fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [12670] Rental: configurable valid contract types


From: Sigurd Nes
Subject: [Fmsystem-commits] [12670] Rental: configurable valid contract types
Date: Thu, 29 Jan 2015 19:40:47 +0000

Revision: 12670
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=12670
Author:   sigurdne
Date:     2015-01-29 19:40:47 +0000 (Thu, 29 Jan 2015)
Log Message:
-----------
Rental: configurable valid contract types

Modified Paths:
--------------
    trunk/rental/inc/class.uicomposite.inc.php

Modified: trunk/rental/inc/class.uicomposite.inc.php
===================================================================
--- trunk/rental/inc/class.uicomposite.inc.php  2015-01-29 19:40:00 UTC (rev 
12669)
+++ trunk/rental/inc/class.uicomposite.inc.php  2015-01-29 19:40:47 UTC (rev 
12670)
@@ -123,10 +123,29 @@
                        $editable = phpgw::get_var('editable') == 'true' ? true 
: false;
                        
                        $contract_types = 
rental_socontract::get_instance()->get_fields_of_responsibility();
+
+                       $config = CreateObject('phpgwapi.config','rental');
+                       $config->read();
+                       $valid_contract_types = array();
+                       if(isset($config->config_data['contract_types']) && 
is_array($config->config_data['contract_types']))
+                       {
+                               foreach ($config->config_data['contract_types'] 
as $_key => $_value)
+                               {
+                                       if($_value)
+                                       {
+                                               $valid_contract_types[] = 
$_value;
+                                       }
+                               }
+                       }
+
                        
                        $create_types = array();
                        foreach($contract_types as $id => $label)
                        {
+                               if($valid_contract_types && 
!in_array($id,$valid_contract_types))
+                               {
+                                       continue;
+                               }
        
                                $names = $this->locations->get_name($id);
                                if($names['appname'] == 
$GLOBALS['phpgw_info']['flags']['currentapp'])




reply via email to

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