Modifying schedule page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2015 01:12 PM
Hi,
I created a schedule page similar to the "Windows and Changes" pages, and would like to modify the information being displayed. I was able to modify what it displays (change number plus the Short Description), but the Short Description gets cut off if it's too long. It seems that the maximum number of lines displayed is only 2. Also, it's only displaying the planned started time, and I'm not sure how to get it to display both the start time and end time.
Please help.
Thanks,
Maria
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2015 11:28 PM
Did you try increasing the timespan height ?
schedulePage.setViewProperty("timespan_height", 4);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2015 07:55 AM
Hi Probir,
I tried schedulePage.setViewProperty("timespan_height", 4); but it didn't make any difference. Anything else I can try?
Maria
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2015 07:22 AM
Hello Maria / Probir,
Did you add any events(like on mouseclick,mouseover etc) to this page ?
I have requirement, when mouse is clicked on any window then related change ticket list should pop-up.
Any help in this regard would be appreciated.
Thanks,
Jotiram
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2016 07:45 AM
Mine only shows 1.5 lines. The second line of text gets cut off half way through. I have tried adjusting the height property, but nothing changed. Any suggestions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2016 08:00 AM
If you need to expand the height of each box, put the following in the Client Script section of the schedule page. For example, this value gives about 4 lines.
GwtCalendarViewMonthly.prototype.MAX_HEIGHT = 35;
Also, if you want any headings on top of the calendar (I put a legend explaining the colors), put something like the following in the HTML section of the schedule page.
<p>This view contains only "Work in Progress" changes. (Changes whose approval are Not Yet Requested or in Support are omitted)</p><h4>Legend</h4><table bgcolor="#000000"><tr><td bgcolor="#06FB4A" align="right">Green :</td><td>Fully Approved</td></tr><tr><td bgcolor="#85929E" align="right">Grey :</td><td>Not Yet Approved</td></tr><tr><td bgcolor="#F7FC06" align="right">Yellow :</td><td>Not Yet Approved but Planned Start Date within 7 days</td></tr><tr><td bgcolor="#E74C3C" align="right">Red :</td><td>Not Yet Approved but Planned Start Date has past</td></tr></table>
For your reference, here is the code I used for our schedule page. You just have to modify it according to your needs. (We have some additional values within the approval attribute)
var todaysdate = gs.nowDateTime();
var nextweekdate = gs.daysAgo(-7);
gr = new GlideRecord('change_request');
gr.addQuery('active', 'true');
gr.query();
while (gr.next()) {
var color = '#318047';
var state = gr.state;
var priority = 'P' + gr.priority;
var approval = gr.approval;
if (state == '2'){
//We just want to see Work In Progress
color = '#06FB4A';
//if (approval.indexOf('Requested') >= 0 ){
// color = '#85929E';
//}
var start = gr.start_date.getDisplayValue();
if (approval.indexOf('Business Approved') == -1 && approval.indexOf('Approved - eCAB') == -1){
//The approval is NOT Final approved, color is grey
color = '#85929E';
var inRange = (nextweekdate > start)? true: false;
if (inRange){
//color is yellow if planned start date is within 7 days of start
color = '#F7FC06';
}
inRange = (todaysdate > start)? true: false;
if (inRange){
//color is red if planned start date is past current date
color = '#E74C3C';
}
}
var end = gr.end_date.getDisplayValue();
//blank out approval value if the color is still green
if (color == '#06FB4A'){
approval = '';
}
var name = gr.number + ' - ' + approval+ ' - START: ' + start + ' - END: ' + end + ' - ' + gr.short_description.toString();
var item = schedulePage.addItem(gr, start, end, '', color);
if (item) {
if (gr.type == 'Comprehensive')
item.setName(priority + ' - ' + name);
else
item.setName(priority + ' ' + gr.type.toUpperCase() + ' - ' + name);
}
}
}