Skip to content
This repository was archived by the owner on Oct 22, 2026. It is now read-only.
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
48 changes: 42 additions & 6 deletions app/Domain/Tickets/Templates/submodules/ticketDetails.sub.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ class="autosave-field"
</div>
<div style="padding-top:6px;">
<?php if ($login::userIsAtLeast($roles::$editor)) { ?>
<a href="javascript:void(0);" onclick="jQuery('#editorId').val(<?php echo session('userdata.id'); ?>).trigger('chosen:updated');"><?php echo $tpl->__('label.assign_to_me'); ?></a>
<?php } ?>
<a href="javascript:void(0);" onclick="assignToMe();"><?php echo $tpl->__('label.assign_to_me'); ?></a> <?php } ?>
</div>
</div>

Expand Down Expand Up @@ -219,6 +218,46 @@ function loadStatusHistory(ticketId) {
}
});
}
window.assignToMe = function() {
const userId = <?php echo session('userdata.id'); ?>;
const $editorSelect = $('#editorId');
const currentEditorId = $editorSelect.val();

if (currentEditorId == userId) {
return;
}

const ticketId = $('#status-change-log').data('ticket-id');
const user = $('#status-select').data('user') || 'Unknown User';

const oldStatusText = $editorSelect.data('old-status');
const newStatusText = '<?php echo addslashes($currentUserName); ?>';

$editorSelect.val(userId).trigger('chosen:updated');
$editorSelect.data('old-status', newStatusText);

$.ajax({
url: '<?= BASE_URL ?>/tickets/ticketHistoryController/logStatusChange',
method: 'POST',
data: {
ticketId: ticketId,
oldStatus: currentEditorId,
newStatus: userId,
oldStatusText: oldStatusText,
newStatusText: newStatusText,
user: user,
detailsAttributeId: 'editorId'
},
success: function(response) {
$('.saveTicketBtn').trigger('click');
loadStatusHistory(ticketId);
},
error: function(xhr, status, error) {
console.error('Error saving status:', error);
console.error('Response:', xhr.responseText);
}
});
};

const ticketIdOnLoad = $('#status-change-log').data('ticket-id');
if (ticketIdOnLoad) {
Expand Down Expand Up @@ -278,7 +317,7 @@ function loadStatusHistory(ticketId) {
const user = $(this).data('user') || 'Unknown User';

$.ajax({
url: '/tickets/ticketHistoryController/logStatusChange',
url: '<?= BASE_URL ?>/tickets/ticketHistoryController/logStatusChange',
method: 'POST',
data: {
ticketId: ticketId,
Expand All @@ -290,7 +329,6 @@ function loadStatusHistory(ticketId) {
detailsAttributeId: changedElementId
},
success: function(response) {
console.log('Status change saved', response);
loadStatusHistory(ticketId);
},
error: function(xhr, status, error) {
Expand All @@ -309,7 +347,6 @@ function loadStatusHistory(ticketId) {
const oldStatusText = $(this).data('old-status');
const newStatusText = $(this).val();
const user = $(this).data('user') || 'Unknown User';
console.log('Date: ', oldStatusText, newStatusText);

$.ajax({
url: '<?= BASE_URL ?>/tickets/ticketHistoryController/logStatusChange',
Expand All @@ -324,7 +361,6 @@ function loadStatusHistory(ticketId) {
detailsAttributeId: changedElementId
},
success: function(response) {
console.log('Status change saved', response);
loadStatusHistory(ticketId);
},
error: function(xhr, status, error) {
Expand Down
10 changes: 6 additions & 4 deletions app/Domain/Timesheets/Templates/showMy.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@
</div>

</div>
<div style=" width: 100%;">
<div style=" width: 100%; overflow-x:scroll;">
<table cellpadding="0" width="100%" class="table table-bordered display timesheetTable" id="dyntableX" data-hours-format="<?= $tpl->escape($hoursFormat); ?>">
<colgroup>
<col class="con0" >
Expand Down Expand Up @@ -422,8 +422,10 @@ class="hourCell"
<?php } ?>

<!-- Row to add new time registration -->
<tr class="gradeA timesheetRow" style="z-index: 9999;" >
<td width="14%" style="z-index: 9999;" >
<tr class="gradeA timesheetRow">
<td width="5%">-</td>
<td width="5%">-</td>
<td width="12%">
<div class="form-group" id="projectSelect">
<select data-placeholder="<?php echo $tpl->__('input.placeholders.choose_project')?>" class="project-select">
<option value=""></option>
Expand Down Expand Up @@ -474,7 +476,7 @@ class="hourCell"
</div>
</td>
<td width="8%">
<select class="kind-select" name="kindId">
<select class="kind-select" name="kindId" style="width:150px;">
<?php foreach ($tpl->get('kind') as $key => $kindRow) { ?>
<?php echo '<option value='.$key.'>'.$tpl->__($kindRow).'</option>'; ?>
<?php }?>
Expand Down
7 changes: 0 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading