summaryrefslogtreecommitdiff
path: root/lib/VNDB/DB
diff options
context:
space:
mode:
authormorkt <>2015-02-14 07:46:45 +0100
committerYorhel <git@yorhel.nl>2015-02-14 07:46:45 +0100
commit3d5a72a7325e1edf839c8bb8c5983651dbe329d7 (patch)
treeced60503fdd5283daf56ce4b7206ba92523f791b /lib/VNDB/DB
parente311da013d5ece918723de43916a9ce91a0f6fd1 (diff)
Revamp staff alias editing interface + fix reverting removed aliasses
The new alias editing interface makes it a lot easier to change the primary name.
Diffstat (limited to 'lib/VNDB/DB')
-rw-r--r--lib/VNDB/DB/Staff.pm13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/VNDB/DB/Staff.pm b/lib/VNDB/DB/Staff.pm
index b22b9538..a8b85b8c 100644
--- a/lib/VNDB/DB/Staff.pm
+++ b/lib/VNDB/DB/Staff.pm
@@ -5,7 +5,7 @@ use strict;
use warnings;
use Exporter 'import';
-our @EXPORT = qw|dbStaffGet dbStaffRevisionInsert|;
+our @EXPORT = qw|dbStaffGet dbStaffRevisionInsert dbStaffAliasIds|;
# options: results, page, id, aid, search, rev, truename, role, gender
# what: extended changes roles aliases
@@ -148,4 +148,15 @@ sub dbStaffRevisionInsert {
}
}
+
+# returns alias IDs that are and were related to the given staff ID
+sub dbStaffAliasIds {
+ my($self, $sid) = @_;
+ return $self->dbAll(q|
+ SELECT DISTINCT sa.id
+ FROM staff_alias sa
+ JOIN staff_rev sr ON sr.id = sa.rid
+ WHERE sr.sid = ?|, $sid);
+}
+
1;