[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: property/inc class.bostandard_entity.inc.php,NO
From: |
Sigurd Nes <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: property/inc class.bostandard_entity.inc.php,NONE,1.1 class.sostandard_entity.inc.php,NONE,1.1 class.uistandard_entity.inc.php,NONE,1.1 class.sostandard_2.inc.php,1.1,1.2 hook_admin.inc.php,1.9,1.10 |
Date: |
Fri, 13 Dec 2002 13:13:36 -0500 |
Update of /cvsroot/phpgroupware/property/inc
In directory subversions:/tmp/cvs-serv17108/inc
Modified Files:
class.sostandard_2.inc.php hook_admin.inc.php
Added Files:
class.bostandard_entity.inc.php
class.sostandard_entity.inc.php
class.uistandard_entity.inc.php
Log Message:
no message
--- NEW FILE ---
<?php
/***************************************************************************\
* This program is free software; you can redistribute it and/or modify
it *
* under the terms of the GNU General Public License as published by the
*
* Free Software Foundation; either version 2 of the License, or (at
your *
* option) any later version.
*
\***************************************************************************/
class bostandard_entity
{
var $start;
var $query;
var $filter;
var $sort;
var $order;
var $cat_id;
var $public_functions = array
(
'read' => True,
'read_single' => True,
'save' => True,
'delete' => True,
'check_perms' => True
);
var $soap_functions = array(
'list' => array(
'in' =>
array('int','int','struct','string','int'),
'out' => array('array')
),
'read' => array(
'in' => array('int','struct'),
'out' => array('array')
),
'save' => array(
'in' => array('int','struct'),
'out' => array()
),
'delete' => array(
'in' => array('int','struct'),
'out' => array()
)
);
function bostandard_entity($session=False)
{
$this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
$this->so =
CreateObject($this->currentapp.'.sostandard_entity');
$this->socommon =
CreateObject($this->currentapp.'.socommon');
$start = get_var('start',array('POST','GET'));
$query = get_var('query',array('POST','GET'));
$sort = get_var('sort',array('POST','GET'));
$order = get_var('order',array('POST','GET'));
$filter = get_var('filter',array('POST','GET'));
$cat_id = get_var('cat_id',array('POST','GET'));
if ($start)
{
$this->start=$start;
}
else
{
$this->start=0;
}
if(isset($query))
{
$this->query = $query;
}
if(!empty($filter))
{
$this->filter = $filter;
}
if(isset($sort))
{
$this->sort = $sort;
}
if(isset($order))
{
$this->order = $order;
}
if(isset($cat_id))
{
$this->cat_id = $cat_id;
}
}
function read($type='')
{
$standard = $this->so->read(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
'type' => $type));
$this->total_records = $this->so->total_records;
return $standard;
}
function read_single($id,$type)
{
return $this->so->read_single($id,$type);
}
function save($standard,$action='',$type ='')
{
if ($action=='edit')
{
if ($standard['id'] != '')
{
$message =
$this->so->edit($standard,$type);
}
}
else
{
$message = $this->so->add($standard,$type);
}
return $message;
}
function delete($id,$type)
{
$this->so->delete($id,$type);
}
function read_attrib($type='',$type_id='')
{
$attrib = $this->so->read_attrib(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
'type' => $type,'type_id' => $type_id));
$this->total_records = $this->so->total_records;
return $attrib;
}
function read_single_attrib($id,$type)
{
return $this->so->read_single_attrib($id,$type);
}
function save_attrib($standard,$action='',$type ='')
{
if ($action=='edit')
{
if ($standard['id'] != '')
{
$message =
$this->so->edit_sttrib($standard,$type);
}
}
else
{
$message =
$this->so->add_attrib($standard,$type);
}
return $message;
}
function select_entity_type($type='',$selected='')
{
$entity_types= $this->so->select_entity_type($type);
while (is_array($entity_types) && list(,$type) =
each($entity_types))
{
$sel_type = '';
if ($type['id']==$selected)
{
$sel_type = 'selected';
}
$entity_type_list[] = array
(
'id' => $type['id'],
'num' => $type['num'],
'selected' => $sel_type
);
}
for ($i=0;$i<count($entity_type_list);$i++)
{
if ($entity_type_list[$i]['selected'] !=
'selected')
{
unset($entity_type_list[$i]['selected']);
}
}
return $entity_type_list;
}
function select_datatype($selected='')
{
$datatypes[0]['id']= 'C';
$datatypes[0]['num']= 'Character';
$datatypes[1]['id']= 'I';
$datatypes[1]['num']= 'Integer';
$datatypes[2]['id']= 'N';
$datatypes[2]['num']= 'Decimal';
while (is_array($datatypes) && list(,$type) =
each($datatypes))
{
$sel_type = '';
if ($type['id']==$selected)
{
$sel_type = 'selected';
}
$datatype_list[] = array
(
'id' => $type['id'],
'num' => $type['num'],
'selected' => $sel_type
);
}
for ($i=0;$i<count($datatype_list);$i++)
{
if ($datatype_list[$i]['selected'] !=
'selected')
{
unset($datatype_list[$i]['selected']);
}
}
return $datatype_list;
}
}
?>
--- NEW FILE ---
<?php
/***************************************************************************\
* This program is free software; you can redistribute it and/or modify
it *
* under the terms of the GNU General Public License as published by the
*
* Free Software Foundation; either version 2 of the License, or (at
your *
* option) any later version.
*
\***************************************************************************/
class sostandard_entity
{
var $grants;
function sostandard_entity()
{
$this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
$this->db = $GLOBALS['phpgw']->db;
$this->db2 = $this->db;
$this->grants =
$GLOBALS['phpgw']->acl->get_grants($this->currentapp);
$this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
$this->socommon =
CreateObject($this->currentapp.'.socommon');
if
($GLOBALS['phpgw_info']['server']['db_type']=='pgsql')
{
$this->join = " JOIN ";
}
else
{
$this->join = " LEFT JOIN ";
}
}
function read($data)
{
if(is_array($data))
{
if ($data['start'])
{
$start=$data['start'];
}
else
{
$start=0;
}
$query =
(isset($data['query'])?$data['query']:'');
$sort =
(isset($data['sort'])?$data['sort']:'DESC');
$order =
(isset($data['order'])?$data['order']:'');
$type = (isset($data['type'])?$data['type']:0);
}
if ($order)
{
$ordermethod = " order by $order $sort";
}
else
{
$ordermethod = ' order by id asc';
}
$table = $this->select_table($type);
if($query)
{
$query = ereg_replace("'",'',$query);
$query = ereg_replace('"','',$query);
$querymethod = " where num LIKE '%$query%' or
descr LIKE '%$query%'";
}
$sql = "SELECT * FROM $table $querymethod";
$this->db2->query($sql,__LINE__,__FILE__);
$this->total_records = $this->db2->num_rows();
$this->db->limit_query($sql .
$ordermethod,$start,__LINE__,__FILE__);
while ($this->db->next_record())
{
$standard[] = array
(
'id' => $this->db->f('id'),
'num' => $this->db->f('num'),
'descr' => $this->db->f('descr')
);
}
return $standard;
}
function select_table($type)
{
switch($type)
{
case 'equipment':
$table='fm_equipment_type';
break;
case 'property':
$table='fm_property_type';
break;
}
return $table;
}
function select_table_attrib($type)
{
switch($type)
{
case 'equipment':
$table='fm_equipment_type_attrib';
break;
case 'property':
$table='fm_property_type_attrib';
break;
}
return $table;
}
function read_single($id,$type)
{
$table = $this->select_table($type);
$sql = "SELECT * FROM $table where id='$id'";
$this->db->query($sql,__LINE__,__FILE__);
if ($this->db->next_record())
{
$standard['id'] =
$this->db->f('id');
$standard['num'] =
$this->db->f('num');
$standard['descr'] =
$this->db->f('descr');
return $standard;
}
}
function add($standard,$type)
{
$table = $this->select_table($type);
$standard['id'] = $this->socommon->next_id($table);
$standard['num'] =
$this->db->db_addslashes($standard['num']);
$standard['descr'] =
$this->db->db_addslashes($standard['descr']);
$this->db->query("INSERT INTO $table (id, num, descr) "
. "VALUES ('" . $standard['id'] . "','" .
$standard['num'] . "','" . $standard['descr']. "')",__LINE__,__FILE__);
$receipt = array(
'id' => $standard['id'],
'message' => lang('standard has been
saved')
);
return $receipt;
}
function edit($standard,$type)
{
$table = $this->select_table($type);
$standard['num'] =
$this->db->db_addslashes($standard['num']);
$standard['descr'] =
$this->db->db_addslashes($standard['descr']);
$this->db->query("UPDATE $table set descr='" .
$standard['descr'] . "', num='". $standard['num']
. "' WHERE id='" .
$standard['id']. "'",__LINE__,__FILE__);
$message = lang('standard has been edited');
return $message;
}
function delete($id,$type)
{
$table = $this->select_table($type);
$this->db->query("DELETE FROM $table WHERE id='" . $id
. "'",__LINE__,__FILE__);
}
function read_attrib($data)
{
//_debug_array($data);
if(is_array($data))
{
if ($data['start'])
{
$start=$data['start'];
}
else
{
$start=0;
}
$query =
(isset($data['query'])?$data['query']:'');
$sort =
(isset($data['sort'])?$data['sort']:'DESC');
$order =
(isset($data['order'])?$data['order']:'');
$type = (isset($data['type'])?$data['type']:0);
$type_id =
(isset($data['type_id'])?$data['type_id']:0);
}
if ($order)
{
$ordermethod = " order by $order $sort";
}
else
{
$ordermethod = ' order by id asc';
}
$table = $this->select_table_attrib($type);
$type_table = $this->select_table($type);
if($query)
{
$query = ereg_replace("'",'',$query);
$query = ereg_replace('"','',$query);
$querymethod = " and (num LIKE '%$query%' or
descr LIKE '%$query%')";
}
$sql = "SELECT $table.id ,$table.num ,$table.descr,
$table.datatype ,$type_table.num as type FROM $type_table $this->join $table on
$table.type_id = $type_table.id where $table.type_id= '$type_id' $querymethod";
$this->db2->query($sql,__LINE__,__FILE__);
$this->total_records = $this->db2->num_rows();
$this->db->limit_query($sql .
$ordermethod,$start,__LINE__,__FILE__);
while ($this->db->next_record())
{
$attrib[] = array
(
'id' => $this->db->f('id'),
'num' => $this->db->f('num'),
'descr' => $this->db->f('descr'),
'type_num' => $this->db->f('type'),
'datatype' =>
$this->db->f('datatype')
);
}
return $attrib;
}
function read_single_attrib($id,$type)
{
$table = $this->select_table_attrib($type);
$type_table = $this->select_table($type);
$sql = "SELECT $table.id ,$table.num ,$table.descr,
$table.datatype,$type_table.id as type_id ,$type_table.num as type_num FROM
$type_table $this->join $table on $table.type_id = $type_table.id where
$table.id= '$id' $querymethod";
$this->db->query($sql,__LINE__,__FILE__);
if ($this->db->next_record())
{
$attrib['id'] = $this->db->f('id');
$attrib['num'] = $this->db->f('num');
$attrib['descr'] = $this->db->f('descr');
$attrib['type_id'] =
$this->db->f('type_id');
$attrib['type_num'] =
$this->db->f('type_num');
$attrib['datatype'] =
$this->db->f('datatype');
//_debug_array($attrib);
return $attrib;
}
}
function select_entity_type($type='')
{
$table = $this->select_table($type);
$this->db->query("SELECT * FROM $table ORDER BY num ");
$i = 0;
while ($this->db->next_record())
{
$entity_type[$i]['id'] =
$this->db->f('id');
$entity_type[$i]['num'] =
stripslashes($this->db->f('num'));
$entity_type[$i]['descr'] =
stripslashes($this->db->f('descr'));
$i++;
}
//_debug_array($entity_type);
return $entity_type;
}
}
?>
--- NEW FILE ---
<?php
/***************************************************************************\
* -------------------------------------------------
*
* This program is free software; you can redistribute it and/or modify
it *
* under the terms of the GNU General Public License as published by the
*
* Free Software Foundation; either version 2 of the License, or (at
your *
* option) any later version.
*
\***************************************************************************/
class uistandard_entity
{
var $grants;
var $start;
var $query;
var $sort;
var $order;
var $sub;
var $currentapp;
var $public_functions = array
(
'index' => True,
'view' => True,
'edit' => True,
'delete' => True,
'list_attribute' => True,
'edit_attrib' => True
);
function uistandard_entity()
{
$this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
$this->nextmatchs =
CreateObject('phpgwapi.nextmatchs');
$this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
$this->grants =
$GLOBALS['phpgw']->acl->get_grants($this->currentapp);
$this->grants[$this->account] = PHPGW_ACL_READ +
PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE;
$this->bo =
CreateObject($this->currentapp.'.bostandard_entity');
$this->bocommon =
CreateObject($this->currentapp.'.bocommon',True);
$this->start =
$this->bo->start;
$this->query =
$this->bo->query;
$this->sort =
$this->bo->sort;
$this->order =
$this->bo->order;
}
function save_sessiondata()
{
$data = array
(
'start' => $this->start,
'query' => $this->query,
'sort' => $this->sort,
'order' => $this->order,
);
$this->bocommon->save_sessiondata($data);
}
function index()
{
$type = get_var('type',array('POST','GET'));
$GLOBALS['phpgw']->xslttpl->add_file(array(
'standard_entity',
'nextmatchs',
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP .
'app_header',
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP .
'search_field'));
//
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP .
'nextmatchs'));
$standard_list = $this->bo->read($type);
while (is_array($standard_list) && list(,$standard) =
each($standard_list))
{
$words = split(' ',$standard['descr']);
$first = "$words[0] $words[1] $words[2]
$words[3]";
$content[] = array
(
'id'
=> $standard['id'],
'num'
=> $standard['num'],
'first'
=> $first,
'link_attribute'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uistandard_entity.list_attribute&type_id='
. $standard['id'].'&type='.$type),
'link_edit'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uistandard_entity.edit&id='
. $standard['id'].'&type='.$type),
'link_delete'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uistandard_entity.delete&id='
. $standard['id'].'&type='.$type),
'lang_view_standardtext' =>
lang('view the standard'),
'lang_attribute_standardtext' =>
lang('attributes for the standard'). ' ' . lang($type),
'lang_edit_standardtext' =>
lang('edit the standard'),
'lang_delete_standardtext' =>
lang('delete the standard'),
'text_attribute'
=> lang('Attributes'),
'text_edit'
=> lang('edit'),
'text_delete'
=> lang('delete')
);
}
//_debug_array($content);
$table_header[] = array
(
'lang_descr' => lang('Descr'),
'lang_attribute' => lang('Attributes'),
'lang_edit' => lang('edit'),
'lang_delete' => lang('delete'),
'sort_id' =>
$this->nextmatchs->show_sort_order(array
(
'sort' => $this->sort,
'var' => 'id',
'order' => $this->order,
'extra' => array('menuaction' =>
$this->currentapp.'.uistandard_entity.index',
'type' =>$type)
)),
'lang_id' => lang('standard id'),
'sort_num' =>
$this->nextmatchs->show_sort_order(array
(
'sort' => $this->sort,
'var' => 'num',
'order' => $this->order,
'extra' => array('menuaction' =>
$this->currentapp.'.uistandard_entity.index',
'type' =>$type)
)),
'lang_num' => lang('Name'),
);
$table_add[] = array
(
'lang_add' =>
lang('add'),
'lang_add_standardtext' => lang('add a
standard'),
'add_action' =>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uistandard_entity.edit&type='.$type),
'lang_done' =>
lang('done'),
'lang_done_standardtext' => lang('back
to admin'),
'done_action' =>
$GLOBALS['phpgw']->link('/admin/index.php')
);
$data = array
(
'allow_all_rows'
=> False,
'start_record'
=> $this->start,
'record_limit'
=> $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'],
'num_records'
=> count($standard_list),
'all_records'
=> $this->bo->total_records,
'link_url'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uistandard_entity.index&type='.$type),
'img_path'
=> $GLOBALS['phpgw']->common->get_image_path('phpgwapi'),
'appname'
=> lang($this->currentapp),
'function_msg'
=> lang('list '.$type.' standard'),
'lang_searchfield_standardtext' => lang('Enter
the search string. To show all entries, empty this field and press the SUBMIT
button again'),
'lang_searchbutton_standardtext' =>
lang('Submit the search string'),
'query'
=> $this->query,
'lang_submit'
=> lang('submit'),
'table_header'
=> $table_header,
'values'
=> $content,
'table_add'
=> $table_add
);
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
$this->save_sessiondata();
}
function edit()
{
$type = get_var('type',array('POST','GET'));
$id = get_var('id',array('POST','GET'));
$values =
get_var('values',array('POST'));
$GLOBALS['phpgw']->xslttpl->add_file(array('standard_entity',$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default')
. SEP . 'app_header'));
if ($values['save'])
{
if($id)
{
$values['id']=$id;
$action='edit';
}
else
{
// $id =
$values['id'];
$standard['num'] =
$values['num'];
$standard['descr'] =
$values['descr'];
}
$message =
$this->bo->save($values,$action,$type);
if(!$id)
{
$id=$message['id'];
$message=$message['message'];
}
}
if ($id)
{
$standard = $this->bo->read_single($id,$type);
$function_msg = lang('edit standard');
$action='edit';
}
else
{
$function_msg = lang('add standard');
$action='add';
}
$link_data = array
(
'menuaction' =>
$this->currentapp.'.uistandard_entity.edit',
'id' => $id,
'type' => $type
);
//_debug_array($link_data);
$data = array
(
'appname'
=> lang($type),
'function_msg'
=> $function_msg,
'form_action'
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
'done_action'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uistandard_entity.index&type='.$type),
'lang_id'
=> lang('standard ID'),
'lang_num'
=> lang('Name'),
'lang_descr'
=> lang('Descr'),
'lang_save'
=> lang('save'),
'lang_done'
=> lang('done'),
'value_id'
=> $id,
'value_num'
=> $standard['num'],
'message'
=> $message,
'lang_id_standardtext' =>
lang('Enter the standard ID'),
'lang_descr_standardtext' =>
lang('Enter a description the standard'),
'lang_done_standardtext' =>
lang('Back to the list'),
'lang_save_standardtext' =>
lang('Save the standard'),
'type_id'
=> $standard['type_id'],
'value_descr'
=> $standard['descr']
);
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
}
function delete()
{
$type = get_var('type',array('POST','GET'));
$id = get_var('id',array('POST','GET'));
$confirm =
get_var('confirm',array('POST'));
$link_data = array
(
'menuaction' =>
$this->currentapp.'.uistandard_entity.index',
'type' => $type
);
if (get_var('confirm',array('POST')))
{
$this->bo->delete($id,$type);
Header('Location: ' .
$GLOBALS['phpgw']->link('/index.php',$link_data));
}
$GLOBALS['phpgw']->xslttpl->add_file(array($GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default')
. SEP . 'app_delete',
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP .
'app_header'));
$data = array
(
'appname' =>
lang($type),
'function_msg' => lang('delete
standard'),
'done_action' =>
$GLOBALS['phpgw']->link('/index.php',$link_data),
'delete_action' =>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uistandard_entity.delete&id='
. $id.'&type='.$type),
'lang_confirm_msg' => lang('do you
really want to delete this entry'),
'lang_yes' =>
lang('yes'),
'lang_yes_standardtext' => lang('Delete the
entry'),
'lang_no_standardtext' => lang('Back to the
list'),
'lang_no' =>
lang('no')
);
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
}
function list_attribute()
{
$type = get_var('type',array('POST','GET'));
$type_id =
get_var('type_id',array('POST','GET'));
$GLOBALS['phpgw']->xslttpl->add_file(array(
'standard_entity',
'nextmatchs',
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP .
'app_header',
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP .
'search_field'));
//
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP .
'nextmatchs'));
$attrib_list = $this->bo->read_attrib($type,$type_id);
while (is_array($attrib_list) && list(,$attrib) =
each($attrib_list))
{
$words = split(' ',$attrib['descr']);
$first = "$words[0] $words[1] $words[2]
$words[3]";
$content[] = array
(
'num'
=> $attrib['num'],
'type_num'
=> $attrib['type_num'],
'datatype'
=> $attrib['datatype'],
'first'
=> $first,
'link_edit'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uistandard_entity.edit_attrib&id='
. $attrib['id'].'&type='.$type.'&type_id='.$type_id),
'link_delete'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uistandard_entity.delete_attrib&id='
. $attrib['id'].'&type='.$type),
'lang_view_attribtext' =>
lang('view the attrib'),
'lang_attribute_attribtext' =>
lang('attributes for the attrib'). ' ' . lang($type),
'lang_edit_attribtext' =>
lang('edit the attrib'),
'lang_delete_attribtext' =>
lang('delete the attrib'),
'text_attribute'
=> lang('Attributes'),
'text_edit'
=> lang('edit'),
'text_delete'
=> lang('delete')
);
}
//_debug_array($content);
$table_header[] = array
(
'lang_type_num' => lang('Type'),
'lang_descr' => lang('Descr'),
'lang_datatype' => lang('Datatype'),
'lang_edit' => lang('edit'),
'lang_delete' => lang('delete'),
'sort_num' =>
$this->nextmatchs->show_sort_order(array
(
'sort' => $this->sort,
'var' => 'num',
'order' => $this->order,
'extra' => array('menuaction' =>
$this->currentapp.'.uistandard_entity.list_attribute',
'type' =>$type,
'type_id'
=>$type_id)
)),
'lang_num' => lang('Name'),
);
$table_add[] = array
(
'lang_add' =>
lang('add'),
'lang_add_attribtext' => lang('add a attrib'),
'add_action' =>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uistandard_entity.edit_attrib&type='.$type.'&type_id='.$type_id),
'lang_done' =>
lang('done'),
'lang_done_attribtext' => lang('back to
admin'),
'done_action' =>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uistandard_entity.index&type='.$type),
);
$data = array
(
'allow_all_rows'
=> False,
'start_record'
=> $this->start,
'record_limit'
=> $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'],
'num_records'
=> count($attrib_list),
'all_records'
=> $this->bo->total_records,
'link_url'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uistandard_entity.index&type='.$type),
'img_path'
=> $GLOBALS['phpgw']->common->get_image_path('phpgwapi'),
'appname'
=> lang($this->currentapp),
'function_msg'
=> lang('list '.$type.' attrib'),
'lang_searchfield_attribtext' => lang('Enter
the search string. To show all entries, empty this field and press the SUBMIT
button again'),
'lang_searchbutton_attribtext' => lang('Submit
the search string'),
'query'
=> $this->query,
'lang_submit'
=> lang('submit'),
'table_header_attrib' =>
$table_header,
'values_attrib'
=> $content,
'table_add'
=> $table_add
);
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_attribute' => $data));
$this->save_sessiondata();
}
function edit_attrib()
{
$type_id =
get_var('type_id',array('POST','GET'));
$type = get_var('type',array('POST','GET'));
$id = get_var('id',array('POST','GET'));
$values =
get_var('values',array('POST'));
$GLOBALS['phpgw']->xslttpl->add_file(array('standard_entity',$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default')
. SEP . 'app_header'));
if ($values['save'])
{
if($id)
{
$values['id']=$id;
$action='edit';
}
else
{
// $id =
$values['id'];
$attrib['num'] =
$values['num'];
$attrib['descr'] =
$values['descr'];
}
$message =
$this->bo->save($values,$action,$type);
if(!$id)
{
$id=$message['id'];
$message=$message['message'];
}
}
if ($id)
{
$attrib =
$this->bo->read_single_attrib($id,$type);
$type_num=$attrib['type_num'];
$function_msg = lang('edit attribute'). ' ' .
lang($type_num);
$action='edit';
}
else
{
$function_msg = lang('add attribute');
$action='add';
}
$link_data = array
(
'menuaction' =>
$this->currentapp.'.uistandard_entity.edit_attrib',
'id' => $id,
'type' => $type
);
//_debug_array($link_data);
$data = array
(
'appname'
=> lang($type),
'function_msg' =>
$function_msg,
'form_action' =>
$GLOBALS['phpgw']->link('/index.php',$link_data),
'done_action' =>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uistandard_entity.list_attribute&type='.$type.'&type_id='.$type_id),
'lang_id'
=> lang('Attribute ID'),
'lang_num'
=> lang('Name'),
'lang_descr' =>
lang('Descr'),
'lang_entity_type' =>
lang('Type'),
'lang_no_entity_type' => lang('No
entity type'),
'lang_save'
=> lang('save'),
'lang_done'
=> lang('done'),
'value_id'
=> $id,
'value_num'
=> $attrib['num'],
'message'
=> $message,
'lang_id_attribtext' => lang('Enter
the attribute ID'),
'lang_entity_statustext' => lang('Select
a entity type'),
'lang_descr_attribtext' => lang('Enter
a description the attribute'),
'lang_done_attribtext' => lang('Back
to the list'),
'lang_save_attribtext' => lang('Save
the attribute'),
'type_id'
=> $attrib['type_id'],
'value_descr' =>
$attrib['descr'],
'entity_list' =>
$this->bo->select_entity_type($type,$attrib['type_id']),
'select_entity_type' =>
'values[type_id]',
'lang_datatype' =>
lang('Datatype'),
'lang_datatype_statustext' => lang('Select
a datatype'),
'lang_no_datatype' =>
lang('No datatype'),
'datatype_list' =>
$this->bo->select_datatype($attrib['datatype']),
'select_datatype' =>
'values[datatype]'
);
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_attrib' => $data));
}
}
?>
Index: class.sostandard_2.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.sostandard_2.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** class.sostandard_2.inc.php 12 Dec 2002 18:15:33 -0000 1.1
--- class.sostandard_2.inc.php 13 Dec 2002 18:13:33 -0000 1.2
***************
*** 110,113 ****
--- 110,116 ----
$table='fm_wo_chapter';
break;
+ case 'building_part':
+ $table='fm_building_part';
+ break;
}
Index: hook_admin.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/hook_admin.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** hook_admin.inc.php 12 Dec 2002 18:15:33 -0000 1.9
--- hook_admin.inc.php 13 Dec 2002 18:13:33 -0000 1.10
***************
*** 22,30 ****
'Documentation Categories' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index&appname=p_documentation'),
'Configuration' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname='
. $appname),
! 'Equipment type'=>
$GLOBALS['phpgw']->link('/property/list_equipment_type.php'),
'Equipment type attributes'=>
$GLOBALS['phpgw']->link('/property/list_equipment_type_attribute.php'),
! 'Property type'=>
$GLOBALS['phpgw']->link('/property/list_property_type.php'),
'Property type attributes '=>
$GLOBALS['phpgw']->link('/property/list_property_type_attribute.php'),
'Property type attributes class'=>
$GLOBALS['phpgw']->link('/property/list_property_type_attribute_class.php'),
'Workorder template'=>
$GLOBALS['phpgw']->link('/property/list_wo_template.php'),
'Tender chapter'=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uistandard_2.index&type=tender_chapter'),
--- 22,31 ----
'Documentation Categories' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index&appname=p_documentation'),
'Configuration' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname='
. $appname),
! 'Equipment type'=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uistandard_entity.index&type=equipment'),
'Equipment type attributes'=>
$GLOBALS['phpgw']->link('/property/list_equipment_type_attribute.php'),
! 'Property type'=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uistandard_entity.index&type=property'),
'Property type attributes '=>
$GLOBALS['phpgw']->link('/property/list_property_type_attribute.php'),
'Property type attributes class'=>
$GLOBALS['phpgw']->link('/property/list_property_type_attribute_class.php'),
+ 'Building Part'=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uistandard_2.index&type=building_part'),
'Workorder template'=>
$GLOBALS['phpgw']->link('/property/list_wo_template.php'),
'Tender chapter'=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uistandard_2.index&type=tender_chapter'),
***************
*** 35,39 ****
'Request type'=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uistandard_2.index&type=request_type'),
// 'Request type attributes'=>
$GLOBALS['phpgw']->link('/property/list_request_type_attribute.php'),
! 'Key location'=>
$GLOBALS['phpgw']->link('/property/list_key_location.php'),
'Branch'=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uistandard_3.index&type=branch'),
'Accounting'=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uistandard_2.index&type=accounting'),
--- 36,40 ----
'Request type'=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uistandard_2.index&type=request_type'),
// 'Request type attributes'=>
$GLOBALS['phpgw']->link('/property/list_request_type_attribute.php'),
! 'Key location'=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uistandard_3.index&type=key_location'),
'Branch'=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uistandard_3.index&type=branch'),
'Accounting'=>
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uistandard_2.index&type=accounting'),
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: property/inc class.bostandard_entity.inc.php,NONE,1.1 class.sostandard_entity.inc.php,NONE,1.1 class.uistandard_entity.inc.php,NONE,1.1 class.sostandard_2.inc.php,1.1,1.2 hook_admin.inc.php,1.9,1.10,
Sigurd Nes <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] CVS: property/templates/default standard_entity.xsl,NONE,1.1 standard_3.xsl,1.1,1.2
- Next by Date:
[Phpgroupware-cvs] CVS: property/templates/default standard_entity.xsl,1.1,1.2
- Previous by thread:
[Phpgroupware-cvs] CVS: property/templates/default standard_entity.xsl,NONE,1.1 standard_3.xsl,1.1,1.2
- Next by thread:
[Phpgroupware-cvs] CVS: property/templates/default standard_entity.xsl,1.1,1.2
- Index(es):