]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 304267: Large lists in admin pages fail to display (they take too much time)...
authorlpsolit%gmail.com <>
Thu, 25 Jun 2009 01:04:47 +0000 (01:04 +0000)
committerlpsolit%gmail.com <>
Thu, 25 Jun 2009 01:04:47 +0000 (01:04 +0000)
template/en/default/admin/components/list.html.tmpl
template/en/default/admin/custom_fields/list.html.tmpl
template/en/default/admin/fieldvalues/list.html.tmpl
template/en/default/admin/groups/list.html.tmpl
template/en/default/admin/milestones/list.html.tmpl
template/en/default/admin/products/list.html.tmpl
template/en/default/admin/table.html.tmpl
template/en/default/admin/users/list.html.tmpl

index 990b079973437b76450de787c7503936d130f2f0..d4bf117482c9e6e560c131f1a558a337e353f5a5 100644 (file)
    }) %]
 
 [%# Overrides the initialowner and the initialqacontact with right values %]
-[% overrides.initialowner = [] %]
-[% overrides.initialqacontact = [] %]
+[% overrides.initialowner = {} %]
+[% overrides.initialqacontact = {} %]
 
 [% FOREACH component = product.components %]
-  [% overrides.initialowner.push({
-       match_value => component.name
-       match_field => 'name'
+  [% overrides.initialowner.name.${component.name} = {
        override_content => 1
        content => component.default_assignee.login
-     })
+     }
   %]
-  [% overrides.initialqacontact.push({
-       match_value => component.name
-       match_field => 'name'
+  [% overrides.initialqacontact.name.${component.name} = {
        override_content => 1
        content => component.default_qa_contact.login
-     })
+     }
   %]
 [% END %]
 
index 6f2e68be73a4b4f11a8948209f5a266ee84e2277..dd266c759acbfb49066f721a723aa172580f0c95 100644 (file)
 [% custom_fields = Bugzilla.get_fields({ custom => 1 }) %]
 
 [%# We want to display the type name of fields, not their type ID. %]
-[% overrides.type = [] %]
+[% overrides.type = {} %]
 
 [% FOREACH field_type = field_types.keys %]
-  [% overrides.type.push({
-       match_value => field_type
-       match_field => 'type'
+  [% overrides.type.type.$field_type = {
        override_content => 1
-       content => field_types.${field_type}
-    })
+       content => field_types.$field_type
+    }
   %]
 [% END %]
 
 
-[% overrides.action = [ {
-     match_value => 1
-     match_field => 'obsolete'
-     override_content => 1
-     content => "Delete"
-     override_contentlink => 1
-     contentlink => delete_contentlink
-   } ]
+[% overrides.action.obsolete = {
+     "1" => {
+       override_content => 1
+       content => "Delete"
+       override_contentlink => 1
+       contentlink => delete_contentlink
+     }
+   }
 %] 
 
 [% PROCESS admin/table.html.tmpl
index 976b58ae7477bd7cf1aefe81d0c9174c55248f0c..fdc22d9126ee55dccb7d0f56d31f89d6b7b4b04e 100644 (file)
 %]
 
 
-[% SET overrides.action = [] %]
+[% SET overrides.action = {} %]
 [% FOREACH check_value = values %]
-
   [% IF check_value.is_static %]
-    [% overrides.action.push({
-         match_value => check_value.name
-         match_field => 'name'
+    [% overrides.action.name.${check_value.name} = {
          override_content => 1
          content => "(Non-deletable value)"
          override_contentlink => 1
          contentlink => undef
-       })
+       }
     %]
   [% ELSIF check_value.is_default %]
-    [% overrides.action.push({
-      match_value => check_value.name
-      match_field => 'name'
-      override_content => 1
-      content => "(Default value)"
-      override_contentlink => 1
-      contentlink => undef })
+    [% overrides.action.name.${check_value.name} = {
+         override_content => 1
+         content => "(Default value)"
+         override_contentlink => 1
+         contentlink => undef
+       }
     %]
   [% END %]
 
index 029e5f0b412b0018f314f7fc0d3c824953fddd0c..1d137dc5fb9cadd15d27c1d9e2c776dbc8706396 100644 (file)
   ]
 %]
 
-[% overrides.is_active_bug_group = [ {
-     match_value => "0"
-     match_field => 'is_active_bug_group'
-     override_content => 1
-     content => "&nbsp;"
-   },
-   {
-     match_value => "1"
-     match_field => 'is_active_bug_group'
-     override_content => 1
-     content => "X"
-   }]
-   overrides.userregexp = [ {
-     match_value => ""
-     match_field => 'userregexp'
-     override_content => 1
-     content => "&nbsp;"
-   }]
-   overrides.action = [ {
-     match_value => Param("chartgroup")
-     match_field => 'name'
-     override_content => 1
-     content => "(used as the 'chartgroup')"
-   },
-   {
-     match_value => Param("insidergroup")
-     match_field => 'name'
-     override_content => 1
-     content => "(used as the 'insidergroup')"
-   },
-   {
-     match_value => Param("timetrackinggroup")
-     match_field => 'name'
-     override_content => 1
-     content => "(used as the 'timetrackinggroup')"
-   },
-   {
-     match_value => Param("querysharegroup")
-     match_field => 'name'
-     override_content => 1
-     content => "(used as the 'querysharegroup')"
-   },
-   {
-     match_value => "1"
-     match_field => 'isbuggroup'
-     override_content => 1
-     content => "Delete"
-     override_contentlink => 1
-     contentlink => del_contentlink
-   }]
-   overrides.type = [ {
-     match_value => "0"
-     match_field => 'isbuggroup'
-     override_content => 1
-     content => "system"
-   },
-   {
-     match_value => "1"
-     match_field => 'isbuggroup'
-     override_content => 1
-     content => "user"
-   }]
+[% overrides.is_active_bug_group = {
+     'is_active_bug_group' => {
+       "0" => {
+          override_content => 1
+          content => "&nbsp;"
+       }
+       "1" => {
+          override_content => 1
+          content => "X"
+       }
+     }
+   }
+
+   overrides.userregexp = {
+     'userregexp' => {
+       "" => {
+         override_content => 1
+         content => "&nbsp;"
+       }
+     }
+   } 
+%]
+
+[% FOREACH group IN ["chartgroup", "insidergroup", "timetrackinggroup", "querysharegroup"] %]
+  [% special_group = Param(group) %]
+
+  [% IF special_group %]
+    [% overrides.action.name.$special_group = {
+         override_content => 1
+         content => "(used as the '$group')"
+       }
+    %]
+  [% END %]
+[% END %]
+
+[% overrides.action.isbuggroup = {
+     "1" => {
+         override_content => 1
+         content => "Delete"
+         override_contentlink => 1
+         contentlink => del_contentlink
+     }
+   }
+
+   overrides.type.isbuggroup = {
+     "0" => {
+         override_content => 1
+         content => "system"
+     }
+     "1" => {
+         override_content => 1
+         content => "user"
+     }
+   }
 %] 
 
 [% PROCESS admin/table.html.tmpl
index 00e5bd922fda01c149413c51d1b944f9ed980e4a..e1463603c9c89dd293235d2f2b4768eda3ca3fc3 100644 (file)
      })
 %]
 
-[%# We want to override the usual 'Delete' link for the default
-    milestone %]
-[% overrides.action = [ {
-     match_value => product.default_milestone
-     match_field => 'name'
+[%# We want to override the usual 'Delete' link for the default milestone %]
+[% overrides.action.name.${product.default_milestone} = {
      override_content => 1
      content => "(Default milestone)"
      override_contentlink => 1
      contentlink => undef
-   } ]
+   } 
 %] 
 
 [% PROCESS admin/table.html.tmpl
index b82a6a5b0030c7442455758431faf7ff55f47dfb..4d1c049377b3f028f3f0afe2a5ae185fc5e82c50 100644 (file)
      })
 %]
 
-[% overrides.disallow_new = [ {
-     match_value => "1"
-     match_field => 'disallow_new'
-     override_content => 1
-     content => "No"
-   },
-   {
-     match_value => 0
-     match_field => 'disallow_new'
-     override_content => 1
-     content => "Yes"
-   }]
+[% overrides.disallow_new.disallow_new = {
+     "1" => {
+       override_content => 1
+       content => "No"
+     },
+     "0" => {
+       override_content => 1
+       content => "Yes"
+     }
+   }
 %] 
 
 [% PROCESS admin/table.html.tmpl
index 303aba79853ffdbecda024e19b1252e01ec1d698..ce5e985cb3ec22f72158e7e49547c97a0ac500e5 100644 (file)
   #   keys are column names from columns subhashes name field.
   #
   # overrides:
-  #   Provides a method for overriding individual table cells. This is
-  #   a hash, whose key is the column name, so the column must be
-  #   named for one of it's cells to be overwritten. The hash value is
-  #   an array. Each item in this array is a hash specifying
-  #   row-matching criteria, and any overridden values. The
-  #   row-matching criteria consist of keys:
-  #     match_field: The name of the row value we want to match
-  #     match_value: The value to match against
+  # Example:
+  #     overrides {                           # first hash
+  #       column_name_to_be_overwriten => {   # second hash
+  #         name_of_row_to_match_against => { # third hash
+  #           value_to_match_against => {     # fourth hash
+  #             content => "some contents"
+  #             override_content => 1
+  #           }
+  #         }
+  #       }
+  #     }
+  #
+  #   Provides a method for overriding individual table cells. This is a hash
+  #   (1), whose key is the column name, so the column must be named for
+  #   one of it's cells to be overwritten. The hash value is another hash
+  #   (2). The keys of that second hash are the name of the row to match
+  #   against. The second hash then again points to another hash. Within this
+  #   third hash (3), the keys represent values to match against. The item
+  #   contains a fourth hash (4) specifying overridden values.
+  #   
   #   Each column value mentioned in the 'columns' documentation above
   #   can be overwritten (apart from name and heading). To override a
   #   table-cell value 'xxx', specify a new 'xxx' value, and specify a
          yesno_field = c.yesno_field
        %]
 
-      [%# Are there any specific overrides for this column? %]
-      [% FOREACH override = overrides.${c.name} %]
-
-        [%# Is the override for this row? %]
-        [% IF override.match_value == row.${override.match_field} %]
-
-          [% SET contentlink = override.contentlink 
-             IF override.override_contentlink %]
-          [% SET content = override.content
-             IF override.override_content %]
-          [% SET content_use_field = override.content_use_field
-             IF override.override_content_use_field %]
-          [% SET align = override.align
-             IF override.override_align %]
-          [% SET class = override.class
-             IF override.override_class %]
-          [% SET allow_html_content = override.allow_html_content
-             IF override.override_allow_html_content %]
-          [% SET yesno_field = override.yesno_field
-             IF override.override_yesno_field %]
-
-          [% LAST %]
+      [%# Get any specific "important" overrides for this c.name and row.name ? %]
+      [% SET important = overrides.${c.name}.name.${row.name} %]
 
-        [% END %]
+      [% IF important %]
+
+          [% FOREACH key IN important.keys %]
+             [% SET ${key} = important.${key} %]
+          [% END %]
+
+      [% ELSE %]
+
+          [%# Are there any specific overrides for this column? %]
+          [% FOREACH match_field = overrides.${c.name}.keys %]
+     
+              [% override = overrides.${c.name}.${match_field}.${row.$match_field} %]
+              [% NEXT UNLESS override %]
+
+              [% FOREACH key IN override.keys %]
+                  [% SET ${key} = override.${key} %]
+              [% END %]
+
+              [% LAST %]
+
+          [% END %]
       [% END %]
 
       <td [% IF align %] align="[% align FILTER html %]" [% END %]
index 4788e527d31addc8144bc9e97d3dd821c28ee4e7..cb05e827b0477f5fc98da88162b3d9666cbdc0bd 100644 (file)
 [% END %]
 
 [%# Disabled users are crossed out. Missing realnames are noticed in red. %]
-[% overrides.login_name = [] %]
-[% overrides.realname = [] %]
+[% overrides.login_name = {} %]
+[% overrides.realname = {} %]
 
 [% FOREACH thisuser = users %]
   [% IF !thisuser.realname %]
     [%# We cannot pass one class now and one class later. %]
     [% SET classes = (thisuser.disabledtext ? "bz_inactive missing" : "missing") %]
-    [% overrides.realname.push({
-        match_value      => "$thisuser.login_name"
-        match_field      => 'login_name'
-        content          => "missing"
-        override_content => 1
-        class            => "$classes"
-        override_class   => 1 })
+    [% overrides.realname.login_name.${thisuser.login_name} = {
+           content          => "missing"
+           override_content => 1
+           class            => "$classes"
+           override_class   => 1
+       }
+    %]
+  [% ELSIF thisuser.disabledtext %]
+    [% overrides.realname.login_name.${thisuser.login_name} = {
+           class          => "bz_inactive"
+           override_class => 1
+       }
     %]
   [% END %]
 
   [% IF thisuser.disabledtext %]
-    [% overrides.login_name.push({
-        match_value    => "$thisuser.login_name"
-        match_field    => 'login_name'
-        class          => "bz_inactive"
-        override_class => 1 })
-    %]
-
-    [% overrides.realname.push({
-        match_value    => "$thisuser.login_name"
-        match_field    => 'login_name'
-        class          => "bz_inactive"
-        override_class => 1 })
+    [% overrides.login_name.login_name.${thisuser.login_name} = {
+           class          => "bz_inactive"
+           override_class => 1
+       }
     %]
   [% END %]
 [% END %]