fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [9707]


From: Torstein
Subject: [Fmsystem-commits] [9707]
Date: Tue, 03 Jul 2012 10:02:55 +0000

Revision: 9707
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9707
Author:   vator
Date:     2012-07-03 10:02:54 +0000 (Tue, 03 Jul 2012)
Log Message:
-----------


Modified Paths:
--------------
    trunk/controller/inc/class.socheck_list.inc.php
    trunk/controller/inc/class.socontrol.inc.php
    trunk/controller/inc/class.uicalendar.inc.php
    trunk/controller/inc/class.uicheck_list.inc.php
    trunk/controller/inc/class.uicheck_list_for_component.inc.php
    trunk/controller/inc/class.uicontrol_group.inc.php
    trunk/controller/inc/component/class.month_calendar.inc.php
    trunk/controller/inc/component/class.year_calendar.inc.php
    trunk/controller/inc/model/class.check_list.inc.php
    trunk/controller/inc/model/class.component.inc.php
    trunk/controller/templates/base/calendar/view_calendar_month.xsl
    trunk/controller/templates/base/calendar/view_calendar_year.xsl
    trunk/controller/templates/base/check_list/add_check_list.xsl
    trunk/controller/templates/base/check_list/edit_check_list.xsl
    trunk/controller/templates/base/css/base.css

Removed Paths:
-------------
    trunk/controller/inc/class.uicontrol_item_option.inc.php
    trunk/controller/inc/model/class.schedule.inc.php

Modified: trunk/controller/inc/class.socheck_list.inc.php
===================================================================
--- trunk/controller/inc/class.socheck_list.inc.php     2012-07-03 07:21:48 UTC 
(rev 9706)
+++ trunk/controller/inc/class.socheck_list.inc.php     2012-07-03 10:02:54 UTC 
(rev 9707)
@@ -433,82 +433,8 @@
                return $control_array;
        }
        
-       
-       // Fetches all controls as objects with check lists
-       /* DET SER UT TIL AT DENNE IKKE BRUKES: TORSTEIN 18.06.2012 
-       function get_check_lists_for_location( $location_code, $from_date_ts, 
$to_date_ts, $repeat_type = null, $control_id = 0 ){
-               $use_location_inparam = false;
-               $sql =  "SELECT c.id as c_id, title, description, start_date, 
end_date, control_area_id, c.location_code as c_location_code, repeat_type, 
repeat_interval, ";
-               $sql .= "cl.id as cl_id, cl.status as cl_status, cl.comment as 
cl_comment, deadline, planned_date, completed_date, ";
-               $sql .= "cl.component_id as cl_component_id, cl.location_code 
as cl_location_code, num_open_cases, num_pending_cases "; 
-               $sql .= "FROM controller_control c ";
-               $sql .= "LEFT JOIN controller_check_list cl on cl.control_id = 
c.id ";
-               $sql .= "WHERE cl.location_code = '{$location_code}' ";
-               if($control_id > 0)
-               {
-                       $sql .= "AND c.id={$control_id} ";
-                       $use_location_inparam = true;
-               }
-               if($repeat_type != null)
-               {
-                       $sql .= "AND c.repeat_type = $repeat_type ";
-               }
-               $sql .= "AND deadline BETWEEN $from_date_ts AND $to_date_ts ";
-               $sql .= "ORDER BY c.id;";
-
-               $this->db->query($sql);
-               
-               $control_id = 0;
-               $control = null;
-               $controls_array = array();
-               while ($this->db->next_record()) {
-                       
-                       if( $this->db->f('c_id', true) != $control_id ){
-                               
-                               if($control_id != 0){
-                                       
$control->set_check_lists_array($check_lists_array);
-                                       $controls_array[] = $control;
-                               }
-                       
-                               $control = new 
controller_control($this->unmarshal($this->db->f('c_id', true), 'int'));
-                               
$control->set_title($this->unmarshal($this->db->f('title', true), 'string'));
-                               
$control->set_description($this->unmarshal($this->db->f('description', true), 
'boolean'));
-                               
$control->set_start_date($this->unmarshal($this->db->f('start_date', true), 
'int'));
-                               
$control->set_end_date($this->unmarshal($this->db->f('end_date', true), 'int'));
-                               
$control->set_control_area_id($this->unmarshal($this->db->f('control_area_id', 
true), 'int'));
-                               
$control->set_repeat_type($this->unmarshal($this->db->f('repeat_type', true), 
'int'));
-                               
$control->set_repeat_interval($this->unmarshal($this->db->f('repeat_interval', 
true), 'int'));
-                                                               
-                               $check_lists_array = array();
-                       }
-
-                       $check_list = new 
controller_check_list($this->unmarshal($this->db->f('cl_id', true), 'int'));
-                       
$check_list->set_status($this->unmarshal($this->db->f('cl_status', true), 
'int'));
-                       
$check_list->set_comment($this->unmarshal($this->db->f('cl_comment', true), 
'string'));
-                       
$check_list->set_deadline($this->unmarshal($this->db->f('deadline', true), 
'int'));
-                       
$check_list->set_planned_date($this->unmarshal($this->db->f('planned_date', 
true), 'int'));
-                       
$check_list->set_completed_date($this->unmarshal($this->db->f('completed_date', 
true), 'int')); 
-                       
$check_list->set_component_id($this->unmarshal($this->db->f('cl_component_id', 
true), 'int'));
-                       
$check_list->set_location_code($this->unmarshal($this->db->f('cl_location_code',
 true), 'string'));
-                       
$check_list->set_num_open_cases($this->unmarshal($this->db->f('num_open_cases', 
true), 'int')); 
-                       
$check_list->set_num_pending_cases($this->unmarshal($this->db->f('num_pending_cases',
 true), 'int'));
-                       
-                       $check_lists_array[] = $check_list;
-
-                       $control_id =  $control->get_id();
-               }
-               
-               if($control != null){
-                       $control->set_check_lists_array($check_lists_array);
-                       $controls_array[] = $control;
-               }       
-               
-               return $controls_array;
-       }
-       */
-       
        // Fetches control id and check lists for period and location
-       function get_check_lists_for_location_2( $location_code, $from_date_ts, 
$to_date_ts, $repeat_type_expr = null ){
+       function get_check_lists_for_location( $location_code, $from_date_ts, 
$to_date_ts, $repeat_type_expr = null ){
                $sql =  "SELECT c.id as c_id, ";
                $sql .= "cl.id as cl_id, cl.status as cl_status, cl.comment as 
cl_comment, deadline, planned_date, completed_date, ";
                $sql .= "cl.component_id as cl_component_id, cl.location_code 
as cl_location_code, num_open_cases, num_pending_cases "; 

Modified: trunk/controller/inc/class.socontrol.inc.php
===================================================================
--- trunk/controller/inc/class.socontrol.inc.php        2012-07-03 07:21:48 UTC 
(rev 9706)
+++ trunk/controller/inc/class.socontrol.inc.php        2012-07-03 10:02:54 UTC 
(rev 9707)
@@ -109,25 +109,6 @@
                                return 0;
                        }
                }
-
-/*             function get_controls_for_location($location_code, $role_id, 
$from_date, $to_date, $repeat_type)
-               {
-                   $controls = array();
-                   $controls_loc = 
$this->get_controls_by_location($location_code, $from_date, $to_date, 
$repeat_type, '', $role_id );
-                   $controls_comp = 
$this->get_controls_for_components_by_location($location_code, $from_date, 
$to_date, $repeat_type, '', $role_id );
-                   
-                   foreach($controls_loc as $cl)
-                   {
-                       $controls[] = $cl;
-                   }
-                   foreach($controls_comp as $cc)
-                   {
-                       $controls[] = $cc;
-                   }
-                   
-                   return $controls;
-               }
-*/
                
                public function get_controls_by_location($location_code, 
$from_date, $to_date, $repeat_type, $return_type = "return_object", $role_id = 
'')
                {
@@ -862,8 +843,9 @@
                        $joins = " {$this->left_join} 
controller_control_component_list ON (c.id = 
controller_control_component_list.control_id)";
                        $joins .= " {$this->left_join} fm_bim_item ON 
(controller_control_component_list.component_id = fm_bim_item.id)";
                        $joins .= " {$this->left_join} fm_bim_type ON 
(fm_bim_item.type= fm_bim_type.id)";
-                       //$joins .= " {$this->left_join} fm_responsibility_role 
ON (c.responsibility_id = fm_responsibility_role.id)";
+
                        $sql  = "SELECT c.id AS control_id, c.title AS 
control_title, fm_bim_type.name AS type_name, fm_bim_item.id AS bim_id, 
fm_bim_item.guid as bim_item_guid FROM controller_control c {$joins} {$limit}";
+                       
                        $controlArray = array();
                        $this->db->query($sql, __LINE__, __FILE__);
                        $i=1;
@@ -879,7 +861,7 @@
 
                        return $controlArray;
                }
-
+               
                public function getBimItemAttributeValue($bimItemGuid, 
$attribute) 
                {
                        $columnAlias = "attribute_values";
@@ -894,6 +876,8 @@
                        }
                }
                
