DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

EXT: sm_employeelist

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed by:Stefan Macke
Changed:2007-03-15T13:22:20
Email:typo3@stefanmacke.com
Info 2:Stefan Macke
Info 3:
Info 4:

EXT: sm_employeelist

Extension Key: sm_employeelist

Copyright 2007, Stefan Macke, <typo3@stefanmacke.com>

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.com

Table of Contents

EXT: sm_employeelist 1

Introduction 1

What does it do? 1

Requirement 2

Screenshots 2

Users manual 4

Introduction 4

Managing Employees 4

Managing Departments 4

Managing Positions 5

Managing Telephone Numbers 5

FAQ 5

Administration 5

Changing the look of the plug-in 5

FAQ 5

Configuration 5

Installing the extension 5

Flexform configuration 6

Configuration in the page's template 7

Common settings for the page's template 7

FAQ 7

Reference 8

Tutorial 10

Known problems 10

To-Do list 10

Changelog 10

Version 1.0.0 10

Introduction

What does it do?

This extension creates lists of employees of a company based on TYPO3 frontend users. Frontend user groups are used as the departments of the company and you can define positions for the employees like “manager” or “clerk” etc. Additionally there is a details page for each employee with his/her picture, telephone etc.

The following page contents can be created by the extension's first plugin 'Employee List':

  • Employee list: Displays a list of all employees. You can add/remove fields to display and sort the list by these fields.
  • Department list: Displays a list of all departments or all employees of a certain department. According to the priority of the employees' positions, they will be displayed with different colors.
  • Position list: Displays a list of all positions or all employees in a certain position.
  • Telephone list: Displays a (printable) telephone list.
  • Birthday list: Displays a (printable) list with all employees and their birthdays.
  • Picture list: Displays a list with only the pictures and names of all employees or just a certain group of employees.
  • Presence list: Displays a list of all employees with their current “status” (on-/offline, IP-address).
  • List of collective numbers: Displays a list of the company's collective numbers or a list of employees assigned to a certain collective number.
  • Details page: Displays a details page for each employee with all the information about him/her (picture, telephone number, email etc.).
  • Statistics: Displays some statistics like number of employees, average age etc.
  • Current Birthdays: A list of current (+/- 4 days) employees' birthdays.
  • Current jubilees: A list of current (+/- 4 days) employees' jubilees.

The additional plugin 'Event List' offers a list of events the employees can sign up for (like the christmas party etc.). Definable administrators can sign up for other employees and automatically remind them via mail that they should make a decision etc.

Requirement

You need PHP5 to run this extension.

Screenshots

A simple employee list.
img-1 A department list.
img-2
An employee's details page.
img-3 A (printable) telephone list.
img-4
Configuration in the back end.
img-5 An event list.

img-6

Users manual

Introduction

First of all, let's take a look at my dummy installation of the extension. I created a few dummy records of all types the extension uses (employees, departments, positions, telephone numbers and events) in the users sysfolder (which has to be set as Startingpoint in the plugins' configuration).

img-7 img-8

Managing Employees

Employees are simply the front end users of your website. You can create them in the users sysfolder and set all their values. The extension adds some extra fields to the standard user administration page. They should be pretty self explaining, but I will explain the most interesting ones here:

Name

Field

Name

Description

The employee's name has to be entered in the format 'surname, first name'. The extension will split the name at the comma.

Departments

Field

Departments

Description

The employee's departments are represented by the website's frontend user groups.

Positions

Field

Positions

Description

Positions have to be created manually. One could imagine positions like IT-Guy, Manager etc. The employee's position with the highest priority defines its overall priority.

Birthday / First entry

Field

Birthday / First entry

Description

These dates have to be entered in the format YYYY-MM-DD. The extension will split the dates at the dashes.

IP address / Last logon to Windows

Field

IP address / Last logon to Windows

Description

These fields will be used by the Presence List. I leave it to you how you fill these fields (I do it in the Windows logon script).

Collective numbers

Field

Collective numbers

Description

I don't know if anyone has a use for this, but my company has telephone numbers I call collective numbers. These are telephone numbers customers can call from outside that are routed to a list of employees instead of just one. This field is used to create lists that show which employees are assigned to which number.

