fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [7435] property: enable configurable show/hide docume


From: Sigurd Nes
Subject: [Fmsystem-commits] [7435] property: enable configurable show/hide documents at location-level
Date: Tue, 28 Jun 2011 09:02:26 +0000

Revision: 7435
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7435
Author:   sigurdne
Date:     2011-06-28 09:02:25 +0000 (Tue, 28 Jun 2011)
Log Message:
-----------
property: enable configurable show/hide documents at location-level

Modified Paths:
--------------
    trunk/property/inc/class.soadmin_location.inc.php
    trunk/property/inc/class.uiadmin_location.inc.php
    trunk/property/inc/class.uilocation.inc.php
    trunk/property/inc/hook_settings.inc.php
    trunk/property/setup/setup.inc.php
    trunk/property/setup/tables_current.inc.php
    trunk/property/setup/tables_update.inc.php
    trunk/property/templates/base/admin_location.xsl

Modified: trunk/property/inc/class.soadmin_location.inc.php
===================================================================
--- trunk/property/inc/class.soadmin_location.inc.php   2011-06-27 13:36:06 UTC 
(rev 7434)
+++ trunk/property/inc/class.soadmin_location.inc.php   2011-06-28 09:02:25 UTC 
(rev 7435)
@@ -183,7 +183,8 @@
                                                'name'                  => 
$this->db->f('name'),
                                                'descr'                 => 
$this->db->f('descr'),
                                                'list_info'             => 
$this->db->f('list_info',true),
-                                               'list_address'  => 
$this->db->f('list_address')
+                                               'list_address'  => 
$this->db->f('list_address'),
+                                               'list_documents'=> 
$this->db->f('list_documents')
                                        );
                        }
                        return $standard;
@@ -363,7 +364,7 @@
                                $fd['part_of_town_id'] = array('type' => 'int', 
'precision' => 2, 'nullable' => true);
                        }
 
-                       $fd['loc' .$standard['id'] . '_name'] = array('type' => 
'varchar', 'precision' => 25, 'nullable' => true);
+                       $fd['loc' .$standard['id'] . '_name'] = array('type' => 
'varchar', 'precision' => 50, 'nullable' => true);
                        $fd['entry_date'] = array('type' => 'int', 'precision' 
=> 4, 'nullable' => true);
                        $fd['category'] = array('type' => 'int', 'precision' => 
4, 'nullable' => true);
                        $fd['user_id'] = array('type' => 'int', 'precision' => 
4, 'nullable' => true);
@@ -499,7 +500,8 @@
                                'descr'                 => 
$this->db->db_addslashes($values['descr']),
                                'list_info'             => 
(isset($values['list_info'])?serialize($values['list_info']):''),
                                'list_address'  => 
(isset($values['list_address'])?$values['list_address']:''),
-                       );
+                               'list_documents'=> 
(isset($values['list_documents'])?$values['list_documents']:''),
+                               );
 
                        $value_set      = 
$this->db->validate_update($value_set);
 
@@ -668,7 +670,8 @@
                                        'name'                  => 
stripslashes($this->db->f('name')),
                                        'descr'                 => 
stripslashes($this->db->f('descr')),
                                        'list_info'             => 
unserialize($this->db->f('list_info')),
-                                       'list_address'  => 
$this->db->f('list_address')
+                                       'list_address'  => 
$this->db->f('list_address'),
+                                       'list_documents'=> 
$this->db->f('list_documents')
                                );
                        }
                        //_debug_array($location_type);

Modified: trunk/property/inc/class.uiadmin_location.inc.php
===================================================================
--- trunk/property/inc/class.uiadmin_location.inc.php   2011-06-27 13:36:06 UTC 
(rev 7434)
+++ trunk/property/inc/class.uiadmin_location.inc.php   2011-06-28 09:02:25 UTC 
(rev 7435)
@@ -534,10 +534,9 @@
                                        'lang_select'                           
        => lang('select'),
                                        'value_list_info'                       
        => $this->bo->get_list_info((isset($id)?$id:''),$values['list_info']),
                                        'lang_location'                         
        => lang('location'),
-                                       'lang_list_address'                     
        => lang('list address'),
                                        'lang_list_info_statustext'             
=> lang('Names of levels to list at this level'),
-                                       'lang_list_address_statustext'  => 
lang('List address at this level'),
-                                       'value_list_address'                    
=> (isset($values['list_address'])?$values['list_address']:'')
+                                       'value_list_address'                    
=> isset($values['list_address'])?$values['list_address']:'',
+                                       'value_list_documents'                  
=> isset($values['list_documents'])?$values['list_documents']:''
                                );
 
                        $appname        = lang('location');

