fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15727]


From: saul . huanay
Subject: [Fmsystem-commits] [15727]
Date: Fri, 23 Sep 2016 22:25:07 +0000 (UTC)

Revision: 15727
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15727
Author:   psaul
Date:     2016-09-23 22:25:06 +0000 (Fri, 23 Sep 2016)
Log Message:
-----------


Modified Paths:
--------------
    branches/dev-syncromind-2/rental/inc/class.boapplication.inc.php
    branches/dev-syncromind-2/rental/inc/class.uiapplication.inc.php
    branches/dev-syncromind-2/rental/inc/class.uicomposite.inc.php
    branches/dev-syncromind-2/rental/js/rental/composite.edit.js
    branches/dev-syncromind-2/rental/js/rental/composite.view.js
    branches/dev-syncromind-2/rental/templates/base/composite.xsl

Modified: branches/dev-syncromind-2/rental/inc/class.boapplication.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.boapplication.inc.php    
2016-09-23 00:51:30 UTC (rev 15726)
+++ branches/dev-syncromind-2/rental/inc/class.boapplication.inc.php    
2016-09-23 22:25:06 UTC (rev 15727)
@@ -147,6 +147,10 @@
                                        $params['filters'][$field] = 
phpgw::get_var("filter_$field", $_params['type']);
                                }
                        }
+                       if (phpgw::get_var('composite_id'))
+                       {
+                               $params['filters']['composite_id'] = 
phpgw::get_var('composite_id');
+                       }
 
                        return $params;
                }

Modified: branches/dev-syncromind-2/rental/inc/class.uiapplication.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.uiapplication.inc.php    
2016-09-23 00:51:30 UTC (rev 15726)
+++ branches/dev-syncromind-2/rental/inc/class.uiapplication.inc.php    
2016-09-23 22:25:06 UTC (rev 15727)
@@ -628,7 +628,7 @@
                        $applications = $this->bo->read($params);
                        $status_text = rental_application::get_status_list();
                        $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
-                       foreach ($applications['results'] as &$application)
+                       foreach ($applications['results'] as $key => 
&$application)
                        {
                                        $application['status'] = 
$status_text[$application['status']];
                                        $application['composite_type'] = 
$this->composite_types[$application['composite_type']];
@@ -637,7 +637,27 @@
                                        $application['assign_date_start'] = 
$GLOBALS['phpgw']->common->show_date($application['assign_date_start'], 
$dateformat);
                                        $application['assign_date_end'] = 
$GLOBALS['phpgw']->common->show_date($application['assign_date_end'], 
$dateformat);
                                        $application['executive_officer'] = 
$application['executive_officer'] ? 
$GLOBALS['phpgw']->accounts->get($application['executive_officer'])->__toString()
 : '';
+                                       if 
(isset($params['filters']['composite_id']))
+                                       {
+                                               $composite_id = 
$params['filters']['composite_id'];
+                                               $n_composites = 0;
+                                               foreach 
($application['composites'] as $value)
+                                               {
+                                                       if ($value == 
$composite_id)
+                                                       {
+                                                               $n_composites++;
+                                                               break;
+                                                       }
+                                               }
+                                               if ($n_composites == 0)
+                                               {
+                                                       
$applications['total_records']--;
+                                                       
$applications['recordsTotal']--;
+                                                       
array_splice($applications['results'], $key, 1);
+                                               }
+                                       }
                        }
+
                        array_walk($applications["results"], array($this, 
"_add_links"), "rental.uiapplication.edit");
 
                        return $this->jquery_results($applications);

Modified: branches/dev-syncromind-2/rental/inc/class.uicomposite.inc.php
===================================================================
--- branches/dev-syncromind-2/rental/inc/class.uicomposite.inc.php      
2016-09-23 00:51:30 UTC (rev 15726)
+++ branches/dev-syncromind-2/rental/inc/class.uicomposite.inc.php      
2016-09-23 22:25:06 UTC (rev 15727)
@@ -1,9 +1,11 @@
 <?php
        phpgw::import_class('rental.socomposite');
        phpgw::import_class('rental.socontract');
