Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kimai v2 bug fixes #24

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Form/OvertimeByUserForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ class OvertimeByUserForm extends AbstractType
{
/**
* Simplify cross linking between pages by removing the block prefix.
*
* @return null|string
*/
public function getBlockPrefix(): string
{
return null;
return '';
}

/**
Expand Down
12 changes: 12 additions & 0 deletions Resources/translations/messages.de.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,18 @@
<source>label.overtime</source>
<target>Überstunden</target>
</trans-unit>
<trans-unit id="label.user">
<source>label.user</source>
<target>Benutzer</target>
</trans-unit>
<trans-unit id="label.date">
<source>label.date</source>
<target>Datum</target>
</trans-unit>
<trans-unit id="label.duration">
<source>label.duration</source>
<target>Dauer</target>
</trans-unit>
<trans-unit id="description.overtime_history">
<source>description.overtime_history</source>
<target>
Expand Down
12 changes: 12 additions & 0 deletions Resources/translations/messages.en.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,18 @@
<source>label.overtime</source>
<target>Overtime</target>
</trans-unit>
<trans-unit id="label.user">
<source>label.user</source>
<target>User</target>
</trans-unit>
<trans-unit id="label.date">
<source>label.date</source>
<target>User</target>
</trans-unit>
<trans-unit id="label.duration">
<source>label.duration</source>
<target>Duration</target>
</trans-unit>
<trans-unit id="description.overtime_history">
<source>description.overtime_history</source>
<target>
Expand Down
12 changes: 12 additions & 0 deletions Resources/translations/messages.hr.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,18 @@
<source>label.overtime</source>
<target>Tijekom vremena</target>
</trans-unit>
<trans-unit id="label.user">
<source>label.user</source>
<target>Korisnik</target>
</trans-unit>
<trans-unit id="label.date">
<source>label.date</source>
<target>Datum</target>
</trans-unit>
<trans-unit id="label.duration">
<source>label.duration</source>
<target>Trajanje</target>
</trans-unit>
<trans-unit id="description.overtime_history">
<source>description.overtime_history</source>
<target>
Expand Down
10 changes: 10 additions & 0 deletions Resources/views/report_by_user.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,22 @@
window.location.href = '{{ path('not_approved',{'approveId':approveId,'user':user.id,'date':current|date('Y-m-d')}) }}'.replace(/&amp;/g,'&');
}
}
function denyAction() {
if (confirm('{{ 'label.undoMessage'|trans }}'.replace(/&quot;/g,'"')) === true) {
window.location.href = '{{ path('denied',{'approveId':approveId,'user':user.id,'date':current|date('Y-m-d')}) }}'.replace(/&amp;/g,'&');
}
}

let undoButton = document.getElementById("undoButton");
if (undoButton) {
undoButton.addEventListener("click", undoAction);
}

let deniedButton = document.getElementById("deniedButton");
if (deniedButton) {
deniedButton.addEventListener("click", denyAction);
}

</script>
{% endblock %}

Expand Down
4 changes: 2 additions & 2 deletions Resources/views/settings_overtime_history.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<td>
{% set deleteLinkPath = path('delete_overtime_history', {'entryId': entry.id }) %}
<button type="button" class="btn btn-sm btn-warning closeModal"
onclick="$('#deniedLink').attr('href', '{{ deleteLinkPath }}');">
onclick="window.location.href='{{deleteLinkPath}}'">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if this change is related with jQuery that was removed from Kimai.

If yes, your change is a good approach, but have a lot of places using jQuery.

I made this workaround that maybe fixed all problems related as jQuery
bee83f9

I know that isn't the best because is a request to an external package, but was the most simple and fast solution that I found.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either works, but I agree that it should be standardized throughout. I went with this method as it was already used in a few other places throughout the codebase and didn't require any external dependencies.

<i class="fa fa-trash"></i>
</button>
</td>
Expand Down Expand Up @@ -81,7 +81,7 @@
$("#deleteMessage").hide();
}
});
});
});
</script>
{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion Resources/views/settings_workday_history.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<td>
{% set deleteLinkPath = path('delete_workday_history', {'entryId': entry.id }) %}
<button type="button" class="btn btn-sm btn-warning closeModal"
onclick="$('#deniedLink').attr('href', '{{ deleteLinkPath }}');">
onclick="window.location.href='{{deleteLinkPath}}'">
<i class="fa fa-trash"></i>
</button>
</td>
Expand Down
Loading