Timesheets

From Newroco Tech Docs
Revision as of 13:20, 14 June 2017 by Emilian.mitocariu (talk | contribs) (Created page with "==Prerequisites== Install the following packages <pre>apt-get install apache2 libapache2-mod-php7.0 apt-get install php php-pgsql php-curl php-pear apt-get install postgresql...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Prerequisites

Install the following packages

apt-get install apache2 libapache2-mod-php7.0
apt-get install php php-pgsql php-curl php-pear
apt-get install postgresql postgresql-plpython python-psycopg2
apt-get install mailutils
pear install PEAR
pear install MDB2-2.5.0b5
pear install MDB2_Driver_pgsql-1.5.0b4
wget developer.jasig.org/cas-clients/php/current.tgz && pear install current.tgz
apt-get install gettext

Change this value in /etc/php/7.0/apache2/php.ini

session.gc_maxlifetime = 48480

If you want French language to work you'll have to install the locales

locale-gen fr_FR
locale-gen fr_FR.UTF-8
update-locale
dpkg-reconfigure locales


Install Timesheets

Take a postgresql schema dump from an existing timesheets DB like this

su postgres
pg_dump -s database_name > timesheets-dump.sql
exit

And copy it to the server you want to install timesheets.

In postgresql create the database, the users, and load the dump you took earlier

su postgres
psql
CREATE USER timesheetadministrator WITH PASSWORD 'password';
CREATE USER timesheetwebentry WITH PASSWORD 'password';
CREATE DATABASE timesheetsystem OWNER timesheetadministrator;
GRANT ALL PRIVILEGES ON DATABASE timesheetsystem to timesheetwebentry;
\q
psql -d timesheetsystem < timesheets-dump.sql
exit

Copy the application source to /var/www/html.

Change values in /var/www/html/config.php for passwords, CAS link and email addresses to fit your needs.

if you want to change the logo you can do it in file /var/www/html/timesheets.css around line 17. You can also change the browser tab logo and the footer organization name and link in file /var/www/html/classes/Template.php around lines 128 and 80.

Add users

To add a new user you first have to add it to the backend that CAS is using for authenticating (probably samba/LDAP) and then add it to the database timesheetsystem, table tbl_staff_lookup

su postgres
psql
\connect timesheetsystem
INSERT INTO tbl_staff_lookup(refid, fname, lname, linemanager, username, email, employed, minhours, variable, cost_centre, location) VALUES ('id', 'first-name', 'last-name', manager-id, 'user.name', 'email@example.com', true, 8.0, true, 'IS', 'Iasi');
\q
exit