fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [14705] interlink


From: Sigurd Nes
Subject: [Fmsystem-commits] [14705] interlink
Date: Sun, 07 Feb 2016 15:57:26 +0000

Revision: 14705
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14705
Author:   sigurdne
Date:     2016-02-07 15:57:26 +0000 (Sun, 07 Feb 2016)
Log Message:
-----------
interlink

Modified Paths:
--------------
    branches/dev-syncromind/phpgwapi/js/jquery/common.js
    branches/dev-syncromind/phpgwapi/templates/base/datatable_jquery.xsl
    branches/dev-syncromind/property/inc/class.bocommon.inc.php
    branches/dev-syncromind/property/inc/class.boentity.inc.php
    branches/dev-syncromind/property/inc/class.boproject.inc.php
    branches/dev-syncromind/property/inc/class.borequest.inc.php
    branches/dev-syncromind/property/inc/class.soentity.inc.php
    branches/dev-syncromind/property/inc/class.uiagreement.inc.php
    branches/dev-syncromind/property/inc/class.uicondition_survey.inc.php
    branches/dev-syncromind/property/inc/class.uidocument2.inc.php
    branches/dev-syncromind/property/inc/class.uientity.inc.php
    branches/dev-syncromind/property/inc/class.uigeneric.inc.php
    branches/dev-syncromind/property/inc/class.uilocation.inc.php
    branches/dev-syncromind/property/inc/class.uilookup.inc.php
    branches/dev-syncromind/property/inc/class.uiproject.inc.php
    branches/dev-syncromind/property/inc/class.uirequest.inc.php
    branches/dev-syncromind/property/inc/class.uitts.inc.php
    branches/dev-syncromind/property/inc/class.uiworkorder.inc.php
    branches/dev-syncromind/property/templates/base/entity.xsl
    branches/dev-syncromind/property/templates/base/lookup.entity.xsl
    branches/dev-syncromind/property/templates/base/project.xsl

Modified: branches/dev-syncromind/phpgwapi/js/jquery/common.js
===================================================================
--- branches/dev-syncromind/phpgwapi/js/jquery/common.js        2016-02-06 
16:40:30 UTC (rev 14704)
+++ branches/dev-syncromind/phpgwapi/js/jquery/common.js        2016-02-07 
15:57:26 UTC (rev 14705)
@@ -220,6 +220,7 @@
        var singleSelect = options['singleSelect'] || false;
        var order = options['order'] || [0, 'desc'];
        var responsive = options['responsive'] || false;
+       var initial_search = options['initial_search'] || false;
 
        var lengthMenu = null;
        try
@@ -321,7 +322,8 @@
                        }
                },
                sDom: sDom_def,
-               buttons: buttons_def
+               buttons: buttons_def,
+               search: initial_search
        });
        $("#" + container + ' tbody').on( 'click', 'tr', function () {
                        var api = oTable.api();

Modified: branches/dev-syncromind/phpgwapi/templates/base/datatable_jquery.xsl
===================================================================
--- branches/dev-syncromind/phpgwapi/templates/base/datatable_jquery.xsl        
2016-02-06 16:40:30 UTC (rev 14704)
+++ branches/dev-syncromind/phpgwapi/templates/base/datatable_jquery.xsl        
2016-02-07 15:57:26 UTC (rev 14705)
@@ -570,7 +570,9 @@
                var editor_action = '<xsl:value-of select="editor_action"/>';
                var disablePagination = '<xsl:value-of 
select="disablePagination"/>';
                var select_all = '<xsl:value-of select="select_all"/>';
+               var initial_search = {"search": "<xsl:value-of 
select="query"/>" };
 
+
                <xsl:choose>
                        <xsl:when test="//datatable/actions">
                                var button_def = [
@@ -941,6 +943,7 @@
                                                stateSave: true,
                                                stateDuration: -1, 
//sessionstorage
                                                tabIndex: 1,
+                                               "search": initial_search,
                                                buttons: JqueryPortico.buttons
                                        });
 

Modified: branches/dev-syncromind/property/inc/class.bocommon.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.bocommon.inc.php 2016-02-06 
16:40:30 UTC (rev 14704)
+++ branches/dev-syncromind/property/inc/class.bocommon.inc.php 2016-02-07 
15:57:26 UTC (rev 14705)
@@ -2129,6 +2129,7 @@
                                }
                        }
 
+                       $values['extra'] = isset($values['extra']) && 
$values['extra'] ? $values['extra'] : array();
                        $values['street_name'] = phpgw::get_var('street_name');
                        $values['street_number'] = 
phpgw::get_var('street_number');
                        if(isset($values['location']) && 
is_array($values['location']))
@@ -2136,7 +2137,43 @@
                                $values['location_name'] = phpgw::get_var('loc' 
. (count($values['location'])) . '_name', 'string', 'POST'); // if not address 
- get the parent name as address
                                $values['location_code'] = implode('-', 
$values['location']);
                        }
