[otrs-cvs] CVS: ITSMCMDB/Kernel/Modules AgentITSMCMDB.pm,1.35,1.36

cvs-log at otrs.org cvs-log at otrs.org
Thu Nov 2 13:46:28 CET 2006


Update of /home/cvs/ITSMCMDB/Kernel/Modules
In directory lancelot:/tmp/cvs-serv13580/Kernel/Modules

Modified Files:
	AgentITSMCMDB.pm 
Log Message:
add search function

Index: AgentITSMCMDB.pm
===================================================================
RCS file: /home/cvs/ITSMCMDB/Kernel/Modules/AgentITSMCMDB.pm,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -r1.35 -r1.36
*** AgentITSMCMDB.pm	2 Nov 2006 12:05:04 -0000	1.35
--- AgentITSMCMDB.pm	2 Nov 2006 12:46:25 -0000	1.36
***************
*** 374,384 ****
  
      elsif ($Self->{Subaction} eq 'RecordSearch') {
          $Output = $Self->{LayoutObject}->Header(Title => 'Search Record');
          $Output .= $Self->{LayoutObject}->NavigationBar();
  
          $Self->{LayoutObject}->Block(
              Name => 'RecordSearch',
!             Data => {},
          );
  
          $Output .= $Self->{LayoutObject}->Output(
--- 374,509 ----
  
      elsif ($Self->{Subaction} eq 'RecordSearch') {
+         my $ConfigItemSelect = $Self->{ParamObject}->GetParam(Param => "ConfigItemSelect");
+ 
          $Output = $Self->{LayoutObject}->Header(Title => 'Search Record');
          $Output .= $Self->{LayoutObject}->NavigationBar();
  
+         # create config item list
+         my %ConfigItemList;
+         foreach my $OneConfigItem ($Self->{ITSMCMDBObject}->ConfigItemList()) {
+             $ConfigItemList{$OneConfigItem} = $OneConfigItem;
+         }
+         # create pulldown field
+         $Param{ConfigItemSelectStrg} = $Self->{LayoutObject}->OptionStrgHashRef(
+             Name => 'ConfigItemSelect',
+             Data => \%ConfigItemList,
+             SelectedID => $ConfigItemSelect,
+         );
+         # output block
          $Self->{LayoutObject}->Block(
              Name => 'RecordSearch',
!             Data => {%Param},
          );
+         # if config item was selected
+         if ($ConfigItemSelect) {
+             $Self->{LayoutObject}->Block(
+                 Name => 'RecordSearchAttribute',
+                 Data => {},
+             );
+ 
+             # get attributes
+             my @Attributes = $Self->{ITSMCMDBObject}->AttributeSearch(
+                 ConfigItem => $ConfigItemSelect,
+                 Option => 'Searchable',
+                 OptionValue => 1,
+             );
+ 
+             foreach my $Key (@Attributes) {
+                 my $AttributeInput = $Self->{LayoutObject}->ITSMCMDBInputText(
+                     Name => $Key,
+                     Size => 50,
+                 );
+ 
+                 $Self->{LayoutObject}->Block(
+                     Name => 'RecordSearchAttributeRow',
+                     Data => {
+                         Attribute => $Key,
+                         AttributeInput => $AttributeInput,
+                     },
+                 );
+             }
+         }
+ 
+ #        # output search result
+ #        if ($SubmitSearch) {
+ #            my @ConfigItemResultList = $Self->{ParamObject}->GetArray(Param => "ConfigItemSelect");
+ #            if (!@ConfigItemResultList) {
+ #                foreach (sort keys %ConfigItemList) {
+ #                    push (@ConfigItemResultList, $_);
+ #                }
+ #            }
+ #
+ #            foreach my $ConfigItem (@ConfigItemResultList) {
+ #                my @SearchResult = $Self->{ITSMCMDBObject}->RecordSearch(
+ #                    ConfigItem => $ConfigItem,
+ #
+ #                );
+ #
+ #                if (@SearchResult) {
+ #                    $Self->{LayoutObject}->Block(
+ #                        Name => 'RecordSearchResult',
+ #                        Data => {%Param},
+ #                    );
+ #
+ #                    # get overview attribute
+ #                    my @AttributeOverview = $Self->{ITSMCMDBObject}->AttributeOverviewList(
+ #                        ConfigItem => $ConfigItem,
+ #                    );
+ #
+ #                    # output table header
+ #                    foreach (@AttributeOverview) {
+ #                        $Self->{LayoutObject}->Block(
+ #                            Name => 'RecordSearchResultColumn',
+ #                            Data => {
+ #                                Attribute => $_,
+ #                            },
+ #                        );
+ #                    }
+ #
+ #                    foreach my $RecordID (@SearchResult) {
+ #                        # set output class
+ #                        if ($Param{Class} && $Param{Class} eq 'searchpassive') {
+ #                            $Param{Class} = 'searchactive';
+ #                        }
+ #                        else {
+ #                            $Param{Class} = 'searchpassive';
+ #                        }
+ #
+ #                        $Self->{LayoutObject}->Block(
+ #                            Name => 'RecordSearchResultRow',
+ #                            Data => {
+ #                                ConfigItem => $ConfigItem,
+ #                                RecordID => $RecordID,
+ #                                RecordIDHuman => sprintf("%08d", $RecordID),
+ #                                %Param,
+ #                            },
+ #                        );
+ #                        # output table header
+ #                        foreach (@AttributeOverview) {
+ #                            my $AttributeValue = $Self->{ITSMCMDBObject}->AttributeValueGet(
+ #                                ConfigItem => $ConfigItem,
+ #                                RecordID => $RecordID,
+ #                                Attribute => $_,
+ #                            );
+ #
+ #                            $Self->{LayoutObject}->Block(
+ #                                Name => 'RecordSearchResultRowColumn',
+ #                                Data => {
+ #                                    Attribute => $AttributeValue,
+ #                                    %Param,
+ #                                },
+ #                            );
+ #                        }
+ #                    }
+ #
+ #                    # output table footer
+ #                    foreach (@AttributeOverview) {
+ #                        $Self->{LayoutObject}->Block(
+ #                            Name => 'RecordSearchResultColumn2',
+ #                        );
+ #                    }
+ #                }
+ #            }
+ #        }
  
          $Output .= $Self->{LayoutObject}->Output(



More information about the cvs-log mailing list