diff options
author | Byron Jones <bjones@mozilla.com> | 2013-10-29 05:18:37 +0100 |
---|---|---|
committer | Byron Jones <bjones@mozilla.com> | 2013-10-29 05:18:37 +0100 |
commit | 9b6f5d07a80ff630ed76108e0ca9689b4e2410f5 (patch) | |
tree | e70478a85617733543f3dfb90c9036436efb1a22 /extensions | |
parent | b7ebd27d636881700d442d3a2ff0cf6fa47ca639 (diff) | |
download | bugzilla-9b6f5d07a80ff630ed76108e0ca9689b4e2410f5.tar.gz bugzilla-9b6f5d07a80ff630ed76108e0ca9689b4e2410f5.tar.xz |
Bug 892615: Add a 24 hour nag to all requests (review, feedback and need-info) and make them follow-able (schema-only)
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/RequestNagger/Config.pm | 15 | ||||
-rw-r--r-- | extensions/RequestNagger/Extension.pm | 93 |
2 files changed, 108 insertions, 0 deletions
diff --git a/extensions/RequestNagger/Config.pm b/extensions/RequestNagger/Config.pm new file mode 100644 index 000000000..6b9488c80 --- /dev/null +++ b/extensions/RequestNagger/Config.pm @@ -0,0 +1,15 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This Source Code Form is "Incompatible With Secondary Licenses", as +# defined by the Mozilla Public License, v. 2.0. + +package Bugzilla::Extension::RequestNagger; +use strict; + +use constant NAME => 'RequestNagger'; +use constant REQUIRED_MODULES => [ ]; +use constant OPTIONAL_MODULES => [ ]; + +__PACKAGE__->NAME; diff --git a/extensions/RequestNagger/Extension.pm b/extensions/RequestNagger/Extension.pm new file mode 100644 index 000000000..a8dc4a5c2 --- /dev/null +++ b/extensions/RequestNagger/Extension.pm @@ -0,0 +1,93 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This Source Code Form is "Incompatible With Secondary Licenses", as +# defined by the Mozilla Public License, v. 2.0. + +package Bugzilla::Extension::RequestNagger; + +use strict; +use warnings; + +use base qw(Bugzilla::Extension); + +use Bugzilla::Constants; + +our $VERSION = '1'; + +# +# installation +# + +sub db_schema_abstract_schema { + my ($self, $args) = @_; + $args->{'schema'}->{'nag_watch'} = { + FIELDS => [ + id => { + TYPE => 'MEDIUMSERIAL', + NOTNULL => 1, + PRIMARYKEY => 1, + }, + nagged_id => { + TYPE => 'INT3', + NOTNULL => 1, + REFERENCES => { + TABLE => 'profiles', + COLUMN => 'userid', + DELETE => 'CASCADE', + } + }, + watcher_id => { + TYPE => 'INT3', + NOTNULL => 1, + REFERENCES => { + TABLE => 'profiles', + COLUMN => 'userid', + DELETE => 'CASCADE', + } + }, + ], + INDEXES => [ + nag_watch_idx => { + FIELDS => [ 'nagged_id', 'watcher_id' ], + TYPE => 'UNIQUE', + }, + ], + }; + $args->{'schema'}->{'nag_defer'} = { + FIELDS => [ + id => { + TYPE => 'MEDIUMSERIAL', + NOTNULL => 1, + PRIMARYKEY => 1, + }, + flag_id => { + TYPE => 'INT3', + NOTNULL => 1, + REFERENCES => { + TABLE => 'flags', + COLUMN => 'id', + DELETE => 'CASCADE', + } + }, + defer_until => { + TYPE => 'DATETIME', + NOTNULL => 1, + }, + ], + INDEXES => [ + nag_defer_idx => { + FIELDS => [ 'flag_id' ], + TYPE => 'UNIQUE', + }, + ], + }; +} + +sub install_update_db { + my $dbh = Bugzilla->dbh; + $dbh->bz_add_column('products', 'nag_interval', { TYPE => 'INT2', NOTNULL => 1, DEFAULT => 7 * 24 }); +} + +__PACKAGE__->NAME; |