[tools] testbot/cgi: Rename the per-item action list variables.

Francois Gouget fgouget at codeweavers.com
Thu Mar 3 11:15:15 CST 2022


Rename it to $ItemActions to avoid confusion with the global actions
list ($Actions).

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 .../lib/ObjectModel/CGI/CollectionBlock.pm    | 54 ++++++++++++++-----
 .../ObjectModel/CGI/CollectionBlockForPage.pm |  8 +--
 testbot/lib/ObjectModel/CGI/CollectionPage.pm |  8 +--
 3 files changed, 48 insertions(+), 22 deletions(-)

diff --git a/testbot/lib/ObjectModel/CGI/CollectionBlock.pm b/testbot/lib/ObjectModel/CGI/CollectionBlock.pm
index effd039fb2..3af2a14ce5 100644
--- a/testbot/lib/ObjectModel/CGI/CollectionBlock.pm
+++ b/testbot/lib/ObjectModel/CGI/CollectionBlock.pm
@@ -108,8 +108,8 @@ EOF
   print "<table border='0' cellpadding='5' cellspacing='0' summary='" .
         "Overview of " . $Collection->GetCollectionName() . "'>\n";
   print "<thead>\n";
-  my $Actions = $self->CallGetItemActions();
-  $self->CallGenerateHeaderRow($PropertyDescriptors, $Actions);
+  my $ItemActions = $self->CallGetItemActions();
+  $self->CallGenerateHeaderRow($PropertyDescriptors, $ItemActions);
   print "</thead>\n";
 
   print "<tbody>\n";
@@ -121,7 +121,7 @@ EOF
     my $Class = ($Row % 2) == 0 ? "even" : "odd";
     my $Item = $self->{Collection}->GetItem($Key);
     $self->CallGenerateDataRow($Item, $PropertyDescriptors, $DetailsPage,
-                               $Class, $Actions);
+                               $Class, $ItemActions);
     $Row++;
   }
   if (@$Keys == 0)
@@ -132,7 +132,7 @@ EOF
   print "</tbody>\n";
   print "</table>\n";
 
