fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [13688] more on responsibility roles


From: Sigurd Nes
Subject: [Fmsystem-commits] [13688] more on responsibility roles
Date: Mon, 03 Aug 2015 09:13:50 +0000

Revision: 13688
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=13688
Author:   sigurdne
Date:     2015-08-03 09:13:49 +0000 (Mon, 03 Aug 2015)
Log Message:
-----------
more on responsibility roles

Modified Paths:
--------------
    trunk/property/inc/class.bogeneric.inc.php
    trunk/property/inc/class.sogeneric.inc.php
    trunk/property/inc/class.solocation.inc.php
    trunk/property/inc/class.soresponsible.inc.php
    trunk/property/inc/class.uilocation.inc.php
    trunk/property/inc/class.uiresponsible.inc.php
    trunk/property/setup/setup.inc.php
    trunk/property/setup/tables_current.inc.php
    trunk/property/setup/tables_update.inc.php
    trunk/property/templates/base/responsible.xsl

Modified: trunk/property/inc/class.bogeneric.inc.php
===================================================================
--- trunk/property/inc/class.bogeneric.inc.php  2015-07-17 19:57:10 UTC (rev 
13687)
+++ trunk/property/inc/class.bogeneric.inc.php  2015-08-03 09:13:49 UTC (rev 
13688)
@@ -166,6 +166,13 @@
                                                }
                                        }
                                }
+                               if 
(isset($field['values_def']['get_single_value']) && 
$field['values_def']['get_single_value'])
+                               {
+                                       foreach($values as &$entry)
+                                       {
+                                               $entry[$field['name']] = 
execMethod($field['values_def']['get_single_value'],$entry[$field['name']]);
+                                       }
+                               }
                        }
 
                        $this->total_records = $this->so->total_records;

Modified: trunk/property/inc/class.sogeneric.inc.php
===================================================================
--- trunk/property/inc/class.sogeneric.inc.php  2015-07-17 19:57:10 UTC (rev 
13687)
+++ trunk/property/inc/class.sogeneric.inc.php  2015-08-03 09:13:49 UTC (rev 
13688)
@@ -2264,7 +2264,6 @@
                                                                        
'valueset'              => false,
                                                                        
'method'                => 'preferences.boadmin_acl.get_locations',
                                                                        
'method_input'  => array('acl_app' => 'property',       'selected' => 
'##location##')
-//                                                                     
'method_input'  => array('acl_app' => '$this->appname', 'selected' => 
'##location##', 'have_categories' => true)
                                                                )
                                                        ),
                                                        array
@@ -2275,6 +2274,7 @@
                                                                'values_def'    
=> array
                                                                (
                                                                        
'valueset'              => false,
+                                                                       
'get_single_value'      => 'property.soresponsible.get_responsibility_name',
                                                                        
'method'                => 'property.boresponsible.get_responsibilities',
                                                                        
'method_input'  => array('appname' => '$this->appname', 'selected' => 
'##responsibility_id##')
                                                                )

Modified: trunk/property/inc/class.solocation.inc.php
===================================================================
--- trunk/property/inc/class.solocation.inc.php 2015-07-17 19:57:10 UTC (rev 
13687)
+++ trunk/property/inc/class.solocation.inc.php 2015-08-03 09:13:49 UTC (rev 
13688)
@@ -554,7 +554,7 @@
                                {
                                        $joinmethod .= " {$this->join} 
fm_responsibility_contact ON ( fm_location{$type_id}.location_code = 
fm_responsibility_contact.location_code))";
                                        $paranthesis .='(';
-                                       $joinmethod .= " {$this->join} 
fm_responsibility_role ON ( fm_responsibility_contact.id = 
fm_responsibility_role.responsibility_role_id))";
+                                       $joinmethod .= " {$this->join} 
fm_responsibility_role ON ( fm_responsibility_contact.responsibility_role_id = 
fm_responsibility_role.id))";
                                        $paranthesis .='(';
 
                                        $cols.= ',fm_responsibility_role.id as 
role_id';

Modified: trunk/property/inc/class.soresponsible.inc.php
===================================================================
--- trunk/property/inc/class.soresponsible.inc.php      2015-07-17 19:57:10 UTC 
(rev 13687)
+++ trunk/property/inc/class.soresponsible.inc.php      2015-08-03 09:13:49 UTC 
(rev 13688)
@@ -437,7 +437,31 @@
                        return $receipt;
                }
 
