IT Monkey will place code here as examples of what Cireson's consulting team has to offer as well as examples for public consumption to benefit the Microsoft System Center community as a whole.
DISCLAIMER
All files and projects located here come as is and without any warranty or support. We will attempt to improve the projects as time goes on based on customer and community demand. Comments and improvements are welcome as well as customization requests. Your use of these Cireson Uploads is subject to our Terms of Use.
Cireson's support team has no information on these projects outside of what you have available and will not provide support for these enhancements, extensions, and scripts.
Dont forget to checkout solutions uploaded by our customers, partners and community members here.
Portal - Change Calendar
https://support.cireson.com/KnowledgeBase/View/1129#/
https://support.cireson.com/KnowledgeBase/View/1106#/
This is an example of how to create a Change Calendar for your change managers in the Cireson Portal
To install execute the below query against your ServiceManagement database:
--use a GUID generator to create some new guids for your view panel and navigation node. NOTE: All guids must be completely lower case. --you can run this query three times in SQL to generate the guids you need. -- SELECT LOWER(CONVERT(nvarchar(39),NEWID())) DECLARE @NavNodeGuid nvarchar(255) = '4f962bc3-61ba-4b95-a311-fa00b2c61e30'; DECLARE @ViewPanelGuid nvarchar(255) = '6de60ec7-9b5d-4aad-9da9-3c77b5ac0e6f'; DECLARE @DataSourceGuid nvarchar(255) = 'f177dd61-5cd9-4f78-95c9-f8987a69edca'; --this query selects all the active Change Requests in the WorkItem table DECLARE @Query nvarchar(max) = 'DECLARE @SystemWorkItemChangeRequest uniqueidentifier = ''e6c9cf6e-d7fe-1b5d-216c-c3f5d2c7670c''; DECLARE @ChangeStatus_Cancelled uniqueidentifier = ''877defb6-0d21-7d19-89d5-a1107d621270''; DECLARE @ChangeStatus_Failed uniqueidentifier = ''85f00ead-2603-6c68-dfec-531c83bf900f''; DECLARE @ChangeStatus_Completed uniqueidentifier = ''68277330-a0d3-cfdd-298d-d5c31d1d126f''; DECLARE @ChangeStatus_Closed uniqueidentifier = ''f228d50b-2b5a-010f-b1a4-5c7d95703a9b''; SELECT w.Id, w.WorkItemId, w.WorkItemId+'' - ''+w.Title as Title, w.Description, w.ScheduledStartDate, w.ScheduledEndDate FROM [WorkItem] w WHERE w.ClassId = @SystemWorkItemChangeRequest AND w.StatusId NOT IN (@ChangeStatus_Cancelled, @ChangeStatus_Failed, @ChangeStatus_Completed, @ChangeStatus_Closed)'; --this is the text which will be shown in the portal menu DECLARE @MenuTitle nvarchar(255) = 'Change Request Calendar'; DECLARE @Locale nvarchar(3) = 'ENU'; --this just deletes it if it already exists so that you can iteratively tweak it and recreate it easily DELETE FROM DisplayString WHERE ElementID = @NavNodeGuid and LocaleID = @Locale; DELETE FROM NavigationNode WHERE Id = @NavNodeGuid; DELETE FROM ViewPanel WHERE id = @ViewPanelGuid; DELETE FROM DataSource WHERE id = @DataSourceGuid; --this creates the query which will be used as the data source for the calendar INSERT INTO dbo.[DataSource] (Id, ConnectionString, Query) VALUES ( @DataSourceGuid, NULL, @Query); --this creates the navigation node display string INSERT INTO [dbo].[DisplayString] (ElementID, LocaleID, DisplayString) VALUES (@NavNodeGuid, @Locale, @MenuTitle); --Create the navigation node. INSERT INTO NavigationNode(Id, [Definition], Ordinal, Sealed, IsPublic, IsVisible, LicenseRequired, IconClass, ParentId, Location) VALUES ( @NavNodeGuid, '{"Id":"' + @NavNodeGuid+ '","layoutType":"full","view":{"header":{"title":"' + @MenuTitle + '","subTitle":""},"body":{"content":{"rows":[{"columns":[{"ColSpan":12,"type":"viewPanel","ViewPanelId":"' + @ViewPanelGuid + '"}]}]}}}}', 2,0,0,0,'DASHBOARD', NULL, 'E99B6A93-E536-442E-839F-67A99B439297','6CFC4D00-D8EB-4F51-B63D-F776576CF25A'); --Create the view panel INSERT INTO ViewPanel(Id, [Definition], TypeId) VALUES ( @ViewPanelGuid, '{"Id":"' + @ViewPanelGuid + '","type":"calendar","content":{"queryId":"' + @DataSourceGuid + '", "views":["day","week","month","agenda"],"id":"WorkItemId","title":"Title","description":"Description","startDate":"ScheduledStartDate","endDate":"ScheduledEndDate"}}', 'calendar' );
Comments
nothing to see here...
This is very cool. I've got two questions.
I checked in my lab post upgrade after seeing this, im guessing the hot fix installer is removing the customization for some reason. I had to re-run the above query to get it back as a navigation node.
Let me open this as an incident on your behalf for the team to investigate. IR53815
Cheers
Joe
Not showing any CRs on the calendar however.
The behavior of the navigation node being removed upon upgrade is by design as you have configured the navigation node with the sealed column = 1. The Sealed column is used for system defaults and should always be set to 0 for custom navigation nodes. If you modify the Sealed column on your navigation node to 0 it will not be removed upon upgrade.
I did update our KB article with this information as well as it had an incorrect example that populated Sealed as 1. @Joe_Burrows please update the example above.
Thanks, Carrie
http://demos.telerik.com/kendo-ui/scheduler/index
Specifically under the resources area
resources: [
{ field: "ownerId", title: "Owner", dataSource: [ { text: "Alex", value: 1, color: "#f8a398" }, { text: "Bob", value: 2, color: "#51a0ed" }, { text: "Charlie", value: 3, color: "#56ca85" } ] } I am not a good programmer though, so no idea on how to implement it
I have altered this code to make a downtime calendar, which works perfect. Since all work items have the scheduled downtime date fields, this is a great way to communicate this to your end users and or colleagues. Making sure those fields are available on the portal forms when you want to apply this calendar.
This code isn't perfect, since the SQL query allows for all kinds of Work Items, but I have only defined the statuses for Change and Service Request. I don't know if those GUIDS will work in your environment as well, so please check if this works for you:
Agenda view looks like this on mobile:
And as you can see, this includes the Assigned User in the Title, when there is no User Assigned, the Work Item does not appear on the Calendar.
It doesn't get any better when pasting it back in Notepad ++ either.
See attached txt
1. Is it possible to change the language for today, day, week and so on???
2. Completed CR aren't show at the calendar? Possible to Change, too?
THX, works fine.
Additionally questions:
1. How to change the colors for the different status of CR? For example completed = green, in Progress = red .....
2. We have a calendar with all active CR (see first post). We want no additional calendar with all available status. So is it possible to have one calendar with one (for all status) or more (for each status) checkboxes to show it dynamic?