phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] sms inc/class.boconfig.inc.php inc/class.socomm...


From: Sigurd Nes
Subject: [Phpgroupware-cvs] sms inc/class.boconfig.inc.php inc/class.socomm...
Date: Wed, 24 May 2006 13:32:33 +0000

CVSROOT:        /sources/phpgroupware
Module name:    sms
Branch:         
Changes by:     Sigurd Nes <address@hidden>     06/05/24 13:32:33

Modified files:
        inc            : class.boconfig.inc.php class.socommon.inc.php 
                         class.soconfig.inc.php class.uiconfig.inc.php 
        setup          : tables_current.inc.php tables_update.inc.php 
        templates/base : config.xsl 

Log message:
        

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/inc/class.boconfig.inc.php.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/inc/class.socommon.inc.php.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/inc/class.soconfig.inc.php.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/inc/class.uiconfig.inc.php.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/setup/tables_current.inc.php.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/setup/tables_update.inc.php.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/templates/base/config.xsl.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: sms/inc/class.boconfig.inc.php
diff -u sms/inc/class.boconfig.inc.php:1.2 sms/inc/class.boconfig.inc.php:1.3
--- sms/inc/class.boconfig.inc.php:1.2  Tue May 23 13:02:12 2006
+++ sms/inc/class.boconfig.inc.php      Wed May 24 13:32:33 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package sms
        * @subpackage config