+                       if($values['location_code'])
+                       {
+                               $bolocation = 
CreateObject('property.bolocation');
+                               $values['location_data'] = 
$bolocation->read_single($values['location_code'], 
array_merge($values['extra'],array('view' => true)));
+                       }
 
+                       $origin         = isset($values['origin']) && 
$values['origin'] ? $values['origin'] : false;
+                       $origin_id              = isset($values['origin_id']) 
&& $values['origin_id'] ? $values['origin_id'] : false;
+
+                       if($origin == '.ticket' && $origin_id && 
!$values['descr'])
+                       {
+                               $boticket= CreateObject('property.botts');
+                               $ticket = $boticket->read_single($origin_id);
+                               $values['descr'] = $ticket['details'];
+                               $values['name'] = $ticket['subject'] ? 
$ticket['subject'] : $ticket['category_name'];
+                               $ticket_notes = 
$boticket->read_additional_notes($origin_id);
+                               $i = count($ticket_notes)-1;
+                               if(isset($ticket_notes[$i]['value_note']) && 
$ticket_notes[$i]['value_note'])
+                               {
+                                       $values['descr'] .= ": " . 
$ticket_notes[$i]['value_note'];
+                               }
+                               $values['contact_id'] = $ticket['contact_id'];
+                       }
+
+                       if(isset($origin) && $origin)
+                       {
+                               $interlink      = 
CreateObject('property.interlink');
+                               $values['origin_data'] = array(
+                                       'location'      => $origin,
+                                       'descr'         => 
$interlink->get_location_name($origin),
+                                       'data'          => array(
+                                                       'id'    => $origin_id,
+                                                       'link'  => 
$interlink->get_relation_link(array('location' => $origin), $origin_id)
+                                               )
+                               );
+                       }
+
                        return $values;
                }
 

Modified: branches/dev-syncromind/property/inc/class.boentity.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.boentity.inc.php 2016-02-06 
16:40:30 UTC (rev 14704)
+++ branches/dev-syncromind/property/inc/class.boentity.inc.php 2016-02-07 
15:57:26 UTC (rev 14705)
@@ -711,7 +711,7 @@
                        }
 
                        $interlink = CreateObject('property.interlink');
-                       $values['origin'] = 
$interlink->get_relation($this->type_app[$this->type], 
".{$this->type}.{$data['entity_id']}.{$data['cat_id']}", $data['id'], 'origin');
+                       $values['origin_data'] = 
$interlink->get_relation($this->type_app[$this->type], 
".{$this->type}.{$data['entity_id']}.{$data['cat_id']}", $data['id'], 'origin');
                        $values['target'] = 
$interlink->get_relation($this->type_app[$this->type], 
".{$this->type}.{$data['entity_id']}.{$data['cat_id']}", $data['id'], 'target');
                        return $values;
                }

Modified: branches/dev-syncromind/property/inc/class.boproject.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.boproject.inc.php        
2016-02-06 16:40:30 UTC (rev 14704)
+++ branches/dev-syncromind/property/inc/class.boproject.inc.php        
2016-02-07 15:57:26 UTC (rev 14705)
@@ -635,7 +635,7 @@
                                
$values['p'][$values['p_entity_id']]['p_cat_name'] = $category['name'];
                        }
 
-                       $values['origin'] = 
$this->interlink->get_relation('property', '.project', $project_id, 'origin');
+                       $values['origin_data'] = 
$this->interlink->get_relation('property', '.project', $project_id, 'origin');
                        $values['target'] = 
$this->interlink->get_relation('property', '.project', $project_id, 'target');
 
                        //_debug_array($values);

Modified: branches/dev-syncromind/property/inc/class.borequest.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.borequest.inc.php        
2016-02-06 16:40:30 UTC (rev 14704)
+++ branches/dev-syncromind/property/inc/class.borequest.inc.php        
2016-02-07 15:57:26 UTC (rev 14705)
@@ -663,7 +663,7 @@
                        }
 
                        $interlink = CreateObject('property.interlink');
-                       $values['origin'] = 
$interlink->get_relation('property', '.project.request', $request_id, 'origin');
+                       $values['origin_data'] = 
$interlink->get_relation('property', '.project.request', $request_id, 'origin');
                        $values['target'] = 
$interlink->get_relation('property', '.project.request', $request_id, 'target');
 
                        return $values;

Modified: branches/dev-syncromind/property/inc/class.soentity.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.soentity.inc.php 2016-02-06 
16:40:30 UTC (rev 14704)
+++ branches/dev-syncromind/property/inc/class.soentity.inc.php 2016-02-07 
15:57:26 UTC (rev 14705)
@@ -2192,14 +2192,12 @@
                                . 