+       phpgw::import_class('rental.soapplication');
        phpgw::import_class('rental.sounit');
        phpgw::import_class('rental.uicommon');
        include_class('rental', 'composite', 'inc/model/');
+       include_class('rental', 'application', 'inc/model/');
        include_class('rental', 'property_location', 'inc/model/');
 
        class rental_uicomposite extends rental_uicommon
@@ -893,6 +895,54 @@
 
                                $units = $composite->get_units();
                                $address_1 = 
$units[0]->get_location()->get_address_1();
+
+//                             application
+                               $tabletools4 = array
+                                       (
+                                       'my_name' => 'edit',
+                                       'text' => lang('edit'),
+                                       'action' => 
$GLOBALS['phpgw']->link('/index.php', array
+                                               (
+                                               'menuaction' => 
'rental.uiapplication.edit'
+                                       )),
+                                       'parameters' => 
json_encode(array('parameter' => array(array('name' => 'id','source' => 'id'))))
+                               );
+                               
+                               $datatable_container_application_name = ($mode 
== 'edit') ? 'datatable-container_3' : 'datatable-container_2';
+                               
+                               $datatable_def[] = array(
+                                       'container' => 
$datatable_container_application_name,
+                                       'requestUrl' => 
json_encode(self::link(array(
+                                               'menuaction' => 
'rental.uiapplication.query',
+                                               'composite_id' => $composite_id,
+                                               'editable' => 0,
+                                               'phpgw_return_as' => 'json'))),
+                                       'ColumnDefs' => array(
+                                               array('key' => 'id', 'label' => 
'id', 'formatter' => 'JqueryPortico.formatLink', 'sortable' => true),
+                                               array('key' => 'ecodimb_name', 
'label' => 'dimb', 'sortable' => false),
+                                               array('key' => 'email', 'label' 
=> 'email', 'sortable' => false),
+                                               array('key' => 
'assign_date_start', 'label' => 'assign_start', 'sortable' => false),
+                                               array('key' => 
'assign_date_end', 'label' => 'assign_end', 'sortable' => false),
+                                               array('key' => 'status', 
'label' => 'status', 'sortable' => false),
+                                               array('key' => 'entry_date', 
'label' => 'entry_date', 'sortable' => true),
+                                               array('key' => 
'executive_officer', 'label' => 'executive_officer', 'sortable' => true),
+                                       ),
+                                       'tabletools' => $tabletools4,
+                                       'config' => array(
+                                               array('disableFilter' => true)
+                                       )
+                               );
+                               
+                               $applications_search_options[] = array('id' => 
'all', 'name' => lang('all'), 'selected' => 1);
+                               $applications_search_options[] = array('id' => 
'ecodimb_name', 'name' => 'dimb', 'selected' => 0);
+                               
+                               
+                               $status_application_options[] = array('id' => 
'', 'name' => lang('all'), 'selected' => 1);
+                               $status_application_options[] = array('id' => 
1, 'name' => lang('registered'), 'selected' => 0);
+                               $status_application_options[] = array('id' => 
2, 'name' => lang('pending'), 'selected' => 0);
+                               $status_application_options[] = array('id' => 
3, 'name' => lang('rejected'), 'selected' => 0);
+                               $status_application_options[] = array('id' => 
4, 'name' => lang('approved'), 'selected' => 0);
+
                        }
 
                        $link_index = array
@@ -973,7 +1023,9 @@
                                'list_search_option' => array('options' => 
$search_options),
                                'list_type_id' => array('options' => 
$level_options),
                                'list_contracts_search_options' => 