+               /**
+                * get the responsibility name
+                *
+                * @param type $id
+                * @return string name
+                */
+               public function get_responsibility_name($id)
+               {               
+                       static $names = array();
+                       $i = (int) $id;
 
+                       if ($names[$i])
+                       {
+                               return $names[$i];
+                       }
+                       
+
+                       $sql = "SELECT * FROM fm_responsibility WHERE id= 
{$id}";
+                       $this->db->query($sql, __LINE__, __FILE__);
+                       $this->db->next_record();       
+                       $name = $this->db->f('name', true);
+                       $names[$i] = $name;
+                       return $name;
+               }
+
                /**
                 * Read single responsibility type
                 *
@@ -600,7 +624,6 @@
                                                'p_num'                         
                => $this->db->f('p_num', true),
                                                'p_entity_id'                   
        => $this->db->f('p_entity_id'),
                                                'p_cat_id'                      
                => $this->db->f('p_cat_id'),
-                                               'ecodimb'                       
                => $this->db->f('ecodimb'),
                                                'remark'                        
                => $this->db->f('remark', true),
                                        );
                        }
@@ -632,7 +655,6 @@
                                        isset($values['extra']['p_num']) ? 
$values['extra']['p_num'] : '',
                                        isset($values['extra']['p_entity_id']) 
? $values['extra']['p_entity_id'] : '',
                                        isset($values['extra']['p_cat_id']) ? 
$values['extra']['p_cat_id'] : '',
-                                       $values['ecodimb'],
                                        $values['remark'],
                                        $this->account,
                                        time()
@@ -643,7 +665,7 @@
                        $this->db->transaction_begin();
 
                        $this->db->query("INSERT INTO fm_responsibility_contact 
(responsibility_role_id, contact_id,"
-                               ." location_code, active_from, active_to, 
p_num, p_entity_id, p_cat_id, ecodimb, remark, created_by, created_on)"
+                               ." location_code, active_from, active_to, 
p_num, p_entity_id, p_cat_id, remark, created_by, created_on)"
                                ." VALUES ($insert_values)", __LINE__, 
__FILE__);
 
                        if($this->db->transaction_commit())
@@ -678,8 +700,7 @@
                                || $values['active_from'] != 
$orig['active_from']
                                || $values['active_to'] != $orig['active_to']
                                || $values['extra']['p_num'] != $orig['p_num']
-                               || $values['remark'] != $orig['remark']
-                               || $values['ecodimb'] != $orig['ecodimb'])
+                               || $values['remark'] != $orig['remark'])
                        {
                                $receipt = $this->add_contact($values);
 
@@ -689,7 +710,6 @@
 
                                        $value_set['expired_by']        = 
$this->account;
                                        $value_set['expired_on']        = 
time();
-                                       $value_set['ecodimb']           = 
$values['ecodimb'];
                                }
 
                                $value_set      = 
$this->db->validate_update($value_set);
@@ -759,8 +779,7 @@
                                        'created_on'                            
=> $this->db->f('created_on'),
                                        'expired_by'                            
=> $this->db->f('expired_by'),
                                        'expired_on'                            
=> $this->db->f('expired_on'),
-                                       'priority'                              
        => $this->db->f('priority'), // FIXME - evaluate the need for this one
-                                       'ecodimb'                               
        => $this->db->f('ecodimb')
+                                       'priority'                              
        => $this->db->f('priority') // FIXME - evaluate the need for this one
                                );
 
                        return $values;
@@ -848,14 +867,8 @@
                        $todo = false;
                        $item_filter = '';
 
-                       if(isset($data['ecodimb']) && $data['ecodimb'])
+                       if(isset($data['extra']['p_entity_id']) && 
$data['extra']['p_entity_id'])
                        {
-                               $item_filter =   " AND ecodimb = 
'{$data['ecodimb']}'";
-                               $location_filter[] = '';
-                               $todo = true;
-                       }
-                       elseif(isset($data['extra']['p_entity_id']) && 
$data['extra']['p_entity_id'])
-                       {
                                $location_code = implode('-', 
$data['location']);
 
                                $item_filter =   " AND p_num = 
'{$data['extra']['p_num']}'"
@@ -863,7 +876,6 @@
                                        .' AND p_cat_id =' . (int) 
$data['extra']['p_cat_id'];
 
                                $location_filter[] = " AND location_code = 
'{$location_code}'";
-                               $ordermethod = '';
                                $todo = true;
                        }
                        else if(isset($data['location']) && $data['location'])
@@ -886,7 +898,6 @@
                                // Start at the bottom level
                                $location_filter        = 
array_reverse($location_filter);                              
 
-                               $ordermethod = ' ORDER by location_code.id ASC';
                                $todo = true;
                        }
 

Modified: trunk/property/inc/class.uilocation.inc.php
===================================================================
--- trunk/property/inc/class.uilocation.inc.php 2015-07-17 19:57:10 UTC (rev 
13687)
+++ trunk/property/inc/class.uilocation.inc.php 2015-08-03 09:13:49 UTC (rev 
13688)
@@ -1252,6 +1252,11 @@
                                        );
 
                                $values_combo_box[4] =   
execMethod('property.sogeneric.get_list',$_role_criteria);
+
+                               foreach($values_combo_box[4] as &$_role)
+                               {
+                                       $_role['name'] .= ':: ' .  
execMethod('property.soresponsible.get_responsibility_name',$_role['id']);
+                               }
                                $default_value = array 
('id'=>'','name'=>lang('no role'));
                                array_unshift 
($values_combo_box[4],$default_value);
 

Modified: trunk/property/inc/class.uiresponsible.inc.php
===================================================================
--- trunk/property/inc/class.uiresponsible.inc.php      2015-07-17 19:57:10 UTC 
(rev 13687)
+++ trunk/property/inc/class.uiresponsible.inc.php      2015-08-03 09:13:49 UTC 
(rev 13688)
@@ -446,7 +446,7 @@
                                                        'parameters'    => 
$parameters
                                                );
                                }
-
+/*
                                $datatable['rowactions']['action'][] = array
                                        (
                                                'my_name'               => 
'contacts',
@@ -458,7 +458,7 @@
                                                )),
                                                'parameters'    => $parameters2
                                        );
-
+*/
                                if($this->acl_add)
                                {
                                        $datatable['rowactions']['action'][] = 
array
@@ -1013,7 +1013,6 @@
                                                'created_on'                    
=> $entry['created_on'],
                                                'contact_name'                  
=> $entry['contact_name'],
                                                'remark'                        
        => $entry['remark'],
-                                               'ecodimb'                       
        => $entry['ecodimb'],
                                                'link_edit'                     
        => $link_edit,
                                                'text_edit'                     
        => $text_edit,
                                                'lang_edit_text'                
=> $lang_edit_text,
@@ -1067,20 +1066,6 @@
                                                        'type_id'               
=> $type_id
                                                )
                                        )),
