Initial commit: Kimai TMS
Kimai time management system (PHP 5.6 / MySQL) with custom extensions: - Budget tracking (ki_budget) - Change request form (ki_changerequest) - Invoice generation (ki_invoice) - Expense tracking (ki_expenses) - Flexi time (ki_flexitime) - Export, admin panel, timesheets, tasks, summary Database: ~900K time entries, 2,000+ users, 439 projects. Config: includes/autoconf.php — localhost/kimai/kimai
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?php /* Smarty version 2.6.20, created on 2015-02-03 08:13:50
|
||||
compiled from index.tpl */ ?>
|
||||
<?php echo '
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
listprojects_ext_onload();
|
||||
});
|
||||
</script>
|
||||
|
||||
'; ?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="listprojects_ext_wrap" width="100%">
|
||||
<div id ="listprojects_ext" width="100%">
|
||||
|
||||
|
||||
|
||||
58
extensions/ki_listprojects/config.ini
Normal file
58
extensions/ki_listprojects/config.ini
Normal file
@@ -0,0 +1,58 @@
|
||||
;= =====================================================================================================
|
||||
;= You can define vars as single values or as array, for array efinition separate string values with [,]
|
||||
;= EXAMPLE_SINGLE_VALUE = "myvar"
|
||||
;= EXAMPLE_ARRAY = "myvar1", "myvar2"
|
||||
;= =====================================================================================================
|
||||
|
||||
;= =====================================================================================================
|
||||
;= Basic Vars you must define
|
||||
;= =====================================================================================================
|
||||
EXTENSION_NAME = "Project List"
|
||||
EXTENSION_KEY = "listprojects_ext"
|
||||
EXTENSION_INIT_FILE = "ki_listprojects/init.php"
|
||||
EXTENSION_DIR = "ki_listprojects"
|
||||
|
||||
ADMIN_ALLOWED = "1"
|
||||
GROUP_LEADER_ALLOWED = "1"
|
||||
USER_ALLOWED = "1"
|
||||
CUSTOMER_ALLOWED = "0"
|
||||
|
||||
;= =====================================================================================================
|
||||
;= Hooks
|
||||
;= =====================================================================================================
|
||||
; you may set this to an empty string if you don't want a function called up on tabchange
|
||||
; multiple calls can be added using ";" as delimiter *inside* the quotes
|
||||
|
||||
; Hooklist:
|
||||
; TAB_CHANGE_TRIGGER - gets called when any tab was clicked, regardless if the tab is already active or not
|
||||
; TIMESPACE_CHANGE_TRIGGER - gets called everytime the datepicker picks a date (equally for start and end)
|
||||
; BUZZER_RECORD_TRIGGER - fires when the buzzer was clicked for recording (also true for "record again" in ts_ext)
|
||||
; BUZZER_STOP_TRIGGER - fires when the buzzer was hit in stop-state (true for stops in ts_ext)
|
||||
; CHANGE_KND_TRIGGER - gets called when any change happend on a customer record
|
||||
; CHANGE_PCT_TRIGGER - same for projects
|
||||
; CHANGE_EVT_TRIGGER - same for events/tasks
|
||||
; REG_TIMEOUTS - if you have timeouts running that do not need to run when the tab of your extension
|
||||
; is not active, register them here. they will be terminated on tabchange and you have
|
||||
; to restart them on triggerchange
|
||||
|
||||
; If you need a special hook for your extension please contact the core-team ;)
|
||||
|
||||
|
||||
TAB_CHANGE_TRIGGER = "listprojects_ext_triggerchange();"
|
||||
TIMESPACE_CHANGE_TRIGGER = "listprojects_ext_triggerTSS();"
|
||||
;BUZZER_RECORD_TRIGGER = "listprojects_ext_triggerREC();"
|
||||
;BUZZER_STOP_TRIGGER = "listprojects_ext_triggerSTP();"
|
||||
|
||||
;CHANGE_KND_TRIGGER =
|
||||
;CHANGE_PCT_TRIGGER =
|
||||
;CHANGE_EVT_TRIGGER =
|
||||
;REG_TIMEOUTS =
|
||||
|
||||
;= =====================================================================================================
|
||||
;= Optional Vars you could define
|
||||
;= =====================================================================================================
|
||||
|
||||
CSS_INCLUDE_FILES = "../extensions/ki_listprojects/css/demo.css.php"
|
||||
JS_INCLUDE_FILES[] = "../extensions/ki_listprojects/js/init.js"
|
||||
JS_INCLUDE_FILES[] = "../extensions/ki_listprojects/js/func.js"
|
||||
|
||||
50
extensions/ki_listprojects/css/demo.css.php
Normal file
50
extensions/ki_listprojects/css/demo.css.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
header('Content-type: text/css');
|
||||
$table_header = "../../../skins/standard/grfx/g3_table_header.png";
|
||||
?>
|
||||
|
||||
#listprojects_ext_wrap {
|
||||
border:1px solid #000;
|
||||
border-top:none;
|
||||
|
||||
width: 98%;
|
||||
left: 1%;
|
||||
position:absolute;
|
||||
overflow:hidden;
|
||||
margin:0;
|
||||
}
|
||||
|
||||
#listprojects_ext {
|
||||
padding:10px;
|
||||
|
||||
background-color: #eee;
|
||||
color:#000;
|
||||
overflow:auto;
|
||||
}
|
||||
|
||||
|
||||
#listprojects_ext_header {
|
||||
background-image: url('<?php echo $table_header; ?>');
|
||||
border:1px solid #000;
|
||||
color:#fff;
|
||||
padding:5px 10px;
|
||||
height:20px;
|
||||
overflow:hidden;
|
||||
position:absolute;
|
||||
}
|
||||
|
||||
#listprojects_ext_advanced {
|
||||
padding:10px;
|
||||
}
|
||||
|
||||
#listprojects_timespan {
|
||||
padding: 20px 0px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#listprojects_screenshot
|
||||
{
|
||||
float:left;
|
||||
margin-right:10px;
|
||||
}
|
||||
39
extensions/ki_listprojects/init.php
Normal file
39
extensions/ki_listprojects/init.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of
|
||||
* Kimai - Open Source Time Tracking // http://www.kimai.org
|
||||
* (c) 2006-2009 Kimai-Development-Team
|
||||
*
|
||||
* Kimai is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; Version 3, 29 June 2007
|
||||
*
|
||||
* Kimai is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Kimai; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// Include Basics
|
||||
include('../../includes/basics.php');
|
||||
|
||||
$usr = checkUser();
|
||||
// =========================================
|
||||
// = Get the currently displayed timespace =
|
||||
// =========================================
|
||||
$timespace = get_timespace();
|
||||
$in = $timespace[0];
|
||||
$out = $timespace[1];
|
||||
|
||||
// Set smarty config.
|
||||
require_once(WEBROOT.'libraries/smarty/Smarty.class.php');
|
||||
$tpl = new Smarty();
|
||||
$tpl->template_dir = 'templates/';
|
||||
$tpl->compile_dir = 'compile/';
|
||||
|
||||
$tpl->display('index.tpl');
|
||||
include_once './templates/index.php';
|
||||
?>
|
||||
0
extensions/ki_listprojects/install.php
Normal file
0
extensions/ki_listprojects/install.php
Normal file
52
extensions/ki_listprojects/js/func.js
Normal file
52
extensions/ki_listprojects/js/func.js
Normal file
@@ -0,0 +1,52 @@
|
||||
/**
|
||||
* This file is part of
|
||||
* Kimai - Open Source Time Tracking // http://www.kimai.org
|
||||
* (c) 2006-2009 Kimai-Development-Team
|
||||
*
|
||||
* Kimai is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; Version 3, 29 June 2007
|
||||
*
|
||||
* Kimai is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Kimai; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
function listprojects_ext_onload() {
|
||||
$("#loader").hide();
|
||||
}
|
||||
|
||||
function listprojects_ext_resize() {
|
||||
// function must exist, so init can register it as callback
|
||||
}
|
||||
|
||||
var background = new Array("#000000","#FFFF00","#76EE00","#CD3333","#B23AEE","#CDBE70");
|
||||
var text = new Array("#FFFFFF","#000000","#000000","#FFFFFF","#FFFFFF","#000000");
|
||||
|
||||
function listprojects_ext_triggerchange() {
|
||||
$("#testdiv").append(" This has been put here on tab change.");
|
||||
|
||||
array_target = Math.round(Math.random()*background.length);
|
||||
|
||||
$("#testdiv").css("color",text[array_target]);
|
||||
$("#testdiv").css("background-color",background[array_target]);
|
||||
}
|
||||
|
||||
function listprojects_ext_triggerTSS() {
|
||||
$.post(listprojects_ext_path + "processor.php", { axAction: "test", axValue: 0, id: 0 },
|
||||
function(data) {
|
||||
$('#demo_timespace > span.timespace_target').html(data);
|
||||
});
|
||||
}
|
||||
|
||||
function listprojects_ext_triggerREC() {
|
||||
logfile("trigger REC listprojects_ext");
|
||||
}
|
||||
|
||||
function listprojects_ext_triggerSTP() {
|
||||
logfile("trigger STP listprojects_ext");
|
||||
}
|
||||
53
extensions/ki_listprojects/js/init.js
Normal file
53
extensions/ki_listprojects/js/init.js
Normal file
@@ -0,0 +1,53 @@
|
||||
/**
|
||||
* This file is part of
|
||||
* Kimai - Open Source Time Tracking // http://www.kimai.org
|
||||
* (c) 2006-2009 Kimai-Development-Team
|
||||
*
|
||||
* Kimai is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; Version 3, 29 June 2007
|
||||
*
|
||||
* Kimai is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Kimai; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/****************************************************************************************************
|
||||
*
|
||||
* IMPORTANT NOTE:
|
||||
*
|
||||
* If you like a function to run when your extension is loaded into the extension-frame
|
||||
* you CAN'T use the methods you'd normally use when the dom is ready build! So something like:
|
||||
*
|
||||
*
|
||||
* $(document).ready(function(){
|
||||
* [do something stupid...]
|
||||
* });
|
||||
*
|
||||
*
|
||||
* ... won't work here.
|
||||
* This is because the dom is already finished loading BEFORE the extensions are hooked in!
|
||||
* When You want JavaScript or jQuery to do something when your extension is loaded into its
|
||||
* place in the *existing* DOM, you have to put a function-call *into* the content you load.
|
||||
* You can also use the jQuery ready-funktion there!
|
||||
*
|
||||
****************************************************************************************************/
|
||||
|
||||
// set path of extension
|
||||
var listprojects_ext_path = "../extensions/ki_listprojects/";
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
var listprojects_ext_resizeTimer = null;
|
||||
|
||||
$(window).bind('resize', function() {
|
||||
if (listprojects_ext_resizeTimer) clearTimeout(listprojects_ext_resizeTimer);
|
||||
listprojects_ext_resizeTimer = setTimeout(listprojects_ext_resize, 500);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
33
extensions/ki_listprojects/processor.php
Normal file
33
extensions/ki_listprojects/processor.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of
|
||||
* Kimai - Open Source Time Tracking // http://www.kimai.org
|
||||
* (c) 2006-2009 Kimai-Development-Team
|
||||
*
|
||||
* Kimai is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; Version 3, 29 June 2007
|
||||
*
|
||||
* Kimai is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Kimai; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// Always include the Kimai Standard Processor Initialization!
|
||||
|
||||
// insert KSPI
|
||||
$isCoreProcessor = 0;
|
||||
$dir_templates = "templates/";
|
||||
require("../../includes/kspi.php");
|
||||
|
||||
switch ($axAction) {
|
||||
case 'test':
|
||||
echo $kga['usr']['timespace_in'];
|
||||
break;
|
||||
}
|
||||
|
||||
?>
|
||||
45
extensions/ki_listprojects/templates/index.php
Normal file
45
extensions/ki_listprojects/templates/index.php
Normal file
@@ -0,0 +1,45 @@
|
||||
|
||||
<div class="CSSTableGenerator" >
|
||||
|
||||
<p>
|
||||
<?php
|
||||
try {
|
||||
$con = new PDO('mysql:host=localhost;port=3306;dbname=kimai', "kimai", "kimai");
|
||||
$con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$query = "select DISTINCT
|
||||
k.knd_name as 'Company Name',
|
||||
p.pct_name as 'Project'
|
||||
from kimai15_pct p
|
||||
inner join kimai15_knd k on p.pct_kndID=k.knd_ID
|
||||
where p.pct_visible = 1
|
||||
order by p.pct_name";
|
||||
|
||||
//first pass just gets the column names
|
||||
echo '<table id="myTable" border="1" cellpadding="3" cellspacing="0">';
|
||||
$result = $con->query($query);
|
||||
//return only the first row (we only need field names)
|
||||
$row = $result->fetch(PDO::FETCH_ASSOC);
|
||||
echo " <tr> \n";
|
||||
foreach ($row as $field => $value) {
|
||||
echo " <th>$field</th> \n";
|
||||
} // end foreach
|
||||
echo " </tr> \n";
|
||||
//second query gets the data
|
||||
$data = $con->query($query);
|
||||
$data->setFetchMode(PDO::FETCH_ASSOC);
|
||||
foreach ($data as $row) {
|
||||
echo " <tr> \n";
|
||||
foreach ($row as $name => $value) {
|
||||
echo " <td>$value</td> \n";
|
||||
} // end field loop
|
||||
echo " </tr> \n";
|
||||
} // end record loop
|
||||
echo "</table> \n";
|
||||
} catch (PDOException $e) {
|
||||
echo 'ERROR: ' . $e->getMessage();
|
||||
} // end try
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
22
extensions/ki_listprojects/templates/index.tpl
Normal file
22
extensions/ki_listprojects/templates/index.tpl
Normal file
@@ -0,0 +1,22 @@
|
||||
{* IMPORTANT NOTE:
|
||||
Javascript or jQuery stuff that should run when your extension *has finished loading*
|
||||
should sit in an special onload function like this:
|
||||
*}
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
listprojects_ext_onload();
|
||||
});
|
||||
</script>
|
||||
|
||||
{/literal}
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="listprojects_ext_wrap" width="100%">
|
||||
<div id ="listprojects_ext" width="100%">
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user