[pLog-svn] r5328 - in plog/branches/lifetype-1.2: class/action/admin class/view/admin locale/admin templates/admin

oscar at devel.lifetype.net oscar at devel.lifetype.net
Sat Apr 21 08:16:14 EDT 2007


Author: oscar
Date: 2007-04-21 08:16:14 -0400 (Sat, 21 Apr 2007)
New Revision: 5328

Modified:
   plog/branches/lifetype-1.2/class/action/admin/adminaddpostaction.class.php
   plog/branches/lifetype-1.2/class/action/admin/adminpostmanagementcommonaction.class.php
   plog/branches/lifetype-1.2/class/action/admin/adminupdatepostaction.class.php
   plog/branches/lifetype-1.2/class/view/admin/admineditpostview.class.php
   plog/branches/lifetype-1.2/locale/admin/locale_ca_ES.php
   plog/branches/lifetype-1.2/locale/admin/locale_de_DE.php
   plog/branches/lifetype-1.2/locale/admin/locale_en_UK.php
   plog/branches/lifetype-1.2/locale/admin/locale_es_ES.php
   plog/branches/lifetype-1.2/locale/admin/locale_fr_FR.php
   plog/branches/lifetype-1.2/locale/admin/locale_it_IT.php
   plog/branches/lifetype-1.2/locale/admin/locale_nl_NL.php
   plog/branches/lifetype-1.2/locale/admin/locale_zh_CN.php
   plog/branches/lifetype-1.2/locale/admin/locale_zh_TW.php
   plog/branches/lifetype-1.2/templates/admin/editpost.template
   plog/branches/lifetype-1.2/templates/admin/newpost.template
Log:
Implemented feature request http://bugs.lifetype.net/view.php?id=1273 -- now the ownership of the post won't be reassigned to the last user who updated anymore but it will stay assigned to the original author. In addition to that, there's now a drop-down list available that will allow blog owners and users with the edit_all_users_posts permission to choose the article owner, both in the "new post" and "edit post" screen. 


Modified: plog/branches/lifetype-1.2/class/action/admin/adminaddpostaction.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/action/admin/adminaddpostaction.class.php	2007-04-20 13:56:34 UTC (rev 5327)
+++ plog/branches/lifetype-1.2/class/action/admin/adminaddpostaction.class.php	2007-04-21 12:16:14 UTC (rev 5328)
@@ -43,7 +43,8 @@
         	$this->registerField( "commentsEnabled" );
         	$this->registerField( "customField" );
         	$this->registerField( "postDateTime" );
-        	$this->registerField( "trackbackUrls" );        	
+        	$this->registerField( "trackbackUrls" );
+			$this->registerField( "postUser" );
 
 			// security checks
 			$this->requirePermission( "add_post" );
