Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KItinerary
Commits
79c791c2
Commit
79c791c2
authored
Nov 08, 2021
by
Volker Krause
Browse files
Add Pretix pkpass extractor script
parent
20dcd7f0
Pipeline
#95375
passed with stage
in 5 minutes and 25 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/lib/scripts/extractors.qrc
View file @
79c791c2
...
...
@@ -98,6 +98,8 @@
<file>oebb.js</file>
<file>onepagebooking.json</file>
<file>onepagebooking.js</file>
<file>pretix.json</file>
<file>pretix.js</file>
<file>regiojet.json</file>
<file>regiojet.js</file>
<file>regiondo.json</file>
...
...
src/lib/scripts/pretix.js
0 → 100644
View file @
79c791c2
/*
SPDX-FileCopyrightText: 2021 Volker Krause <vkrause@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
function
parsePass
(
content
,
node
)
{
var
res
=
node
.
result
[
0
];
res
.
reservationFor
.
name
=
content
.
field
[
'
eventName
'
].
value
;
res
.
reservationFor
.
startDate
=
JsonLd
.
toDateTime
(
content
.
field
[
'
doorsOpen
'
].
value
,
'
dd.MM.yyyy hh:mm
'
,
'
de
'
);
res
.
reservationFor
.
endDate
=
JsonLd
.
toDateTime
(
content
.
field
[
'
doorsClose
'
].
value
,
'
dd.MM.yyyy hh:mm
'
,
'
de
'
);
res
.
reservationFor
.
url
=
content
.
field
[
'
website
'
].
value
;
res
.
underName
=
JsonLd
.
newObject
(
'
Person
'
);
res
.
underName
.
name
=
content
.
field
[
'
name
'
].
value
;
res
.
reservationNumber
=
content
.
field
[
'
orderCode
'
].
value
;
return
res
;
}
src/lib/scripts/pretix.json
0 → 100644
View file @
79c791c2
{
"filter"
:
[
{
"field"
:
"passTypeIdentifier"
,
"match"
:
"pass.eu.pretix.ticket"
,
"mimeType"
:
"application/vnd.apple.pkpass"
,
"scope"
:
"Current"
}
],
"function"
:
"parsePass"
,
"mimeType"
:
"application/vnd.apple.pkpass"
,
"script"
:
"pretix.js"
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment