From 61c5384b327ae80276c038fef2d3c12ed850d902 Mon Sep 17 00:00:00 2001
From: Rafael Monnerat <rafael@nexedi.com>
Date: Tue, 25 Mar 2008 16:26:46 +0000
Subject: [PATCH] The blocks at secondary layer should be frozen by default and
 also store if it is a part of secondary layer.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20126 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Form/PlanningBox.py | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/product/ERP5Form/PlanningBox.py b/product/ERP5Form/PlanningBox.py
index 9dd21dc734..843c68b475 100644
--- a/product/ERP5Form/PlanningBox.py
+++ b/product/ERP5Form/PlanningBox.py
@@ -2305,7 +2305,8 @@ class PlanningStructure:
                             lane_axis_range = axis_range,
                             planning=self, warning=warning,
                             error_block_list=error_block_list,
-                            error_info_dict=error_info_dict)
+                            error_info_dict=error_info_dict,
+                            sec_layer_uid_list=basic_structure.sec_layer_uid_list)
 
         if axis_group_object.property_dict['stat'] == 1:
           # case stat group_object, need to update block size to display
@@ -2380,7 +2381,8 @@ class Activity:
   def addBlocs(self, report_axis_start=None, report_axis_stop=None,
                lane_axis_start=None, lane_axis_stop=None,
                lane_axis_range=None, planning=None, warning=0,
-               error_block_list=[], height=0, error_info_dict={}):
+               error_block_list=[], height=0, error_info_dict={},
+               sec_layer_uid_list=[]):
     """
     define list of (begin & stop) values for blocs representing the actual
     activity (can have several blocs if necessary).
@@ -2420,12 +2422,19 @@ class Activity:
         # passive
         block_color = '#D1E8FF'
         block_link = ''
+      
+      property_dict = self.property_dict
+      if self.object.getUid() in sec_layer_uid_list:
+        property_dict['sec_layer'] = 1
+      else:
+        property_dict['sec_layer'] = 0
+
       new_block = Bloc(name= block_name,color=block_color,link=block_link,
                        number = block_number,
                        vertical_view=self.vertical_view, parent_activity=self,
                        warning=warning, error=error,
                        error_text=error_text,zone=zone,
-                       property_dict=self.property_dict)
+                       property_dict=property_dict)
 
       new_block.buildInfoDict(info_dict = self.info)
 
-- 
2.30.9