fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [6518] property: new datatypes as userinput for jaspe


From: Sigurd Nes
Subject: [Fmsystem-commits] [6518] property: new datatypes as userinput for jasper reports
Date: Wed, 27 Oct 2010 17:28:52 +0000

Revision: 6518
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6518
Author:   sigurdne
Date:     2010-10-27 17:28:52 +0000 (Wed, 27 Oct 2010)
Log Message:
-----------
property: new datatypes as userinput for jasper reports

Modified Paths:
--------------
    trunk/property/inc/class.uijasper.inc.php
    trunk/property/templates/base/jasper.xsl

Modified: trunk/property/inc/class.uijasper.inc.php
===================================================================
--- trunk/property/inc/class.uijasper.inc.php   2010-10-27 13:18:13 UTC (rev 
6517)
+++ trunk/property/inc/class.uijasper.inc.php   2010-10-27 17:28:52 UTC (rev 
6518)
@@ -686,11 +686,11 @@
 
                function view()
                {
-                       $jasper_id      = phpgw::get_var('jasper_id');
-                       $values = $this->bo->read_single($jasper_id);
-                       $values_attribute = phpgw::get_var('values_attribute');
-                       $sel_format = phpgw::get_var('sel_format');
-                       $first_run = true;
+                       $jasper_id                      = 
phpgw::get_var('jasper_id');
+                       $values                         = 
$this->bo->read_single($jasper_id);
+                       $values_attribute       = 
phpgw::get_var('values_attribute');
+                       $sel_format                     = 
phpgw::get_var('sel_format');
+                       $first_run                      = true;
 
                        if($values_attribute)
                        {
@@ -709,6 +709,7 @@
                        {
                                foreach ($values['input'] as &$input)
                                {
+                                       $input['name'] = $input['input_name'];
                                        if(!($input['value'] = 
phpgw::get_var(strtolower($input['input_name']))) || !$input['is_id'])
                                        {
                                                $user_input = true;
@@ -723,9 +724,15 @@
                        {
                                foreach ($values['input'] as &$input)
                                {
+                                       $input['name'] = $input['input_name'];
                                        if(!$input['value'])
                                        {
                                                $user_input = true;
+                                               $input['name'] = 
$input['input_name'];
+                                               if ( ($input['value'] = 
phpgw::get_var(strtolower($input['input_name']))))
+                                               {
+                                                       $user_input = false;    
                                
+                                               }                               
                
                                        }
                                        else
                                        {
@@ -740,7 +747,6 @@
                                        }
                                }
                        }
-
                        if(!$user_input)
                        {
                                $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
false;
@@ -778,11 +784,11 @@
 
                                $report_source          = 
"{$GLOBALS['phpgw_info']['server']['files_dir']}/property/jasper/{$jasper_id}/{$values['file_name']}";
                                $jasper_wrapper         = 
CreateObject('phpgwapi.jasper_wrapper');
-/*
-_debug_array($jasper_parameters);
-_debug_array($output_type);
-_debug_array($report_source);die();
-*/
+
+//_debug_array($jasper_parameters);
+//_debug_array($output_type);
+//_debug_array($report_source);die();
+
                                try
                                {
                                        
$jasper_wrapper->execute($jasper_parameters, $output_type, $report_source);
@@ -805,6 +811,7 @@
                                $custom_fields                  = 
CreateObject('property.custom_fields');
                                $values['attributes']   = $values['input'];
                                unset($values['input']);
+
                                $values = $custom_fields->prepare($values);
 
                                $receipt['error'][] = array('msg' => 
lang('enter input'));
@@ -835,6 +842,7 @@
                                        'msgbox_data'           => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                        'form_action'           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
                                        'attributes'            => 
$values['attributes'],
+                                       'lookup_functions'      => 
isset($values['lookup_functions'])?$values['lookup_functions']:'',
                                        'formats'                       => 
$formats
                                );
 

Modified: trunk/property/templates/base/jasper.xsl
===================================================================
--- trunk/property/templates/base/jasper.xsl    2010-10-27 13:18:13 UTC (rev 
6517)
+++ trunk/property/templates/base/jasper.xsl    2010-10-27 17:28:52 UTC (rev 
6518)
@@ -318,6 +318,15 @@
 
 <!-- user_input  -->
        <xsl:template match="user_input" xmlns:php="http://php.net/xsl";>
+               <xsl:choose>
+                       <xsl:when test="lookup_functions != ''">
+                               <script type="text/javascript">
+                                       self.name="first_Window";
+                                       <xsl:value-of 
select="lookup_functions"/>
+                               </script>
+                       </xsl:when>
+               </xsl:choose>
+
                <div class="yui-content">
                <xsl:variable name="form_action"><xsl:value-of 
select="form_action"/></xsl:variable>
                <form  name="form" method="post" action="{$form_action}">




reply via email to

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