-       * @version $Id: class.boconfig.inc.php,v 1.2 2006/05/23 13:02:12 
sigurdne Exp $
+       * @version $Id: class.boconfig.inc.php,v 1.3 2006/05/24 13:32:33 
sigurdne Exp $
        */
 
        /**
@@ -174,7 +174,6 @@
                }
 
 
-
                function read_attrib($type_id)
                {
                        $config_info = $this->so->read_attrib(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
@@ -193,12 +192,10 @@
 
                function save_attrib($values,$action='')
                {
-
                        if ($action=='edit')
                        {
                                if ($values['attrib_id'] != '')
                                {
-
                                        $receipt = 
$this->so->edit_attrib($values);
                                }
                                else
@@ -220,6 +217,56 @@
                }
 
 
+               function read_value($type_id,$attrib_id)
+               {
+                       $config_info = $this->so->read_value(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
+                                                                               
        'allrows'=>$this->allrows, 'type_id'=>$type_id, 'attrib_id' 
=>$attrib_id));
+                       $this->total_records = $this->so->total_records;
+                       return $config_info;
+               }
+
+               function read_single_value($type_id,$attrib_id,$id)
+               {
+                       $values 
=$this->so->read_single_value($type_id,$attrib_id,$id);
+
+                       return $values;
+               }
+
+
+               function save_value($values,$action='')
+               {
+                       if ($action=='edit')
+                       {
+                               if ($values['id'] != '')
+                               {
+                                       $receipt = 
$this->so->edit_value($values);
+                               }
+                               else
+                               {
+                                       
$receipt['error'][]=array('msg'=>lang('Error'));
+                               }
+                       }
+                       else
+                       {
+                               $receipt = $this->so->add_value($values);
+                       }
+
+                       return $receipt;
+               }
+
+               function delete_value($type_id,$attrib_id,$id)
+               {
+                       $this->so->delete_value($type_id,$attrib_id,$id);
+               }
+
+
+               function select_choice_list($type_id,$attrib_id,$selected='')
+               {
+                       $list = 
$this->so->select_choice_list($type_id,$attrib_id);
+                       return $this->bocommon->select_list($selected,$list);
+               }
+
+
                function select_input_type_list($selected='')
                {
                        $input_type[0]['id'] = 'text';
Index: sms/inc/class.socommon.inc.php
diff -u sms/inc/class.socommon.inc.php:1.1 sms/inc/class.socommon.inc.php:1.2
--- sms/inc/class.socommon.inc.php:1.1  Tue May 23 13:02:12 2006
+++ sms/inc/class.socommon.inc.php      Wed May 24 13:32:33 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package sms
        * @subpackage core
-       * @version $Id: class.socommon.inc.php,v 1.1 2006/05/23 13:02:12 
sigurdne Exp $
+       * @version $Id: class.socommon.inc.php,v 1.2 2006/05/24 13:32:33 
sigurdne Exp $
        */
 
        /**
@@ -50,7 +50,6 @@
 
                function next_id($table='',$key='')
                {
-_debug_array($key);
                        if(is_array($key))
                        {
                                while (is_array($key) && list($column,$value) = 
each($key))
Index: sms/inc/class.soconfig.inc.php
diff -u sms/inc/class.soconfig.inc.php:1.2 sms/inc/class.soconfig.inc.php:1.3
--- sms/inc/class.soconfig.inc.php:1.2  Tue May 23 13:02:12 2006
+++ sms/inc/class.soconfig.inc.php      Wed May 24 13:32:33 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package sms
        * @subpackage config
-       * @version $Id: class.soconfig.inc.php,v 1.2 2006/05/23 13:02:12 
sigurdne Exp $
+       * @version $Id: class.soconfig.inc.php,v 1.3 2006/05/24 13:32:33 
sigurdne Exp $
        */
 
        /**
@@ -165,8 +165,12 @@
 
                function delete_type($id)
                {
-
+                       $this->db->transaction_begin();
+                       $this->db->query('DELETE FROM phpgw_sms_config_value 
WHERE type_id =' . intval($type_id),__LINE__,__FILE__);
+                       $this->db->query('DELETE FROM phpgw_sms_config_choice 
WHERE type_id =' . intval($type_id),__LINE__,__FILE__);
+                       $this->db->query('DELETE FROM phpgw_sms_config_attrib 
WHERE type_id =' . intval($type_id),__LINE__,__FILE__);
                        $this->db->query('DELETE FROM phpgw_sms_config_type 
WHERE id='  . intval($id),__LINE__,__FILE__);
+                       $this->db->transaction_commit();
                }
 
                function read_attrib($data)
@@ -198,8 +202,9 @@
                                $ordermethod = ' order by name asc';
                        }
 
-                       $table = 'phpgw_sms_config_attrib';
-
+                       $attrib_table = 'phpgw_sms_config_attrib';
+                       $value_table = 'phpgw_sms_config_value';
+                       
                        if($query)
                        {
                                $query = ereg_replace("'",'',$query);
@@ -208,7 +213,7 @@
                                $querymethod = " AND name $this->like 
'%$query%'";
                        }
 
-                       $sql = "SELECT * FROM $table WHERE type_id = '$type_id' 
$querymethod";
+                       $sql = "SELECT * , $value_table.id as value_id FROM 
$attrib_table LEFT JOIN $value_table ON ($attrib_table.type_id = 
$value_table.type_id AND $attrib_table.id = $value_table.attrib_id )WHERE 
$attrib_table.type_id = '$type_id' $querymethod";
 
                        $this->db2->query($sql,__LINE__,__FILE__);
                        $this->total_records = $this->db2->num_rows();
@@ -226,10 +231,11 @@
                        {
                                $config_info[] = array
                                (
-                                       'id'            => $this->db->f('id'),
+                                       'id'            => $this->db->f(1),
                                        'type_id'       => 
$this->db->f('type_id'),
+                                       'value_id'      => 
$this->db->f('value_id'),                                    
                                        'name'          => 
stripslashes($this->db->f('name')),
-                                       'descr'         => 
stripslashes($this->db->f('descr'))
+                                       'value'         => 
stripslashes($this->db->f('value'))
                                );
                        }
 
@@ -249,11 +255,34 @@
                                $values['input_type']   = 
$this->db->f('input_type');
                                $values['name']         = 
stripslashes($this->db->f('name'));
                                $values['descr']        = 
stripslashes($this->db->f('descr'));
+                               if($this->db->f('input_type')=='listbox')
+                               {
+                                       $values['choice'] = 
$this->read_attrib_choice($type_id,$id);
+                               }
                        }
+
                        return $values;
                }
 
 
+               function read_attrib_choice($type_id,$attrib_id)
+               {
+                       $choice_table = 'phpgw_sms_config_choice';
+                       $sql = "SELECT * FROM $choice_table WHERE 
type_id=$type_id AND attrib_id=$attrib_id ";
+                       $this->db->query($sql,__LINE__,__FILE__);
+
+                       while ($this->db->next_record())
+                       {
+                               $choice[] = array
+                               (
+                                       'id'    => $this->db->f('id'),
+                                       'value' => $this->db->f('value')
+                               );
+                       }
+                       return $choice;
+               }
+
+
                function add_attrib($values)
                {
                        $this->db->transaction_begin();
@@ -284,7 +313,6 @@
 
                function edit_attrib($values)
                {
-
                        $this->db->transaction_begin();
 
                        $value_set['name']      = 
$this->db->db_addslashes($values['name']);
@@ -295,6 +323,33 @@
 
                        $this->db->query("UPDATE phpgw_sms_config_attrib set 
$value_set WHERE type_id =" . $values['type_id'] . " AND id=" . 
$values['attrib_id'],__LINE__,__FILE__);
 
+
+                       if($values['new_choice'])
+                       {
+                               $choice_id = 
$this->bocommon->next_id('phpgw_sms_config_choice' 
,array('type_id'=>$values['type_id'],'attrib_id'=>$values['attrib_id']));
+       
+                               $values_insert= array(
+                                       $values['type_id'],
+                                       $values['attrib_id'],
+                                       $choice_id,
+                                       $values['new_choice']
+                                       );
+
+                               $values_insert  = 
$this->bocommon->validate_db_insert($values_insert);
+
+                               $this->db->query("INSERT INTO 
phpgw_sms_config_choice (type_id,attrib_id,id,value) "
+                               . "VALUES ($values_insert)",__LINE__,__FILE__);
+                       }
+
+                       if($values['delete_choice'])
+                       {
+                               for 
($i=0;$i<count($values['delete_choice']);$i++)
+                               {
+                                       $this->db->query("DELETE FROM 
phpgw_sms_config_choice WHERE type_id=" . $values['type_id']. " AND attrib_id=" 
. $values['attrib_id']  ." AND id=" . 
$values['delete_choice'][$i],__LINE__,__FILE__);
+                               }
+                       }
+
+
                        $this->db->transaction_commit();
 
                        $receipt['message'][]=array('msg'=>lang('config attrib 
has been edited'));
@@ -305,9 +360,167 @@
 
                function delete_attrib($type_id,$id)
                {
-                       $this->db->query('DELETE_ FROM phpgw_sms_config_attrib 
WHERE type_id =' . intval($type_id) . ' AND id=' . 
intval($id),__LINE__,__FILE__);
+                       $this->db->transaction_begin();
+                       $this->db->query('DELETE FROM phpgw_sms_config_value 
WHERE type_id =' . intval($type_id) . ' AND attrib_id=' . 
intval($id),__LINE__,__FILE__);
+                       $this->db->query('DELETE FROM phpgw_sms_config_choice 
WHERE type_id =' . intval($type_id) . ' AND attrib_id=' . 
intval($id),__LINE__,__FILE__);
+                       $this->db->query('DELETE FROM phpgw_sms_config_attrib 
WHERE type_id =' . intval($type_id) . ' AND id=' . 
intval($id),__LINE__,__FILE__);
+                       $this->db->transaction_commit();
+               }
+
+               function read_value($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']:'');
+                               $allrows        = 
(isset($data['allrows'])?$data['allrows']:'');
+                               $type_id        = 
(isset($data['type_id'])?$data['type_id']:0);
+                               $attrib_id      = 
(isset($data['attrib_id'])?$data['attrib_id']:0);
+                       }
+
+                       if ($order)
+                       {
+                               $ordermethod = " order by $order $sort";
+
+                       }
+                       else
+                       {
+                               $ordermethod = ' order by value asc';
+                       }
+
+                       $table = 'phpgw_sms_config_value';
+
+                       if($query)
+                       {
+                               $query = ereg_replace("'",'',$query);
+                               $query = ereg_replace('"','',$query);
+
+                               $querymethod = " AND name $this->like 
'%$query%'";
+                       }
+
+                       $sql = "SELECT * FROM $table WHERE type_id = '$type_id' 
AND attrib_id = '$attrib_id' $querymethod";
+
+                       $this->db2->query($sql,__LINE__,__FILE__);
+                       $this->total_records = $this->db2->num_rows();
+
+                       if(!$allrows)
+                       {
+                               $this->db->limit_query($sql . 
$ordermethod,$start,__LINE__,__FILE__);
+                       }
+                       else
+                       {
+                               $this->db->query($sql . 
$ordermethod,__LINE__,__FILE__);
+                       }
+
+                       while ($this->db->next_record())
+                       {
+                               $config_info[] = array
+                               (
+                                       'id'            => $this->db->f('id'),
+                                       'type_id'       => $type_id,
+                                       'attrib_id'     => $attrib_id,
+                                       'value'         => 
stripslashes($this->db->f('value')),
+
+                               );
+                       }
+
+                       return $config_info;
+               }
+
+
+               function read_single_value($type_id,$attrib_id,$id)
+               {
+                       $sql = 'SELECT * FROM phpgw_sms_config_value WHERE 
type_id =' . intval($type_id) . ' AND attrib_id=' . intval($attrib_id) . ' AND 
id=' . intval($id);
+
+                       $this->db->query($sql,__LINE__,__FILE__);
+
+                       if ($this->db->next_record())
+                       {
+                               $values['id']           = $id;
+                               $values['value']        = 
stripslashes($this->db->f('value'));
+                       }
+
+                       return $values;
                }
 
+               function add_value($values)
+               {
+                       $this->db->transaction_begin();
+
+                       $values['value'] = 
$this->db->db_addslashes($values['value']);
+                       $id = 
$this->bocommon->next_id('phpgw_sms_config_value',array('type_id'=>$values['type_id'],'attrib_id'=>$values['attrib_id']));
+
+                       $insert_values=array(
+                               $values['type_id'],
+                               $values['attrib_id'],
+                               $id,
+                               $values['value']
+                               );
+
+                       $insert_values  = 
$this->bocommon->validate_db_insert($insert_values);
+                       $this->db->query("INSERT INTO phpgw_sms_config_value 
(type_id,attrib_id,id,value) "
+                               . "VALUES ($insert_values)",__LINE__,__FILE__);
+
+                       $receipt['message'][]=array('msg'=>lang('config value 
has been saved'));
+                       $receipt['attrib_id']= $values['attrib_id'];
+
+                       $this->db->transaction_commit();
+
+                       return $receipt;
+               }
+
+               function edit_value($values)
+               {
+                       if(!$values['value'])
+                       {
+                               
$this->delete_value($values['type_id'],$values['attrib_id'],$values['id']);
+                       }
+                       else
+                       {
+                               $this->db->transaction_begin();
+                               $value_set['value']     = 
$this->db->db_addslashes($values['value']);
+                               $value_set      = 
$this->bocommon->validate_db_update($value_set);
+                               $this->db->query("UPDATE phpgw_sms_config_value 
set $value_set WHERE type_id =" . $values['type_id'] . " AND attrib_id=" . 
$values['attrib_id'] . " AND id=" . $values['id'],__LINE__,__FILE__);
+                               $this->db->transaction_commit();
+                       }
+
+                       $receipt['message'][]=array('msg'=>lang('config attrib 
has been edited'));
+
+                       $receipt['attrib_id']= $values['attrib_id'];
+                       return $receipt;
+               }
+
+               function delete_value($type_id,$attrib_id,$id)
+               {
+                       $this->db->transaction_begin();
+                       $this->db->query('DELETE FROM phpgw_sms_config_value 
WHERE type_id =' . intval($type_id) . ' AND attrib_id=' . intval($attrib_id) . 
' AND id=' . intval($id),__LINE__,__FILE__);
+                       $this->db->transaction_commit();
+               }
+
+
+
+               function select_choice_list($type_id,$attrib_id)
+               {
+                       $this->db->query('SELECT * FROM phpgw_sms_config_choice 
WHERE type_id =' . intval($type_id) . ' AND attrib_id=' . intval($attrib_id) . 
' ORDER BY value');
+
+                       while ($this->db->next_record())
+                       {
+                               $choice[] = array(
+                                       'id'    => 
stripslashes($this->db->f('value')),
+                                       'name'  => 
stripslashes($this->db->f('value'))
+                                       );
+                       }
+                       return $choice;
+               }
                function select_conf_list()
                {
                        $this->db->query("SELECT * FROM phpgw_sms_config_type  
ORDER BY name ");
Index: sms/inc/class.uiconfig.inc.php
diff -u sms/inc/class.uiconfig.inc.php:1.2 sms/inc/class.uiconfig.inc.php:1.3
--- sms/inc/class.uiconfig.inc.php:1.2  Tue May 23 13:02:12 2006
+++ sms/inc/class.uiconfig.inc.php      Wed May 24 13:32:33 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package sms
        * @subpackage config
-       * @version $Id: class.uiconfig.inc.php,v 1.2 2006/05/23 13:02:12 
sigurdne Exp $
+       * @version $Id: class.uiconfig.inc.php,v 1.3 2006/05/24 13:32:33 
sigurdne Exp $
        */
 
        /**
@@ -35,6 +35,9 @@
                        'list_attrib'           => True,
                        'edit_attrib'           => True,
                        'delete_attrib'         => True,
+                       'list_value'            => True,
+                       'edit_value'            => True,
+                       'delete_value'          => True,
                );
 
                function uiconfig()
@@ -170,7 +173,7 @@
                                'lang_search'                                   
=> lang('search'),
                                'table_header'                                  
=> $table_header,
                                'table_add'                                     
=> $table_add,
-                               'values'                                        
        => $content
+                               'values'                                        
=> $content
                        );
 
                        $appname                                        = 
lang('config');
@@ -325,8 +328,8 @@
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('config','nextmatchs','menu',
                                                                                
'search_field'));
 
-                       $receipt = 
$GLOBALS['phpgw']->session->appsession('session_data','sms_c_type_receipt');
-                       
$GLOBALS['phpgw']->session->appsession('session_data','sms_c_type_receipt','');
+                       $receipt = 
$GLOBALS['phpgw']->session->appsession('session_data','sms_c_attrib_receipt');
+                       
$GLOBALS['phpgw']->session->appsession('session_data','sms_c_attrib_receipt','');
 
                        $links = $this->menu->links();
 
@@ -338,18 +341,15 @@
                                $content[] = array
                                (
                                        'name'                                  
=> $entry['name'],
-                                       'link_values'                           
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiconfig.list_values&type_id='
 . $entry['type_id'] . '&attrib_id='  . $entry['id']),
+                                       'link_value'                            
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiconfig.edit_value&type_id='
 . $type_id . '&attrib_id='  . $entry['id'] . '&id='  . $entry['value_id']),
                                        'link_edit'                             
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiconfig.edit_attrib&type_id='
 . $entry['type_id'] . '&attrib_id='  . $entry['id']),
                                        'link_delete'                           
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiconfig.delete_attrib&type_id='
 . $entry['type_id'] . '&attrib_id='  . $entry['id']),
-                                       'link_view'                             
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiconfig.view_attrib&type_id='
 . $entry['type_id'] . '&attrib_id='  . $entry['id']),
-                                       'lang_view_config_text'                 
=> lang('view the config'),
                                        'lang_edit_config_text'                 
=> lang('edit the config'),
-                                       'text_view'                             
=> lang('view'),
                                        'text_edit'                             
=> lang('edit'),
                                        'text_delete'                           
=> lang('delete'),
-                                       'text_values'                   => 
lang('values'),
+                                       'text_value'                            
=> $entry['value']?$entry['value']:lang('value'),
                                        'lang_delete_config_text'               
=> lang('delete the config'),
-                                       'lang_values_text'                      
=> lang('values for this config type'),
+                                       'lang_value_text'                       
=> lang('values for this config type'),
                                );
                        }
 
@@ -371,8 +371,7 @@
                                'lang_name'             => lang('name'),
                                'lang_delete'           => lang('delete'),
                                'lang_edit'             => lang('edit'),
-                               'lang_view'             => lang('view'),
-                               'lang_values'   => lang('values'),
+                               'lang_value'    => lang('value'),
                        );
 
                        if(!$this->allrows)
@@ -509,6 +508,13 @@
 
                        $type = $this->bo->read_single_type($type_id);
                        
+
+                       if($values['input_type']=='listbox')
+                       {
+                               $multiple_choice= True;
+                       }
+
+
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
 
                        $data = array
@@ -522,7 +528,16 @@
                                'input_type_list'               => 
$this->bo->select_input_type_list($values['input_type']),
                                'lang_no_input_type'            => lang('no 
input type'),
                                'lang_lang_input_type_status_text'=> 
lang('input type'),
-                               
+
+                               'lang_choice'                           => 
lang('Choice'),
+                               'lang_new_value'                        => 
lang('New value'),
+                               'lang_new_value_statustext'             => 
lang('New value for multiple choice'),
+                               'multiple_choice'                       => 
$multiple_choice,
+                               'value_choice'                          => 
$values['choice'],
+                               'lang_delete_value'                     => 
lang('Delete value'),
+                               'lang_value'                            => 
lang('value'),
+                               'lang_delete_choice_statustext'=> lang('Delete 
this value from the list of multiple choice'),
+
                                'msgbox_data'                   => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'form_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
                                'lang_id'                       => lang('ID'),
@@ -544,6 +559,261 @@
                }
 
 
+
+               function list_value()
+               {
+                       $type_id        = 
get_var('type_id',array('POST','GET'));
+                       $attrib_id      = 
get_var('attrib_id',array('POST','GET'));
+                                               
+                       if(!$type_id && !$attrib_id)
+                       {
+                               
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uiconfig.index');
+                       }
+                       
+                       
$GLOBALS['phpgw']->xslttpl->add_file(array('config','nextmatchs','menu',
+                                                                               
'search_field'));
+
+                       $receipt = 
$GLOBALS['phpgw']->session->appsession('session_data','sms_c_value_receipt');
+                       
$GLOBALS['phpgw']->session->appsession('session_data','sms_c_attrib_value','');
+
+                       $links = $this->menu->links();
+
+                       $config_info = 
$this->bo->read_value($type_id,$attrib_id);
+
+                       while (is_array($config_info) && list(,$entry) = 
each($config_info))
+                       {
+
+                               $content[] = array
+                               (
+                                       'value'                                 
=> $entry['value'],
+                                       'link_edit'                             
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiconfig.edit_value&type_id='
 . $entry['type_id'] . '&attrib_id='  . $entry['attrib_id'] . '&id='  . 
$entry['id']),
+                                       'link_delete'                           
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiconfig.delete_value&type_id='
 . $entry['type_id'] . '&attrib_id='  . $entry['attrib_id'] . '&id='  . 
$entry['id']),
+                                       'link_view'                             
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiconfig.view_value&type_id='
 . $entry['type_id'] . '&attrib_id='  . $entry['attrib_id'] . '&id='  . 
$entry['id']),
+                                       'lang_view_config_text'                 
=> lang('view the config'),
+                                       'lang_edit_config_text'                 
=> lang('edit the config'),
+                                       'text_view'                             
=> lang('view'),
+                                       'text_edit'                             
=> lang('edit'),
+                                       'text_delete'                           
=> lang('delete'),
+                                       'text_value'                            
=> lang('value'),
+                                       'lang_delete_config_text'               
=> lang('delete the config'),
+                                       'lang_value_text'                       
=> lang('value for this config type'),
+                               );
+                       }
+
+//_debug_array($content);
+
+                       $table_header[] = array
+                       (
+
+                               'sort_value'    => 
$this->nextmatchs->show_sort_order(array
+                                                                               
(
+                                                                               
        'sort'  => $this->sort,
+                                                                               
        'var'   =>      'value',
+                                                                               
        'order' =>      $this->order,
+                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uiconfig.index',
+                                                                               
                                'query'         =>$this->query,
+                                                                               
                                'cat_id'        =>$this->cat_id,
+                                                                               
                                'allrows' => $this->allrows)
+                                                                               
)),
+                               'lang_value'            => lang('value'),
+                               'lang_delete'           => lang('delete'),
+                               'lang_edit'             => lang('edit'),
+                               'lang_view'             => lang('view'),
+
+                       );
+
+                       if(!$this->allrows)
+                       {
+                               $record_limit   = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
+                       }
+                       else
+                       {
+                               $record_limit   = $this->bo->total_records;
+                       }
+
+                       $type = $this->bo->read_single_type($type_id);
+                       $attrib = 
$this->bo->read_single_attrib($type_id,$attrib_id);
+                                               
+                       $link_data = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uiconfig.list_value',
+                                               'sort'                  
=>$this->sort,
+                                               'order'                 
=>$this->order,
+                                               'cat_id'                
=>$this->cat_id,
+                                               'filter'                
=>$this->filter,
+                                               'query'                 
=>$this->query,
+                                               'type_id'               
=>$type_id,
+                                               'attrib_id'             
=>$attrib_id
+                       );
+
+                       if(!$content)
+                       {
+                               $table_add[] = array
+                               (
+                                       'lang_add'              => lang('add'),
+                                       'lang_add_statustext'   => lang('add a 
value'),
+                                       'add_action'            => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiconfig.edit_value&type_id='
 . $type_id . '&attrib_id=' . $attrib_id),
+                               );
+                       }
+
+                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
+
+                       $data = array
+                       (
+                               'link_type'                                     
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiconfig.list_attrib&type_id='
 . $type_id),
+                               'lang_type'                                     
=> lang('type'),
+                               'value_type_name'                               
=> $type['name'],
+                               'lang_attrib'                                   
=> lang('attribute'),
+                               'value_attrib_name'                             
=> $attrib['name'],
+
+                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'links'                                         
=> $links,
+                               'allow_allrows'                                 
=> True,
+                               'allrows'                                       
=> $this->allrows,
+                               'start_record'                                  
=> $this->start,
+                               'record_limit'                                  
=> $record_limit,
+                               'num_records'                                   
=> count($config_info),
+                               'all_records'                                   
=> $this->bo->total_records,
+                               'link_url'                                      
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'img_path'                                      
=> $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
+                               '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_values'                           
=> $table_header,
+                               'table_add'                                     
=> $table_add,
+                               'values_value'                                  
=> $content
+                       );
+
+                       $appname                                        = 
lang('config');
+;
+                       $function_msg                                   = 
lang('list values');
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_value' => $data));
+                       $this->save_sessiondata();
+               }
+
+
+               function edit_value()
+               {
+                       $type_id        = 
get_var('type_id',array('POST','GET'));
+                       $attrib_id      = 
get_var('attrib_id',array('POST','GET'));
+                       $id             = get_var('id',array('POST','GET'));
+                       $values         = get_var('values',array('POST'));
+
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('config'));
+
+                       if (is_array($values))
+                       {
+                               if ($values['save'] || $values['apply'])
+                               {
+
+                                       $values[type_id] = $type_id;
+                                       $values[attrib_id] = $attrib_id;
+                                                                               
+                                       if(!$values['value'] && !$id)
+                                       {
+                                               
$receipt['error'][]=array('msg'=>lang('Please enter a value !'));
+                                       }
+
+                                       if($id)
+                                       {
+                                               $values['id']=$id;
+                                               $action='edit';
+                                       }
+
+                                       if(!$receipt['error'])
+                                       {
+                                               $receipt = 
$this->bo->save_value($values,$action);
+                                               $id = $receipt['id'];
+
+                                               if ($values['save'])
+                                               {
+                                                       
$GLOBALS['phpgw']->session->appsession('session_data','sms_c_attrib_receipt',$receipt);
+                                                       
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uiconfig.list_attrib&type_id='
 . $type_id . '&attrib_id=' . $attrib_id);
+                                               }
+                                       }
+                               }
+                               else
+                               {
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uiconfig.list_attrib&type_id='
 . $type_id . '&attrib_id=' . $attrib_id);
+                               }
+                       }
+
+
+                       if ($id)
+                       {
+                               if(!$receipt['error'])
+                               {
+                                       $values = 
$this->bo->read_single_value($type_id,$attrib_id,$id);
+                               }
+                               $function_msg = lang('edit value');
+                               $action='edit';
+                       }
+                       else
+                       {
+                               $function_msg = lang('add value');
+                               $action='add';
+                       }
+
+                       $link_data = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uiconfig.edit_value',
+                               'type_id'       => $type_id,
+                               'attrib_id'     => $attrib_id,
+                               'id'            => $id
+                       );
+
+                       $type = $this->bo->read_single_type($type_id);
+                       $attrib = 
$this->bo->read_single_attrib($type_id,$attrib_id);                   
+
+                       if($attrib['input_type']=='listbox')
+                       {
+                               $choice_list = 
$this->bo->select_choice_list($type_id,$attrib_id,$values['value']);
+                       }
+
+
+                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
+
+                       $data = array
+                       (
+                               'lang_type'                                     
=> lang('type'),
+                               'value_type_name'                               
=> $type['name'],
+                               'lang_attrib'                                   
=> lang('attribute'),
+                               'value_attrib_name'                             
=> $attrib['name'],
+
+                               'value_value'                   => 
$values['value'],
+                               'lang_value'                    => 
lang('value'),
+                               'choice_list'                   => $choice_list,
+                               'lang_no_value'         => lang('no value'),
+                               'lang_value_status_text'=> lang('select value'),
+
+                               'msgbox_data'                   => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'form_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'lang_id'                       => lang('ID'),
+                               'lang_save'                     => lang('save'),
+                               'lang_cancel'                   => 
lang('cancel'),
+                               'lang_type'                     => lang('type'),
+                               'value_type'                    => 
$type['name'],
+                               'lang_attrib'                   => 
lang('attribute'),
+                               'value_attrib'                  => 
$attrib['name'],
+                               'value_id'                      => $id,
+
+                               'lang_done_status_text'         => lang('Back 
to the list'),
+                               'lang_save_status_text'         => lang('Save 
the training'),
+                               'lang_apply'                    => 
lang('apply'),
+                               'lang_apply_status_text'        => lang('Apply 
the values'),
+                       );
+
+                       $appname                                        = 
lang('config');
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_value' => $data));
+               }
+
+
+
                function delete_type()
                {
                        $type_id        = 
get_var('type_id',array('POST','GET'));
@@ -558,7 +828,7 @@
                        if (get_var('confirm',array('POST')))
                        {
                                $this->bo->delete_type($type_id);
-                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
+                               
$GLOBALS['phpgw']->redirect_link($GLOBALS['phpgw']->link('/index.php',$link_data));
                        }
 
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('app_delete'));
@@ -597,7 +867,7 @@
                        if (get_var('confirm',array('POST')))
                        {
                                $this->bo->delete_attrib($type_id,$attrib_id);
-                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
+                               
$GLOBALS['phpgw']->redirect_link($GLOBALS['phpgw']->link('/index.php',$link_data));
                        }
 
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('app_delete'));
@@ -620,4 +890,46 @@
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                }
 
+
+               function delete_value()
+               {
+                       $type_id        = 
get_var('type_id',array('POST','GET'));
+                       $attrib_id      = 
get_var('attrib_id',array('POST','GET'));
+                       $id             = get_var('id',array('POST','GET'));
+                       $confirm        = get_var('confirm',array('POST'));
+
+                       $link_data = array
+                       (
+                               'menuaction' => 
$this->currentapp.'.uiconfig.index',
+                               'type_id' => $type_id,
+                               'attrib_id' => $attrib_id,
+                               'id' => $id
+                       );
+
+                       if (get_var('confirm',array('POST')))
+                       {
+                               
$this->bo->delete_value($type_id,$attrib_id,$id);
+                               
$GLOBALS['phpgw']->redirect_link($GLOBALS['phpgw']->link('/index.php',$link_data));
+                       }
+
+                       
$GLOBALS['phpgw']->xslttpl->add_file(array('app_delete'));
+
+                       $data = array
+                       (
+                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiconfig.delete_type&type_id='
 . $type_id . '&attrib_id=' . $attrib_id . '&id=' . $id),
+                               'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
+                               'lang_yes'                      => lang('yes'),
+                               'lang_yes_statustext'           => lang('Delete 
the entry'),
+                               'lang_no_statustext'            => lang('Back 
to the list'),
+                               'lang_no'                               => 
lang('no')
+                       );
+
+                       $appname                                        = 
lang('config');
+                       $function_msg                                   = 
lang('delete value');
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
+               }
+
        }
Index: sms/setup/tables_current.inc.php
diff -u sms/setup/tables_current.inc.php:1.4 
sms/setup/tables_current.inc.php:1.5
--- sms/setup/tables_current.inc.php:1.4        Mon May 22 08:50:44 2006
+++ sms/setup/tables_current.inc.php    Wed May 24 13:32:33 2006
@@ -7,7 +7,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package sms
        * @subpackage setup
-       * @version $Id: tables_current.inc.php,v 1.4 2006/05/22 08:50:44 
sigurdne Exp $
+       * @version $Id: tables_current.inc.php,v 1.5 2006/05/24 13:32:33 
sigurdne Exp $
        */
 
 
