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


PHP DateTimeUtil::get_time_start方法代码示例

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


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

示例1: CalendarActivity

 function CalendarActivity($args)
 {
     // if we've passed in an array, then this is a free/busy slot
     // and does not have a sugarbean associated to it
     global $DO_USER_TIME_OFFSET;
     if (is_array($args)) {
         $this->start_time = $args[0];
         $this->end_time = $args[1];
         $this->sugar_bean = null;
         return;
     }
     // else do regular constructor..
     $sugar_bean = $args;
     global $timedate;
     $this->sugar_bean = $sugar_bean;
     if ($sugar_bean->object_name == 'Task') {
         $newdate = $timedate->merge_date_time($this->sugar_bean->date_due, $this->sugar_bean->time_due);
         $tempdate = $timedate->to_db_date($newdate, $DO_USER_TIME_OFFSET);
         if ($newdate != $tempdate) {
             $this->sugar_bean->date_due = $tempdate;
         }
         $temptime = $timedate->to_db_time($newdate, $DO_USER_TIME_OFFSET);
         if ($newdate != $temptime) {
             $this->sugar_bean->time_due = $temptime;
         }
         $this->start_time = DateTimeUtil::get_time_start($this->sugar_bean->date_due, $this->sugar_bean->time_due);
         if (empty($this->start_time)) {
             return null;
         }
         $this->end_time = $this->start_time;
     } else {
         // Convert it back to database time so we can properly manage it for getting the proper start and end dates
         $dbDate = $timedate->to_db($this->sugar_bean->date_start);
         $this->start_time = DateTimeUtil::get_time_start($dbDate);
         $this->end_time = DateTimeUtil::get_time_end($this->start_time, $this->sugar_bean->duration_hours, $this->sugar_bean->duration_minutes);
     }
 }
开发者ID:aldridged,项目名称:gtg-sugar,代码行数:37,代码来源:Calendar.php

示例2: Call

require_once 'modules/Calendar/DateTimeUtil.php';
global $timedate;
$callBean = new Call();
$callQuery = "SELECT * FROM calls where calls.status != 'Held' and calls.deleted=0";
//$callQuery = "SELECT * FROM calls where calls.name like '1' and calls.deleted=0";
$result = $callBean->db->query($callQuery, true, "");
$row = $callBean->db->fetchByAssoc($result);
while ($row != null) {
    $date_time_start = DateTimeUtil::get_time_start($row['date_start']);
    $date_time_end = DateTimeUtil::get_time_end($date_time_start, $row['duration_hours'], $row['duration_minutes']);
    $date_end = gmdate("Y-m-d", $date_time_end->ts);
    $updateQuery = "UPDATE calls set calls.date_end='{$date_end}' where calls.id='{$row['id']}'";
    $call = new Call();
    $call->db->query($updateQuery);
    $row = $callBean->db->fetchByAssoc($result);
}
$meetingBean = new Meeting();
$meetingQuery = "SELECT * FROM meetings where meetings.status != 'Held' and meetings.deleted=0";
//$meetingQuery = "SELECT * FROM meetings where meetings.name like '1' and meetings.deleted=0";
$result = $meetingBean->db->query($meetingQuery, true, "");
$row = $meetingBean->db->fetchByAssoc($result);
while ($row != null) {
    $date_time_start = DateTimeUtil::get_time_start($row['date_start']);
    $date_time_end = DateTimeUtil::get_time_end($date_time_start, $row['duration_hours'], $row['duration_minutes']);
    $date_end = gmdate("Y-m-d", $date_time_end->ts);
    $updateQuery = "UPDATE meetings set meetings.date_end='{$date_end}' where meetings.id='{$row['id']}'";
    $call = new Call();
    $call->db->query($updateQuery);
    $row = $callBean->db->fetchByAssoc($result);
}
echo $mod_strings['LBL_DIAGNOSTIC_DONE'];
开发者ID:aldridged,项目名称:gtg-sugar,代码行数:31,代码来源:RepairActivities.php

