Customizing the approval sheet template

Location

By default, the approval sheet template file is stored in the folder "UserConfig\Templates” and is called "ApprovementListTemplate.[locale].server.docx”. This is a standard file, generated by the system to create an approval template.

Creating a custom template

In this folder, create a file with the name "ApprovementListTemplate.docx" (note that the name must be different from the default template name!), which will be used as a new template. The system can use only one approval sheet template, therefore you will need to replace the system file with a custom one.

Note:

Use the .docx (Office2007-2013) format, because other formats will not be recognized and the template will be generated using the standard file.

By default, the template looks like this:

In the approval sheet, objects are referred: approval comments, order, names of approvers and dates.

Pay attention to using cycles: the standard template includes two tables. The first one is used as a header (number, job position, comment, etc.) and the second - as the content; therefore a cycle is used in the second table. The cycle condition is placed before the table - {foritemin {$items}} - i.e. values will be displayed for each {$object}; {endmarks the end of the cycle. For correct enumeration of the cycle elements, the following structure is used: {Index () +1}, which returns a number, incrementing by 1 with each step of the cycle.

 

For more information, read this article.

Examples

Example 1.

Show profile data of the approvers, e.g. the date of employment and the phone number:

The values are taken from the User table of the user database. List of fields:

            

Field               

            

Value               

            

Field               

            

Value               

            

Id                

            

User Id

MobilePhone                

            

Mobile phone number

            

Uid                

            

User UID

            

RoomNumber                

            

Office number

            

Status                

            

Locked/not locked

            

Description                

            

Comment to the user profile

UserName                

            

User login in the system

            

Skype                

            

Skype profile

            

FirstName                

            

First Name

            

ICQ                

            

ICQ profile

            

MiddleName                

            

Middle Name

            

JabberID                

            

JabberID

            

LastName                

            

Last Name

            

ReplacementUser                

            

Id of the substituted user

            

FullName                

            

Full Name

            

 

            

                

            

Email                

            

Email

            

                

            

                

            

BirthDate                

            

Birthday

            

                

            

                

            

EmployDate                

            

Date of employment

            

                

            

                

            

WorkPhone                

            

Work phone number

            

                

            

                

Example 2.  

Check condition, whether the user has the Accountant job position. If the result is True, display the department name.

In this example, the if-else structure is used:     

{if *condition*}      

*Action or text if the condition is true*    

{else}      

*Action or text if the condition is false*      

{end if}