array('options' => $contracts_search_options),
+                               'list_applications_search_options' => 
array('options' => $applications_search_options),
                                'list_status_options' => array('options' => 
$status_options),
+                               'list_status_application_options' => 
array('options' => $status_application_options),
                                'list_fields_of_responsibility_options' => 
array('options' => $fields_of_responsibility_options),
                                'composite_id' => $composite_id,
                                'validator' => 
phpgwapi_jquery::formvalidator_generate(array('location',

Modified: branches/dev-syncromind-2/rental/js/rental/composite.edit.js
===================================================================
--- branches/dev-syncromind-2/rental/js/rental/composite.edit.js        
2016-09-23 00:51:30 UTC (rev 15726)
+++ branches/dev-syncromind-2/rental/js/rental/composite.edit.js        
2016-09-23 22:25:06 UTC (rev 15727)
@@ -36,7 +36,7 @@
                        previous_contract_query = $(this).val();
                }
        });
-
+       
        $('#contract_status').change(function ()
        {
                filterDataContracts('contract_status', $(this).val());
@@ -56,6 +56,21 @@
        {
                filterDataContracts('contract_type', $(this).val());
        });
+       
+       var previous_application_query = '';
+       $('#applications_query').on('keyup change', function ()
+       {
+               if ($.trim($(this).val()) != $.trim(previous_application_query))
+               {
+                       filterDataApplications('search', {'value': 
$(this).val()});
+                       previous_application_query = $(this).val();
+               }
+       });
+       
+       $('#application_status').change(function ()
+       {
+               filterDataApplications('filter_status', $(this).val());
+       });
 });
 
 function filterDataLocations(param, value)
@@ -70,6 +85,12 @@
        oTable2.fnDraw();
 }
 
+function filterDataApplications(param, value)
+{
+       oTable3.dataTableSettings[3]['ajax']['data'][param] = value;
+       oTable3.fnDraw();
+}
+
 function formatterArea(key, oData)
 {
        var amount = $.number(oData[key], decimalPlaces, decimalSeparator, 
thousandsSeparator) + ' ' + area_suffix;

Modified: branches/dev-syncromind-2/rental/js/rental/composite.view.js
===================================================================
--- branches/dev-syncromind-2/rental/js/rental/composite.view.js        
2016-09-23 00:51:30 UTC (rev 15726)
+++ branches/dev-syncromind-2/rental/js/rental/composite.view.js        
2016-09-23 22:25:06 UTC (rev 15727)
@@ -35,6 +35,21 @@
        {
                filterDataContracts('contract_type', $(this).val());
        });
+       
+       var previous_application_query = '';
+       $('#applications_query').on('keyup change', function ()
+       {
+               if ($.trim($(this).val()) != $.trim(previous_application_query))
+               {
+                       filterDataApplications('search', {'value': 
$(this).val()});
+                       previous_application_query = $(this).val();
+               }
+       });
+       
+       $('#application_status').change(function ()
+       {
+               filterDataApplications('filter_status', $(this).val());
+       });
 });
 
 function filterDataContracts(param, value)
@@ -43,6 +58,12 @@
        oTable1.fnDraw();
 }
 
