fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10526] property: bug in locationform


From: Sigurd Nes
Subject: [Fmsystem-commits] [10526] property: bug in locationform
Date: Wed, 21 Nov 2012 13:31:19 +0000

Revision: 10526
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10526
Author:   sigurdne
Date:     2012-11-21 13:31:18 +0000 (Wed, 21 Nov 2012)
Log Message:
-----------
property: bug in locationform

Modified Paths:
--------------
    trunk/property/inc/class.bocommon.inc.php
    trunk/property/inc/class.sotts.inc.php
    trunk/property/inc/class.uientity.inc.php
    trunk/property/inc/class.uilookup.inc.php
    trunk/property/inc/class.uitts.inc.php
    trunk/property/js/yahoo/lookup.entity.index.js
    trunk/property/setup/phpgw_no.lang
    trunk/property/templates/base/entity.xsl

Modified: trunk/property/inc/class.bocommon.inc.php
===================================================================
--- trunk/property/inc/class.bocommon.inc.php   2012-11-20 14:11:32 UTC (rev 
10525)
+++ trunk/property/inc/class.bocommon.inc.php   2012-11-21 13:31:18 UTC (rev 
10526)
@@ -2007,7 +2007,7 @@
                 * @param array $insert_record array containing fields to 
collect from post
                 * @return updated values
                 */