-                                       'sort_ecodimb'  => 
$this->nextmatchs->show_sort_order(array
-                                       (
-                                               'sort'  => $this->sort,
-                                               'var'   => 'ecodimb',
-                                               'order' => $this->order,
-                                               'extra' => array
-                                               (
-                                                       'menuaction'    => 
'property.uiresponsible.contact',
-                                                       'allrows'               
=> $this->allrows,
-                                                       'appname'               
=> $this->appname,
-                                                       'location'              
=> $this->location,
-                                                       'type_id'               
=> $type_id
-                                               )
-                                       )),
                                        'lang_contact'          => 
lang('contact'),
                                        'lang_location'         => 
lang('location'),
                                        'lang_item'                     => 
lang('item'),
@@ -1089,7 +1074,6 @@
                                        'lang_created_on'       => 
lang('created'),
                                        'lang_created_by'       => 
lang('supervisor'),
                                        'lang_remark'           => 
lang('remark'),
-                                       'lang_ecodimb'          => lang('dimb'),
                                        'lang_edit'                     => 
$this->acl_edit ? lang('edit') : '',
                                        //              'lang_delete'           
=> $this->acl_delete ? lang('delete') : '',
                                );
@@ -1209,8 +1193,6 @@
 
                        if (isset($values) && is_array($values))
                        {
-                               $values['ecodimb']                      = 
phpgw::get_var('ecodimb');
-
                                if(!$this->acl_edit)
                                {
                                        $this->no_access();
@@ -1355,12 +1337,6 @@
                                )
                        );
 