+               
+               
                public function getLocationCodeFromControl($control_id)
                {
                        $sql = "select location_code from 
controller_control_location_list where control_id={$control_id}";

Modified: trunk/controller/inc/class.uicalendar.inc.php
===================================================================
--- trunk/controller/inc/class.uicalendar.inc.php       2012-07-03 07:21:48 UTC 
(rev 9706)
+++ trunk/controller/inc/class.uicalendar.inc.php       2012-07-03 10:02:54 UTC 
(rev 9707)
@@ -100,10 +100,10 @@
                        $role = $this->validate_role($role);
                        
                        // Gets timestamp value of first day in month
-                       $from_date_ts = 
month_calendar::get_start_month_date_ts($year, intval( $month ));
+                       $from_date_ts = 
month_calendar::get_start_date_month_ts($year, intval( $month ));
 
                        // Gets timestamp value of first day in month
-                       $to_date_ts = 
month_calendar::get_end_month_date_ts($year, intval( $month ));
+                       $to_date_ts = 
month_calendar::get_next_start_date_month_ts($year, intval( $month ));
 
                        // Validates location_code. If not set, first location 
among assigned locations
                        $location_code = 
$this->validate_location_code($location_code);
@@ -116,10 +116,13 @@
       $buildings_on_property = $this->get_buildings_on_property($user_role, 
$location_code, $level);
                        
                        // Fetches controls for location within specified time 
period
-                       $controls_for_location_array = 
$this->so_control->get_controls_by_location($location_code, $from_date_ts, 
$to_date_ts);
+                       $controls_for_location_array = 
$this->so_control->get_controls_by_location($location_code, $from_date_ts, 
$to_date_ts, $repeat_type, "return_object", $role );
 
+                       // Fetches all controls for the components for a 
location within time period
+                       $components_with_controls_array = 
$this->so_control->get_controls_by_component($location_code, $from_date_ts, 
$to_date_ts, $repeat_type, "return_object", $role);
+                       
                        // Fetches all control ids with check lists for 
specified time period
-                       $control_id_with_check_list_array = 
$this->so->get_check_lists_for_location_2($location_code, $from_date_ts, 
$to_date_ts);
+                       $control_id_with_check_list_array = 
$this->so->get_check_lists_for_location($location_code, $from_date_ts, 
$to_date_ts);
                        
                        // Loops through all controls for location and 
populates controls with check lists
                        $controls_with_check_list_array = 
$this->populate_controls_with_check_lists($controls_for_location_array, 
$control_id_with_check_list_array);
@@ -127,7 +130,7 @@
                        $controls_calendar_array = array();
                        foreach($controls_with_check_list_array as $control)
                        {
-                               $month_calendar = new month_calendar($control, 
$year, $month);
+                               $month_calendar = new month_calendar($control, 
$year, $month, null, $location_code, "location");
                                $calendar_array = 
$month_calendar->build_calendar( $control->get_check_lists_array() );
 
                                $controls_calendar_array[] = array("control" => 
$control->toArray(), "calendar_array" => $calendar_array);
@@ -136,19 +139,25 @@
                        // COMPONENTS
                        foreach($components_with_controls_array as $component)
                        {
-                               $controls_for_component_array = 
$component->get_controls_array(); 
-                               $controls_components_calendar_array = array();
+                               $location_id = $component->get_location_id();
+                               $component_id = $component->get_id();
+      
+               $short_desc = 
execMethod('property.soentity.get_short_description', array('location_id' => 
$location_id, 'id' => $component_id));
+               $component->set_xml_short_desc( $short_desc );
                                
+                               $controls_for_component_array = 
$component->get_controls_array();
+                               $controls_components_calendar_array = array();
+                                                               
                          foreach($controls_for_component_array as $control)
                          {
                            // Fetches control ids with check lists for 
specified time period
-                                       $control_id_with_check_list_array = 
$this->so->get_check_lists_for_component($component->get_type(), 
$component->get_id(), $from_date_ts, $to_date_ts, $repeat_type = ">=2");
+                                       $control_id_with_check_list_array = 
$this->so->get_check_lists_for_component($component->get_location_id(), 
$component->get_id(), $from_date_ts, $to_date_ts, $repeat_type = ">=0");
 
                                        // Loops through all controls for 
location and populates controls with check lists
                                        $controls_for_component_array = 
$this->populate_controls_with_check_lists($controls_for_component_array, 
$control_id_with_check_list_array);
 
-                                       $year_calendar = new year_calendar( 
$control, $year, $component, null, "component" );
-                                       $calendar_array = 
$year_calendar->build_calendar( $control->get_check_lists_array() );
+                                       $month_calendar = new month_calendar( 
$control, $year, $month, $component, null, "component" );
+                                       $calendar_array = 
$month_calendar->build_calendar( $control->get_check_lists_array() );
                                                                                
                                
                                        $controls_components_calendar_array[] = 
array("control" => $control->toArray(), "calendar_array" => $calendar_array);
                          }
@@ -156,6 +165,8 @@
                          $components_calendar_array[] = array("component" => 
$component->toArray(), "controls_calendar" => 
$controls_components_calendar_array);
                        }
                        
+                       print_r( $components_calendar_array );
+                       
                        $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
                
                        $property_array = 
execMethod('property.solocation.read', array('type_id' => 1, 'allrows' => 
true));
@@ -176,20 +187,21 @@
                        
                        $data = array
                        (               
-                               'buildings_on_property'         => 
$buildings_on_property,
-                               'my_locations'                          => 
$my_locations,
-                               'property_array'                        => 
$property_array,
-                               'current_location'                      => 
$location_array,
-                               'heading_array'                         => 
$heading_array,
-                               'controls_calendar_array' => 
$controls_calendar_array,
-                               'date_format'                                   
=> $date_format,
-                               'current_year'                                  
=> $year,
-                               'current_month_nr'                      => 
$month,
-                               'location_level'                                
=> $level,
-                               'roles_array'                                   
        => $roles_array,
-                               'repeat_type_array'                     => 
$repeat_type_array,
-                               'current_role'                                  
        => $role,
-                               'current_repeat_type'           => $repeat_type
+                               'buildings_on_property'                 => 
$buildings_on_property,
+                               'my_locations'                                  
=> $my_locations,
+                               'property_array'                                
=> $property_array,
+                               'current_location'                              
=> $location_array,
+                               'heading_array'                                 
=> $heading_array,
+                               'controls_calendar_array'       => 
$controls_calendar_array,
+                               'components_calendar_array'     => 
$components_calendar_array,
+                               'date_format'                                   
        => $date_format,
+                               'location_level'                                
        => $level,
+                               'roles_array'                                   
                => $roles_array,
+                               'repeat_type_array'                             
=> $repeat_type_array,
+                               'current_year'                                  
        => $year,
+                               'current_month_nr'                              
=> $month,
+                               'current_role'                                  
                => $role,
+                               'current_repeat_type'                   => 
$repeat_type
                        );
                        
                        self::add_javascript('controller', 'controller', 
'jquery.js');
@@ -213,7 +225,7 @@
                        // Validates year. If year is not set, current year is 
chosen
                        $year = $this->validate_year($year);
 
-                       // Validates year. 
+                       // Validates repeat type. 
                        $repeat_type = 
$this->validate_repeat_type($repeat_type);
                        
                        // Validates role. 
@@ -243,14 +255,12 @@
                        
                        // Fetches all controls for the components for a 
location within time period
                        $components_with_controls_array = 
$this->so_control->get_controls_by_component($location_code, $from_date_ts, 
$to_date_ts, $repeat_type, "return_object", $role);
-               
-                       $controls_calendar_array = array();
-                       
+                 
                        // Loops through controls with repeat type day or week
                        // and populates array that contains aggregated open 
cases pr month.
                        foreach($controls_for_location_array as $control)
                        {
-                               if($control->get_repeat_type() == 0 | 
$control->get_repeat_type() == 1)
+                               if($control->get_repeat_type() == 
controller_control::REPEAT_TYPE_DAY | $control->get_repeat_type() == 
controller_control::REPEAT_TYPE_WEEK)
                                {
                                        $cl_criteria = new 
controller_check_list();
                                        
$cl_criteria->set_control_id($control->get_id());
@@ -271,14 +281,14 @@
                        
                        $repeat_type_expr = ">=2";
                        // Fetches control ids with check lists for specified 
time period
-                       $control_id_with_check_list_array = 
$this->so->get_check_lists_for_location_2($location_code, $from_date_ts, 
$to_date_ts, $repeat_type_expr);
+                       $control_id_with_check_list_array = 
$this->so->get_check_lists_for_location($location_code, $from_date_ts, 
$to_date_ts, $repeat_type_expr);
                        
                        // Loops through all controls for location and 
populates controls with check lists
                        $controls_for_location_array = 
$this->populate_controls_with_check_lists($controls_for_location_array, 
$control_id_with_check_list_array);
                        
                        foreach($controls_for_location_array as $control)
                        {
-                               if($control->get_repeat_type() == 2 | 
$control->get_repeat_type() == 3)
+                               if($control->get_repeat_type() == 
controller_control::REPEAT_TYPE_MONTH | $control->get_repeat_type() == 
controller_control::REPEAT_TYPE_YEAR)
                                {
                                        $year_calendar = new 
year_calendar($control, $year, null, $location_code, "location" );
                                        $calendar_array = 
$year_calendar->build_calendar( $control->get_check_lists_array() );
@@ -291,36 +301,22 @@
                        foreach($components_with_controls_array as $component)
                        {
                                $location_id = $component->get_location_id();
- 
-                               $system_location = 
$GLOBALS['phpgw']->locations->get_name($location_id);
+                               $id = $component->get_id();
+      
+               $short_desc_arr = 
execMethod('property.soentity.get_short_description', array('location_id' => 
$location_id, 'id' => $id));
+               $component->set_xml_short_desc( $short_desc_arr );
                                
-                               $filters = array("short_description" => "IS NOT 
NULL");
-                               $attributes['attributes'] = 
$GLOBALS['phpgw']->custom_fields->find($system_location['appname'],$system_location['location'],
 0, '', 'ASC', 'short_description', true, true,$filters);
-               
-                               $params = array
-                               (
-                                       'location_id' => 
$component->get_location_id(),
-                                       'id' => $component->get_id()
-                               );
-                       
-                               $soentity         = 
createObject('property.soentity');
-        $prop_array = $soentity->read_single_eav($params, $attributes);
-                               
-                               $attr_arr = 
array_pop($prop_array['attributes']);
-                               $xml_short_desc = $attr_arr['value'];           
-                               $component->set_xml_short_desc($xml_short_desc);
-                               
                                $controls_for_component_array = 
$component->get_controls_array();
                                $controls_components_calendar_array = array();
                                
                          foreach($controls_for_component_array as $control)
                          {
-                                 if($control->get_repeat_type() == 0 | 
$control->get_repeat_type() == 1)
+                                 if($control->get_repeat_type() == 
controller_control::REPEAT_TYPE_DAY | $control->get_repeat_type() == 
controller_control::REPEAT_TYPE_WEEK)
                                  {
                                        $cl_criteria = new 
controller_check_list();
                                                $cl_criteria->set_control_id( 
$control->get_id() );
                                                $cl_criteria->set_component_id( 
$component->get_id() );
-                                       $cl_criteria->set_location_id( 
$component->get_type() );
+                                       $cl_criteria->set_location_id( 
$component->get_location_id() );
                                        
                                        $from_month = 
$this->get_start_month_for_control($control);
                                                $to_month = 
$this->get_end_month_for_control($control);
@@ -335,7 +331,7 @@
                                  else 
                                  {
                                    // Fetches control ids with check lists for 
specified time period
-                                               
$control_id_with_check_list_array = 
$this->so->get_check_lists_for_component($component->get_type(), 
$component->get_id(), $from_date_ts, $to_date_ts, $repeat_type = ">=2");
+                                               
$control_id_with_check_list_array = 
$this->so->get_check_lists_for_component($component->get_location_id(), 
$component->get_id(), $from_date_ts, $to_date_ts, $repeat_type = ">=2");
 
                                                // Loops through all controls 
for location and populates controls with check lists
                                                $controls_for_component_array = 
$this->populate_controls_with_check_lists($controls_for_component_array, 
$control_id_with_check_list_array);
@@ -375,10 +371,10 @@
                                'controls_calendar_array'       => 
$controls_calendar_array,
                                'components_calendar_array'     => 
$components_calendar_array,
                                'date_format'                                   
        => $date_format,
-                               'current_year'                                  
        => $year,
                                'location_level'                                
        => $level,
                                'roles_array'                                   
                => $roles_array,
                                'repeat_type_array'                             
=> $repeat_type_array,
+                               'current_year'                                  
        => $year,
                                'current_role'                                  
                => $role,
                                'current_repeat_type'                   => 
$repeat_type
                        );
@@ -418,7 +414,7 @@
                        $locations_with_calendar_array = array();
                        
                        // Process aggregated values for controls with repeat 
type day or week 
-                       if($control->get_repeat_type() <= 1 )
+                       if($control->get_repeat_type() <= 
controller_control::REPEAT_TYPE_WEEK )
                        {
                                foreach($locations_for_control_array as 
$location)
                                {
@@ -461,7 +457,7 @@
                                }
                        }
                        // Process values for controls with repeat type month 
or year
-                       else if($control->get_repeat_type() > 1)
+                       else if($control->get_repeat_type() > 
controller_control::REPEAT_TYPE_WEEK)
                        {
                                foreach($locations_for_control_array as 
$location)
                                {
@@ -538,10 +534,10 @@
                        $month = $this->validate_month($month);
                        
                        // Gets timestamp value of first day in month
-                       $from_date_ts = 
month_calendar::get_start_month_date_ts($year, intval( $month ));
+                       $from_date_ts = 
month_calendar::get_start_date_month_ts($year, intval( $month ));
 
                        // Gets timestamp value of first day in month
-                       $to_date_ts = 
month_calendar::get_end_month_date_ts($year, intval( $month ));
+                       $to_date_ts = 
month_calendar::get_next_start_date_month_ts($year, intval( $month ));
                        
                        $locations_with_calendar_array = array();
                        
@@ -818,6 +814,6 @@
                        
                        return $month;
                }
-
+               
                public function query(){}
        }
\ No newline at end of file

Modified: trunk/controller/inc/class.uicheck_list.inc.php
===================================================================
--- trunk/controller/inc/class.uicheck_list.inc.php     2012-07-03 07:21:48 UTC 
(rev 9706)
+++ trunk/controller/inc/class.uicheck_list.inc.php     2012-07-03 10:02:54 UTC 
(rev 9707)
@@ -52,37 +52,36 @@
                private $so_control_item_list;
        
                var $public_functions = array(
-                                                                               
'index'                                                 => true,
-                                                                               
'add_check_list'                                => true,
-                                                                               
'save_check_list'                               => true,
-                                                                               
'edit_check_list'                               => true,
+                                                                               
'index'                                                                         
        => true,
+                                                                               
'add_check_list'                                                => true,
+                                                                               
'save_check_list'                                       => true,
+                                                                               
'edit_check_list'                                       => true,
                                                                                
'create_case_message'                   => true,
-                                                                               
'view_control_info'                     => true,
-                                                                               
'view_cases_for_check_list'             => true,
-                                                                               
'update_check_list'                             => true,
-                                                                               
'print_check_list'                              => true,
-                                                                               
'register_case'                                 => true,
-                                                                               
'view_open_cases'                               => true,
-                                                                               
'view_closed_cases'                             => true,
+                                                                               
'view_control_info'                             => true,
+                                                                               
'view_cases_for_check_list'     => true,
+                                                                               
'print_check_list'                                      => true,
+                                                                               
'register_case'                                                 => true,
+                                                                               
'view_open_cases'                                               => true,
+                                                                               
'view_closed_cases'                                     => true,
                                                                                
'view_control_details'                  => true,
-                                                                               
'view_control_items'                    => true,
-                                                                               
'get_check_list_info'                   => true, 
-                                                                               
'get_cases_for_check_list'              => true
+                                                                               
'view_control_items'                            => true,
+                                                                               
'get_check_list_info'                           => true, 
+                                                                               
'get_cases_for_check_list'      => true
                                                                        );
 
                function __construct()
                {
                        parent::__construct();
 
-                       $this->so_control_area          = 
CreateObject('controller.socontrol_area');
-                       $this->so_control                       = 
CreateObject('controller.socontrol');
-                       $this->so                                       = 
CreateObject('controller.socheck_list');
-                       $this->so_control_item          = 
CreateObject('controller.socontrol_item');
-                       $this->so_check_item            = 
CreateObject('controller.socheck_item');
-                       $this->so_procedure                     = 
CreateObject('controller.soprocedure');
-                       $this->so_control_group_list = 
CreateObject('controller.socontrol_group_list');
-                       $this->so_control_group         = 
CreateObject('controller.socontrol_group');
-                       $this->so_control_item_list = 
CreateObject('controller.socontrol_item_list');
+                       $this->so_control_area                          = 
CreateObject('controller.socontrol_area');
+                       $this->so_control                                       
        = CreateObject('controller.socontrol');
+                       $this->so                                               
                                        = 
CreateObject('controller.socheck_list');
+                       $this->so_control_item                          = 
CreateObject('controller.socontrol_item');
+                       $this->so_check_item                                    
= CreateObject('controller.socheck_item');
+                       $this->so_procedure                                     
        = CreateObject('controller.soprocedure');
+                       $this->so_control_group_list    = 
CreateObject('controller.socontrol_group_list');
+                       $this->so_control_group                         = 
CreateObject('controller.socontrol_group');
+                       $this->so_control_item_list     = 
CreateObject('controller.socontrol_item_list');
 
                        
self::set_active_menu('controller::control::check_list');
                }       
@@ -185,7 +184,7 @@
                }
                
                /**
-                * Public function for displaying the add check list form  
+                * Public function for displaying the add check list form
                 * 
                 * @param HTTP:: location code, control id, date
                 * @return data array
@@ -199,26 +198,45 @@
                        $check_list->set_control_id($control_id);
                        $check_list->set_deadline($deadline_ts);
                        
-                       if($type == "component"){
+                       if($type == "component")
+                       {
                                $location_id = phpgw::get_var('location_id');
                                $check_list->set_location_id($location_id);
                                $component_id = phpgw::get_var('component_id');
                                $check_list->set_component_id($component_id);
-                       }else{
+                                               
+                               $component_arr = 
execMethod('property.soentity.read_single_eav', array('location_id' => 
$location_id, 'id' => $component_id));
+                               $short_desc = 
execMethod('property.soentity.get_short_description', array('location_id' => 
$location_id, 'id' => $component_id));
+               
+                               $component = new controller_component();
+                               $component->set_location_code( 
$component_arr['location_code'] );
+               $component->set_xml_short_desc( $short_desc );
+                               
+                               $component_array = $component->toArray();
+                               $building_location_code = 
$this->get_building_location_code($component_arr['location_code']);
+                       }
+                       else
+                       {
                                $location_code = 
phpgw::get_var('location_code');       
+                               $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
                        }
                        
                        $control = $this->so_control->get_single($control_id);
                        
-                       $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
+                       $year = date("Y", $deadline_ts);
+                       $month = date("n", $deadline_ts);
                        
                        $data = array
                        (
-                               'location_array'        => $location_array,
-                               'control'                                       
=> $control->toArray(),
-                               'date_format'           => $date_format,
-                               'check_list'                    => 
$check_list->toArray(),
-                               'type'                                          
=> $type
+                               'location_array'                                
        => $location_array,
+                               'component_array'                               
        => $component_array,
+                               'control'                                       
                                => $control->toArray(),
+                               'date_format'                                   
        => $date_format,
+                               'check_list'                                    
                => $check_list->toArray(),
+                               'type'                                          
                                => $type,
+                               'current_year'                                  
        => $year,
+                               'current_month_nr'                              
=> $month,
+                               'building_location_code'        => 
$building_location_code
                        );
                        
                        self::add_javascript('controller', 'controller', 
'jquery.js');
@@ -237,7 +255,8 @@
                 * @param HTTP:: location code, control id, status etc.. (check 
list details) 
                 * @return data array
                */
-               function save_check_list(){
+               function save_check_list()
+               {
                        $control_id = phpgw::get_var('control_id');
                        $status = (int)phpgw::get_var('status');
                        $type = phpgw::get_var('type');
@@ -245,7 +264,8 @@
                        $planned_date = phpgw::get_var('planned_date', 
'string');
                        $completed_date = phpgw::get_var('completed_date', 
'string');
                        $comment = phpgw::get_var('comment', 'string');
-                       
+                       $return_format = phpgw::get_var('phpgw_return_as');
+                                               
                        $deadline_date_ts = 
date_helper::get_timestamp_from_date( $deadline_date, "d/m-Y" );
                        
                        if($planned_date != ''){
@@ -281,9 +301,19 @@
                        
                        $check_list_id = $this->so->store($check_list);
                        
-                       if( $check_list_id > 0 ){
+                       
+                       if( ($check_list_id > 0) & ($return_format != 'json') )
+                       {
                                $this->redirect(array('menuaction' => 
'controller.uicheck_list.edit_check_list', 'check_list_id'=>$check_list_id));   
  
                        }
+                       else if( ($check_list_id > 0) & ($return_format == 
'json') )
+                       {
+                               return json_encode( array( "status" => 
"updated" ) );
+                       }
+                       else
+                       {
+                               return json_encode( array( "status" => 
"not_updated" ) );
+                       } 
                }
                
                /**
@@ -305,20 +335,43 @@
                        
                        $component_id = $check_list->get_component_id();
 
-                       if($component_id > 0){
+                       if($component_id > 0)
+                       {
+                               $location_id = $check_list->get_location_id();
+                               $component_id = $check_list->get_component_id();
                                
-                       }else{
+                               $component_arr = 
execMethod('property.soentity.read_single_eav', array('location_id' => 
$location_id, 'id' => $component_id));
+                               $short_desc = 
execMethod('property.soentity.get_short_description', array('location_id' => 
$location_id, 'id' => $component_id));
+               
+                               $component = new controller_component();
+                               $component->set_location_code( 
$component_arr['location_code'] );
+               $component->set_xml_short_desc( $short_desc );
+                               $component_array = $component->toArray();
+                               
+                               $type = 'component';
+                               $building_location_code = 
$this->get_building_location_code($component_arr['location_code']);
+                       }
+                       else
+                       {
                                $location_code = 
$check_list->get_location_code();
-       
-                               $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));      
+                               $location_array = 
execMethod('property.bolocation.read_single', array('location_code' => 
$location_code));
+                               $type = 'location';
                        }
                        
+                       $year = date("Y", $check_list->get_deadline());
+                       $month = date("n", $check_list->get_deadline());
+                       
                        $data = array
                        (
-                               'control'                               => 
$control->toArray(),
-                               'check_list'                    => 
$check_list->toArray(),
-                               'location_array'        => $location_array,
-                               'date_format'           => $date_format
+                               'control'                                       
                        => $control->toArray(),
+                               'check_list'                                    
                => $check_list->toArray(),
+                               'location_array'                                
        => $location_array,
+                               'component_array'                               
        => $component_array,
+                               'date_format'                                   
        => $date_format,
+                               'type'                                          
                                => $type,
+                               'current_year'                                  
        => $year,
+                               'current_month_nr'                              
=> $month,
+                               'building_location_code'        => 
$building_location_code
                        );
                        
                        self::add_javascript('controller', 'controller', 
'jquery.js');
@@ -395,6 +448,7 @@
                }
                
                // Saves a check list that already exists. Returns status for 
update as a JSON array with values update/not updated  
+               /*
                public function update_check_list()
                {
                        $check_list_id = phpgw::get_var('check_list_id');
@@ -430,6 +484,7 @@
                        else
                                return json_encode( array( "status" => 
"not_updated" ) );
                }
+               */
                
                public function print_check_list()
                {
@@ -668,5 +723,25 @@
                        return json_encode( $check_items_with_cases );
                }
                
+               function get_building_location_code($location_code)
+               {
+                       if( strlen( $location_code ) == 6 )
+                       {
+                               $location_code_arr = explode('-', 
$location_code, 2);
+                               $building_location_code = $location_code_arr[0];
+                       }
+                       else if( strlen( $location_code ) > 6 )
+                       {
+                               $location_code_arr = explode('-', 
$location_code, 3);
+                               $building_location_code = $location_code_arr[0] 
. "-" . $location_code_arr[1];
+                       }
+                       else
+                       {
+                               $building_location_code = $location_code;
+                       }
+                       
+                       return $building_location_code; 
+               }
+               
                public function query(){}
        }

Modified: trunk/controller/inc/class.uicheck_list_for_component.inc.php
===================================================================
--- trunk/controller/inc/class.uicheck_list_for_component.inc.php       
2012-07-03 07:21:48 UTC (rev 9706)
+++ trunk/controller/inc/class.uicheck_list_for_component.inc.php       
2012-07-03 10:02:54 UTC (rev 9707)
@@ -263,7 +263,6 @@
                                )
                        );
 
-
                        phpgwapi_yui::load_widget('paginator');
 
                        self::add_javascript('controller', 'yahoo', 
'control_tabs.js');
@@ -474,7 +473,6 @@
                                        $ifc = false;
                        }
 
-
                        $bim_types = $this->so_control->get_bim_types($ifc);
                        if(count($bim_types)>0)
                                return json_encode( $bim_types );

Modified: trunk/controller/inc/class.uicontrol_group.inc.php
===================================================================
--- trunk/controller/inc/class.uicontrol_group.inc.php  2012-07-03 07:21:48 UTC 
(rev 9706)
+++ trunk/controller/inc/class.uicontrol_group.inc.php  2012-07-03 10:02:54 UTC 
(rev 9707)
@@ -49,13 +49,13 @@
 
                public $public_functions = array
                (
-                       'index'                                                 
                =>      true,
-                       'query'                                                 
                =>      true,
-                       'edit'                                                  
                =>      true,
-                       'view'                                                  
                =>      true,
-                       'add'                                                   
                =>      true,
-                       'save_group_and_item_order'                             
=>      true,
-                       'get_control_groups_by_control_area'    => true
+                       'index'                                                 
                                                                        =>      
true,
+                       'query'                                                 
                                                                        =>      
true,
+                       'edit'                                                  
                                                                        =>      
true,
+                       'view'                                                  
                                                                        =>      
true,
+                       'add'                                                   
                                                                                
=>      true,
+                       'save_group_and_item_order'                             
                =>      true,
+                       'get_control_groups_by_control_area'    =>  true
                );
 
                public function __construct()

Deleted: trunk/controller/inc/class.uicontrol_item_option.inc.php
===================================================================
--- trunk/controller/inc/class.uicontrol_item_option.inc.php    2012-07-03 
07:21:48 UTC (rev 9706)
+++ trunk/controller/inc/class.uicontrol_item_option.inc.php    2012-07-03 
10:02:54 UTC (rev 9707)
@@ -1,104 +0,0 @@
-<?php
-       /**
-       * phpGroupWare - controller: a part of a Facilities Management System.
-       *
-       * @author Erink Holm-Larsen <address@hidden>
-       * @author Torstein Vadla <address@hidden>
-       * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc. 
http://www.fsf.org/
-       * This file is part of phpGroupWare.
-       *
-       * phpGroupWare is free software; you can redistribute it and/or modify
-       * it under the terms of the GNU General Public License as published by
-       * the Free Software Foundation; either version 2 of the License, or
-       * (at your option) any later version.
-       *
-       * phpGroupWare is distributed in the hope that it will be useful,
-       * but WITHOUT ANY WARRANTY; without even the implied warranty of
-       * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-       * GNU General Public License for more details.
-       *
-       * You should have received a copy of the GNU General Public License
-       * along with phpGroupWare; if not, write to the Free Software
-       * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 
 USA
-       *
-       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
-       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/
-       * @package property
-       * @subpackage controller
-       * @version $Id: class.uicontrol_item.inc.php 9082 2012-03-29 12:58:24Z 
vator $
-       */
-
-       phpgw::import_class('phpgwapi.uicommon');
-       phpgw::import_class('controller.socontrol_item_option');
-               
-       include_class('controller', 'control_item_option', 'inc/model/');
-
-       class controller_uicontrol_item_option extends phpgwapi_uicommon
-       {
-               private $so;
-               private $so_control_item;
-       
-               public $public_functions = array
-               (
-                       'add'           => true,
-                       'edit'          => true,
-                       'save'          => true,
-                       'delete'        => true,
-                       'query'         => true
-               );
-
-               public function __construct()
-               { 
-                       parent::__construct();
-                       $this->so = 
CreateObject('controller.socontrol_item_option');
-                       $this->so_control_item = 
CreateObject('controller.socontrol_item');
-               }
-
-               public function add()
-               {
-                       $control_item_id = phpgw::get_var('control_item_id');
-                       
-                       $control_item = 
$this->so_control_item->get_single($control_item_id);   
-                       
-                       $data = array
-                       (
-                               'control_item'  => $control_item->toArray()
-                       );
-                       
-                       self::add_javascript('controller', 'controller', 
'jquery.js');
-                       self::add_javascript('controller', 'controller', 
'ajax.js');
-                       self::add_javascript('controller', 'controller', 
'jquery-ui.custom.min.js');
-
-                       
self::render_template_xsl('control_item/control_item_option', $data);
-               }
-               
-               public function save()
-               {       
-                       $option_value = phpgw::get_var('option_value');
-                       $control_item_id = phpgw::get_var('control_item_id');
-                       
-                       $control_item_option = new 
controller_control_item_option($option_value, $control_item_id);
-                       $control_item_option_id = $this->so->store( 
$control_item_option );
-                       
-                       if($control_item_option_id > 0){
-                               $control_item_option = 
$this->so->get_single($control_item_option_id);   
-                               
-                               return json_encode( array( "status" => "saved", 
"saved_object" => $control_item_option->toArray() ) );
-                       }
-                       else{
-                               return json_encode( array("status" => 
"not_saved") );
-                       }
-               }
-
-               public function edit()
-               {
-                       $control_item_option_id = phpgw::get_var('id');
-                       $label = phpgw::get_var('label');
-                       $control_item_id = phpgw::get_var('control_item_id');
-                       
-                       $control_item_option = new 
controller_control_item_option($label, $control_item_id);
-                       $control_item_option_id = $this->so->store( 
$control_item_option );
-               }
-               
-               public function query(){}
-       }

Modified: trunk/controller/inc/component/class.month_calendar.inc.php
===================================================================
--- trunk/controller/inc/component/class.month_calendar.inc.php 2012-07-03 
07:21:48 UTC (rev 9706)
+++ trunk/controller/inc/component/class.month_calendar.inc.php 2012-07-03 
10:02:54 UTC (rev 9707)
@@ -9,63 +9,82 @@
 */  
 
 class month_calendar {
-       
-       private $period_start_date_ts;
-    private $period_end_date_ts;
        private $year;
        private $month;
        private $control;
+       private $type;
+       private $component;
+       private $location_code;
        private $calendar_array = array();
        
-       public function __construct($control, $year, $month){
-        $this->year = $year;
-        $this->month = $month;
-        $this->control = $control;
-        
-       $from_month = $month;
-                       
-               $from_date_ts = strtotime("$from_month/01/$year");
+       public function __construct($control, $year, $month, $component, 
$location_code, $type){
+    $this->year = $year;
+    $this->month = $month;
+    $this->control = $control;
+    $this->component = $component;
+    $this->location_code = $location_code;
+    $this->type = $type;
                
-               if(($from_month + 1) > 12){
-                       $to_month = 1;
-                       $to_year = $year + 1;
-               }else{
-                       $to_month = $from_month + 1;
-                       $to_year = $year;
-               }
-               
-               $to_date_ts = strtotime("$to_month/01/$to_year");
-        
-               $this->period_start_date_ts = $from_date_ts;
-               $this->period_end_date_ts = $to_date_ts;
-                       
-        $this->init_calendar();
-       }
+    $this->init_calendar();
+  }
        
        function init_calendar(){
+               $ctr_start_date_ts = $this->control->get_start_date();
+    $ctr_end_date_ts = $this->control->get_end_date();
+    $period_start_date_ts = $this->get_start_date_month_ts($this->year, 
$this->month);
+    $period_end_date_ts = $this->get_next_start_date_month_ts($this->year, 
$this->month);
+    $repeat_type = $this->control->get_repeat_type();
+    $repeat_interval = $this->control->get_repeat_interval();
 
                $num_days_in_month = cal_days_in_month(CAL_GREGORIAN, 
$this->month, $this->year);
                
-               for($i=1;$i<=$num_days_in_month;$i++){
+               for($i=1;$i<=$num_days_in_month;$i++)
+               {
                        $this->calendar_array[$i] = null;
                }
                
-               $date_generator = new 
date_generator($this->control->get_start_date(), 
$this->control->get_end_date(), $this->period_start_date_ts, 
$this->period_end_date_ts, $this->control->get_repeat_type(), 
$this->control->get_repeat_interval());
+               $date_generator = new date_generator($ctr_start_date_ts, 
$ctr_end_date_ts, $period_start_date_ts, $period_end_date_ts, $repeat_type, 
$repeat_interval);
                $dates_array = $date_generator->get_dates();
                
                // Inserts dates 
-               foreach($dates_array as $date){
-                       
+               foreach($dates_array as $date_ts)
+               {
+                       $check_list = new controller_check_list();
+       $check_list->set_deadline( $date_ts );
+       $check_list->set_control_id( $this->control->get_id() );
+       
+       if($this->type == "component")
+       {
+               $check_list->set_component_id( $this->component->get_id() );
+               $check_list->set_location_id( 
$this->component->get_location_id() );
+               $check_list_status_manager = new check_list_status_manager( 
$check_list, "component" );
+       }
+       else 
+       {
+               $check_list->set_location_code( $this->location_code );
+               $check_list_status_manager = new check_list_status_manager( 
$check_list, "location" );
+       } 
+       
+                       $check_list_status_info = 
$check_list_status_manager->get_status_for_check_list(); 
+       
+      $this->calendar_array[ date("j", $date_ts) ]["status"] = 
$check_list_status_info->get_status();
+      $this->calendar_array[ date("j", $date_ts) ]["info"]   = 
$check_list_status_info->serialize();
+      
+                       /*
                        $todays_date = mktime(0,0,0,date("m"), date("d"), 
date("Y"));
                        
-                       if($date < $todays_date){
+                       if($date < $todays_date)
+                       {
                                $status = "CONTROL_NOT_DONE";
-                       }else{
+                       }
+                       else
+                       {
                                $status = "CONTROL_REGISTERED";
                        }
                        
                        $this->calendar_array[ date("j", $date) ]["status"]  = 
$status;
-                       $this->calendar_array[ date("j", $date) ]["info"]  = 
array("date" => $date, "control_id" => $this->control->get_id());  
+                       $this->calendar_array[ date("j", $date) ]["info"]  = 
array("date" => $date, "control_id" => $this->control->get_id());
+                       */
                }
        }
        
@@ -82,32 +101,36 @@
                return $this->calendar_array;
        }
        
-       public static function get_heading_array($year, $month){
+       public static function get_heading_array($year, $month)
+       {
                $num_days_in_month = cal_days_in_month(CAL_GREGORIAN, $month, 
$year);           
                $heading_array = array();
                
-               for($i=1;$i<=$num_days_in_month;$i++){
+               for($i=1;$i<=$num_days_in_month;$i++)
+               {
                        $heading_array[$i] = "$i";      
                }
                
                return $heading_array;
        }
        
-       public static function get_start_month_date_ts($year, $from_month){
-               return strtotime("$from_month/01/$year");
+       public static function get_start_date_month_ts($year, $month){
+               return strtotime("$month/01/$year");
        }
        
-       public static function get_end_month_date_ts($year, $from_month){
-               if(($from_month + 1) > 12){
+       public static function get_next_start_date_month_ts($year, $month)
+       {
+               if(($month + 1) > 12)
+               {
                        $to_month = 1;
                        $to_year = $year + 1;
-               }else{
-                       $to_month = $from_month + 1;
+               }
+               else
+               {
+                       $to_month = $month + 1;
                        $to_year = $year;
                }
                
-               $to_date_ts = strtotime("$to_month/01/$to_year");
-               
-               return $to_date_ts; 
+               return strtotime("$to_month/01/$to_year");
        }
 }
\ No newline at end of file

Modified: trunk/controller/inc/component/class.year_calendar.inc.php
===================================================================
--- trunk/controller/inc/component/class.year_calendar.inc.php  2012-07-03 
07:21:48 UTC (rev 9706)
+++ trunk/controller/inc/component/class.year_calendar.inc.php  2012-07-03 
10:02:54 UTC (rev 9707)
@@ -13,10 +13,10 @@
        private $type;
        private $component;
        private $location_code;
-       
        private $calendar_array = array();
        
-  public function __construct($control, $year, $component, $location_code, 
$type){
+  public function __construct($control, $year, $component, $location_code, 
$type)
+  {
     $this->year = $year;
     $this->control = $control;
     $this->component = $component;
@@ -29,8 +29,10 @@
   /* Initializes calendar by setting status for each month in calendar array. 
    *   - CONTROL_NOT_DONE if month date is in the past 
    *   - CONTROL_REGISTERED if month date is in the future */ 
-       function init_calendar(){
-    for($i = 1;$i <= 12;$i++){
+       function init_calendar()
+       {
+    for($i = 1;$i <= 12;$i++)
+    {
                  $this->calendar_array[$i] = null;
     }
                
@@ -45,16 +47,20 @@
     $dates_array = $date_generator->get_dates();
                
     // Inserts dates 
-    foreach($dates_array as $date_ts){
+    foreach($dates_array as $date_ts)
+    {
        $check_list = new controller_check_list();
        $check_list->set_deadline( $date_ts );
        $check_list->set_control_id( $this->control->get_id() );
        
-       if($this->type == "component"){
+       if($this->type == "component")
+       {
                $check_list->set_component_id( $this->component->get_id() );
-               $check_list->set_location_id( $this->component->get_type() );
+               $check_list->set_location_id( 
$this->component->get_location_id() );
                $check_list_status_manager = new check_list_status_manager( 
$check_list, "component" );
-       }else {
+       }
+       else 
+       {
                $check_list->set_location_code( $this->location_code );
                $check_list_status_manager = new check_list_status_manager( 
$check_list, "location" );
        } 
@@ -68,9 +74,10 @@
                }
        }
        
-       public function build_calendar( $check_lists_array ){
-               
-               foreach($check_lists_array as $check_list){
+       public function build_calendar( $check_lists_array )
+       {
+               foreach($check_lists_array as $check_list)
+               {
                        $check_list_status_manager = new 
check_list_status_manager( $check_list );
                        $check_list_status_info = 
$check_list_status_manager->get_status_for_check_list(); 
 
@@ -83,7 +90,8 @@
                return $this->calendar_array;
        }
        
-       public function build_agg_month_calendar( 
$agg_open_cases_pr_month_array ){
+       public function build_agg_month_calendar( 
$agg_open_cases_pr_month_array )
+       {
                
                foreach($agg_open_cases_pr_month_array as 
$status_agg_month_info)
                {

Modified: trunk/controller/inc/model/class.check_list.inc.php
===================================================================
--- trunk/controller/inc/model/class.check_list.inc.php 2012-07-03 07:21:48 UTC 
(rev 9706)
+++ trunk/controller/inc/model/class.check_list.inc.php 2012-07-03 10:02:54 UTC 
(rev 9707)
@@ -169,17 +169,22 @@
                public function serialize()
                {
                        return array(
-                               'id' => $this->get_id(),
-                               'control_id' => $this->get_control_id(),
-                               'status' => $this->get_status(),
-                               'comment' => $this->get_comment(),
-                               'deadline' => $this->get_deadline(),
-                               'planned_date' => $this->get_planned_date(),
-                               'completed_date' => $this->get_completed_date(),
-                               'location_code' => $this->get_location_code(),
-                               'component_id' => $this->get_component_id(),
-                               'location_id' => $this->get_location_id(),
-                               'num_open_cases' => $this->get_num_open_cases()
+                               'id'                                            
        => $this->get_id(),
+                               'control_id'                    => 
$this->get_control_id(),
+                               'status'                                        
=> $this->get_status(),
+                               'comment'                               => 
$this->get_comment(),
+                               'deadline'                              => 
$this->get_deadline(),
+                               'planned_date'          => 
$this->get_planned_date(),
+                               'completed_date'        => 
$this->get_completed_date(),
+                               'location_code'         => 
$this->get_location_code(),
+                               'component_id'          => 
$this->get_component_id(),
+                               'location_id'           => 
$this->get_location_id(),
+                               'num_open_cases'        => 
$this->get_num_open_cases()
                        );
                }
+               
+               public function validate(){
+                       
+               
+               }
        }

Modified: trunk/controller/inc/model/class.component.inc.php
===================================================================
--- trunk/controller/inc/model/class.component.inc.php  2012-07-03 07:21:48 UTC 
(rev 9706)
+++ trunk/controller/inc/model/class.component.inc.php  2012-07-03 10:02:54 UTC 
(rev 9707)
@@ -41,6 +41,7 @@
                // Not a table column
                protected $xml_short_desc;
                protected $location_code;
+               protected $p_location_code;
                protected $loc_1;
                protected $address;
                

Deleted: trunk/controller/inc/model/class.schedule.inc.php
===================================================================
--- trunk/controller/inc/model/class.schedule.inc.php   2012-07-03 07:21:48 UTC 
(rev 9706)
+++ trunk/controller/inc/model/class.schedule.inc.php   2012-07-03 10:02:54 UTC 
(rev 9707)
@@ -1,94 +0,0 @@
-<?php
-       /**
-       * phpGroupWare - controller: a part of a Facilities Management System.
-       *
-       * @author Erink Holm-Larsen <address@hidden>
-       * @author Torstein Vadla <address@hidden>
-       * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc. 
http://www.fsf.org/
-       * This file is part of phpGroupWare.
-       *
-       * phpGroupWare is free software; you can redistribute it and/or modify
-       * it under the terms of the GNU General Public License as published by
-       * the Free Software Foundation; either version 2 of the License, or
-       * (at your option) any later version.
-       *
-       * phpGroupWare is distributed in the hope that it will be useful,
-       * but WITHOUT ANY WARRANTY; without even the implied warranty of
-       * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-       * GNU General Public License for more details.
-       *
-       * You should have received a copy of the GNU General Public License
-       * along with phpGroupWare; if not, write to the Free Software
-       * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 
 USA
-       *
-       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
-       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/
-       * @package property
-       * @subpackage controller
-       * @version $Id$
-       */
-
-       include_class('controller', 'model', 'inc/model/');
-
-       class controller_schedule extends controller_model
-       {
-               public static $so;
-               
-               protected $id;
-               protected $control_id;
-               protected $schedule_time;
-               
-               /**
-                * Constructor.  Takes an optional ID.  If a contract is 
created from outside
-                * the database the ID should be empty so the database can add 
one according to its logic.
-                * 
-                * @param int $id the id of this composite
-                */
-               public function __construct(int $id = null)
-               {
-                       $this->id = (int)$id;
-               }
-               
-               public function set_id($id)
-               {
-                       $this->id = $id;
-               }
-               
-               public function get_id() { return $this->id; }
-               
-               public function set_title($title)
-               {
-                       $this->title = $title;
-               }
-               
-               public function get_title() { return $this->title; }
-               
-               public function set_control_id($control_id)
-               {
-                       $this->control_id = $control_id;
-               }
-               
-               public function get_control_id() { return $this->control_id; }
-               
-               public function set_schedule_time($schedule_time)
-               {
-                       $this->schedule_time = $schedule_time;
-               }
-               
-               public function get_schedule_time() { return 
$this->schedule_time; }
-               
-               /**
-                * Get a static reference to the storage object associated with 
this model object
-                * 
-                * @return the storage object
-                */
-               public static function get_so()
-               {
-                       if (self::$so == null)
-                       {
-                               self::$so = 
CreateObject('controller.soschedule');
-                       }
-                       
-                       return self::$so;
-               }
-       }

Modified: trunk/controller/templates/base/calendar/view_calendar_month.xsl
===================================================================
--- trunk/controller/templates/base/calendar/view_calendar_month.xsl    
2012-07-03 07:21:48 UTC (rev 9706)
+++ trunk/controller/templates/base/calendar/view_calendar_month.xsl    
2012-07-03 10:02:54 UTC (rev 9707)
@@ -100,7 +100,7 @@
                
                        <!-- =====================  SELECT LIST FOR MY ASSIGNED 
LOCATIONS  ================= -->
                        <div id="choose-my-location" class="select-box">
-                               <label>Velg et annet bygg du har ansvar 
for</label>
+                               <label>Velg et annet bygg/eiendom du har ansvar 
for</label>
                                
                                <form action="#">
                                        <input type="hidden" name="period_type" 
value="view_month" />
@@ -183,6 +183,9 @@
                </div>
                        
                <div id="cal_wrp">
+               
+                       <!-- ================================  BUILDINGS TABLE  
====================================  -->
+                       <h2>Bygg/eiendom</h2>
                        <table id="calendar" class="month">
                                <tr class="heading">
                                        <th 
class="title"><span>Tittel</span></th>
@@ -194,59 +197,126 @@
                                </tr>
                                <xsl:choose>    
                                        <xsl:when 
test="controls_calendar_array/child::node()">
-                               <xsl:for-each select="controls_calendar_array">
-
-                                       <tr>                            
-                                       <xsl:choose>
-                                       <xsl:when test="(position() mod 2) != 
1">
-                                           <xsl:attribute 
name="class">odd</xsl:attribute>
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                           <xsl:attribute 
name="class">even</xsl:attribute>
-                                       </xsl:otherwise>
-                                   </xsl:choose>
-                                       
-                                               <td class="title">
-                                               <span><xsl:value-of 
select="control/title"/></span>
-                                               </td>
-                                               <td class="assigned">
-                                               <span><xsl:value-of 
select="control/responsibility_name"/></span>
-                                               </td>
-                                               <td class="frequency">
-                                               <span>
-                                                       <xsl:choose>
-                                                               <xsl:when 
test="control/repeat_interval = 1">
-                                                                       <span 
class="pre">Hver</span>
-                                                               </xsl:when>
-                                                               <xsl:when 
test="control/repeat_interval = 2">
-                                                                       <span 
class="pre">Annenhver</span>
-                                                               </xsl:when>
-                                                               <xsl:when 
test="control/repeat_interval > 2">
-                                                                       <span 
class="pre">Hver</span><span><xsl:value-of 
select="control/repeat_interval"/>.</span>
-                                                               </xsl:when>
-                                                       </xsl:choose>
-                                                       
-                                                       <span 
class="val"><xsl:value-of select="control/repeat_type_label"/></span>
-                                               </span>
-                                               </td>
-                               
-                               <xsl:for-each select="calendar_array">
-                                       
-                                       <xsl:call-template 
name="check_list_status_checker" >
-                                               <xsl:with-param 
name="location_code"><xsl:value-of 
select="//current_location/location_code"/></xsl:with-param>
-                                       </xsl:call-template>
-                                       
-                               </xsl:for-each>
-                               </tr>
-                               </xsl:for-each>
-                               
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                               <tr class="cal_info_msg"><td 
colspan="3">Ingen sjekklister for bygg i angitt periode</td></tr>
-                                       </xsl:otherwise>
-                               </xsl:choose>
+                                       <xsl:for-each 
select="controls_calendar_array">
+                                                       <tr>                    
        
+                                                       <xsl:choose>
+                                                       <xsl:when 
test="(position() mod 2) != 1">
+                                                           <xsl:attribute 
name="class">odd</xsl:attribute>
+                                                       </xsl:when>
+                                                       <xsl:otherwise>
+                                                           <xsl:attribute 
name="class">even</xsl:attribute>
+                                                       </xsl:otherwise>
+                                                   </xsl:choose>
+                                                       
+                                                               <td 
class="title">
+                                                               
<span><xsl:value-of select="control/title"/></span>
+                                                               </td>
+                                                               <td 
class="assigned">
+                                                               
<span><xsl:value-of select="control/responsibility_name"/></span>
+                                                               </td>
+                                                               <td 
class="frequency">
+                                                               <span>
+                                                                       
<xsl:choose>
+                                                                               
<xsl:when test="control/repeat_interval = 1">
+                                                                               
        <span class="pre">Hver</span>
+                                                                               
</xsl:when>
+                                                                               
<xsl:when test="control/repeat_interval = 2">
+                                                                               
        <span class="pre">Annenhver</span>
+                                                                               
</xsl:when>
+                                                                               
<xsl:when test="control/repeat_interval > 2">
+                                                                               
        <span class="pre">Hver</span><span><xsl:value-of 
select="control/repeat_interval"/>.</span>
+                                                                               
</xsl:when>
+                                                                       
</xsl:choose>
+                                                                       
+                                                                       <span 
class="val"><xsl:value-of select="control/repeat_type_label"/></span>
+                                                               </span>
+                                                               </td>
+                                               
+                                                       <xsl:for-each 
select="calendar_array">
+                                                               
<xsl:call-template name="check_list_status_checker" >
+                                                                       
<xsl:with-param name="location_code"><xsl:value-of 
select="//current_location/location_code"/></xsl:with-param>
+                                                               
</xsl:call-template>
+                                                       </xsl:for-each>
+                                               </tr>
+                                       </xsl:for-each>
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       <tr class="cal_info_msg"><td 
colspan="3">Ingen sjekklister for bygg i angitt periode</td></tr>
+                               </xsl:otherwise>
+                       </xsl:choose>
+                       </table>
+               
+               <!-- ================================  COMPONENTS TABLE  
====================================  -->
+               <h2 class="components">Komponenter</h2>
+               <xsl:choose>
+                               <xsl:when 
test="components_calendar_array/child::node()">
+               <xsl:for-each select="components_calendar_array">
+                 <h3><xsl:value-of select="component/xml_short_desc"/></h3>
+                 
+                       <table id="calendar" class="month">
+                                       <tr class="heading">
+                                                       <th 
class="title"><span>Tittel</span></th>
+                                                       <th 
class="assigned"><span>Tildelt</span></th>
+                                                       <th 
class="frequency"><span>Frekvens</span></th>
+                                       <xsl:for-each select="//heading_array">
+                                               <th><span><xsl:value-of 
select="."/></span></th>
+                                       </xsl:for-each>
+                                       </tr>
                        
-                       </table>
+                               <xsl:for-each select="controls_calendar">
+                                               <xsl:variable 
name="control_id"><xsl:value-of select="control/id"/></xsl:variable>
+                                       
+                                               <tr>
+                                                       <xsl:choose>
+                                                       <xsl:when 
test="(position() mod 2) != 1">
+                                                           <xsl:attribute 
name="class">odd</xsl:attribute>
+                                                       </xsl:when>
+                                                       <xsl:otherwise>
+                                                           <xsl:attribute 
name="class">even</xsl:attribute>
+                                                       </xsl:otherwise>
+                                                   </xsl:choose>
+                                                               <td 
class="title">
+                                                               
<span><xsl:value-of select="control/title"/></span>
+                                                               </td>
+                                                               <td 
class="assigned">
+                                                               
<span><xsl:value-of select="control/responsibility_name"/></span>
+                                                               </td>
+                                                               <td 
class="frequency">
+                                                               <span>
+                                                                       
<xsl:choose>
+                                                                               
<xsl:when test="control/repeat_interval = 1 and control/repeat_type &lt; 3">
+                                                                               
        <span class="pre">Hver</span>
+                                                                               
</xsl:when>
+                                                                               
<xsl:when test="control/repeat_interval = 1 and control/repeat_type = 3">
+                                                                               
        <span class="pre">Hvert</span>
+                                                                               
</xsl:when>
+                                                                               
<xsl:when test="control/repeat_interval = 2">
+                                                                               
        <span class="pre">Annenhver</span>
+                                                                               
</xsl:when>
+                                                                               
<xsl:when test="control/repeat_interval > 2">
+                                                                               
        <span class="pre">Hver</span><span><xsl:value-of 
select="control/repeat_interval"/>.</span>
+                                                                               
</xsl:when>
+                                                                       
</xsl:choose>
+                                                                       
+                                                                       <span 
class="val"><xsl:value-of select="control/repeat_type_label"/></span>
+                                                               </span>
+                                                               </td>
+                                                               <xsl:for-each 
select="calendar_array">
+                                                                       
<xsl:call-template name="check_list_status_checker" >
+                                                                               
<xsl:with-param name="location_code"><xsl:value-of 
select="//current_location/location_code"/></xsl:with-param>
+                                                                       
</xsl:call-template>
+                                                               </xsl:for-each>
+                                               </tr>   
+                                       </xsl:for-each>
+                               </table>        
+               </xsl:for-each>
+               </xsl:when>
+                       <xsl:otherwise>
+                               <div id="calendar">
+                                       <p class="no-comp-msg">Ingen 
komponenter tilknyttet kontroll</p>
+                               </div>
+                       </xsl:otherwise>
+                       </xsl:choose>
                </div>
        </div>
 </div>

Modified: trunk/controller/templates/base/calendar/view_calendar_year.xsl
===================================================================
--- trunk/controller/templates/base/calendar/view_calendar_year.xsl     
2012-07-03 07:21:48 UTC (rev 9706)
+++ trunk/controller/templates/base/calendar/view_calendar_year.xsl     
2012-07-03 10:02:54 UTC (rev 9707)
@@ -94,7 +94,7 @@
                        
                        <!-- =====================  SELECT LIST FOR MY 
LOCATIONS  ================= -->
                        <div id="choose-my-location" class="select-box">
-                               <label>Velg et annet bygg du har ansvar 
for</label>
+                               <label>Velg et annet bygg/eiendom du har ansvar 
for</label>
                                <xsl:call-template name="select_my_locations" />
                        </div>
                </div>
@@ -162,18 +162,16 @@
                        
                        <xsl:choose>
                                <xsl:when 
test="controls_calendar_array/child::node()">
-                               
                                <xsl:for-each select="controls_calendar_array">
                                        <xsl:variable 
name="control_id"><xsl:value-of select="control/id"/></xsl:variable>
-                               
                                        <tr>                            
-                                               <xsl:choose>
-                                               <xsl:when test="(position() mod 
2) != 1">
-                                                   <xsl:attribute 
name="class">odd</xsl:attribute>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                   <xsl:attribute 
name="class">even</xsl:attribute>
-                                               </xsl:otherwise>
+                                                       <xsl:choose>
+                                                   <xsl:when test="(position() 
mod 2) != 1">
+                                                    <xsl:attribute 
name="class">odd</xsl:attribute>
+                                                   </xsl:when>
+                                                   <xsl:otherwise>
+                                                       <xsl:attribute 
name="class">even</xsl:attribute>
+                                                   </xsl:otherwise>
                                            </xsl:choose>
                                                        <td class="title">
                                                        <span><xsl:value-of 
select="control/title"/></span>
@@ -182,31 +180,31 @@
                                                        <span><xsl:value-of 
select="control/responsibility_name"/></span>
                                                        </td>
                                                        <td class="frequency">
-                                                       <span>
-                                                               <xsl:choose>
-                                                                       
<xsl:when test="control/repeat_interval = 1 and control/repeat_type &lt; 3">
-                                                                               
<span class="pre">Hver</span>
-                                                                       
</xsl:when>
-                                                                       
<xsl:when test="control/repeat_interval = 1 and control/repeat_type = 3">
-                                                                               
<span class="pre">Hvert</span>
-                                                                       
</xsl:when>
-                                                                       
<xsl:when test="control/repeat_interval = 2">
-                                                                               
<span class="pre">Annenhver</span>
-                                                                       
</xsl:when>
-                                                                       
<xsl:when test="control/repeat_interval > 2">
-                                                                               
<span class="pre">Hver</span><span><xsl:value-of 
select="control/repeat_interval"/>.</span>
-                                                                       
</xsl:when>
-                                                               </xsl:choose>
-                                                               
-                                                               <span 
class="val"><xsl:value-of select="control/repeat_type_label"/></span>
-                                                       </span>
+                                       <span>
+                                               <xsl:choose>
+                                                       <xsl:when 
test="control/repeat_interval = 1 and control/repeat_type &lt; 3">
+                                                               <span 
class="pre">Hver</span>
+                                                       </xsl:when>
+                                                       <xsl:when 
test="control/repeat_interval = 1 and control/repeat_type = 3">
+                                                               <span 
class="pre">Hvert</span>
+                                                       </xsl:when>
+                                                       <xsl:when 
test="control/repeat_interval = 2">
+                                                               <span 
class="pre">Annenhver</span>
+                                                       </xsl:when>
+                                                       <xsl:when 
test="control/repeat_interval > 2">
+                                                               <span 
class="pre">Hver</span><span><xsl:value-of 
select="control/repeat_interval"/>.</span>
+                                                       </xsl:when>
+                                               </xsl:choose>
+                                               
+                                               <span class="val"><xsl:value-of 
select="control/repeat_type_label"/></span>
+                                       </span>
                                                        </td>
                                                        <xsl:for-each 
select="calendar_array">
                                                                
<xsl:call-template name="check_list_status_checker" >
                                                                        
<xsl:with-param name="location_code"><xsl:value-of 
select="//current_location/location_code"/></xsl:with-param>
                                                                
</xsl:call-template>
                                                        </xsl:for-each>
-                                       </tr>   
+                                               </tr>   
                                </xsl:for-each> 
                        </xsl:when>
                        <xsl:otherwise>
@@ -219,84 +217,85 @@
                <xsl:choose>
                                <xsl:when 
test="components_calendar_array/child::node()">
                <xsl:for-each select="components_calendar_array">
+                 <h3><xsl:value-of select="component/xml_short_desc"/></h3>
                  
-                           <h3><xsl:value-of 
select="component/xml_short_desc"/></h3>
-                 
-               <table id="calendar" class="year">
-                               <tr class="heading">
-                                               <th 
class="title"><span>Tittel</span></th>
-                                               <th 
class="assigned"><span>Tildelt</span></th>
-                                               <th 
class="frequency"><span>Frekvens</span></th>
-                                       <xsl:for-each select="//heading_array">
-                                               <th>
-                                                       <a>
-                                                               <xsl:attribute 
name="href">
-                                                                       
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
-                                                                       
<xsl:text>&amp;year=</xsl:text>
-                                                                       
<xsl:value-of select="//current_year"/>
-                                                                       
<xsl:text>&amp;location_code=</xsl:text>
-                                                                       
<xsl:value-of select="//current_location/location_code"/>
-                                                                       
<xsl:text>&amp;month=</xsl:text>
-                                                                       
<xsl:number/>
-                                                               </xsl:attribute>
-                                                               
-                                                               <xsl:variable 
name="month_str">short_month <xsl:number/> capitalized</xsl:variable>
-                                                               <xsl:value-of 
select="php:function('lang', $month_str)" />
-                                                       </a>                    
        
-                                               </th>
+                       <table id="calendar" class="year">
+                                       <tr class="heading">
+                                                       <th 
class="title"><span>Tittel</span></th>
+                                                       <th 
class="assigned"><span>Tildelt</span></th>
+                                                       <th 
class="frequency"><span>Frekvens</span></th>
+                                               <xsl:for-each 
select="//heading_array">
+                                                       <th>
+                                                               <a>
+                                                                       
<xsl:attribute name="href">
+                                                                               
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
+                                                                               
<xsl:text>&amp;year=</xsl:text>
+                                                                               
<xsl:value-of select="//current_year"/>
+                                                                               
<xsl:text>&amp;location_code=</xsl:text>
+                                                                               
<xsl:value-of select="//current_location/location_code"/>
+                                                                               
<xsl:text>&amp;month=</xsl:text>
+                                                                               
<xsl:number/>
+                                                                       
</xsl:attribute>
+                                                                       
+                                                                       
<xsl:variable name="month_str">short_month <xsl:number/> 
capitalized</xsl:variable>
+                                                                       
<xsl:value-of select="php:function('lang', $month_str)" />
+                                                               </a>            
                
+                                                       </th>
+                                               </xsl:for-each>
+                                       </tr>
+                       
+                               <xsl:for-each select="controls_calendar">
+                                               <xsl:variable 
name="control_id"><xsl:value-of select="control/id"/></xsl:variable>
+                                       
+                                               <tr>
+                                                       <xsl:choose>
+                                                       <xsl:when 
test="(position() mod 2) != 1">
+                                                           <xsl:attribute 
name="class">odd</xsl:attribute>
+                                                       </xsl:when>
+                                                       <xsl:otherwise>
+                                                           <xsl:attribute 
name="class">even</xsl:attribute>
+                                                       </xsl:otherwise>
+                                                   </xsl:choose>
+                                                               <td 
class="title">
+                                                               
<span><xsl:value-of select="control/title"/></span>
+                                                               </td>
+                                                               <td 
class="assigned">
+                                                               
<span><xsl:value-of select="control/responsibility_name"/></span>
+                                                               </td>
+                                                               <td 
class="frequency">
+                                                               <span>
+                                                                       
<xsl:choose>
+                                                                               
<xsl:when test="control/repeat_interval = 1 and control/repeat_type &lt; 3">
+                                                                               
        <span class="pre">Hver</span>
+                                                                               
</xsl:when>
+                                                                               
<xsl:when test="control/repeat_interval = 1 and control/repeat_type = 3">
+                                                                               
        <span class="pre">Hvert</span>
+                                                                               
</xsl:when>
+                                                                               
<xsl:when test="control/repeat_interval = 2">
+                                                                               
        <span class="pre">Annenhver</span>
+                                                                               
</xsl:when>
+                                                                               
<xsl:when test="control/repeat_interval > 2">
+                                                                               
        <span class="pre">Hver</span><span><xsl:value-of 
select="control/repeat_interval"/>.</span>
+                                                                               
</xsl:when>
+                                                                       
</xsl:choose>
+                                                                       
+                                                                       <span 
class="val"><xsl:value-of select="control/repeat_type_label"/></span>
+                                                               </span>
+                                                               </td>
+                                                               <xsl:for-each 
select="calendar_array">
+                                                                       
<xsl:call-template name="check_list_status_checker" >
+                                                                               
<xsl:with-param name="location_code"><xsl:value-of 
select="//current_location/location_code"/></xsl:with-param>
+                                                                       
</xsl:call-template>
+                                                               </xsl:for-each>
+                                               </tr>   
                                        </xsl:for-each>
-                               </tr>
-               
-                       <xsl:for-each select="controls_calendar">
-                                       <xsl:variable 
name="control_id"><xsl:value-of select="control/id"/></xsl:variable>
-                               
-                                       <tr>
-                                               <xsl:choose>
-                                               <xsl:when test="(position() mod 
2) != 1">
-                                                   <xsl:attribute 
name="class">odd</xsl:attribute>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                   <xsl:attribute 
name="class">even</xsl:attribute>
-                                               </xsl:otherwise>
-                                           </xsl:choose>
-                                                       <td class="title">
-                                                       <span><xsl:value-of 
select="control/title"/></span>
-                                                       </td>
-                                                       <td class="assigned">
-                                                       <span><xsl:value-of 
select="control/responsibility_name"/></span>
-                                                       </td>
-                                                       <td class="frequency">
-                                                       <span>
-                                                               <xsl:choose>
-                                                                       
<xsl:when test="control/repeat_interval = 1 and control/repeat_type &lt; 3">
-                                                                               
<span class="pre">Hver</span>
-                                                                       
</xsl:when>
-                                                                       
<xsl:when test="control/repeat_interval = 1 and control/repeat_type = 3">
-                                                                               
<span class="pre">Hvert</span>
-                                                                       
</xsl:when>
-                                                                       
<xsl:when test="control/repeat_interval = 2">
-                                                                               
<span class="pre">Annenhver</span>
-                                                                       
</xsl:when>
-                                                                       
<xsl:when test="control/repeat_interval > 2">
-                                                                               
<span class="pre">Hver</span><span><xsl:value-of 
select="control/repeat_interval"/>.</span>
-                                                                       
</xsl:when>
-                                                               </xsl:choose>
-                                                               
-                                                               <span 
class="val"><xsl:value-of select="control/repeat_type_label"/></span>
-                                                       </span>
-                                                       </td>
-                                                       <xsl:for-each 
select="calendar_array">
-                                                               
<xsl:call-template name="check_list_status_checker" >
-                                                                       
<xsl:with-param name="location_code"><xsl:value-of 
select="//current_location/location_code"/></xsl:with-param>
-                                                               
</xsl:call-template>
-                                                       </xsl:for-each>
-                                       </tr>   
-                               </xsl:for-each>
                                </table>        
                </xsl:for-each>
                </xsl:when>
                        <xsl:otherwise>
-                               <p class="no-comp-msg">Ingen komponenter 
tilknyttet kontroll</p>
+                               <div id="calendar">
+                                       <p class="no-comp-msg">Ingen 
komponenter tilknyttet kontroll</p>
+                               </div>
                        </xsl:otherwise>
                        </xsl:choose>
        </div>

Modified: trunk/controller/templates/base/check_list/add_check_list.xsl
===================================================================
--- trunk/controller/templates/base/check_list/add_check_list.xsl       
2012-07-03 07:21:48 UTC (rev 9706)
+++ trunk/controller/templates/base/check_list/add_check_list.xsl       
2012-07-03 10:02:54 UTC (rev 9707)
@@ -25,9 +25,57 @@
 <!-- ==================  ADD CHECKLIST  ========================= -->
 
 <div id="main_content" class="medium">
-       
-       <h1>Kontroll: <xsl:value-of select="control/title"/></h1>
-       <h2>Bygg: <xsl:value-of select="location_array/loc1_name"/></h2>
+       <div id="check-list-heading">
+               <div class="box-1">
+                       <h1>Kontroll: <xsl:value-of 
select="control/title"/></h1>
+                       <xsl:choose>
+                               <xsl:when test="type = 'component'">
+                                       <h2><xsl:value-of 
select="component_array/xml_short_desc"/></h2>
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       <h2>Bygg: <xsl:value-of 
select="location_array/loc1_name"/></h2>
+                               </xsl:otherwise>
+                       </xsl:choose>
+               </div>
+               <div class="box-2 select-box">
+                       <a>
+                               <xsl:attribute name="href">
+                                       
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_year</xsl:text>
+                                       <xsl:text>&amp;year=</xsl:text>
+                                       <xsl:value-of select="current_year"/>
+                                       <xsl:text>&amp;location_code=</xsl:text>
+                                       <xsl:choose>
+                                         <xsl:when test="type = 'component'">
+                                                 <xsl:value-of 
select="building_location_code"/>
+                                               </xsl:when>
+                                               <xsl:otherwise>
+                                                 <xsl:value-of 
select="location_array/location_code"/>
+                                               </xsl:otherwise>
+                                       </xsl:choose>
+                               </xsl:attribute>
+                               Kontrolplan for bygg/eiendom (år)
+                       </a>
+                       <a class="last">
+                               <xsl:attribute name="href">
+                                       
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
+                                       <xsl:text>&amp;year=</xsl:text>
+                                       <xsl:value-of select="current_year"/>
+                                       <xsl:text>&amp;month=</xsl:text>
+                                       <xsl:value-of 
select="current_month_nr"/>
+                                       <xsl:text>&amp;location_code=</xsl:text>
+                                       <xsl:choose>
+                                         <xsl:when test="type = 'component'">
+                                                 <xsl:value-of 
select="building_location_code"/>
+                                               </xsl:when>
+                                               <xsl:otherwise>
+                                                 <xsl:value-of 
select="location_array/location_code"/>
+                                               </xsl:otherwise>
+                                       </xsl:choose>
+                               </xsl:attribute>
+                               Kontrolplan for bygg/eiendom (måned)
+                       </a>
+               </div>
+       </div>
                
        <div id="check_list_menu">
                <a href="#" class="active">

Modified: trunk/controller/templates/base/check_list/edit_check_list.xsl
===================================================================
--- trunk/controller/templates/base/check_list/edit_check_list.xsl      
2012-07-03 07:21:48 UTC (rev 9706)
+++ trunk/controller/templates/base/check_list/edit_check_list.xsl      
2012-07-03 10:02:54 UTC (rev 9707)
@@ -34,9 +34,56 @@
        
        <!-- ==================  EDIT CHECKLIST  ========================= -->
        
-       <div>
-               <h1>Kontroll: <xsl:value-of select="control/title"/></h1>
-               <h2>Bygg: <xsl:value-of select="location_array/loc1_name"/></h2>
+       <div id="check-list-heading">
+               <div class="box-1">
+                       <h1>Kontroll: <xsl:value-of 
select="control/title"/></h1>
+                       <xsl:choose>
+                               <xsl:when test="type = 'component'">
+                                       <h2><xsl:value-of 
select="component_array/xml_short_desc"/></h2>
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       <h2>Bygg: <xsl:value-of 
select="location_array/loc1_name"/></h2>
+                               </xsl:otherwise>
+                       </xsl:choose>
+               </div>
+               <div class="box-2 select-box">
+                       <a>
+                               <xsl:attribute name="href">
+                                       
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_year</xsl:text>
+                                       <xsl:text>&amp;year=</xsl:text>
+                                       <xsl:value-of select="current_year"/>
+                                       <xsl:text>&amp;location_code=</xsl:text>
+                                       <xsl:choose>
+                                         <xsl:when test="type = 'component'">
+                                                 <xsl:value-of 
select="building_location_code"/>
+                                               </xsl:when>
+                                               <xsl:otherwise>
+                                                 <xsl:value-of 
select="location_array/location_code"/>
+                                               </xsl:otherwise>
+                                       </xsl:choose>
+                               </xsl:attribute>
+                               Kontrolplan for bygg/eiendom (år)
+                       </a>
+                       <a class="last">
+                               <xsl:attribute name="href">
+                                       
<xsl:text>index.php?menuaction=controller.uicalendar.view_calendar_for_month</xsl:text>
+                                       <xsl:text>&amp;year=</xsl:text>
+                                       <xsl:value-of select="current_year"/>
+                                       <xsl:text>&amp;month=</xsl:text>
+                                       <xsl:value-of 
select="current_month_nr"/>
+                                       <xsl:text>&amp;location_code=</xsl:text>
+                                       <xsl:choose>
+                                         <xsl:when test="type = 'component'">
+                                                 <xsl:value-of 
select="building_location_code"/>
+                                               </xsl:when>
+                                               <xsl:otherwise>
+                                                 <xsl:value-of 
select="location_array/location_code"/>
+                                               </xsl:otherwise>
+                                       </xsl:choose>
+                               </xsl:attribute>
+                               Kontrolplan for bygg/eiendom (måned)
+                       </a>
+               </div>
                
                <!-- ==================  CHECKLIST TAB MENU  
===================== -->
                <xsl:call-template name="check_list_tab_menu">
@@ -47,9 +94,10 @@
        <!-- ==================  CHECKLIST DETAILS  ===================== -->
        <div id="check_list_details">
                <h3 class="box_header">Sjekklistedetaljer</h3>
-                       <form id="frm_update_check_list" 
action="index.php?menuaction=controller.uicheck_list.update_check_list" 
method="post"> 
+                       <form id="frm_update_check_list" 
action="index.php?menuaction=controller.uicheck_list.save_check_list" 
method="post">   
                        <xsl:variable name="check_list_id"><xsl:value-of 
select="check_list/id"/></xsl:variable>
                        <input id="check_list_id" type="hidden" 
name="check_list_id" value="{$check_list_id}" />
+                       <input type="hidden" name="phpgw_return_as" 
value="json" />
                        
                        <fieldset class="col_1">
                        <div class="row">

Modified: trunk/controller/templates/base/css/base.css
===================================================================
--- trunk/controller/templates/base/css/base.css        2012-07-03 07:21:48 UTC 
(rev 9706)
+++ trunk/controller/templates/base/css/base.css        2012-07-03 10:02:54 UTC 
(rev 9707)
@@ -894,7 +894,22 @@
 }
 
 /* =======================================  CHECK LIST  
========================================= */
+#check-list-heading .box-1 {
+       float:left; 
+       width:71%;
+}
 
+#check-list-heading .box-2 {
+       float:right; 
+       width:25%;
+}
+
+#check-list-heading .box-2 a{
+       font-weight: normal;
+  padding: 0 0 5px;
+  text-align: center;
+}
+               
 .check_list li div {
     float: left;
     margin: 5px;
@@ -1082,7 +1097,7 @@
 #control_plan h2 {
   background: none repeat scroll 0 0 #FFFFFF;
   color: #000000;
-  display: inline-block;
+  float: left;
   font-size: 23px;
   padding: 0.2em 0.5em;
 }
@@ -1102,8 +1117,9 @@
 }
 
 #cal_wrp h3 {
-    font-size: 1.4em;
-    margin-bottom: 5px;
+  clear: both;
+  font-size: 1.4em;
+  margin-bottom: 5px;
 }
 
 /* =============================  SEARCH LOCATION BOX  ======================= 
*/
@@ -1168,6 +1184,10 @@
   text-align: justify; 
 }
 
+.select-box a.last{
+  padding: 0;
+}
+
 #choose-loc .btn {
     display: inline-block;
     font-size: 0.9em;
@@ -1205,6 +1225,7 @@
 }
 
 #calendar {
+  clear: both;
   table-layout: fixed;
   width: 100%;
 }
@@ -1550,9 +1571,11 @@
 
 /* ======================== CHECK LIST MENU ========================== */
 #check_list_menu {
+    clear: both;
     margin: 0 0 20px;
     overflow: hidden;
 }
+
 #check_list_menu a {
     background: none repeat scroll 0 0 #F4EDE3;
     border: 1px solid #EDE4D8;
@@ -1566,16 +1589,20 @@
     text-decoration: none;
     width: 185px;
 }
+
 #check_list_menu a.active {
        background: none repeat scroll 0 0 #CAE3FB;
     border: 1px solid #CAE3FB;
 }
+
 #check_list_menu .left_btns {
     float: left;
 }
+
 #check_list_menu .right_btns {
     float: right;
 }
+
 #check_list_menu .right_btns a {
     background: none repeat scroll 0 0 #F57056;
     border-color: #EE836F -moz-use-text-color #CB563F;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]