Skip to content

Commit

Permalink
#3933 [Admin] fix: improve pageY and missing reposition
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-eoxia committed May 30, 2024
1 parent 9911b5b commit d64e379
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions admin/ticket/ticket.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
$action = GETPOST('action', 'alpha');
$backtopage = GETPOST('backtopage', 'alpha');
$value = GETPOST('value', 'alpha');
$pageY = GETPOST('page_y', 'int');

// Security check - Protection if external user
$permissiontoread = $user->rights->digiriskdolibarr->adminpage->read;
Expand All @@ -82,7 +83,7 @@
setEventMessages($langs->transnoentities('TicketProjectUpdated'), array());

if ($action != 'updateedit') {
header("Location: " . $_SERVER["PHP_SELF"] . "?page_y=" . GETPOST("page_y"));
header('Location: ' . $_SERVER['PHP_SELF'] . '?page_y=' . $pageY);
exit;
}
}
Expand Down Expand Up @@ -236,7 +237,7 @@

if (empty($rangeNumberPost)) {
setEventMessage($langs->trans('MissingRangeValue'), 'errors');
header("Location: " . $_SERVER["PHP_SELF"]);
header('Location: ' . $_SERVER['PHP_SELF'] . '?page_y=' . $pageY);
exit;
}
if (dol_strlen($constraintLabel) == 0) {
Expand All @@ -253,7 +254,7 @@

setEventMessages($langs->transnoentities('TimeRangeAdded'), array());

header("Location: " . $_SERVER["PHP_SELF"] . "?page_y=" . GETPOST("page_y"));
header('Location: ' . $_SERVER['PHP_SELF'] . '?page_y=' . $pageY);
exit;
}

Expand All @@ -269,7 +270,7 @@

setEventMessages($langs->transnoentities('TimeRangeDeleted'), array());

header("Location: " . $_SERVER["PHP_SELF"] . "?page_y=" . GETPOST("page_y"));
header('Location: ' . $_SERVER['PHP_SELF'] . '?page_y=' . $pageY);
exit;
}

Expand All @@ -280,7 +281,7 @@
dolibarr_set_const($db, 'DIGIRISKDOLIBARR_TICKET_MULTI_COMPANY_PUBLIC_INTERFACE_SUBTITLE', $multiCompanyTicketPublicInterfaceSubtitle, 'chaine', 0, '', 0);

setEventMessage('SavedConfig');
header('Location: ' . $_SERVER['PHP_SELF'] . '?page_y=' . GETPOST('page_y'));
header('Location: ' . $_SERVER['PHP_SELF'] . '?page_y=' . $pageY);
exit;
}

Expand Down Expand Up @@ -765,7 +766,7 @@
print dolibarr_get_const($db, 'DIGIRISKDOLIBARR_TICKET_EXTRAFIELDS', 0) ? $langs->transnoentities('AlreadyGenerated') : $langs->transnoentities('NotCreated');
print '</td>';
print '<td class="center">';
print dolibarr_get_const($db, 'DIGIRISKDOLIBARR_TICKET_EXTRAFIELDS', 0) ? '<a type="" class=" butActionRefused" value="">'.$langs->transnoentities('Create') .'</a>' : '<input type="submit" class="button" value="'.$langs->transnoentities('Create') .'">' ;
print dolibarr_get_const($db, 'DIGIRISKDOLIBARR_TICKET_EXTRAFIELDS', 0) ? '<a type="" class=" butActionRefused" value="">'.$langs->transnoentities('Create') .'</a>' : '<input type="submit" class="button reposition" value="'.$langs->transnoentities('Create') .'">' ;
print '</td>';

print '<td class="center">';
Expand Down Expand Up @@ -857,7 +858,7 @@
print '<input type="hidden" name="token" value="' . newToken() . '">';
print '<input type="hidden" name="action" value="generateQRCode">';
print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';

print '<input type="hidden" name="page_y">';

print '<tr class="oddeven"><td>' . $langs->transnoentities("GenerateQRCode") . '</td>';

Expand All @@ -876,7 +877,7 @@
print '<a class="clicked-photo-preview" href="'. $urladvanced .'">' . '<img width="200" src="'.DOL_URL_ROOT . '/custom/digiriskdolibarr/documents/viewimage.php?modulepart=digiriskdolibarr&entity=1&file=' . 'multicompany/ticketqrcode/' . $QRCode['name'] .'" alt="' . $langs->transnoentities("MultiEntityTicketPublicInterfaceQRCode") . '"></a>';
print '<a id="download" href="'.DOL_URL_ROOT . '/custom/digiriskdolibarr/documents/viewimage.php?modulepart=digiriskdolibarr&entity=1&file=' . 'multicompany/ticketqrcode/' . $QRCode['name'] .'" download="'.DOL_URL_ROOT . '/custom/digiriskdolibarr/documents/viewimage.php?modulepart=digiriskdolibarr'. '&file=' . 'multicompany/ticketqrcode/' . $QRCode['name'] .'"><i class="fas fa-download"></i></a>';
} else {
print '<input type="submit" class="button" value="'.$langs->transnoentities('Generate') .'">' ;
print '<input type="submit" class="button reposition" value="'.$langs->transnoentities('Generate') .'">' ;
}
print '</td>';

Expand Down

0 comments on commit d64e379

Please sign in to comment.