Index: /branches/release-39/lib/MT/CMS/Template.pm
===================================================================
--- /branches/release-39/lib/MT/CMS/Template.pm (revision 2502)
+++ /branches/release-39/lib/MT/CMS/Template.pm (revision 2504)
@@ -113,4 +113,5 @@
         $param->{published_url} = $published_url if $published_url;
         $param->{saved_rebuild} = 1 if $q->param('saved_rebuild');
+        $param->{static_maps} = $obj->build_type == MT::PublishOption::DYNAMIC() ? 0 : 1;
 
         my $filter = $app->param('filter_key');
@@ -297,6 +298,16 @@
                 $param->{object_loop} = $param->{template_map_loop} = $maps
                   if @$maps;
-                my %archive_types = map { $_->{archive_label} => 1 } @$maps;
-                $param->{enabled_archive_types} = join(", ", sort keys %archive_types);
+                my %at;
+                my $build_type = MT::PublishOption::DYNAMIC();
+                my $build_type_0 = 0;
+                foreach my $map ( @$maps ) {
+                    $at{ $map->{archive_label} } = 1;
+                    $build_type_0 = $map->{map_build_type};
+                    $build_type = $map->{map_build_type}
+                        if MT::PublishOption::DYNAMIC() ne $map->{map_build_type};
+                }
+                $param->{enabled_archive_types} = join(", ", sort keys %at);
+                $param->{static_maps} = $build_type == MT::PublishOption::DYNAMIC() ? 0 : 1;
+                $param->{build_type_0} = 1 unless $build_type_0;
             }
         }
Index: /branches/release-39/lib/MT/WeblogPublisher.pm
===================================================================
--- /branches/release-39/lib/MT/WeblogPublisher.pm (revision 2445)
+++ /branches/release-39/lib/MT/WeblogPublisher.pm (revision 2504)
@@ -988,6 +988,5 @@
     # 404 will be triggered.
     require MT::PublishOption;
-    if ( $tmpl->build_dynamic
-      || ( $map->build_type == MT::PublishOption::DYNAMIC() ) )
+    if ( $map->build_type == MT::PublishOption::DYNAMIC() ) 
     {
         rename(
@@ -1003,8 +1002,7 @@
     }
 
-    return 1 if ( $tmpl->build_dynamic )
-        || ( $map->build_type == MT::PublishOption::DYNAMIC() );
+    return 1 if ( $map->build_type == MT::PublishOption::DYNAMIC() );
     return 1 if ( $entry && $entry->status != MT::Entry::RELEASE() );
-    return 1 unless ( $tmpl->build_type );
+    return 1 unless ( $map->build_type );
 
     my $timer = MT->get_timer;
Index: /branches/release-39/tmpl/cms/edit_template.tmpl
===================================================================
--- /branches/release-39/tmpl/cms/edit_template.tmpl (revision 2407)
+++ /branches/release-39/tmpl/cms/edit_template.tmpl (revision 2504)
@@ -161,5 +161,5 @@
     </mt:if>
     <mt:unless name="build_type_0">
-    <mt:unless name="build_dynamic">
+    <mt:if name="static_maps">
         <mt:if name="can_rebuild">
             <mt:if name="template_group" like="/^(archive|index)$/">
@@ -173,5 +173,5 @@
             </mt:if>
         </mt:if>
-    </mt:unless>
+    </mt:if>
     </mt:unless>
     <div id="autosave-notification-<$mt:var name="bar_position" default="top"$>" class="autosave-notification"></div>
