Skip to content

Commit

Permalink
Fix Kunena#916: Moderators Not Receiving New Topic/New Post Emails
Browse files Browse the repository at this point in the history
* Keep the old behavior from K!1.7 by default (mailmod, mailadmin)
* Rename old 'No' to 'Unapproved Posts'
* Add new option to disable emails ('No')
* Change descriptions
  • Loading branch information
mahagr committed Jul 3, 2012
1 parent 6395612 commit 4347f6d
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 15 deletions.
Expand Up @@ -93,6 +93,8 @@ COM_KUNENA_SHOW_USERLIST_COUNTUNSERS_ACTIVATED_ACCOUNT="All Real Users"
COM_KUNENA_SHOW_USERLIST_COUNTUNSERS_ACTIVE="Only Active Users"
COM_KUNENA_SHOW_USERLIST_COUNTUNSERS_ALL="All Users"
COM_KUNENA_SHOW_USERLIST_COUNTUNSERS_NON_BLOCKED_USERS="Show only non-blocked users"
COM_KUNENA_CFG_OPTION_UNAPPROVED_POSTS="Unapproved Posts"
COM_KUNENA_CFG_OPTION_ALL_NEW_POSTS="All New Posts"

; JROOT/administrator/components/com_kunena/models/cpanel.php

Expand Down
Expand Up @@ -199,14 +199,14 @@ COM_KUNENA_A_LATESTCATEGORY_IN="Category Filter in Recent Topics"
COM_KUNENA_A_LATESTCATEGORY_IN_DESC="Choose if you want show or hide following categories in recent topics."
COM_KUNENA_A_LENGTHS="Length Settings"
COM_KUNENA_A_LOOKS="Look and Feel"
COM_KUNENA_A_MAIL_ADMIN="E-mail Administrators"
COM_KUNENA_A_MAIL_ADMIN_DESC="Set to <em>Yes</em> if you want e-mail notifications on each new post sent to the enabled system administrator(s)."
COM_KUNENA_A_MAILADMIN="E-mail Administrators"
COM_KUNENA_A_MAILADMIN_DESC="Set to <em>Unapproved Posts</em> or <em>All New Posts</em> if you want e-mail notifications on new new posts sent to the Kunena administrators."
COM_KUNENA_A_MESSAGES="Messages Per Page"
COM_KUNENA_A_MESSAGES_DESC="Number of messages per page to show"
COM_KUNENA_A_MESSAGES_DESC_SEARCH="Messages per page for search results"
COM_KUNENA_A_MESSAGES_SEARCH="Search Results"
COM_KUNENA_A_MODERATION="E-mail Moderators"
COM_KUNENA_A_MODERATION_DESC="Set to <em>Yes</em> if you want e-mail notifications on new posts sent to the category moderator(s). Note: Although every Administrator has automatically all Moderator privileges, assign them explicitly as moderators on the category to receive e-mails too."
COM_KUNENA_A_MAILMOD="E-mail Moderators"
COM_KUNENA_A_MAILMOD_DESC="Set to <em>Unapproved Posts</em> or <em>All New Posts</em> if you want e-mail notifications on new posts sent to the category moderators. Note: Global moderators and administrators do not get e-mail notifications with this option unless you explicitly assign them as moderators on the category."
COM_KUNENA_A_PESONNALTEXT="Max. Personal Text Length"
COM_KUNENA_A_PESONNALTEXT_DESC="Maximum number of characters allowed for the personal text in user profile."
COM_KUNENA_A_POLL_ALLOW_ONE_VOTE="Single Vote Only"
Expand Down
Expand Up @@ -142,12 +142,12 @@ public function sendNotification($url=null) {
return;
} elseif ($this->hold == 1) {
$mailsubs = 0;
$mailmods = (bool) $config->mailmod;
$mailadmins = (bool) $config->mailadmin;
$mailmods = $config->mailmod >= 0;
$mailadmins = $config->mailadmin >= 0;
} else {
$mailsubs = (bool) $config->allowsubscriptions;
$mailmods = 0;
$mailadmins = 0;
$mailmods = $config->mailmod >= 1;
$mailadmins = $config->mailadmin >= 1;
}

