Skip to content

Commit

Permalink
Initializing
Browse files Browse the repository at this point in the history
  • Loading branch information
emorinaj committed Nov 16, 2021
1 parent 37f043f commit f6c998c
Show file tree
Hide file tree
Showing 386 changed files with 86,300 additions and 3 deletions.
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GNU GENERAL PUBLIC LICENSE
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Expand Down Expand Up @@ -671,4 +671,4 @@ into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
<https://www.gnu.org/licenses/why-not-lgpl.html>.
40 changes: 39 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,39 @@
# attendance
# Zeiterfassung für EGroupware

# Clone Github Repository
```$``` ```git clone https://github.com/agroviva/attendance```
# Nginx Configuration
Add to this file: ```sudo nano /etc/egroupware-docker/egroupware-nginx.conf```
```
# Routing Templates
location /egroupware/attendance/graph {
alias /usr/share/egroupware/attendance/graph;
try_files $uri $uri/ @attendancegraph;
location ~ \index.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_pass $egroupware:9000;
}
}
location @attendancegraph {
rewrite /graph/(.*)$ /egroupware/attendance/graph/index.php?/$1 last;
}
# Export (PDF, Excel etc.)
location /egroupware/attendance/export {
alias /usr/share/egroupware/attendance/export;
try_files $uri $uri/ @export;
location ~ \index.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_pass $egroupware:9000;
}
}
location @export {
rewrite /export/(.*)$ /egroupware/attendance/export/index.php?/$1 last;
}
```
42 changes: 42 additions & 0 deletions app/css/app.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
@import url("/egroupware/attendance/app/vlive/css/desktop.css");

@import url('/egroupware/attendance/app/vlive/css/mobile.css');

/*
@import url('/egroupware/attendance/css/mobile.css') (max-width: 1024px);
@import url("/egroupware/attendance/css/desktop.css") (min-width: 1025px);
*/

/* phone-portrait
@import url(“/egroupware/attendance/css/mobile.css”) only screen
and (min-width:320px )
and (max-width: 568px )
and ( orientation: portrait );
/* phone4 -landscape
@import url(‘/egroupware/attendance/css/mobile.css’) only screen
and (min-width:321px )
and (max-width: 480px)
and (orientation: landscape );
/* phone5 -landscape
@import url(‘/egroupware/attendance/css/mobile.css’) only screen
and (min-width:481px )
and (max-width: 568px)
and (orientation: landscape );
/* ———- Tablets ———-
@import url(“/egroupware/attendance/css/mobile.css”) only screen
and (min-width: 569px )
and (max-width: 1024px)
and (orientation: portrait);
@import url(‘/egroupware/attendance/css/mobile.css’) only screen
and (min-width: 569px)
and (max-width: 1024px)
and (orientation: landscape);
/* desktop
@import url(“/egroupware/attendance/css/desktop.css”) only screen
and (min-width: 1025px); */
50 changes: 50 additions & 0 deletions app/css/app.css.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php
header('Content-type: text/css', true);
$path = include dirname(__FILE__).'/../default.php';
$version = $path['version'];
echo
"
@import url('/egroupware/attendance/app/v{$version}/css/desktop.css');
@import url('/egroupware/attendance/app/v{$version}/css/mobile.css');
";
?>

/*
@import url('/egroupware/attendance/css/mobile.css') (max-width: 1024px);

@import url("/egroupware/attendance/css/desktop.css") (min-width: 1025px);
*/

/* phone-portrait
@import url(“/egroupware/attendance/css/mobile.css”) only screen
and (min-width:320px )
and (max-width: 568px )
and ( orientation: portrait );

/* phone4 -landscape
@import url(‘/egroupware/attendance/css/mobile.css’) only screen
and (min-width:321px )
and (max-width: 480px)
and (orientation: landscape );

/* phone5 -landscape
@import url(‘/egroupware/attendance/css/mobile.css’) only screen
and (min-width:481px )
and (max-width: 568px)
and (orientation: landscape );

/* ———- Tablets ———-
@import url(“/egroupware/attendance/css/mobile.css”) only screen
and (min-width: 569px )
and (max-width: 1024px)
and (orientation: portrait);

@import url(‘/egroupware/attendance/css/mobile.css’) only screen
and (min-width: 569px)
and (max-width: 1024px)
and (orientation: landscape);

/* desktop
@import url(“/egroupware/attendance/css/desktop.css”) only screen
and (min-width: 1025px); */
5 changes: 5 additions & 0 deletions app/default.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