@@ -463,12 +463,13 @@
                        'fd' => array(
                                'type_id' => array('type' => 'int','precision' 
=> 4,'nullable' => False),
                                'attrib_id' => array('type' => 'int', 
'precision' => 4,'nullable' => False),
+                               'id' => array('type' => 'int', 'precision' => 
4,'nullable' => False),
                                'value' => array('type' => 'varchar', 
'precision' => 20,'nullable' => False)
                        ),
-                       'pk' => array('type_id','attrib_id','value'),
+                       'pk' => array('type_id','attrib_id','id'),
                        'fk' => array(),
                        'ix' => array(),
-                       'uc' => array()
+                       'uc' => array('type_id','attrib_id','value')
                ),
                'phpgw_sms_config_value' => array(
                        'fd' => array(
@@ -480,7 +481,7 @@
                        'pk' => array('type_id','attrib_id','id'),
                        'fk' => array(),
                        'ix' => array(),
-                       'uc' => array()
+                       'uc' => array('type_id','attrib_id','value')
                ),
 
 
Index: sms/setup/tables_update.inc.php
diff -u sms/setup/tables_update.inc.php:1.1 sms/setup/tables_update.inc.php:1.2
--- sms/setup/tables_update.inc.php:1.1 Mon May 22 08:50:44 2006
+++ sms/setup/tables_update.inc.php     Wed May 24 13:32:33 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package hrm
        * @subpackage setup
-       * @version $Id: tables_update.inc.php,v 1.1 2006/05/22 08:50:44 
sigurdne Exp $
+       * @version $Id: tables_update.inc.php,v 1.2 2006/05/24 13:32:33 
sigurdne Exp $
        */
 
        /**
@@ -55,12 +55,13 @@
                                'fd' => array(
                                        'type_id' => array('type' => 
'int','precision' => 4,'nullable' => False),
                                        'attrib_id' => array('type' => 'int', 
'precision' => 4,'nullable' => False),
+                                       'id' => array('type' => 'int', 
'precision' => 4,'nullable' => False),
                                        'value' => array('type' => 'varchar', 
'precision' => 20,'nullable' => False)
                                ),
-                               'pk' => array('type_id','attrib_id','value'),
+                               'pk' => array('type_id','attrib_id','id'),
                                'fk' => array(),
                                'ix' => array(),
-                               'uc' => array()
+                               'uc' => array('type_id','attrib_id','value')
                        )
                );
 
@@ -69,12 +70,13 @@
                                'fd' => array(
                                        'type_id' => array('type' => 
'int','precision' => 4,'nullable' => False),
                                        'attrib_id' => array('type' => 'int', 
'precision' => 4,'nullable' => False),
+                                       'id' => array('type' => 'int', 
'precision' => 4,'nullable' => False),
                                        'value' => array('type' => 'varchar', 
'precision' => 200,'nullable' => False)
                                ),
-                               'pk' => array('type_id','attrib_id','value'),
+                               'pk' => array('type_id','attrib_id','id'),
                                'fk' => array(),
                                'ix' => array(),
-                               'uc' => array()
+                               'uc' => array('type_id','attrib_id','value')
                        )
                );
 
@@ -83,14 +85,14 @@
                $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_attrib (type_id,id,input_type,name, descr) VALUES (1, 
1,'listbox', 'gateway_module', 'Active gateway module')");
                $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_attrib (type_id,id,input_type,name, descr) VALUES (1, 2, 
'text', 'gateway_number', 'Gateway number')");
                $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_attrib (type_id,id,input_type,name, descr) VALUES (2, 1, 
'text', 'gnokii_cfg', 'Gnokii Installation Path')");
-               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_choice (type_id,attrib_id,value) VALUES (1, 1, 'gnokii')");
-               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_choice (type_id,attrib_id,value) VALUES (1, 1, 'clickatell')");
-               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_choice (type_id,attrib_id,value) VALUES (1, 1, 'uplink')");
-               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_choice (type_id,attrib_id,value) VALUES (1, 1, 'kannel')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_choice (type_id,attrib_id,id,value) VALUES (1, 1, 1, 
'gnokii')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_choice (type_id,attrib_id,id,value) VALUES (1, 1, 2, 
'clickatell')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_choice (type_id,attrib_id,id,value) VALUES (1, 1, 3, 
'uplink')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_choice (type_id,attrib_id,id,value) VALUES (1, 1, 4, 
'kannel')");
                
-               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_value (type_id,attrib_id,value) VALUES (1, 1, 'gnokii')");
-               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_value (type_id,attrib_id,value) VALUES (1, 2, '99999999')");
-               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_value (type_id,attrib_id,value) VALUES (2, 1, '/usr/local')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_value (type_id,attrib_id,id,value) VALUES (1, 1, 1, 
'gnokii')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_value (type_id,attrib_id,id,value) VALUES (1, 2, 1, 
'99999999')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_value (type_id,attrib_id,id,value) VALUES (2, 1, 1, 
'/usr/local')");
                
                $GLOBALS['setup_info']['hrm']['currentver'] = '0.9.17.502';
                $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
Index: sms/templates/base/config.xsl
diff -u sms/templates/base/config.xsl:1.2 sms/templates/base/config.xsl:1.3
--- sms/templates/base/config.xsl:1.2   Tue May 23 13:02:12 2006
+++ sms/templates/base/config.xsl       Wed May 24 13:32:33 2006
@@ -1,4 +1,4 @@
-<!-- $Id: config.xsl,v 1.2 2006/05/23 13:02:12 sigurdne Exp $ -->
+<!-- $Id: config.xsl,v 1.3 2006/05/24 13:32:33 sigurdne Exp $ -->
 
        <xsl:template name="app_data">
                <xsl:choose>
@@ -11,10 +11,16 @@
                        <xsl:when test="edit_attrib">
                                <xsl:apply-templates select="edit_attrib"/>
                        </xsl:when>
+                       <xsl:when test="edit_value">
+                               <xsl:apply-templates select="edit_value"/>
+                       </xsl:when>
 
                        <xsl:when test="list_attrib">
                                <xsl:apply-templates select="list_attrib"/>
                        </xsl:when>
+                       <xsl:when test="list_value">
+                               <xsl:apply-templates select="list_value"/>
+                       </xsl:when>
 
                        <xsl:otherwise>
                                <xsl:apply-templates select="list_type"/>
@@ -162,25 +168,21 @@
                                <a href="{$sort_name}"><xsl:value-of 
select="lang_name"/></a>
                        </td>
                        <td class="th_text" width="5%" align="center">
-                               <xsl:value-of select="lang_values"/>
+                               <xsl:value-of select="lang_value"/>
                        </td>
                        <td class="th_text" width="5%" align="center">
                                <xsl:value-of select="lang_edit"/>
                        </td>
                        <td class="th_text" width="5%" align="center">
-                               <xsl:value-of select="lang_view"/>
-                       </td>
-                       <td class="th_text" width="5%" align="center">
                                <xsl:value-of select="lang_delete"/>
                        </td>
                </tr>
        </xsl:template>
 
        <xsl:template match="values_attrib">
-               <xsl:variable name="lang_view_config_text"><xsl:value-of 
select="lang_view_config_text"/></xsl:variable>
                <xsl:variable name="lang_edit_config_text"><xsl:value-of 
select="lang_edit_config_text"/></xsl:variable>
                <xsl:variable name="lang_delete_config_text"><xsl:value-of 
select="lang_delete_config_text"/></xsl:variable>
-               <xsl:variable name="lang_values_text"><xsl:value-of 
select="lang_values_text"/></xsl:variable>
+               <xsl:variable name="lang_value_text"><xsl:value-of 
select="lang_value_text"/></xsl:variable>
                        <tr>
                                <xsl:attribute name="class">
                                        <xsl:choose>
@@ -200,16 +202,107 @@
                                        <xsl:value-of select="name"/>
                                </td>
                                <td align="center">
-                                       <xsl:variable 
name="link_values"><xsl:value-of select="link_values"/></xsl:variable>
-                                       <a href="{$link_values}" 
onMouseover="window.status='{$lang_values_text}';return true;" 
onMouseout="window.status='';return true;"><xsl:value-of 
select="text_values"/></a>
+                                       <xsl:variable 
name="link_value"><xsl:value-of select="link_value"/></xsl:variable>
+                                       <a href="{$link_value}" 
onMouseover="window.status='{$lang_value_text}';return true;" 
onMouseout="window.status='';return true;"><xsl:value-of 
select="text_value"/></a>
                                </td>
                                <td align="center">
                                        <xsl:variable 
name="link_edit"><xsl:value-of select="link_edit"/></xsl:variable>
                                        <a href="{$link_edit}" 
onMouseover="window.status='{$lang_edit_config_text}';return true;" 
onMouseout="window.status='';return true;"><xsl:value-of 
select="text_edit"/></a>
                                </td>
                                <td align="center">
-                                       <xsl:variable 
name="link_view"><xsl:value-of select="link_view"/></xsl:variable>
-                                       <a href="{$link_view}" 
onMouseover="window.status='{$lang_view_config_text}';return true;" 
onMouseout="window.status='';return true;"><xsl:value-of 
select="text_view"/></a>
+                                       <xsl:variable 
name="link_delete"><xsl:value-of select="link_delete"/></xsl:variable>
+                                       <a href="{$link_delete}" 
onMouseover="window.status='{$lang_delete_config_text}';return true;" 
onMouseout="window.status='';return true;"><xsl:value-of 
select="text_delete"/></a>
+                               </td>
+                       </tr>
+       </xsl:template>
+
+
+       <xsl:template match="list_value">
+               <xsl:call-template name="menu"/> 
+               <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
+                       <xsl:choose>
+                               <xsl:when test="msgbox_data != ''">
+                                       <tr>
+                                               <td align="left" colspan="3">
+                                                       <xsl:call-template 
name="msgbox"/>
+                                               </td>
+                                       </tr>
+                               </xsl:when>
+                       </xsl:choose>
+                       <tr>
+                               <td align="left">
+                                       <xsl:value-of select="lang_type"/>
+                                       <xsl:text>: </xsl:text>
+                                       <xsl:variable 
name="link_type"><xsl:value-of select="link_type"/></xsl:variable>
+                                       <a href="{$link_type}"><xsl:value-of 
select="value_type_name"/></a>
+                                       <xsl:text>-> </xsl:text>
+                                       <xsl:value-of select="lang_attrib"/>
+                                       <xsl:text>: </xsl:text>
+                                       <xsl:value-of 
select="value_attrib_name"/>
+                               </td>
+                               <td align="right">
+                                       <xsl:call-template name="search_field"/>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td colspan="3" width="100%">
+                                       <xsl:call-template name="nextmatchs"/>
+                                       <!--    <xsl:with-param 
name="nextmatchs_params"/>
+                                       </xsl:call-template> -->
+                               </td>
+                       </tr>
+               </table>
+               <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
+                               <xsl:apply-templates 
select="table_header_values"/>
+                               <xsl:apply-templates select="values_values"/>
+                               <xsl:choose>
+                                       <xsl:when test="table_add != ''">
+                                               <xsl:apply-templates 
select="table_add"/>
+                                       </xsl:when>
+                               </xsl:choose>
+
+               </table>
+       </xsl:template>
+
+       <xsl:template match="table_header_values">
+               <xsl:variable name="sort_value"><xsl:value-of 
select="sort_value"/></xsl:variable>
+               <tr class="th">
+                       <td class="th_text" width="10%" align="left">
+                               <a href="{$sort_value}"><xsl:value-of 
select="lang_value"/></a>
+                       </td>
+                       <td class="th_text" width="5%" align="center">
+                               <xsl:value-of select="lang_edit"/>
+                       </td>
+                       <td class="th_text" width="5%" align="center">
+                               <xsl:value-of select="lang_delete"/>
+                       </td>
+               </tr>
+       </xsl:template>
+
+       <xsl:template match="values_value">
+               <xsl:variable name="lang_edit_config_text"><xsl:value-of 
select="lang_edit_config_text"/></xsl:variable>
+               <xsl:variable name="lang_delete_config_text"><xsl:value-of 
select="lang_delete_config_text"/></xsl:variable>
+                       <tr>
+                               <xsl:attribute name="class">
+                                       <xsl:choose>
+                                               <xsl:when test="@class">
+                                                       <xsl:value-of 
select="@class"/>
+                                               </xsl:when>
+                                               <xsl:when test="position() mod 
2 = 0">
+                                                       
<xsl:text>row_off</xsl:text>
+                                               </xsl:when>
+                                               <xsl:otherwise>
+                                                       
<xsl:text>row_on</xsl:text>
+                                               </xsl:otherwise>
+                                       </xsl:choose>
+                               </xsl:attribute>
+
+                               <td align="left">
+                                       <xsl:value-of select="value"/>
+                               </td>
+                               <td align="center">
+                                       <xsl:variable 
name="link_edit"><xsl:value-of select="link_edit"/></xsl:variable>
+                                       <a href="{$link_edit}" 
onMouseover="window.status='{$lang_edit_config_text}';return true;" 
onMouseout="window.status='';return true;"><xsl:value-of 
select="text_edit"/></a>
                                </td>
                                <td align="center">
                                        <xsl:variable 
name="link_delete"><xsl:value-of select="link_delete"/></xsl:variable>
@@ -218,7 +311,6 @@
                        </tr>
        </xsl:template>
 
-
        <xsl:template match="table_add">
                        <tr>
                                <td height="50">
@@ -463,6 +555,19 @@
                                        </textarea>
                                </td>
                        </tr>
+                       <xsl:choose>
+                               <xsl:when test="multiple_choice != ''">
+                                       <tr>
+                                               <td valign="top">
+                                                       <xsl:value-of 
select="lang_choice"/>
+                                               </td>
+                                               <td align="right">
+                                                       <xsl:call-template 
name="choice"/>
+                                               </td>
+                                       </tr>
+                               </xsl:when>
+                       </xsl:choose>
+
                        <tr height="50">
                                <td colspan = "2" align = "center"><table><tr>
                                <td valign="bottom">
@@ -502,6 +607,116 @@
                </div>
        </xsl:template>
 
+
+<!-- add / edit value -->
+       <xsl:template match="edit_value">
+               <div align="left">
+               <xsl:variable name="form_action"><xsl:value-of 
select="form_action"/></xsl:variable>
+               <form method="post" action="{$form_action}">
+               <table cellpadding="2" cellspacing="2" width="80%" 
align="center">
+                       <xsl:choose>
+                               <xsl:when test="msgbox_data != ''">
+                                       <tr>
+                                               <td align="left" colspan="3">
+                                                       <xsl:call-template 
name="msgbox"/>
+                                               </td>
+                                       </tr>
+                               </xsl:when>
+                       </xsl:choose>
+
+                       <tr>
+                               <td valign="top" width="30%">
+                                       <xsl:value-of select="lang_type"/>
+                               </td>
+                               <td align="left">
+                                       <xsl:value-of select="value_type"/>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td valign="top" width="30%">
+                                       <xsl:value-of select="lang_attrib"/>
+                               </td>
+                               <td align="left">
+                                       <xsl:value-of select="value_attrib"/>
+                               </td>
+                       </tr>
+
+                       <xsl:choose>
+                               <xsl:when test="value_id != ''">
+                               <tr>
+                               <td valign="top" width="30%">
+                                               <xsl:value-of select="lang_id"/>
+                                       </td>
+                                       <td align="left">
+                                               <xsl:value-of 
select="value_id"/>
+                                       </td>
+                               </tr>
+                               </xsl:when>
+                       </xsl:choose>   
+                       <tr>
+                               <td valign="top" width="10%">
+                                       <xsl:value-of select="lang_value"/>
+                               </td>
+                               <td>
+                               <xsl:choose>
+                                       <xsl:when test="choice_list = ''">
+                                               <input type="text" size="20" 
name="values[value]" value="{value_value}" onMouseout="window.status='';return 
true;">
+                                                       <xsl:attribute 
name="onMouseover">
+                                                               
<xsl:text>window.status='</xsl:text>
+                                                                       
<xsl:value-of select="lang_value_status_text"/>
+                                                               <xsl:text>'; 
return true;</xsl:text>
+                                                       </xsl:attribute>
+                                               </input>
+                                       </xsl:when>
+                                       <xsl:otherwise>
+                                               <xsl:variable 
name="lang_value_status_text"><xsl:value-of 
select="lang_value_status_text"/></xsl:variable>
+                                               <select name="values[value]" 
class="forms" onMouseover="window.status='{$lang_value_status_text}'; return 
true;" onMouseout="window.status='';return true;">
+                                                       <option 
value=""><xsl:value-of select="lang_no_value"/></option>
+                                                       <xsl:apply-templates 
select="choice_list"/>
+                                               </select>
+                                       </xsl:otherwise>
+                               </xsl:choose>
+                               </td>
+                       </tr>
+                       <tr height="50">
+                               <td colspan = "2" align = "left"><table><tr>
+                               <td valign="bottom">
+                                       <xsl:variable 
name="lang_save"><xsl:value-of select="lang_save"/></xsl:variable>
+                                       <input type="submit" 
name="values[save]" value="{$lang_save}" onMouseout="window.status='';return 
true;">
+                                               <xsl:attribute 
name="onMouseover">
+                                                       
<xsl:text>window.status='</xsl:text>
+                                                               <xsl:value-of 
select="lang_save_status_text"/>
+                                                       <xsl:text>'; return 
true;</xsl:text>
+                                               </xsl:attribute>
+                                       </input>
+                               </td>
+                               <td valign="bottom">
+                                       <xsl:variable 
name="lang_apply"><xsl:value-of select="lang_apply"/></xsl:variable>
+                                       <input type="submit" 
name="values[apply]" value="{$lang_apply}" onMouseout="window.status='';return 
true;">
+                                               <xsl:attribute 
name="onMouseover">
+                                                       
<xsl:text>window.status='</xsl:text>
+                                                               <xsl:value-of 
select="lang_apply_status_text"/>
+                                                       <xsl:text>'; return 
true;</xsl:text>
+                                               </xsl:attribute>
+                                       </input>
+                               </td>
+                               <td align="left" valign="bottom">
+                                       <xsl:variable 
name="lang_cancel"><xsl:value-of select="lang_cancel"/></xsl:variable>
+                                       <input type="submit" 
name="values[cancel]" value="{$lang_cancel}" 
onMouseout="window.status='';return true;">
+                                               <xsl:attribute 
name="onMouseover">
+                                                       
<xsl:text>window.status='</xsl:text>
+                                                               <xsl:value-of 
select="lang_cancel_status_text"/>
+                                                       <xsl:text>'; return 
true;</xsl:text>
+                                               </xsl:attribute>
+                                       </input>
+                               </td>
+                               </tr></table></td>
+                       </tr>
+               </table>
+               </form>
+               </div>
+       </xsl:template>
+
        
        <xsl:template match="input_type_list">
        <xsl:variable name="id"><xsl:value-of select="id"/></xsl:variable>
@@ -514,3 +729,78 @@
                        </xsl:otherwise>
                </xsl:choose>
        </xsl:template>
+
+       <xsl:template match="choice_list">
+       <xsl:variable name="id"><xsl:value-of select="id"/></xsl:variable>
+               <xsl:choose>
+                       <xsl:when test="selected">
+                               <option value="{$id}" 
selected="selected"><xsl:value-of disable-output-escaping="yes" 
select="name"/></option>
+                       </xsl:when>
+                       <xsl:otherwise>
+                               <option value="{$id}"><xsl:value-of 
disable-output-escaping="yes" select="name"/></option>
+                       </xsl:otherwise>
+               </xsl:choose>
+       </xsl:template>
+
+
+
+       <xsl:template name="choice">
+                       <table cellpadding="2" cellspacing="2" width="80%" 
align="left">
+                       <xsl:choose>
+                               <xsl:when test="value_choice!=''">
+                                       <tr class="th">
+                                               <td class="th_text" width="85%" 
align="left">
+                                                       <xsl:value-of 
select="lang_value"/>
+                                               </td>
+                                               <td class="th_text" width="15%" 
align="center">
+                                                       <xsl:value-of 
select="lang_delete_value"/>
+                                               </td>
+                                       </tr>
+                               <xsl:for-each select="value_choice" >
+                                       <tr>
+                                               <xsl:attribute name="class">
+                                                       <xsl:choose>
+                                                               <xsl:when 
test="@class">
+                                                                       
<xsl:value-of select="@class"/>
+                                                               </xsl:when>
+                                                               <xsl:when 
test="position() mod 2 = 0">
+                                                                       
<xsl:text>row_off</xsl:text>
+                                                               </xsl:when>
+                                                               <xsl:otherwise>
+                                                                       
<xsl:text>row_on</xsl:text>
+                                                               </xsl:otherwise>
+                                                       </xsl:choose>
+                                               </xsl:attribute>
+                                       <td align="left">
+                                               <xsl:value-of select="value"/>
+                                               <xsl:text> </xsl:text>
+                                       </td>
+                                       <td align="center">
+                                               <input type="checkbox" 
name="values[delete_choice][]" value="{id}"  
onMouseout="window.status='';return true;">
+                                                       <xsl:attribute 
name="onMouseover">
+                                                               
<xsl:text>window.status='</xsl:text>
+                                                                       
<xsl:value-of select="//lang_delete_choice_statustext"/>
+                                                               <xsl:text>'; 
return true;</xsl:text>
+                                                       </xsl:attribute>
+                                               </input>
+                                       </td>
+                                       </tr>
+                               </xsl:for-each>
+                               </xsl:when>
+                       </xsl:choose>
+                       <tr>
+                               <td valign="top">
+                                       <xsl:value-of select="lang_new_value"/>
+                               </td>
+                               <td>
+                                       <input type="text" 
name="values[new_choice]" onMouseout="window.status='';return true;">
+                                               <xsl:attribute 
name="onMouseover">
+                                                       
<xsl:text>window.status='</xsl:text>
+                                                               <xsl:value-of 
select="lang_new_value_statustext"/>
+                                                       <xsl:text>'; return 
true;</xsl:text>
+                                               </xsl:attribute>
+                                       </input>
+                               </td>
+                       </tr>
+                       </table>
+       </xsl:template>




reply via email to

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