Skip to content

Commit b69a70c

Browse files
authored
Merge pull request #1213 from itflow-org/develop
Develop to Master - 25.03.5 Release
2 parents d92f0fc + 9230019 commit b69a70c

37 files changed

+515
-510
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22

33
This file documents all notable changes made to ITFlow.
44

5+
## [25.03.5]
6+
7+
### Fixed
8+
- Fixed the user listing issue when copying a trip.
9+
- Corrected the display of recurring invoice amounts on the dashboard.
10+
- Fixed the linking of entities with assets and contacts.
11+
- Resolved the issue with displaying the correct mobile country code in the contact listing.
12+
- Set the default date to `9999-12-31` to ensure future items (like invoices) are displayed by default.
13+
- Fixed the display issue where file folders were not showing properly during document creation.
14+
- Migrated from Dragula to SortableJS for a more modern, mobile-friendly solution.
15+
- Added Handlebars icons for drag-and-drop items.
16+
- Changed behavior to open Contact and Asset Details pages directly instead of using a modal.
17+
518
## [25.03.4]
619

720
### Fixed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ If you want to improve ITFlow, feel free to fork the repo and create a pull requ
9393
We’re incredibly grateful to the organizations and individuals who support the project - a big thank you to:
9494
- CompuMatter
9595
- F1 for HELP
96+
- JetBrains (PhpStorm)
9697

