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


PHP Calendar::add_activities方法代码示例

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


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

示例1: display

 function display()
 {
     ob_start();
     if (isset($GLOBALS['cal_strings'])) {
         return parent::display() . "Only one Calendar dashlet is allowed.";
     }
     require_once 'modules/Calendar/Calendar.php';
     require_once 'modules/Calendar/CalendarDisplay.php';
     require_once "modules/Calendar/CalendarGrid.php";
     global $cal_strings, $current_language;
     $cal_strings = return_module_language($current_language, 'Calendar');
     if (!ACLController::checkAccess('Calendar', 'list', true)) {
         ACLController::displayNoAccess(true);
     }
     $cal = new Calendar($this->view);
     $cal->dashlet = true;
     $cal->add_activities($GLOBALS['current_user']);
     $cal->load_activities();
     $display = new CalendarDisplay($cal, $this->id);
     $display->display_calendar_header(false);
     $display->display();
     $str = ob_get_contents();
     ob_end_clean();
     return parent::display() . $str;
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:25,代码来源:CalendarDashlet.php

示例2: display

 function display()
 {
     $smarty = new Sugar_Smarty();
     parent::display();
     $db = DBManagerFactory::getInstance();
     //$myquery = 'SELECT tab4.first_name fname, tab4.last_name lname,  tab5.mrn_c mrn, tab4.id patid, tab5.location_c location, tab5.active_c active, ( SELECT tab1.reg_patient_reg_encounterreg_encounter_idb enclink  FROM reg_patient_reg_encounter_c tab1 WHERE  tab1.reg_patient_reg_encounterreg_patient_ida = patid AND tab1.date_modified = (SELECT max( date_modified ) dat FROM reg_patient_reg_encounter_c enc1 WHERE  enc1.reg_patient_reg_encounterreg_patient_ida = patid) )  enclink, ( SELECT DATE_FORMAT(tab3.next_rx_refill_due_c,"%m/%d/%Y") ref1 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink )  refill,  ( SELECT DATE_FORMAT(tab3.last_uts_c,"%m/%d/%Y") uts1 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink ) last_uts , ( SELECT DATE_FORMAT(tab3.next_uts_due_c,"%m/%d/%Y") uts11 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink )  uts ,  (SELECT DATE_FORMAT(tab3.next_pcp_visit_c,"%m/%d/%Y") pcp11 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink )  next_pcp,  (SELECT p1b.name provname  from reg_provider p1b, reg_provider_reg_patient_c p2b  WHERE p2b.reg_provider_reg_patientreg_provider_ida = p1b.id  AND p2b.reg_provider_reg_patientreg_patient_idb = patid) provname, ( SELECT risklvl_c risk1 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink )  risk FROM reg_patient tab4, reg_patient_cstm tab5, reg_patient_reg_encounter_c tab1, ( SELECT max( date_modified ) dat, reg_patient_reg_encounterreg_patient_ida pat FROM reg_patient_reg_encounter_c GROUP BY reg_patient_reg_encounterreg_patient_ida) tab2, reg_encounter_cstm tab3 WHERE  tab5.id_c = tab4.id  AND tab1.date_modified = tab2.dat AND tab1.reg_patient_reg_encounterreg_patient_ida = tab2.pat AND tab3.id_c = tab1.reg_patient_reg_encounterreg_encounter_idb  AND tab4.id = tab2.pat';
     $myquery = 'SELECT tab4.first_name fname, tab4.last_name lname,  tab5.mrn_c mrn, tab4.id patid, tab5.location_c location, tab5.active_c active, ( SELECT tab1.reg_patient_reg_encounterreg_encounter_idb enclink  FROM reg_patient_reg_encounter_c tab1 WHERE  tab1.reg_patient_reg_encounterreg_patient_ida = patid AND tab1.date_modified = (SELECT max( date_modified ) dat FROM reg_patient_reg_encounter_c enc1 WHERE  enc1.reg_patient_reg_encounterreg_patient_ida = patid) )  enclink, ( SELECT DATE_FORMAT(tab3.next_rx_refill_due_c,"%m/%d/%Y") ref1 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink )  refill,  ( SELECT DATE_FORMAT(tab3.last_uts_c,"%m/%d/%Y") uts1 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink ) last_uts , ( SELECT DATE_FORMAT(tab3.next_uts_due_c,"%m/%d/%Y") uts11 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink )  uts ,  (SELECT DATE_FORMAT(tab3.next_pcp_visit_c,"%m/%d/%Y") pcp11 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink )  next_pcp,  (SELECT p1b.name provname  from reg_provider p1b, reg_provider_reg_patient_c p2b  WHERE p2b.reg_provider_reg_patientreg_provider_ida = p1b.id  AND p2b.reg_provider_reg_patientreg_patient_idb = patid) provname, ( SELECT risklvl_c risk1 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink )  risk FROM reg_patient tab4, reg_patient_cstm tab5 WHERE  tab5.id_c = tab4.id ';
     $result = $db->query($myquery);
     $mydata = null;
     while ($row = $db->fetchRow($result)) {
         $mydata[] = $row;
     }
     global $cal_strings, $current_language;
     $cal_strings = return_module_language($current_language, 'Calendar');
     if (empty($_REQUEST['view'])) {
         $_REQUEST['view'] = SugarConfig::getInstance()->get('calendar.default_view', 'week');
     }
     $cal = new Calendar($_REQUEST['view']);
     if (in_array($cal->view, array('day', 'week', 'month'))) {
         $cal->add_activities($GLOBALS['current_user']);
     } else {
         if ($cal->view == 'shared') {
             $cal->init_shared();
             global $shared_user;
             $shared_user = new User();
             foreach ($cal->shared_ids as $member) {
                 $shared_user->retrieve($member);
                 $cal->add_activities($shared_user);
             }
         }
     }
     if (in_array($cal->view, array("day", "week", "month", "shared"))) {
         $cal->load_activities();
     }
     if (!empty($_REQUEST['print']) && $_REQUEST['print'] == 'true') {
         $cal->setPrint(true);
     }
     $display = new CalendarDisplay($cal);
     $smarty->assign("mydata", $mydata);
     echo "<table><tr><td>";
     $smarty->display($this->lv->tpl);
     echo "</td>";
     echo "<td style='width:100%;vertical-align:top'>";
     $caltest = new caltest();
     $caltest->test();
     echo "</td></tr></table>";
 }
开发者ID:apikck,项目名称:REG_Patient,代码行数:47,代码来源:view.toplist.php

示例3: test

 public function test()
 {
     global $cal_strings, $current_language;
     $cal_strings = return_module_language($current_language, 'Calendar');
     if (empty($_REQUEST['view'])) {
         $_REQUEST['view'] = SugarConfig::getInstance()->get('calendar.default_view', 'week');
     }
     $cal = new Calendar($_REQUEST['view']);
     if (in_array($cal->view, array('day', 'week', 'month'))) {
         $cal->add_activities($GLOBALS['current_user']);
     } else {
         if ($cal->view == 'shared') {
             $cal->init_shared();
             global $shared_user;
             $shared_user = new User();
             foreach ($cal->shared_ids as $member) {
                 $shared_user->retrieve($member);
                 $cal->add_activities($shared_user);
             }
         }
     }
     if (in_array($cal->view, array("day", "week", "month", "shared"))) {
         $cal->load_activities();
     }
     if (!empty($_REQUEST['print']) && $_REQUEST['print'] == 'true') {
         $cal->setPrint(true);
     }
     /*
     $_REQUEST['year']='2014';
     $_REQUEST['month']='12';
     $_REQUEST['day']='8';*/
     //var_dump($_REQUEST);
     $display = new CalendarDisplay($cal);
     echo "<div style='width:448px'>";
     $display->display_calendar_header(false);
     $display->display();
     echo "</div>";
 }
开发者ID:apikck,项目名称:REG_Patient,代码行数:38,代码来源:caltest.php

示例4: testCalendarLoadActivities

 public function testCalendarLoadActivities()
 {
     $cal = new Calendar('month');
     $cal->add_activities($GLOBALS['current_user']);
     $format = $GLOBALS['current_user']->getUserDateTimePreferences();
     $meeting = new Meeting();
     $meeting->meeting_id = uniqid();
     $meeting->date_start = $this->time_date->swap_formats("2012-01-01 11:00pm", 'Y-m-d h:ia', $format['date'] . ' ' . $format['time']);
     $meeting->name = "test";
     $cal->acts_arr = array();
     $cal->acts_arr[$GLOBALS['current_user']->id] = array();
     $cal->acts_arr[$GLOBALS['current_user']->id][] = new CalendarActivity($meeting);
     $cal->load_activities();
     $this->assertEquals($cal->items[0]['time_start'], $this->time_date->swap_formats("2012-01-01 11:00pm", 'Y-m-d h:ia', $format['time']), "Time should remain the same after load_activities");
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:15,代码来源:CalendarTest.php

示例5: action_getActivities

 protected function action_getActivities()
 {
     $this->view = 'json';
     if (!ACLController::checkAccess('Calendar', 'list', true)) {
         ACLController::displayNoAccess(true);
     }
     require_once 'modules/Calendar/Calendar.php';
     $cal = new Calendar($_REQUEST['view']);
     if (in_array($cal->view, array('day', 'week', 'month'))) {
         $cal->add_activities($GLOBALS['current_user']);
     } else {
         if ($cal->view == 'shared') {
             $cal->init_shared();
             $sharedUser = new User();
             foreach ($cal->shared_ids as $member) {
                 $sharedUser->retrieve($member);
                 $cal->add_activities($sharedUser);
             }
         }
     }
     $cal->load_activities();
     $this->view_object_map['jsonData'] = $cal->items;
 }
开发者ID:omusico,项目名称:sugar_work,代码行数:23,代码来源:controller.php

示例6: Calendar

if (empty($_REQUEST['view'])) {
    if (isset($_SESSION['CALENDAR_VIEW']) && in_array($_SESSION['CALENDAR_VIEW'], $views)) {
        $_REQUEST['view'] = $_SESSION['CALENDAR_VIEW'];
    } else {
        $_REQUEST['view'] = SugarConfig::getInstance()->get('calendar.default_view', 'week');
    }
}
$_SESSION['CALENDAR_VIEW'] = $_REQUEST['view'];
$cal = new Calendar($_REQUEST['view'], array(), $views);
if ($cal->view == "sharedMonth" || $cal->view == "sharedWeek") {
    $cal->init_shared();
    global $shared_user;
    $shared_user = new User();
    foreach ($cal->shared_ids as $member) {
        $shared_user->retrieve($member);
        $cal->add_activities($shared_user);
    }
} else {
    if (array_key_exists($cal->view, $views)) {
        $cal->add_activities($GLOBALS['current_user']);
    }
}
if (array_key_exists($cal->view, $views)) {
    $cal->load_activities();
}
if (!empty($_REQUEST['print']) && $_REQUEST['print'] == 'true') {
    $cal->setPrint(true);
}
$display = new CalendarDisplay($cal, "", $views);
$display->display_title();
if ($cal->view == "sharedMonth" || $cal->view == "sharedWeek") {
开发者ID:recci,项目名称:SuiteCRM,代码行数:31,代码来源:index.php

示例7: template_shared_calendar

function template_shared_calendar(&$args)
{
    global $current_user;
    global $app_strings;
    global $mod_strings;
    $date_arr = array("activity_focus" => $args['activity_focus']);
    $calendar = new Calendar("day", $date_arr);
    $calendar->show_tasks = false;
    $calendar->toggle_appt = false;
    foreach ($args['users'] as $user) {
        /*
        	if ($user->id != $current_user->id)
        	{
        */
        $calendar->add_activities($user, 'vfb');
        /*
        	}
        */
    }
    ?>
<p>

<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td><h5 class="listViewSubHeadS1"><?php 
    echo $mod_strings['LBL_USER_CALENDARS'];
    ?>
</h5>
</td>
<td align=right>
<h5 class="listViewSubHeadS1"><?php 
    template_echo_date_info("day", $calendar->date_time);
    ?>
</h5>
</td></tr></table>
<table cellpadding="0" cellspacing="0" width="100%" border="0" class="listView">
        <tr height="20">
        <td scope="col" width="25%" class="listViewThS1"><?php 
    echo $app_strings['LBL_LIST_NAME'];
    ?>
</td>
<?php 
    $start_slice_idx = $calendar->get_start_slice_idx();
    $end_slice_idx = $calendar->get_end_slice_idx();
    $cur_slice_idx = 1;
    $slice_args = array();
    for ($cur_slice_idx = $start_slice_idx; $cur_slice_idx <= $end_slice_idx; $cur_slice_idx++) {
        $slice_args['slice'] = $calendar->slice_hash[$calendar->slices_arr[$cur_slice_idx]];
        $slice_args['calendar'] = $calendar;
        //print_r($cur_time);
        ?>
	<td class="listViewThS1"><?php 
        template_echo_slice_date($slice_args);
        ?>
</td>
<?php 
    }
    ?>
        </tr>
<?php 
    global $hilite_bg, $click_bg, $odd_bg, $even_bg;
    $oddRow = true;
    foreach ($args['users'] as $curr_user) {
        if ($oddRow) {
            $bg_color = $odd_bg;
            $row_class = 'oddListRowS1';
        } else {
            $bg_color = $even_bg;
            $row_class = 'evenListRowS1';
        }
        $oddRow = !$oddRow;
        ?>
<tr height="20"> 
<td scope="row" valign=TOP  class="<?php 
        echo $row_class;
        ?>
" bgcolor="<?php 
        echo $bg_color;
        ?>
"><a href="index.php?action=DetailView&module=Users&record=<?php 
        echo $curr_user->id;
        ?>
" class="listViewTdLinkS1">
<?php 
        echo $curr_user->full_name;
        ?>
</a></td>
<?php 
        // loop through each slice for this user and show free/busy
        for ($cur_slice_idx = $start_slice_idx; $cur_slice_idx <= $end_slice_idx; $cur_slice_idx++) {
            $cur_slice = $calendar->slice_hash[$calendar->slices_arr[$cur_slice_idx]];
            // if this current activitiy occurs within this time slice
            if (Calendar::occurs_within_slice($cur_slice, $calendar->activity_focus)) {
                /*
                		$got_conflict = 0;
                		if ( isset($cur_slice->acts_arr[$curr_user->id]) )
                		{
                			foreach( $cur_slice->acts_arr[$curr_user->id] as $act)
                			{
                				if ($act->sugar_bean->id != $calendar->activity_focus->sugar_bean->id)
                				{
                					$got_conflict = 1;
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:101,代码来源:template_shared_calendar.php


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