return [
'version' => 'live',
];
111 changes: 111 additions & 0 deletions app/vlive/api/app.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<?php

use AgroEgw\App;
use AgroEgw\DB;
use Attendance\Ajax;
use Attendance\Core\Update;
use EGroupware\Api\Asyncservice;

if (!function_exists("errorHandler")) {
function errorHandler($error_level, $error_message, $error_file, $error_line, $error_context)
{
$error = "lvl: " . $error_level . " | msg:" . $error_message . " | file:" . $error_file . " | ln:" . $error_line;
switch ($error_level) {
case E_ERROR:
case E_CORE_ERROR:
case E_COMPILE_ERROR:
case E_PARSE:
mylog($error, "fatal");
break;
case E_USER_ERROR:
case E_RECOVERABLE_ERROR:
mylog($error, "error");
break;
case E_WARNING:
case E_CORE_WARNING:
case E_COMPILE_WARNING:
case E_USER_WARNING:
mylog($error, "warn");
break;
case E_NOTICE:
case E_USER_NOTICE:
mylog($error, "info");
break;
case E_STRICT:
mylog($error, "debug");
break;
default:
mylog($error, "warn");
}
}
}

if (!function_exists("shutdownHandler")) {
function shutdownHandler() //will be called when php script ends.
{
$lasterror = error_get_last();
switch ($lasterror['type'])
{
case E_ERROR:
case E_CORE_ERROR:
case E_COMPILE_ERROR:
case E_USER_ERROR:
case E_RECOVERABLE_ERROR:
case E_CORE_WARNING:
case E_COMPILE_WARNING:
case E_PARSE:
$error = "[SHUTDOWN] lvl:" . $lasterror['type'] . " | msg:" . $lasterror['message'] . " | file:" . $lasterror['file'] . " | ln:" . $lasterror['line'];
mylog($error, "fatal");
}
}
}

if (!function_exists("mylog")) {
function mylog($error, $errlvl)
{
// echo $error;
}
}

set_error_handler("errorHandler");
register_shutdown_function("shutdownHandler");

require_once __DIR__.'/../../../../agroviva/vendor/autoload.php';

if (!defined('APPDIR')) {
define('APPDIR', dirname(__DIR__));
}

if (!defined('TEMPLATE')) {
define('TEMPLATE', __DIR__.'/../views');
}

App::setName('attendance');
App::Start();
require_once '/usr/share/egroupware/header.inc.php';
require_once EGW_INCLUDE_ROOT.'/attendance/setup/setup.inc.php';
require_once __DIR__.'/functions.php';
require_once __DIR__.'/../classes/autoload.php';

$async = new asyncservice();

$async->delete('attendance_api');
if (($async->read('attendance')['attendance']['method'] != 'attendance.attendance_sync.synchron')) {
$async->delete('attendance');
$async->set_timer(['hour' => '*/2'], 'attendance', 'attendance.attendance_sync.synchron', null);
}

$db = (new DB("SHOW TABLES LIKE 'egw_attendance'"))->Fetch();
if (empty($db)) {
$async->delete('attendance');
die();
}

Update::Start();

require_once APPDIR.'/inc/class.attendance_ui.inc.php';
require_once APPDIR.'/inc/class.attendance_so.inc.php';
require_once APPDIR.'/inc/class.attendance_bo.inc.php';

Ajax::Response();
App::Clean();
17 changes: 17 additions & 0 deletions app/vlive/api/export/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

use Attendance\Export;

ini_set('memory_limit', '-1');
include __DIR__.'/../app.php';

$so = new attendance_so();
$bo = new attendance_bo();

if (isset($_GET)) {
$export = new Export($_GET);
} elseif (isset($_POST)) {
$export = new Export($_POST);
}

$export->exec();
Loading

0 comments on commit f6c998c

Please sign in to comment.