-                       $ecodimb_data=$bocommon->initiate_ecodimb_lookup(array
-                               (
-                                       'ecodimb'                       => 
$values['ecodimb'],
-                                       'ecodimb_descr'         => 
$values['ecodimb_descr'])
-                               );
-
                        $link_data = array
                                (
                                        'menuaction'    => 
'property.uiresponsible.edit_contact',
@@ -1407,7 +1383,6 @@
 
                        $data = array
                                (
-                                       'ecodimb_data'                          
        => $ecodimb_data,
                                        'value_entry_date'                      
        => isset($values['entry_date']) ? $values['entry_date'] : '',
                                        'value_name'                            
        => isset($values['name']) ? $values['name'] : '',
                                        'value_remark'                          
        => isset($values['remark']) ? $values['remark'] : '',

Modified: trunk/property/setup/setup.inc.php
===================================================================
--- trunk/property/setup/setup.inc.php  2015-07-17 19:57:10 UTC (rev 13687)
+++ trunk/property/setup/setup.inc.php  2015-08-03 09:13:49 UTC (rev 13688)
@@ -12,7 +12,7 @@
        */
 
        $setup_info['property']['name']                 = 'property';
-       $setup_info['property']['version']              = '0.9.17.692';
+       $setup_info['property']['version']              = '0.9.17.693';
        $setup_info['property']['app_order']    = 8;
        $setup_info['property']['enable']               = 1;
        $setup_info['property']['app_group']    = 'office';

Modified: trunk/property/setup/tables_current.inc.php
===================================================================
--- trunk/property/setup/tables_current.inc.php 2015-07-17 19:57:10 UTC (rev 
13687)
+++ trunk/property/setup/tables_current.inc.php 2015-08-03 09:13:49 UTC (rev 
13688)
@@ -2538,7 +2538,6 @@
                                'created_by' => array('type' => 'int', 
'precision' => 4,'nullable' => False),
                                'expired_on' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
                                'expired_by' => array('type' => 'int', 
'precision' => 4,'nullable' => True),
-                               'ecodimb' => array('type' => 'int','precision' 
=> 4,'nullable' => True),
                                'remark' => array('type' => 'text','nullable' 
=> True)
                        ),
                        'pk' => array('id'),

Modified: trunk/property/setup/tables_update.inc.php
===================================================================
--- trunk/property/setup/tables_update.inc.php  2015-07-17 19:57:10 UTC (rev 
13687)
+++ trunk/property/setup/tables_update.inc.php  2015-08-03 09:13:49 UTC (rev 
13688)
@@ -8562,4 +8562,22 @@
                        $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.692';
                        return $GLOBALS['setup_info']['property']['currentver'];
                }
+       }
+
+       /**
+       * Update property version from 0.9.17.691 to 0.9.17.692
+       * Alter field name.
+       */
+       $test[] = '0.9.17.692';
+       function property_upgrade0_9_17_692()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               
$GLOBALS['phpgw_setup']->oProc->DropColumn('fm_responsibility_contact',array(),'ecodimb');
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.693';
+                       return $GLOBALS['setup_info']['property']['currentver'];
+               }
        }
\ No newline at end of file

Modified: trunk/property/templates/base/responsible.xsl
===================================================================
--- trunk/property/templates/base/responsible.xsl       2015-07-17 19:57:10 UTC 
(rev 13687)
+++ trunk/property/templates/base/responsible.xsl       2015-08-03 09:13:49 UTC 
(rev 13688)
@@ -407,11 +407,6 @@
                                <xsl:value-of select="lang_contact"/>
                        </td>
                        <td class="th_text" width="10%" align="left">
-                               <a href="{sort_ecodimb}">
-                                       <xsl:value-of select="lang_ecodimb"/>
-                               </a>
-                       </td>
-                       <td class="th_text" width="10%" align="left">
                                <a href="{$sort_location}">
                                        <xsl:value-of select="lang_location"/>
                                </a>
@@ -466,9 +461,6 @@
                                <xsl:value-of select="contact_name"/>
                        </td>
                        <td align="left">
-                               <xsl:value-of select="ecodimb"/>
-                       </td>
-                       <td align="left">
                                <xsl:value-of select="location_code"/>
                        </td>
                        <td align="left">
@@ -629,7 +621,6 @@
                                                        </input>
                                                </td>
                                        </tr>
-                                       <xsl:call-template name="ecodimb_form"/>
                                        <xsl:call-template 
name="location_form"/>
                                        <tr>
                                                <td>




reply via email to

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