Modified: trunk/property/inc/class.uilocation.inc.php
===================================================================
--- trunk/property/inc/class.uilocation.inc.php 2011-06-27 13:36:06 UTC (rev 
7434)
+++ trunk/property/inc/class.uilocation.inc.php 2011-06-28 09:02:25 UTC (rev 
7435)
@@ -2189,8 +2189,13 @@
                                $related = 
$this->bo->read_entity_to_link($location_code);
                                $related_link = array();
 
-                               $document = CreateObject('property.sodocument');
-                               $documents = $document->get_files_at_location( 
array('location_code' => $location_code) );
+                               $location_type_info =  
$this->soadmin_location->read_single($type_id);
+                               $documents = array();
+                               if($location_type_info['list_documents'])
+                               {
+                                       $document = 
CreateObject('property.sodocument');
+                                       $documents = 
$document->get_files_at_location( array('location_code' => $location_code) );
+                               }
 
                                if($documents)
                                {

Modified: trunk/property/inc/hook_settings.inc.php
===================================================================
--- trunk/property/inc/hook_settings.inc.php    2011-06-27 13:36:06 UTC (rev 
7434)
+++ trunk/property/inc/hook_settings.inc.php    2011-06-28 09:02:25 UTC (rev 
7435)
@@ -185,6 +185,8 @@
        create_select_box('Send e-mail from 
TTS','tts_user_mailnotification',$yes_and_no,'Send e-mail from TTS as default');
        create_input_box('Refresh TTS every (seconds)','refreshinterval','The 
intervall for Helpdesk refresh - cheking for new tickets');
 
+       create_select_box('Set myself as contact when adding a 
ticket','tts_me_as_contact',$yes_and_no,'');
+
        create_select_box('Default Degree Request 
safety','default_safety',$degree,'The degree of seriousness');
        create_select_box('Default Degree Request 
aesthetics','default_aesthetics',$degree);
        create_select_box('Default Degree Request indoor 
climate','default_climate',$degree);

Modified: trunk/property/setup/setup.inc.php
===================================================================
--- trunk/property/setup/setup.inc.php  2011-06-27 13:36:06 UTC (rev 7434)
+++ trunk/property/setup/setup.inc.php  2011-06-28 09:02:25 UTC (rev 7435)
@@ -12,7 +12,7 @@
        */
 
        $setup_info['property']['name']                 = 'property';
-       $setup_info['property']['version']              = '0.9.17.618';
+       $setup_info['property']['version']              = '0.9.17.619';
        $setup_info['property']['app_order']    = 8;
        $setup_info['property']['enable']               = 1;
        $setup_info['property']['app_group']    = 'office';

Modified: trunk/property/setup/tables_current.inc.php
===================================================================
--- trunk/property/setup/tables_current.inc.php 2011-06-27 13:36:06 UTC (rev 
7434)
+++ trunk/property/setup/tables_current.inc.php 2011-06-28 09:02:25 UTC (rev 
7435)
@@ -149,6 +149,7 @@
                                'uc' => array('type' => 'text','nullable' => 
True),
                                'list_info' => array('type' => 
'varchar','precision' => '255','nullable' => True),
                                'list_address' => array('type' => 
'int','precision' => '2','nullable' => True),
+                               'list_documents' => array('type' => 
'int','precision' => '2','nullable' => True),
                        ),
                        'pk' => array('id'),
                        'fk' => array(),

Modified: trunk/property/setup/tables_update.inc.php
===================================================================
--- trunk/property/setup/tables_update.inc.php  2011-06-27 13:36:06 UTC (rev 
7434)
+++ trunk/property/setup/tables_update.inc.php  2011-06-28 09:02:25 UTC (rev 
7435)
@@ -5282,7 +5282,35 @@
                }
        }
 
+
        /**
+       * Update property version from 0.9.17.618 to 0.9.17.619
+       */
+
+       $test[] = '0.9.17.618';
+       function property_upgrade0_9_17_618()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_location_type','list_documents', 
array('type' => 'int','precision' => '2','nullable' => True));
+               $GLOBALS['phpgw_setup']->oProc->query("UPDATE fm_location_type 
SET list_documents = 1");
+
+               $GLOBALS['phpgw_setup']->oProc->query("SELECT count(*) as cnt 
FROM fm_location_type");
+               $GLOBALS['phpgw_setup']->oProc->next_record();
+               $locations = $GLOBALS['phpgw_setup']->oProc->f('cnt') +1;
+               for ($level = 5; $level < $locations; $level++)
+               {
+                       
$GLOBALS['phpgw_setup']->oProc->AlterColumn("fm_location{$level}", 
"loc{$level}_name",array('type' => 'varchar','precision' => '50','nullable' => 
True));
+               }
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.619';
+                       return $GLOBALS['setup_info']['property']['currentver'];
+               }
+       }
+
+
+       /**
        * Update property version from 0.9.17.607 to 0.9.17.608
        * Add more room for address at tickets
        * 

Modified: trunk/property/templates/base/admin_location.xsl
===================================================================
--- trunk/property/templates/base/admin_location.xsl    2011-06-27 13:36:06 UTC 
(rev 7434)
+++ trunk/property/templates/base/admin_location.xsl    2011-06-28 09:02:25 UTC 
(rev 7435)
@@ -318,7 +318,7 @@
        </xsl:template>
 
 <!-- add / edit  -->
-       <xsl:template match="edit">
+       <xsl:template match="edit" xmlns:php="http://php.net/xsl";>
                <div align="left">
 
                        <table cellpadding="2" cellspacing="2" width="80%" 
align="center">
@@ -393,33 +393,39 @@
                                                                        
<xsl:call-template name="list_info"/>
                                                                </td>
                                                        </tr>
-
                                                        <tr>
-                                                               <td 
valign="top">
-                                                                       
<xsl:value-of select="lang_list_address"/>
+                                                               <td 
align="left">
+                                                                       
<xsl:value-of select="php:function('lang', 'list address')" />                  
                                
                                                                </td>
+                                                               <td>
+                                                                       <input 
type="checkbox" name="values[list_address]" value="1" >
+                                                                               
<xsl:attribute name="title">
+                                                                               
        <xsl:value-of select="php:function('lang', 'list address at this 
level')" />
+                                                                               
</xsl:attribute>
+                                                                               
<xsl:if test="value_list_address = '1'">
+                                                                               
        <xsl:attribute name="checked">
+                                                                               
                <xsl:text>checked</xsl:text>
+                                                                               
        </xsl:attribute>
+                                                                               
</xsl:if>
+                                                                       </input>
+                                                               </td>
+                                                       </tr>
+                                                       <tr>
                                                                <td 
align="left">
-                                                                       
<xsl:choose>
-                                                                               
<xsl:when test="value_list_address='1'">
-                                                                               
        <input type="checkbox" name="values[list_address]" value="1"  
checked="checked" onMouseout="window.status='';return true;">
-                                                                               
                <xsl:attribute name="onMouseover">
-                                                                               
                        <xsl:text>window.status='</xsl:text>
-                                                                               
                        <xsl:value-of select="//lang_list_address_statustext"/>
-                                                                               
                        <xsl:text>'; return true;</xsl:text>
-                                                                               
                </xsl:attribute>
-                                                                               
        </input>
-                                                                               
</xsl:when>
-                                                                               
<xsl:otherwise>
-                                                                               
        <input type="checkbox" name="values[list_address]" value="1"  
onMouseout="window.status='';return true;">
-                                                                               
                <xsl:attribute name="onMouseover">
-                                                                               
                        <xsl:text>window.status='</xsl:text>
-                                                                               
                        <xsl:value-of select="//lang_list_address_statustext"/>
-                                                                               
                        <xsl:text>'; return true;</xsl:text>
-                                                                               
                </xsl:attribute>
-                                                                               
        </input>
-                                                                               
</xsl:otherwise>
-                                                                       
</xsl:choose>
+                                                                       
<xsl:value-of select="php:function('lang', 'list documents')" />                
                                        
                                                                </td>
+                                                               <td>
+                                                                       <input 
type="checkbox" name="values[list_documents]" value="1" >
+                                                                               
<xsl:attribute name="title">
+                                                                               
        <xsl:value-of select="php:function('lang', 'list documents at level')" 
/>
+                                                                               
</xsl:attribute>
+                                                                               
<xsl:if test="value_list_documents = '1'">
+                                                                               
        <xsl:attribute name="checked">
+                                                                               
                <xsl:text>checked</xsl:text>
+                                                                               
        </xsl:attribute>
+                                                                               
</xsl:if>
+                                                                       </input>
+                                                               </td>
                                                        </tr>
                                                </xsl:when>
                                        </xsl:choose>   




reply via email to

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