示例3: getInvitationHash

 function getInvitationHash(&$focus, $event)
 {
     global $sugar_config;
     global $system_config;
     global $timedate;
     $date_start_in_db_fmt = $timedate->swap_formats($focus->date_start, $timedate->get_date_time_format(true, $current_user), $timedate->get_db_date_time_format());
     $date_start_array = split(" ", trim($date_start_in_db_fmt));
     $date_time_start = DateTimeUtil::get_time_start($date_start_array[0], $date_start_array[1]);
     $date_start_timestamp = mktime($date_time_start->hour, $date_time_start->min, $date_time_start->sec, $date_time_start->month, $date_time_start->day);
     $startDateString = date("d.m.Y", $date_start_timestamp);
     //dd.mm.yyyy
     $startTimeString = date("H:i", $date_start_timestamp);
     $date_end_timestamp = $date_start_timestamp + ($focus->duration_hours * 3600 + $focus->duration_minutes * 60);
     $endDateString = date("d.m.Y", $date_end_timestamp);
     //dd.mm.yyyy
     $endTimeString = date("H:i", $date_end_timestamp);
     /*
     
     echo '<pre>'; 
     
     echo $startDateString;
     echo "\n";
     
     echo $startTimeString;
     echo "\n";
     
     
     echo $date_start_in_db_fmt;
     echo "\n";
     
     echo "endDateString ". $endDateString;
     echo "\n";
     echo "endTimeString ". $endTimeString;
     echo "\n";
     exit();
     
     echo '</pre>';
     */
     if ($focus->online_meeting_url_c == "" && $focus->is_openmeetings_c == true && $_REQUEST['send_invites'] == "1") {
         $_REQUEST['send_invites'] = '0';
         $openmeetings_gateway = new openmeetings_gateway();
         if ($openmeetings_gateway->openmeetings_loginuser()) {
             $admin = new Administration();
             $admin->retrieveSettings();
             //$notify_user = $focus->get_notification_recipients();
             foreach ($focus->users_arr as $user_id) {
                 $notify_user = new User();
                 $notify_user->retrieve($user_id);
                 $notify_user->new_assigned_user_name = $notify_user->full_name;
                 $GLOBALS['log']->info("Notifications: recipient is {$notify_user->new_assigned_user_name}");
                 $invitation_hash = $openmeetings_gateway->getInvitationHash($notify_user->name, $focus->openmeetings_roomid_c, false, "123", 2, $startDateString, $startTimeString, $endDateString, $endTimeString);
                 $notify_user->online_meeting_url_temp = "http://" . $system_config->settings[info_openmeetings_url] . ":" . $system_config->settings[info_openmeetings_http_port] . "/openmeetings/?" . "invitationHash=" . $invitation_hash;
                 //$admin = new Administration();
                 //$admin->retrieveSettings();
                 $focus->send_assignment_notifications($notify_user, $admin);
             }
             foreach ($focus->contacts_arr as $contact_id) {
                 $notify_user = new Contact();
                 $notify_user->retrieve($contact_id);
                 $notify_user->new_assigned_user_name = $notify_user->name;
                 $GLOBALS['log']->info("Notifications: recipient is {$notify_user->new_assigned_user_name}");
                 $invitation_hash = $openmeetings_gateway->getInvitationHash($notify_user->name, $focus->openmeetings_roomid_c, false, "123", 2, $startDateString, $startTimeString, $endDateString, $endTimeString);
                 $notify_user->online_meeting_url_temp = "http://" . $system_config->settings[info_openmeetings_url] . ":" . $system_config->settings[info_openmeetings_http_port] . "/openmeetings/?" . "invitationHash=" . $invitation_hash;
                 //$admin = new Administration();
                 //$admin->retrieveSettings();
                 $focus->send_assignment_notifications($notify_user, $admin);
             }
             foreach ($focus->leads_arr as $lead_id) {
                 $notify_user = new Lead();
                 $notify_user->retrieve($lead_id);
                 $notify_user->new_assigned_user_name = $notify_user->full_name;
                 $GLOBALS['log']->info("Notifications: recipient is {$notify_user->new_assigned_user_name}");
                 $invitation_hash = $openmeetings_gateway->getInvitationHash($notify_user->name, $focus->openmeetings_roomid_c, false, "123", 2, $startDateString, $startTimeString, $endDateString, $endTimeString);
                 $notify_user->online_meeting_url_temp = "http://" . $system_config->settings[info_openmeetings_url] . ":" . $system_config->settings[info_openmeetings_http_port] . "/openmeetings/?" . "invitationHash=" . $invitation_hash;
                 //$admin = new Administration();
                 //$admin->retrieveSettings();
                 $focus->send_assignment_notifications($notify_user, $admin);
             }
         } else {
             echo "Could not login User to OpenMeetings, check your OpenMeetings Module Configuration";
             //exit();
         }
     }
 }