Working hours

Field

Working hours

Description

Here you can enter information about the employee's working hours if he/she is a part-time worker. If you enter any text here, the employee will be shown as a part-time worker in lists.

Managing Departments

Departments are simply the frontend user groups of your website. According to the employees I will explain some fields added by the extension here:

Column / vertical position on the telephone list

Field

Column / vertical position on the telephone list

Description

I designed the telephone list to be printer friendly, so it has more than one column. You can define where the department shows up on the telephone list with these settings. Simply count the columns from left to right over all pages to find out the right column number and all the departments in one column from top to bottom to find out the vertical position.

Example: If you configure the telephone list to have 2 columns (that's the default) and want to show the IT department on the first column on page 3, right behind the management, you would enter 5 for column and 2 for vertical position (of course you would have to set vertical position to 1 for the management department, too).

Managing Positions

Positions are new database record types the extension offers. You should also create them in your users sysfolder. Positions have only two possible fields: name and priority. Name should be self explaining.

The priority is needed to sort department lists and assign configurable CSS-classes to the employees with the given priority on any list the extension can create. The higher the value for the position's priority, the higher the employees assigned to that position will appear in a list of the departments their in.

Take a look at the screenshot of the department list: the position Director has a priority of 99, Manager has 65 and 'normal' workers (like IT-Guys ;-) have 50 (the default value). The list gets sorted by the positions' priorities and the employees get a certain CSS-class, according to my configuration (e.g. the director gets the class 'highestPriority' which will result in a dark red background).

Managing Telephone Numbers

Telephone numbers are also new database records the extension offers. They represent a single telephone number that is not assigned to a single employee (e.g. the telephone central) but should appear on the telephone list. Furthermore a telephone number can also represent a collective number, that can be assigned to many different employees (collective numbers will not show up on the telephone list). I will explain the meaning of the fields here:

**Belongs to group / Group of numbers / Position on the telephone

Field

Belongs to group / Group of numbers / Position on the telephone list

Description

If you set the current telephone number to be a group of numbers, it will be not really a single telephone number but a 'container' for more numbers on the telephone list (like a department is a container for employees). You can assign other telephone numbers to such a group and it will appear like a department on the telephone list on the configured column / vertical position (see explanation in section Administer Departments ).

The position settings will have no effect, if the current number is not defined as a group. Single telephone numbers have to be assigned to a group, or they will not show up on the telephone list!

Collective number

Field

Collective number

Description

If you define the current number to be a collective number, it will not show up on the telephone list, but on the list of collective numbers, and employees can be assigned to it. The settings for the telephone list position and the group will have no effect at all.

Managing Events

Events are also new database records the extension offers. They represent an event that takes place in the company, like the Christmas party etc. The employees can sign up for these events so the people in charge of planning them know who will be coming or not. The fields should be self-explaining, so I only explain some of them here:

Deactivate signup from this date

Field

Deactivate signup from this date

Description

If this field is set to a YYYY-MM-DD value, the employees will no be able to sign themselves in after that date. However, admins can still sign up for other employees.

Options

Field

Options

Description

These are the options the employees can choose from. E.g. if you plan a christmas party and you have two different places the employees should “vote” for, you would enter them here (each option on a single line).

Departments who administer this event, **Employees who administer

Field

Departments who administer this event, Employees who administer this event

Description

Here you can choose which departments / employees will be admins for the event. Admins can sign up for other employees and remind those who have not made a decision yet via an automatic email.

Sender address for automatically sent emails

Field

Sender address for automatically sent emails

Description

This email address will be set as the sender address of reminder mails. If you enter an admin's address employees can simply ask questions by replying to the automatic emails.

Employees are allowed to sign up for the event

Field

Employees are allowed to sign up for the event

Description

If deactivated, the employees will not be able to sign themselves up for the event. Only admins will be able to do so.

Show statistics

Field

Show statistics

Description

If enabled, a small statistics table will be displayed under the list that makes it easier to find out how many employees have signed up or not.

FAQ

No FAQ yet.

Administration

Changing the look of the plug-in

The extension creates valid (X)HTML and is styled with CSS. You can reset my default style with the following code in your page's template:

plugin.tx_smemployeelist_pi1._CSS_DEFAULT_STYLE >
plugin.tx_smemployeelist_pi2._CSS_DEFAULT_STYLE >

You can take my CSS definitions from the files pi1/static/setup.txt and pi2/static/setup.txt in the extension's folder, add it to a custom stylesheet and change it the way you like.

FAQ

No FAQ yet.

Configuration

Installing the extension

Installing the sm_employeelist extension is very simple.

Install the extension using TYPO3's extension manager.

Include the extension's static code in your page template (Note: If you want to use all plugins you have to select every single static file here).

img-9 Insert a new page content to one of your pages. Select the Employee List plugin.

img-10 First of all, set the Startingpoint . That's the page/sysfolder where the extension looks for employees, departments, positions and telephone numbers. I recommend using a sysfolder in which all the data is stored.

Continue to configure the plugin. You can use the flexform to configure the output of a single page content. If you want to use more than one page (e.g. one for each different list) you should set the pages' Ids in your template, so you don't have to define them on each single page content.

Flexform configuration

General settings
Page Ids

Option

Page Ids

Description

You can define the Ids of your websites pages where the individual lists are located. For example: If you define the details page here, the employee list will link to that page if you click on the employee's name.

I recommend to set these values in the template (see section Common settings for the page's template ).

Special groups

Option

Special groups

Description

Here you can define certain usergroups/departments as 'special groups'. These will not be shown on lists, but as icons on the employee's special page.

For example, I created a department 'first aid' and assigned a little red cross to it. So on each details page of an employee that is in this department, there will appear a little red cross right under his image. The syntax is as follows:

GroupID,IconFile,Description

Each row defines a single special group. The icon file has to be placed in the img -folder of the extension.

Special content

Option

Special content

Description

If you set this value, the page content will only display the chosen content (current birthdays/jubilees or statistics) and nothing else (all other settings are ignored).

Settings for list page
Date format

Option

Date format

Description

Format of dates (birthday / first entry) on the lists (syntax: strftime)Default (17.01.2007):

%d.%m.%Y
List type

Option

List type

Description

Defines which type of list will be displayed.

Fields to display

Option

Fields to display

Description

Defines which fields of the employees will be displayed on the list (from left to right). Possible values are:

id, fullname, fulladdress, title, surname, firstname, address, city, zip, company, country, birthday, image, sex, hobbies, signature, signatureimage, departments, positions, collectivenumbers, firstentry, telephone, fax, email, website, description, username, ipaddress, lastwinlogon, age, workyears, workinghours, workingtime
List can be sorted by columns

Option

List can be sorted by columns

Description

Defines whether the list can be sorted by clicking on the column headers.

Maximum width / height of employee images

Option

Maximum width / height of employee images

Description

Defines the maximum width / height of the employees' images. Bigger / smaller images will be resized.

**Set CSS-classes for employees according to their positions / CSS-

Option

Set CSS-classes for employees according to their positions / CSS- classes for positions' priorities

Description

If set, employees will be given the custom CSS-classes you can define according to their priority. Syntax:

Priority,CSS-class name

Priorities lower than 50: employees with a priority lower than the given one will be given the CSS-class, priorities higher than 50: employees with a priority higher than the given one will be given the CSS-class.

Hide employees in these departments

Option

Hide employees in these departments

Description

Defines departments that will not be shown on the list. For example, in my company we have a 'department' for ex-workers, that should not be shown on the list (and therefore will not be included in statistics) but should be displayed on the department list or on the employees' details pages.

Settings for details page
Date format

Option

Date format

Description

Format (strftime) of dates on the details page.Default (01. January 2007):

%d. %B %Y
Fields to display in the details section

Option

Fields to display in the details section

Description

Employee's fields that will be shown in the details section of the details page.

For possible values take a look at the corresponding field in the list page settings.

Template file for details page

Option

Template file for details page

Description

Here you can enter the path to a custom template file for the details page. The default is employeeSingleView.html which is located in the tpl -folder of the extension. Take a look at the file to find out what markers the extension uses.

Maximum width / height of the employee's image

Option

Maximum width / height of the employee's image

Description

See corresponding field in the list page settings.

Detail fields that will be linked to custom lists

Option

Detail fields that will be linked to custom lists

Description

Defines which detail field(s) will be linked to 'custom lists'. For example, you could create a link on the field 'city' to get a list of people coming from the same city as the current employee. The link will point to the page you defined as the default list page or (if none defined) to the current page.

Special list settings
Number of columns on the image list

Option

Number of columns on the image list

Description

How many columns with images will be created on the image list. Default is 5.

Show only images of employees in the following positions

Option

Show only images of employees in the following positions

Description

If you want to create an image list of only employees in certain positions (e.g. IT-Guys), you could select these here.

Number of columns / rows on the birthday list

Option

Number of columns / rows on the birthday list

Description

Should be self explaining. The list creates a new page after the number or rows is reached.

Number of columns on the telephone list

Option

Number of columns on the telephone list

Description

How many columns will be created on the telephone list. Default is 2 and my default CSS is optimized for 2 columns.

Show additional information on the telephone list

Option

Show additional information on the telephone list

Description

Whether or not to show the content of the employee's / department's description field in an extra column on the telephone list.

Show date of last change on telephone list

Option

Show date of last change on telephone list

Description

Whether to display the date of the latest change on top of the telephone list. This date is automatically calculated by the last change to any (!) field of an employee.

Settings for the event list

These options appear on the flexform for the event list.

EnableCaching

Option

EnableCaching

Description

Enables caching.

Configuration in the page's template

All settings from the flexform could also be set in the page's template. For a list of possible settings see section Reference .

Common settings for the page's template

I recommend to set some configuration in your page's template, so you don't have to define them every time you create a new list. Simply set the following values (you will have to precede them with plugin.tx_smemployeelist_pi1.):

pidList

Option

pidList

Description

The page ID of your users sysfolder.

flexform.general.listPage

Option

flexform.general.listPage

Description

The page ID of your default employee list.

flexform.general.detailsPage

Option

flexform.general.detailsPage

Description

The page ID of your employee details page.

flexform.general.deptListPage

Option

flexform.general.deptListPage

Description

The page ID of your department list.

flexform.general.posListPage

Option

flexform.general.posListPage

Description

The page ID of your position list.

flexform.general.numberListPage

Option

flexform.general.numberListPage

Description

The page ID of your list of collective numbers.

Changing the mail template for the event list

The template file for the automatic mails from the event list is located in the extension's directory under pi2/mail.txt . It is a simple HTML-file, that you can change according to your needs. The following variables can be placed anywhere in the template and will be replaced with the corresponding values.

__EMPLOYEE__

Variable

__EMPLOYEE__

Description

The first name of the employee the mail goes to.

__EVENT__

Variable

__EVENT__

Description

The title of the event.

__URL__

Variable

__URL__

Description

The URL to the event on the event list.

__SENDER__

Variable

__SENDER__

Description

The email address of the sender (as defined in the event record)

FAQ

No FAQ yet.

Reference

General settings
pidList

Property

pidList

Data type

int

Description

ID of users sysfolder.

Default

0
recursive

Property

recursive

Data type

bool

Description

Whether to search for database records in pidList and its subpages.

Default

1
List settings
orderByFields

Property

orderByFields

Data type

string

Description

A list of fields the lists can be sorted by. Some fields don't make sense here, so this list does not include all possible employee fields.

Default

Id, fullname, zip, city, country, birthday, sex, signature, company, firstentry, telephone, fax, email, website, description, username, ipaddress, lastwinlogon
Flexform settings

These settings refer to the flexform settings. If these are set in the template, you don't have to set them in the flexform. If both are set, flexform values will take effect. Look at the example below the table to get a feeling on how to address the fields correctly.

general.listPage

Property

general.listPage

Data type

int

Description

ID of the default employee list page.

Default

0
general.detailsPage

Property

general.detailsPage

Data type

int

Description

ID of the employee details page.

Default

0
general.deptListPage

Property

general.deptListPage

Data type

int

Description

ID of the department list page.

Default

0
general.posListPage

Property

general.posListPage

Data type

int

Description

ID of the position list page.

Default

0
general.numberListPage

Property

general.numberListPage

Data type

int

Description

ID of the collective number list page.

Default

0
general.specialGroups

Property

general.specialGroups

Data type

string

Description

Defines special groups. Example:

specialGroups (
        37,ico_football.gif,Plays football
        38,ico_firstAid.gif,Is able to give First Aid
)

Result: departments 37 and 38 aren't shown on lists but as icons (the GIF-files) with info texts ('plays football' etc.) on the employees' details pages.

Default

list.dateFormat

Property

list.dateFormat

Data type

string

Description

The date format (strftime) on the lists.

Default

%d.%m.%Y
list.listfields

Property

list.listfields

Data type

string

Description

The fields to display on the lists. For possible values see section Settings for list page .

Default

fullname
list.sortable

Property

list.sortable

Data type

bool

Description

Whether the list can be sorted by its columns.

Default

1
list.linkNames

Property

list.linkNames

Data type

bool

Description

Whether employees' names will be linked to the details pages.

Default

1
list.showAnchors

Property

list.showAnchors

Data type

bool

Description

Whether to show a list of links to new first letters of the current sorting column.

Default

1
list.imageMaxWidth

Property

list.imageMaxWidth

Data type

int

Description

Maximum image width in pixel.

Default

100
list.imageMaxHeight

Property

list.imageMaxHeight

Data type

int

Description

Maximum image height in pixel.

Default

100
list.clickEnlarge

Property

list.clickEnlarge

Data type

bool

Description

Whether to link the employees' images to the original images.

Default

1
list.excludeGroups

Property

list.excludeGroups

Data type

string

Description

A list of groups to exclude from the list.

Example:

excludeGroups = 22,23

Result: Employees in groups 22 or 23 will not be shown on the list.

Default

list.excludeGroupsInfo

Property

list.excludeGroupsInfo

Data type

bool

Description

Whether to list the excluded groups below the list.

Default

1
list.priorityClasses

Property

list.priorityClasses

Data type

string

Description

A list of CSS-classes that will be assigned to employees when they have a certain priority.

Example:

priorityClasses (
        49,lowPriority
        55,highPriority
        60,higherPriority
        70,highestPriority
)

Result: Employees below priority 49 will be assigned the CSS- class 'lowPriority', employees above priority 55 will be assigned the CSS-class 'highPriority' etc.

Default

49,lowPriority
55,highPriority
60,higherPriority
70,highestPriority
details.dateFormat

Property

details.dateFormat

Data type

string

Description

The date format (strftime) on the details page.

Default

%d. %B %Y
details.fields

Property

details.fields

Data type

string

Description

The fields to display in the details section. For possible values see section Settings for list page .

Default

fulladdress, birthday, hobbies
details.imageMaxWidth

Property

details.imageMaxWidth

Data type

int

Description

Maximum image width in pixel.

Default

150
details.imageMaxHeight

Property

details.imageMaxHeight

Data type

int

Description

Maximum image height in pixel.

Default

150
details.clickEnlarge

Property

details.clickEnlarge

Data type

bool

Description

Whether to link the employees' images to the original images.

Default

1
details.customFields

Property

details.customFields

Data type

string

Description

A list of fields on the details page that will be linked to custom lists.

Example:

customFields = city,zip

Result: A click on the city or the zip leads to a list of all employees having the same city / zip.

Default

specialLists.ILcolumns

Property

specialLists.ILcolumns

Data type

int

Description

Number of columns on the image list.

Default

5
specialLists.BLcolumns

Property

specialLists.BLcolumns

Data type

int

Description

Number of columns on the birthday list.

Default

2
specialLists.BLrows

Property

specialLists.BLrows

Data type

int

Description

Number of rows on the birthday list.

Default

100
specialLists.TLcolumns

Property

specialLists.TLcolumns

Data type

int

Description

Number of columns on the telephone list.

Default

2
Example

Here is a sample configuration of the extension:

plugin.tx_smemployeelist_pi1 {
  pidList = 21
  recursive = 1
  flexform {
    general {
      listPage = 11
      detailsPage = 12
      deptListPage = 13
      posListPage = 14
      numberListPage = 15
      specialGroups (
        37,ico_football.gif,Plays football
        38,ico_firstAid.gif,Is able to give First Aid
      )
    )
    list {
      dateFormat = %d.%m.%Y
      listfields = fullname,signature,telephone
      sortable = 1
      linkNames = 1
      showAnchors = 1
      imageMaxWidth = 100
      imageMaxHeight = 100
      clickEnlarge = 1
      excludeGroups = 23,24
      excludeGroupsInfo = 1
      priorityClasses (
        49,lowPriority
        55,highPriority
        60,higherPriority
        70,highestPriority
      )
    }
    details {
      dateFormat = %d. %B %Y
      fields = fulladdress,birthday,hobbies,firstentry,collectivenumbers
      imageMaxWidth = 150
      imageMaxHeight = 150
      clickEnlarge = 1
    }
    specialLists {
      ILcolumns = 5
      BLcolumns = 2
      BLrows = 100
      TLcolumns = 2
    }
  }
}

Tutorial

Install the extension. Dont' forget to include the static code in your page template.

Create some employees, departments and positions in a sysfolder or a normal page (I recommend a sysfolder of course). I assume you already have front end users and front end groups, so the only thing you need to create are positions. This is crucial because the extension sets the employee's field 'positions' to be needed. Once you installed the extension, you cannot save an employee / front end user without assigning him to a position.

Let's create a simple employee list now, that links to a details page. First of all, we will create two pages: Employee List and Employee Details .

img-11 img-12 Insert a new page content to page Employee List and choose to add the plugin 'Employee List'.

The only thing you have (!) to set is the Startingpoint to the sysfolder containing your front end users, groups etc. because otherwise the extension will not know where to look for employees, departments etc.

img-13 If you just save the default settings now, you will already get a nice little list of employees with links to their details page. Now we want the names to link to the page we created for that purpose: Add a new page content to page Employee Details the same way we did with Employee List . Grr... now we have to set the Startingpoint again. Let's change that value to a default: Edit your page's template and insert the following code into the 'Setup' area (of course you have to change '2' to the ID of your users sysfolder).

plugin.tx_smemployeelist_pi1 {
 pidList = 2
}

Now go back to the page Employee Details and change to the section 'Settings for details page' of the flexform. You can play around with the settings here.

Go to the page Employee List and set the value for the details page ID to the page Employee Details . And voilá: The employee list links to the details page. To define this behavior as default, add the following code to your page's template (of course you have to change '2' to the ID of your page Employee List ):

plugin.tx_smemployeelist_pi1 {
 flexform {
          general {
                   detailsPage = 2
             }
   }
}

Now you can play around with the settings and different lists the extension offers. Simply add the plugin as a page content and set the desired values...

Known problems

I have been using the extension productive for about 3 weeks now and think (!) I have eliminated all problems.

If you experience any, please email me or contact me on my blog http://blog.stefan-macke.de

To-Do list

  • Add some more translations (I would do it myself, but only speak English/German. So if you would like to contribute a translation, simply contact me :-)
  • Add a plugin that offers the employees a small timetable they can register themselves with (e.g. for a resource plan for rooms etc.).

Thanks

Thanks to the Tango Desktop Project. All icons used in this extension were taken from their website: http://tango.freedesktop.org/Tango_Icon_Gallery

Changelog

Version 1.0.0

Initial version.

Version 1.0.2

  • Removed Subversion-files and _res -folder :-)
  • Added a more detailed description of the extension.
  • Added working hours to employees' fields. If working hours are defined for an employee he/she will be considered to be a part-time worker. Working times can be displayed on the details page. You can now add the column 'workingtime' that displays if the employee is a part-time or full-time worker to any list and 'workinghours' as a detail to the details page.
  • Empty fields will no longer be shown on the details page. Before they were shown, but the value was set to '-'.

Version 1.0.3

  • Updated manual.
  • Statistics now include number of part-time workers.

Version 1.1.0

  • Added the event list.
  • Updated the manual to look nicer in TER.
  • Some smaller changes in the source code.

img-14 EXT: sm_employeelist - 13