-  if (@$Actions != 0 && @$Keys != 0)
+  if (@$ItemActions != 0 && @$Keys != 0)
   {
     print <<EOF;
 <div class='CollectionBlockActions'>
@@ -153,7 +153,7 @@ document.write("<a href='javascript:void(0)' onClick='ToggleAll();'>Toggle All<\
 </script>
 EOF
     print "For selected ", $self->{Collection}->GetCollectionName() . ":";
-    foreach my $Action (@$Actions)
+    foreach my $Action (@$ItemActions)
     {
       print " <input type='submit' name='Action' value='" .
             $self->escapeHTML($Action) . "' />";
@@ -162,7 +162,7 @@ EOF
     print "</div>\n";
   }
 
-  $Actions = $self->CallGetActions();
+  my $Actions = $self->CallGetActions();
   if (@$Actions != 0)
   {
     print "<div class='CollectionBlockActions'>\n";
@@ -231,17 +231,17 @@ sub GenerateFormEnd($)
 
 sub CallGenerateHeaderRow($$$)
 {
-  my ($self, $PropertyDescriptors, $Actions) = @_;
+  my ($self, $PropertyDescriptors, $ItemActions) = @_;
 
-  $self->GenerateHeaderRow($PropertyDescriptors, $Actions);
+  $self->GenerateHeaderRow($PropertyDescriptors, $ItemActions);
 }
 
 sub GenerateHeaderRow($$$)
 {
-  my ($self, $PropertyDescriptors, $Actions) = @_;
+  my ($self, $PropertyDescriptors, $ItemActions) = @_;
 
   print "<tr>\n";
-  if (@$Actions != 0)
+  if (@$ItemActions != 0)
   {
     print "<th> </th>\n";
   }
@@ -272,9 +272,9 @@ sub GenerateHeaderCell($$)
 
 sub CallGenerateDataRow($$$$$$)
 {
-  my ($self, $Item, $PropertyDescriptors, $DetailsPage, $Class, $Actions) = @_;
+  my ($self, $Item, $PropertyDescriptors, $DetailsPage, $Class, $ItemActions) = @_;
 
-  $self->GenerateDataRow($Item, $PropertyDescriptors, $DetailsPage, $Class, $Actions);
+  $self->GenerateDataRow($Item, $PropertyDescriptors, $DetailsPage, $Class, $ItemActions);
 }
 
 sub SelName($$)
@@ -287,10 +287,10 @@ sub SelName($$)
 
 sub GenerateDataRow($$$$$$)
 {
-  my ($self, $Item, $PropertyDescriptors, $DetailsPage, $Class, $Actions) = @_;
+  my ($self, $Item, $PropertyDescriptors, $DetailsPage, $Class, $ItemActions) = @_;
 
   print "<tr class='$Class'>\n";
-  if (@$Actions != 0)
+  if (@$ItemActions != 0)
   {
     print "<td><input name='", $self->SelName($Item->GetKey()),
           "' type='checkbox' /></td>\n";
@@ -369,6 +369,19 @@ sub CallGetItemActions($)
   return $self->GetItemActions();
 }
 
+=pod
+=over 12
+
+=item C<GetItemActions()>
+
+Returns the list of per-item actions.
+
+This is a set of actions that is applied to each selected item in the
+collection.
+
+=back
+=cut
+
 sub GetItemActions($)
 {
   #my ($self) = @_;
@@ -382,6 +395,19 @@ sub CallGetActions($)
   return $self->GetActions();
 }
 
+=pod
+=over 12
+
+=item C<GetActions()>
+
+Returns the list of global actions.
+
+This is a set of actions that do not impact any specific item in the
+collection.
+
+=back
+=cut
+
 sub GetActions($)
 {
   my ($self) = @_;
diff --git a/testbot/lib/ObjectModel/CGI/CollectionBlockForPage.pm b/testbot/lib/ObjectModel/CGI/CollectionBlockForPage.pm
index 03a45082f0..13ad5a8752 100644
--- a/testbot/lib/ObjectModel/CGI/CollectionBlockForPage.pm
+++ b/testbot/lib/ObjectModel/CGI/CollectionBlockForPage.pm
@@ -54,16 +54,16 @@ sub CallGenerateHeaderCell($$)
 
 sub CallGenerateHeaderRow($$$)
 {
-  my ($self, $PropertyDescriptors, $Actions) = @_;
+  my ($self, $PropertyDescriptors, $ItemActions) = @_;
 
-  $self->{EnclosingPage}->GenerateHeaderRow($self, $PropertyDescriptors, $Actions);
+  $self->{EnclosingPage}->GenerateHeaderRow($self, $PropertyDescriptors, $ItemActions);
 }
 
 sub CallGenerateDataRow($$$$$$)
 {
-  my ($self, $Item, $PropertyDescriptors, $DetailsPage, $Class, $Actions) = @_;
+  my ($self, $Item, $PropertyDescriptors, $DetailsPage, $Class, $ItemActions) = @_;
 
-  $self->{EnclosingPage}->GenerateDataRow($self, $Item, $PropertyDescriptors, $DetailsPage, $Class, $Actions);
+  $self->{EnclosingPage}->GenerateDataRow($self, $Item, $PropertyDescriptors, $DetailsPage, $Class, $ItemActions);
 }
 
 sub CallGenerateDataCell($$$$)
diff --git a/testbot/lib/ObjectModel/CGI/CollectionPage.pm b/testbot/lib/ObjectModel/CGI/CollectionPage.pm
index 5c48954c68..72bba1bc4e 100644
--- a/testbot/lib/ObjectModel/CGI/CollectionPage.pm
+++ b/testbot/lib/ObjectModel/CGI/CollectionPage.pm
@@ -103,16 +103,16 @@ sub GenerateHeaderCell($$$)
 
 sub GenerateHeaderRow($$$$)
 {
-  my ($self, $CollectionBlock, $PropertyDescriptors, $Actions) = @_;
+  my ($self, $CollectionBlock, $PropertyDescriptors, $ItemActions) = @_;
 
-  $CollectionBlock->GenerateHeaderRow($PropertyDescriptors, $Actions);
+  $CollectionBlock->GenerateHeaderRow($PropertyDescriptors, $ItemActions);
 }
 
 sub GenerateDataRow($$$$$$$)
 {
-  my ($self, $CollectionBlock, $Item, $PropertyDescriptors, $DetailsPage, $Class, $Actions) = @_;
+  my ($self, $CollectionBlock, $Item, $PropertyDescriptors, $DetailsPage, $Class, $ItemActions) = @_;
 
-  $CollectionBlock->GenerateDataRow($Item, $PropertyDescriptors, $DetailsPage, $Class, $Actions);
+  $CollectionBlock->GenerateDataRow($Item, $PropertyDescriptors, $DetailsPage, $Class, $ItemActions);
 }
 
 sub GenerateDataCell($$$$$)
-- 
2.30.2




More information about the wine-devel mailing list