[Affelio-cvs 730] CVS update: affelio/lib/Affelio/App/Admin

Back to archive index

Tadashi Okoshi slash****@users*****
2005年 11月 1日 (火) 13:03:57 JST


Index: affelio/lib/Affelio/App/Admin/Messaging.pm
diff -u affelio/lib/Affelio/App/Admin/Messaging.pm:1.16 affelio/lib/Affelio/App/Admin/Messaging.pm:1.17
--- affelio/lib/Affelio/App/Admin/Messaging.pm:1.16	Thu Oct 27 20:15:01 2005
+++ affelio/lib/Affelio/App/Admin/Messaging.pm	Tue Nov  1 13:03:57 2005
@@ -14,7 +14,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #
-# $Id: Messaging.pm,v 1.16 2005/10/27 11:15:01 slash5234 Exp $
+# $Id: Messaging.pm,v 1.17 2005/11/01 04:03:57 slash5234 Exp $
 
 package Affelio::App::Admin::Messaging;
 {
@@ -90,32 +90,58 @@
 	my $output_ref = shift;
     	my $wi = new Affelio::misc::WebInput;
 
-	my $reply_to = $cgi->param("reply_to");
-	my $reply_title = $cgi->param("reply_title");
-	my $reply_body = $cgi->param("reply_body");
+	my $mode="";
+
+	my $to_url;
+	my $reply_to;
+	my $reply_title;
+	my $reply_body;
+
+	$to_url = $cgi->url_param("to_url");
+	$reply_to = $cgi->param("reply_to");
+	$reply_title = $cgi->param("reply_title");
+	$reply_body = $cgi->param("reply_body");
+	if($to_url ne ""){
+	    $mode="GET__specified_dest_url";
+	}elsif($reply_to ne ""){
+	    $mode="POST__reply";
+	}
 
 	debug_print("Messaging::compose: start.");
 	debug_print("Messaging::compose: Reply-To: [$reply_to]");
+	debug_print("Messaging::compose: To_URL: [$to_url]");
 
 	############################
 	#To:
 	############################
 	my @friends_list=();
-	my $result = $af->getFM->get_all_friend_list();
+	my $result = $af->getFM->get_all_friend_list(sort => "nickname");
+
+	#Default
+	if($mode eq ""){
+	    push(@friends_list, {nickname => "",
+				 afid     => "",
+				 selected => "selected"});
+	}
+
 	while( my @row = $result->fetchrow_array ){
 
 	    my $selected = "";
-	    if($row[1] eq $reply_to){
+	    if(($mode eq "POST__reply") && ($row[1] eq $reply_to)){
+		$selected ="selected";
+	    }elsif(($mode eq "GET__specified_dest_url") && ($row[1] =~ /$to_url/)){
 		$selected ="selected";
 	    } 
-	    
-	    push(@friends_list, {nickname => $row[2],
+	    my $t= sprintf("%-20s %s",$row[2],$row[1]);
+	    $t=~ s/\s/ /g;
+
+	    push(@friends_list, {nickname => $t,
 				 afid     => $row[1],
 				 selected => $selected});
-	    debug_print("Messaging::\t$row[2]");
 	}
 	$output_ref->{"friends"} = \@friends_list;
 
+
 	############################
 	#Title:
 	############################


Affelio-cvs メーリングリストの案内
Back to archive index