phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property inc/class.boadmin_location.inc.php inc...


From: Sigurd Nes
Subject: [Phpgroupware-cvs] property inc/class.boadmin_location.inc.php inc...
Date: Fri, 24 Nov 2006 10:11:50 +0000

CVSROOT:        /sources/phpgroupware
Module name:    property
Changes by:     Sigurd Nes <sigurdne>   06/11/24 10:11:50

Modified files:
        inc            : class.boadmin_location.inc.php 
                         class.soadmin_location.inc.php 
                         class.solocation.inc.php 
                         class.uiadmin_location.inc.php 
        setup          : default_records.inc.php setup.inc.php 
                         tables_current.inc.php tables_update.inc.php 
        templates/base : admin_location.xsl 

Log message:
        configurable name-listing at different location-levels

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.boadmin_location.inc.php?cvsroot=phpgroupware&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.soadmin_location.inc.php?cvsroot=phpgroupware&r1=1.33&r2=1.34
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.solocation.inc.php?cvsroot=phpgroupware&r1=1.42&r2=1.43
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.uiadmin_location.inc.php?cvsroot=phpgroupware&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/property/setup/default_records.inc.php?cvsroot=phpgroupware&r1=1.36&r2=1.37
http://cvs.savannah.gnu.org/viewcvs/property/setup/setup.inc.php?cvsroot=phpgroupware&r1=1.54&r2=1.55
http://cvs.savannah.gnu.org/viewcvs/property/setup/tables_current.inc.php?cvsroot=phpgroupware&r1=1.71&r2=1.72
http://cvs.savannah.gnu.org/viewcvs/property/setup/tables_update.inc.php?cvsroot=phpgroupware&r1=1.62&r2=1.63
http://cvs.savannah.gnu.org/viewcvs/property/templates/base/admin_location.xsl?cvsroot=phpgroupware&r1=1.3&r2=1.4

