-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathweekly_Radiology.html
More file actions
165 lines (145 loc) · 6.91 KB
/
Copy pathweekly_Radiology.html
File metadata and controls
165 lines (145 loc) · 6.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!-- Ext and ux styles -->
<link href="/ExtScheduler/weekview/resources/css/theme-triton/resources/theme-triton-all.css" rel="stylesheet" type="text/css"/>
<!--<link href="/ExtScheduler/css/theme-triton-all.css" rel="stylesheet" type="text/css"/>-->
<!-- Scheduler styles -->
<link href="/ExtScheduler/weekview/resources/css/sch-all-triton.css?ver=4.2.1" rel="stylesheet" type="text/css" />
<!--<link href="/ExtScheduler/css/sch-all-triton.css" rel="stylesheet" type="text/css" />-->
<!-- Ext JS includes -->
<script src="/ExtScheduler/resources/extJs/ext-all.js" type="text/javascript" nonce="<%=scriptNonce%>"></script>
<!--<script src="/ExtScheduler/js/ext-all-debug.js" type="text/javascript" nonce="<%=scriptNonce%>"></script>-->
<script src="/ExtScheduler/weekview/resources/css/theme-triton/theme-triton.js" crossorigin="anonymous" type="text/javascript" nonce="<%=scriptNonce%>"></script>
<!--<script src="/ExtScheduler/js/theme-triton-debug.js" crossorigin="anonymous" type="text/javascript" nonce="<%=scriptNonce%>"></script>-->
<!-- Scheduler files -->
<script src="/ExtScheduler/resources/extJs/sch-all.js?ver=4.2.1" type="text/javascript" nonce="<%=scriptNonce%>"></script>
<!--<script src="/ExtScheduler/js/sch-all-debug.js" type="text/javascript" nonce="<%=scriptNonce%>"></script>-->
<title>Scheduler Week View</title>
</head>
<body>
<script type="text/javascript" nonce="<%=scriptNonce%>">
Ext.onReady(function ()
{
var initScheduler = function()
{
Ext.application({
name : 'App',
mainView : 'App.view.Viewport',
paths : {
'App': LABKEY.contextPath + '/extscheduler/App'
},
views : [
'EventForm',
'Header',
'InfoPanel',
'NavigationBar',
'ResourceCombo',
'Resources',
'Scheduler_Radiology',
'Viewport'
]
});
};
var queryStoreData = function()
{
var resourceStore = null, eventStore = null, userStore = null;
// query to get the resource store data
LABKEY.Query.selectRows({
schemaName: 'extscheduler',
queryName: 'Resources',
columns: 'Id,Name,Color,Room,Bldg',
success: function(data) {
resourceStore = Ext.create('Sch.data.ResourceStore', {
model : 'Sch.model.Resource',
storeId : 'resource', // referenced by this store id in Scheduler.js, ResourceCombo.js, etc.
sorters : {
property : 'Name',
direction : "ASC"
},
data: data.rows
});
// only initialize the scheduler when all stores have loaded
if (eventStore != null && userStore != null) {
initScheduler();
}
}
});
// query to get the event store data
LABKEY.Query.selectRows({
schemaName: 'extscheduler',
queryName: 'Events',
columns: 'Id,ResourceId,Name,StartDate,EndDate,UserId,Alias,Owner,Comments,Quantity',
success: function(data){
// need to convert the date fields from a string to JS Date object
Ext.each(data.rows, function(row){
row.StartDate = new Date(row.StartDate);
row.EndDate = new Date(row.EndDate);
});
eventStore = Ext.create('Sch.data.EventStore', {
model : 'Sch.model.Event',
storeId : 'event', // referenced by this store id in Scheduler.js, etc.
data : data.rows
});
// only initialize the scheduler when all stores have loaded
if (resourceStore != null && userStore != null) {
initScheduler();
}
}
});
// query to get the Ext Scheduler users store data
LABKEY.Ajax.request({
url: LABKEY.ActionURL.buildURL('extscheduler', 'getSchedulerGroupMembers.api'),
method: 'POST',
success: function (response) {
var data = Ext.JSON.decode(response.responseText);
if (!data.success && data.msg)
{
data.rows = [];
Ext.Msg.alert('Error', data.msg);
}
else if (data.success && data.rows.length == 0)
{
Ext.Msg.alert('Error', 'No users found in the configured Scheduler user group. Please contact '
+ 'an administrator to verify that the Scheduler user group is configured correctly.');
}
Ext.define('User', {
extend: 'Ext.data.Model',
fields: [
{name: 'UserId', type: 'int'},
{name: 'LastName', type: 'string'},
{name: 'FirstName', type: 'string'},
{name: 'DisplayName', type: 'string'},
{
name: 'FullName',
convert: function(v, record) {
if (record.get('LastName') == null || record.get('LastName') == '')
return record.get('DisplayName');
else
return record.get('LastName') + ', ' + record.get('FirstName');
}
}
]
});
userStore = Ext.create('Ext.data.Store', {
storeId : 'users', // referenced by this store id in InfoPanel.js
model: 'User',
sorters : {
property : 'FullName',
direction : "ASC"
},
data : data.rows
});
// only initialize the scheduler when all stores have loaded
if (resourceStore != null && eventStore != null) {
initScheduler();
}
}
});
};
queryStoreData();
});
</script>
</body>
</html>