-               function collect_locationdata($values = '',$insert_record = 
array())
+               function collect_locationdata($values = array(),$insert_record 
= array())
                {
 //_debug_array($insert_record);die();
                        if($insert_record)
@@ -2024,7 +2024,7 @@
                                {
                                        foreach ($insert_record['extra'] as 
$key => $column)
                                        {
-                                               if(isset($_POST[$key]))
+                                               if(isset($_POST[$key]) && 
$_POST[$key])
                                                {
                                                        
$values['extra'][$column]       = phpgw::get_var($key, 'string', 'POST');
                                                }

Modified: trunk/property/inc/class.sotts.inc.php
===================================================================
--- trunk/property/inc/class.sotts.inc.php      2012-11-20 14:11:32 UTC (rev 
10525)
+++ trunk/property/inc/class.sotts.inc.php      2012-11-21 13:31:18 UTC (rev 
10526)
@@ -791,14 +791,35 @@
                        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_item_id' => 
$ticket['origin_item_id'],
-                                               'location2_id'          => 
$GLOBALS['phpgw']->locations->get_id('property', '.ticket'),
-                                               'location2_item_id' => $id,
-                                               'account_id'            => 
$this->account
-                                       );
+                               (
+                                       'location1_id'          => 
$ticket['origin_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
+                               );
+                       }
+                       else 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']}");
+ 
+                               $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();
+                               $prefix = $this->db->f('prefix');
+                               $ticket['origin_item_id']               = (int) 
ltrim($ticket['extra']['p_num'], $prefix);
+                       
+                               $interlink_data = array
+                               (
+                                       'location1_id'          => 
$ticket['origin_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: trunk/property/inc/class.uientity.inc.php
===================================================================
--- trunk/property/inc/class.uientity.inc.php   2012-11-20 14:11:32 UTC (rev 
10525)
+++ trunk/property/inc/class.uientity.inc.php   2012-11-21 13:31:18 UTC (rev 
10526)
@@ -1969,7 +1969,7 @@
                                        }
                                }
 
-                               $tabs['related']        = array('label' => 
lang('related'), 'link' => '#related');
+                               $tabs['related']        = array('label' => 
lang('log'), 'link' => '#related');
                                $_target = array();
                                if(isset($values['target']) && 
$values['target'])
                                {

Modified: trunk/property/inc/class.uilookup.inc.php
===================================================================
--- trunk/property/inc/class.uilookup.inc.php   2012-11-20 14:11:32 UTC (rev 
10525)
+++ trunk/property/inc/class.uilookup.inc.php   2012-11-21 13:31:18 UTC (rev 
10526)
@@ -1977,12 +1977,24 @@
                                                        (
                                                                array
                                                                ( //boton       
CATEGORY
+
+                                                                       'id' => 
'sel_cat_id',
+                                                                       'name' 
=> 'cat_id',
+                                                                       'value' 
=> lang('Category'),
+                                                                       'type' 
=> 'select',
+                                                                       'style' 
=> 'filter',
+                                                                       
'values' => $values_combo_box[0],
+                                                                       
'onchange'=> 'onChangeSelect("cat_id");',
+                                                                       
'tab_index' => 1
+
+/*
                                                                        'id' => 
'btn_cat_id',
                                                                        'name' 
=> 'cat_id',
                                                                        'value' 
=> lang('Category'),
                                                                        'type' 
=> 'button',
                                                                        'style' 
=> 'filter',
                                                                        
'tab_index' => 1
+*/
                                                                ),
                                                                array
                                                                ( //boton       
CATEGORY
@@ -2023,11 +2035,12 @@
                                                        ),
                                                        'hidden_value' => array
                                                        (
-                                                               array
+                                       /*                      array
                                                                ( //div values  
combo_box_0
                                                                        'id' => 
'values_combo_box_0',
                                                                        'value' 
=> $bocommon->select2String($values_combo_box[0]) //i.e.  id,value/id,vale/
                                                                ),
+                                       */
                                                                array
                                                                ( //div values  
combo_box_1
                                                                        'id' => 
'values_combo_box_1',

Modified: trunk/property/inc/class.uitts.inc.php
===================================================================
--- trunk/property/inc/class.uitts.inc.php      2012-11-20 14:11:32 UTC (rev 
10525)
+++ trunk/property/inc/class.uitts.inc.php      2012-11-21 13:31:18 UTC (rev 
10526)
@@ -1780,7 +1780,6 @@
 
                                $values = 
$this->bocommon->collect_locationdata($values,$insert_record);
 
-
                                if(!$values['subject'] && 
isset($this->bo->config->config_data['tts_mandatory_title']) && 
$this->bo->config->config_data['tts_mandatory_title'])
                                {
                                        
$receipt['error'][]=array('msg'=>lang('Please enter a title !'));

Modified: trunk/property/js/yahoo/lookup.entity.index.js
===================================================================
--- trunk/property/js/yahoo/lookup.entity.index.js      2012-11-20 14:11:32 UTC 
(rev 10525)
+++ trunk/property/js/yahoo/lookup.entity.index.js      2012-11-21 13:31:18 UTC 
(rev 10526)
@@ -3,11 +3,11 @@
 //--------------------------------------------------------
 
        //define SelectButton
-       var oMenuButton_0, oMenuButton_1, oMenuButton_2;
+       var oMenuButton_0, oMenuButton_1;//, oMenuButton_2;
        var selectsButtons = [
-       {order:0, 
var_URL:'cat_id',name:'btn_cat_id',style:'districtbutton',dependiente:''},
-       {order:1, var_URL:'district_id',name:'btn_district_id', 
style:'districtbutton', dependiente:''},
-       {order:2, var_URL:'criteria_id', 
name:'btn_criteria_id',style:'criteriabutton',dependiente:''}
+//     {order:0, 
var_URL:'cat_id',name:'btn_cat_id',style:'districtbutton',dependiente:''},
+       {order:0, var_URL:'district_id',name:'btn_district_id', 
style:'districtbutton', dependiente:''},
+       {order:1, var_URL:'criteria_id', 
name:'btn_criteria_id',style:'criteriabutton',dependiente:''}
        ]
 
        // define buttons
@@ -26,6 +26,25 @@
                date_search : 0 //if search has link "Data search"
        }
        
+       this.myParticularRenderEvent = function()
+       {
+       }
+       
+       this.onChangeSelect = function(type)
+       {
+               var myselect=document.getElementById("sel_"+ type);
+               for (var i=0; i<myselect.options.length; i++)
+               {
+                       if (myselect.options[i].selected==true)
+                       {
+                               break;
+                       }
+               }
+               eval("path_values." +type +"='"+myselect.options[i].value+"'");
+               execute_ds();
+       }
+
+
        
/****************************************************************************************/
                
        this.particular_setting = function()

Modified: trunk/property/setup/phpgw_no.lang
===================================================================
--- trunk/property/setup/phpgw_no.lang  2012-11-20 14:11:32 UTC (rev 10525)
+++ trunk/property/setup/phpgw_no.lang  2012-11-21 13:31:18 UTC (rev 10526)
@@ -1015,6 +1015,7 @@
 location not chosen!   property        no      Lokalisering er ikke valgt
 location type  property        no      Lokaliserings type
 location type not chosen!      property        no      Lokaliseringsnivå ikke 
valgt
+log    property        no      Logg
 longevity      property        no      Levetid
 lookup property        no      Slå opp
 lookup template        property        no      Slå opp standardbeskrivelser

Modified: trunk/property/templates/base/entity.xsl
===================================================================
--- trunk/property/templates/base/entity.xsl    2012-11-20 14:11:32 UTC (rev 
10525)
+++ trunk/property/templates/base/entity.xsl    2012-11-21 13:31:18 UTC (rev 
10526)
@@ -292,7 +292,7 @@
                                                                <table 
cellpadding="2" cellspacing="2" width="80%" align="center">
                                                                        <tr>
                                                                                
<td valign='top'>
-                                                                               
        <xsl:value-of select="php:function('lang', 'started from')"/>
+                                                                               
        <!--<xsl:value-of select="php:function('lang', 'started from')"/>-->
                                                                                
</td>
                                                                                
<td>
                                                                                
        <div id="datatable-container_1"/>
@@ -300,7 +300,7 @@
                                                                        </tr>
                                                                        <tr>
                                                                                
<td valign='top'>
-                                                                               
        <xsl:value-of select="php:function('lang', 'used in')"/>
+                                                                               
        <!--<xsl:value-of select="php:function('lang', 'used in')"/>-->
                                                                                
</td>
                                                                                
<td>
                                                                                
        <div id="datatable-container_2"/>
@@ -310,24 +310,6 @@
                                                        </div>
                                                </xsl:when>
                                        </xsl:choose>
-
-                                       <!--
-                                       <xsl:choose>
-                                               <xsl:when test="related_link != 
''">
-                                                       <div id="related">
-                                                               <table 
cellpadding="2" cellspacing="2" width="80%" align="center">
-                                                                       <tr>
-                                                                               
<td>
-                                                                               
        <table width="100%" cellpadding="2" cellspacing="2" align="center">
-                                                                               
                <xsl:apply-templates select="related_link"/>
-                                                                               
        </table>
-                                                                               
</td>
-                                                                       </tr>
-                                                               </table>
-                                                       </div>
-                                               </xsl:when>
-                                       </xsl:choose>
-                                       -->
                                </div>
                                <xsl:choose>
                                        <xsl:when test="mode = 'edit'">
@@ -511,20 +493,3 @@
                        </xsl:when>
                </xsl:choose>
        </xsl:template>
-
-       <!-- New template-->
-       <xsl:template match="related_link">
-               <xsl:variable name="lang_entity_statustext">
-                       <xsl:value-of select="lang_entity_statustext"/>
-               </xsl:variable>
-               <xsl:variable name="entity_link">
-                       <xsl:value-of select="entity_link"/>
-               </xsl:variable>
-               <tr>
-                       <td class="small_text" align="left">
-                               <a href="{$entity_link}" 
onMouseover="window.status='{$lang_entity_statustext}';return true;" 
onMouseout="window.status='';return true;">
-                                       <xsl:value-of select="text_entity"/>
-                               </a>
-                       </td>
-               </tr>
-       </xsl:template>




reply via email to

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