fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [14747] more fixes


From: Sigurd Nes
Subject: [Fmsystem-commits] [14747] more fixes
Date: Wed, 17 Feb 2016 12:36:02 +0000

Revision: 14747
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14747
Author:   sigurdne
Date:     2016-02-17 12:34:49 +0000 (Wed, 17 Feb 2016)
Log Message:
-----------
more fixes

Modified Paths:
--------------
    trunk/phpgwapi/templates/base/datatable_jquery.xsl
    trunk/property/inc/class.bobudget.inc.php
    trunk/property/inc/class.bolocation.inc.php
    trunk/property/inc/class.bolookup.inc.php
    trunk/property/inc/class.soinvoice.inc.php
    trunk/property/inc/class.soworkorder.inc.php
    trunk/property/inc/class.uientity.inc.php
    trunk/property/inc/class.uilocation.inc.php
    trunk/property/inc/class.uilookup.inc.php
    trunk/property/inc/class.uiproject.inc.php
    trunk/property/inc/class.uiworkorder.inc.php

Modified: trunk/phpgwapi/templates/base/datatable_jquery.xsl
===================================================================
--- trunk/phpgwapi/templates/base/datatable_jquery.xsl  2016-02-17 09:14:32 UTC 
(rev 14746)
+++ trunk/phpgwapi/templates/base/datatable_jquery.xsl  2016-02-17 12:34:49 UTC 
(rev 14747)
@@ -489,7 +489,7 @@
                var columns = [
                <xsl:for-each select="//datatable/field">
                        {
-                       data:                   "<xsl:value-of select="key"/>",
+                       data: "<xsl:value-of select="key"/>",
                        <xsl:if test="className">
                                <xsl:choose>
                                        <xsl:when test="className='right' or 
className='center'">
@@ -531,10 +531,12 @@
                                return ret;
                                },
                        </xsl:if>
-                       <xsl:if test="dir">
-                               dir: "<xsl:value-of select="dir"/>",
-                       </xsl:if>
                        <xsl:choose>
+                               <xsl:when test="dir !=''">
+                                       dir: "<xsl:value-of select="dir"/>",
+                               </xsl:when>
+                       </xsl:choose>
+                       <xsl:choose>
                                <xsl:when test="editor">
                                        <xsl:if test="editor =0">
                                                editor: false,
@@ -580,6 +582,7 @@
                var initial_search = {"search": "<xsl:value-of 
select="query"/>" };
                var action_def = null;
                var contextMenuItems={};
+               var InitContextMenu=false
 
                <xsl:choose>
                        <xsl:when test="//datatable/actions">
@@ -818,6 +821,7 @@
                                if( typeof(action_def[i]['className']) != 
'undefined' && action_def[i]['className'] == 'record')
                                {
                                        contextMenuItems[i] = 
{name:action_def[i]['text'], callback:action_def[i]['action']};
+                                       InitContextMenu = true;
                                }
                        }
        ]]>
@@ -872,7 +876,7 @@
                        var order_def = [];
                        for(i=0;i < JqueryPortico.columns.length;i++)
                        {
-                               if (JqueryPortico.columns[i]['orderable'] === 
true)
+                               if (JqueryPortico.columns[i]['orderable'] === 
true && typeof(JqueryPortico.columns[i]['dir']) != 'undefined')
                                {
                                        var dir = 
JqueryPortico.columns[i]['dir'] || "desc";
                                        order_def.push([i, dir]);
@@ -890,7 +894,7 @@
                        {
                                var sDom_def = '<"clear">lfrtip';
                        }
-       
+
                $(document).ready(function() {
                        oTable = $('#datatable-container').dataTable({
                                paginate:               disablePagination ? 
false : true,
@@ -902,7 +906,7 @@
                                ajax:                   {
                                        url: ajax_url,
                                        data: {},
-                                                       type: 'POST'
+                                       type: 'POST'
                                },
                                fnServerParams: function ( aoData ) {
                                        if(typeof(aoData.order[0]) != 
'undefined')
@@ -992,15 +996,18 @@
                                        }
                           } );
 
-                       $('#datatable-container').contextMenu({
-                                 selector: 'tr',
-                                  items: contextMenuItems,
-                         });
+                       if(InitContextMenu === true)
+                       {
+                               $('#datatable-container').contextMenu({
+                                         selector: 'tr',
+                                          items: contextMenuItems,
+                               });
+                       }
 
-                         if(number_of_toolbar_items < 4)
-                         {
+                       if(number_of_toolbar_items < 4)
+                       {
                                $('#header1').prop("checked", true);
-                         }
+                       }
                });
        ]]>
 