$this->db->validate_insert(array_values($values_insert)) . ')', __LINE__, 
__FILE__);
                        }
 
-                       if(isset($values['origin']) && 
is_array($values['origin']))
+                       if(isset($values['origin_id']) &&$values['origin_id'])
                        {
-                               if($values['origin'][0]['data'][0]['id'])
-                               {
                                        $interlink_data = array
                                                (
-                                               'location1_id' => 
$GLOBALS['phpgw']->locations->get_id('property', 
$values['origin'][0]['location']),
-                                               'location1_item_id' => 
$values['origin'][0]['data'][0]['id'],
+                                               'location1_id' => 
$GLOBALS['phpgw']->locations->get_id('property', $values['origin']),
+                                               'location1_item_id' => 
$values['origin_id'],
                                                'location2_id' => 
$GLOBALS['phpgw']->locations->get_id($this->type_app[$this->type], 
".{$this->type}.{$entity_id}.{$cat_id}"),
                                                'location2_item_id' => 
$values['id'],
                                                'account_id' => $this->account
@@ -2207,7 +2205,7 @@
 
                                        $interlink = 
CreateObject('property.interlink');
                                        $interlink->add($interlink_data, 
$this->db);
-                               }
+
                        }
 
                        if(isset($history_set) AND is_array($history_set))

Modified: branches/dev-syncromind/property/inc/class.uiagreement.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.uiagreement.inc.php      
2016-02-06 16:40:30 UTC (rev 14704)
+++ branches/dev-syncromind/property/inc/class.uiagreement.inc.php      
2016-02-07 15:57:26 UTC (rev 14705)
@@ -995,7 +995,7 @@
                                        'perm' => $mode, 'acl_location' => 
$this->acl_location));
                        }
 
-                       $id = phpgw::get_var('id', 'int');
+                       $id = isset($values['id']) && $values['id'] ? 
$values['id'] : phpgw::get_var('id', 'int');
                        $values = phpgw::get_var('values');
 
                        $delete_item = phpgw::get_var('delete_item', 'bool');