9798
## License
9899
ITFlow is distributed "as is" under the GPL License, WITHOUT WARRANTY OF ANY KIND. See [`LICENSE`](https://github.com/itflow-org/itflow/blob/master/LICENSE) for details.

admin_settings_ticket.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,31 @@
7272
<input type="email" class="form-control" name="config_ticket_new_ticket_notification_email" placeholder="Address to notify for new tickets, leave blank for none" value="<?php echo nullable_htmlentities($config_ticket_new_ticket_notification_email); ?>">
7373
</div>
7474
</div>
75+
76+
<div class="form-group">
77+
<label>Tickets Default View</label>
78+
<div class="input-group">
79+
<div class="input-group-prepend">
80+
<span class="input-group-text"><i class="fa fa-fw fa-eye"></i></span>
81+
</div>
82+
<select class="form-control" name="config_ticket_default_view">
83+
<option value=0 <?php if ($config_ticket_default_view == 0) { echo "selected"; } ?>>List</option>
84+
<option value=1 <?php if ($config_ticket_default_view == 1) { echo "selected"; } ?>>Compact</option>
85+
<option value=2 <?php if ($config_ticket_default_view == 2) { echo "selected"; } ?>>Kanban</option>
86+
</select>
87+
</div>
88+
</div>
89+
<div class="form-group">
90+
<label>Kanban Settings</label>
91+
<div class="custom-control custom-switch">
92+
<input type="checkbox" class="custom-control-input" name="config_ticket_ordering" <?php if ($config_ticket_ordering == 1) { echo "checked"; } ?> value="1" id="ticketOrderingSwitch">
93+
<label class="custom-control-label" for="ticketOrderingSwitch">Allow ticket ordering within its column<small class="text-secondary">(uncheked will result in ordering it by priority and id)</small></label>
94+
</div>
95+
<div class="custom-control custom-switch">
96+
<input type="checkbox" class="custom-control-input" name="config_ticket_moving_columns" <?php if ($config_ticket_moving_columns == 1) { echo "checked"; } ?> value="1" id="ticketMovingColumnsSwitch">
97+
<label class="custom-control-label" for="ticketMovingColumnsSwitch">Allow moving columns</label>
98+
</div>
99+
</div>
75100

76101
<hr>
77102

admin_ticket_template_details.php

Lines changed: 117 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -30,156 +30,139 @@
3030
$sql_task_templates = mysqli_query($mysqli, "SELECT * FROM task_templates WHERE task_template_ticket_template_id = $ticket_template_id ORDER BY task_template_order ASC, task_template_id ASC");
3131

3232
?>
33-
<link rel="stylesheet" href="plugins/dragula/dragula.min.css">
34-
35-
<ol class="breadcrumb d-print-none">
36-
<li class="breadcrumb-item">
37-
<a href="clients.php">Home</a>
38-
</li>
39-
<li class="breadcrumb-item">
40-
<a href="admin_user.php">Admin</a>
41-
</li>
42-
<li class="breadcrumb-item">
43-
<a href="admin_ticket_template.php">Ticket Templates</a>
44-
</li>
45-
<li class="breadcrumb-item active"><i class="fas fa-life-ring mr-2"></i><?php echo $ticket_template_name; ?></li>
46-
</ol>
47-
48-
<div class="row">
49-
<div class="col-8">
50-
51-
<div class="card card-dark">
52-
<div class="card-header">
53-
<h3 class="card-title mt-2">
54-
<div class="media">
55-
<i class="fa fa-fw fa-2x fa-life-ring mr-3"></i>
56-
<div class="media-body">
57-
<h3 class="mb-0"><?php echo $ticket_template_name; ?></h3>
58-
<div><small class="text-secondary"><?php echo $ticket_template_description; ?></small></div>
59-
</div>
33+
34+
<ol class="breadcrumb d-print-none">
35+
<li class="breadcrumb-item">
36+
<a href="clients.php">Home</a>
37+
</li>
38+
<li class="breadcrumb-item">
39+
<a href="admin_user.php">Admin</a>
40+
</li>
41+
<li class="breadcrumb-item">
42+
<a href="admin_ticket_template.php">Ticket Templates</a>
43+
</li>
44+
<li class="breadcrumb-item active"><i class="fas fa-life-ring mr-2"></i><?php echo $ticket_template_name; ?></li>
45+
</ol>
46+
47+
<div class="row">
48+
<div class="col-8">
49+
50+
<div class="card card-dark">
51+
<div class="card-header">
52+
<h3 class="card-title mt-2">
53+
<div class="media">
54+
<i class="fa fa-fw fa-2x fa-life-ring mr-3"></i>
55+
<div class="media-body">
56+
<h3 class="mb-0"><?php echo $ticket_template_name; ?></h3>
57+
<div><small class="text-secondary"><?php echo $ticket_template_description; ?></small></div>
6058
</div>
61-
</h3>
62-
<div class="card-tools">
63-
<button type="button" class="btn btn-default btn-sm" data-toggle="modal" data-target="#editTicketTemplateModal">
64-
<i class="fas fa-edit"></i>
65-
</button>
6659
</div>
67-
</div>
68-
<h5><?php echo $ticket_template_subject; ?></h5>
69-
<div class="card-body prettyContent">
70-
<?php echo $ticket_template_details; ?>
60+
</h3>
61+
<div class="card-tools">
62+
<button type="button" class="btn btn-default btn-sm" data-toggle="modal" data-target="#editTicketTemplateModal">
63+
<i class="fas fa-edit"></i>
64+
</button>
7165
</div>
7266
</div>
73-
67+
<h5><?php echo $ticket_template_subject; ?></h5>
68+
<div class="card-body prettyContent">
69+
<?php echo $ticket_template_details; ?>
70+
</div>
7471
</div>
7572

76-
<div class="col-4">
73+
</div>
7774

78-
<div class="card card-dark">
79-
<div class="card-header">
80-
<h5 class="card-title"><i class="fa fa-fw fa-tasks mr-2"></i>Tasks</h5>
81-
</div>
82-
<div class="card-body">
83-
<form action="post.php" method="post" autocomplete="off">
84-
<input type="hidden" name="ticket_template_id" value="<?php echo $ticket_template_id; ?>">
85-
<div class="form-group">
86-
<div class="input-group">
87-
<div class="input-group-prepend">
88-
<span class="input-group-text"><i class="fa fa-fw fa-tasks"></i></span>
89-
</div>
90-
<input type="text" class="form-control" name="task_name" placeholder="Create a task" required>
91-
<div class="input-group-append">
92-
<button type="submit" name="add_ticket_template_task" class="btn btn-primary"><i class="fas fa-fw fa-check"></i></button>
93-
</div>
75+
<div class="col-4">
76+
77+
<div class="card card-dark">
78+
<div class="card-header">
79+
<h5 class="card-title"><i class="fa fa-fw fa-tasks mr-2"></i>Tasks</h5>
80+
</div>
81+
<div class="card-body">
82+
<form action="post.php" method="post" autocomplete="off">
83+
<input type="hidden" name="ticket_template_id" value="<?php echo $ticket_template_id; ?>">
84+
<div class="form-group">
85+
<div class="input-group">
86+
<div class="input-group-prepend">
87+
<span class="input-group-text"><i class="fa fa-fw fa-tasks"></i></span>
88+
</div>
89+
<input type="text" class="form-control" name="task_name" placeholder="Create a task" required>
90+
<div class="input-group-append">
91+
<button type="submit" name="add_ticket_template_task" class="btn btn-primary"><i class="fas fa-fw fa-check"></i></button>
9492
</div>
9593
</div>
96-
</form>
97-
<table class="table table-striped table-sm">
98-
<?php
99-
while($row = mysqli_fetch_array($sql_task_templates)){
100-
$task_id = intval($row['task_template_id']);
101-
$task_name = nullable_htmlentities($row['task_template_name']);
102-
$task_completion_estimate = intval($row['task_template_completion_estimate']);
103-
$task_description = nullable_htmlentities($row['task_template_description']);
104-
?>
105-
<tr data-task-id="<?php echo $task_id; ?>">
106-
<td><i class="far fa-fw fa-square text-secondary"></i></td>
107-
<td>
108-
<a href="#" class="grab-cursor">
109-
<span class="text-secondary"><?php echo $task_completion_estimate; ?>m</span>
110-
<span class="text-dark"> - <?php echo $task_name; ?></span>
111-
</a>
112-
</td>
113-
<td class="text-right">
114-
<div class="float-right">
115-
<div class="dropdown dropleft text-center">
116-
<button class="btn btn-link text-secondary btn-sm" type="button" data-toggle="dropdown">
117-
<i class="fas fa-fw fa-ellipsis-v"></i>
118-
</button>
119-
<div class="dropdown-menu">
120-
<a class="dropdown-item" href="#"
121-
data-toggle = "ajax-modal"
122-
data-ajax-url = "ajax/ajax_ticket_template_task_edit.php"
123-
data-ajax-id = "<?php echo $task_id; ?>"
124-
>
125-
<i class="fas fa-fw fa-edit mr-2"></i>Edit
126-
</a>
127-
<div class="dropdown-divider"></div>
128-
<a class="dropdown-item text-danger confirm-link" href="post.php?delete_task_template=<?php echo $task_id; ?>&csrf_token=<?php echo $_SESSION['csrf_token'] ?>">
129-
<i class="fas fa-fw fa-trash-alt mr-2"></i>Delete
130-
</a>
131-
</div>
94+
</div>
95+
</form>
96+
<table class="table table-sm" id="tasks">
97+
<?php
98+
while($row = mysqli_fetch_array($sql_task_templates)){
99+
$task_id = intval($row['task_template_id']);
100+
$task_name = nullable_htmlentities($row['task_template_name']);
101+
$task_completion_estimate = intval($row['task_template_completion_estimate']);
102+
$task_description = nullable_htmlentities($row['task_template_description']);
103+
?>
104+
<tr data-task-id="<?php echo $task_id; ?>">
105+
<td>
106+
<a href="#" class="drag-handle"><i class="fas fa-bars text-muted mr-1"></i></a>
107+
<span class="text-secondary"><?php echo $task_completion_estimate; ?>m</span>
108+
<span class="text-dark"> - <?php echo $task_name; ?></span>
109+
</td>
110+
<td class="text-right">
111+
<div class="float-right">
112+
<div class="dropdown dropleft text-center">
113+
<button class="btn btn-link text-secondary btn-sm" type="button" data-toggle="dropdown">
114+
<i class="fas fa-fw fa-ellipsis-v"></i>
115+
</button>
116+
<div class="dropdown-menu">
117+
<a class="dropdown-item" href="#"
118+
data-toggle = "ajax-modal"
119+
data-ajax-url = "ajax/ajax_ticket_template_task_edit.php"
120+
data-ajax-id = "<?php echo $task_id; ?>"
121+
>
122+
<i class="fas fa-fw fa-edit mr-2"></i>Edit
123+
</a>
124+
<div class="dropdown-divider"></div>
125+
<a class="dropdown-item text-danger confirm-link" href="post.php?delete_task_template=<?php echo $task_id; ?>&csrf_token=<?php echo $_SESSION['csrf_token'] ?>">
126+
<i class="fas fa-fw fa-trash-alt mr-2"></i>Delete
127+
</a>
132128
</div>
133129
</div>
134-
</td>
135-
</tr>
136-
<?php
137-
}
138-
?>
139-
</table>
140-
</div>
130+
</div>
131+
</td>
132+
</tr>
133+
<?php
134+
}
135+
?>
136+
</table>
141137
</div>
142-
143138
</div>
144139

145140
</div>
146141

147-
<script src="js/pretty_content.js"></script>
148-
<script src="plugins/dragula/dragula.min.js"></script>
149-
<script>
150-
$(document).ready(function() {
151-
var container = $('.table tbody')[0];
152-
153-
dragula([container])
154-
.on('drop', function (el, target, source, sibling) {
155-
// Handle the drop event to update the order in the database
156-
var rows = $(container).children();
157-
var positions = rows.map(function(index, row) {
158-
return {
159-
id: $(row).data('taskId'),
160-
order: index
161-
};
162-
}).get();
163-
164-
// Send the new order to the server
165-
$.ajax({
166-
url: 'ajax.php',
167-
method: 'POST',
168-
data: {
169-
update_task_templates_order: true, // Adjust the parameter name if needed
170-
ticket_template_id: <?php echo $ticket_template_id; ?>,
171-
positions: positions
172-
},
173-
success: function(data) {
174-
// Handle success
175-
},
176-
error: function(error) {
177-
console.error('Error updating order:', error);
178-
}
179-
});
180-
});
181-
});
182-
</script>
142+
</div>
143+
144+
<script src="js/pretty_content.js"></script>
145+
146+
<script src="plugins/SortableJS/Sortable.min.js"></script>
147+
<script>
148+
new Sortable(document.querySelector('table#tasks tbody'), {
149+
handle: '.drag-handle',
150+
animation: 150,
151+
onEnd: function (evt) {
152+
const rows = document.querySelectorAll('table#tasks tbody tr');
153+
const positions = Array.from(rows).map((row, index) => ({
154+
id: row.dataset.taskId,
155+
order: index
156+
}));
157+
158+
$.post('ajax.php', {
159+
update_task_templates_order: true,
160+
ticket_template_id: <?php echo $ticket_template_id; ?>,
161+
positions: positions
162+
});
163+
}
164+
});
165+
</script>
183166

184167
<?php
185168

ajax.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,13 +586,13 @@
586586
enforceUserPermission('module_sales', 2);
587587

588588
$positions = $_POST['positions'];
589-
$recurring_id = intval($_POST['recurring_id']);
589+
$recurring_invoice_id = intval($_POST['recurring_invoice_id']);
590590

591591
foreach ($positions as $position) {
592592
$id = intval($position['id']);
593593
$order = intval($position['order']);
594594

595-
mysqli_query($mysqli, "UPDATE invoice_items SET item_order = $order WHERE item_recurring_id = $recurring_id AND item_id = $id");
595+
mysqli_query($mysqli, "UPDATE invoice_items SET item_order = $order WHERE item_recurring_invoice_id = $recurring_invoice_id AND item_id = $id");
596596
}
597597

598598
// return a response

ajax/ajax_trip_copy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115

116116
$sql_users = mysqli_query($mysqli, "SELECT users.user_id, user_name FROM users
117117
LEFT JOIN user_settings on users.user_id = user_settings.user_id
118-
WHERE user_role > 1 AND user_archived_at IS NULL ORDER BY user_name ASC"
118+
WHERE user_role_id > 1 AND user_archived_at IS NULL ORDER BY user_name ASC"
119119
);
120120
while ($row = mysqli_fetch_array($sql_users)) {
121121
$user_id_select = intval($row['user_id']);

asset_details.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@
244244
data-ajax-id="<?php echo $asset_id; ?>">
245245
<i class="fas fa-fw fa-edit"></i>
246246
</button>
247-
<h3 class="text-bold"><i class="fa fa-fw text-secondary fa-<?php echo $device_icon; ?> mr-3"></i><?php echo $asset_name; ?></h3>
247+
<h4 class="text-bold"><i class="fa fa-fw text-secondary fa-<?php echo $device_icon; ?> mr-3"></i><?php echo $asset_name; ?></h4>
248248
<?php if ($asset_photo) { ?>
249249
<img class="img-fluid img-circle p-3" alt="asset_photo" src="<?php echo "uploads/clients/$client_id/$asset_photo"; ?>">
250250
<?php } ?>
@@ -405,7 +405,7 @@
405405

406406
<div class="card card-dark">
407407
<div class="card-header py-2">
408-
<h3 class="card-title mt-2"><i class="fa fa-fw fa-ethernet mr-2"></i><?php echo $asset_name; ?> Network Interfaces</h3>
408+
<h3 class="card-title mt-2"><i class="fa fa-fw fa-ethernet mr-2"></i>Interfaces</h3>
409409
<div class="card-tools">
410410
<div class="btn-group">
411411
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addAssetInterfaceModal">

0 commit comments

Comments
 (0)