[pLog-svn] r5452 - in plog/branches/lifetype-1.2: class/action/admin js/ui templates/admin
reto at devel.lifetype.net
reto at devel.lifetype.net
Sun May 27 14:35:45 EDT 2007
Author: reto
Date: 2007-05-27 14:35:45 -0400 (Sun, 27 May 2007)
New Revision: 5452
Modified:
plog/branches/lifetype-1.2/class/action/admin/adminaddbloguseraction.class.php
plog/branches/lifetype-1.2/js/ui/default.js
plog/branches/lifetype-1.2/templates/admin/addbloguser.template
Log:
fixing mail notification when adding users to a blog (it never worked) and a small bug that unchecks the mail notification checkbox if permission-sets are chosen.
Modified: plog/branches/lifetype-1.2/class/action/admin/adminaddbloguseraction.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/action/admin/adminaddbloguseraction.class.php 2007-05-27 15:33:10 UTC (rev 5451)
+++ plog/branches/lifetype-1.2/class/action/admin/adminaddbloguseraction.class.php 2007-05-27 18:35:45 UTC (rev 5452)
@@ -28,11 +28,15 @@
// data validation
$this->registerFieldValidator( "newBlogUserName", new StringValidator());
+
$this->_sendNotification = ($this->_request->getValue( "sendNotification" ) != "" );
- if( $this->_sendNotification )
+
+ if( $this->_sendNotification ) {
$this->registerFieldValidator( "newBlogUserText", new StringValidator());
- else
+ }
+ else {
$this->registerField( "newBlogUserText" );
+ }
$this->registerField( "sendNotification" );
$this->registerField( "perm" );
@@ -43,7 +47,7 @@
$this->requirePermission( "add_blog_user" );
}
- function sendNotificationEmail( $userInfo )
+ function sendNotificationEmail( &$userInfo )
{
// if everything went fine, we can now send the confirmation email
// only if the user specified a valid email address
@@ -51,7 +55,7 @@
// build an email message
$message = new EmailMessage();
$message->setBody( $this->_notificationText );
- $message->setSubject( "LifeType Notification" );
+ $message->setSubject( $this->_locale->tr("notification_subject") );
$message->addTo( $userInfo->getEmail());
$message->setFrom( $this->_userInfo->getEmail());
// and finally send it
@@ -106,14 +110,18 @@
$this->sendNotificationEmail( $userInfo );
}
- if( $this->userHasPermission( "view_blog_users" ))
+ if( $this->userHasPermission( "view_blog_users" )) {
$this->_view = new AdminBlogUsersListView( $this->_blogInfo );
- else
+ }
+ else {
$this->_view = new AdminNewBlogUserView( $this->_blogInfo );
+ }
+
$this->_view->setSuccessMessage( $this->_locale->pr("user_added_to_blog_ok", $userInfo->getUsername()));
$this->setCommonData();
return true;
}
+
}
-?>
\ No newline at end of file
+?>
Modified: plog/branches/lifetype-1.2/js/ui/default.js
===================================================================
--- plog/branches/lifetype-1.2/js/ui/default.js 2007-05-27 15:33:10 UTC (rev 5451)
+++ plog/branches/lifetype-1.2/js/ui/default.js 2007-05-27 18:35:45 UTC (rev 5452)
@@ -112,7 +112,7 @@
i = 0;
while (e = f.elements[i])
{
- if (e.type == "checkbox")
+ if (e.type == "checkbox" && e.id != "sendNotification")
{
if( inArray(permissionSets[permissionSet], e.value) )
e.checked = 1;
@@ -190,4 +190,4 @@
{
window.location.href = l;
}
-}
\ No newline at end of file
+}
Modified: plog/branches/lifetype-1.2/templates/admin/addbloguser.template
===================================================================
--- plog/branches/lifetype-1.2/templates/admin/addbloguser.template 2007-05-27 15:33:10 UTC (rev 5451)
+++ plog/branches/lifetype-1.2/templates/admin/addbloguser.template 2007-05-27 18:35:45 UTC (rev 5452)
@@ -24,7 +24,7 @@
<div class="field">
<label for="sendNotification">{$locale->tr("send_notification")}</label>
<div class="formHelp">
- <input class="checkbox" type="checkbox" id="sendNotification" name="sendNotification" value="{$sendNotification}" />
+ <input class="checkbox" type="checkbox" id="sendNotification" name="sendNotification" value="1" {if isset($sendNotification)}checked="checked"{/if} />
{$locale->tr("send_user_notification_help")}
</div>
</div>
@@ -45,7 +45,7 @@
{if $permission->getName() == "blog_access"}
{** the blog_access permission will always be checked by default for new users, in order not to cause confusion as
this permissions is now needed for even accessing the blog **}
- <input type="hidden" name="perm[{$permission->getId()}]" value="{$permission->getId()}" checked="checked" />
+ <input type="hidden" name="perm[{$permission->getId()}]" value="{$permission->getId()}" />
{else}
<input type="checkbox" class="checkbox" name="perm[{$permission->getId()}]" value="{$permission->getId()}" {if $perm[$permId]==$permission->getId()}checked="checked"{/if} />
{$locale->tr($permission->getDescription())}<br/>
More information about the pLog-svn
mailing list