Skip to content

Commit

Permalink
more link_url suppport
Browse files Browse the repository at this point in the history
  • Loading branch information
oetiker committed Mar 26, 2024
1 parent d35cb6b commit 044c7c1
Show file tree
Hide file tree
Showing 9 changed files with 167 additions and 91 deletions.
30 changes: 29 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
@@ -1,7 +1,35 @@
0.13.0 2024-03-25 11:23:07 +0100 Tobias Oetiker <[email protected]>
0.13.0 2024-03-26 08:15:18 +0100 Tobias Oetiker <[email protected]>

-

0.13.0 2024-03-26 08:12:04 +0100 Tobias Oetiker <[email protected]>

-

0.13.0 2024-03-26 08:09:50 +0100 Tobias Oetiker <[email protected]>

-

0.13.0 2024-03-25 15:24:45 +0100 Tobias Oetiker <[email protected]>

-

0.13.0 2024-03-25 15:21:29 +0100 Tobias Oetiker <[email protected]>

-

0.13.0 2024-03-25 15:20:02 +0100 Tobias Oetiker <[email protected]>

-

0.13.0 2024-03-25 15:17:10 +0100 Tobias Oetiker <[email protected]>

-

0.13.0 2024-03-25 11:23:07 +0100 Tobias Oetiker <[email protected]>

- added okt_drive_url

0.13.0 2024-03-25 11:20:12 +0100 Tobias Oetiker <[email protected]>

- add okt event filter to okt view
Expand Down
10 changes: 9 additions & 1 deletion lib/OktDB.pm
Original file line number Diff line number Diff line change
Expand Up @@ -423,4 +423,12 @@ ALTER TABLE oktevent ADD oktevent_expense_note TEXT;
-- 10 up
--sql
ALTER TABLE oktevent ADD oktevent_drive_url TEXT;
ALTER TABLE oktevent ADD oktevent_drive_url TEXT;
-- 11 up
--sql
ALTER TABLE oktevent ADD okt_drive_url TEXT;
-- 12 up
--sql
ALTER TABLE okt ADD okt_drive_url TEXT;
32 changes: 30 additions & 2 deletions lib/OktDB/GuiPlugin/Okt.pm
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ has actionCfg => sub {
enabled => false
},
set => {
height => 240,
height => 340,
width => 400
},
backend => {
Expand Down Expand Up @@ -141,7 +141,32 @@ has actionCfg => sub {
};
}
},
{
{
label => trm('Open Drive'),
action => 'submit',
addToContextMenu => true,
key => 'drive',
buttonSet => {
enabled => false
},
actionHandler => sub {
my $self = shift;
my $args = shift;
my $url = $args->{selection}{okt_drive_url};
if ($url) {
return {
action => 'openLink',
url => $url,
target => '_blank',
features => 'noopener,noreferrer'
}
}
else {
die mkerror(4994,"No Drive URL found for this event");
}
}
},
{
label => trm('Show OktEvents'),
action => 'popup',
key => 'events',
Expand Down Expand Up @@ -211,6 +236,9 @@ SQL_END
events => {
enabled => true,
},
drive => {
enabled => $row->{okt_drive_url} ? true : false
}
};
$row->{okt_end_ts} = localtime($row->{okt_end_ts})->strftime("%d.%m.%Y") if $row->{okt_end_ts};
$row->{okt_start_ts} = localtime($row->{okt_start_ts})->strftime("%d.%m.%Y") if $row->{okt_start_ts};
Expand Down
16 changes: 14 additions & 2 deletions lib/OktDB/GuiPlugin/OktForm.pm
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ has formCfg => sub {
required => true,
},
},

{
key => 'okt_start_ts',
label => trm('First Day'),
Expand Down Expand Up @@ -100,7 +101,18 @@ has formCfg => sub {
$_[0] = $t;
return "";
},
}
},
{
key => 'okt_drive_url',
label => trm('Drive URL'),
widget => 'text',
validator => sub ($value,$fieldName,$form) {
if ($value and $value !~ m{^https://drive.google.com/\S+$}) {
return trm("Expected a google drive url");
}
return "";
}
},
];
};