Modified: branches/dev-syncromind/property/inc/class.uicondition_survey.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.uicondition_survey.inc.php       
2016-02-06 16:40:30 UTC (rev 14704)
+++ branches/dev-syncromind/property/inc/class.uicondition_survey.inc.php       
2016-02-07 15:57:26 UTC (rev 14705)
@@ -344,7 +344,7 @@
                 */
                public function edit($values = array(), $mode = 'edit')
                {
-                       $id = (int)phpgw::get_var('id');
+                       $id = isset($values['id']) && $values['id'] ? 
$values['id'] : phpgw::get_var('id', 'int');
 
                        if(!$this->acl_add && !$this->acl_edit)
                        {

Modified: branches/dev-syncromind/property/inc/class.uidocument2.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.uidocument2.inc.php      
2016-02-06 16:40:30 UTC (rev 14704)
+++ branches/dev-syncromind/property/inc/class.uidocument2.inc.php      
2016-02-07 15:57:26 UTC (rev 14705)
@@ -337,7 +337,7 @@
                 */
                public function edit($values = array(), $mode = 'edit')
                {
-                       $id = (int)phpgw::get_var('id');
+                       $id = isset($values['id']) && $values['id'] ? 
$values['id'] : phpgw::get_var('id', 'int');
 
                        if(!$this->acl_add && !$this->acl_edit)
                        {

Modified: branches/dev-syncromind/property/inc/class.uientity.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.uientity.inc.php 2016-02-06 
16:40:30 UTC (rev 14704)
+++ branches/dev-syncromind/property/inc/class.uientity.inc.php 2016-02-07 
15:57:26 UTC (rev 14705)
@@ -179,11 +179,9 @@
 
                        if(isset($origin) && $origin)
                        {
-                               unset($values['origin']);
-                               unset($values['origin_id']);
-                               $values['origin'][0]['location'] = $origin;
-                               $values['origin'][0]['descr'] = 
$interlink->get_location_name($origin);
-                               $values['origin'][0]['data'][] = array(
+                               $values['origin_data'][0]['location'] = $origin;
+                               $values['origin_data'][0]['descr'] = 
$interlink->get_location_name($origin);
+                               $values['origin_data'][0]['data'][] = array(
                                        'id' => $origin_id,
                                        'link' => 
$interlink->get_relation_link(array('location' => $origin), $origin_id),
                                );
@@ -1449,7 +1447,7 @@
 
                function edit($values = array(), $mode = 'edit')
                {
-                       $id = phpgw::get_var('id', 'int');
+                       $id = isset($values['id']) && $values['id'] ? 
$values['id'] : phpgw::get_var('id', 'int');
                        $_lean = phpgw::get_var('lean', 'bool');
 
                        if($mode == 'edit' && (!$this->acl_add && 
!$this->acl_edit))
@@ -2108,6 +2106,7 @@
                                                        'my_name' => 'add',
                                                        'text' => lang('add'),
                                                        'type' => 'custom',
+                                                       'className' => 'add',
                                                        'custom_code' => "
                                                                                
add_control();"
                                                ),
@@ -2245,7 +2244,7 @@
                                . "_entity_id:'{$this->entity_id}',"
                                . "_cat_id:'{$this->cat_id}',"
                                . "_type:'{$this->type}'}",
-                               'value_origin' => isset($values['origin']) ? 
$values['origin'] : '',
+                               'value_origin' => isset($values['origin_data']) 
? $values['origin_data'] : '',
                                'value_origin_type' => isset($origin) ? $origin 
: '',
                                'value_origin_id' => isset($origin_id) ? 
$origin_id : '',
                                'lang_no_cat' => lang('no category'),

Modified: branches/dev-syncromind/property/inc/class.uigeneric.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.uigeneric.inc.php        
2016-02-06 16:40:30 UTC (rev 14704)
+++ branches/dev-syncromind/property/inc/class.uigeneric.inc.php        
2016-02-07 15:57:26 UTC (rev 14705)
@@ -534,7 +534,7 @@
                                return;
                        }
 
-                       $id = 
phpgw::get_var($this->location_info['id']['name']);
+                       $id = isset($values['id']) && $values['id'] ? 
$values['id'] : phpgw::get_var($this->location_info['id']['name']);
                        $values_attribute = phpgw::get_var('values_attribute');
 
                        $GLOBALS['phpgw_info']['apps']['manual']['section'] = 
'general.edit.' . $this->type;

Modified: branches/dev-syncromind/property/inc/class.uilocation.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.uilocation.inc.php       
2016-02-06 16:40:30 UTC (rev 14704)
+++ branches/dev-syncromind/property/inc/class.uilocation.inc.php       
2016-02-07 15:57:26 UTC (rev 14705)
@@ -896,6 +896,11 @@
                                $function_msg = $lookup_list[$lookup_name];
                                // for POP-UPs
                                $input_name = 
phpgwapi_cache::session_get('property', 'lookup_fields');
+                               $input_name_entity = 
phpgwapi_cache::session_get('property', 'lookup_fields_entity');
+                               $input_name = $input_name ? $input_name : 
array();
+                               $input_name_entity = $input_name_entity ? 
$input_name_entity : array();
+
+                               $input_name = array_merge($input_name, 
$input_name_entity);
                                //$input_name = array();
                                $function_exchange_values = <<<JS
 
@@ -1620,7 +1625,7 @@
 
                        //$get_history          = phpgw::get_var('get_history', 
'bool', 'POST');
                        $lookup_tenant = phpgw::get_var('lookup_tenant', 
'bool');
-                       $location_code = phpgw::get_var('location_code');
+                       $location_code = isset($values['location_code']) && 
$values['location_code'] ? $values['location_code'] : 
phpgw::get_var('location_code');
                        $sibling = phpgw::get_var('sibling');
                        $parent = phpgw::get_var('parent');
                        $values_attribute = phpgw::get_var('values_attribute');

Modified: branches/dev-syncromind/property/inc/class.uilookup.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.uilookup.inc.php 2016-02-06 
16:40:30 UTC (rev 14704)
+++ branches/dev-syncromind/property/inc/class.uilookup.inc.php 2016-02-07 
15:57:26 UTC (rev 14705)
@@ -1103,6 +1103,7 @@
                                        )),
                                        'allrows' => true,
                                        'editor_action' => '',
+                                       'query'                 => 
$this->location_code,
                                        'field' => array()
                                )
                        );

Modified: branches/dev-syncromind/property/inc/class.uiproject.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.uiproject.inc.php        
2016-02-06 16:40:30 UTC (rev 14704)
+++ branches/dev-syncromind/property/inc/class.uiproject.inc.php        
2016-02-07 15:57:26 UTC (rev 14705)
@@ -946,7 +946,6 @@
                        $config->read();
 
                        $values = $this->_populate();
