📜 ⬆️ ⬇️

Vacation request management service for SharePoint 2013 integrated with BOSS-Kadrovik

Six months ago, we talked about how we implemented a service for booking meeting rooms with a large customer with geographically dispersed offices and a staff of several thousand people. We continue to work with the SharePoint portal of this company, as part of its development, EastBanc Technologies specialists have created another module - the leave application management service in integration with the automated BOSS-Kadrovik personnel management system.

The purpose of this service, it seems to us, does not need a lengthy explanation: to put it simply, the service automates the recording of holidays in the company. It is much more interesting what practical tasks we faced in this particular company, more on that.

Analysis

In accordance with the Labor Code of the Russian Federation, the annual basic paid leave is granted to the employee after 6 months from the first day of work in the company, and then every year on the basis of the order for granting leave, executed in accordance with the vacation schedule. Each month of work “on the account” of an employee, 2.33 days of paid vacation is accumulated. Paid vacation is : the main annual, additional, basic paid vacation in advance, additional vacation in advance. And a separate type is administrative leave .
')
Applications for these types of holidays we had to automate. Our tasks included:

  1. Provide employees with a convenient interface on the corporate portal for processing and coordinating vacation requests. The employee must see how many free days he has, be able to send a request for approval to the head.
  2. To enable the employee’s manager to coordinate holiday requests automatically.
  3. Synchronize actual data with planning data that the personnel department has (stored in the BOSS-Personnel system).
  4. Minimize paper workflow.

From a technical point of view, it was necessary to consider the following:

  1. The service had to be integrated into a personal account, retaining the style and logic of the already familiar reservations booking service .
  2. The solution was implemented on MS SharePoint 2010, but all participants in the development process already understood the need to move to 2013, which was later conducted by EastBanc Technologies .

Ui

Everything was simple here: to act in the same spirit as with the negotiations (pictures are clickable, open in a new window).


“My office”: we see the number of vacation days available to us for a given period, our own applications and their statuses, and in the “Archive” section - applications of subordinates, also with statuses. Stand apart is the button "Add request".


“My office” of the personnel officer: here everything is the same, only the section “Requests for approval” is added, which arrive from the entire company.


Application for vacation - from the point of view of the employee. He fills out this form and sends it to the head of his department for approval, after which it flies to personnel officers.


Application for leave from an employee - in this form, it comes to the immediate head of the employee (head of department).


Application for vacation from the employee - in this form, it comes to the personnel officer after agreement with the immediate head of the employee.


The annual vacation schedule for a specific department - as the personnel officer sees.


Vacation schedule for the department for the month - as the personnel officer sees it.

Storage of applications on the portal

To store information on actual and scheduled vacations, we created a list in SharePoint:



Integration with BOSS-Kadrovik

Information in SharePoint comes from the BOSS-Kadrovik system through file sharing using SharePoint Job. We also send the information about the agreed requests back to BOSS-Kadrovik.

To associate an employee's employee number with an account in ActiveDirectory, the employeeID field was added and “prokinato” in SharePoint using the User Profile Service:



A separate problem was the vacation schedule, because in the list of actual and planned vacations of the order of 100 thousand lines, and it was labor-intensive to determine the employee through the User Profile Service. Therefore, we configured the Search Service Application, and using the KeywordQuery mechanism modified in SharePoint 2013, we obtain all the necessary information about users:

ResultTableCollection rtc = null; var kwq = new KeywordQuery(site) { QueryText = String.Format(querySchema, employeeIdField, nameField, departmentField, department, officeField, office), ResultTypes = ResultType.RelevantResults, KeywordInclusion = KeywordInclusion.AllKeywords, HiddenConstraints = "scope:" + "\"People\"" }; SearchExecutor se = new SearchExecutor(); rtc = se.ExecuteQuery(kwq); 


In order to comply with the Labor Code of the Russian Federation, we made a check on the user's application: the duration of the main paid leave is a multiple of 7 days, and one of the holidays should last at least two weeks. In addition to this check, an additional check for “days off” has been added: information about planned trips or days off comes from BOSS-Kadrovik - it is forbidden to apply for leave on these days.
Also, holidays can be “added up”: for example, for the main paid leave of 14 days, you can “attach” administrative leave of 7 days.

The data formats used for the exchange are:

1. Actual and planned vacation (from BOSS-Kadrovik and to BOSS-Kadrovik - the format is identical)

imployeeId; fromDate; toDate; type
59; 2010-08-09 00: 00: 00; 2010-08-22 00: 00: 00; 0
59; 2007-06-01 00: 00: 00; 2007-06-15 00: 00: 00; 0
59; 2007-08-15 00: 00: 00; 2007-09-04 00: 00: 00; 0
59; 2012-06-25 00: 00: 00; 2012-07-15 00: 00: 00; 0
59; 2012-09-01 00: 00: 00; 2012-09-07 00: 00: 00; 0
59; 2013-04-29 00: 00: 00; 2013-05-06 00: 00: 00; 0
59; 2013-07-01 00: 00: 00; 2013-07-21 00: 00: 00; 0

2. Available days for vacation (from BOSS-Kadrovik)

imployeeId; fromDate; toDate; mainVacationDays; additionalVacationDays
59; 2013-06-20 00: 00: 00; 2014-06-19 00: 00: 00; 14.0000; 3.0000
59; 2012-06-20 00: 00: 00; 2013-06-19 00: 00: 00;, 0000; 3,0000
59; 2011-06-20 00: 00: 00; 2012-06-19 00: 00: 00;, 0000; 3,0000
59; 2008-06-20 00: 00: 00; 2009-06-19 00: 00: 00; 1,0000;, 0000
59; 2007-06-20 00: 00: 00; 2008-06-19 00: 00: 00; 3,0000;, 0000

