fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [14910] Merge 14905:14909 from trunk


From: Sigurd Nes
Subject: [Fmsystem-commits] [14910] Merge 14905:14909 from trunk
Date: Sat, 09 Apr 2016 11:19:48 +0000

Revision: 14910
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14910
Author:   sigurdne
Date:     2016-04-09 11:19:48 +0000 (Sat, 09 Apr 2016)
Log Message:
-----------
Merge 14905:14909 from trunk

Modified Paths:
--------------
    branches/Version-2_0-branch/bookingfrontend/inc/class.bosearch.inc.php
    branches/Version-2_0-branch/property/inc/class.bofiles.inc.php
    branches/Version-2_0-branch/property/inc/class.sorequest.inc.php
    branches/Version-2_0-branch/property/inc/class.sotts.inc.php
    branches/Version-2_0-branch/property/inc/class.uirequest.inc.php
    branches/Version-2_0-branch/property/inc/hook_config.inc.php
    branches/Version-2_0-branch/property/js/portico/request.edit.js
    branches/Version-2_0-branch/property/templates/base/config.tpl

Property Changed:
----------------
    branches/Version-2_0-branch/
    branches/Version-2_0-branch/bookingfrontend/


Property changes on: branches/Version-2_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/dev-syncromind:13653
/branches/stavangerkommune:12743-12875,12986
/trunk:14721-14732,14734-14735,14737,14739,14741,14743-14744,14746-14749,14751,14753,14755-14757,14759,14761-14764,14766-14768,14770-14783,14785-14792,14794-14813,14815-14816,14818,14820-14822,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14847,14849-14866,14868-14869,14871,14873-14875,14877-14878,14880-14884,14886-14896,14898,14900-14902,14904
   + /branches/dev-syncromind:13653
/branches/stavangerkommune:12743-12875,12986
/trunk:14721-14732,14734-14735,14737,14739,14741,14743-14744,14746-14749,14751,14753,14755-14757,14759,14761-14764,14766-14768,14770-14783,14785-14792,14794-14813,14815-14816,14818,14820-14822,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14847,14849-14866,14868-14869,14871,14873-14875,14877-14878,14880-14884,14886-14896,14898,14900-14902,14904,14906-14909


Property changes on: branches/Version-2_0-branch/bookingfrontend
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/stavangerkommune/bookingfrontend:9468-12740,12986
/trunk/bookingfrontend:14721-14732,14770-14783,14794-14808,14824-14825,14838,14886-14894
   + /branches/stavangerkommune/bookingfrontend:9468-12740,12986
/trunk/bookingfrontend:14721-14732,14770-14783,14794-14808,14824-14825,14838,14886-14894,14906-14909

Modified: branches/Version-2_0-branch/bookingfrontend/inc/class.bosearch.inc.php
===================================================================
--- branches/Version-2_0-branch/bookingfrontend/inc/class.bosearch.inc.php      
2016-04-08 11:49:02 UTC (rev 14909)
+++ branches/Version-2_0-branch/bookingfrontend/inc/class.bosearch.inc.php      
2016-04-09 11:19:48 UTC (rev 14910)
@@ -53,9 +53,13 @@
 
                        $_filter_building['part_of_town_id'] = 
$filter_part_of_town;
 
+                       $buildings = array();
                        if ($filter_top_level && !$building_id && !$searchterm)
                        {
                                $buildings = 
$this->sobuilding->get_buildings_from_activity($filter_top_level);
+                       }
+                       if ($buildings)
+                       {
                                $_filter_building['id'] = $buildings;
                        }
                        if ($building_id)

