[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: property/inc class.sogab.inc.php,1.10,1.11 class
From: |
Sigurd Nes <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: property/inc class.sogab.inc.php,1.10,1.11 class.uigab.inc.php,1.9,1.10 |
Date: |
Thu, 03 Jul 2003 07:50:41 -0400 |
Update of /cvsroot/phpgroupware/property/inc
In directory subversions:/tmp/cvs-serv3720/inc
Modified Files:
class.sogab.inc.php class.uigab.inc.php
Log Message:
no message
Index: class.sogab.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.sogab.inc.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** class.sogab.inc.php 29 Jun 2003 15:43:11 -0000 1.10
--- class.sogab.inc.php 3 Jul 2003 11:50:38 -0000 1.11
***************
*** 19,22 ****
--- 19,24 ----
$this->bocommon =
CreateObject($this->currentapp.'.bocommon');
$this->socommon =
CreateObject($this->currentapp.'.socommon');
+ $this->insert_level = 3;
+
$this->join = $this->socommon->join;
***************
*** 248,259 ****
function add($gab)
{
! $next_type = count(explode('-',
$gab['location_code']))+1;
$gab['remark'] =
$this->db->db_addslashes($gab['remark']);
$gab_id= $gab['kommune_nr'] .
sprintf("%05s",$gab['gaards_nr']) . sprintf("%04s",$gab['bruks_nr']) .
sprintf("%04s",$gab['feste_nr']) . sprintf("%03s",$gab['seksjons_nr']);
! if($gab['propagate'])
{
! $sql = 'select location_code,loc' . $next_type
. '_name as location_name FROM fm_location' . $next_type . " where
location_code LIKE '%" . $gab['location_code'] . "%'";
$this->db->query($sql,__LINE__,__FILE__);
--- 250,274 ----
function add($gab)
{
! $location = explode('-', $gab['location_code']);
! $next_type = count($location)+1;
!
! //_debug_array($gab);
!
! $where= 'WHERE';
! for ($i=0;$i<count($location);$i++)
! {
! $where_condition .= " $where loc" . ($i+1) .
"='" . $location[$i] . "'";
! $where= 'AND';
! }
!
$gab['remark'] =
$this->db->db_addslashes($gab['remark']);
$gab_id= $gab['kommune_nr'] .
sprintf("%05s",$gab['gaards_nr']) . sprintf("%04s",$gab['bruks_nr']) .
sprintf("%04s",$gab['feste_nr']) . sprintf("%03s",$gab['seksjons_nr']);
! if($gab['propagate'] && ($next_type <
($this->insert_level+1)))
{
!
! // $sql = 'select location_code,loc' .
$this->insert_level . '_name as location_name FROM fm_location' .
$this->insert_level . " where location_code LIKE '%" . $gab['location_code'] .
"%'";
! $sql = 'SELECT location_code,loc' .
$this->insert_level . '_name as location_name FROM fm_location' .
$this->insert_level . " $where_condition ";
$this->db->query($sql,__LINE__,__FILE__);
***************
*** 279,283 ****
else
{
! $gab_insert[] = array('location_code'=>
$gab['location_code'],
'gab_id' => $gab_id,
'street_name' => $gab['street_name'],
--- 294,300 ----
else
{
! if(count($location)==$this->insert_level)
! {
! $gab_insert[] = array('location_code'=>
$gab['location_code'],
'gab_id' => $gab_id,
'street_name' => $gab['street_name'],
***************
*** 285,288 ****
--- 302,306 ----
'location_name' => $gab['location_name'],
'remark' => $gab['remark']);
+ }
}
***************
*** 293,297 ****
else
{
! $receipt['message'][] =
array('msg'=>lang('Could not find any location to save to!'));
}
--- 311,315 ----
else
{
! $receipt['error'][] = array('msg'=>lang('Could
not find any location to save to!'));
}
***************
*** 379,393 ****
function edit($gab)
{
//_debug_array($gab);
! $this->db->query("UPDATE fm_gab_location set
! remark ='" . $gab['remark'] .
"',
! entry_date ='" . time() . "',
! user_id ='" . $this->account
! . "' WHERE location_code= '" .
$gab['location_code'] ."' and gab_id= '" . $gab['gab_id']
."'",__LINE__,__FILE__);
$receipt['gab_id'] = $gab['gab_id'];
- $receipt['message'][] = array('msg'=>lang('gab %1 has
been edited',"'".$gab['gab_id']."'"));
- $receipt['message'][] = array('msg'=>lang('at location
%1',$gab['location_code']));
return $receipt;
--- 397,421 ----
function edit($gab)
{
+ $location = explode('-', $gab['location_code']);
+
//_debug_array($gab);
! if(count($location)==$this->insert_level)
! {
!
! $this->db->query("UPDATE fm_gab_location set
! remark ='" .
$gab['remark'] . "',
! entry_date ='" .
time() . "',
! user_id ='" .
$this->account
! . "' WHERE location_code= '" .
$gab['location_code'] ."' and gab_id= '" . $gab['gab_id']
."'",__LINE__,__FILE__);
+ $receipt['message'][] = array('msg'=>lang('gab
%1 has been edited',"'".$gab['gab_id']."'"));
+ $receipt['message'][] = array('msg'=>lang('at
location %1',$gab['location_code']));
+ }
+ else
+ {
+ $receipt['error'][] =
array('msg'=>lang('Nothing to do !'));
+ }
$receipt['gab_id'] = $gab['gab_id'];
return $receipt;
Index: class.uigab.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uigab.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** class.uigab.inc.php 30 Jun 2003 10:49:14 -0000 1.9
--- class.uigab.inc.php 3 Jul 2003 11:50:38 -0000 1.10
***************
*** 523,526 ****
--- 523,538 ----
$values['location_code'] = $location_code;
+ if(!$values['location_code'] &&
!$values['location'])
+ {
+
$receipt['error'][]=array('msg'=>lang('Please select a location !'));
+ }
+
+ $insert_level = 3;
+
+ if((count($values['location']) < $insert_level)
&& !$values['propagate'] && !$values['location_code'])
+ {
+ $receipt['error'][] =
array('msg'=>lang('Either select propagate - or choose the correct location
level !'));
+ }
+
//_debug_array($values);
if(!$receipt['error'])
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: property/inc class.sogab.inc.php,1.10,1.11 class.uigab.inc.php,1.9,1.10,
Sigurd Nes <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] CVS: property/inc class.acl2.inc.php,1.5,1.6 class.boadmin.inc.php,1.7,1.8 class.uiadmin.inc.php,1.12,1.13
- Next by Date:
[Phpgroupware-cvs] CVS: property/inc/export GABNr,1.3,1.4
- Previous by thread:
[Phpgroupware-cvs] CVS: property/inc class.acl2.inc.php,1.5,1.6 class.boadmin.inc.php,1.7,1.8 class.uiadmin.inc.php,1.12,1.13
- Next by thread:
[Phpgroupware-cvs] CVS: property/inc/export GABNr,1.3,1.4
- Index(es):