3. Information about truancy, time off, business trips (from BOSS-Kadrovik)

imployeeId; fromDate; toDate; type
5236; 2007-03-12 00: 00: 00; 2007-03-16 00:00:00; Business trip
5249; 2007-03-09 00: 00: 00; 2007-03-18 00:00:00; Business trip
209; 2007-03-19 00: 00: 00; 2007-03-19 00:00:00; Weekend parents of children with disabilities

Implementation

To implement the forms for creating / editing / viewing applications, we redefined the standard dialogs for editing SharePoint elements in the corresponding list schema.xml using the UseLegacyForm attribute:

 <Forms> <Form Type="DisplayForm" Url="DisplayForm.aspx" WebPartZoneID="Main" UseLegacyForm="TRUE" /> <Form Type="EditForm" Url="EditForm.aspx" WebPartZoneID="Main" UseLegacyForm="TRUE" /> <Form Type="NewForm" Url="NewForm.aspx" WebPartZoneID="Main" UseLegacyForm="TRUE" /> </Forms> 


As can be seen from the definition, these are essentially ordinary aspx pages, but with unique content placeholders.
For example for the title tag:

 <asp:Content ID="Content1" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">    </asp:Content> 


Office.microsoft.com/en-us/sharepoint-designer-help/working-with-content-placeholder-controls-HA102265026.aspx is described here in more detail .

For UI, we used jQuery UI.

Also in the pop-up window to view the application we needed to display the approval history of this application. To do this, we have created a list of "history of the approval of the application" with a lookup-field on the list of applications. And defined the view using a CAML request:

 <Query> <Where> <Eq> <FieldRef Name="Request" LookupId="TRUE" /> <Value Type="Lookup"> <GetVar Scope="Request" Name="Id"/> </Value> </Eq> </Where> <OrderBy> <FieldRef Name="ID"></FieldRef> </OrderBy> </Query> 


The Id parameter (this is the Id from the list of requests) comes from the request parameters, which is generally understandable, since The link formed by SharePoint to open the form for viewing an element looks as follows:

 {$HttpVDir}/_layouts/15/listform.aspx?PageType=6&ListId={$List}&ID={$ID} 


Next, for our list of reconciliation history, its submission for a specific application and an aspx page for displaying an application, an xls representation was announced:

 <File Path="RequestList/DisplayForm.aspx" Url="Lists/RequestList/DisplayForm.aspx"> <View WebPartOrder="1" WebPartZoneID="Main" BaseViewID="2" List="$Resources:core,lists_Folder;/RequestHistoryList" > <![CDATA[ <webParts> <webPart xmlns="http://schemas.microsoft.com/WebPart/v3"> <data> <properties> .... <property name="XslLink" type="string">/_layouts/15/ETR.VacationRequest/xsl/history.xsl</property> .... </properties> </data> </webPart> </webParts> ]]> </View> </File> 

From the code it is obvious that the presentation will be located on the Lists / RequestList / DisplayForm.aspx page in the WebPartZoneID = “Main” web-site zone. It remains only to make sure that we have such a zone on the page:

 <WebPartPages:WebPartZone runat="server" FrameType="None" ID="Main" Title="loc:Main" /> 


With the vacation schedule, we went further, because the standard list view in the form of a calendar did not suit us or the customer. Therefore, we gave the task to our designers, and they drew this beautiful calendar:



Having received the approval of the customer, we set to work: first of all, following the example of our reservations booking service, we wrote a WCF service that returns json and still works in the context of SharePoint.

Defined DataContract:

 [DataContract(Name = "Vacation")] public class Vacation { [DataMember(Name = "fromDate")] public DateTime FromDate { get; set; } [DataMember(Name = "toDate")] public DateTime ToDate { get; set; } [DataMember(Name = "type")] public int Type { get; set; } } [DataContract(Name = "employeeData")] public class EmployeeData { [DataMember(Name = "id")] public int Id { get; set; } [DataMember(Name = "name")] public string Name { get; set; } [DataMember(Name = "vacations")] public List<Vacation> Vacations { get; set; } } [DataContract(Name = "departmentData")] public class DepartmentData { [DataMember(Name = "name")] public string Name { get; set; } [DataMember(Name = "office")] public string Office { get; set; } [DataMember(Name = "employees")] public List<EmployeeData> Employees { get; set; } } 

Collected data about the user using KeywordQuery, and data about the holidays using a simple CAML request. Made a custom layout and bundled jQuery with KnockOut implemented the required interface.

Result

As a result, we were able to fully satisfy the customer’s needs in automating the vacation accounting business process. Now, for the employees of the customer company, vacation fees start with an easy, pleasant process of filling out the application, and not running around with pieces of paper. They also always have free access to information on the number of vacation days and information on the status of applications submitted.

Managers of employees have complete, documented information about the schedule of vacations of their subordinates, can more effectively plan the activities of the unit and, not least, their own vacations.

But of course, the human resources department won the most: firstly, the application service for leave is a protection against random errors in numbers, secondly, it significantly reduces paper workflow, which usually inevitably grows around each vacationer, thirdly, integration with BOSS-Kadrovik allows the personnel department to efficiently conduct analytical accounting of personnel and labor costs.

Source: https://habr.com/ru/post/213125/


All Articles