fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [11218] more on controller


From: Sigurd Nes
Subject: [Fmsystem-commits] [11218] more on controller
Date: Sat, 29 Jun 2013 17:30:07 +0000

Revision: 11218
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11218
Author:   sigurdne
Date:     2013-06-29 17:30:01 +0000 (Sat, 29 Jun 2013)
Log Message:
-----------
more on controller

Modified Paths:
--------------
    trunk/controller/inc/class.socontrol.inc.php
    trunk/controller/inc/class.uicalendar.inc.php
    trunk/controller/templates/base/calendar/select_buildings_on_property.xsl
    trunk/controller/templates/base/calendar/view_calendar_month.xsl
    trunk/controller/templates/base/calendar/view_calendar_year.xsl

Modified: trunk/controller/inc/class.socontrol.inc.php
===================================================================
--- trunk/controller/inc/class.socontrol.inc.php        2013-06-29 15:01:39 UTC 
(rev 11217)
+++ trunk/controller/inc/class.socontrol.inc.php        2013-06-29 17:30:01 UTC 
(rev 11218)
@@ -284,12 +284,12 @@
 
                        $controls_array = array();
                        
-                       $sql  = "SELECT distinct c.*, 
fm_responsibility_role.name AS responsibility_name "; 
+                       $sql  = "SELECT distinct c.*, 
fm_responsibility_role.name AS responsibility_name,location_code "; 
                        $sql .= "FROM controller_control_location_list cll "; 
                        $sql .= "LEFT JOIN controller_control c on 
cll.control_id=c.id ";
                        $sql .= "LEFT JOIN fm_responsibility_role ON 