Patches:
Index: inc/class.boadmin_location.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.boadmin_location.inc.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- inc/class.boadmin_location.inc.php  12 Oct 2006 09:09:27 -0000      1.13
+++ inc/class.boadmin_location.inc.php  24 Nov 2006 10:11:49 -0000      1.14
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage admin
-       * @version $Id: class.boadmin_location.inc.php,v 1.13 2006/10/12 
09:09:27 sigurdne Exp $
+       * @version $Id: class.boadmin_location.inc.php,v 1.14 2006/11/24 
10:11:49 sigurdne Exp $
        */
 
        /**
@@ -226,5 +226,24 @@
 
                        return 
$this->bocommon->select_list($selected,$nullable);
                }
+               
+               function get_list_info($type_id='',$selected='')
+               {
+                       if($type_id)
+                       {
+                               $location_types= 
$this->so->select_location_type();
+
+                               for ($i=0; $i<($type_id); $i++)
+                               {
+                                       $location[$i] = $location_types[$i];
+                                       unset($location[$i]['list_info']);
+                                       if($selected[($i+1)])
+                                       {       
+                                               $location[$i]['selected'] = 
'selected';
+                                       }                               
+                               }
+                               return $location;
+                       }
+               }
        }
 ?>

Index: inc/class.soadmin_location.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.soadmin_location.inc.php,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34
--- inc/class.soadmin_location.inc.php  3 Nov 2006 09:15:15 -0000       1.33
+++ inc/class.soadmin_location.inc.php  24 Nov 2006 10:11:49 -0000      1.34
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage admin
-       * @version $Id: class.soadmin_location.inc.php,v 1.33 2006/11/03 
09:15:15 sigurdne Exp $
+       * @version $Id: class.soadmin_location.inc.php,v 1.34 2006/11/24 
10:11:49 sigurdne Exp $
        */
 
        /**
@@ -187,6 +187,8 @@
                                $standard['id']                 = 
$this->db->f('id');
                                $standard['name']               = 
$this->db->f('name');
                                $standard['descr']              = 
$this->db->f('descr');
+                               $standard['list_info']  = 
unserialize($this->db->f('list_info'));
+                               $standard['list_address']       = 
$this->db->f('list_address');
 
                                return $standard;
                        }
@@ -437,17 +439,23 @@
                        return $receipt;
                }
 
-               function edit($standard)
+               function edit($values)
                {
+
                        $table = 'fm_location_type';
 
-                       $standard['name'] = 
$this->db->db_addslashes($standard['name']);
-                       $standard['descr'] = 
$this->db->db_addslashes($standard['descr']);
+                       $value_set=array(
+                               'name'                  => 
$this->db->db_addslashes($values['name']),
+                               'descr'                 => 
$this->db->db_addslashes($values['descr']),
+                               'list_info'             => 
serialize($values['list_info']),
+                               'list_address'  => 
(isset($values['list_address'])?$values['list_address']:''),
+                               );
 
-                       $this->db->query("UPDATE $table set descr='" . 
$standard['descr'] . "', name='". $standard['name']
-                               . "' WHERE id='" . $standard['id']. 
"'",__LINE__,__FILE__);
+                       $value_set      = 
$this->bocommon->validate_db_update($value_set);
 
-                       $receipt['id'] = $standard['id'];
+                       $this->db->query("UPDATE $table SET $value_set WHERE 
id='" . $values['id']. "'",__LINE__,__FILE__);
+
+                       $receipt['id'] = $values['id'];
                        $receipt['message'][] = array('msg'=> lang('Standard 
has been edited'));
 
                        return $receipt;
@@ -1089,13 +1097,15 @@
                {
                        $this->db->query("SELECT * FROM fm_location_type ORDER 
BY id ");
 
-                       $i = 0;
                        while ($this->db->next_record())
                        {
-                               $location_type[$i]['id']                = 
$this->db->f('id');
-                               $location_type[$i]['name']              = 
stripslashes($this->db->f('name'));
-                               $location_type[$i]['descr']     = 
stripslashes($this->db->f('descr'));
-                               $i++;
+                               $location_type[]        = array(
+                                       'id'                    => 
$this->db->f('id'),
+                                       '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')
+                                       );
                        }
 //_debug_array($location_type);
 

Index: inc/class.solocation.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.solocation.inc.php,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -b -r1.42 -r1.43
--- inc/class.solocation.inc.php        23 Nov 2006 20:47:42 -0000      1.42
+++ inc/class.solocation.inc.php        24 Nov 2006 10:11:49 -0000      1.43
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage location
-       * @version $Id: class.solocation.inc.php,v 1.42 2006/11/23 20:47:42 
sigurdne Exp $
+       * @version $Id: class.solocation.inc.php,v 1.43 2006/11/24 10:11:49 
sigurdne Exp $
        */
 
        /**
@@ -216,15 +216,11 @@
 
                                // make this configurable
                                
-                               $location_naming = array
-                                                               (
-                                                                       1 => 
true,
-                                                                       2 => 
true
-                                                               );
+                               $list_info = 
$location_types[($type_id-1)]['list_info'];
                                
                                for ($i=1; $i<($type_id+1); $i++)
                                {
-                                       if(isset($location_naming[$i]) && 
$location_naming[$i])
+                                       if(isset($list_info[$i]) && 
$list_info[$i])
                                        {
                                                $cols.= ',fm_location' . $i . 
'.loc' . ($i) . '_name';
                                                $cols_return[]                  
        = 'loc' . ($i) . '_name';

Index: inc/class.uiadmin_location.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.uiadmin_location.inc.php,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- inc/class.uiadmin_location.inc.php  15 Oct 2006 20:14:14 -0000      1.22
+++ inc/class.uiadmin_location.inc.php  24 Nov 2006 10:11:49 -0000      1.23
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage admin
-       * @version $Id: class.uiadmin_location.inc.php,v 1.22 2006/10/15 
20:14:14 sigurdne Exp $
+       * @version $Id: class.uiadmin_location.inc.php,v 1.23 2006/11/24 
10:11:49 sigurdne Exp $
        */
 
        /**
@@ -34,7 +34,7 @@
                        'view'                  => True,
                        'edit'                  => True,
                        'delete'                => True,
-                       'list_attribute'        => True,
+                       'list_attribute'=> True,
                        'edit_attrib'           => True,
                );
 
@@ -263,7 +263,15 @@
                                'lang_descr_standardtext'               => 
lang('Enter a description of the standard'),
                                'lang_done_standardtext'                => 
lang('Back to the list'),
                                'lang_save_standardtext'                => 
lang('Save the standard'),
-                               'value_descr'                           => 
(isset($values['descr'])?$values['descr']:'')
+                               'value_descr'                                   
=> (isset($values['descr'])?$values['descr']:''),
+                               'lang_list_info'                                
=> lang('list info'),
+                               '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']:'')
                        );
 
                        $appname                                        = 
lang('location');

Index: setup/default_records.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/setup/default_records.inc.php,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -b -r1.36 -r1.37
--- setup/default_records.inc.php       31 Oct 2006 14:18:36 -0000      1.36
+++ setup/default_records.inc.php       24 Nov 2006 10:11:49 -0000      1.37
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage setup
-       * @version $Id: default_records.inc.php,v 1.36 2006/10/31 14:18:36 
sigurdne Exp $
+       * @version $Id: default_records.inc.php,v 1.37 2006/11/24 10:11:49 
sigurdne Exp $
        */
 
 
