|
|
@ -1,10 +1,12 @@
|
|
|
|
<?php
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
use Engelsystem\Database\Db;
|
|
|
|
use Engelsystem\Database\Db;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Load a single work log entry.
|
|
|
|
* Load a single work log entry.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param int $user_worklog_id
|
|
|
|
* @param int $user_worklog_id
|
|
|
|
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function UserWorkLog($user_worklog_id)
|
|
|
|
function UserWorkLog($user_worklog_id)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -16,7 +18,8 @@ function UserWorkLog($user_worklog_id)
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns all work log entries for a user.
|
|
|
|
* Returns all work log entries for a user.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param User $user
|
|
|
|
* @param array $user
|
|
|
|
|
|
|
|
* @return array[]
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function UserWorkLogsForUser($user)
|
|
|
|
function UserWorkLogsForUser($user)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -28,7 +31,8 @@ function UserWorkLogsForUser($user)
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Delete a work log entry.
|
|
|
|
* Delete a work log entry.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param UserWorkLog $userWorkLog
|
|
|
|
* @param $userWorkLog
|
|
|
|
|
|
|
|
* @return int
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function UserWorkLog_delete($userWorkLog)
|
|
|
|
function UserWorkLog_delete($userWorkLog)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -37,7 +41,12 @@ function UserWorkLog_delete($userWorkLog)
|
|
|
|
$userWorkLog['id']
|
|
|
|
$userWorkLog['id']
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
engelsystem_log(sprintf('Delete work log for %s, %s hours, %s', User_Nick_render($user_source), $userWorkLog['work_hours'], $userWorkLog['comment']));
|
|
|
|
engelsystem_log(sprintf(
|
|
|
|
|
|
|
|
'Delete work log for %s, %s hours, %s',
|
|
|
|
|
|
|
|
User_Nick_render($user_source),
|
|
|
|
|
|
|
|
$userWorkLog['work_hours'],
|
|
|
|
|
|
|
|
$userWorkLog['comment']
|
|
|
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
|
|
return $result;
|
|
|
|
return $result;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -45,7 +54,8 @@ function UserWorkLog_delete($userWorkLog)
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Update work log entry (only work hours and comment)
|
|
|
|
* Update work log entry (only work hours and comment)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param UserWorkLog $userWorkLog
|
|
|
|
* @param $userWorkLog
|
|
|
|
|
|
|
|
* @return int
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function UserWorkLog_update($userWorkLog)
|
|
|
|
function UserWorkLog_update($userWorkLog)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -62,7 +72,12 @@ function UserWorkLog_update($userWorkLog)
|
|
|
|
$userWorkLog['id']
|
|
|
|
$userWorkLog['id']
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
engelsystem_log(sprintf('Updated work log for %s, %s hours, %s', User_Nick_render($user_source), $userWorkLog['work_hours'], $userWorkLog['comment']));
|
|
|
|
engelsystem_log(sprintf(
|
|
|
|
|
|
|
|
'Updated work log for %s, %s hours, %s',
|
|
|
|
|
|
|
|
User_Nick_render($user_source),
|
|
|
|
|
|
|
|
$userWorkLog['work_hours'],
|
|
|
|
|
|
|
|
$userWorkLog['comment'])
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
return $result;
|
|
|
|
return $result;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -70,7 +85,8 @@ function UserWorkLog_update($userWorkLog)
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Create a new work log entry
|
|
|
|
* Create a new work log entry
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param UserWorkLog $userWorkLog
|
|
|
|
* @param $userWorkLog
|
|
|
|
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function UserWorkLog_create($userWorkLog)
|
|
|
|
function UserWorkLog_create($userWorkLog)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -95,7 +111,8 @@ function UserWorkLog_create($userWorkLog)
|
|
|
|
time()
|
|
|
|
time()
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
engelsystem_log(sprintf('Added work log entry for %s, %s hours, %s', User_Nick_render($user_source), $userWorkLog['work_hours'], $userWorkLog['comment']));
|
|
|
|
engelsystem_log(sprintf('Added work log entry for %s, %s hours, %s', User_Nick_render($user_source),
|
|
|
|
|
|
|
|
$userWorkLog['work_hours'], $userWorkLog['comment']));
|
|
|
|
|
|
|
|
|
|
|
|
return $result;
|
|
|
|
return $result;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -104,6 +121,7 @@ function UserWorkLog_create($userWorkLog)
|
|
|
|
* New user work log entry
|
|
|
|
* New user work log entry
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param array[] $user
|
|
|
|
* @param array[] $user
|
|
|
|
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function UserWorkLog_new($user)
|
|
|
|
function UserWorkLog_new($user)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -119,5 +137,3 @@ function UserWorkLog_new($user)
|
|
|
|
'comment' => ''
|
|
|
|
'comment' => ''
|
|
|
|
];
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
|