fm_responsibility_role.id = c.responsibility_id ";
-                       $sql .= "WHERE cll.location_code = '$location_code' ";
-                       
+       //              $sql .= "WHERE cll.location_code = '$location_code' ";
+                       $sql .= "WHERE cll.location_code LIKE '$location_code%' 
";                      
                        if( $repeat_type )
                        {
                                $sql .= "AND c.repeat_type = $repeat_type ";
@@ -308,8 +308,10 @@
 
                        while($this->db->next_record())
                        {
+                               $_location_code = $this->db->f('location_code', 
true);
+
                                $control = new 
controller_control($this->unmarshal($this->db->f('id'), 'int'));
-                               
$control->set_title($this->unmarshal($this->db->f('title', true), 'string'));
+                               
$control->set_title($this->unmarshal($this->db->f('title', true)  . " 
[{$_location_code}]", 'string'));
                                
$control->set_description($this->unmarshal($this->db->f('description', true), 
'string'));
                                
$control->set_start_date($this->unmarshal($this->db->f('start_date'), 'int'));
                                
$control->set_end_date($this->unmarshal($this->db->f('end_date'), 'int'));
@@ -322,7 +324,7 @@
                                
$control->set_repeat_type($this->unmarshal($this->db->f('repeat_type'), 'int'));
                                
$control->set_repeat_type_label($this->unmarshal($this->db->f('repeat_type'), 
'int'));
                                
$control->set_repeat_interval($this->unmarshal($this->db->f('repeat_interval'), 
'int'));
-                               
+
                                if($return_type == "return_object")
                                {
                                        $controls_array[] = $control;

Modified: trunk/controller/inc/class.uicalendar.inc.php
===================================================================
--- trunk/controller/inc/class.uicalendar.inc.php       2013-06-29 15:01:39 UTC 
(rev 11217)
+++ trunk/controller/inc/class.uicalendar.inc.php       2013-06-29 17:30:01 UTC 
(rev 11218)
@@ -94,7 +94,7 @@
                        $location_code = phpgw::get_var('location_code');
                        $year = phpgw::get_var('year');
                        $month = phpgw::get_var('month');
-                       $role = phpgw::get_var('role');
+                       $role = phpgw::get_var('role', 'int', 'REQUEST', -1);
                        $repeat_type = phpgw::get_var('repeat_type');
 
                        // Validates year. If year is not set, current year is 
chosen
@@ -107,7 +107,7 @@
                        $repeat_type = 
$this->validate_repeat_type($repeat_type);
 
                        // Validates role.
-                       $role = $this->validate_role($role);
+//                     $role = $this->validate_role($role);
 
                        // Gets timestamp value of first day in month
                        $from_date_ts = 
month_calendar::get_start_date_month_ts($year, intval($month));
@@ -133,7 +133,8 @@
                                if ($level == 1)
                                {
                                        // Fetches all controls for the 
components for a location within time period
-                                       $filter = "bim_item.location_code = 
'$location_code' ";
+//                                     $filter = "bim_item.location_code = 
'$location_code' ";
+                                       $filter = "bim_item.location_code LIKE 
'$location_code%' ";
                                        $components_with_controls_array = 
$this->so_control->get_controls_by_component($from_date_ts, $to_date_ts, 
$repeat_type, "return_object", $role, $filter);
                                }
                                else
@@ -248,7 +249,8 @@
                {
                        $location_code = phpgw::get_var('location_code');
                        $year = phpgw::get_var('year');
-                       $role = phpgw::get_var('role');
+                       $role = phpgw::get_var('role', 'int', 'REQUEST', -1);
+
                        $repeat_type = phpgw::get_var('repeat_type');
 
                        // Validates year. If year is not set, current year is 
chosen
@@ -258,7 +260,7 @@
                        $repeat_type = 
$this->validate_repeat_type($repeat_type);
 
                        // Validates role.
-                       $role = $this->validate_role($role);
+//                     $role = $this->validate_role($role);
 
                        // Gets timestamp of first day in year
                        $from_date_ts = $this->get_start_date_year_ts($year);
@@ -287,7 +289,8 @@
                                if ($level == 1)
                                {
                                        // Fetches all controls for the 
components for a location within time period
-                                       $filter = "bim_item.location_code = 
'$location_code' ";
+//                                     $filter = "bim_item.location_code = 
'$location_code' ";
+                                       $filter = "bim_item.location_code LIKE 
'$location_code%' ";
                                        $components_with_controls_array = 
$this->so_control->get_controls_by_component($from_date_ts, $to_date_ts, 
$repeat_type, "return_object", $role, $filter);
                                }
                                else

Modified: 
trunk/controller/templates/base/calendar/select_buildings_on_property.xsl
===================================================================
--- trunk/controller/templates/base/calendar/select_buildings_on_property.xsl   
2013-06-29 15:01:39 UTC (rev 11217)
+++ trunk/controller/templates/base/calendar/select_buildings_on_property.xsl   
2013-06-29 17:30:01 UTC (rev 11218)
@@ -9,7 +9,7 @@
     </input>
                
     <select id="choose-building-on-property" class="select-location">
-      <option value="">Velg bygg</option>
+      <option value="">Velg lokalisering</option>
       <xsl:for-each select="buildings_on_property">
         <option>
           <xsl:if test="id = //current_location/location_code">

Modified: trunk/controller/templates/base/calendar/view_calendar_month.xsl
===================================================================
--- trunk/controller/templates/base/calendar/view_calendar_month.xsl    
2013-06-29 15:01:39 UTC (rev 11217)
+++ trunk/controller/templates/base/calendar/view_calendar_month.xsl    
2013-06-29 17:30:01 UTC (rev 11218)
@@ -184,7 +184,7 @@
                                                </a>
                                        </xsl:if>
 
-                                       <label>Velg et annet bygg på 
eiendommen</label>
+                                       <label>Velg en annen lokalisering på 
eiendommen</label>
                                        <xsl:call-template 
name="select_buildings_on_property" />
                                </div>
 
@@ -404,4 +404,4 @@
                        </div>
                </div>
        </div>
-</xsl:template>
\ No newline at end of file
+</xsl:template>

Modified: trunk/controller/templates/base/calendar/view_calendar_year.xsl
===================================================================
--- trunk/controller/templates/base/calendar/view_calendar_year.xsl     
2013-06-29 15:01:39 UTC (rev 11217)
+++ trunk/controller/templates/base/calendar/view_calendar_year.xsl     
2013-06-29 17:30:01 UTC (rev 11218)
@@ -124,7 +124,7 @@
                                                </a>
                                        </xsl:if>
 
-                                       <label>Velg et annet bygg på 
eiendommen</label>
+                                       <label>Velg en annen lokalisering på 
eiendommen</label>
                                        <xsl:call-template 
name="select_buildings_on_property" />
                                </div>
 




reply via email to

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