Skip to content

TSerious/QuickFioriTimeEvents

Repository files navigation

QuickFioriTimeEvents

Windows-Taskbar tool to quickly add time events in SAP Fiori.

My employer uses a SAP Fiori tool to track our time events (working hours). That means that we have to open the appropiate website and clock in and out. Cause I found this relatively annoying I created this small tool for the (Windows) taskbar with which you can quickly clock in and out.

The tool is shown as a small icon taskbar icon in the taskbar. A right click opens a menu that let you perform some actions quickly.

Features

  • Arrive (clock in)
  • Leave (clock out)
  • Leave and shutdown the PC (sleep and hybernate are also possible)
  • Start a pause
  • Start a pause and shutdown the PC (sleep and hybernate are also possible)
  • End a pause
  • Show the time you are clocked in and the work time (clock in time minus pause time)
  • Log a leave event: The clock out time is only logged and not submitted to SAP Fiori. This is useful, as an offset time can be added to the leave event and events in the future might be blocked.
  • Log a leave event and shutdown (sleep and hybernate are also possible)
  • Submit logged leave event and arrive afterwards
  • Get the current work time from SAP Fiori

Installation

The tool does not need to be installed just run it. When run for the first time, you will be asked weather to use Edge or Firefox. On the first start, you also need to define the url for Fiori. Open a browser navigate to your Fiori website and copy the address into the shown window.
taskbar icon

Autostart

In order to start the tool with Windows, it needs to be put into the Startup directory. To open the Startup directory, hit the keys Win+R, type shell:startup into the opened form (window) and click ok. Afterwards create a shortcut of the QuickFioriTimeEvents.exe (right click on the exe and select Create shortcut) and copy the just created shortcut to the Startup directory. From now on the tool will be started when Windows is started.

Using the application

You mainly interact with the tool trough the taskbar icon taskbar icon. Right click on it and perform one of the actions.

Commands

Quit

Closes the application.

Arrive

Adds an arrive or clock in event to your time events in Fiori. The time in [ArriveLeave]ArriveOffset will be added to the current time.

Leave

Adds a leave or clock out event to your time events in Fiori. The time in [ArriveLeave]LeaveOffset will be added to the current time.

Leave and hybernate

Does the same as Leave and executes the [General]ShutdownCommand afterwards.

Start Pause

Adds a pause start event to your time events in Fiori. The time in [ArriveLeave]StartPauseOffset will be added to the current time.

Start Pause and hybernate

Does the same as Start Pause and executes the [General]PauseStartCommand afterwards.

End Pause

Adds a pause end event to your time events in Fiori. The time in [ArriveLeave]EndPauseOffset will be added to the current time.

Arriv (submit Leave)

Before doing the same as Arrive, the currently logged leave (or clock out) time is added to time events in Fiori. The added leave time is the logged leave time plus [ArriveLeave]LeaveLogOffset.

Log Leave

Log the current time as the leave (clock out) time but do not submit this to Fiori.

Log Leave and hybernate

Does the same as Log Leave and executes the [General]ShutdownCommand afterwards.

Update state

Gets the current state (if you are logged in and the pause time) from Fiori.

Reset icon

Resets the icon to the default one.

Open config file

Open the config.ini file.

Open documentation

Opens the pdf version of this documentation. (You are probably reading it)

Show work time

Shows the time (hours:minutes:seconds) since you clocked in. It also shows the time since clock in minus the pause time. This is the time you have worked. By default this can be executed with a left click on the icon, if [General]ShowWorkTimeOnLeftClick is "True".

Icon state

The current state is indicated by the taskbar icon. It can be in the following states:

  • taskbar icon Default icon.
  • taskbar icon You are clocked in and working.
  • taskbar icon You are clocked out.
  • taskbar icon A leave or clock out event has ben logged (but not submitted).
  • taskbar icon You are clocked in but currently in a pause (and not working).
  • taskbar icon An error has occured.

Configuring the application

You can customize what is shown in the right click menu (see here) and other stuff.

Right now the application can only be configured via the config.ini file. The file is seperated into different sections. In order to change the settings of the application you have to edit the config.ini file. The settings of each section are described in the tables below.

ArriveLeave

Setting Default value Desciption
[ArriveLeave]Approve True A value indicating whether the event shall be approved. Only approved events are stored in fiori. Set to False to approve manually.
[ArriveLeave]ArriveOffset -5 Minutes that will be added to the arrive time. Negative values are possible.
[ArriveLeave]LeaveOffset 0 Minutes that will be added to the leave time. Negative values are possible.
[ArriveLeave]LeaveLogOffset 5 Minutes that will be added to the leave time. Negative values are possible.
[ArriveLeave]StartPauseOffset 0 Minutes that will be added to the pause start time. Negative values are possible.
[ArriveLeave]EndPauseOffset 0 Minutes that will be added to the pause end time. Negative values are possible.

General

Setting Default value Desciption
[General]MinLogLevel The minimum level of log entries.
CRITICAL = 50, ERROR = 40, WARNING = 30,
INFO = 20, DEBUG = 10, NOTSET = 0
[General]ClearLog True A value indicating whether the log shall be deleted,
each time the software starts.
[General]WaitTimeAfterPageLoad 10 The time in seconds to wait after the initial page
is loaded in the browser instance.
[General]Url The (base) url of Fiori.
[General]UrlHome #Shell-home The path to the 'Home' page.
[General]UrlTime ?appState=lean#TimeEntry-change The path to the 'Time' page.
[General]Driver The browser (or driver) that is used to interact with SAP Fiori.
Currently Edge or Firefox are supported.
[General]ProfilePath The path where the profile of the used browser (driver) is stored.
[General]BinaryPath The path where the executable of the used browser (driver) us located.
[General]CheckProfilePath True A value whether to check if [General]ProfilePath is set.
[General]ArriveEvent P10 The arrive event indentifier.
[General]LeaveEvent P20 The leave event indentifier.
[General]PauseStartEvent P15 The pause start event indentifier.
[General]PauseEndEvent P25 The pause end event indentifier.
[General]PauseStartCommand shutdown.exe /h The shutdown command. '/h' means hybernate
instead of normal shutdown.
[General]ShutdownCommand shutdown.exe /h The shutdown command. '/h' means hybernate
instead of normal shutdown.
[General]CloseInstance True A value indicating whether the browser instance should be quit
after the event has been created.
[General]ShowWorkTimeOnLeftClick True A value indicating whether a left click on the icon
shows the current work time.
[General]Order

Quit|---|Arrive|Leave|LeaveAndShutdown|---|StartPause|StartPauseAndShutdown|EndPause|---|LeaveLoggedAndArrive|LogLeave|LogLeaveAndShutdown|---|GetCurrentState|SetDefaultIcon|OpenConfig|OpenReadme|---|ShowWorkTime

The order of the elemnts in the right click menu of the icon.
Each element is seperated with '|'.
Possible elements are listed in Menu Elements.

Menu Elements

The following elements can be added to [General]Order to customize the right click menu.

State

These settings doesn't need to be edited as they are only used to save the state of the application. So they will change on each run.

Setting Default value Desciption
[State]LastArriveDateTime The date and time the arrive event was set the last time
[State]LastPing The date and time of the last interaction with the software.
[State]IsPause False A value indicating whether you are currently in a pause.
[State]LastPauseDateTime The date and time of the last pause start event.
[State]AccumulatedPauseTime 0 The time in seconds the user has been in a pause.
[State]LoggedLeaveDateTime The date and time of the leave event that will be created when using LeaveAndArrive.