source: sandbox/2.3-MailArchiver/calendar/js/dhtmlx/samples/02_customization/shared_events/user_1_combined.html @ 6779

Revision 6779, 2.8 KB checked in by rafaelraymundo, 12 years ago (diff)

Ticket #2946 - Liberado Expresso(branch 2.3) integrado ao MailArchiver?.

Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<head>
4        <meta http-equiv="Content-type" content="text/html; charset=utf-8">
5        <title></title>
6</head>
7        <script src="../../../codebase/dhtmlxscheduler.js" type="text/javascript" charset="utf-8"></script>
8        <link rel="stylesheet" href="../../../codebase/dhtmlxscheduler.css" type="text/css" title="no title" charset="utf-8">
9
10       
11<style type="text/css" media="screen">
12        html, body{
13                margin:0px;
14                padding:0px;
15                height:100%;
16                overflow:hidden;
17        }       
18    /*event in day or week view*/
19        .dhx_cal_event.user_2 div{
20                background-color:#FF8040 !important;
21                color:white !important;
22        }
23    /*multi-day event in month view*/
24        .dhx_cal_event_line.user_2{
25                background-color:#FF8040 !important;
26                color:white !important;
27        }
28    /*event with fixed time, in month view*/
29        .dhx_cal_event_clear.user_2{
30                color:#FF8040 !important;
31        }       
32</style>
33
34
35<script type="text/javascript" charset="utf-8">
36        function init() {
37                scheduler.config.xml_date="%Y-%m-%d %H:%i";
38                scheduler.config.first_hour=6;
39                scheduler.config.prevent_cache = true;
40               
41                scheduler.init('scheduler_here',new Date(2009,5,1),"month");
42               
43                scheduler.load("events.php?user=1");
44                scheduler.load("events_shared.php?user=2");
45               
46                var dp = new dataProcessor("events.php?user=1");
47                dp.init(scheduler);
48               
49               
50                //coloring for different users
51                scheduler.templates.event_bar_text=scheduler.templates.event_text=function(start,end,event){
52                        return "["+event.userId+"] "+event.text;
53                }
54                scheduler.templates.event_class=function(start,end,event){
55                   if (event.userId==2)
56                  return "user_2";
57                }
58               
59                //allow edit operations only for own events
60                function allow_own(id){
61                        var ev = this.getEvent(id);
62                        return ev.userId == 1;
63                }
64                scheduler.attachEvent("onClick",allow_own);
65                scheduler.attachEvent("onDblClick",allow_own);
66
67                //default properties of new event
68                scheduler.attachEvent("onEventCreated",function(id){
69                        var ev = this.getEvent(id);
70                        ev.userId = 1; //just for rendering on client, will not affect server data
71                        ev.event_type = 0; //private event by default
72                });
73               
74        }
75</script>
76
77<body onload="init();">
78        <div id="scheduler_here" class="dhx_cal_container" style='width:100%; height:100%;'>
79                <div class="dhx_cal_navline">
80                        <div class="dhx_cal_prev_button">&nbsp;</div>
81                        <div class="dhx_cal_next_button">&nbsp;</div>
82                        <div class="dhx_cal_today_button"></div>
83                        <div class="dhx_cal_date"></div>
84                        <div class="dhx_cal_tab" name="day_tab" style="right:204px;"></div>
85                        <div class="dhx_cal_tab" name="week_tab" style="right:140px;"></div>
86                        <div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div>
87                </div>
88                <div class="dhx_cal_header">
89                </div>
90                <div class="dhx_cal_data">
91                </div>         
92        </div>
93</body>
Note: See TracBrowser for help on using the repository browser.