@@ -552,6 +552,10 @@
                . implode(',',$pk) . "','"
                . implode(',',$ix) . "')");
 
+       $GLOBALS['phpgw_setup']->oProc->query("UPDATE fm_location_type set 
list_info = '" . 'a:1:{i:1;s:1:"1";}' ."' WHERE id = '1'");
+       $GLOBALS['phpgw_setup']->oProc->query("UPDATE fm_location_type set 
list_info = '" . 'a:2:{i:1;s:1:"1";i:2;s:1:"2";}' ."' WHERE id = '2'");
+       $GLOBALS['phpgw_setup']->oProc->query("UPDATE fm_location_type set 
list_info = '" . 'a:3:{i:1;s:1:"1";i:2;s:1:"2";i:3;s:1:"3";}' ."' WHERE id = 
'3'");
+       $GLOBALS['phpgw_setup']->oProc->query("UPDATE fm_location_type set 
list_info = '" . 'a:1:{i:1;s:1:"1";}' ."' WHERE id = '4'");
 
        for ($i=0;$i<count($default_attrib['id']);$i++)
        {

Index: setup/setup.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/setup/setup.inc.php,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -b -r1.54 -r1.55
--- setup/setup.inc.php 13 Nov 2006 12:24:21 -0000      1.54
+++ setup/setup.inc.php 24 Nov 2006 10:11:49 -0000      1.55
@@ -8,12 +8,12 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage setup
-       * @version $Id: setup.inc.php,v 1.54 2006/11/13 12:24:21 sigurdne Exp $
+       * @version $Id: setup.inc.php,v 1.55 2006/11/24 10:11:49 sigurdne Exp $
        */
 
        $setup_info['property']['name']         = 'property';
        $setup_info['property']['title']        = 'Property';
-       $setup_info['property']['version']      = '0.9.17.533';
+       $setup_info['property']['version']      = '0.9.17.534';
        $setup_info['property']['app_order']    = 8;
        $setup_info['property']['enable']       = 1;
        $setup_info['property']['app_group']    = 'office';

Index: setup/tables_current.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/setup/tables_current.inc.php,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -b -r1.71 -r1.72
--- setup/tables_current.inc.php        31 Oct 2006 19:13:11 -0000      1.71
+++ setup/tables_current.inc.php        24 Nov 2006 10:11:49 -0000      1.72
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage setup
-       * @version $Id: tables_current.inc.php,v 1.71 2006/10/31 19:13:11 
sigurdne Exp $
+       * @version $Id: tables_current.inc.php,v 1.72 2006/11/24 10:11:49 
sigurdne Exp $
        */
 
        $phpgw_baseline = array(
@@ -217,6 +217,8 @@
                                'pk' => array('type' => 'text','nullable' => 
True),
                                'ix' => array('type' => 'text','nullable' => 
True),
                                'uc' => array('type' => 'text','nullable' => 
True),
+                               'list_info' => array('type' => 
'varchar','precision' => '255','nullable' => True),
+                               'list_address' => array('type' => 
'int','precision' => '2','nullable' => True),
                        ),
                        'pk' => array('id'),
                        'fk' => array(),

Index: setup/tables_update.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/setup/tables_update.inc.php,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -b -r1.62 -r1.63
--- setup/tables_update.inc.php 13 Nov 2006 12:24:21 -0000      1.62
+++ setup/tables_update.inc.php 24 Nov 2006 10:11:50 -0000      1.63
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage setup
-       * @version $Id: tables_update.inc.php,v 1.62 2006/11/13 12:24:21 
sigurdne Exp $
+       * @version $Id: tables_update.inc.php,v 1.63 2006/11/24 10:11:50 
sigurdne Exp $
        */
 
        /**
@@ -1667,4 +1667,22 @@
                return $GLOBALS['setup_info']['property']['currentver'];
        }
        
+       /**
+       * Update property version from 0.9.17.533 to 0.9.17.534
+       */
+
+       $test[] = '0.9.17.533';
+       function property_upgrade0_9_17_533()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_location_type','list_info', 
array('type' => 'varchar','precision' => '255','nullable' => True));
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_location_type','list_address', 
array('type' => 'int','precision' => '2','nullable' => True));
 
+               $GLOBALS['phpgw_setup']->oProc->query("UPDATE fm_location_type 
set list_info = '" . 'a:1:{i:1;s:1:"1";}' ."' WHERE id = '1'");
+               $GLOBALS['phpgw_setup']->oProc->query("UPDATE fm_location_type 
set list_info = '" . 'a:2:{i:1;s:1:"1";i:2;s:1:"2";}' ."' WHERE id = '2'");
+               $GLOBALS['phpgw_setup']->oProc->query("UPDATE fm_location_type 
set list_info = '" . 'a:3:{i:1;s:1:"1";i:2;s:1:"2";i:3;s:1:"3";}' ."' WHERE id 
= '3'");
+               $GLOBALS['phpgw_setup']->oProc->query("UPDATE fm_location_type 
set list_info = '" . 'a:1:{i:1;s:1:"1";}' ."' WHERE id = '4'");          
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
+               $GLOBALS['setup_info']['property']['currentver'] = '0.9.17.534';
+               return $GLOBALS['setup_info']['property']['currentver'];
+       }

Index: templates/base/admin_location.xsl
===================================================================
RCS file: /sources/phpgroupware/property/templates/base/admin_location.xsl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- templates/base/admin_location.xsl   12 Oct 2006 10:51:12 -0000      1.3
+++ templates/base/admin_location.xsl   24 Nov 2006 10:11:50 -0000      1.4
@@ -1,4 +1,4 @@
-<!-- $Id: admin_location.xsl,v 1.3 2006/10/12 10:51:12 sigurdne Exp $ -->
+<!-- $Id: admin_location.xsl,v 1.4 2006/11/24 10:11:50 sigurdne Exp $ -->
 
        <xsl:template name="app_data">
                <xsl:choose>
@@ -376,6 +376,46 @@
 
                                </td>
                        </tr>
+                       <xsl:choose>
+                               <xsl:when test="value_id != ''">
+                                       <tr>
+                                               <td valign="top">
+                                                       <xsl:value-of 
select="lang_list_info"/>
+                                               </td>
+                                               <td align="right">
+                                                       <xsl:call-template 
name="list_info"/>
+                                               </td>
+                                       </tr>
+                                       
+                                       <tr>
+                                               <td valign="top">
+                                                       <xsl:value-of 
select="lang_list_address"/>
+                                               </td>
+                                               <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>
+                                       </td>
+                                       </tr>
+                               </xsl:when>
+                       </xsl:choose>   
                        <tr height="50">
                                <td>
                                        <xsl:variable 
name="lang_save"><xsl:value-of select="lang_save"/></xsl:variable>
@@ -885,3 +925,59 @@
                        </tr>
                        </table>
        </xsl:template>
+
+       <xsl:template name="list_info">
+               <table cellpadding="2" cellspacing="2" width="80%" align="left">
+                       <tr class="th">
+                               <td class="th_text" width="85%" align="left">
+                                       <xsl:value-of select="lang_location"/>
+                               </td>
+                               <td class="th_text" width="15%" align="center">
+                                       <xsl:value-of select="lang_select"/>
+                               </td>
+                       </tr>
+                       <xsl:for-each select="value_list_info" >
+                               <tr>
+                                       <xsl:attribute name="class">
+                                               <xsl:choose>
+                                                       <xsl:when test="@class">
+                                                               <xsl:value-of 
select="@class"/>
+                                                       </xsl:when>
+                                                       <xsl:when 
test="position() mod 2 = 0">
+                                                               
<xsl:text>row_off</xsl:text>
+                                                       </xsl:when>
+                                                       <xsl:otherwise>
+                                                               
<xsl:text>row_on</xsl:text>
+                                                       </xsl:otherwise>
+                                               </xsl:choose>
+                                       </xsl:attribute>
+                                       <td align="left">
+                                               <xsl:value-of select="name"/>
+                                               <xsl:text> </xsl:text>
+                                       </td>
+                                       <td align="center">
+                                               <xsl:choose>
+                                                       <xsl:when 
test="selected='selected'">
+                                                               <input 
type="checkbox" name="values[list_info][{id}]" value="{id}"  checked="checked" 
onMouseout="window.status='';return true;">
+                                                                       
<xsl:attribute name="onMouseover">
+                                                                               
<xsl:text>window.status='</xsl:text>
+                                                                               
        <xsl:value-of select="//lang_list_type_statustext"/>
+                                                                               
<xsl:text>'; return true;</xsl:text>
+                                                                       
</xsl:attribute>
+                                                               </input>
+                                                       </xsl:when>
+                                                       <xsl:otherwise>
+                                                               <input 
type="checkbox" name="values[list_info][{id}]" value="{id}"  
onMouseout="window.status='';return true;">
+                                                                       
<xsl:attribute name="onMouseover">
+                                                                               
<xsl:text>window.status='</xsl:text>
+                                                                               
        <xsl:value-of select="//lang_list_type_statustext"/>
+                                                                               
<xsl:text>'; return true;</xsl:text>
+                                                                       
</xsl:attribute>
+                                                               </input>
+                                                       </xsl:otherwise>
+                                               </xsl:choose>
+                                       </td>
+                               </tr>
+                       </xsl:for-each>
+               </table>
+       </xsl:template>




reply via email to

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