phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property inc/class.bocommon.inc.php inc/class.b...


From: Sigurd Nes
Subject: [Phpgroupware-cvs] property inc/class.bocommon.inc.php inc/class.b...
Date: Wed, 27 Sep 2006 10:51:08 +0000

CVSROOT:        /sources/phpgroupware
Module name:    property
Changes by:     Sigurd Nes <sigurdne>   06/09/27 10:51:08

Modified files:
        inc            : class.bocommon.inc.php class.boentity.inc.php 
                         class.soentity.inc.php class.uientity.inc.php 
        templates/base : entity.xsl 

Log message:
        

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.bocommon.inc.php?cvsroot=phpgroupware&r1=1.39&r2=1.40
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.boentity.inc.php?cvsroot=phpgroupware&r1=1.21&r2=1.22
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.soentity.inc.php?cvsroot=phpgroupware&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.uientity.inc.php?cvsroot=phpgroupware&r1=1.26&r2=1.27
http://cvs.savannah.gnu.org/viewcvs/property/templates/base/entity.xsl?cvsroot=phpgroupware&r1=1.8&r2=1.9

Patches:
Index: inc/class.bocommon.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.bocommon.inc.php,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -b -r1.39 -r1.40
--- inc/class.bocommon.inc.php  26 Sep 2006 18:29:27 -0000      1.39
+++ inc/class.bocommon.inc.php  27 Sep 2006 10:51:08 -0000      1.40
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage core
-       * @version $Id: class.bocommon.inc.php,v 1.39 2006/09/26 18:29:27 
sigurdne Exp $
+       * @version $Id: class.bocommon.inc.php,v 1.40 2006/09/27 10:51:08 
sigurdne Exp $
        */
 
        /**
@@ -1007,14 +1007,6 @@
                        $location_level         = 
(isset($data['location_level'])?$data['location_level']:'');
                        $no_address     = 
(isset($data['no_address'])?$data['no_address']:'');
 
-                       $this->join = $this->socommon->join;
-
-                       $joinmethod .= " $this->join  fm_location1 ON 
($entity_table.loc1 = fm_location1.loc1))";
-                       $paranthesis .='(';
-                       $joinmethod .= " $this->join  fm_part_of_town ON 
(fm_location1.part_of_town_id = fm_part_of_town.part_of_town_id))";
-                       $paranthesis .='(';
-                       $joinmethod .= " $this->join  fm_owner ON 
(fm_location1.owner_id = fm_owner.id))";
-                       $paranthesis .='(';
 
                        $soadmin_location       = 
CreateObject($this->currentapp.'.soadmin_location');
                        $location_types = 
$soadmin_location->select_location_type();
@@ -1023,10 +1015,18 @@
                        if($location_level)
                        {
                                $type_id=$location_level;
+                               $this->join = $this->socommon->join;
+                               $joinmethod .= " $this->join  fm_location1 ON 
($entity_table.loc1 = fm_location1.loc1))";
+                               $paranthesis .='(';
+                               $joinmethod .= " $this->join  fm_part_of_town 
ON (fm_location1.part_of_town_id = fm_part_of_town.part_of_town_id))";
+                               $paranthesis .='(';
+                               $joinmethod .= " $this->join  fm_owner ON 
(fm_location1.owner_id = fm_owner.id))";
+                               $paranthesis .='(';
                        }
                        else
                        {
-                               $type_id        = count($location_types);
+                               $type_id        = 0;//count($location_types);
+                               $no_address     = True;
                        }
                        $this->type_id  = $type_id;
 

Index: inc/class.boentity.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.boentity.inc.php,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- inc/class.boentity.inc.php  20 Sep 2006 08:41:47 -0000      1.21
+++ inc/class.boentity.inc.php  27 Sep 2006 10:51:08 -0000      1.22
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage entity
-       * @version $Id: class.boentity.inc.php,v 1.21 2006/09/20 08:41:47 
sigurdne Exp $
+       * @version $Id: class.boentity.inc.php,v 1.22 2006/09/27 10:51:08 
sigurdne Exp $
        */
 
        /**
@@ -497,7 +497,7 @@
                                }
                        }
 
-                       $values['location_code']=implode("-", $location);
+                       $values['location_code']=(isset($location)?implode("-", 
$location):'');
 
                        $values['date'] = 
$this->bocommon->date_to_timestamp($values['date']);
 

Index: inc/class.soentity.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.soentity.inc.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- inc/class.soentity.inc.php  24 Mar 2006 19:30:21 -0000      1.17
+++ inc/class.soentity.inc.php  27 Sep 2006 10:51:08 -0000      1.18
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage entity
-       * @version $Id: class.soentity.inc.php,v 1.17 2006/03/24 19:30:21 
sigurdne Exp $
+       * @version $Id: class.soentity.inc.php,v 1.18 2006/09/27 10:51:08 
sigurdne Exp $
        */
 
        /**

Index: inc/class.uientity.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.uientity.inc.php,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- inc/class.uientity.inc.php  20 Sep 2006 08:41:47 -0000      1.26
+++ inc/class.uientity.inc.php  27 Sep 2006 10:51:08 -0000      1.27
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage entity
-       * @version $Id: class.uientity.inc.php,v 1.26 2006/09/20 08:41:47 
sigurdne Exp $
+       * @version $Id: class.uientity.inc.php,v 1.27 2006/09/27 10:51:08 
sigurdne Exp $
        */
 
        /**
@@ -449,6 +449,27 @@
                                $record_limit   = $this->bo->total_records;
                        }
 
+                       if($this->entity_id)
+                       {
+                               $entity         = 
$this->boadmin_entity->read_single($this->entity_id,false);
+                               $appname        = $entity['name'];
+                       }
+                       if($this->cat_id)
+                       {
+                               $category = 
$this->boadmin_entity->read_single_category($this->entity_id,$this->cat_id);
+                               $function_msg   = 'list ' . $category['name'];
+                               $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                               if (isset($category['location_level']) && 
$category['location_level']>0)
+                               {
+                                       $district_list  = 
$this->bocommon->select_district_list($group_filters,$this->district_id);
+                               }
+                               else
+                               {
+                                       $district_list ='';
+                               }
+                       }
+
+
                        $data = array
                        (
                                'group_filters'                         => 
$GLOBALS['phpgw_info']['user']['preferences'][$this->currentapp]['group_filters'],
@@ -479,7 +500,7 @@
                                'link_url'                              => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
                                'img_path'                              => 
$GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
 
-                               'district_list'                         => 
$this->bocommon->select_district_list($group_filters,$this->district_id),
+                               'district_list'                         => 
$district_list,
                                'lang_no_district'                      => 
lang('no district'),
                                'lang_district_statustext'              => 
lang('Select the district the selection belongs to. To do not use a district 
select NO DISTRICT'),
                                'select_district_name'                  => 
'district_id',
@@ -510,17 +531,6 @@
                                'table_add'                             => 
$table_add
                        );
 
-                       if($this->entity_id)
-                       {
-                               $entity         = 
$this->boadmin_entity->read_single($this->entity_id,false);
-                               $appname        = $entity['name'];
-                       }
-                       if($this->cat_id)
-                       {
-                               $category = 
$this->boadmin_entity->read_single_category($this->entity_id,$this->cat_id);
-                               $function_msg   = 'list ' . $category['name'];
-                               $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       }
 
                        if(!$this->entity_id || !$this->cat_id)
                        {
@@ -648,9 +658,19 @@
                                $lookup_tenant=True;
                        }
 
+                       if($this->cat_id)
+                       {
+                               $category = 
$this->boadmin_entity->read_single_category($this->entity_id,$this->cat_id);
+                       }
+                       else
+                       {
+                               $cat_list = 
$this->bo->select_category_list('select',$this->cat_id);
+                       }
+
+
                        if ($values['save'])
                        {
-                               if(!$values['location'])
+                               if(!$values['location'] && 
isset($category['location_level']) && $category['location_level'])
                                {
                                        
$receipt['error'][]=array('msg'=>lang('Please select a location !'));
                                        $error_id=true;
@@ -735,14 +755,6 @@
                                }
                        }
 
-                       if($this->cat_id)
-                       {
-                               $category = 
$this->boadmin_entity->read_single_category($this->entity_id,$this->cat_id);
-                       }
-                       else
-                       {
-                               $cat_list = 
$this->bo->select_category_list('select',$this->cat_id);
-                       }
 
                        $lookup_type='form';
 
@@ -783,7 +795,7 @@
 
 
 
-                       if($entity['location_form'])
+                       if($entity['location_form'] && 
$category['location_level'] > 0 )
                        {
                                
$location_data=$bolocation->initiate_ui_location(array(
                                                'values'        => 
$values['location_data'],

Index: templates/base/entity.xsl
===================================================================
RCS file: /sources/phpgroupware/property/templates/base/entity.xsl,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- templates/base/entity.xsl   10 Apr 2006 09:39:13 -0000      1.8
+++ templates/base/entity.xsl   27 Sep 2006 10:51:08 -0000      1.9
@@ -1,4 +1,4 @@
-<!-- $Id: entity.xsl,v 1.8 2006/04/10 09:39:13 sigurdne Exp $ -->
+<!-- $Id: entity.xsl,v 1.9 2006/09/27 10:51:08 sigurdne Exp $ -->
 
        <xsl:template name="app_data">
                <xsl:choose>
@@ -34,9 +34,13 @@
                                                <td>
                                                        <xsl:call-template 
name="cat_select"/>
                                                </td>
+                                               <xsl:choose>
+                                                       <xsl:when 
test="district_list != ''">
                                                <td>
                                                        <xsl:call-template 
name="select_district"/>
                                                </td>
+                                                       </xsl:when>
+                                               </xsl:choose>
                                                <xsl:choose>
                                                        <xsl:when 
test="status_list!=''">
                                                                <td 
align="left">
@@ -56,9 +60,13 @@
                                        <td>
                                                <xsl:call-template 
name="cat_filter"/>
                                        </td>
-                                       <td>
+                                       <xsl:choose>
+                                               <xsl:when 
test="district_list!=''">
+                                                       <td align="left">
                                                <xsl:call-template 
name="filter_district"/>
                                        </td>
+                                               </xsl:when>
+                                       </xsl:choose>
                                        <xsl:choose>
                                                <xsl:when 
test="status_list!=''">
                                                        <td align="left">




reply via email to

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