phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property/inc class.bos_agreement.inc.php class....


From: Sigurd Nes
Subject: [Phpgroupware-cvs] property/inc class.bos_agreement.inc.php class....
Date: Sun, 12 Aug 2007 21:25:10 +0000

CVSROOT:        /sources/phpgroupware
Module name:    property
Changes by:     Sigurd Nes <sigurdne>   07/08/12 21:25:10

Modified files:
        inc            : class.bos_agreement.inc.php 
                         class.historylog.inc.php class.uientity.inc.php 
                         class.uis_agreement.inc.php 

Log message:
        update

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.bos_agreement.inc.php?cvsroot=phpgroupware&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.historylog.inc.php?cvsroot=phpgroupware&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.uientity.inc.php?cvsroot=phpgroupware&r1=1.45&r2=1.46
http://cvs.savannah.gnu.org/viewcvs/property/inc/class.uis_agreement.inc.php?cvsroot=phpgroupware&r1=1.43&r2=1.44

Patches:
Index: class.bos_agreement.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.bos_agreement.inc.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- class.bos_agreement.inc.php 26 Jan 2007 14:53:46 -0000      1.15
+++ class.bos_agreement.inc.php 12 Aug 2007 21:25:10 -0000      1.16
@@ -24,7 +24,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage agreement
-       * @version $Id: class.bos_agreement.inc.php,v 1.15 2007/01/26 14:53:46 
sigurdne Exp $
+       * @version $Id: class.bos_agreement.inc.php,v 1.16 2007/08/12 21:25:10 
sigurdne Exp $
        */
 
        /**
@@ -682,6 +682,22 @@
                        return $receipt;
                }
 
+               function read_attrib_history($data)
+               {
+               //      _debug_array($data);
+                       $historylog = 
CreateObject($this->currentapp.'.historylog','s_agreement');
+                       $history_values = 
$historylog->return_array(array(),array('SO'),'history_timestamp','ASC',$data['id'],$data['attrib_id'],$data['item_id']);
+                       $this->total_records = count($history_values);
+               //      _debug_array($history_values);
+                       return $history_values;
+               }
+
+               function delete_history_item($data)
+               {
+                       $historylog = 
CreateObject($this->currentapp.'.historylog','s_agreement');
+                       $historylog->delete_single_record($data['history_id']);
+               }
+
 
        }
 ?>

Index: class.historylog.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.historylog.inc.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- class.historylog.inc.php    12 Aug 2007 09:30:50 -0000      1.17
+++ class.historylog.inc.php    12 Aug 2007 21:25:10 -0000      1.18
@@ -24,7 +24,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage core
-       * @version $Id: class.historylog.inc.php,v 1.17 2007/08/12 09:30:50 
sigurdne Exp $
+       * @version $Id: class.historylog.inc.php,v 1.18 2007/08/12 21:25:10 
sigurdne Exp $
        */
 
        /**
@@ -143,7 +143,7 @@
                }
 
                // array $filter_out
-               function return_array($filter_out,$only_show,$_orderby = 
'',$sort = '', $record_id,$attrib_id='')
+               function return_array($filter_out,$only_show,$_orderby = 
'',$sort = '', $record_id,$attrib_id='',$detail_id='')
                {
 
                        if (! $sort || ! $_orderby)
@@ -168,7 +168,12 @@
 
                        if($attrib_id)
                        {
-                               $filter .= "and history_entity_attrib_id = 
$attrib_id";
+                               $filter .= " and history_attrib_id = 
$attrib_id";
+                       }
+
+                       if($detail_id)
+                       {
+                               $filter .= " and history_detail_id = 
$detail_id";
                        }
 
                        while (is_array($only_show) && list(,$_filter) = 
each($only_show))

Index: class.uientity.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.uientity.inc.php,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -b -r1.45 -r1.46
--- class.uientity.inc.php      8 Jun 2007 09:07:30 -0000       1.45
+++ class.uientity.inc.php      12 Aug 2007 21:25:10 -0000      1.46
@@ -24,7 +24,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage entity
-       * @version $Id: class.uientity.inc.php,v 1.45 2007/06/08 09:07:30 
sigurdne Exp $
+       * @version $Id: class.uientity.inc.php,v 1.46 2007/08/12 21:25:10 
sigurdne Exp $
        */
 
        /**
@@ -1430,6 +1430,16 @@
                                'lang_delete'           => lang('delete')
                        );
 
+                       $link_data = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uientity.attrib_history',
+                               'id'                    => $id,
+                               'entity_id'             => $entity_id,
+                               'cat_id'                => $cat_id,
+                               'entity_id'             => $entity_id,
+                               'edit'                  => $edit
+                       );
+
                        $data = array
                        (
                                'allow_allrows'         => false,

Index: class.uis_agreement.inc.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/class.uis_agreement.inc.php,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -b -r1.43 -r1.44
--- class.uis_agreement.inc.php 12 Aug 2007 09:30:51 -0000      1.43
+++ class.uis_agreement.inc.php 12 Aug 2007 21:25:10 -0000      1.44
@@ -24,7 +24,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package property
        * @subpackage agreement
-       * @version $Id: class.uis_agreement.inc.php,v 1.43 2007/08/12 09:30:51 
sigurdne Exp $
+       * @version $Id: class.uis_agreement.inc.php,v 1.44 2007/08/12 21:25:10 
sigurdne Exp $
        */
 
        /**
@@ -54,7 +54,8 @@
                        'edit_item'             => True,
                        'view_item'             => True,
                        'view_file'             => True,
-                       'excel'                 => True
+                       'excel'                 => True,
+                       'attrib_history'=> True,                        
                );
 
                function property_uis_agreement()
@@ -1128,7 +1129,8 @@
                                                's_agreement_id'        => 
$s_agreement_id,
                                                'attrib_id'     => 
$values['attributes'][$i]['attrib_id'],
                                                'item_id'       => $id,
-                                               'edit'          => True
+                                               'edit'          => True,
+                                               'role'          =>'detail'
                                        );
 
                                        
$values['attributes'][$i]['link_history']=$GLOBALS['phpgw']->link('/index.php',$link_history_data);
@@ -1249,6 +1251,25 @@
                                                'entity_data'   => $values['p']
                                                ));
 
+
+                       for ($i=0;$i<count($values['attributes']);$i++)
+                       {
+                               if($values['attributes'][$i]['history']==1)
+                               {
+                                       $link_history_data = array
+                                       (
+                                               'menuaction'    => 
$this->currentapp.'.uis_agreement.attrib_history',
+                                               's_agreement_id'        => 
$s_agreement_id,
+                                               'attrib_id'     => 
$values['attributes'][$i]['attrib_id'],
+                                               'item_id'       => $id,
+                                               'edit'          => False,
+                                               'role'          =>'detail'
+                                       );
+
+                                       
$values['attributes'][$i]['link_history']=$GLOBALS['phpgw']->link('/index.php',$link_history_data);
+                               }
+                       }
+
                        
$GLOBALS['phpgw']->js->validate_file('core','check',$this->currentapp);
 
                        $data = array
@@ -1276,6 +1297,9 @@
                                'lang_cost_statustext'                          
=> lang('cost'),
                                'value_cost'                                    
=> $values['cost'],
                                'set_column'                                    
=> $set_column,
+
+                               'lang_history'                                  
=> lang('history'),
+                               'lang_history_help'                             
=> lang('history of this attribute'),
                        );
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('service agreement') . ': ' . lang('view item') . ' ' . 
$s_agreement['name'];
@@ -1796,5 +1820,103 @@
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_attrib' => $data));
                //      $GLOBALS['phpgw']->xslttpl->pp();
                }
+
+               function attrib_history()
+               {
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('attrib_history','nextmatchs'));
+                       $GLOBALS['phpgw_info']['flags']['noframework'] = True;
+
+                       $s_agreement_id         = 
get_var('s_agreement_id',array('POST','GET'));
+                       $item_id        = 
get_var('item_id',array('POST','GET'));
+                       $attrib_id      = 
get_var('attrib_id',array('POST','GET'));
+
+                       $data_lookup= array(
+                               'id'            => $s_agreement_id,
+                               'item_id'       => $item_id,
+                               'attrib_id'     => $attrib_id
+                               );
+
+                       $delete = get_var('delete',array('POST','GET'));
+                       $edit = get_var('edit',array('POST','GET'));
+
+                       if ($delete)
+                       {
+                               $data_lookup['history_id'] = 
get_var('history_id',array('POST','GET'));
+                               $this->bo->delete_history_item($data_lookup);
+                       }
+
+                       $values = $this->bo->read_attrib_history($data_lookup);
+                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+
+                       while (is_array($values) && list(,$entry) = 
each($values))
+                       {
+                               $link_delete_history_data = array
+                                       (
+                                               'menuaction'    => 
$this->currentapp.'.uis_agreement.attrib_history',
+                                               's_agreement_id'        => 
$s_agreement_id,
+                                               'item_id'               => 
$item_id,
+                                               'attrib_id'     => $attrib_id,
+                                               'history_id'    => $entry['id'],
+                                               'delete'        => true,
+                                               'edit'          => true,
+                                               'role'          => 
$this->bo->role
+                                       );
+                               if($edit)
+                               {
+                                       $text_delete    = lang('delete');
+                                       $link_delete    = 
$GLOBALS['phpgw']->link('/index.php',$link_delete_history_data);
+                               }
+
+                               $content[] = array
+                               (
+                                       'id'                            => 
$entry['id'],
+                                       'value'                         => 
$entry['new_value'],
+                                       'user'                          => 
$entry['owner'],
+                                       'time_created'                  => 
$GLOBALS['phpgw']->common->show_date($entry['datetime'],$dateformat),
+                                       'link_delete'                   => 
$link_delete,
+                                       'lang_delete_statustext'        => 
lang('delete the item'),
+                                       'text_delete'                   => 
$text_delete,
+                               );
+                       }
+
+
+                       $table_header = array
+                       (
+                               'lang_value'            => lang('value'),
+                               'lang_user'             => lang('user'),
+                               'lang_time_created'     => lang('time created'),
+                               'lang_delete'           => lang('delete')
+                       );
+
+                       $link_data = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uis_agreement.attrib_history',
+                               's_agreement_id'=> $s_agreement_id,
+                               'item_id'               => $item_id,
+                               'attrib_id'     => $attrib_id,
+                               'edit'                  => $edit
+                       );
+
+                       $data = array
+                       (
+                               'allow_allrows'         => false,
+                               'start_record'          => $this->start,
+                               'record_limit'          => 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'],
+                               'num_records'           => count($values),
+                               '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'),
+                               'values'                => $content,
+                               'table_header'          => $table_header,
+                       );
+//_debug_array($data);
+                       $this->bo->role='detail';
+                       $attrib_data    = 
$this->bo->read_single_attrib($attrib_id);
+                       $appname        = $attrib_data['input_text'];
+                       $function_msg   = lang('history');
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;      
+
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('attrib_history' => $data));
+               }
        }
 ?>




reply via email to

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