Modified: branches/Version-2_0-branch/property/inc/class.bofiles.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.bofiles.inc.php      
2016-04-08 11:49:02 UTC (rev 14909)
+++ branches/Version-2_0-branch/property/inc/class.bofiles.inc.php      
2016-04-09 11:19:48 UTC (rev 14910)
@@ -157,6 +157,7 @@
                        foreach ($values['file_action'] as $file_name)
                        {
                                $file_name = html_entity_decode($file_name);
+                               $file_name = 
$this->strip_entities_from_name($file_name);
 
                                $file = "{$this->fakebase}{$path}{$file_name}";
 
@@ -203,6 +204,7 @@
                        if (!$file)
                        {
                                $file_name = 
html_entity_decode(urldecode(phpgw::get_var('file_name')));
+                               $file_name = 
$this->strip_entities_from_name($file_name);
                                $id = phpgw::get_var('id');
                                $file = 
"{$this->fakebase}/{$type}/{$id}/{$file_name}";
                        }
@@ -273,6 +275,7 @@
                        $attachments = array();
                        foreach ($values as $file_name)
                        {
+                               $file_name = 
$this->strip_entities_from_name($file_name);
                                $file = "{$this->fakebase}{$path}{$file_name}";
 
                                if ($this->vfs->file_exists(array(
@@ -291,4 +294,9 @@
                        }
                        return $attachments;
                }
+
+               function strip_entities_from_name($file_name)
+               {
+                       return str_replace(array('(', 
')','−−'),array('(', ')', '--'), $file_name);
+               }
        }
\ No newline at end of file

Modified: branches/Version-2_0-branch/property/inc/class.sorequest.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.sorequest.inc.php    
2016-04-08 11:49:02 UTC (rev 14909)
+++ branches/Version-2_0-branch/property/inc/class.sorequest.inc.php    
2016-04-09 11:19:48 UTC (rev 14910)
@@ -229,6 +229,7 @@
                        if($query)
                        {
                                $filtermethod .= " AND fm_request.title 
{$this->_like} '%$query%'";
+                               $filtermethod .= " OR fm_request.id =" . (int) 
$query;
                        }
 
 

Modified: branches/Version-2_0-branch/property/inc/class.sotts.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.sotts.inc.php        
2016-04-08 11:49:02 UTC (rev 14909)
+++ branches/Version-2_0-branch/property/inc/class.sotts.inc.php        
2016-04-09 11:19:48 UTC (rev 14910)
@@ -967,29 +967,42 @@
                                $this->db->query("UPDATE fm_tenant SET 
contact_phone='{$ticket['extra']['contact_phone']}' WHERE 
id='{$ticket['extra']['tenant_id']}'", __LINE__, __FILE__);
                        }
 
-                       if (isset($ticket['origin']) && 
is_array($ticket['origin']))
+                       $interlink = CreateObject('property.interlink');
+
+                       if (isset($ticket['origin']) && $ticket['origin'] && 
isset($ticket['origin_id']) && $ticket['origin_id'] )
                        {
-                               if ($ticket['origin'][0]['data'][0]['id'])
-                               {
-                                       $ticket['origin_id'] = 
$GLOBALS['phpgw']->locations->get_id('property', 
$ticket['origin'][0]['location']);
-                                       $ticket['origin_item_id'] = 
$ticket['origin'][0]['data'][0]['id'];
-                               }
-                       }
+                               $ticket['origin_location_id'] = 
$GLOBALS['phpgw']->locations->get_id('property', $ticket['origin']);
+                               $ticket['origin_item_id'] = 
$ticket['origin_id'];
 
-                       if (isset($ticket['origin_id']) && $ticket['origin_id'] 
&& isset($ticket['origin_item_id']) && $ticket['origin_item_id'])
-                       {
                                $interlink_data = array
                                        (
-                                       'location1_id' => $ticket['origin_id'],
+                                       'location1_id' => 
$ticket['origin_location_id'],
                                        'location1_item_id' => 
$ticket['origin_item_id'],
                                        'location2_id' => 
$GLOBALS['phpgw']->locations->get_id('property', '.ticket'),
                                        'location2_item_id' => $id,
                                        'account_id' => $this->account
                                );
+
+                               $interlink->add($interlink_data, $this->db);
+
+                               if($ticket['origin']==".project.request")
+                               {
+                                       $config = 
CreateObject('phpgwapi.config', 'property');
+                                       $config->read();
+                                       $request_ticket_hookup_status = 
isset($config->config_data['request_ticket_hookup_status']) && 
$config->config_data['request_ticket_hookup_status'] ? 
$config->config_data['request_ticket_hookup_status'] : false;
+
+                                       if ($request_ticket_hookup_status)
+                                       {
+                                               $this->db->query("UPDATE 
fm_request SET status='{$request_ticket_hookup_status}' WHERE id='" . (int) 
$ticket['origin_item_id'] . "'", __LINE__, __FILE__);
+                                       }
+
+                                       
phpgwapi_cache::message_set(lang('request %1 has been edited', 
$ticket['origin_item_id']), 'message');
+                               }
                        }
-                       else if (isset($ticket['extra']) && 
is_array($ticket['extra']) && isset($ticket['extra']['p_num']) && 
$ticket['extra']['p_num'])
+
+                       if (isset($ticket['extra']) && 
is_array($ticket['extra']) && isset($ticket['extra']['p_num']) && 
$ticket['extra']['p_num'])
                        {
-                               $ticket['origin_id'] = 
$GLOBALS['phpgw']->locations->get_id('property', 
".entity.{$ticket['extra']['p_entity_id']}.{$ticket['extra']['p_cat_id']}");
+                               $ticket['origin_location_id'] = 
$GLOBALS['phpgw']->locations->get_id('property', 
".entity.{$ticket['extra']['p_entity_id']}.{$ticket['extra']['p_cat_id']}");
 
                                $this->db->query('SELECT prefix FROM 
fm_entity_category WHERE entity_id = ' . (int)$ticket['extra']['p_entity_id'] . 
' AND id = ' . (int)$ticket['extra']['p_cat_id']);
                                $this->db->next_record();
@@ -998,17 +1011,12 @@
 
                                $interlink_data = array
                                        (
-                                       'location1_id' => $ticket['origin_id'],
+                                       'location1_id' => 
$ticket['origin_location_id'],
                                        'location1_item_id' => 
$ticket['origin_item_id'],
                                        'location2_id' => 
$GLOBALS['phpgw']->locations->get_id('property', '.ticket'),
                                        'location2_item_id' => $id,
                                        'account_id' => $this->account
                                );
-                       }
-
-                       if ($interlink_data)
-                       {
-                               $interlink = CreateObject('property.interlink');
                                $interlink->add($interlink_data, $this->db);
                        }
 

Modified: branches/Version-2_0-branch/property/inc/class.uirequest.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.uirequest.inc.php    
2016-04-08 11:49:02 UTC (rev 14909)
+++ branches/Version-2_0-branch/property/inc/class.uirequest.inc.php    
2016-04-09 11:19:48 UTC (rev 14910)
@@ -1420,7 +1420,7 @@
                                        array('key' => 'end_date', 'label' => 
lang('end date'), 'sortable' => true,
                                                'resizeable' => true),
                                        array('key' => 'budget', 'label' => 
lang('budget'), 'sortable' => true, 'resizeable' => false,
-                                               'formatter' => 
'FormatterRight')),
+                                               'formatter' => 
'JqueryPortico.FormatterAmount0')),
                                'data' => json_encode($related),
                                'config' => array(
                                        array('disableFilter' => true),
@@ -1599,6 +1599,7 @@
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
 
                        self::add_javascript('property', 'portico', 
'request.edit.js');
+                       phpgwapi_jquery::load_widget('numberformat');
                        self::render_template_xsl(array('request', 
'datatable_inline', 'files', 'attributes_form'), array(
                                'edit' => $data));
                }

