Skip to content
Snippets Groups Projects
Commit d296c8e6 authored by Florian Will's avatar Florian Will
Browse files

[TASK] itemsPerPage value was not showing in Pagination

parent 7c23ac09
No related branches found
No related tags found
1 merge request!52Feature 5168 unify root page selector
......@@ -85,8 +85,8 @@ class Pagination {
$this->lastPage = (int) ceil($this->totalItems / $this->limit);
// correct current page if out of bounds
$this->currentPage = $this->currentPage < 1 ? 1 : min($this->currentPage, $this->lastPage);
$this->previousPage = ($this->currentPage > 1) ? $this->currentPage - 1 : null;
$this->nextPage = ($this->currentPage < $this->lastPage) ? $this->currentPage + 1 : null;
$this->previousPage = ($this->currentPage > 1) ? $this->currentPage - 1 : NULL;
$this->nextPage = ($this->currentPage < $this->lastPage) ? $this->currentPage + 1 : NULL;
$this->startItem = ($this->currentPage - 1) * $this->limit + 1;
// correct startItem if out of bounds
$this->startItem = max($this->startItem, 1);
......@@ -118,6 +118,10 @@ class Pagination {
return $query->execute(TRUE);
}
public function getItemsPerPage(): int {
return $this->limit;
}
/**
* @return int
*/
......
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" target-language="de" datatype="plaintext" original="EXT:sg_jobs/Resources/Private/Language/locallang.xlf" date="2024-01-18T20:23:37Z">
<file source-language="en" target-language="de" datatype="plaintext"
original="EXT:sg_jobs/Resources/Private/Language/locallang.xlf" date="2024-01-18T20:23:37Z">
<header>
<type>module</type>
<description>General language labels used in frontend and backend.</description>
......@@ -9,7 +10,8 @@
<authorEmail>fabian@sgalinski.de</authorEmail>
</header>
<body>
<trans-unit id="application_mail.marker.birthdate" resname="application_mail.marker.birthdate" approved="yes">
<trans-unit id="application_mail.marker.birthdate" resname="application_mail.marker.birthdate"
approved="yes">
<source><![CDATA[Date of birth]]></source>
<target><![CDATA[Geburtsdatum]]></target>
</trans-unit>
......@@ -21,7 +23,8 @@
<source><![CDATA[Country]]></source>
<target><![CDATA[Land]]></target>
</trans-unit>
<trans-unit id="application_mail.marker.education" resname="application_mail.marker.education" approved="yes">
<trans-unit id="application_mail.marker.education" resname="application_mail.marker.education"
approved="yes">
<source><![CDATA[Education]]></source>
<target><![CDATA[Höchster Bildungsabschluss]]></target>
</trans-unit>
......@@ -29,27 +32,33 @@
<source><![CDATA[Email]]></source>
<target><![CDATA[E-Mail]]></target>
</trans-unit>
<trans-unit id="application_mail.marker.firstname" resname="application_mail.marker.firstname" approved="yes">
<trans-unit id="application_mail.marker.firstname" resname="application_mail.marker.firstname"
approved="yes">
<source><![CDATA[First name]]></source>
<target><![CDATA[Vorname]]></target>
</trans-unit>
<trans-unit id="application_mail.marker.freetextField1" resname="application_mail.marker.freetextField1" approved="yes">
<trans-unit id="application_mail.marker.freetextField1" resname="application_mail.marker.freetextField1"
approved="yes">
<source><![CDATA[Free text field 1]]></source>
<target><![CDATA[Freitextfeld 1]]></target>
</trans-unit>
<trans-unit id="application_mail.marker.freetextField2" resname="application_mail.marker.freetextField2" approved="yes">
<trans-unit id="application_mail.marker.freetextField2" resname="application_mail.marker.freetextField2"
approved="yes">
<source><![CDATA[Free text field 2]]></source>
<target><![CDATA[Freitextfeld 2]]></target>
</trans-unit>
<trans-unit id="application_mail.marker.freetextField3" resname="application_mail.marker.freetextField3" approved="yes">
<trans-unit id="application_mail.marker.freetextField3" resname="application_mail.marker.freetextField3"
approved="yes">
<source><![CDATA[Free text field 3]]></source>
<target><![CDATA[Freitextfeld 3]]></target>
</trans-unit>
<trans-unit id="application_mail.marker.freetextField4" resname="application_mail.marker.freetextField4" approved="yes">
<trans-unit id="application_mail.marker.freetextField4" resname="application_mail.marker.freetextField4"
approved="yes">
<source><![CDATA[Free text field 4]]></source>
<target><![CDATA[Freitextfeld 4]]></target>
</trans-unit>
<trans-unit id="application_mail.marker.freetextField5" resname="application_mail.marker.freetextField5" approved="yes">
<trans-unit id="application_mail.marker.freetextField5" resname="application_mail.marker.freetextField5"
approved="yes">
<source><![CDATA[Free text field 5]]></source>
<target><![CDATA[Freitextfeld 5]]></target>
</trans-unit>
......@@ -77,7 +86,8 @@
<source><![CDATA[Mobile]]></source>
<target><![CDATA[Mobil]]></target>
</trans-unit>
<trans-unit id="application_mail.marker.nationality" resname="application_mail.marker.nationality" approved="yes">
<trans-unit id="application_mail.marker.nationality" resname="application_mail.marker.nationality"
approved="yes">
<source><![CDATA[Nationality]]></source>
<target><![CDATA[Nationalität]]></target>
</trans-unit>
......@@ -85,7 +95,8 @@
<source><![CDATA[Phone]]></source>
<target><![CDATA[Telefon]]></target>
</trans-unit>
<trans-unit id="application_mail.marker.salutation" resname="application_mail.marker.salutation" approved="yes">
<trans-unit id="application_mail.marker.salutation" resname="application_mail.marker.salutation"
approved="yes">
<source><![CDATA[Salutation]]></source>
<target><![CDATA[Anrede]]></target>
</trans-unit>
......@@ -121,7 +132,8 @@
<source><![CDATA[Locations]]></source>
<target><![CDATA[Arbeitsorte]]></target>
</trans-unit>
<trans-unit id="backend.filters.locations.description" resname="backend.filters.locations.description" approved="yes" xml:space="preserve">
<trans-unit id="backend.filters.locations.description" resname="backend.filters.locations.description"
approved="yes" xml:space="preserve">
<source><![CDATA[(Use the ctrl or cmd keys to deselect an option or to select multiple options) ]]></source>
<target><![CDATA[Benutze die STRG oder CMD-Tasten, um eine Option abzuwählen oder mehrere anzuwählen
]]></target>
......@@ -164,33 +176,40 @@
</trans-unit>
<trans-unit id="configuration.applicantMail" resname="configuration.applicantMail" approved="yes">
<source><![CDATA[Send confirmation e-mail to applicants (sg_mail template "applicant_mail")]]></source>
<target><![CDATA[Bestätigungs-E-Mail an Bewerber versenden (sg_mail Template "applicant_mail")]]></target>
<target>
<![CDATA[Bestätigungs-E-Mail an Bewerber versenden (sg_mail Template "applicant_mail")]]></target>
</trans-unit>
<trans-unit id="configuration.jobFolderPath" resname="configuration.jobFolderPath" approved="yes">
<source><![CDATA[Job Folder Path (Relative to fileadmin, defaults to "JobApplication")]]></source>
<target><![CDATA[Job-Verzeichnis-Pfad (relativ zu fileadmin, Standardwert ist "JobApplication")]]></target>
<target>
<![CDATA[Job-Verzeichnis-Pfad (relativ zu fileadmin, Standardwert ist "JobApplication")]]></target>
</trans-unit>
<trans-unit id="error.NoSuchArgumentException" resname="error.NoSuchArgumentException" approved="yes">
<source><![CDATA[Some file could not be uploaded. Is it too large?]]></source>
<target><![CDATA[Einige Dateien konnten nicht hochgeladen werden. Ist eine Datei zu groß?]]></target>
</trans-unit>
<trans-unit id="error.TypeConverterException.missing." resname="error.TypeConverterException.missing." approved="yes">
<trans-unit id="error.TypeConverterException.missing." resname="error.TypeConverterException.missing."
approved="yes">
<source><![CDATA[Missing some file]]></source>
<target><![CDATA[Eine Datei fehlt]]></target>
</trans-unit>
<trans-unit id="error.TypeConverterException.missing.certificate" resname="error.TypeConverterException.missing.certificate" approved="yes">
<trans-unit id="error.TypeConverterException.missing.certificate"
resname="error.TypeConverterException.missing.certificate" approved="yes">
<source><![CDATA[Missing certificate file]]></source>
<target><![CDATA[Datei für Zeugnis fehlt]]></target>
</trans-unit>
<trans-unit id="error.TypeConverterException.missing.coverLetter" resname="error.TypeConverterException.missing.coverLetter" approved="yes">
<trans-unit id="error.TypeConverterException.missing.coverLetter"
resname="error.TypeConverterException.missing.coverLetter" approved="yes">
<source><![CDATA[Missing coverletter file]]></source>
<target><![CDATA[Datei für Motivationsschreiben fehlt]]></target>
</trans-unit>
<trans-unit id="error.TypeConverterException.missing.cv" resname="error.TypeConverterException.missing.cv" approved="yes">
<trans-unit id="error.TypeConverterException.missing.cv" resname="error.TypeConverterException.missing.cv"
approved="yes">
<source><![CDATA[Missing cv file]]></source>
<target><![CDATA[Datei für Lebenslauf fehlt]]></target>
</trans-unit>
<trans-unit id="error.TypeConverterException.type" resname="error.TypeConverterException.type" approved="yes">
<trans-unit id="error.TypeConverterException.type" resname="error.TypeConverterException.type"
approved="yes">
<source><![CDATA[File extension is not allowed!]]></source>
<target><![CDATA[Dateityp nicht erlaubt!]]></target>
</trans-unit>
......@@ -202,7 +221,8 @@
<source><![CDATA[All vacancies]]></source>
<target><![CDATA[Alle offenen Stellen]]></target>
</trans-unit>
<trans-unit id="frontend.apply.allowed_file_extensions" resname="frontend.apply.allowed_file_extensions" approved="yes">
<trans-unit id="frontend.apply.allowed_file_extensions" resname="frontend.apply.allowed_file_extensions"
approved="yes">
<source><![CDATA[File types: ]]></source>
<target><![CDATA[Datentypen: ]]></target>
</trans-unit>
......@@ -319,10 +339,13 @@
<target><![CDATA[Telefon *]]></target>
</trans-unit>
<trans-unit id="frontend.apply.privacyPolicy" resname="frontend.apply.privacyPolicy" approved="yes">
<source><![CDATA[I have read the %s and confirm the usage of my personal data according to it. *]]></source>
<target><![CDATA[Ich habe die %s zur Kenntnis genommen und bin mit der dort beschriebenen Verwendung meiner Daten einverstanden. *]]></target>
<source>
<![CDATA[I have read the %s and confirm the usage of my personal data according to it. *]]></source>
<target>
<![CDATA[Ich habe die %s zur Kenntnis genommen und bin mit der dort beschriebenen Verwendung meiner Daten einverstanden. *]]></target>
</trans-unit>
<trans-unit id="frontend.apply.privacyPolicy.link" resname="frontend.apply.privacyPolicy.link" approved="yes">
<trans-unit id="frontend.apply.privacyPolicy.link" resname="frontend.apply.privacyPolicy.link"
approved="yes">
<source><![CDATA[privacy policy]]></source>
<target><![CDATA[Datenschutzinformationen]]></target>
</trans-unit>
......@@ -350,7 +373,8 @@
<source><![CDATA[Job title *]]></source>
<target><![CDATA[Job-Titel *]]></target>
</trans-unit>
<trans-unit id="frontend.apply.unsolicitedApplication" resname="frontend.apply.unsolicitedApplication" approved="yes">
<trans-unit id="frontend.apply.unsolicitedApplication" resname="frontend.apply.unsolicitedApplication"
approved="yes">
<source><![CDATA[Unsolicited Application]]></source>
<target><![CDATA[Initiativbewerbung]]></target>
</trans-unit>
......@@ -362,7 +386,8 @@
<source><![CDATA[Apply online now]]></source>
<target><![CDATA[Jetzt online bewerben]]></target>
</trans-unit>
<trans-unit id="frontend.applyNow.emptyApplication" resname="frontend.applyNow.emptyApplication" approved="yes">
<trans-unit id="frontend.applyNow.emptyApplication" resname="frontend.applyNow.emptyApplication"
approved="yes">
<source><![CDATA[Apply to an unlisted position]]></source>
<target><![CDATA[Initiativ-Bewerbung]]></target>
</trans-unit>
......@@ -414,7 +439,8 @@
<source><![CDATA[Country]]></source>
<target><![CDATA[Land]]></target>
</trans-unit>
<trans-unit id="frontend.filter.countriesfunctions" resname="frontend.filter.countriesfunctions" approved="yes">
<trans-unit id="frontend.filter.countriesfunctions" resname="frontend.filter.countriesfunctions"
approved="yes">
<source><![CDATA[Function]]></source>
<target><![CDATA[Funktion]]></target>
</trans-unit>
......@@ -547,8 +573,8 @@
<target><![CDATA[Einträge]]></target>
</trans-unit>
<trans-unit id="backend.job.itemsPerPage" resname="backend.job.itemsPerPage">
<source><![CDATA[Entries per page:]]></source>
<target><![CDATA[Einträge pro Seite:]]></target>
<source><![CDATA[Max.]]></source>
<target><![CDATA[Max.]]></target>
</trans-unit>
<trans-unit id="backend.job.of" resname="backend.job.of">
<source><![CDATA[of]]></source>
......
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="EXT:sg_jobs/Resources/Private/Language/locallang.xlf" date="2024-01-18T20:23:37Z">
<file source-language="en" datatype="plaintext" original="EXT:sg_jobs/Resources/Private/Language/locallang.xlf"
date="2024-01-18T20:23:37Z">
<header>
<type>module</type>
<description>General language labels used in frontend and backend.</description>
......@@ -94,7 +95,8 @@
<source><![CDATA[Locations]]></source>
</trans-unit>
<trans-unit id="backend.filters.locations.description" resname="backend.filters.locations.description">
<source><![CDATA[(Use the ctrl or cmd keys to deselect an option or to select multiple options) ]]></source>
<source>
<![CDATA[(Use the ctrl or cmd keys to deselect an option or to select multiple options) ]]></source>
</trans-unit>
<trans-unit id="backend.filters.search" resname="backend.filters.search">
<source><![CDATA[Search]]></source>
......@@ -109,7 +111,8 @@
<source><![CDATA[Item]]></source>
</trans-unit>
<trans-unit id="backend.manualSortingBug" resname="backend.manualSortingBug">
<source><![CDATA[Manual sorting is currently not working. You can do that in the List module.]]></source>
<source>
<![CDATA[Manual sorting is currently not working. You can do that in the List module.]]></source>
</trans-unit>
<trans-unit id="backend.message.error" resname="backend.message.error">
<source><![CDATA[Something went wrong. Please reload.]]></source>
......@@ -138,10 +141,12 @@
<trans-unit id="error.TypeConverterException.missing." resname="error.TypeConverterException.missing.">
<source><![CDATA[Missing some file]]></source>
</trans-unit>
<trans-unit id="error.TypeConverterException.missing.certificate" resname="error.TypeConverterException.missing.certificate">
<trans-unit id="error.TypeConverterException.missing.certificate"
resname="error.TypeConverterException.missing.certificate">
<source><![CDATA[Missing certificate file]]></source>
</trans-unit>
<trans-unit id="error.TypeConverterException.missing.coverLetter" resname="error.TypeConverterException.missing.coverLetter">
<trans-unit id="error.TypeConverterException.missing.coverLetter"
resname="error.TypeConverterException.missing.coverLetter">
<source><![CDATA[Missing coverletter file]]></source>
</trans-unit>
<trans-unit id="error.TypeConverterException.missing.cv" resname="error.TypeConverterException.missing.cv">
......@@ -256,7 +261,8 @@
<source><![CDATA[Phone *]]></source>
</trans-unit>
<trans-unit id="frontend.apply.privacyPolicy" resname="frontend.apply.privacyPolicy">
<source><![CDATA[I have read the %s and confirm the usage of my personal data according to it. *]]></source>
<source>
<![CDATA[I have read the %s and confirm the usage of my personal data according to it. *]]></source>
</trans-unit>
<trans-unit id="frontend.apply.privacyPolicy.link" resname="frontend.apply.privacyPolicy.link">
<source><![CDATA[privacy policy]]></source>
......@@ -436,7 +442,7 @@
<source><![CDATA[Page]]></source>
</trans-unit>
<trans-unit id="backend.job.itemsPerPage" resname="backend.job.itemsPerPage">
<source><![CDATA[Entries per page:]]></source>
<source><![CDATA[Max.]]></source>
</trans-unit>
<trans-unit id="backend.job.of" resname="backend.job.of">
<source><![CDATA[of]]></source>
......
......@@ -7,7 +7,7 @@
<!-- Records Display -->
<li class="page-item ps-2 pe-2 pagination-label">
<span>
<f:translate key="backend.job.records" extensionName="sg_jobs" /> {pagination.startItem} - {pagination.endItem}
<f:translate key="backend.job.records" extensionName="sg_jobs"/> {pagination.startItem} - {pagination.endItem}
</span>
</li>
......@@ -17,12 +17,12 @@
<f:then>
<a href="{f:uri.action(action: action, arguments: {currentPage: 1, itemsPerPage: itemsPerPage})}"
>
<core:icon identifier="actions-view-paging-first" />
<core:icon identifier="actions-view-paging-first"/>
</a>
</f:then>
<f:else>
<span >
<core:icon identifier="actions-view-paging-first" />
<span>
<core:icon identifier="actions-view-paging-first"/>
</span>
</f:else>
</f:if>
......@@ -34,12 +34,12 @@
<f:then>
<a href="{f:uri.action(action: action, arguments: {currentPage: pagination.previousPage, itemsPerPage: itemsPerPage})}"
>
<core:icon identifier="actions-view-paging-previous" />
<core:icon identifier="actions-view-paging-previous"/>
</a>
</f:then>
<f:else>
<span >
<core:icon identifier="actions-view-paging-previous" />
<span>
<core:icon identifier="actions-view-paging-previous"/>
</span>
</f:else>
</f:if>
......@@ -48,7 +48,7 @@
<!-- Go to Page -->
<li class="page-item ps-2">
<form action="" method="POST">
<f:translate key="backend.job.page" extensionName="sg_jobs" />
<f:translate key="backend.job.page" extensionName="sg_jobs"/>
<f:form.textfield id="paginator"
name="paginator-target-page"
additionalAttributes="{
......@@ -58,9 +58,10 @@
class="form-control input-sm paginator-input"
style="padding: 4px 8px"
value="{pagination.currentPage}"
type="number" />
<f:translate key="backend.job.of" extensionName="sg_jobs" /> {pagination.lastPage}
<input type="hidden" name="itemsPerPage" value="{itemsPerPage}" />
type="number"/>
<f:translate key="backend.job.of" extensionName="sg_jobs"/>
{pagination.lastPage}
<input type="hidden" name="itemsPerPage" value="{itemsPerPage}"/>
</form>
</li>
......@@ -70,12 +71,12 @@
<f:then>
<a href="{f:uri.action(action: action, arguments: {currentPage: pagination.nextPage, itemsPerPage: itemsPerPage})}"
>
<core:icon identifier="actions-view-paging-next" />
<core:icon identifier="actions-view-paging-next"/>
</a>
</f:then>
<f:else>
<span >
<core:icon identifier="actions-view-paging-next" />
<span>
<core:icon identifier="actions-view-paging-next"/>
</span>
</f:else>
</f:if>
......@@ -87,43 +88,44 @@
<f:then>
<a href="{f:uri.action(action: action, arguments: {currentPage: pagination.lastPage, itemsPerPage: itemsPerPage})}"
>
<core:icon identifier="actions-view-paging-last" />
<core:icon identifier="actions-view-paging-last"/>
</a>
</f:then>
<f:else>
<span >
<core:icon identifier="actions-view-paging-last" />
<span>
<core:icon identifier="actions-view-paging-last"/>
</span>
</f:else>
</f:if>
</li>
<!-- Refresh Button -->
<li class="page-item ps-2">
<a href="{f:uri.action(action: action, arguments: {currentPage: pagination.currentPage, itemsPerPage: itemsPerPage})}"
>
<core:icon identifier="actions-refresh"/>
</a>
</li>
<!-- Custom Items Per Page Input Field with Label -->
<li class="page-item ps-2 ">
<form action="" method="POST" class="d-flex ">
<li class="page-item ps-2 ms-4 ">
<form action="" method="POST" class="d-flex align-items-center">
<label for="itemsPerPageInput" class="me-2 mb-0">
<f:translate key="backend.job.itemsPerPage" extensionName="sg_jobs" />
<f:translate key="backend.job.itemsPerPage" extensionName="sg_jobs"/>
</label>
<input type="number"
name="itemsPerPage"
id="itemsPerPageInput"
class="form-control input-sm "
style="padding: 4px 8px; width: 70px; min-width: 50px; margin: -7px 0px"
value="{itemsPerPage}"
style="padding: 4px 8px; width: 60px; height: 28px; min-width: 50px; margin: -7px 0px"
value="{pagination.itemsPerPage}"
min="1"
required />
<input type="hidden" name="page" value="{pagination.currentPage}" />
required/>
<input type="hidden" name="page" value="{pagination.currentPage}"/>
</form>
</li>
<!-- Refresh Button -->
<li class="page-item ps-2">
<a href="{f:uri.action(action: action, arguments: {currentPage: pagination.currentPage, itemsPerPage: itemsPerPage})}"
>
<core:icon identifier="actions-refresh" />
</a>
</li>
</ul>
</nav>
</html>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment