fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [8165] added responsibility_id


From: Erik Holm-Larsen
Subject: [Fmsystem-commits] [8165] added responsibility_id
Date: Tue, 22 Nov 2011 13:02:01 +0000

Revision: 8165
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8165
Author:   erikhl
Date:     2011-11-22 13:02:00 +0000 (Tue, 22 Nov 2011)
Log Message:
-----------
added responsibility_id

Modified Paths:
--------------
    trunk/controller/inc/class.socontrol.inc.php
    trunk/controller/inc/class.uicontrol.inc.php
    trunk/controller/inc/model/class.control.inc.php
    trunk/controller/templates/base/control.xsl

Modified: trunk/controller/inc/class.socontrol.inc.php
===================================================================
--- trunk/controller/inc/class.socontrol.inc.php        2011-11-22 12:35:59 UTC 
(rev 8164)
+++ trunk/controller/inc/class.socontrol.inc.php        2011-11-22 13:02:00 UTC 
(rev 8165)
@@ -68,7 +68,8 @@
                        'control_area_id = ' . 
$this->marshal($control->get_control_area_id()),
                        'repeat_type = ' . 
$this->marshal($control->get_repeat_type(), 'string'),
                        'repeat_interval = ' . 
$this->marshal($control->get_repeat_interval(), 'string'),
-                       'procedure_id = ' . 
$this->marshal($control->get_procedure_id(), 'int')
+                       'procedure_id = ' . 
$this->marshal($control->get_procedure_id(), 'int'),
+                       'responsibility_id = ' . 
$this->marshal($control->get_responsibility_id(), 'int')
                );
                
                $result = $this->db->query('UPDATE controller_control SET ' . 
join(',', $values) . " WHERE id=$id", __LINE__,__FILE__);
@@ -242,8 +243,19 @@
                
                return $control;
        }
-       
 
-       
-       
+       function get_roles()
+       {
+               $ret_array = array();
+               $sql = "select * from fm_responsibility_role ORDER BY name";
+               $this->db->query($sql, __LINE__, __FILE__);
+               $i = 0;
+               while($this->db->next_record())
+               {
+                       $ret_array[$i]['id'] = $this->db->f('id');
+                       $ret_array[$i]['name'] = $this->db->f('name');
+                       $i++;
+               }
+               return $ret_array;
+       }
 }

Modified: trunk/controller/inc/class.uicontrol.inc.php
===================================================================
--- trunk/controller/inc/class.uicontrol.inc.php        2011-11-22 12:35:59 UTC 
(rev 8164)
+++ trunk/controller/inc/class.uicontrol.inc.php        2011-11-22 13:02:00 UTC 
(rev 8165)
@@ -178,6 +178,7 @@
                        // Fetches prosedures that are related to first control 
area in list
                        $control_area_id = $control_areas_array[0]['id'];
                        $procedures_array = 
$this->so_procedure->get_procedures_by_control_area_id($control_area_id);
+                       $role_array = $this->so->get_roles();
                        
                        $tabs = array( array(
                                                        'label' => "1: " . 
lang('Details')
@@ -197,6 +198,7 @@
                                'control'                                       
=> (isset($control)) ? $control->toArray(): null,
                                'control_areas_array'           => 
$control_areas_array,
                                'procedures_array'                      => 
$procedures_array,
+                               'role_array'                            => 
$role_array,
                                'start_date'                            => 
$GLOBALS['phpgw']->yuical->add_listener('start_date',date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],
 time())),
                                'end_date'                                      
=> 
$GLOBALS['phpgw']->yuical->add_listener('end_date',date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],
 ''))
                        );

Modified: trunk/controller/inc/model/class.control.inc.php
===================================================================
--- trunk/controller/inc/model/class.control.inc.php    2011-11-22 12:35:59 UTC 
(rev 8164)
+++ trunk/controller/inc/model/class.control.inc.php    2011-11-22 13:02:00 UTC 
(rev 8165)
@@ -195,6 +195,7 @@
                                
$this->set_control_area_id(phpgw::get_var('control_area_id','int'));
                                
$this->set_repeat_type(phpgw::get_var('repeat_type','int'));
                                
$this->set_repeat_interval(phpgw::get_var('repeat_interval','int'));
+                               
$this->set_responsibility_id(phpgw::get_var('responsibility_id','int'));
                }
                
                public function serialize()
@@ -211,6 +212,7 @@
                                'control_area_name' => 
$this->get_control_area_name(),
                                'repeat_type' => $this->get_repeat_type(),
                                'repeat_interval' => 
$this->get_repeat_interval(),
+                               'responsibility' => 
$this->get_responsibility_id(),
                        
                                );
                }

Modified: trunk/controller/templates/base/control.xsl
===================================================================
--- trunk/controller/templates/base/control.xsl 2011-11-22 12:35:59 UTC (rev 
8164)
+++ trunk/controller/templates/base/control.xsl 2011-11-22 13:02:00 UTC (rev 
8165)
@@ -117,6 +117,25 @@
                                </xsl:choose>
                                </dd>
                                <dt>
+                                       <label>Rolle</label>
+                               </dt>
+                               <dd>
+                               <xsl:choose>
+                                       <xsl:when test="editable">
+                                               <select id="responsibility_id" 
name="responsibility_id">
+                                                       <xsl:for-each 
select="role_array">
+                                                               <option 
value="{id}">
+                                                                       
<xsl:value-of disable-output-escaping="yes" select="name"/>
+                                                               </option>
+                                                   </xsl:for-each>
+                                               </select>
+                                       </xsl:when>
+                                       <xsl:otherwise>
+                                               <xsl:value-of 
select="control/role_name" />
+                                       </xsl:otherwise>
+                               </xsl:choose>
+                               </dd>
+                               <dt>
                                        <label 
for="description">Beskrivelse</label>
                                </dt>
                                <dd>




reply via email to

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