Modified: branches/Version-2_0-branch/property/inc/hook_config.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/hook_config.inc.php        
2016-04-08 11:49:02 UTC (rev 14909)
+++ branches/Version-2_0-branch/property/inc/hook_config.inc.php        
2016-04-09 11:19:48 UTC (rev 14910)
@@ -253,7 +253,7 @@
         * Get HTML listbox with request status that are to be set when request 
is added to a project
         *
         * @param $config
-        * @return string HTML checkboxes to be placed in a table
+        * @return string HTML listbox to be placed in a table
         */
        function request_project_hookup_status( $config )
        {
@@ -273,7 +273,31 @@
 
                return $out;
        }
+       /**
+        * Get HTML listbox with request status that are to be set when request 
is added to a ticket
+        *
+        * @param $config
+        * @return string HTML listbox to be placed in a table
+        */
+       function request_ticket_hookup_status( $config )
+       {
+               $status_assigned = 
isset($config['request_ticket_hookup_status']) ? 
$config['request_ticket_hookup_status'] : '';
+               $status_entries = execMethod('property.bogeneric.get_list', 
array('type' => 'request_status',
+                       'selected' => $status_assigned));
 
+               $out = '<option value="">' . lang('none selected') . 
'</option>' . "\n";
+               foreach ($status_entries as $status)
+               {
+                       $selected = $status['selected'] ? ' selected = 
"selected"' : '';
+
+                       $out .= <<<HTML
+                       <option 
value='{$status['id']}'{$selected}>{$status['name']}</option>
+HTML;
+               }
+
+               return $out;
+       }
+
        /**
         * Get HTML listbox with workorder status that are to be set when 
invoice is processed
         *

Modified: branches/Version-2_0-branch/property/js/portico/request.edit.js
===================================================================
--- branches/Version-2_0-branch/property/js/portico/request.edit.js     
2016-04-08 11:49:02 UTC (rev 14909)
+++ branches/Version-2_0-branch/property/js/portico/request.edit.js     
2016-04-09 11:19:48 UTC (rev 14910)
@@ -24,7 +24,7 @@
                                return intVal(a) + intVal(b);
                        }) : 0;
 
-               $(api.column(col).footer()).html("<div align=\"right\">" + 
pageTotal + "</div>");
+               $(api.column(col).footer()).html("<div align=\"right\">" + 
$.number(pageTotal, 0, ',', '.') + "</div>");
        });
 
 };

Modified: branches/Version-2_0-branch/property/templates/base/config.tpl
===================================================================
--- branches/Version-2_0-branch/property/templates/base/config.tpl      
2016-04-08 11:49:02 UTC (rev 14909)
+++ branches/Version-2_0-branch/property/templates/base/config.tpl      
2016-04-09 11:19:48 UTC (rev 14910)
@@ -139,8 +139,15 @@
                                </select>
                        </td>
                </tr>
+               <tr>
+                       <td>{lang_request_status_on_ticket_hookup}:</td>
+                       <td>
+                               <select 
name="newsettings[request_ticket_hookup_status]">
+                                       {hook_request_ticket_hookup_status}
+                               </select>
+                       </td>
+               </tr>
 
-
                <tr class="pure-table-odd">
                
<td>{lang_workorder_status_that_are_to_be_set_when_invoice_is_processed}:</td>
                <td>




reply via email to

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