diff options
author | Marc Alexander <admin@m-a-styles.de> | 2014-03-14 23:35:07 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2014-03-29 22:14:58 +0100 |
commit | d83d819827634931e9317469090e933edfc99f2b (patch) | |
tree | 90030f15f6a85ee426fe3717c80d1f692fc5b8e4 | |
parent | 5866f08919f2d48ab9c1b62caf20836f66cdd21f (diff) | |
download | forums-d83d819827634931e9317469090e933edfc99f2b.tar forums-d83d819827634931e9317469090e933edfc99f2b.tar.gz forums-d83d819827634931e9317469090e933edfc99f2b.tar.bz2 forums-d83d819827634931e9317469090e933edfc99f2b.tar.xz forums-d83d819827634931e9317469090e933edfc99f2b.zip |
[ticket/12150] Use shorter column names for prune settings
All columns were renamed from having prune_shadow_topics as namebase to just
prune_shadow.
A missing column was also added to the migration file's remove_schema() method.
PHPBB3-12150
-rw-r--r-- | phpBB/adm/style/acp_forums.html | 14 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_forums.php | 18 | ||||
-rw-r--r-- | phpBB/language/en/acp/common.php | 2 | ||||
-rw-r--r-- | phpBB/language/en/acp/forums.php | 4 | ||||
-rw-r--r-- | phpBB/phpbb/cron/task/core/prune_shadow_topics.php | 12 | ||||
-rw-r--r-- | phpBB/phpbb/db/migration/data/v310/prune_shadow_topics.php | 15 | ||||
-rw-r--r-- | tests/functional/prune_shadow_topic_test.php | 6 |
7 files changed, 36 insertions, 35 deletions
diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html index 2e826e7c13..0bb5e10f57 100644 --- a/phpBB/adm/style/acp_forums.html +++ b/phpBB/adm/style/acp_forums.html @@ -279,17 +279,17 @@ <label><input type="radio" class="radio" name="prune_sticky" value="0"<!-- IF not S_PRUNE_STICKY --> id="prune_sticky" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="enable_shadow_topic_prune">{L_FORUM_PRUNE_SHADOW_TOPICS}{L_COLON}</label><br /><span>{L_FORUM_PRUNE_SHADOW_TOPICS_EXPLAIN}</span></dt> - <dd><label><input type="radio" class="radio" name="enable_shadow_topic_prune" value="1"<!-- IF S_PRUNE_SHADOW_TOPIC_ENABLE --> id="enable_shadow_topic_prune" checked="checked"<!-- ENDIF --> /> {L_YES}</label> - <label><input type="radio" class="radio" name="enable_shadow_topic_prune" value="0"<!-- IF not S_PRUNE_SHADOW_TOPIC_ENABLE --> id="enable_shadow_topic_prune" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> + <dt><label for="enable_shadow_prune">{L_FORUM_PRUNE_SHADOW}{L_COLON}</label><br /><span>{L_FORUM_PRUNE_SHADOW_EXPLAIN}</span></dt> + <dd><label><input type="radio" class="radio" name="enable_shadow_prune" value="1"<!-- IF S_PRUNE_SHADOW_ENABLE --> id="enable_shadow_prune" checked="checked"<!-- ENDIF --> /> {L_YES}</label> + <label><input type="radio" class="radio" name="enable_shadow_prune" value="0"<!-- IF not S_PRUNE_SHADOW_ENABLE --> id="enable_shadow_prune" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <dl> - <dt><label for="prune_shadow_topic_freq">{L_AUTO_PRUNE_FREQ}{L_COLON}</label><br /><span>{L_AUTO_PRUNE_FREQ_EXPLAIN}</span></dt> - <dd><input type="number" id="prune_shadow_topic_freq" name="prune_shadow_topic_freq" value="{PRUNE_FREQ}" maxlength="4" size="4" min="0" max="9999" /> {L_DAYS}</dd> + <dt><label for="prune_shadow_freq">{L_AUTO_PRUNE_FREQ}{L_COLON}</label><br /><span>{L_AUTO_PRUNE_FREQ_EXPLAIN}</span></dt> + <dd><input type="number" id="prune_shadow_freq" name="prune_shadow_freq" value="{PRUNE_FREQ}" maxlength="4" size="4" min="0" max="9999" /> {L_DAYS}</dd> </dl> <dl> - <dt><label for="prune_shadow_topic_days">{L_AUTO_PRUNE_DAYS}{L_COLON}</label><br /><span>{L_AUTO_PRUNE_DAYS_EXPLAIN}</span></dt> - <dd><input type="number" id="prune_shadow_topic_days" name="prune_shadow_topic_days" value="{PRUNE_DAYS}" maxlength="4" size="4" min="0" max="9999" /> {L_DAYS}</dd> + <dt><label for="prune_shadow_days">{L_AUTO_PRUNE_DAYS}{L_COLON}</label><br /><span>{L_AUTO_PRUNE_DAYS_EXPLAIN}</span></dt> + <dd><input type="number" id="prune_shadow_days" name="prune_shadow_days" value="{PRUNE_DAYS}" maxlength="4" size="4" min="0" max="9999" /> {L_DAYS}</dd> </dl> </fieldset> </div> diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index 4cce7b07ce..c47d9bc185 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -138,15 +138,15 @@ class acp_forums 'enable_prune' => request_var('enable_prune', false), 'enable_post_review' => request_var('enable_post_review', true), 'enable_quick_reply' => request_var('enable_quick_reply', false), - 'enable_shadow_topic_prune' => request_var('enable_shadow_topic_prune', false), + 'enable_shadow_prune' => request_var('enable_shadow_prune', false), 'prune_days' => request_var('prune_days', 7), 'prune_viewed' => request_var('prune_viewed', 7), 'prune_freq' => request_var('prune_freq', 1), 'prune_old_polls' => request_var('prune_old_polls', false), 'prune_announce' => request_var('prune_announce', false), 'prune_sticky' => request_var('prune_sticky', false), - 'prune_shadow_topic_days' => request_var('prune_shadow_topic_days', 7), - 'prune_shadow_topic_freq' => request_var('prune_shadow_topic_freq', 1), + 'prune_shadow_days' => request_var('prune_shadow_days', 7), + 'prune_shadow_freq' => request_var('prune_shadow_freq', 1), 'forum_password' => request_var('forum_password', '', true), 'forum_password_confirm'=> request_var('forum_password_confirm', '', true), 'forum_password_unset' => request_var('forum_password_unset', false), @@ -460,9 +460,9 @@ class acp_forums 'prune_days' => 7, 'prune_viewed' => 7, 'prune_freq' => 1, - 'enable_shadow_topic_prune' => false, - 'prune_shadow_topic_days' => 7, - 'prune_shadow_topic_freq' => 1, + 'enable_shadow_prune' => false, + 'prune_shadow_days' => 7, + 'prune_shadow_freq' => 1, 'forum_flags' => FORUM_FLAG_POST_REVIEW + FORUM_FLAG_ACTIVE_TOPICS, 'forum_options' => 0, 'forum_password' => '', @@ -642,8 +642,8 @@ class acp_forums 'PRUNE_FREQ' => $forum_data['prune_freq'], 'PRUNE_DAYS' => $forum_data['prune_days'], 'PRUNE_VIEWED' => $forum_data['prune_viewed'], - 'PRUNE_SHADOW_TOPIC_FREQ' => $forum_data['prune_shadow_topic_freq'], - 'PRUNE_SHADOW_TOPIC_DAYS' => $forum_data['prune_shadow_topic_days'], + 'PRUNE_SHADOW_FREQ' => $forum_data['prune_shadow_freq'], + 'PRUNE_SHADOW_DAYS' => $forum_data['prune_shadow_days'], 'TOPICS_PER_PAGE' => $forum_data['forum_topics_per_page'], 'FORUM_RULES_LINK' => $forum_data['forum_rules_link'], 'FORUM_RULES' => $forum_data['forum_rules'], @@ -676,7 +676,7 @@ class acp_forums 'S_DISPLAY_SUBFORUM_LIST' => ($forum_data['display_subforum_list']) ? true : false, 'S_DISPLAY_ON_INDEX' => ($forum_data['display_on_index']) ? true : false, 'S_PRUNE_ENABLE' => ($forum_data['enable_prune']) ? true : false, - 'S_PRUNE_SHADOW_TOPIC_ENABLE' => ($forum_data['enable_shadow_topic_prune']) ? true : false, + 'S_PRUNE_SHADOW_ENABLE' => ($forum_data['enable_shadow_prune']) ? true : false, 'S_FORUM_LINK_TRACK' => ($forum_data['forum_flags'] & FORUM_FLAG_LINK_TRACK) ? true : false, 'S_PRUNE_OLD_POLLS' => ($forum_data['forum_flags'] & FORUM_FLAG_PRUNE_POLL) ? true : false, 'S_PRUNE_ANNOUNCE' => ($forum_data['forum_flags'] & FORUM_FLAG_PRUNE_ANNOUNCE) ? true : false, diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index 8c748fe463..2dc58d8361 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -676,7 +676,7 @@ $lang = array_merge($lang, array( 'LOG_PRUNE' => '<strong>Pruned forums</strong><br />» %s', 'LOG_AUTO_PRUNE' => '<strong>Auto-pruned forums</strong><br />» %s', - 'LOG_PRUNE_SHADOW_TOPIC' => '<strong>Auto-pruned shadow topics</strong><br />» %s', + 'LOG_PRUNE_SHADOW' => '<strong>Auto-pruned shadow topics</strong><br />» %s', 'LOG_PRUNE_USER_DEAC' => '<strong>Users deactivated</strong><br />» %s', 'LOG_PRUNE_USER_DEL_DEL' => '<strong>Users pruned and posts deleted</strong><br />» %s', 'LOG_PRUNE_USER_DEL_ANON' => '<strong>Users pruned and posts retained</strong><br />» %s', diff --git a/phpBB/language/en/acp/forums.php b/phpBB/language/en/acp/forums.php index f452dad8a0..d64380b6b6 100644 --- a/phpBB/language/en/acp/forums.php +++ b/phpBB/language/en/acp/forums.php @@ -101,8 +101,8 @@ $lang = array_merge($lang, array( 'FORUM_PASSWORD_OLD' => 'The forum password is using an old hashing method and should be changed.', 'FORUM_PASSWORD_MISMATCH' => 'The passwords you entered did not match.', 'FORUM_PRUNE_SETTINGS' => 'Forum prune settings', - 'FORUM_PRUNE_SHADOW_TOPICS' => 'Enable auto-pruning of shadow topics', - 'FORUM_PRUNE_SHADOW_TOPICS_EXPLAIN' => 'Prunes the forum of shadow topics, set the frequency/age parameters below.', + 'FORUM_PRUNE_SHADOW' => 'Enable auto-pruning of shadow topics', + 'FORUM_PRUNE_SHADOW_EXPLAIN' => 'Prunes the forum of shadow topics, set the frequency/age parameters below.', 'FORUM_RESYNCED' => 'Forum “%s” successfully resynced', 'FORUM_RULES_EXPLAIN' => 'Forum rules are displayed at any page within the given forum.', 'FORUM_RULES_LINK' => 'Link to forum rules', diff --git a/phpBB/phpbb/cron/task/core/prune_shadow_topics.php b/phpBB/phpbb/cron/task/core/prune_shadow_topics.php index 4d7166ccb3..75165d900d 100644 --- a/phpBB/phpbb/cron/task/core/prune_shadow_topics.php +++ b/phpBB/phpbb/cron/task/core/prune_shadow_topics.php @@ -73,9 +73,9 @@ class prune_shadow_topics extends \phpbb\cron\task\base implements \phpbb\cron\t include($this->phpbb_root_path . 'includes/functions_admin.' . $this->php_ext); } - if ($this->forum_data['prune_shadow_topic_days']) + if ($this->forum_data['prune_shadow_days']) { - $this->auto_prune_shadow_topics($this->forum_data['forum_id'], 'shadow', $this->forum_data['forum_flags'], $this->forum_data['prune_shadow_topic_days'], $this->forum_data['prune_shadow_topic_freq']); + $this->auto_prune_shadow_topics($this->forum_data['forum_id'], 'shadow', $this->forum_data['forum_flags'], $this->forum_data['prune_shadow_days'], $this->forum_data['prune_shadow_freq']); } } @@ -105,7 +105,7 @@ class prune_shadow_topics extends \phpbb\cron\task\base implements \phpbb\cron\t */ public function should_run() { - return $this->forum_data['enable_shadow_topic_prune'] && $this->forum_data['prune_shadow_topic_next'] < time(); + return $this->forum_data['enable_shadow_prune'] && $this->forum_data['prune_shadow_next'] < time(); } /** @@ -136,7 +136,7 @@ class prune_shadow_topics extends \phpbb\cron\task\base implements \phpbb\cron\t { $forum_id = $request->variable('f', 0); - $sql = 'SELECT forum_id, prune_shadow_topic_next, enable_shadow_topic_prune, prune_shadow_topic_days, forum_flags, prune_shadow_topic_freq + $sql = 'SELECT forum_id, prune_shadow_next, enable_shadow_prune, prune_shadow_days, forum_flags, prune_shadow_freq FROM ' . FORUMS_TABLE . " WHERE forum_id = $forum_id"; $result = $this->db->sql_query($sql); @@ -176,11 +176,11 @@ class prune_shadow_topics extends \phpbb\cron\task\base implements \phpbb\cron\t prune($forum_id, $prune_mode, $prune_date, $prune_flags, true); $sql = 'UPDATE ' . FORUMS_TABLE . " - SET prune_shadow_topic_next = $next_prune + SET prune_shadow_next = $next_prune WHERE forum_id = $forum_id"; $this->db->sql_query($sql); - add_log('admin', 'LOG_PRUNE_SHADOW_TOPIC', $row['forum_name']); + add_log('admin', 'LOG_PRUNE_SHADOW', $row['forum_name']); } return; diff --git a/phpBB/phpbb/db/migration/data/v310/prune_shadow_topics.php b/phpBB/phpbb/db/migration/data/v310/prune_shadow_topics.php index 0cf9981c14..1e7cfb5acb 100644 --- a/phpBB/phpbb/db/migration/data/v310/prune_shadow_topics.php +++ b/phpBB/phpbb/db/migration/data/v310/prune_shadow_topics.php @@ -21,10 +21,10 @@ class prune_shadow_topics extends \phpbb\db\migration\migration return array( 'add_columns' => array( $this->table_prefix . 'forums' => array( - 'enable_shadow_topic_prune' => array('BOOL', 0, 'after' => 'prune_freq'), - 'prune_shadow_topic_days' => array('UINT', 7, 'after' => 'enable_shadow_topic_prune'), - 'prune_shadow_topic_freq' => array('UINT', 1, 'after' => 'prune_shadow_topic_freq'), - 'prune_shadow_topic_next' => array('INT:11', 0, 'after' => 'prune_shadow_topic_freq'), + 'enable_shadow_prune' => array('BOOL', 0, 'after' => 'prune_freq'), + 'prune_shadow_days' => array('UINT', 7, 'after' => 'enable_shadow_prune'), + 'prune_shadow_freq' => array('UINT', 1, 'after' => 'prune_shadow_freq'), + 'prune_shadow_next' => array('INT:11', 0, 'after' => 'prune_shadow_freq'), ), ), ); @@ -35,9 +35,10 @@ class prune_shadow_topics extends \phpbb\db\migration\migration return array( 'drop_columns' => array( $this->table_prefix . 'forums' => array( - 'enable_shadow_topic_prune', - 'prune_shadow_topic_days', - 'prune_shadow_topic_freq', + 'enable_shadow_prune', + 'prune_shadow_days', + 'prune_shadow_freq', + 'prune_shadow_next', ), ), ); diff --git a/tests/functional/prune_shadow_topic_test.php b/tests/functional/prune_shadow_topic_test.php index 1db8c3aab7..901cedb389 100644 --- a/tests/functional/prune_shadow_topic_test.php +++ b/tests/functional/prune_shadow_topic_test.php @@ -27,9 +27,9 @@ class phpbb_functional_prune_shadow_topic_test extends phpbb_functional_test_cas $crawler = self::submit($form); $form = $crawler->selectButton('update')->form(array( 'forum_perm_from' => 2, - 'enable_shadow_topic_prune' => true, - 'prune_shadow_topic_freq' => 1, - 'prune_shadow_topic_days' => 1, + 'enable_shadow_prune' => true, + 'prune_shadow_freq' => 1, + 'prune_shadow_days' => 1, )); $crawler = self::submit($form); } |