[otrs-cvs] CVS: ITSMCMDB/Kernel/Output/HTML LayoutITSMCMDB.pm, 1.7, 1.8

cvs-log at otrs.org cvs-log at otrs.org
Thu Nov 2 16:09:16 CET 2006


Update of /home/cvs/ITSMCMDB/Kernel/Output/HTML
In directory lancelot:/tmp/cvs-serv17558/Kernel/Output/HTML

Modified Files:
	LayoutITSMCMDB.pm 
Log Message:
added customer selection

Index: LayoutITSMCMDB.pm
===================================================================
RCS file: /home/cvs/ITSMCMDB/Kernel/Output/HTML/LayoutITSMCMDB.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** LayoutITSMCMDB.pm	27 Oct 2006 13:52:41 -0000	1.7
--- LayoutITSMCMDB.pm	2 Nov 2006 15:09:14 -0000	1.8
***************
*** 124,127 ****
--- 124,184 ----
  }
  
+ =item ITSMCMDBInputCustomerSelect()
+ 
+ returns a text customer seleect html string
+ 
+     my $String = $LayoutObject->ITSMCMDBInputCustomerSelect(
+         Name => 'inputname',
+         Value => 'the Value',
+     );
+ 
+ =cut
+ 
+ sub ITSMCMDBInputCustomerSelect {
+     my $Self = shift;
+     my %Param = @_;
+     # check needed stuff
+     foreach (qw()) {
+         if (!$Param{$_}) {
+             $Self->{LogObject}->Log(Priority => 'error', Message => "Need $_!");
+             return;
+         }
+     }
+ 
+     $Param{Name} = $Param{Name} || 'name';
+     $Param{Value} = $Param{Value} || '';
+     my $String = "<input type=\"text\" name=\"$Param{Name}\" ";
+ 
+     if ($Param{Value}) {
+         $String .= "value=\"$Param{Value}\" ";
+     }
+     $String .= ">";
+ 
+     if ($Param{Realname}) {
+         $String .= $Param{Realname};
+     }
+     $String .= '<br>';
+     if ($Param{Result} && %{$Param{Result}}) {
+         $Param{CustomerUserListCount} = 0;
+         foreach (keys %{$Param{Result}}) {
+             $Param{CustomerUserListCount}++;
+             $Param{CustomerUserListLast} = $Param{Result}->{$_};
+             $Param{CustomerUserListLastUser} = $_;
+         }
+         if ($Param{CustomerUserListCount} > 1) {
+             my $Selection = $Self->{LayoutObject}->OptionStrgHashRef(
+                 Data => $Param{Result},
+                 Name => $Param{Name},
+                 Max => 80,
+             );
+             $String = $Selection.'<br>';
+             $String .= '<input class="button" type="submit" name="'.$Param{Name}.'::ExpandCustomerName2" value="$Text{"Take this Customer"}">';
+         }
+     }
+     $String .= '<input class="button" type="submit" name="'.$Param{Name}.'::ExpandCustomerName1" value="$Text{"Search Customer"}">';
+ 
+     return $String;
+ }
+ 
  =item ITSMCMDBButtom()
  



More information about the cvs-log mailing list