@@ -1040,33 +1047,34 @@
                        <xsl:if test="type = 'filter'">
                                $('select#<xsl:value-of 
select="name"/>').change( function()
                                {
-                               <xsl:value-of select="extra"/>
-                               filterData('<xsl:value-of select="name"/>', 
$(this).val());
+                                       <xsl:value-of select="extra"/>
+                                       filterData('<xsl:value-of 
select="name"/>', $(this).val());
                                });
                        </xsl:if>
                        <xsl:if test="type = 'date-picker'">
                                var previous_<xsl:value-of select="id"/>;
                                $("#filter_<xsl:value-of 
select="id"/>").on('keyup change', function ()
                                {
-                               if ( $.trim($(this).val()) != 
$.trim(previous_<xsl:value-of select="id"/>) )
-                               {
-                               filterData('<xsl:value-of select="id"/>', 
$(this).val());
-                               previous_<xsl:value-of select="id"/> = 
$(this).val();
-                               }
+                                       if ( $.trim($(this).val()) != 
$.trim(previous_<xsl:value-of select="id"/>) )
+                                       {
+                                               filterData('<xsl:value-of 
select="id"/>', $(this).val());
+                                               previous_<xsl:value-of 
select="id"/> = $(this).val();
+                                       }
                                });
                        </xsl:if>
                        <xsl:if test="type = 'autocomplete'">
                                $(document).ready(function() {
-                               
$('input.ui-autocomplete-input#filter_<xsl:value-of 
select="name"/>_name').on('autocompleteselect', function(event, ui){
-                               filterData('filter_<xsl:value-of 
select="name"/>_id', ui.item.value);
+                                       
$('input.ui-autocomplete-input#filter_<xsl:value-of 
select="name"/>_name').on('autocompleteselect', function(event, ui){
+                                               
filterData('filter_<xsl:value-of select="name"/>_id', ui.item.value);
+                                       });
+                                       
$('input.ui-autocomplete-input#filter_<xsl:value-of 
select="name"/>_name').on('keyup', function(){
+                                               if ($(this).val() == '')
+                                               {
+                                                       
$('#filter_<xsl:value-of select="name"/>_id').val('');
+                                                       
filterData('filter_<xsl:value-of select="name"/>_id', $(this).val());
+                                               }
+                                       });
                                });
-                               
$('input.ui-autocomplete-input#filter_<xsl:value-of 
select="name"/>_name').on('keyup', function(){
-                               if ($(this).val() == ''){
-                               $('#filter_<xsl:value-of 
select="name"/>_id').val('');
-                               filterData('filter_<xsl:value-of 
select="name"/>_id', $(this).val());
-                               }
-                               });
-                               });
                        </xsl:if>
                </xsl:for-each>
        <![CDATA[

Modified: trunk/property/inc/class.bobudget.inc.php
===================================================================
--- trunk/property/inc/class.bobudget.inc.php   2016-02-17 09:14:32 UTC (rev 
14746)
+++ trunk/property/inc/class.bobudget.inc.php   2016-02-17 12:34:49 UTC (rev 
14747)
@@ -115,7 +115,7 @@
                        $this->month = isset($month) && $month ? $month : 0;
                        $this->details = $details;
 
-                       if (isset($year) && !$this->year == $year && 
!$GLOBALS['phpgw_info']['menuaction'] == 'property.uibudget.obligations')
+                       if (isset($year) && $this->year != $year && 
$GLOBALS['phpgw_info']['menuaction'] != 'property.uibudget.obligations')
                        {
                                $this->grouping = '';
                                $this->revision = '';

Modified: trunk/property/inc/class.bolocation.inc.php
===================================================================
--- trunk/property/inc/class.bolocation.inc.php 2016-02-17 09:14:32 UTC (rev 
14746)
+++ trunk/property/inc/class.bolocation.inc.php 2016-02-17 12:34:49 UTC (rev 
14747)
@@ -721,18 +721,6 @@
                function read( $data = array() )
                {
 //_debug_array($data);
-                       /* $type_id = isset($data['type_id']) && 
$data['type_id'] ? $data['type_id'] : $this->type_id;
-                         $allrows = isset($data['allrows']) && 
$data['allrows'] ? $data['allrows'] : $this->allrows;
-
-                         $locations = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
-                         'filter' => $this->filter,'cat_id' => 
$this->cat_id,'type_id' => $type_id,
-                         
'lookup_tenant'=>$data['lookup_tenant'],'lookup'=>$data['lookup'],
-                         'district_id'=>$this->district_id,'allrows'=>$allrows,
-                         
'status'=>$this->status,'part_of_town_id'=>$this->part_of_town_id,'dry_run'=>$data['dry_run'],
-                         'location_code' => $this->location_code, 
'filter_role_on_contact' => $data['filter_role_on_contact'], 'role_id' => 
$data['role_id'],
-                         'results' => $data['results'],'control_registered' => 
$data['control_registered'],
-                         'control_id' => $data['control_id'])); */
-
                        if ($data['lookup'] && $data['location_code'])
                        {
                                $data['query'] = $data['query'] ? 
$data['query'] : $data['location_code'];

Modified: trunk/property/inc/class.bolookup.inc.php
===================================================================
--- trunk/property/inc/class.bolookup.inc.php   2016-02-17 09:14:32 UTC (rev 
14746)
+++ trunk/property/inc/class.bolookup.inc.php   2016-02-17 12:34:49 UTC (rev 
14747)
@@ -252,7 +252,7 @@
                                        {
                                                if ($field['name'] == 
'member_of')
                                                {
-                                                       $filter[$field['name']] 
= phpgw::get_var('cat_id');
+                                                       $filter[$field['name']] 
= $this->cat_id;
                                                }
                                                else
                                                {

Modified: trunk/property/inc/class.soinvoice.inc.php
===================================================================
--- trunk/property/inc/class.soinvoice.inc.php  2016-02-17 09:14:32 UTC (rev 
14746)
+++ trunk/property/inc/class.soinvoice.inc.php  2016-02-17 12:34:49 UTC (rev 
14747)
@@ -1676,7 +1676,7 @@
                                                        $local_error = true;
                                                }
 
-                                               if 
(!($check_count['kostra_count'] == $values['invoice_count'][$n]))
+                                               if 
($check_count['kostra_count'] != $values['invoice_count'][$n])
                                                {
                                                        $receipt['error'][] = 
array('msg' => 'Tjenestekode mangler for undebilag: ' . " " . 
$values['voucher_id'][$n]);
                                                        $local_error = true;
@@ -1819,7 +1819,7 @@
                                                $transfer_sign_field = 
'utbetalingid=';
                                                $transfer_date_field = 
'utbetalingsigndato=';
 
-                                               if 
(!($values['num_days_orig'][$n] == $values['num_days'][$n]))
+                                               if 
($values['num_days_orig'][$n] != $values['num_days'][$n])
                                                {
                                                        $payment_date = 
date($this->db->date_format(), $values['timestamp_voucher_date'][$n] + (24 * 
3600 * $values['num_days'][$n]));
                                                        
$GLOBALS['phpgw']->db->query("UPDATE fm_ecobilag set forfallsdato= 
'$payment_date' where bilagsnr='$voucher_id'");
@@ -2053,19 +2053,19 @@
 
                                if ($global_check)
                                {
-                                       if (!($check_count['dima_count'] == 
$check_count['invoice_count']))
+                                       if ($check_count['dima_count'] != 
$check_count['invoice_count'])
                                        {
                                                
phpgwapi_cache::message_set(lang('Dima is missing from sub invoice in:') . " " 
. $data['voucher_id'], 'error');
                                                $local_error = true;
                                        }
 
-                                       if 
(!($check_count['spbudact_code_count'] == $check_count['invoice_count']))
+                                       if ($check_count['spbudact_code_count'] 
!= $check_count['invoice_count'])
                                        {
                                                
phpgwapi_cache::message_set(lang('Budget code is missing from sub invoice in 
:') . " " . $data['voucher_id'], 'error');
                                                $local_error = true;
                                        }
 
-                                       if (!($check_count['kostra_count'] == 
$check_count['invoice_count']))
+                                       if ($check_count['kostra_count'] != 
$check_count['invoice_count'])
                                        {
                                                
phpgwapi_cache::message_set('Tjenestekode mangler for undebilag: ' . " " . 
$data['voucher_id'], 'error');
                                                $local_error = true;

Modified: trunk/property/inc/class.soworkorder.inc.php
===================================================================
--- trunk/property/inc/class.soworkorder.inc.php        2016-02-17 09:14:32 UTC 
(rev 14746)
+++ trunk/property/inc/class.soworkorder.inc.php        2016-02-17 12:34:49 UTC 
(rev 14747)
@@ -2331,7 +2331,7 @@
                                }
 
                                //override if periode is closed
-                               if (!isset($active_period[$period]) || 
!$active_period[$period] == 1)
+                               if (!isset($active_period[$period]) || 
$active_period[$period] != 1)
                                {
                                        $_sum_oblications = 0;
                                }

Modified: trunk/property/inc/class.uientity.inc.php
===================================================================
--- trunk/property/inc/class.uientity.inc.php   2016-02-17 09:14:32 UTC (rev 
14746)
+++ trunk/property/inc/class.uientity.inc.php   2016-02-17 12:34:49 UTC (rev 
14747)
@@ -1087,11 +1087,9 @@
                                        'perm' => 1, 'acl_location' => 
$this->acl_location));
                        }
 
-                       $second_display = phpgw::get_var('second_display', 
'bool');
-
                        $default_district = 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['default_district'])
 ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['default_district'] : 
'');
 
-                       if ($default_district && !$second_display && 
!$this->district_id)
+                       if ($default_district && ! 
isset($_REQUEST['district_id']))
                        {
                                $this->bo->district_id = $default_district;
                                $this->district_id = $default_district;
@@ -1178,7 +1176,6 @@
                                'datatable' => array(
                                        'source' => self::link(array(
                                                'menuaction' => 
'property.uientity.index',
-                                               'second_display' => 
$second_display,
                                                'entity_id' => $this->entity_id,
                                                'cat_id' => $this->cat_id,
                                                'type' => $this->type,
@@ -1188,7 +1185,6 @@
                                        )),
                                        'download' => self::link(array(
                                                'menuaction' => 
'property.uientity.download',
-                                               'second_display' => 
$second_display,
                                                'entity_id' => $this->entity_id,
                                                'cat_id' => $this->cat_id,
                                                'type' => $this->type,

Modified: trunk/property/inc/class.uilocation.inc.php
===================================================================
--- trunk/property/inc/class.uilocation.inc.php 2016-02-17 09:14:32 UTC (rev 
14746)
+++ trunk/property/inc/class.uilocation.inc.php 2016-02-17 12:34:49 UTC (rev 
14747)
@@ -772,15 +772,20 @@
                                return;
                        }
 
-                       $second_display = phpgw::get_var('second_display', 
'bool');
+
                        $default_district = 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['default_district'])
 ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['default_district'] : 
'');
 
-                       if ($default_district && !$second_display && 
!$this->district_id)
+                       if ($default_district && ! 
isset($_REQUEST['district_id']))
                        {
                                $this->bo->district_id = $default_district;
                                $this->district_id = $default_district;
                        }
 
+                       if (phpgw::get_var('phpgw_return_as') == 'json')
+                       {
+                               return $this->query();
+                       }
+
                        $location_id = 
$GLOBALS['phpgw']->locations->get_id('property', $this->acl_location);
                        $custom_config = CreateObject('admin.soconfig', 
$location_id);
                        $_config = isset($custom_config->config_data) && 
$custom_config->config_data ? $custom_config->config_data : array();
@@ -876,10 +881,6 @@
                                }
                        }
 
-                       if (phpgw::get_var('phpgw_return_as') == 'json')
-                       {
-                               return $this->query();
-                       }
 
                        self::add_javascript('phpgwapi', 'jquery', 
'editable/jquery.jeditable.js');
                        self::add_javascript('phpgwapi', 'jquery', 
'editable/jquery.dataTables.editable.js');
@@ -1313,10 +1314,9 @@
                                return;
                        }
 
-                       $second_display = phpgw::get_var('second_display', 
'bool');
                        $default_district = 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['default_district'])
 ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['default_district'] : 
'');
 
-                       if ($default_district && !$second_display && 
!$this->district_id)
+                       if ($default_district && ! 
isset($_REQUEST['district_id']))
                        {
                                $this->bo->district_id = $default_district;
                                $this->district_id = $default_district;

Modified: trunk/property/inc/class.uilookup.inc.php
===================================================================
--- trunk/property/inc/class.uilookup.inc.php   2016-02-17 09:14:32 UTC (rev 
14746)
+++ trunk/property/inc/class.uilookup.inc.php   2016-02-17 12:34:49 UTC (rev 
14747)
@@ -158,7 +158,7 @@
 
                        $default_category = 
$GLOBALS['phpgw_info']['user']['preferences']['addressbook']['default_category'];
 
-                       if ($default_category && !$second_display)
+                       if ($default_category && !isset($_REQUEST['cat_id']))
                        {
                                $this->bo->cat_id = $default_category;
                                $this->cat_id = $default_category;
@@ -306,7 +306,7 @@
 
                        $default_category = 
$GLOBALS['phpgw_info']['user']['preferences']['addressbook']['default_category'];
 
-                       if ($default_category && !$second_display)
+                       if ($default_category && !isset($_REQUEST['cat_id']))
                        {
                                $this->bo->cat_id = $default_category;
                                $this->cat_id = $default_category;
@@ -410,7 +410,7 @@
                {
                        $default_category = 
$GLOBALS['phpgw_info']['user']['preferences']['property']['default_vendor_category'];
 
-                       if ($default_category)
+                       if ($default_category && !isset($_REQUEST['cat_id']))
                        {
                                $this->bo->cat_id = $default_category;
                                $this->cat_id = $default_category;
@@ -517,7 +517,9 @@
                                'name' => array('id', 'org_name', 'status'),
                                'formatter' => array('', '', ''),
                                'descr' => array(lang('ID'), lang('Name'), 
lang('status')),
-                               'sortable' => array(true, true, false)
+                               'sortable' => array(true, true, false),
+                               'dir' => array(false, "asc", false)
+
                        );
 
                        $count_uicols_name = count($uicols['name']);
@@ -528,7 +530,8 @@
                                        'key' => $uicols['name'][$k],
                                        'label' => $uicols['descr'][$k],
                                        'sortable' => $uicols['sortable'][$k],
-                                       'hidden' => false
+                                       'hidden' => false,
+                                       'dir' => $uicols['dir'][$k] ? 
$uicols['dir'][$k] : '',
                                );
 
                                array_push($data['datatable']['field'], 
$params);
@@ -958,10 +961,9 @@
                        $this->location_code = $boentity->location_code;
                        $this->criteria_id = $boentity->criteria_id;
 
-                       $second_display = phpgw::get_var('second_display', 
'bool');
                        $default_district = 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['default_district'])
 ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['default_district'] : 
'');
 
-                       if ($default_district && !$second_display && 
!$this->district_id)
+                       if ($default_district && ! 
isset($_REQUEST['district_id']))
                        {
                                $this->bo->district_id = $default_district;
                                $this->district_id = $default_district;
@@ -1044,7 +1046,6 @@
                                                'container' => 
'datatable-container',
                                                'requestUrl' => 
self::link(array(
                                                        'menuaction' => 
'property.uilookup.entity',
-                                                       'second_display' => 
$second_display,
                                                        'cat_id' => 
$this->cat_id,
                                                        'entity_id' => 
$this->entity_id,
                                                        'district_id' => 
$this->district_id,

Modified: trunk/property/inc/class.uiproject.inc.php
===================================================================
--- trunk/property/inc/class.uiproject.inc.php  2016-02-17 09:14:32 UTC (rev 
14746)
+++ trunk/property/inc/class.uiproject.inc.php  2016-02-17 12:34:49 UTC (rev 
14747)
@@ -238,7 +238,7 @@
                        $values_combo_box[2] = array();
                        foreach ($_cats as $_cat)
                        {
-                               if ($_cat['level'] == 0 && !$_cat['active'] == 
2)
+                               if ($_cat['level'] == 0 && $_cat['active'] != 2)
                                {
                                        $values_combo_box[2][] = $_cat;
                                }
@@ -332,10 +332,9 @@
                        $lookup = phpgw::get_var('lookup', 'bool');
                        $from = phpgw::get_var('from');
 
-                       $second_display = phpgw::get_var('second_display', 
'bool');
                        $default_district = 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['default_district'])
 ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['default_district'] : 
'');
 
-                       if ($default_district && !$second_display && 
!$this->district_id)
+                       if ($default_district && ! 
isset($_REQUEST['district_id']))
                        {
                                $this->bo->district_id = $default_district;
                                $this->district_id = $default_district;

Modified: trunk/property/inc/class.uiworkorder.inc.php
===================================================================
--- trunk/property/inc/class.uiworkorder.inc.php        2016-02-17 09:14:32 UTC 
(rev 14746)
+++ trunk/property/inc/class.uiworkorder.inc.php        2016-02-17 12:34:49 UTC 
(rev 14747)
@@ -381,10 +381,9 @@
 
                        $lookup = '';
 
-                       $second_display = phpgw::get_var('second_display', 
'bool');
                        $default_district = 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['default_district'])
 ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['default_district'] : 
'');
 
-                       if ($default_district && !$second_display && 
!$this->district_id)
+                       if ($default_district && ! 
isset($_REQUEST['district_id']))
                        {
                                $this->bo->district_id = $default_district;
                                $this->district_id = $default_district;
@@ -1035,7 +1034,7 @@
                                if (isset($receipt['notice_owner']) && 
is_array($receipt['notice_owner']) && $config->config_data['mailnotification'])
 //                                             && 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['notify_project_owner'])
 && 
$GLOBALS['phpgw_info']['user']['preferences']['property']['notify_project_owner'])
                                {
-                                       if (!$this->account == 
$project['coordinator'] && $config->config_data['notify_project_owner'])
+                                       if ($this->account != 
$project['coordinator'] && $config->config_data['notify_project_owner'])
                                        {
                                                $prefs_coordinator = 
$this->bocommon->create_preferences('property', $project['coordinator']);
                                                if 
(isset($prefs_coordinator['email']) && $prefs_coordinator['email'])




reply via email to

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