@@ -122,7 +123,7 @@
 			$article  = new Article( $this->_postTopic, 
 			                         $postText, 
 			                         $this->_postCategories,
-									 $this->_userInfo->getId(), 
+									 $this->_posterId, 
 									 $this->_blogInfo->getId(), 
 									 $this->_postStatus, 
 									 0, 

Modified: plog/branches/lifetype-1.2/class/action/admin/adminpostmanagementcommonaction.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/action/admin/adminpostmanagementcommonaction.class.php	2007-04-20 13:56:34 UTC (rev 5327)
+++ plog/branches/lifetype-1.2/class/action/admin/adminpostmanagementcommonaction.class.php	2007-04-21 12:16:14 UTC (rev 5328)
@@ -30,6 +30,7 @@
         var $_commentsEnabled;
         var $_globalCategoryId;
         var $_trackbackUrls;
+		var $_posterId;
         // stuff about the date
         var $_postYear;
         var $_postMonth;
@@ -129,6 +130,7 @@
 				
         	$this->_postText     = trim(Textfilter::xhtmlize(Textfilter::filterJavaScript($this->_postText)));
             $this->_postTopic    = trim(Textfilter::xhtmlize(Textfilter::filterAllHTML($this->_request->getValue( "postTopic" ))));
+			$this->_posterId = $this->_request->getValue( "posterId" );
             $this->_postCategories = $this->_request->getValue( "postCategories" );
 			$this->_postSlug = Textfilter::filterAllHTML($this->_request->getValue( "postSlug" ));
             $this->_postStatus   = $this->_request->getValue( "postStatus" );
@@ -145,6 +147,16 @@
 			
             // fetch the timestamp that the post will have
 			$this->_fetchPostDateInformation();
+
+			// information about the poster but only if the user is supposed to be able to change it
+			if( $this->_userInfo->hasPermissionByName( "update_all_user_articles", $this->_blogInfo->getId()) || 
+			    $this->_userInfo->isSiteAdmin() || 
+			    $this->_blogInfo->getOwnerId() == $this->_userInfo->getId()) {			
+				$this->_posterId = $this->_request->getValue( "postUser" );
+			}
+			else {
+				$this->_posterId = $this->_userInfo->getId();
+			}			
 		}
 		
 		/**

Modified: plog/branches/lifetype-1.2/class/action/admin/adminupdatepostaction.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/action/admin/adminupdatepostaction.class.php	2007-04-20 13:56:34 UTC (rev 5327)
+++ plog/branches/lifetype-1.2/class/action/admin/adminupdatepostaction.class.php	2007-04-21 12:16:14 UTC (rev 5328)
@@ -65,9 +65,10 @@
         	$this->registerField( "commentsEnabled" );
         	$this->registerField( "customField" );
         	$this->registerField( "postDateTime" );   
-        	$this->registerField( "trackbackUrls" );     	
+        	$this->registerField( "trackbackUrls" );
+			$this->registerField( "postUser" );   	
 
-			$this->requirePermission( "add_post" );
+			$this->requirePermission( "update_post" );
         }
         
         /**
@@ -115,7 +116,8 @@
             $post->setDateObject( $this->_postTimestamp );
             $post->setCommentsEnabled( $this->_commentsEnabled );
 			$post->setPostSlug( $this->_postSlug );
-			$post->setGlobalCategoryId( $this->_globalArticleCategoryId );
+			$post->setGlobalCategoryId( $this->_globalArticleCategoryId );		
+			$post->setUser( $this->_posterId );			
 
             // prepare the custom fields
             $fields = Array();

Modified: plog/branches/lifetype-1.2/class/view/admin/admineditpostview.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/view/admin/admineditpostview.class.php	2007-04-20 13:56:34 UTC (rev 5327)
+++ plog/branches/lifetype-1.2/class/view/admin/admineditpostview.class.php	2007-04-21 12:16:14 UTC (rev 5328)
@@ -53,6 +53,7 @@
                 $this->setValue( "postText", str_replace('&', '&', $this->_article->getText( false )));
 	            $this->setValue( "postSlug", $this->_article->getPostSlug());
 	            $this->setValue( "postId", $this->_article->getId());
+				$this->setValue( "postUser", $this->_article->getUserId());
 	            if( $this->_article->getCommentsEnabled())
 					$commentsEnabled = true;
 	            else

Modified: plog/branches/lifetype-1.2/locale/admin/locale_ca_ES.php
===================================================================
--- plog/branches/lifetype-1.2/locale/admin/locale_ca_ES.php	2007-04-20 13:56:34 UTC (rev 5327)
+++ plog/branches/lifetype-1.2/locale/admin/locale_ca_ES.php	2007-04-21 12:16:14 UTC (rev 5328)
@@ -1185,4 +1185,7 @@
 $messages['full_blog_permission'] = 'Permet a l\'usuari accedir al bloc com si fos el propietari.';
 
 $messages['error_template_exist'] = 'Hi ha hagut un error afegint la nova plantilla, ja hi ha una plantilla anomenada "%s".';
+
+/// new strings in LT 1.2.2 ///
+$messages['posted_by_help'] = 'Select article owner';
 ?>
\ No newline at end of file

Modified: plog/branches/lifetype-1.2/locale/admin/locale_de_DE.php
===================================================================
--- plog/branches/lifetype-1.2/locale/admin/locale_de_DE.php	2007-04-20 13:56:34 UTC (rev 5327)
+++ plog/branches/lifetype-1.2/locale/admin/locale_de_DE.php	2007-04-21 12:16:14 UTC (rev 5328)
@@ -1172,4 +1172,7 @@
 $messages['full_blog_permission'] = 'Dem Benutzer die selben Berechtigungen wie dem Blog Besitzer geben.';
 
 $messages['error_template_exist'] = 'Fehler beim Hochladen des Templates. Template "%s" existiert bereits.';
+
+/// new strings in LT 1.2.2 ///
+$messages['posted_by_help'] = 'Select article owner';
 ?>

Modified: plog/branches/lifetype-1.2/locale/admin/locale_en_UK.php
===================================================================
--- plog/branches/lifetype-1.2/locale/admin/locale_en_UK.php	2007-04-20 13:56:34 UTC (rev 5327)
+++ plog/branches/lifetype-1.2/locale/admin/locale_en_UK.php	2007-04-21 12:16:14 UTC (rev 5328)
@@ -1168,4 +1168,7 @@
 $messages['full_blog_permission'] = 'Allow blog user to access all blog functions as blog owner';
 
 $messages['error_template_exist'] = 'There was an error uploading the template, template "%s" already exist.';
+
+/// new strings in LT 1.2.2 ///
+$messages['posted_by_help'] = 'Select article owner';
 ?>

Modified: plog/branches/lifetype-1.2/locale/admin/locale_es_ES.php
===================================================================
--- plog/branches/lifetype-1.2/locale/admin/locale_es_ES.php	2007-04-20 13:56:34 UTC (rev 5327)
+++ plog/branches/lifetype-1.2/locale/admin/locale_es_ES.php	2007-04-21 12:16:14 UTC (rev 5328)
@@ -1179,4 +1179,7 @@
 $messages['full_blog_permission'] = 'Permite al usuaio acceder al blog como si fuera el propietario';
 
 $messages['error_template_exist'] = 'Hubo un error añadiendo la nueva plantilla, ya hay una plantilla llamada "%s".';
+
+/// new strings in LT 1.2.2 ///
+$messages['posted_by_help'] = 'Select article owner';
 ?>

Modified: plog/branches/lifetype-1.2/locale/admin/locale_fr_FR.php
===================================================================
--- plog/branches/lifetype-1.2/locale/admin/locale_fr_FR.php	2007-04-20 13:56:34 UTC (rev 5327)
+++ plog/branches/lifetype-1.2/locale/admin/locale_fr_FR.php	2007-04-21 12:16:14 UTC (rev 5328)
@@ -1348,4 +1348,7 @@
 $messages['full_blog_permission'] = 'Allow blog user access all blog functions as blog owner';
 
 $messages['error_template_exist'] = 'There was an error upload the template, template "%s" already exist.';
-?>
+
+/// new strings in LT 1.2.2 ///
+$messages['posted_by_help'] = 'Select article owner';
+?>

Modified: plog/branches/lifetype-1.2/locale/admin/locale_it_IT.php
===================================================================
--- plog/branches/lifetype-1.2/locale/admin/locale_it_IT.php	2007-04-20 13:56:34 UTC (rev 5327)
+++ plog/branches/lifetype-1.2/locale/admin/locale_it_IT.php	2007-04-21 12:16:14 UTC (rev 5328)
@@ -1167,4 +1167,7 @@
 $messages['full_blog_permission'] = 'Permetti agli utenti del blog di accedere a tutte le funzioni del blog come se fossere i proprietari';
 
 $messages['error_template_exist'] = 'Si è verificato un errore caricando lo stile, lo stile "%s" esiste già.';
-?>
+
+/// new strings in LT 1.2.2 ///
+$messages['posted_by_help'] = 'Select article owner';
+?>
\ No newline at end of file

Modified: plog/branches/lifetype-1.2/locale/admin/locale_nl_NL.php
===================================================================
--- plog/branches/lifetype-1.2/locale/admin/locale_nl_NL.php	2007-04-20 13:56:34 UTC (rev 5327)
+++ plog/branches/lifetype-1.2/locale/admin/locale_nl_NL.php	2007-04-21 12:16:14 UTC (rev 5328)
@@ -1246,4 +1246,7 @@
 $messages['full_blog_permission'] = 'Sta de blog gebruiker toe om toegang te krijgen tot alle blogfuncties als blogeigenaar.';
 
 $messages['error_template_exist'] = 'Er is een fout opgetreden bij het uploaden, template "%s" bestaat al.';
-?>
+
+/// new strings in LT 1.2.2 ///
+$messages['posted_by_help'] = 'Select article owner';
+?>
\ No newline at end of file

Modified: plog/branches/lifetype-1.2/locale/admin/locale_zh_CN.php
===================================================================
--- plog/branches/lifetype-1.2/locale/admin/locale_zh_CN.php	2007-04-20 13:56:34 UTC (rev 5327)
+++ plog/branches/lifetype-1.2/locale/admin/locale_zh_CN.php	2007-04-21 12:16:14 UTC (rev 5328)
@@ -1168,4 +1168,7 @@
 $messages['full_blog_permission'] = '博客作者可以跟博客拥有者一样,操作所有功能';
 
 $messages['error_template_exist'] = '上传模版时发生错误,“%s”模版已经存在。';
-?>
+
+/// new strings in LT 1.2.2 ///
+$messages['posted_by_help'] = 'Select article owner';
+?>
\ No newline at end of file

Modified: plog/branches/lifetype-1.2/locale/admin/locale_zh_TW.php
===================================================================
--- plog/branches/lifetype-1.2/locale/admin/locale_zh_TW.php	2007-04-20 13:56:34 UTC (rev 5327)
+++ plog/branches/lifetype-1.2/locale/admin/locale_zh_TW.php	2007-04-21 12:16:14 UTC (rev 5328)
@@ -1168,4 +1168,7 @@
 $messages['full_blog_permission'] = '網誌作者可以跟網誌擁有者一樣,操作所有功能';
 
 $messages['error_template_exist'] = '上傳模版時發生錯誤,「%s」模版已經存在。';
-?>
+
+/// new strings in LT 1.2.2 ///
+$messages['posted_by_help'] = 'Select article owner';
+?>
\ No newline at end of file

Modified: plog/branches/lifetype-1.2/templates/admin/editpost.template
===================================================================
--- plog/branches/lifetype-1.2/templates/admin/editpost.template	2007-04-20 13:56:34 UTC (rev 5327)
+++ plog/branches/lifetype-1.2/templates/admin/editpost.template	2007-04-21 12:16:14 UTC (rev 5328)
@@ -103,6 +103,20 @@
 		   {/foreach}
          </select>	   
 	   </div>
+	
+	  <!-- user field -->
+	  {check_perms perm=update_all_user_articles}
+	   <div class="field">
+        <label for="postUser">{$locale->tr("posted_by")}</label>
+		 <span class="required">*</span>		 
+		 <div class="formHelp">{$locale->tr("posted_by_help")}</div>
+		 <select name="postUser" id="postUser">
+		   {foreach from=$blog->getUsersInfo() item=bloguser}
+			<option value="{$bloguser->getId()}" {if $postUser==$bloguser->getId()}selected="selected"{/if}>{$bloguser->getUserName()}</option>
+		   {/foreach}
+        </select>	   
+	   </div>
+	   {/check_perms}	
 	   
 	   <div class="field">
          <label for="postCategories[]">{$locale->tr("categories")}</label>

Modified: plog/branches/lifetype-1.2/templates/admin/newpost.template
===================================================================
--- plog/branches/lifetype-1.2/templates/admin/newpost.template	2007-04-20 13:56:34 UTC (rev 5327)
+++ plog/branches/lifetype-1.2/templates/admin/newpost.template	2007-04-21 12:16:14 UTC (rev 5328)
@@ -125,6 +125,20 @@
 		   {/foreach}
          </select>	   
 	   </div>
+	
+	  <!-- user field -->
+	  {check_perms perm=update_all_user_articles}
+	   <div class="field">
+        <label for="postUser">{$locale->tr("posted_by")}</label>
+		 <span class="required">*</span>		 
+		 <div class="formHelp">{$locale->tr("posted_by_help")}</div>
+		 <select name="postUser" id="postUser">
+		   {foreach from=$blog->getUsersInfo() item=bloguser}
+			<option value="{$bloguser->getId()}" {if $postUser==$bloguser->getId()}selected="selected"{/if}>{$bloguser->getUserName()}</option>
+		   {/foreach}
+        </select>	   
+	   </div>
+	   {/check_perms}
 	   
 	   <div class="field">
          <label for="postCategories[]">{$locale->tr("categories")}</label>



More information about the pLog-svn mailing list