$once = false;
Expand Down
13 changes: 10 additions & 3 deletions administrator/components/com_kunena/models/config.php
Expand Up @@ -141,8 +141,6 @@ function getConfiglists() {
$lists ['allowsubscriptions'] = JHTML::_ ( 'select.genericlist', $yesno, 'cfg_allowsubscriptions', 'class="inputbox" size="1"', 'value', 'text', $this->config->allowsubscriptions );
$lists ['subscriptionschecked'] = JHTML::_ ( 'select.genericlist', $yesno, 'cfg_subscriptionschecked', 'class="inputbox" size="1"', 'value', 'text', $this->config->subscriptionschecked );
$lists ['allowfavorites'] = JHTML::_ ( 'select.genericlist', $yesno, 'cfg_allowfavorites', 'class="inputbox" size="1"', 'value', 'text', $this->config->allowfavorites );
$lists ['mailmod'] = JHTML::_ ( 'select.genericlist', $yesno, 'cfg_mailmod', 'class="inputbox" size="1"', 'value', 'text', $this->config->mailmod );
$lists ['mailadmin'] = JHTML::_ ( 'select.genericlist', $yesno, 'cfg_mailadmin', 'class="inputbox" size="1"', 'value', 'text', $this->config->mailadmin );
$lists ['showemail'] = JHTML::_ ( 'select.genericlist', $yesno, 'cfg_showemail', 'class="inputbox" size="1"', 'value', 'text', $this->config->showemail );
$lists ['askemail'] = JHTML::_ ( 'select.genericlist', $yesno, 'cfg_askemail', 'class="inputbox" size="1"', 'value', 'text', $this->config->askemail );
$lists ['changename'] = JHTML::_ ( 'select.genericlist', $yesno, 'cfg_changename', 'class="inputbox" size="1"', 'value', 'text', $this->config->changename );
Expand Down Expand Up @@ -316,7 +314,7 @@ function getConfiglists() {
$recaptcha_theme[] = JHTML::_('select.option', 'clean', JText::_('COM_KUNENA_A_RECAPTCHA_THEME_OPTION_CLEAN'));
$lists ['recaptcha_theme'] = JHTML::_ ( 'select.genericlist', $recaptcha_theme, 'cfg_recaptcha_theme', 'class="inputbox" size="1"', 'value', 'text', $this->config->recaptcha_theme );

// Kunena 2.0.0
// Added new options into Kunena 2.0.0
$lists ['keywords'] = JHTML::_('select.genericlist', $yesno, 'cfg_keywords', 'class="inputbox" size="1"', 'value', 'text', $this->config->keywords);
$lists ['userkeywords'] = JHTML::_('select.genericlist', $yesno, 'cfg_userkeywords', 'class="inputbox" size="1"', 'value', 'text', $this->config->userkeywords);

Expand Down Expand Up @@ -373,6 +371,15 @@ function getConfiglists() {
$lists ['cache'] = JHTML::_('select.genericlist', $yesno, 'cfg_cache', 'class="inputbox" size="1"', 'value', 'text', $this->config->cache);
$lists ['cache_time'] = JHTML::_('select.genericlist', $cachetime, 'cfg_cache_time', 'class="inputbox" size="1"', 'value', 'text', $this->config->cache_time);

// Added new options into Kunena 2.0.1
$mailoptions = array();
$mailoptions[] = JHTML::_('select.option', '-1', JText::_('COM_KUNENA_NO'));
$mailoptions[] = JHTML::_('select.option', '0', JText::_('COM_KUNENA_CFG_OPTION_UNAPPROVED_POSTS'));
$mailoptions[] = JHTML::_('select.option', '1', JText::_('COM_KUNENA_CFG_OPTION_ALL_NEW_POSTS'));

$lists ['mailmod'] = JHTML::_ ( 'select.genericlist', $mailoptions, 'cfg_mailmod', 'class="inputbox" size="1"', 'value', 'text', $this->config->mailmod );
$lists ['mailadmin'] = JHTML::_ ( 'select.genericlist', $mailoptions, 'cfg_mailadmin', 'class="inputbox" size="1"', 'value', 'text', $this->config->mailadmin );

return $lists;
}
}
Expand Up @@ -517,14 +517,14 @@
<td align="left" valign="top"><?php echo JText::_('COM_KUNENA_A_FLOOD_DESC') ?></td>
</tr>
<tr align="center" valign="middle">
<td align="left" valign="top"><?php echo JText::_('COM_KUNENA_A_MODERATION') ?></td>
<td align="left" valign="top"><?php echo JText::_('COM_KUNENA_A_MAILMOD') ?></td>
<td align="left" valign="top"><?php echo $this->lists ['mailmod'] ?></td>
<td align="left" valign="top"><?php echo JText::_('COM_KUNENA_A_MODERATION_DESC') ?></td>
<td align="left" valign="top"><?php echo JText::_('COM_KUNENA_A_MAILMOD_DESC') ?></td>
</tr>
<tr align="center" valign="middle">
<td align="left" valign="top"><?php echo JText::_('COM_KUNENA_A_MAIL_ADMIN') ?></td>
<td align="left" valign="top"><?php echo JText::_('COM_KUNENA_A_MAILADMIN') ?></td>
<td align="left" valign="top"><?php echo $this->lists ['mailadmin'] ?></td>
<td align="left" valign="top"><?php echo JText::_('COM_KUNENA_A_MAIL_ADMIN_DESC') ?></td>
<td align="left" valign="top"><?php echo JText::_('COM_KUNENA_A_MAILADMIN_DESC') ?></td>
</tr>
</table>
</fieldset>
Expand Down

0 comments on commit 4347f6d

Please sign in to comment.