fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10603] property: more on condition_survey


From: Sigurd Nes
Subject: [Fmsystem-commits] [10603] property: more on condition_survey
Date: Mon, 17 Dec 2012 07:50:57 +0000

Revision: 10603
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10603
Author:   sigurdne
Date:     2012-12-17 07:50:53 +0000 (Mon, 17 Dec 2012)
Log Message:
-----------
property: more on condition_survey

Modified Paths:
--------------
    trunk/property/inc/class.uicondition_survey.inc.php

Modified: trunk/property/inc/class.uicondition_survey.inc.php
===================================================================
--- trunk/property/inc/class.uicondition_survey.inc.php 2012-12-15 09:40:46 UTC 
(rev 10602)
+++ trunk/property/inc/class.uicondition_survey.inc.php 2012-12-17 07:50:53 UTC 
(rev 10603)
@@ -50,7 +50,8 @@
                        'get_related'           => true,
                        'get_summation'         => true,
                        'view_file'                     => true,
-                       'import'                        => true
+                       'import'                        => true,
+                       'download'                      => true
                );
 
                public function __construct()
@@ -72,6 +73,19 @@
                }
 
 
+               public function download()
+               {
+                       if(!$this->acl_read)
+                       {
+                               $this->bocommon->no_access();
+                               return;
+                       }
+
+                       $values = $this->query();
+                       _debug_array($values);
+               }
+
+
                public function index()
                {
                        if(!$this->acl_read)
@@ -120,7 +134,7 @@
                                                        array(
                                                                'type' => 
'link',
                                                                'value' => 
lang('download'),
-                                                               'href' => 
'javascript:window.open("'. self::link(array('menuaction' => 
'property.uicondition_survey.index', 'export' => true, 'allrows' => true)) . 
'")',
+                                                               'href' => 
'javascript:window.open("'. self::link(array('menuaction' => 
'property.uicondition_survey.download', 'export' => true, 'allrows' => true)) . 
'","window")',
                                                                'class' => 
'new_item'
                                                        ),
                                                        array(
@@ -221,13 +235,14 @@
                                'allrows' => phpgw::get_var('allrows', 'bool')
                        );
 
-                       // Create an empty result set
                        $result_objects = array();
                        $result_count = 0;
 
-                       $export = phpgw::get_var('export');
-
                        $values = $this->bo->read($params);
+                       if ( phpgw::get_var('export', 'bool'))
+                       {
+                               return $values;
+                       }
 
                        $result_data = array('results' => $values);
 
@@ -236,15 +251,8 @@
                        $result_data['sort'] = $params['sort'];
                        $result_data['dir'] = $params['dir'];
 
+                       array_walk(     $result_data['results'], array($this, 
'_add_links'), "property.uicondition_survey.view" );
 
-                       if ($export)
-                       {
-                               
-                       }
-                       else
-                       {
-                               array_walk(     $result_data['results'], 
array($this, '_add_links'), "property.uicondition_survey.view" );
-                       }
                        return $this->yui_results($result_data);
                }
 




reply via email to

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