[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] property/inc class.soentity.inc.php, 1.9, 1.10 class.
From: |
Sigurd Nes <address@hidden> |
Subject: |
[Phpgroupware-cvs] property/inc class.soentity.inc.php, 1.9, 1.10 class.boentity.inc.php, 1.6, 1.7 class.uientity.inc.php, 1.8, 1.9 class.uilookup.inc.php, 1.32, 1.33 class.bocommon.inc.php, 1.91, 1.92 class.boadmin_entity.inc.php, 1.7, 1.8 class.soproject.inc.php, 1.44, 1.45 class.soadmin_entity.inc.php, 1.9, 1.10 class.soworkorder.inc.php, 1.32, 1.33 class.uiadmin_entity.inc.php, 1.8, 1.9 class.bolocation.inc.php, 1.31, 1.32 |
Date: |
Mon, 03 Nov 2003 18:01:15 +0000 |
Update of /cvsroot/phpgroupware/property/inc
In directory subversions:/tmp/cvs-serv11508/inc
Modified Files:
class.soentity.inc.php class.boentity.inc.php
class.uientity.inc.php class.uilookup.inc.php
class.bocommon.inc.php class.boadmin_entity.inc.php
class.soproject.inc.php class.soadmin_entity.inc.php
class.soworkorder.inc.php class.uiadmin_entity.inc.php
class.bolocation.inc.php
Log Message:
no message
Index: class.soproject.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soproject.inc.php,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -d -r1.44 -r1.45
*** class.soproject.inc.php 29 Oct 2003 17:28:43 -0000 1.44
--- class.soproject.inc.php 3 Nov 2003 18:01:12 -0000 1.45
***************
*** 195,216 ****
$where= 'WHERE';
- $filtermethod = $where . ' ( fm_project.user_id=' .
$this->account;
- if (is_array($this->grants))
- {
- $grants = $this->grants;
- while (list($user) = each($grants))
- {
- $public_user_list[] = $user;
- }
- reset($public_user_list);
- $filtermethod = " $where
(fm_project.access='public' AND fm_project.user_id IN(" .
implode(',',$public_user_list) . "))";
- }
- else
- {
- $filtermethod .= ')';
- }
-
- $where= 'AND';
-
if ($cat_id > 0)
{
--- 195,198 ----
***************
*** 225,238 ****
}
! if (!$filter):
{
! return;
}
! elseif($filter!='all'):
{
$filtermethod .= " $where
fm_project.coordinator=$filter ";
$where= 'AND';
}
- endif;
if ($start_date)
--- 207,231 ----
}
! if ($filter=='all')
{
! if (is_array($this->grants))
! {
! $grants = $this->grants;
! while (list($user) = each($grants))
! {
! $public_user_list[] = $user;
! }
! reset($public_user_list);
! $filtermethod .= " $where
(fm_project.coordinator IN(" . implode(',',$public_user_list) . "))";
!
! $where= 'AND';
! }
!
}
! else
{
$filtermethod .= " $where
fm_project.coordinator=$filter ";
$where= 'AND';
}
if ($start_date)
Index: class.bocommon.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.bocommon.inc.php,v
retrieving revision 1.91
retrieving revision 1.92
diff -C2 -d -r1.91 -r1.92
*** class.bocommon.inc.php 29 Oct 2003 20:46:13 -0000 1.91
--- class.bocommon.inc.php 3 Nov 2003 18:01:12 -0000 1.92
***************
*** 824,833 ****
$paranthesis .='(';
-
$soadmin_location =
CreateObject($this->currentapp.'.soadmin_location');
$location_types =
$soadmin_location->select_location_type();
$config = $soadmin_location->read_config('');
-
if($location_level)
{
--- 824,831 ----
***************
*** 840,847 ****
$this->type_id = $type_id;
- $fm_location_cols =
$soadmin_location->read_attrib(array('type_id'=>$type_id,'lookup_type'=>$type_id));
-
- unset($soadmin_location);
-
for ($i=0; $i<$type_id; $i++)
{
--- 838,841 ----
***************
*** 853,856 ****
--- 847,851 ----
}
/*
+ $fm_location_cols =
$soadmin_location->read_attrib(array('type_id'=>$type_id,'lookup_type'=>$type_id));
$location_cols_count = count($fm_location_cols);
***************
*** 869,872 ****
--- 864,869 ----
*/
+ unset($soadmin_location);
+
for ($i=0; $i< $this->type_id; $i++)
{
***************
*** 874,886 ****
}
- /* $cols_return[] = 'loc1_name';
- $cols_extra[] = 'loc1_name';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] = 'loc1_name';
- $uicols['descr'][] =
lang('Property Name');
- $uicols['statustext'][] = lang('Property Name');
- */
if($lookup)
{
for ($i=2;$i<($type_id+1);$i++)
{
--- 871,883 ----
}
if($lookup)
{
+ $cols_return[] =
'loc1_name';
+ $cols_extra[] =
'loc1_name';
+ $uicols['input_type'][] = 'text';
+ $uicols['name'][] =
'loc1_name';
+ $uicols['descr'][] =
lang('Property Name');
+ $uicols['statustext'][] =
lang('Property Name');
+
for ($i=2;$i<($type_id+1);$i++)
{
***************
*** 912,916 ****
$cols_return[]
= 'street_name';
- // $cols_extra[]
= 'street_name';
$uicols['input_type'][]
= 'hidden';
$uicols['name'][]
= 'street_name';
--- 909,912 ----
***************
*** 919,923 ****
$cols_return[]
= 'street_number';
- // $cols_extra[]
= 'street_number';
$uicols['input_type'][]
= 'hidden';
$uicols['name'][]
= 'street_number';
--- 915,918 ----
***************
*** 926,943 ****
$cols_return[]
= $config[$i]['column_name'];
- // $cols_extra[]
= $config[$i]['column_name'];
$uicols['input_type'][]
= 'hidden';
$uicols['name'][]
= $config[$i]['column_name'];
$uicols['descr'][]
= lang($config[$i]['input_text']);
$uicols['statustext'][]
= lang($config[$i]['input_text']);
}
else
{
$cols_return[]
= $config[$i]['column_name'];
- // $cols_extra[]
= $config[$i]['column_name'];
$uicols['input_type'][]
= 'text';
$uicols['name'][]
= $config[$i]['column_name'];
$uicols['descr'][]
= $config[$i]['input_text'];
$uicols['statustext'][]
= $config[$i]['input_text'];
}
}
--- 921,948 ----
$cols_return[]
= $config[$i]['column_name'];
$uicols['input_type'][]
= 'hidden';
$uicols['name'][]
= $config[$i]['column_name'];
$uicols['descr'][]
= lang($config[$i]['input_text']);
$uicols['statustext'][]
= lang($config[$i]['input_text']);
+ if($lookup)
+ {
+ $cols_extra[]
= 'street_name';
+ $cols_extra[]
= 'street_number';
+ $cols_extra[]
= $config[$i]['column_name'];
+ }
+
}
else
{
$cols_return[]
= $config[$i]['column_name'];
$uicols['input_type'][]
= 'text';
$uicols['name'][]
= $config[$i]['column_name'];
$uicols['descr'][]
= $config[$i]['input_text'];
$uicols['statustext'][]
= $config[$i]['input_text'];
+
+ if($lookup)
+ {
+ $cols_extra[]
= $config[$i]['column_name'];
+ }
}
}
Index: class.soentity.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soentity.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** class.soentity.inc.php 30 Oct 2003 15:21:57 -0000 1.9
--- class.soentity.inc.php 3 Nov 2003 18:01:10 -0000 1.10
***************
*** 62,66 ****
$start=0;
}
! $filter =
(isset($data['filter'])?$data['filter']:'');
$query =
(isset($data['query'])?$data['query']:'');
$sort =
(isset($data['sort'])?$data['sort']:'DESC');
--- 62,66 ----
$start=0;
}
! $filter = $data['filter']?$data['filter']:'all';
$query =
(isset($data['query'])?$data['query']:'');
$sort =
(isset($data['sort'])?$data['sort']:'DESC');
***************
*** 80,94 ****
}
! $this->grants =
$GLOBALS['phpgw']->session->appsession('grants_entity_'.$entity_id.'_'.$cat_id,$this->currentapp);
! if(!$this->grants)
{
$this->acl2 =
CreateObject($this->currentapp.'.acl2','##DEFAULT##','##DEFAULT##');
! $this->grants =
$this->acl2->get_grants($this->currentapp,'.entity.' . $entity_id . '.' .
$cat_id);
!
$GLOBALS['phpgw']->session->appsession('grants_entity_'.$entity_id.'_'.$cat_id,$this->currentapp,$this->grants);
}
! $sql = $this->bocommon->fm_cache('sql_entity_' .
$entity_id . '_' . $cat_id);
$entity_table = 'fm_entity_' . $entity_id . '_' .
$cat_id;
--- 80,94 ----
}
! $grants =
$GLOBALS['phpgw']->session->appsession('grants_entity_'.$entity_id.'_'.$cat_id,$this->currentapp);
! if(!$grants)
{
$this->acl2 =
CreateObject($this->currentapp.'.acl2','##DEFAULT##','##DEFAULT##');
! $grants =
$this->acl2->get_grants($this->currentapp,'.entity.' . $entity_id . '.' .
$cat_id);
!
$GLOBALS['phpgw']->session->appsession('grants_entity_'.$entity_id.'_'.$cat_id,$this->currentapp,$grants);
}
! $sql = $this->bocommon->fm_cache('sql_entity_' .
$entity_id . '_' . $cat_id . '_' . $lookup);
$entity_table = 'fm_entity_' . $entity_id . '_' .
$cat_id;
***************
*** 109,112 ****
--- 109,118 ----
$uicols['descr'][] = false;
$uicols['statustext'][] = false;
+ if($lookup)
+ {
+ $cols .= ',num as entity_id_' .
$entity_id;
+ $cols_return[] = 'entity_id_' .
$entity_id;
+ }
+
$admin_entity =
CreateObject($this->currentapp.'.soadmin_entity');
***************
*** 116,120 ****
'uicols'=>$uicols,'joinmethod'=>$joinmethod,'paranthesis'=>$paranthesis,'query'=>$query,'lookup'=>$lookup,'location_level'=>$category['location_level']));
! $this->bocommon->fm_cache('sql_entity_' .
$entity_id . '_' . $cat_id,$sql);
$this->bocommon->fm_cache('uicols_entityt_' .
$entity_id . '_' . $cat_id,$this->bocommon->uicols);
$this->bocommon->fm_cache('cols_return_entityt_' . $entity_id . '_' .
$cat_id,$this->bocommon->cols_return);
--- 122,126 ----
'uicols'=>$uicols,'joinmethod'=>$joinmethod,'paranthesis'=>$paranthesis,'query'=>$query,'lookup'=>$lookup,'location_level'=>$category['location_level']));
! $this->bocommon->fm_cache('sql_entity_' .
$entity_id . '_' . $cat_id . '_' . $lookup,$sql);
$this->bocommon->fm_cache('uicols_entityt_' .
$entity_id . '_' . $cat_id,$this->bocommon->uicols);
$this->bocommon->fm_cache('cols_return_entityt_' . $entity_id . '_' .
$cat_id,$this->bocommon->cols_return);
***************
*** 133,136 ****
--- 139,148 ----
$this->cols_return_lookup =
$this->bocommon->fm_cache('cols_return_lookup_entityt_' . $entity_id . '_' .
$cat_id);
$this->cols_extra
= $this->bocommon->fm_cache('cols_extra_entityt_' . $entity_id . '_' . $cat_id);
+ if($lookup)
+ {
+ $admin_entity =
CreateObject($this->currentapp.'.soadmin_entity');
+ $category =
$admin_entity->read_single_category($entity_id,$cat_id);
+ }
+
}
***************
*** 178,206 ****
$where= 'WHERE';
! $filtermethod = "$where ( $entity_table.user_id=" .
$this->account;
! if (is_array($this->grants))
{
! $grants = $this->grants;
! while (list($user) = each($grants))
{
! $public_user_list[] = $user;
}
! reset($public_user_list);
! $filtermethod = " $where (
$entity_table.user_id IN(" . implode(',',$public_user_list) . "))";
}
else
{
! $filtermethod .= ')';
! }
!
! $where= 'AND';
!
!
! if ($filter > 0)
! {
! $filtermethod .= " $where
$entity_table.user_id=$filter ";
$where= 'AND';
}
if ($status)
{
--- 190,215 ----
$where= 'WHERE';
! if ($filter=='all')
{
! if (is_array($grants))
{
! while (list($user) = each($grants))
! {
! $public_user_list[] = $user;
! }
! reset($public_user_list);
! $filtermethod .= " $where (
$entity_table.user_id IN(" . implode(',',$public_user_list) . "))";
!
! $where= 'AND';
}
!
}
else
{
! $filtermethod = " $where
$entity_table.user_id=$filter ";
$where= 'AND';
}
+
if ($status)
{
***************
*** 245,249 ****
{
$entity_list[$j][$cols_return[$i]] =
$this->db->f($cols_return[$i]);
! $entity_list[$j]['grants'] =
(int)$this->grants[$this->db->f('user_id')];
}
--- 254,259 ----
{
$entity_list[$j][$cols_return[$i]] =
$this->db->f($cols_return[$i]);
! $entity_list[$j]['grants'] =
(int)$grants[$this->db->f('user_id')];
! $entity_list[$j]['entity_cat_name_' .
$entity_id] = $category['name'];
}
Index: class.uiadmin_entity.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uiadmin_entity.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** class.uiadmin_entity.inc.php 28 Oct 2003 15:14:37 -0000 1.8
--- class.uiadmin_entity.inc.php 3 Nov 2003 18:01:13 -0000 1.9
***************
*** 489,492 ****
--- 489,493 ----
}
+
if ($id)
{
***************
*** 501,504 ****
--- 502,506 ----
}
+ $include_list =
$this->bo->get_entity_list($values['lookup_entity']);
$link_data = array
***************
*** 507,511 ****
'id' => $id
);
! //_debug_array($link_data);
$msgbox_data = $this->bocommon->msgbox_data($receipt);
--- 509,513 ----
'id' => $id
);
! //_debug_array($include_list);
$msgbox_data = $this->bocommon->msgbox_data($receipt);
***************
*** 532,536 ****
'lang_location_form' =>
lang('location form'),
'value_location_form' =>
$values['location_form'],
! 'lang_location_form_statustext' => lang('If
this entity type is to show up in location forms')
);
--- 534,542 ----
'lang_location_form' =>
lang('location form'),
'value_location_form' =>
$values['location_form'],
! 'lang_location_form_statustext' => lang('If
this entity type is to be linked to a location'),
! 'lang_include_in_location_form' =>
lang('include in location form'),
! 'include_list'
=> $include_list,
! 'lang_include_statustext' =>
lang('Which entity type is to show up in location forms'),
! 'lang_select'
=> lang('select'),
);
Index: class.bolocation.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.bolocation.inc.php,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** class.bolocation.inc.php 3 Oct 2003 18:58:21 -0000 1.31
--- class.bolocation.inc.php 3 Nov 2003 18:01:13 -0000 1.32
***************
*** 423,427 ****
$location['location'][$i]['input_name']
= 'equipment_id';
$input_name[]
=
'equipment_id';
! $insert_record['extra']['equipment_id']
= 'equipment_id';
$location['location'][$i]['size']
= 12;
$location['location'][$i]['lookup_function_call']
= 'lookup_equipment()';
--- 423,427 ----
$location['location'][$i]['input_name']
= 'equipment_id';
$input_name[]
=
'equipment_id';
! $insert_record['extra']['equipment_id']
= 'equipment_id';
$location['location'][$i]['size']
= 12;
$location['location'][$i]['lookup_function_call']
= 'lookup_equipment()';
***************
*** 439,442 ****
--- 439,474 ----
}
+ //_debug_array($data);
+
+ if (isset($data['lookup_entity']) AND
is_array($data['lookup_entity']))
+ {
+ foreach($data['lookup_entity'] as $entity)
+ {
+ $m++;
+ $entity_link =
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uilookup.entity&location_type='
. $data['type_id'] . '&entity_id=' .$entity['id']);
+
+ $lookup_functions[$m]['name'] =
'lookup_entity_' . $entity['id'] .'()';
+ $lookup_functions[$m]['action'] =
'Window1=window.open('."'" . $entity_link ."'"
.',"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");';
+
+ $location['location'][$i]['input_type']
= 'text';
+ $location['location'][$i]['input_name']
= 'entity_id_' . $entity['id'];
+ $input_name[]
=
'entity_id_' . $entity['id'];
+ $insert_record['extra']['entity_id']
= 'entity_id_' . $entity['id'];
+ $location['location'][$i]['size']
= 8;
+
$location['location'][$i]['lookup_function_call']
= 'lookup_entity_' . $entity['id'] .'()';
+
$location['location'][$i]['lookup_link']
= True;
+ $location['location'][$i]['name']
= $entity['name'];
+ $location['location'][$i]['value']
=
$data['values']['entity_' . $entity['id']];
+ $location['location'][$i]['statustext']
= lang('Klick this link to
select') .' ' . $entity['name'];
+
+
$location['location'][$i]['extra'][0]['input_name']
= 'entity_cat_name_' . $entity['id'];
+ $input_name[]
=
$location['location'][$i]['extra'][0]['input_name'];
+
$location['location'][$i]['extra'][0]['input_type']
= 'text';
+
$location['location'][$i]['extra'][0]['size']
= 30;
+
$location['location'][$i]['extra'][0]['lookup_function_call'] =
'lookup_entity_' . $entity['id'] .'()';
+
$location['location'][$i]['extra'][0]['value']
= $data['values']['entity_category' . $entity['id']];
+ $i++;
+ }
+ }
//_debug_array($insert_record);
***************
*** 463,467 ****
! //_debug_array($input_name);
return $location;
--- 495,499 ----
! //_debug_array($location);
return $location;
Index: class.boentity.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.boentity.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** class.boentity.inc.php 30 Oct 2003 15:21:58 -0000 1.6
--- class.boentity.inc.php 3 Nov 2003 18:01:11 -0000 1.7
***************
*** 249,256 ****
$cols_extra = $this->so->cols_extra;
$cols_return_lookup =
$this->so->cols_return_lookup;
for ($i=0;$i<count($entity);$i++)
{
! //
$location_data=$this->solocation->read_single($entity[$i]['location_code']);
for ($j=0;$j<count($cols_extra);$j++)
{
--- 249,261 ----
$cols_extra = $this->so->cols_extra;
$cols_return_lookup =
$this->so->cols_return_lookup;
+ //_debug_array($entity);
+ //_debug_array($cols_extra);
+ //_debug_array($cols_return_lookup);
+ if($data['lookup'])
+ {
for ($i=0;$i<count($entity);$i++)
{
!
$location_data=$this->solocation->read_single($entity[$i]['location_code']);
for ($j=0;$j<count($cols_extra);$j++)
{
***************
*** 265,268 ****
--- 270,274 ----
}
}
+ }
}
Index: class.boadmin_entity.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.boadmin_entity.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** class.boadmin_entity.inc.php 29 Oct 2003 20:46:14 -0000 1.7
--- class.boadmin_entity.inc.php 3 Nov 2003 18:01:12 -0000 1.8
***************
*** 152,155 ****
--- 152,164 ----
}
+ function get_entity_list($selected='')
+ {
+ $list = $this->so->read(array('allrows'=>True));
+ return
$this->bocommon->select_multi_list($selected,$list);
+ }
+
+
+
+
function read()
{
Index: class.uilookup.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uilookup.inc.php,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** class.uilookup.inc.php 30 Oct 2003 15:21:58 -0000 1.32
--- class.uilookup.inc.php 3 Nov 2003 18:01:12 -0000 1.33
***************
*** 27,30 ****
--- 27,31 ----
'location' => True,
'equipment' => True,
+ 'entity' => True,
'ns3420' => True,
'street' => True,
***************
*** 729,732 ****
--- 730,920 ----
$GLOBALS['phpgw_info']['flags']['app_header'] =
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_equipment' => $data));
+ $this->save_sessiondata();
+ }
+
+ function entity()
+ {
+ $bocommon =
CreateObject($this->currentapp.'.bocommon');
+ $boentity =
CreateObject($this->currentapp.'.boentity');
+ $boadmin_entity =
CreateObject($this->currentapp.'.boadmin_entity');
+ $this->start =
$boentity->start;
+ $this->query =
$boentity->query;
+ $this->sort =
$boentity->sort;
+ $this->order =
$boentity->order;
+ $this->filter =
$boentity->filter;
+ $this->cat_id =
$boentity->cat_id;
+ $this->part_of_town_id =
$boentity->part_of_town_id;
+ $this->district_id =
$boentity->district_id;
+ $this->entity_id =
$boentity->entity_id;
+
+ $GLOBALS['phpgw']->xslttpl->add_file(array('lookup',
+
'nextmatchs',
+
'search_field'));
+
+ $entity_list = $boentity->read(array('lookup'=>True));
+
+ $input_name =
$GLOBALS['phpgw']->session->appsession('lookup_fields',$this->currentapp);
+ //_debug_array($input_name);
+
+ $uicols = $boentity->uicols;
+
+ //_debug_array($uicols);
+
+ $j=0;
+
+ if (isset($entity_list) AND is_array($entity_list))
+ {
+ foreach($entity_list as $entity_entry)
+ {
+
+ for
($i=0;$i<count($uicols['name']);$i++)
+ {
+
if($uicols['input_type'][$i]!='hidden')
+ {
+
$content[$j]['row'][$i]['value'] = $entity_entry[$uicols['name'][$i]];
+
$content[$j]['row'][$i]['name'] = $uicols['name'][$i];
+ }
+ }
+
+ for ($i=0;$i<count($input_name);$i++)
+ {
+
$content[$j]['hidden'][$i]['value'] = $entity_entry[$input_name[$i]];
+
$content[$j]['hidden'][$i]['name'] = $input_name[$i];
+ }
+
+ $j++;
+ }
+ }
+
+ //_debug_array($content);
+ for ($i=0;$i<count($uicols['descr']);$i++)
+ {
+ if($uicols['input_type'][$i]!='hidden')
+ {
+ $table_header[$i]['header'] =
$uicols['descr'][$i];
+ $table_header[$i]['width']
= '5%';
+ $table_header[$i]['align']
= 'center';
+ if($uicols['name'][$i]=='loc1')
+ {
+ $table_header[$i]['sort_link']
=true;
+ $table_header[$i]['sort']
= $this->nextmatchs->show_sort_order(array
+
(
+
'sort' => $this->sort,
+
'var' => 'loc1',
+
'order' => $this->order,
+
'extra' => array('menuaction' =>
$this->currentapp.'.uilookup.entity',
+
'type_id'
=>$type_id,
+
'query'
=>$this->query,
+
'district_id' =>
$this->district_id,
+
'lookup'
=>$lookup,
+
'entity_id'
=>$this->entity_id,
+
'cat_id'
=>$this->cat_id)
+
));
+ }
+ if($uicols['name'][$i]=='num')
+ {
+ $table_header[$i]['sort_link']
=true;
+ $table_header[$i]['sort']
= $this->nextmatchs->show_sort_order(array
+
(
+
'sort' => $this->sort,
+
'var' => 'num',
+
'order' => $this->order,
+
'extra' => array('menuaction' =>
$this->currentapp.'.uilookup.entity',
+
'type_id'
=>$type_id,
+
'query'
=>$this->query,
+
'lookup'
=>$lookup,
+
'district_id' =>
$this->district_id,
+
'entity_id'
=>$this->entity_id,
+
'cat_id'
=>$this->cat_id)
+
));
+ }
+ }
+ }
+
+ $table_header[$i]['width'] = '5%';
+ $table_header[$i]['align'] =
'center';
+ $table_header[$i]['header'] =
lang('select');
+
+
+ //_debug_array($table_header);
+ //_debug_array($uicols);
+
+ $table_done[] = array
+ (
+ 'lang_done' =>
lang('Done'),
+ 'lang_done_statustext' => lang('Close this
window')
+ );
+
+ $link_select = array
+ (
+ 'menuaction' =>
$this->currentapp.'.uilookup.entity',
+ 'order' => $this->order,
+ 'sort' => $this->sort,
+ 'cat_id' =>
$this->cat_id,
+ 'entity_id' =>
$this->entity_id,
+ 'district_id' => $this->district_id,
+ 'query' => $this->query,
+ 'filter' => $this->filter
+ );
+
+
+ for ($i=0;$i<count($input_name);$i++)
+ {
+ $function_exchange_values .=
'opener.document.form.' . $input_name[$i] .'.value = thisform.elements[' . $i .
'].value;' ."\r\n";
+ }
+
+ $function_exchange_values .='window.close()';
+
+
+ $data = array
+ (
+ 'exchange_values'
=> 'Exchange_values(this.form);',
+ 'function_exchange_values' =>
$function_exchange_values,
+ 'lang_select'
=> lang('select'),
+ 'lookup'
=> 1,//$lookup,
+ 'allow_allrows'
=> false,
+ 'start_record'
=> $this->start,
+ 'record_limit'
=> $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'],
+ 'num_records'
=> count($entity_list),
+ 'all_records'
=> $boentity->total_records,
+ 'link_url'
=> $GLOBALS['phpgw']->link('/index.php',$link_select),
+ 'img_path'
=> $GLOBALS['phpgw']->common->get_image_path('phpgwapi'),
+ 'lang_no_cat'
=> lang('no category'),
+ 'lang_cat_statustext' =>
lang('Select the category the building belongs to. To do not use a category
select NO CATEGORY'),
+ 'select_name'
=> 'cat_id',
+ 'cat_list'
=> $boentity->select_category_list('filter',$this->cat_id),
+ 'district_list'
=> $bocommon->select_district_list('filter',$this->district_id),
+ 'select_action'
=> $GLOBALS['phpgw']->link('/index.php',$link_select),
+ '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',
+ 'lang_select'
=> lang('Select'),
+
+ 'filter_list'
=> $this->nextmatchs->xslt_filter(array('filter' => $this->filter,'yours' =>
'yes')),
+ 'lang_filter_statustext' =>
lang('Select the filter. To show all entries select SHOW ALL'),
+ 'lang_searchfield_statustext' => lang('Enter
the search string. To show all entries, empty this field and press the SUBMIT
button again'),
+ 'lang_searchbutton_statustext' => lang('Submit
the search string'),
+ 'query'
=> $this->query,
+ 'lang_search'
=> lang('search'),
+ 'table_header_entity' =>
$table_header,
+ 'values_entity'
=> $content,
+ 'table_done'
=> $table_done
+ );
+
+ //_debug_array($content);
+ if($this->entity_id)
+ {
+ $entity =
$boadmin_entity->read_single($this->entity_id,false);
+ $appname = $entity['name'];
+ }
+ if($this->cat_id)
+ {
+ $category =
$boadmin_entity->read_single_category($this->entity_id,$this->cat_id);
+ $function_msg
= lang('lookup') . ' ' . $category['name'];
+ $GLOBALS['phpgw_info']['flags']['app_header'] =
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+ }
+
+ $GLOBALS['phpgw_info']['flags']['app_header'] =
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_entity' => $data));
$this->save_sessiondata();
}
Index: class.uientity.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uientity.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** class.uientity.inc.php 30 Oct 2003 15:21:58 -0000 1.8
--- class.uientity.inc.php 3 Nov 2003 18:01:11 -0000 1.9
***************
*** 205,254 ****
$j=0;
! while (is_array($entity_list) && list(,$entity_entry) =
each($entity_list))
{
! for ($i=0;$i<count($uicols['name']);$i++)
{
! if($uicols['input_type'][$i]!='hidden')
{
!
if($entity_entry['query_location'][$uicols['name'][$i]])
! {
!
$content[$j]['row'][$i]['statustext'] = lang('search');
!
$content[$j]['row'][$i]['text'] =
$entity_entry[$uicols['name'][$i]];
!
$content[$j]['row'][$i]['link'] =
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uientity.index&entity_id='
. $this->entity_id . '&cat_id=' . $this->cat_id .'&query=' .
$entity_entry['query_location'][$uicols['name'][$i]]);
! }
! else
{
!
$content[$j]['row'][$i]['value'] =
$entity_entry[$uicols['name'][$i]];
!
$content[$j]['row'][$i]['name'] = $uicols['name'][$i];
}
}
- }
! while
(is_array($entity_entry['query_location']) && list($key,$query_location) =
each($entity_entry['query_location']))
! {
! // _debug_array($key);
!
! }
! if($this->acl_read)
! {
! $content[$j]['row'][$i]['statustext']
= lang('view the entity');
! $content[$j]['row'][$i]['text']
= lang('view');
! $content[$j]['row'][$i++]['link']
=
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uientity.view&entity_id='
. $this->entity_id . '&cat_id=' . $this->cat_id .'&id=' . $entity_entry['id']);
! }
! if($this->acl_edit)
! {
! $content[$j]['row'][$i]['statustext']
= lang('edit the entity');
! $content[$j]['row'][$i]['text']
= lang('edit');
! $content[$j]['row'][$i++]['link']
=
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uientity.edit&entity_id='
. $this->entity_id . '&cat_id=' . $this->cat_id .'&id=' . $entity_entry['id']);
! }
! if($this->acl_delete)
! {
! $content[$j]['row'][$i]['statustext']
= lang('delete the entity');
! $content[$j]['row'][$i]['text']
= lang('delete');
! $content[$j]['row'][$i++]['link']
=
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uientity.delete&entity_id='
. $this->entity_id . '&cat_id=' . $this->cat_id .'&id=' . $entity_entry['id']);
}
-
- $j++;
}
--- 205,252 ----
$j=0;
!
! if (isset($entity_list) AND is_array($entity_list))
{
! foreach($entity_list as $entity_entry)
{
! for
($i=0;$i<count($uicols['name']);$i++)
{
!
if($uicols['input_type'][$i]!='hidden')
{
!
if($entity_entry['query_location'][$uicols['name'][$i]])
! {
!
$content[$j]['row'][$i]['statustext'] = lang('search');
!
$content[$j]['row'][$i]['text'] =
$entity_entry[$uicols['name'][$i]];
!
$content[$j]['row'][$i]['link'] =
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uientity.index&entity_id='
. $this->entity_id . '&cat_id=' . $this->cat_id .'&query=' .
$entity_entry['query_location'][$uicols['name'][$i]]);
! }
! else
! {
!
$content[$j]['row'][$i]['value'] =
$entity_entry[$uicols['name'][$i]];
!
$content[$j]['row'][$i]['name'] = $uicols['name'][$i];
! }
}
}
! if($this->acl_read)
! {
!
$content[$j]['row'][$i]['statustext'] = lang('view the
entity');
! $content[$j]['row'][$i]['text']
= lang('view');
!
$content[$j]['row'][$i++]['link'] =
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uientity.view&entity_id='
. $this->entity_id . '&cat_id=' . $this->cat_id .'&id=' . $entity_entry['id']);
! }
! if($this->acl_edit)
! {
!
$content[$j]['row'][$i]['statustext'] = lang('edit the
entity');
! $content[$j]['row'][$i]['text']
= lang('edit');
!
$content[$j]['row'][$i++]['link'] =
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uientity.edit&entity_id='
. $this->entity_id . '&cat_id=' . $this->cat_id .'&id=' . $entity_entry['id']);
! }
! if($this->acl_delete)
! {
!
$content[$j]['row'][$i]['statustext'] = lang('delete the
entity');
! $content[$j]['row'][$i]['text']
= lang('delete');
!
$content[$j]['row'][$i++]['link'] =
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uientity.delete&entity_id='
. $this->entity_id . '&cat_id=' . $this->cat_id .'&id=' . $entity_entry['id']);
! }
! $j++;
}
}
***************
*** 432,436 ****
'select_user_name'
=> 'filter',
'lang_no_user'
=> lang('No user'),
! 'user_list'
=>
$this->bocommon->get_user_list_right2('filter',4,$this->filter,$this->acl2_location,array('all'),$default=$this->account),
'lang_filter_statustext' =>
lang('Select the filter. To show all entries select SHOW ALL'),
--- 430,434 ----
'select_user_name'
=> 'filter',
'lang_no_user'
=> lang('No user'),
! 'user_list'
=>
$this->bocommon->get_user_list_right2('filter',4,$this->filter,$this->acl2_location,array('all'),$default='all'),
'lang_filter_statustext' =>
lang('Select the filter. To show all entries select SHOW ALL'),
***************
*** 600,603 ****
--- 598,607 ----
}
+ for ($i=0;$i<count($entity['lookup_entity']);$i++)
+ {
+ $lookup_entity[$i]['id'] =
$entity['lookup_entity'][$i];
+ $entity_lookup =
$this->boadmin_entity->read_single($entity['lookup_entity'][$i],false);
+ $lookup_entity[$i]['name'] =
$entity_lookup['name'];
+ }
if($entity['location_form'])
***************
*** 607,611 ****
'type_id' =>
$category['location_level'],
'no_link' =>
False, // disable lookup links for location type less than type_id
! 'lookup_type' => $lookup_type
));
}
--- 611,616 ----
'type_id' =>
$category['location_level'],
'no_link' =>
False, // disable lookup links for location type less than type_id
! 'lookup_type' => $lookup_type,
! 'lookup_entity' =>
$lookup_entity
));
}
Index: class.soadmin_entity.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soadmin_entity.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** class.soadmin_entity.inc.php 28 Oct 2003 15:14:37 -0000 1.9
--- class.soadmin_entity.inc.php 3 Nov 2003 18:01:12 -0000 1.10
***************
*** 237,240 ****
--- 237,241 ----
$entity['descr'] =
$this->db->f('descr');
$entity['location_form'] =
$this->db->f('location_form');
+ $entity['lookup_entity'] =
unserialize($this->db->f('lookup_entity'));
return $entity;
***************
*** 390,399 ****
$values_acl_location= array(
'.entity.' . $values['entity_id'] . '.' .
$values['id'],
! $values['name']
);
$values_acl_location =
$this->bocommon->validate_db_insert($values_acl_location);
! $this->db->query("INSERT INTO fm_acl_location
(id,descr) "
. "VALUES
($values_acl_location)",__LINE__,__FILE__);
--- 391,401 ----
$values_acl_location= array(
'.entity.' . $values['entity_id'] . '.' .
$values['id'],
! $values['name'],
! 1
);
$values_acl_location =
$this->bocommon->validate_db_insert($values_acl_location);
! $this->db->query("INSERT INTO fm_acl_location
(id,descr,allow_grant) "
. "VALUES
($values_acl_location)",__LINE__,__FILE__);
***************
*** 502,510 ****
$entity['descr'] =
$this->db->db_addslashes($entity['descr']);
$value_set=array(
'descr' => $entity['descr'],
'name' => $entity['name'],
! 'location_form' => $entity['location_form']
);
--- 504,517 ----
$entity['descr'] =
$this->db->db_addslashes($entity['descr']);
+ if(!$entity['location_form'])
+ {
+ unset($entity['lookup_entity']);
+ }
$value_set=array(
'descr' => $entity['descr'],
'name' => $entity['name'],
! 'location_form' => $entity['location_form'],
! 'lookup_entity' =>
serialize($entity['lookup_entity'])
);
Index: class.soworkorder.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soworkorder.inc.php,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** class.soworkorder.inc.php 28 Oct 2003 15:14:37 -0000 1.32
--- class.soworkorder.inc.php 3 Nov 2003 18:01:12 -0000 1.33
***************
*** 245,262 ****
$where= 'WHERE';
- $filtermethod = $where . ' ( fm_project.user_id=' .
$this->account;
- if (is_array($this->grants))
- {
- $grants = $this->grants;
- while (list($user) = each($grants))
- {
- $public_user_list[] = $user;
- }
- reset($public_user_list);
- $filtermethod = " $where
(fm_project.access='public' AND fm_project.user_id IN(" .
implode(',',$public_user_list) . "))";
- }
-
- $where= 'AND';
-
if ($cat_id > 0)
{
--- 245,248 ----
***************
*** 271,284 ****
}
! if (!$filter):
{
! return;
}
! elseif($filter!='all'):
{
$filtermethod .= " $where
fm_workorder.user_id=$filter ";
$where= 'AND';
}
- endif;
if ($start_date)
--- 257,279 ----
}
! if ($filter=='all')
{
! if (is_array($this->grants))
! {
! $grants = $this->grants;
! while (list($user) = each($grants))
! {
! $public_user_list[] = $user;
! }
! reset($public_user_list);
! $filtermethod .= " $where
(fm_project.access='public' AND fm_project.user_id IN(" .
implode(',',$public_user_list) . "))";
! $where= 'AND';
! }
}
! else
{
$filtermethod .= " $where
fm_workorder.user_id=$filter ";
$where= 'AND';
}
if ($start_date)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] property/inc class.soentity.inc.php, 1.9, 1.10 class.boentity.inc.php, 1.6, 1.7 class.uientity.inc.php, 1.8, 1.9 class.uilookup.inc.php, 1.32, 1.33 class.bocommon.inc.php, 1.91, 1.92 class.boadmin_entity.inc.php, 1.7, 1.8 class.soproject.inc.php, 1.44, 1.45 class.soadmin_entity.inc.php, 1.9, 1.10 class.soworkorder.inc.php, 1.32, 1.33 class.uiadmin_entity.inc.php, 1.8, 1.9 class.bolocation.inc.php, 1.31, 1.32,
Sigurd Nes <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] api/auth class.auth_ldap.php, 1.1.1.1, 1.1.1.1.2.1 class.auth_sql.php, 1.1.1.1.2.2, 1.1.1.1.2.3
- Next by Date:
[Phpgroupware-cvs] property/setup tables_current.inc.php, 1.141, 1.142
- Previous by thread:
[Phpgroupware-cvs] api/auth class.auth_ldap.php, 1.1.1.1, 1.1.1.1.2.1 class.auth_sql.php, 1.1.1.1.2.2, 1.1.1.1.2.3
- Next by thread:
[Phpgroupware-cvs] property/setup tables_current.inc.php, 1.141, 1.142
- Index(es):