fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [12808] property: more on controller integration


From: Sigurd Nes
Subject: [Fmsystem-commits] [12808] property: more on controller integration
Date: Mon, 02 Mar 2015 08:46:13 +0000

Revision: 12808
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=12808
Author:   sigurdne
Date:     2015-03-02 08:46:12 +0000 (Mon, 02 Mar 2015)
Log Message:
-----------
property: more on controller integration

Modified Paths:
--------------
    trunk/property/inc/class.boentity.inc.php
    trunk/property/inc/class.uientity.inc.php
    trunk/property/templates/base/entity.xsl

Modified: trunk/property/inc/class.boentity.inc.php
===================================================================
--- trunk/property/inc/class.boentity.inc.php   2015-03-02 08:45:03 UTC (rev 
12807)
+++ trunk/property/inc/class.boentity.inc.php   2015-03-02 08:46:12 UTC (rev 
12808)
@@ -953,9 +953,13 @@
                                                'start_date'                    
=> $start_date
                                        );
 
-                                       
if($so_control->register_control_to_component($values))
+                                       if($add = 
$so_control->register_control_to_component($values))
                                        {
-                                               
$this->add_check_list(array('location_id'=>$location_id, 'component_id' => $id, 
'control_id' => $control_id, 'assigned_to' => $assigned_to, 'start_date' => 
$start_date, 'location_code' => $location_code));
+                                               if($add == PHPGW_ACL_ADD)
+                                               {
+                                                       
$this->add_check_list(array('location_id'=>$location_id, 'component_id' => $id, 
'control_id' => $control_id, 'assigned_to' => $assigned_to, 'start_date' => 
$start_date, 'location_code' => $location_code));
+                                               }
+
                                                $result =  array
                                                (
                                                        'status_kode'=> 'ok',

Modified: trunk/property/inc/class.uientity.inc.php
===================================================================
--- trunk/property/inc/class.uientity.inc.php   2015-03-02 08:45:03 UTC (rev 
12807)
+++ trunk/property/inc/class.uientity.inc.php   2015-03-02 08:46:12 UTC (rev 
12808)
@@ -2283,54 +2283,7 @@
                                        }
                                }
 
-                               
if(isset($GLOBALS['phpgw_info']['user']['apps']['controller']))
-                               {
 
-                                       $lang_controller = 
$GLOBALS['phpgw']->translation->translate('controller', array(),false , 
'controller');
-                                       $location_id            = 
$GLOBALS['phpgw']->locations->get_id('property', $this->acl_location);
-                                       $socase                         = 
CreateObject('controller.socase');
-                                       $controller_cases       = 
$socase->get_cases_by_component($location_id, $id);
-                                       
-                                       $_statustext = array();
-                                       $_statustext[0] = lang('open');
-                                       $_statustext[1] = lang('closed');
-                                       $_statustext[2] = lang('pending');
-                               }
-                               
-                               foreach ($controller_cases as $case)
-                               {
-                                       switch ($case['status'])
-                                       {
-                                               case 0:
-                                               case 2:
-                                                       $_method = 
'view_open_cases';
-                                                       break;
-                                               case 1:
-                                                       $_method = 
'view_closed_cases';
-                                                       break;
-                                               default:
-                                                       $_method = 
'view_open_cases';                                           
-                                       }
-
-                                       $_link = 
$GLOBALS['phpgw']->link('/index.php',array
-                                               (
-                                                       'menuaction' => 
"controller.uicase.{$_method}",
-                                                       'check_list_id' => 
$case['check_list_id']
-                                               )
-                                       );
-                                       
-                                       $_target[] = array
-                                       (
-                                               'url'           => "<a 
href=\"{$_link}\" > {$case['check_list_id']}</a>",
-                                               'type'          => 
$lang_controller,
-                                               'title'         => 
$case['descr'],
-                                               'status'        => 
$_statustext[$case['status']],
-                                               'user'          => 
$GLOBALS['phpgw']->accounts->get($case['user_id'])->__toString(),
-                                               'entry_date'=> 
$GLOBALS['phpgw']->common->show_date($case['modified_date'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']),
-                                       );
-                                       unset($_link);
-                               }
-
                                $related = 
$this->bo->read_entity_to_link(array('entity_id'=>$this->entity_id,'cat_id'=>$this->cat_id,'id'=>$id));
 
                                $_related = array();
@@ -2431,7 +2384,8 @@
                                
                                }
 
-                       }
+                               
if(isset($GLOBALS['phpgw_info']['user']['apps']['controller']))
+                               {
                                        $_controls = 
$this->get_controls_at_component($location_id, $id);
 
                                        $datavalues[4] = array
@@ -2462,8 +2416,90 @@
                                                        )
                                                )
                                        );
-                               
 