开发者ID:Neseek77,项目名称:openmeetings,代码行数:84,代码来源:openmeetingsRoomManagament.php

示例4: CalendarActivity

 function CalendarActivity($args)
 {
     // if we've passed in an array, then this is a free/busy slot
     // and does not have a sugarbean associated to it
     global $DO_USER_TIME_OFFSET;
     if (is_array($args)) {
         $this->start_time = $args[0];
         $this->end_time = $args[1];
         $this->sugar_bean = null;
         return;
     }
     // else do regular constructor..
     $sugar_bean = $args;
     global $timedate;
     $this->sugar_bean = $sugar_bean;
     if ($sugar_bean->object_name == 'Task') {
         $newdate = $timedate->merge_date_time($this->sugar_bean->date_due, $this->sugar_bean->time_due);
         $tempdate = $timedate->to_db_date($newdate, $DO_USER_TIME_OFFSET);
         if ($newdate != $tempdate) {
             $this->sugar_bean->date_due = $tempdate;
         }
         $temptime = $timedate->to_db_time($newdate, $DO_USER_TIME_OFFSET);
         if ($newdate != $temptime) {
             $this->sugar_bean->time_due = $temptime;
         }
         $this->start_time = DateTimeUtil::get_time_start($this->sugar_bean->date_due, $this->sugar_bean->time_due);
         if (empty($this->start_time)) {
             return null;
         }
         $this->end_time = $this->start_time;
     } else {
         $newdate = $timedate->merge_date_time($this->sugar_bean->date_start, $this->sugar_bean->time_start);
         //Modify by jchi 6/27/2008 1515pm china time , bug 20626.
         $temptime = $timedate->to_db_time($newdate, $DO_USER_TIME_OFFSET);
         if ($newdate != $temptime) {
             $this->sugar_bean->time_start = $temptime;
         }
         $this->start_time = DateTimeUtil::get_time_start($timedate->to_db_date($this->sugar_bean->date_start, $DO_USER_TIME_OFFSET), $this->sugar_bean->time_start);
         $this->end_time = DateTimeUtil::get_time_end($this->start_time, $this->sugar_bean->duration_hours, $this->sugar_bean->duration_minutes);
     }
 }
开发者ID:nerdystudmuffin,项目名称:dashlet-subpanels,代码行数:41,代码来源:Calendar.php

示例5: save

 function save($check_notify = FALSE)
 {
     require_once 'modules/Calendar/DateTimeUtil.php';
     global $timedate;
     global $current_user;
     global $disable_date_format;
     if (isset($this->date_start) && isset($this->duration_hours) && isset($this->duration_minutes)) {
         $date_time_start = DateTimeUtil::get_time_start($this->date_start);
         $date_time_end = DateTimeUtil::get_time_end($date_time_start, $this->duration_hours, $this->duration_minutes);
         $this->date_end = gmdate("Y-m-d", $date_time_end->ts);
     }
     $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');
     		}*/
     if (empty($this->status)) {
         $mod_strings = return_module_language($GLOBALS['current_language'], $this->module_dir);
         $this->status = $mod_strings['LBL_DEFAULT_STATUS'];
     }
     $return_id = parent::save($check_notify);
     if ($this->update_vcal) {
         vCal::cache_sugar_vcal($current_user);
     }
     return $return_id;
 }
开发者ID:aldridged,项目名称:gtg-sugar,代码行数:41,代码来源:Meeting.php