Expand All @@ -114,7 +126,7 @@ has actionCfg => sub {
my %metaInfo;
my $fieldMap = { map {
"okt_".$_ => $args->{"okt_".$_}
} qw(edition start_ts end_ts)
} qw(edition start_ts end_ts drive_url)
};
if ($type eq 'add') {
$metaInfo{recId} = $self->db->insert('okt',$fieldMap)->last_insert_id;
Expand Down
32 changes: 16 additions & 16 deletions share/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: oktdb 0.1.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-25 11:06+0100\n"
"POT-Creation-Date: 2024-03-25 15:20+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -123,7 +123,7 @@ msgstr ""
#: lib/OktDB/GuiPlugin/AgencyForm.pm:177 lib/OktDB/GuiPlugin/ArtPersForm.pm:385
#: lib/OktDB/GuiPlugin/ArtPersMemberForm.pm:155
#: lib/OktDB/GuiPlugin/EventForm.pm:178 lib/OktDB/GuiPlugin/LocationForm.pm:144
#: lib/OktDB/GuiPlugin/OktEventForm.pm:267 lib/OktDB/GuiPlugin/OktForm.pm:134
#: lib/OktDB/GuiPlugin/OktEventForm.pm:267 lib/OktDB/GuiPlugin/OktForm.pm:146
#: lib/OktDB/GuiPlugin/PersForm.pm:190
#: lib/OktDB/GuiPlugin/ProductionForm.pm:151
#: lib/OktDB/GuiPlugin/ProgTeamForm.pm:141
Expand Down Expand Up @@ -364,7 +364,7 @@ msgstr ""
#: lib/OktDB/GuiPlugin/ArtPersForm.pm:334
#: lib/OktDB/GuiPlugin/ArtPersMemberForm.pm:94
#: lib/OktDB/GuiPlugin/ArtPersMemberForm.pm:112
#: lib/OktDB/GuiPlugin/OktForm.pm:73 lib/OktDB/GuiPlugin/OktForm.pm:91
#: lib/OktDB/GuiPlugin/OktForm.pm:74 lib/OktDB/GuiPlugin/OktForm.pm:92
#: lib/OktDB/GuiPlugin/PersForm.pm:120 lib/OktDB/GuiPlugin/PersForm.pm:146
#: lib/OktDB/GuiPlugin/ProductionForm.pm:82
#: lib/OktDB/GuiPlugin/ProductionForm.pm:100
Expand All @@ -378,8 +378,8 @@ msgstr ""
#: lib/OktDB/GuiPlugin/ArtPersMemberForm.pm:101
#: lib/OktDB/GuiPlugin/ArtPersMemberForm.pm:119
#: lib/OktDB/GuiPlugin/EventForm.pm:109 lib/OktDB/GuiPlugin/OktEventForm.pm:198
#: lib/OktDB/GuiPlugin/OktEventForm.pm:217 lib/OktDB/GuiPlugin/OktForm.pm:80
#: lib/OktDB/GuiPlugin/OktForm.pm:98 lib/OktDB/GuiPlugin/PersForm.pm:127
#: lib/OktDB/GuiPlugin/OktEventForm.pm:217 lib/OktDB/GuiPlugin/OktForm.pm:81
#: lib/OktDB/GuiPlugin/OktForm.pm:99 lib/OktDB/GuiPlugin/PersForm.pm:127
#: lib/OktDB/GuiPlugin/PersForm.pm:153 lib/OktDB/GuiPlugin/ProductionForm.pm:89
#: lib/OktDB/GuiPlugin/ProductionForm.pm:107
#: lib/OktDB/GuiPlugin/ProgTeamForm.pm:87
Expand Down Expand Up @@ -453,11 +453,11 @@ msgstr ""
msgid "ArtPerson Members"
msgstr ""

#: lib/OktDB/GuiPlugin/ArtPers.pm:275 lib/OktDB/GuiPlugin/Okt.pm:145
#: lib/OktDB/GuiPlugin/ArtPers.pm:275 lib/OktDB/GuiPlugin/Okt.pm:170
msgid "Show OktEvents"
msgstr ""

#: lib/OktDB/GuiPlugin/ArtPers.pm:280 lib/OktDB/GuiPlugin/Okt.pm:150
#: lib/OktDB/GuiPlugin/ArtPers.pm:280 lib/OktDB/GuiPlugin/Okt.pm:175
msgid "OktEvents"
msgstr ""

Expand Down Expand Up @@ -741,6 +741,10 @@ msgid ""
"will only work if there are no other entries refering to that Edition."
msgstr ""

#: lib/OktDB/GuiPlugin/Okt.pm:145 lib/OktDB/GuiPlugin/OktEvent.pm:241
msgid "Open Drive"
msgstr ""

#: lib/OktDB/GuiPlugin/OktEvent.pm:103 lib/OktDB/GuiPlugin/OktEventForm.pm:111
msgid "Type"
msgstr ""
Expand Down Expand Up @@ -773,10 +777,6 @@ msgstr ""
msgid "View OktEvent"
msgstr ""

#: lib/OktDB/GuiPlugin/OktEvent.pm:241
msgid "Open Drive"
msgstr ""

#: lib/OktDB/GuiPlugin/OktEventForm.pm:71
msgid "Kabarettage"
msgstr ""
Expand All @@ -789,11 +789,11 @@ msgstr ""
msgid "Select Production"
msgstr ""

#: lib/OktDB/GuiPlugin/OktEventForm.pm:136
#: lib/OktDB/GuiPlugin/OktEventForm.pm:136 lib/OktDB/GuiPlugin/OktForm.pm:107
msgid "Drive URL"
msgstr ""

#: lib/OktDB/GuiPlugin/OktEventForm.pm:143
#: lib/OktDB/GuiPlugin/OktEventForm.pm:143 lib/OktDB/GuiPlugin/OktForm.pm:111
msgid "Expected a google drive url"
msgstr ""

Expand All @@ -818,15 +818,15 @@ msgstr ""
msgid "hh:mm"
msgstr ""

#: lib/OktDB/GuiPlugin/OktForm.pm:70
#: lib/OktDB/GuiPlugin/OktForm.pm:71
msgid "First Day"
msgstr ""

#: lib/OktDB/GuiPlugin/OktForm.pm:88
#: lib/OktDB/GuiPlugin/OktForm.pm:89
msgid "Last Day"
msgstr ""

#: lib/OktDB/GuiPlugin/OktForm.pm:135
#: lib/OktDB/GuiPlugin/OktForm.pm:147
msgid "Add OKT Edition"
msgstr ""

Expand Down
32 changes: 16 additions & 16 deletions share/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: oktdb 0.1.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-25 11:06+0100\n"
"POT-Creation-Date: 2024-03-25 15:20+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -124,7 +124,7 @@ msgstr ""
#: lib/OktDB/GuiPlugin/AgencyForm.pm:177 lib/OktDB/GuiPlugin/ArtPersForm.pm:385
#: lib/OktDB/GuiPlugin/ArtPersMemberForm.pm:155
#: lib/OktDB/GuiPlugin/EventForm.pm:178 lib/OktDB/GuiPlugin/LocationForm.pm:144
#: lib/OktDB/GuiPlugin/OktEventForm.pm:267 lib/OktDB/GuiPlugin/OktForm.pm:134
#: lib/OktDB/GuiPlugin/OktEventForm.pm:267 lib/OktDB/GuiPlugin/OktForm.pm:146
#: lib/OktDB/GuiPlugin/PersForm.pm:190
#: lib/OktDB/GuiPlugin/ProductionForm.pm:151
#: lib/OktDB/GuiPlugin/ProgTeamForm.pm:141
Expand Down Expand Up @@ -365,7 +365,7 @@ msgstr ""
#: lib/OktDB/GuiPlugin/ArtPersForm.pm:334
#: lib/OktDB/GuiPlugin/ArtPersMemberForm.pm:94
#: lib/OktDB/GuiPlugin/ArtPersMemberForm.pm:112
#: lib/OktDB/GuiPlugin/OktForm.pm:73 lib/OktDB/GuiPlugin/OktForm.pm:91
#: lib/OktDB/GuiPlugin/OktForm.pm:74 lib/OktDB/GuiPlugin/OktForm.pm:92
#: lib/OktDB/GuiPlugin/PersForm.pm:120 lib/OktDB/GuiPlugin/PersForm.pm:146
#: lib/OktDB/GuiPlugin/ProductionForm.pm:82
#: lib/OktDB/GuiPlugin/ProductionForm.pm:100
Expand All @@ -379,8 +379,8 @@ msgstr ""
#: lib/OktDB/GuiPlugin/ArtPersMemberForm.pm:101
#: lib/OktDB/GuiPlugin/ArtPersMemberForm.pm:119
#: lib/OktDB/GuiPlugin/EventForm.pm:109 lib/OktDB/GuiPlugin/OktEventForm.pm:198
#: lib/OktDB/GuiPlugin/OktEventForm.pm:217 lib/OktDB/GuiPlugin/OktForm.pm:80
#: lib/OktDB/GuiPlugin/OktForm.pm:98 lib/OktDB/GuiPlugin/PersForm.pm:127
#: lib/OktDB/GuiPlugin/OktEventForm.pm:217 lib/OktDB/GuiPlugin/OktForm.pm:81
#: lib/OktDB/GuiPlugin/OktForm.pm:99 lib/OktDB/GuiPlugin/PersForm.pm:127
#: lib/OktDB/GuiPlugin/PersForm.pm:153 lib/OktDB/GuiPlugin/ProductionForm.pm:89
#: lib/OktDB/GuiPlugin/ProductionForm.pm:107
#: lib/OktDB/GuiPlugin/ProgTeamForm.pm:87
Expand Down Expand Up @@ -454,11 +454,11 @@ msgstr ""
msgid "ArtPerson Members"
msgstr ""

#: lib/OktDB/GuiPlugin/ArtPers.pm:275 lib/OktDB/GuiPlugin/Okt.pm:145
#: lib/OktDB/GuiPlugin/ArtPers.pm:275 lib/OktDB/GuiPlugin/Okt.pm:170
msgid "Show OktEvents"
msgstr ""

#: lib/OktDB/GuiPlugin/ArtPers.pm:280 lib/OktDB/GuiPlugin/Okt.pm:150
#: lib/OktDB/GuiPlugin/ArtPers.pm:280 lib/OktDB/GuiPlugin/Okt.pm:175
msgid "OktEvents"
msgstr ""

Expand Down Expand Up @@ -742,6 +742,10 @@ msgid ""
"will only work if there are no other entries refering to that Edition."
msgstr ""

#: lib/OktDB/GuiPlugin/Okt.pm:145 lib/OktDB/GuiPlugin/OktEvent.pm:241
msgid "Open Drive"
msgstr ""

#: lib/OktDB/GuiPlugin/OktEvent.pm:103 lib/OktDB/GuiPlugin/OktEventForm.pm:111
msgid "Type"
msgstr ""
Expand Down Expand Up @@ -774,10 +778,6 @@ msgstr ""
msgid "View OktEvent"
msgstr ""

#: lib/OktDB/GuiPlugin/OktEvent.pm:241
msgid "Open Drive"
msgstr ""

#: lib/OktDB/GuiPlugin/OktEventForm.pm:71
msgid "Kabarettage"
msgstr ""
Expand All @@ -790,11 +790,11 @@ msgstr ""
msgid "Select Production"
msgstr ""

#: lib/OktDB/GuiPlugin/OktEventForm.pm:136
#: lib/OktDB/GuiPlugin/OktEventForm.pm:136 lib/OktDB/GuiPlugin/OktForm.pm:107
msgid "Drive URL"
msgstr ""

#: lib/OktDB/GuiPlugin/OktEventForm.pm:143
#: lib/OktDB/GuiPlugin/OktEventForm.pm:143 lib/OktDB/GuiPlugin/OktForm.pm:111
msgid "Expected a google drive url"
msgstr ""

Expand All @@ -819,15 +819,15 @@ msgstr ""
msgid "hh:mm"
msgstr ""

#: lib/OktDB/GuiPlugin/OktForm.pm:70
#: lib/OktDB/GuiPlugin/OktForm.pm:71
msgid "First Day"
msgstr ""

#: lib/OktDB/GuiPlugin/OktForm.pm:88
#: lib/OktDB/GuiPlugin/OktForm.pm:89
msgid "Last Day"
msgstr ""

#: lib/OktDB/GuiPlugin/OktForm.pm:135
#: lib/OktDB/GuiPlugin/OktForm.pm:147
msgid "Add OKT Edition"
msgstr ""

Expand Down
Loading

0 comments on commit 044c7c1

Please sign in to comment.