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