示例6: GoogleCalls

 function GoogleCalls(&$bean, $event, $arguments)
 {
     echo "<br>aa " . $bean->id;
     echo "<br>aa " . $bean->name;
     echo "<br>sess delete " . $_SESSION["mass_upd_assigned"];
     echo "<br>sess delete" . $_REQUEST["massupdate"];
     echo "<br>";
     $okev = true;
     $_SESSION["mass_upd_assigned"] = false;
     if (isset($_REQUEST["massupdate"])) {
         if ($_REQUEST["massupdate"] == true) {
             $okev = false;
             if ($_REQUEST['assigned_user_id'] != "" or $_REQUEST['date_start'] != "") {
                 $okev = true;
             }
             if ($_REQUEST['assigned_user_id'] != "") {
                 $_SESSION["mass_upd_assigned"] = true;
             }
         }
     }
     if ($okev == true) {
         if ($_SESSION["called_from_sync"] == false or $_SESSION["called_from_sync"] == "") {
             ### skip if called from sync.php logic hook
             echo "<br>delete from sugar logic hook ";
             global $timedate;
             $offset_val = ".000+02:00";
             $td = new TimeDate();
             echo "<br>old bean id " . $bean->id;
             echo "<br>old bean name " . $bean->name;
             echo "<br>tablename ";
             $tablename = $bean->table_name;
             $a = $response['list'][$tn1];
             $s = array();
             $s["title"] = $bean->name;
             if ($tablename == 'meetings') {
                 $s["title"] = "Meeting: " . $s["title"];
             }
             if ($tablename == 'calls') {
                 $s["title"] = "Call: " . $s["title"];
             }
             if ($tablename == 'tasks') {
                 $s["title"] = "Task: " . $s["title"];
             }
             echo "<br>bean date start " . $bean->date_start;
             $s["content"] = $bean->description;
             $s["where"] = $bean->location;
             $s["startDay"] = $bean->date_start;
             $s["startTime"] = $bean->time_start;
             $s["endDay"] = $bean->date_end;
             $s["reminder_time"] = $bean->reminder_time / 60;
             if ($s["reminder_time"] == '' or $s["reminder_time"] == 0) {
                 $s["reminder_time"] = 10;
             }
             if ($bean->date_start == '' and $bean->date_due != "") {
                 $s["startDay"] = $bean->date_due;
                 #### for tasks if no start date
             } else {
                 $s["startDay"] = $bean->date_start;
             }
             #   print_r($s);
             global $current_user;
             $pd = $s["startDay"];
             ####260608
             #$pd= $td->handle_offset($td->get_date_time_format(true, $current_user), $td->get_date_time_format(true, $current_user), false,$current_user);
             $date_start_in_db_fmt = $td->swap_formats($s["startDay"], $td->get_date_time_format(true, $current_user), $td->get_db_date_time_format());
             $date_end_in_db_fmt1 = $td->swap_formats($bean->date_due, $td->get_date_time_format(true, $current_user), $td->get_db_date_time_format());
             $date_start_array = split(" ", trim($date_start_in_db_fmt));
             $date_time_start = DateTimeUtil::get_time_start($date_start_array[0], $date_start_array[1]);
             $tt1 = $td->to_display_date_time($bean->date_start, true, true, false);
             $user = $current_user;
             $s["startTime"] = $td->handle_offset($date_start_in_db_fmt, "H:i:s", false, $current_user);
             $date_end_in_db_fmt1 = $td->handle_offset($date_end_in_db_fmt1, "Y-m-d H:i:s", false, $current_user);
             echo "<br>bean date start1 " . $s["startTime"];
             ##260806 $s["startTime"]=$date_start_array[1];
             echo "<br>bean date start2 " . $s["startTime"];
             $ch = explode(" ", $s["startDay"]);
             if ($ch['1'] == "00:00" or $ch['1'] == "00.00") {
                 #### 120608 bogdan if task and 12:00 goes to next day $s["startDay"]  = $td->handle_offset($date_start_in_db_fmt, "Y-m-d", false,$current_user);
                 $s["startDay"] = $td->handle_offset($date_start_in_db_fmt, "Y-m-d", false, $current_user);
                 $s["startDay1"] = $td->handle_offset($date_start_in_db_fmt, "Y-m-d H:i:s", false, $current_user);
             } else {
                 $s["startDay"] = $td->handle_offset($date_start_in_db_fmt, "Y-m-d", false, $current_user);
                 $s["startDay1"] = $td->handle_offset($date_start_in_db_fmt, "Y-m-d H:i:s", false, $current_user);
             }
             $plugin_format = "d/m/Y H:i";
             if ($td->get_date_time_format(true, $current_user) != $plugin_format) {
                 ##260608 $plugin_date_start=$td->swap_formats($pd, $td->get_date_time_format(true, $current_user),  $plugin_format);
                 $plugin_date_due = $td->swap_formats($bean->date_due, $td->get_date_time_format(true, $current_user), $plugin_format);
             } else {
                 ##260608  $plugin_date_start=$pd;
                 $plugin_date_due = $bean->date_due;
             }
             $plugin_date_start = $td->swap_formats($s["startDay1"], "Y-m-d H:i:s", $plugin_format);
             $plugin_date_due1 = $td->swap_formats($date_end_in_db_fmt1, "Y-m-d H:i:s", $plugin_format);
             echo "<br>plg date start " . $plugin_date_start;
             #################################################
             $d1 = explode("/", $plugin_date_start);
             global $current_user;
             $d1[2] = explode(" ", $d1[2]);
             $d1[2] = $d1[2][0];
//.........这里部分代码省略.........
开发者ID:Terradex,项目名称:sugar,代码行数:101,代码来源:before_delete_google.php

示例7: GoogleCalls

 function GoogleCalls(&$bean, $event, $arguments)
 {
     $okev = true;
     $_SESSION["mass_upd_assigned"] = false;
     if (isset($_REQUEST["massupdate"])) {
         if ($_REQUEST["massupdate"] == true) {
             $okev = false;
             if ($_REQUEST['assigned_user_id'] != "" or $_REQUEST['date_start'] != "") {
                 $okev = true;
             }
             if ($_REQUEST['assigned_user_id'] != "") {
                 $_SESSION["mass_upd_assigned"] = true;
             }
         }
     }
     if ($okev == true) {
         if ($_SESSION["called_from_sync"] == false or $_SESSION["called_from_sync"] == "") {
             ### skip if called from sync.php logic hook
             global $timedate;
             $offset_val = ".000+02:00";
             $td = new TimeDate();
             $tablename = $bean->table_name;
             $a = $response['list'][$tn1];
             $s = array();
             #  echo "<br>**********Event ******* id=$a[id] ***** name=$a[name]";
             $s["title"] = $bean->name;
             if ($tablename == 'meetings') {
                 $s["title"] = "Meeting: " . $s["title"];
             }
             if ($tablename == 'calls') {
                 $s["title"] = "Call: " . $s["title"];
             }
             if ($tablename == 'tasks') {
                 $s["title"] = "Task: " . $s["title"];
             }
             $s["content"] = $bean->description;
             $s["where"] = $bean->location;
             $s["startDay"] = $bean->date_start;
             $s["startTime"] = $bean->time_start;
             $s["endDay"] = $bean->date_end;
             $s["reminder_time"] = $bean->reminder_time / 60;
             if ($s["reminder_time"] == '' or $s["reminder_time"] == 0) {
                 $s["reminder_time"] = 10;
             }
             if ($bean->date_start == '' and $bean->date_due != "") {
                 $s["startDay"] = $bean->date_due;
                 #### for tasks if no start date
             } else {
                 $s["startDay"] = $bean->date_start;
             }
             #   print_r($s);
             global $current_user;
             $pd = $s["startDay"];
             ####260608
             #$pd= $td->handle_offset($td->get_date_time_format(true, $current_user), $td->get_date_time_format(true, $current_user), false,$current_user);
             $date_start_in_db_fmt = $td->swap_formats($s["startDay"], $td->get_date_time_format(true, $current_user), $td->get_db_date_time_format());
             $date_end_in_db_fmt1 = $td->swap_formats($bean->date_due, $td->get_date_time_format(true, $current_user), $td->get_db_date_time_format());
             $date_start_array = split(" ", trim($date_start_in_db_fmt));
             $date_time_start = DateTimeUtil::get_time_start($date_start_array[0], $date_start_array[1]);
             $tt1 = $td->to_display_date_time($bean->date_start, true, true, false);
             $user = $current_user;
             $s["startTime"] = $td->handle_offset($date_start_in_db_fmt, "H:i:s", false, $current_user);
             $date_end_in_db_fmt1 = $td->handle_offset($date_end_in_db_fmt1, "Y-m-d H:i:s", false, $current_user);
             ###### problem with offset ... if record is at 23.15 gmt +2 .. date problem
             $ch = explode(" ", $s["startDay"]);
             if ($ch['1'] == "00:00" or $ch['1'] == "00.00") {
                 #### 120608 bogdan if task and 12:00 goes to next day $s["startDay"]  = $td->handle_offset($date_start_in_db_fmt, "Y-m-d", false,$current_user);
                 $s["startDay"] = $td->handle_offset($date_start_in_db_fmt, "Y-m-d", false, $current_user);
                 $s["startDay1"] = $td->handle_offset($date_start_in_db_fmt, "Y-m-d H:i:s", false, $current_user);
             } else {
                 $s["startDay"] = $td->handle_offset($date_start_in_db_fmt, "Y-m-d", false, $current_user);
                 $s["startDay1"] = $td->handle_offset($date_start_in_db_fmt, "Y-m-d H:i:s", false, $current_user);
             }
             $plugin_format = "d/m/Y H:i";
             if ($td->get_date_time_format(true, $current_user) != $plugin_format) {
                 ##260608 $plugin_date_start=$td->swap_formats($pd, $td->get_date_time_format(true, $current_user),  $plugin_format);
                 $plugin_date_due = $td->swap_formats($bean->date_due, $td->get_date_time_format(true, $current_user), $plugin_format);
             } else {
                 ##260608  $plugin_date_start=$pd;
                 $plugin_date_due = $bean->date_due;
             }
             $plugin_date_start = $td->swap_formats($s["startDay1"], "Y-m-d H:i:s", $plugin_format);
             $plugin_date_due1 = $td->swap_formats($date_end_in_db_fmt1, "Y-m-d H:i:s", $plugin_format);
             #################################################
             $d1 = explode("/", $plugin_date_start);
             global $current_user;
             $d1[2] = explode(" ", $d1[2]);
             $d1[2] = $d1[2][0];
             if ($bean->time_start != '' and 1 == 2) {
                 $t1 = explode(":", $bean->time_start);
             } else {
                 $fort1 = explode(" ", $plugin_date_start);
                 $fort1 = $fort1[1];
                 $t1 = explode(":", $fort1);
             }
             $t1[1] = round($t1[1]);
             $untill = mktime($t1[0] + $bean->duration_hours, $t1[1] + $bean->duration_minutes, $t1[2], $d1[1], $d1[0], $d1[2]);
             if ($tablename == 'tasks') {
                 if ($plugin_date_due == "" or $bean->date_due == "") {
                     $forexp = $plugin_date_start;
//.........这里部分代码省略.........
开发者ID:Terradex,项目名称:sugar,代码行数:101,代码来源:google_calendar_plg.php

示例8: save

 function save($check_notify = FALSE)
 {
     require_once 'modules/Calendar/DateTimeUtil.php';
     global $timedate, $current_user;
     global $disable_date_format;
     if (isset($this->date_start) && isset($this->duration_hours) && isset($this->duration_minutes)) {
         $date_start_in_db_fmt = $timedate->swap_formats($this->date_start, $timedate->get_date_time_format(true, $current_user), $timedate->get_db_date_time_format());
         $date_start_array = split(" ", trim($date_start_in_db_fmt));
         $date_time_start = DateTimeUtil::get_time_start($date_start_array[0], $date_start_array[1]);
         $date_start_timestamp = mktime($date_time_start->hour, $date_time_start->min, $date_time_start->sec, $date_time_start->month, $date_time_start->day);
         $date_start_timestamp += $this->duration_hours * 3600 + $this->duration_minutes * 60;
         $this->date_end = date($timedate->get_date_time_format(true, $current_user), $date_start_timestamp);
         // Need to convert it to the db date right here so that we don't miss the time calculation
         $this->date_end = $timedate->to_db_date($this->date_end);
         if (empty($disable_date_format)) {
             $this->date_end = $timedate->swap_formats($this->date_end, $timedate->dbDayFormat, $timedate->get_date_format());
         }
     }
     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;
             $check_notify = true;
             if (isset($_REQUEST['assigned_user_name'])) {
                 $this->new_assigned_user_name = $_REQUEST['assigned_user_name'];
             }
         }
     }
     if (empty($this->status)) {
         $mod_strings = return_module_language($GLOBALS['current_language'], $this->module_dir);
         $this->status = $mod_strings['LBL_DEFAULT_STATUS'];
     }
     /*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');
     		}*/
     parent::save($check_notify);
     global $current_user;
     if ($this->update_vcal) {
         vCal::cache_sugar_vcal($current_user);
     }
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:52,代码来源:Call.php

示例9: save

 function save($check_notify = FALSE)
 {
     global $timedate;
     if (isset($this->date_start) && isset($this->time_start) && isset($this->duration_hours) && isset($this->duration_minutes)) {
         $date_time_start = DateTimeUtil::get_time_start($timedate->to_db_date($this->date_start, false), $this->time_start . ":00");
         $date_time_end = DateTimeUtil::get_time_end($date_time_start, $this->duration_hours, $this->duration_minutes);
         $this->date_end = $timedate->to_display_date("{$date_time_end->year}-{$date_time_end->month}-{$date_time_end->day}");
     }
     if (!empty($_REQUEST['send_invites']) && $_REQUEST['send_invites'] == '1') {
         $check_notify = true;
     } else {
         $check_notify = false;
     }
     parent::save($check_notify);
     global $current_user;
     require_once 'modules/vCals/vCal.php';
     if ($this->update_vcal) {
         vCal::cache_sugar_vcal($current_user);
     }
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:20,代码来源:Call.php


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