[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] property inc/class.bolocation.inc.php inc/class...
From: |
Sigurd Nes |
Subject: |
[Phpgroupware-cvs] property inc/class.bolocation.inc.php inc/class... |
Date: |
Fri, 24 Nov 2006 12:33:35 +0000 |
CVSROOT: /sources/phpgroupware
Module name: property
Changes by: Sigurd Nes <sigurdne> 06/11/24 12:33:35
Modified files:
inc : class.bolocation.inc.php class.soadmin.inc.php
class.solocation.inc.php
class.uiadmin_custom.inc.php
class.uilocation.inc.php
templates/base : location.xsl
Log message:
formatting
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.bolocation.inc.php?cvsroot=phpgroupware&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.soadmin.inc.php?cvsroot=phpgroupware&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.solocation.inc.php?cvsroot=phpgroupware&r1=1.44&r2=1.45
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.uiadmin_custom.inc.php?cvsroot=phpgroupware&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.uilocation.inc.php?cvsroot=phpgroupware&r1=1.41&r2=1.42
http://cvs.savannah.gnu.org/viewcvs/property/templates/base/location.xsl?cvsroot=phpgroupware&r1=1.10&r2=1.11
Patches:
Index: inc/class.bolocation.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.bolocation.inc.php,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- inc/class.bolocation.inc.php 30 Oct 2006 09:49:13 -0000 1.23
+++ inc/class.bolocation.inc.php 24 Nov 2006 12:33:34 -0000 1.24
@@ -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.bolocation.inc.php,v 1.23 2006/10/30 09:49:13
sigurdne Exp $
+ * @version $Id: class.bolocation.inc.php,v 1.24 2006/11/24 12:33:34
sigurdne Exp $
*/
/**
@@ -575,45 +575,6 @@
function
save($location,$values_attribute,$action='',$type_id='',$location_code_parent='')
{
-
-
-//_debug_array($values_attribute);
-/* $location_datatype =
$GLOBALS['phpgw']->session->appsession('location_datatype',$this->currentapp);
-// _debug_array($location_datatype);
-
- if(is_array($location_datatype))
- {
- for ($i=0;$i<count($location_datatype);$i++)
- {
-
if($location_datatype[$i]['datatype']=='decimal' &&
$location[$location_datatype[$i]['input_name']])
- {
-
$location[$location_datatype[$i]['input_name']] =
str_replace(",",".",$location[$location_datatype[$i]['input_name']]);
- }
-
-
if($location_datatype[$i]['datatype']=='date' &&
$location[$location_datatype[$i]['input_name']])
- {
- $dateformat=
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
- $dateformat =
str_replace(".","",$dateformat);
- $dateformat =
str_replace("-","",$dateformat);
- $dateformat =
str_replace("/","",$dateformat);
- $y=strpos($dateformat,'Y');
- $d=strpos($dateformat,'d');
- $m=strpos($dateformat,'m');
-
- $dateparts = explode('/',
$location[$location_datatype[$i]['input_name']]);
- $day =
$dateparts[$d];
- $month =
$dateparts[$m];
- $year =
$dateparts[$y];
-
-//
$location[$location_datatype[$i]['input_name']] =
date($this->bocommon->dateformat,mktime(2,0,0,$month,$day,$year));
-
$location[$location_datatype[$i]['input_name']] =
mktime(0,0,0,$month,$day,$year);
-
- }
- }
- }
-
-*/
-
$m=count($values_attribute);
for ($i=0;$i<$m;$i++)
{
@@ -642,13 +603,6 @@
}
}
-
-//_debug_array($values_attribute);
-
-
-
-// _debug_array($location);
-
if ($action=='edit')
{
if
($this->so->check_location($location['location_code'],$type_id))
@@ -670,13 +624,27 @@
$receipt['error'][]=array('msg'=>lang('This location parent ID does not
exist!'));
}
}
-
*/
if(!$receipt['error'])
{
$receipt =
$this->so->add($location,$values_attribute,$type_id);
}
}
+
+
+ $soadmin_custom =
CreateObject($this->currentapp.'.soadmin_custom');
+ $custom_functions =
$soadmin_custom->read(array('acl_location' =>
$this->acl_location,'allrows'=>True));
+
+ if (isSet($custom_functions) AND
is_array($custom_functions))
+ {
+ foreach($custom_functions as $entry)
+ {
+ if (is_file(PHPGW_APP_INC . SEP .
'custom' . SEP . $entry['file_name']) && $entry['active'])
+ include (PHPGW_APP_INC . SEP . 'custom'
. SEP . $entry['file_name']);
+ }
+ }
+
+
return $receipt;
}
Index: inc/class.soadmin.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.soadmin.inc.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- inc/class.soadmin.inc.php 22 Oct 2006 19:28:55 -0000 1.10
+++ inc/class.soadmin.inc.php 24 Nov 2006 12:33:34 -0000 1.11
@@ -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.inc.php,v 1.10 2006/10/22 19:28:55
sigurdne Exp $
+ * @version $Id: class.soadmin.inc.php,v 1.11 2006/11/24 12:33:34
sigurdne Exp $
*/
/**
@@ -58,9 +58,9 @@
$filter = '';
if($grant)
{
- $filter = ' WHERE allow_grant=1';
+ $filter = ' AND allow_grant=1';
}
- $this->db->query("SELECT * FROM phpgw_acl_location
$filter ORDER BY id ");
+ $this->db->query("SELECT * FROM phpgw_acl_location
WHERE appname = '{$this->currentapp}' $filter ORDER BY id ");
$i = 0;
while ($this->db->next_record())
Index: inc/class.solocation.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.solocation.inc.php,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -b -r1.44 -r1.45
--- inc/class.solocation.inc.php 24 Nov 2006 10:44:34 -0000 1.44
+++ inc/class.solocation.inc.php 24 Nov 2006 12:33:34 -0000 1.45
@@ -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.44 2006/11/24 10:44:34
sigurdne Exp $
+ * @version $Id: class.solocation.inc.php,v 1.45 2006/11/24 12:33:34
sigurdne Exp $
*/
/**
@@ -202,6 +202,7 @@
$uicols['descr'][] = 'dummy';
$uicols['statustext'][] = 'dummy';
$uicols['exchange'][] = false;
+ $uicols['align'][] = '';
for ($i=0; $i<($type_id); $i++)
{
@@ -210,12 +211,11 @@
$uicols['descr'][]
= $location_types[$i]['name'];
$uicols['statustext'][] =
$location_types[$i]['descr'];
$uicols['exchange'][] = True;
+ $uicols['align'][]
= 'center';
$cols
.= ",fm_location" . ($type_id) .".loc" . $location_types[$i]['id'];
$cols_return[]
= 'loc' . $location_types[$i]['id'];
}
- // make this configurable
-
$list_info =
$location_types[($type_id-1)]['list_info'];
for ($i=1; $i<($type_id+1); $i++)
@@ -229,43 +229,10 @@
$uicols['descr'][]
= $location_types[($i-1)]['name'] . ' ' . lang('name');
$uicols['statustext'][]
= $location_types[($i-1)]['name'] . ' ' . lang('name');
$uicols['exchange'][]
= True;
+ $uicols['align'][]
= 'left';
}
}
- // $street_level =
$this->soadmin_location->read_config_single('street_id');
- // if ($street_level > $type_id)
-/* {
- $cols.= ',fm_location1.loc1_name as
loc1_name';
- $cols_return[]
= 'loc1_name';
- $uicols['input_type'][] =
'text';
- $uicols['name'][]
= 'loc1_name';
- $uicols['descr'][]
= $location_types[0]['name'] . ' ' . lang('name');
- $uicols['statustext'][] =
$location_types[0]['name'] . ' ' . lang('name');
- $uicols['exchange'][] = True;
-
- if($type_id>1)
- {
- $cols.= ',fm_location' .
$type_id . '.loc' . $type_id . '_name';
- $cols_return[]
= 'loc' . $type_id . '_name';
- $uicols['input_type'][]
= 'text';
- $uicols['name'][]
= 'loc' . $type_id . '_name';
- $uicols['descr'][]
= lang('Name');
- $uicols['statustext'][]
= lang('Name');
- $uicols['exchange'][]
= True;
- }
- }
-*/
-/* for ($i=2;$i<($type_id+1);$i++)
- {
- $cols.= ',fm_location' . $i . '.loc' .
$i . '_name';
- $cols_return[]
= 'loc' . $i . '_name';
- $uicols['input_type'][] =
'text';
- $uicols['name'][]
= 'loc' . $i . '_name';
- $uicols['descr'][]
= '';
- $uicols['statustext'][] = '';
- }
-
-*/
$joinmethod ='';
$paranthesis = '';
for ($j=($type_id-1); $j>0; $j--)
@@ -299,6 +266,7 @@
$uicols['descr'][]
= 'dummy';
$uicols['statustext'][] =
'dummy';
$uicols['exchange'][] = True;
+ $uicols['align'][]
= '';
$cols.= ',fm_tenant.last_name';
$cols_return[]
= 'last_name';
@@ -307,6 +275,7 @@
$uicols['descr'][]
= lang('last name');
$uicols['statustext'][] =
lang('last name');
$uicols['exchange'][] = True;
+ $uicols['align'][]
= 'left';
$cols.= ',fm_tenant.first_name';
$cols_return[]
= 'first_name';
@@ -315,6 +284,7 @@
$uicols['descr'][]
= lang('first name');
$uicols['statustext'][] =
lang('first name');
$uicols['exchange'][] = True;
+ $uicols['align'][]
= 'left';
$cols.= ',fm_tenant.contact_phone';
$cols_return[]
= 'contact_phone';
@@ -323,6 +293,7 @@
$uicols['descr'][]
= lang('contact phone');
$uicols['statustext'][] =
lang('contact phone');
$uicols['exchange'][] = True;
+ $uicols['align'][]
= 'left';
$sub_query_tenant=1;
$this->socommon->fm_cache('sub_query_tenant_'. $type_id . '_' . $lookup_tenant
. '_' . $lookup,$sub_query_tenant);
@@ -362,6 +333,7 @@
$uicols['descr'][] = lang('street name');
$uicols['statustext'][] = lang('street name');
$uicols['exchange'][] = True;
+
$uicols['align'][] = 'left';
$cols.=
',street_number';
$cols_return[]
= 'street_number';
@@ -370,6 +342,7 @@
$uicols['descr'][] = lang('street number');
$uicols['statustext'][] = lang('street number');
$uicols['exchange'][] = True;
+
$uicols['align'][] = 'right';
}
$cols.= ',fm_location'
. $config[$i]['location_type'] . '.' . $config[$i]['column_name'];
@@ -379,6 +352,7 @@
$uicols['descr'][]
= lang($config[$i]['input_text']);
$uicols['statustext'][]
= lang($config[$i]['input_text']);
$uicols['exchange'][]
= True;
+ $uicols['align'][]
= '';
}
else
{
@@ -389,13 +363,13 @@
$uicols['descr'][]
= $config[$i]['input_text'];
$uicols['statustext'][]
= $config[$i]['input_text'];
$uicols['exchange'][]
= True;
+ $uicols['align'][]
= '';
}
}
}
$fm_location_cols =
$this->soadmin_location->read_attrib(array('type_id'=>$type_id,'lookup_type'=>$type_id));
-//_debug_array($fm_location_cols);
$k = count($uicols['name']);
$location_cols_count =
count($fm_location_cols);
@@ -410,6 +384,11 @@
$uicols['descr'][]
= $fm_location_cols[$i]['input_text'];
$uicols['statustext'][]
= $fm_location_cols[$i]['statustext'];
+
if(($fm_location_cols[$i]['datatype'] == 'I' ||
$fm_location_cols[$i]['datatype'] == 'N'))
+ {
+ $uicols['align'][$k] =
'right';
+ }
+
$uicols['cols_return_extra'][$k]= array(
'id' => $k,
'name' =>
$fm_location_cols[$i]['column_name'],
Index: inc/class.uiadmin_custom.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.uiadmin_custom.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- inc/class.uiadmin_custom.inc.php 5 Oct 2006 11:33:53 -0000 1.7
+++ inc/class.uiadmin_custom.inc.php 24 Nov 2006 12:33:34 -0000 1.8
@@ -10,7 +10,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage admin
- * @version $Id: class.uiadmin_custom.inc.php,v 1.7 2006/10/05 11:33:53
sigurdne Exp $
+ * @version $Id: class.uiadmin_custom.inc.php,v 1.8 2006/11/24 12:33:34
sigurdne Exp $
*/
/**
@@ -197,7 +197,6 @@
'cat_id' => $this->cat_id
);
-
$data = array
(
'lang_custom'
=> lang('entity'),
@@ -313,7 +312,6 @@
$data = array
(
'lang_custom' =>
lang('custom'),
-
'msgbox_data' =>
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
'form_action' =>
$GLOBALS['phpgw']->link('/index.php',$link_data),
'done_action' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
$this->currentapp.'.uiadmin_custom.index', 'cat_id'=> $this->cat_id)),
Index: inc/class.uilocation.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.uilocation.inc.php,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -b -r1.41 -r1.42
--- inc/class.uilocation.inc.php 27 Oct 2006 10:55:48 -0000 1.41
+++ inc/class.uilocation.inc.php 24 Nov 2006 12:33:34 -0000 1.42
@@ -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.uilocation.inc.php,v 1.41 2006/10/27 10:55:48
sigurdne Exp $
+ * @version $Id: class.uilocation.inc.php,v 1.42 2006/11/24 12:33:34
sigurdne Exp $
*/
/**
@@ -182,6 +182,7 @@
$content[$j]['row'][$i]['value'] =
$location[$uicols['name'][$i]];
$content[$j]['row'][$i]['name'] = $uicols['name'][$i];
$content[$j]['row'][$i]['lookup'] = $lookup;
+
$content[$j]['row'][$i]['align'] =
(isset($uicols['align'][$i])?$uicols['align'][$i]:'center');
}
}
Index: templates/base/location.xsl
===================================================================
RCS file: /sources/phpgroupware/property/templates/base/location.xsl,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- templates/base/location.xsl 27 Oct 2006 10:55:49 -0000 1.10
+++ templates/base/location.xsl 24 Nov 2006 12:33:34 -0000 1.11
@@ -1,4 +1,4 @@
-<!-- $Id: location.xsl,v 1.10 2006/10/27 10:55:49 sigurdne Exp $ -->
+<!-- $Id: location.xsl,v 1.11 2006/11/24 12:33:34 sigurdne Exp $ -->
<xsl:template name="app_data">
<xsl:choose>
@@ -177,7 +177,7 @@
</td>
</xsl:when>
<xsl:otherwise>
- <td class="small_text"
align="left">
+ <td class="small_text"
align="{align}">
<xsl:value-of
select="value"/>
<xsl:choose>
<xsl:when test="lookup=1">