Skip to content

Commit 12e0b5d

Browse files
authored
Merge pull request #819 from boxwise/fix-timestamp-creating-qr
Fix more timestamps
2 parents f498a9d + adef99d commit 12e0b5d

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

include/people_deactivated.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ function () use (&$data) {
161161
}
162162

163163
// Optimized by using bulk inserts and transactions over delete queries
164-
[$success, $message, $redirect] = listBulkRealDelete($table, $ids);
164+
[$success, $message, $redirect] = listBulkRealDelete($table, $ids, $now);
165165

166166
return [$success, $message, $redirect];
167167
});

library/lib/list.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function listBulkMove($table, $ids, $regardparent = true, $hook = '', $updatetra
9191
return [true, $return, false, $aftermove];
9292
}
9393

94-
function listBulkRealDelete($table, $ids, $uri = false)
94+
function listBulkRealDelete($table, $ids, $now = null)
9595
{
9696
global $translate, $action;
9797

@@ -108,7 +108,7 @@ function listBulkRealDelete($table, $ids, $uri = false)
108108
}
109109
}
110110

111-
simpleBulkSaveChangeHistory($table, $deletedIds, 'Record deleted without undelete');
111+
simpleBulkSaveChangeHistory($table, $deletedIds, 'Record deleted without undelete', $now);
112112

113113
if ($count) {
114114
return [true, $translate['cms_list_deletesuccess'], true];

pdf/qr.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ function () {
3737
$_GET['count'] = count($labels);
3838
}
3939

40+
$now = date('Y-m-d H:i:s');
4041
$box_ids_without_qr = [];
4142
for ($i = 0; $i < intval($_GET['count']); ++$i) {
4243
if (!($i % 2)) {
@@ -85,7 +86,7 @@ function () {
8586
[$id, $hash] = generateQRIDForDB();
8687

8788
if ($labels[$i]) {
88-
db_query('UPDATE stock SET qr_id = :qr_id, modified = NOW(), modified_by = :user WHERE id = :id', ['id' => $labels[$i], 'qr_id' => $id, 'user' => $_SESSION['user']['id']]);
89+
db_query('UPDATE stock SET qr_id = :qr_id, modified = :now, modified_by = :user WHERE id = :id', ['id' => $labels[$i], 'qr_id' => $id, 'now' => $now, 'user' => $_SESSION['user']['id']]);
8990
$box_ids_without_qr[] = $labels[$i];
9091
}
9192
}
@@ -138,7 +139,7 @@ function () {
138139
// $pdf->Text(140,
139140
}
140141
}
141-
simpleBulkSaveChangeHistory('stock', $box_ids_without_qr, 'New Qr-code assigned by pdf generation.');
142+
simpleBulkSaveChangeHistory('stock', $box_ids_without_qr, 'New Qr-code assigned by pdf generation.', $now);
142143

143144
$pdf->Output('I');
144145
}

0 commit comments

Comments
 (0)