+function filterDataApplications(param, value)
+{
+       oTable2.dataTableSettings[2]['ajax']['data'][param] = value;
+       oTable2.fnDraw();
+}
+
 function formatterArea(key, oData)
 {
        var amount = $.number(oData[key], decimalPlaces, decimalSeparator, 
thousandsSeparator) + ' ' + area_suffix;

Modified: branches/dev-syncromind-2/rental/templates/base/composite.xsl
===================================================================
--- branches/dev-syncromind-2/rental/templates/base/composite.xsl       
2016-09-23 00:51:30 UTC (rev 15726)
+++ branches/dev-syncromind-2/rental/templates/base/composite.xsl       
2016-09-23 22:25:06 UTC (rev 15727)
@@ -277,6 +277,45 @@
                                                                        
</xsl:if>
                                                                </xsl:for-each>
                                                        </div>
+
+                                                       <br />
+                                                       <br />
+
+                                                       <div 
class="pure-control-group">
+                                                               <label>
+                                                                       
<xsl:value-of select="php:function('lang', 'search_options')"/>
+                                                               </label>
+                                                               <div 
class="pure-custom">
+                                                                       <div 
class="pure-control-group">
+                                                                               
<label>
+                                                                               
        <xsl:value-of select="php:function('lang', 'search_for')"/>
+                                                                               
</label>
+                                                                               
<input type="text" id="applications_query" name="applications_query" 
value=""></input>
+                                                                       </div>
+                                                                       <div 
class="pure-control-group">
+                                                                               
<label>
+                                                                               
        <xsl:value-of select="php:function('lang', 'status')"/>
+                                                                               
</label>
+                                                                               
<select id="application_status" name="application_status">
+                                                                               
        <xsl:apply-templates select="list_status_application_options/options"/>
+                                                                               
</select>
+                                                                       </div>
+                                                               </div>
+                                                       </div>
+                                                       <div>
+                                                               <xsl:for-each 
select="datatable_def">
+                                                                       <xsl:if 
test="container = 'datatable-container_3'">
+                                                                               
<xsl:call-template name="table_setup">
+                                                                               
        <xsl:with-param name="container" select ='container'/>
+                                                                               
        <xsl:with-param name="requestUrl" select ='requestUrl' />
+                                                                               
        <xsl:with-param name="ColumnDefs" select ='ColumnDefs' />
+                                                                               
        <xsl:with-param name="tabletools" select ='tabletools' />
+                                                                               
        <xsl:with-param name="data" select ='data' />
+                                                                               
        <xsl:with-param name="config" select ='config' />
+                                                                               
</xsl:call-template>
+                                                                       
</xsl:if>
+                                                               </xsl:for-each>
+                                                       </div>
                                                </div>
                                        </xsl:when>
                                </xsl:choose>
@@ -467,6 +506,45 @@
                                                        </xsl:if>
                                                </xsl:for-each>
                                        </div>
+                                       
+                                       <br />
+                                       <br />
+                                       
+                                       <div class="pure-control-group">
+                                               <label>
+                                                       <xsl:value-of 
select="php:function('lang', 'search_options')"/>
+                                               </label>
+                                               <div class="pure-custom">
+                                                       <div 
class="pure-control-group">
+                                                               <label>
+                                                                       
<xsl:value-of select="php:function('lang', 'search_for')"/>
+                                                               </label>
+                                                               <input 
type="text" id="applications_query" name="applications_query" value=""></input>
+                                                       </div>
+                                                       <div 
class="pure-control-group">
+                                                               <label>
+                                                                       
<xsl:value-of select="php:function('lang', 'status')"/>
+                                                               </label>
+                                                               <select 
id="application_status" name="application_status">
+                                                                       
<xsl:apply-templates select="list_status_application_options/options"/>
+                                                               </select>
+                                                       </div>
+                                               </div>
+                                       </div>
+                                       <div>
+                                               <xsl:for-each 
select="datatable_def">
+                                                       <xsl:if test="container 
= 'datatable-container_2'">
+                                                               
<xsl:call-template name="table_setup">
+                                                                       
<xsl:with-param name="container" select ='container'/>
+                                                                       
<xsl:with-param name="requestUrl" select ='requestUrl' />
+                                                                       
<xsl:with-param name="ColumnDefs" select ='ColumnDefs' />
+                                                                       
<xsl:with-param name="tabletools" select ='tabletools' />
+                                                                       
<xsl:with-param name="data" select ='data' />
+                                                                       
<xsl:with-param name="config" select ='config' />
+                                                               
</xsl:call-template>
+                                                       </xsl:if>
+                                               </xsl:for-each>
+                                       </div>
                                </div>
                        </div>
                        <div class="proplist-col">




reply via email to

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