+                                       $lang_controller = 
$GLOBALS['phpgw']->translation->translate('controller', array(),false , 
'controller');
+                                       $location_id            = 
$GLOBALS['phpgw']->locations->get_id('property', $this->acl_location);
+                                       $socase                         = 
CreateObject('controller.socase');
+                                       $controller_cases       = 
$socase->get_cases_by_component($location_id, $id);
+                                       $_statustext = array();
+                                       $_statustext[0] = lang('open');
+                                       $_statustext[1] = lang('closed');
+                                       $_statustext[2] = lang('pending');
+
+                                       $_cases = array();
+                                       foreach ($controller_cases as $case)
+                                       {
+                                               $socheck_list   = 
CreateObject('controller.socheck_list');
+                                               $control_id     = 
$socheck_list->get_single($case['check_list_id'])->get_control_id();
+                                               foreach($_controls as $_control)
+                                               {
+                                                       
if($_control['control_id'] == $control_id)
+                                                       {
+                                                               $_control_name 
= $_control['title'];
+                                                               break;
+                                                       }
+                                               }
+//                                             _debug_array($check_list);die();
+
+                                               switch ($case['status'])
+                                               {
+                                                       case 0:
+                                                       case 2:
+                                                               $_method = 
'view_open_cases';
+                                                               break;
+                                                       case 1:
+                                                               $_method = 
'view_closed_cases';
+                                                               break;
+                                                       default:
+                                                               $_method = 
'view_open_cases';
+                                               }
+
+                                               $_link = 
$GLOBALS['phpgw']->link('/index.php',array
+                                                       (
+                                                               'menuaction' => 
"controller.uicase.{$_method}",
+                                                               'check_list_id' 
=> $case['check_list_id']
+                                                       )
+                                               );
+
+                                               $_cases[] = array
+                                               (
+                                                       'url'           => "<a 
href=\"{$_link}\" > {$case['check_list_id']}</a>",
+                                                       'type'          => 
$_control_name,
+                                                       'title'         => 
$case['descr'],
+                                                       'status'        => 
$_statustext[$case['status']],
+                                                       'user'          => 
$GLOBALS['phpgw']->accounts->get($case['user_id'])->__toString(),
+                                                       'entry_date'=> 
$GLOBALS['phpgw']->common->show_date($case['modified_date'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']),
+                                               );
+                                               unset($_link);
+                                       }
+
+                                       $datavalues[5] = array
+                                       (
+                                               'name'                          
        => "5",
+                                               'values'                        
        => json_encode($_cases),
+                                               'total_records'                 
=> count($_cases),
+                                               'edit_action'                   
=> "''",
+                                               'is_paginator'                  
=> 1,
+                                               'footer'                        
        => 0
+                                       );
+
+                                       $myColumnDefs[5] = array
+                                       (
+                                               'name'          => "5",
+                                               'values'        =>      
json_encode(array(
+                                                       array('key' => 
'url','label'=>lang('id'),'sortable'=>false,'resizeable'=>true),
+                                                       array('key' => 
'type','label'=>lang('type'),'sortable'=>true,'resizeable'=>true),
+                                                       array('key' => 
'title','label'=>lang('title'),'sortable'=>false,'resizeable'=>true),
+                                                       array('key' => 
'status','label'=>lang('status'),'sortable'=>false,'resizeable'=>true),
+                                                       array('key' => 
'user','label'=>lang('user'),'sortable'=>true,'resizeable'=>true),
+                                                       array('key' => 
'entry_date','label'=>lang('entry date'),'sortable'=>false,'resizeable'=>true),
+                                                       )
+                                               )
+                                       );
+
+                               }
+                       }
+
                        $property_js = "/property/js/yahoo/property2.js";
 
                        if 
(!isset($GLOBALS['phpgw_info']['server']['no_jscombine']) || 
!$GLOBALS['phpgw_info']['server']['no_jscombine'])

Modified: trunk/property/templates/base/entity.xsl
===================================================================
--- trunk/property/templates/base/entity.xsl    2015-03-02 08:45:03 UTC (rev 
12807)
+++ trunk/property/templates/base/entity.xsl    2015-03-02 08:46:12 UTC (rev 
12808)
@@ -744,13 +744,37 @@
                                                                </input>
 
                                                        </fieldset>
-                                                               <table 
cellpadding="2" cellspacing="2" width="80%" align="center">
+                                                       <table>
+                                                               <tr>
+                                                                       <td>
+                                                                       
<xsl:value-of select="php:function('lang', 'controller')" />
+                                                                               
+                                                                       </td>
+                                                                       <td>
+                                                                       <table 
cellpadding="2" cellspacing="2" width="80%" align="center">
                                                                        <tr>
                                                                                
<td>
                                                                                
        <div id="datatable-container_4"/>
                                                                                
</td>
                                                                        </tr>
                                                                </table>
+                                                       </td>
+                                                               </tr>
+                                                               <tr>
+                                                                       <td>
+                                                                       
<xsl:value-of select="php:function('lang', 'cases')" />
+                                                                       </td>
+                                                                       <td>
+                                                               <table 
cellpadding="2" cellspacing="2" width="80%" align="center">
+                                                                       <tr>
+                                                                               
<td>
+                                                                               
        <div id="datatable-container_5"/>
+                                                                               
</td>
+                                                                       </tr>
+                                                               </table>
+                                                                       </td>
+                                                               </tr>
+                                                       </table>
 
                                                        <xsl:call-template 
name="controller_integration">
                                                                <xsl:with-param 
name="controller" select ='controller'/>




reply via email to

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