-
                        if($id)
                        {
                                $action = 'edit';
@@ -1251,11 +1250,9 @@
                                if(isset($origin) && $origin)
                                {
                                        $interlink      = 
CreateObject('property.interlink');
-                                       unset($values['origin']);
-                                       unset($values['origin_id']);
-                                       $values['origin'][0]['location']= 
$origin;
-                                       $values['origin'][0]['descr']= 
$interlink->get_location_name($origin);
-                                       $values['origin'][0]['data'][]= array(
+                                       $values['origin_data'][0]['location']= 
$origin;
+                                       $values['origin_data'][0]['descr']= 
$interlink->get_location_name($origin);
+                                       $values['origin_data'][0]['data'][]= 
array(
                                                'id'    => $origin_id,
                                                'link'  => 
$interlink->get_relation_link(array('location' => $origin), $origin_id),
                                        );
@@ -1866,9 +1863,9 @@
 
                        $lang_delete_request_statustext = lang('Check to delete 
this request from this project');
                        $_origin = array();
-                       if(isset($values['origin']) && $values['origin'])
+                       if(isset($values['origin_data']) && 
$values['origin_data'])
                        {
-                               foreach($values['origin'] as $__origin)
+                               foreach($values['origin_data'] as $__origin)
                                {
                                        foreach($__origin['data'] as 
$_origin_data)
                                        {
@@ -1980,7 +1977,7 @@
                                'tabs' => self::_generate_tabs($tabs, 
$active_tab, array('documents' => $id ? false : true,
                                        'history' => $id ? false : true)),
                                'msgbox_data' => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'value_origin' => isset($values['origin']) ? 
$values['origin'] : '',
+                               'value_origin' => isset($values['origin_data']) 
? $values['origin_data'] : '',
                                'value_origin_type' => isset($origin) ? $origin 
: '',
                                'value_origin_id' => isset($origin_id) ? 
$origin_id : '',
                                'year_list' => array('options' => $year_list),
@@ -2012,7 +2009,7 @@
                                'lang_power_meter' => lang('Power meter'),
                                'lang_power_meter_statustext' => lang('Enter 
the power meter'),
                                'value_power_meter' => 
isset($values['power_meter']) ? $values['power_meter'] : '',
-                               'value_budget' => isset($values['budget']) ? 
$values['budget'] : '',
+                               'value_budget' => isset($values['budget']) && 
$this->receipt['error'] ? $values['budget'] : '',
                                'lang_reserve' => lang('reserve'),
                                'value_reserve' => isset($values['reserve']) ? 
$values['reserve'] : '',
                                'lang_reserve_statustext' => lang('Enter the 
reserve'),

Modified: branches/dev-syncromind/property/inc/class.uirequest.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.uirequest.inc.php        
2016-02-06 16:40:30 UTC (rev 14704)
+++ branches/dev-syncromind/property/inc/class.uirequest.inc.php        
2016-02-07 15:57:26 UTC (rev 14705)
@@ -1060,8 +1060,8 @@
                                                'p_entity_id' => 
$values['p_entity_id'],
                                                'p_cat_id' => 
$values['p_cat_id'],
                                                'p_num' => $values['p_num'],
-                                               'origin' => 
isset($values['origin'][0]) ? $values['origin'][0]['location'] : '',
-                                               'origin_id' => 
isset($values['origin'][0]) ? $values['origin'][0]['data'][0]['id'] : ''
+                                               'origin' => 
isset($values['origin_data'][0]) ? $values['origin_data'][0]['location'] : '',
+                                               'origin_id' => 
isset($values['origin_data'][0]) ? $values['origin_data'][0]['data'][0]['id'] : 
''
                                        )
                                        );
                                }
@@ -1163,11 +1163,9 @@
 
                        if(isset($origin) && $origin)
                        {
-                               unset($values['origin']);
-                               unset($values['origin_id']);
-                               $values['origin'][0]['location'] = $origin;
-                               $values['origin'][0]['descr'] = 
$interlink->get_location_name($origin);
-                               $values['origin'][0]['data'][] = array(
+                               $values['origin_data'][0]['location'] = $origin;
+                               $values['origin_data'][0]['descr'] = 
$interlink->get_location_name($origin);
+                               $values['origin_data'][0]['data'][] = array(
                                        'id' => $origin_id,
                                        'link' => 
$interlink->get_relation_link(array('location' => $origin), $origin_id),
                                );
@@ -1478,7 +1476,7 @@
                                'msgbox_data' => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'value_acl_location' => $this->acl_location,
                                'value_target' => $values['target'],
-                               'value_origin' => $values['origin'],
+                               'value_origin' => $values['origin_data'],
                                'value_origin_type' => $origin,
                                'value_origin_id' => $origin_id,
                                'lang_origin_statustext' => lang('Link to the 
origin for this request'),

Modified: branches/dev-syncromind/property/inc/class.uitts.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.uitts.inc.php    2016-02-06 
16:40:30 UTC (rev 14704)
+++ branches/dev-syncromind/property/inc/class.uitts.inc.php    2016-02-07 
15:57:26 UTC (rev 14705)
@@ -1097,11 +1097,9 @@
 
                        if(isset($origin) && $origin)
                        {
-                               unset($values['origin']);
-                               unset($values['origin_id']);
-                               $values['origin'][0]['location'] = $origin;
-                               $values['origin'][0]['descr'] = 
$interlink->get_location_name($origin);
-                               $values['origin'][0]['data'][] = array
+                               $values['origin_data'][0]['location'] = $origin;
+                               $values['origin_data'][0]['descr'] = 
$interlink->get_location_name($origin);
+                               $values['origin_data'][0]['data'][] = array
                                        (
                                        'id' => $origin_id,
                                        'link' => 
$interlink->get_relation_link(array('location' => $origin), $origin_id),
@@ -1370,7 +1368,7 @@
                                'contact_data' => $contact_data,
                                'simple' => $this->simple,
                                'show_finnish_date' => $this->show_finnish_date,
-                               'value_origin' => isset($values['origin']) ? 
$values['origin'] : '',
+                               'value_origin' => isset($values['origin_data']) 
? $values['origin_data'] : '',
                                'value_origin_type' => (isset($origin) ? 
$origin : ''),
                                'value_origin_id' => (isset($origin_id) ? 
$origin_id : ''),
                                'msgbox_data' => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),

Modified: branches/dev-syncromind/property/inc/class.uiworkorder.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.uiworkorder.inc.php      
2016-02-06 16:40:30 UTC (rev 14704)
+++ branches/dev-syncromind/property/inc/class.uiworkorder.inc.php      
2016-02-07 15:57:26 UTC (rev 14705)
@@ -686,11 +686,9 @@
                        $interlink = & $this->bo->interlink;
                        if(isset($origin) && $origin)
                        {
-                               unset($values['origin']);
-                               unset($values['origin_id']);
-                               $values['origin'][0]['location'] = $origin;
-                               $values['origin'][0]['descr'] = 
$interlink->get_location_name($origin);
-                               $values['origin'][0]['data'][] = array
+                               $values['origin_data'][0]['location'] = $origin;
+                               $values['origin_data'][0]['descr'] = 
$interlink->get_location_name($origin);
+                               $values['origin_data'][0]['data'][] = array
                                        (
                                        'id' => $origin_id,
                                        'link' => 
$interlink->get_relation_link(array('location' => $origin), $origin_id),
@@ -1120,7 +1118,8 @@
 
                        $_lean = phpgw::get_var('lean', 'bool');
 
-                       $id = phpgw::get_var('id'); // in case of bigint
+                        // in case of bigint
+                       $id = isset($values['id']) && $values['id'] ? 
$values['id'] : phpgw::get_var('id');
 
                        if($mode == 'edit' && (!$this->acl_add && 
!$this->acl_edit))
                        {
@@ -1973,7 +1972,7 @@
                                'tabs' => self::_generate_tabs(array(), 
$active_tab, array('documents' => $id ? false : true,
                                        'history' => $id ? false : true)),
                                'msgbox_data' => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'value_origin' => isset($values['origin']) ? 
$values['origin'] : '',
+                               'value_origin' => isset($values['origin_data']) 
? $values['origin_data'] : '',
                                'value_origin_type' => isset($origin) ? $origin 
: '',
                                'value_origin_id' => isset($origin_id) ? 
$origin_id : '',
                                'lang_calculate' => lang('Calculate Workorder'),

Modified: branches/dev-syncromind/property/templates/base/entity.xsl
===================================================================
--- branches/dev-syncromind/property/templates/base/entity.xsl  2016-02-06 
16:40:30 UTC (rev 14704)
+++ branches/dev-syncromind/property/templates/base/entity.xsl  2016-02-07 
15:57:26 UTC (rev 14705)
@@ -350,17 +350,18 @@
                                                </tr>
                                        </xsl:when>
                                </xsl:choose>
-                               <xsl:choose>
-                                       <xsl:when test="mode = 'edit'">
+                               <xsl:if test="cat_list=''">
+                                       <xsl:if test="mode = 'edit'">
                                                <tr>
                                                        <td colspan="2" 
align="center">
                                                                
<xsl:call-template name="table_apply">
                                                                        
<xsl:with-param name="lean" select="lean"/>
+                                                                       
<xsl:with-param name="cat_list" select="cat_list"/>
                                                                
</xsl:call-template>
                                                        </td>
                                                </tr>
-                                       </xsl:when>
-                               </xsl:choose>
+                                       </xsl:if>
+                               </xsl:if>
                        </table>
                        <table cellpadding="2" cellspacing="2" width="80%" 
align="center">
                                <xsl:for-each select="origin_list">
@@ -826,6 +827,7 @@
                                <xsl:when test="mode = 'edit'">
                                        <xsl:call-template name="table_apply">
                                                <xsl:with-param name="lean" 
select="lean"/>
+                                               <xsl:with-param name="cat_list" 
select="cat_list"/>                             
                                        </xsl:call-template>
                                </xsl:when>
                        </xsl:choose>
@@ -900,51 +902,50 @@
 <!-- New template-->
 <xsl:template xmlns:php="http://php.net/xsl"; name="table_apply">
        <xsl:param name="lean" />
-               
-       <div class="proplist-col">
-               <table>
-                       <tr>
-                               <xsl:choose>
-                                       <xsl:when test="$lean!=1">
-                                               <td valign="bottom">
-                                                       <xsl:variable 
name="lang_save">
-                                                               <xsl:value-of 
select="php:function('lang', 'save')"/>
-                                                       </xsl:variable>
-                                                       <input type="submit" 
class="pure-button pure-button-primary" name="values[save]" 
value="{$lang_save}">
-                                                               <xsl:attribute 
name="title">
-                                                                       
<xsl:value-of select="php:function('lang', 'save values and exit')"/>
-                                                               </xsl:attribute>
-                                                       </input>
-                                               </td>
-                                       </xsl:when>
-                               </xsl:choose>
-                               <td valign="bottom">
-                                       <xsl:variable name="lang_apply">
-                                               <xsl:value-of 
select="php:function('lang', 'apply')"/>
-                                       </xsl:variable>
-                                       <input type="submit" class="pure-button 
pure-button-primary" name="values[apply]" value="{$lang_apply}">
-                                               <xsl:attribute name="title">
-                                                       <xsl:value-of 
select="php:function('lang', 'save and stay in form')"/>
-                                               </xsl:attribute>
-                                       </input>
-                               </td>
-                               <xsl:choose>
-                                       <xsl:when test="$lean!=1">
-                                               <td align="right" 
valign="bottom">
-                                                       <xsl:variable 
name="lang_cancel">
-                                                               <xsl:value-of 
select="php:function('lang', 'cancel')"/>
-                                                       </xsl:variable>
-                                                       <input type="button" 
class="pure-button pure-button-primary" name="values[cancel]" 
value="{$lang_cancel}" onMouseout="window.status='';return true;" 
onClick="document.cancel_form.submit();">
-                                                               <xsl:attribute 
name="title">
-                                                                       
<xsl:value-of select="php:function('lang', 'Back to the list')"/>
-                                                               </xsl:attribute>
-                                                       </input>
-                                               </td>
-                                       </xsl:when>
-                               </xsl:choose>
-                       </tr>
-               </table>
-       </div>
+       <xsl:param name="cat_list" />
+               <div class="proplist-col">
+                       <table>
+                               <tr>
+                                       <xsl:if test="$cat_list =''">
+                                               <xsl:if test="$lean!=1">
+                                                       <td valign="bottom">
+                                                               <xsl:variable 
name="lang_save">
+                                                                       
<xsl:value-of select="php:function('lang', 'save')"/>
+                                                               </xsl:variable>
+                                                               <input 
type="submit" class="pure-button pure-button-primary" name="values[save]" 
value="{$lang_save}">
+                                                                       
<xsl:attribute name="title">
+                                                                               
<xsl:value-of select="php:function('lang', 'save values and exit')"/>
+                                                                       
</xsl:attribute>
+                                                               </input>
+                                                       </td>
+                                               </xsl:if>
+                                       </xsl:if>
+                                       <td valign="bottom">
+                                               <xsl:variable name="lang_apply">
+                                                       <xsl:value-of 
select="php:function('lang', 'apply')"/>
+                                               </xsl:variable>
+                                               <input type="submit" 
class="pure-button pure-button-primary" name="values[apply]" 
value="{$lang_apply}">
+                                                       <xsl:attribute 
name="title">
+                                                               <xsl:value-of 
select="php:function('lang', 'save and stay in form')"/>
+                                                       </xsl:attribute>
+                                               </input>
+                                       </td>
+                                       <xsl:if test="$lean!=1">
+                                                       <td align="right" 
valign="bottom">
+                                                               <xsl:variable 
name="lang_cancel">
+                                                                       
<xsl:value-of select="php:function('lang', 'cancel')"/>
+                                                               </xsl:variable>
+                                                               <input 
type="button" class="pure-button pure-button-primary" name="values[cancel]" 
value="{$lang_cancel}" onMouseout="window.status='';return true;" 
onClick="document.cancel_form.submit();">
+                                                                       
<xsl:attribute name="title">
+                                                                               
<xsl:value-of select="php:function('lang', 'Back to the list')"/>
+                                                                       
</xsl:attribute>
+                                                               </input>
+                                                       </td>
+                                       </xsl:if>
+                               </tr>
+                       </table>
+               </div>
+
 </xsl:template>
 
 <!-- emtpy -->

Modified: branches/dev-syncromind/property/templates/base/lookup.entity.xsl
===================================================================
--- branches/dev-syncromind/property/templates/base/lookup.entity.xsl   
2016-02-06 16:40:30 UTC (rev 14704)
+++ branches/dev-syncromind/property/templates/base/lookup.entity.xsl   
2016-02-07 15:57:26 UTC (rev 14705)
@@ -358,6 +358,7 @@
                var editor_cols = [];
                var editor_action = '<xsl:value-of select="editor_action"/>';
                var disablePagination = '<xsl:value-of 
select="disablePagination"/>';
+               var initial_search = {"search": "<xsl:value-of 
select="query"/>" };
 
                        <xsl:choose>
                                <xsl:when test="//datatable/actions">
@@ -608,6 +609,7 @@
                
                        var options ={};
                        options.TableTools = JqueryPortico.buttons;
+                       options.initial_search = initial_search;
                        temp_buttons = JqueryPortico.buttons;
                        oTable = 
JqueryPortico.inlineTableHelper("datatable-container", ajax_url, 
JqueryPortico.columns, options);
 ]]>
@@ -675,7 +677,6 @@
                                                
buttons_def.push(buttons_def_temp[i]);
                                        }
 
-
                                        api = oTable.api();
                                        api.destroy();
 
@@ -695,9 +696,11 @@
                                                        }
                                                }
                                        }
-console.log( buttons_def);
+
                                        options ={};
                                        options.TableTools = buttons_def;
+                                       options.initial_search = initial_search;
+
                                        var render;
                                        var columns = [];
                                        var PreColumns = 
result.datatable_def.ColumnDefs;

Modified: branches/dev-syncromind/property/templates/base/project.xsl
===================================================================
--- branches/dev-syncromind/property/templates/base/project.xsl 2016-02-06 
16:40:30 UTC (rev 14704)
+++ branches/dev-syncromind/property/templates/base/project.xsl 2016-02-07 
15:57:26 UTC (rev 14705)
@@ -325,7 +325,8 @@
                                                        
<xsl:text>required</xsl:text>
                                                </xsl:attribute>
                                                <xsl:attribute 
name="data-validation-error-msg">
-                                                       <xsl:text>!please 
select an end date!</xsl:text>
+                                                       <xsl:value-of 
select="php:function('lang', 'Please select an end date!')"/>
+
                                                </xsl:attribute>
                                        </input>
                                </div>
@@ -347,30 +348,28 @@
                                                </xsl:choose>
                                        </xsl:when>
                                </xsl:choose>
-                               <xsl:choose>
-                                       <xsl:when test="value_project_id!='' 
and mode='edit' and project_type_id !=3">
-                                               <div class="pure-control-group">
-                                                       <label for="name">
-                                                               <xsl:value-of 
select="php:function('lang', 'move')"/>
-                                                       </label>
-                                                       <input type="text" 
data-validation="number" data-validation-allowing="float" 
data-validation-decimal-separator="{$decimal_separator}" 
name="values[new_project_id]" value="">
-                                                               <xsl:attribute 
name="title">
-                                                                       
<xsl:value-of select="php:function('lang', 'move budget and orders to another 
project')"/>
-                                                               </xsl:attribute>
-                                                               <xsl:attribute 
name="data-validation-optional">
-                                                                       
<xsl:text>true</xsl:text>
-                                                               </xsl:attribute>
-                                                       </input>
-                                               </div>
-                                       </xsl:when>
-                               </xsl:choose>
+                               <xsl:if test="value_project_id &gt; 0 and 
mode='edit'">
+                                       <div class="pure-control-group">
+                                               <label for="name">
+                                                       <xsl:value-of 
select="php:function('lang', 'move')"/>
+                                               </label>
+                                               <input type="text" 
data-validation="number" data-validation-allowing="float" 
data-validation-decimal-separator="{$decimal_separator}" 
name="values[new_project_id]" value="">
+                                                       <xsl:attribute 
name="title">
+                                                               <xsl:value-of 
select="php:function('lang', 'move budget and orders to another project')"/>
+                                                       </xsl:attribute>
+                                                       <xsl:attribute 
name="data-validation-optional">
+                                                               
<xsl:text>true</xsl:text>
+                                                       </xsl:attribute>
+                                               </input>
+                                       </div>
+                               </xsl:if>
                                <div class="pure-control-group">
                                        <label for="name">
                                                <xsl:value-of 
select="php:function('lang', 'budget')"/>
                                        </label>
                                        <div class="pure-custom">
                                                <div>
-                                                       <input 
data-validation="number" data-validation-allowing="float" 
data-validation-decimal-separator="{$decimal_separator}" type="text" 
name="values[budget]" value="">
+                                                       <input 
data-validation="number" data-validation-allowing="float" 
data-validation-decimal-separator="{$decimal_separator}" type="text" 
name="values[budget]" value="{value_budget}">
                                                                <xsl:attribute 
name="title">
                                                                        
<xsl:value-of select="php:function('lang', 'Enter the budget')"/>
                                                                </xsl:attribute>




reply via email to

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