phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: property/inc class.bocommon.inc.php,1.22,1.23 cl


From: Sigurd Nes <address@hidden>
Subject: [Phpgroupware-cvs] CVS: property/inc class.bocommon.inc.php,1.22,1.23 class.bopricebook.inc.php,1.4,1.5 class.soequipment.inc.php,1.8,1.9 class.sopricebook.inc.php,1.4,1.5class.sostandard_2.inc.php,1.6,1.7 class.uipricebook.inc.php,1.4,1.5 class.uistandard_3.inc.php,1.3,1.4 hook_admin.inc.php,1.19,1.20
Date: Wed, 05 Mar 2003 09:31:54 -0500

Update of /cvsroot/phpgroupware/property/inc
In directory subversions:/tmp/cvs-serv10077/inc

Modified Files:
        class.bocommon.inc.php class.bopricebook.inc.php 
        class.soequipment.inc.php class.sopricebook.inc.php 
        class.sostandard_2.inc.php class.uipricebook.inc.php 
        class.uistandard_3.inc.php hook_admin.inc.php 
Log Message:
no message

Index: class.bocommon.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.bocommon.inc.php,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -r1.22 -r1.23
*** class.bocommon.inc.php      2 Mar 2003 00:39:12 -0000       1.22
--- class.bocommon.inc.php      5 Mar 2003 14:31:49 -0000       1.23
***************
*** 587,591 ****
                                $menu['sublang_activities_list']=lang('Per 
Agreement');
  
!                               
$menu['sub_list_agreement']=$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uipricebook.index');
                                $menu['sublang_agreement']=lang('Agreement');
                        }
--- 587,591 ----
                                $menu['sublang_activities_list']=lang('Per 
Agreement');
  
!                               
$menu['sub_list_agreement']=$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.uipricebook.agreement');
                                $menu['sublang_agreement']=lang('Agreement');
                        }

Index: class.bopricebook.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.bopricebook.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** class.bopricebook.inc.php   4 Mar 2003 19:32:03 -0000       1.4
--- class.bopricebook.inc.php   5 Mar 2003 14:31:49 -0000       1.5
***************
*** 94,97 ****
--- 94,137 ----
                }
  
+               function select_status_list($format='',$selected='')
+               {
+                       switch($format)
+                       {
+                               case 'select':
+                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('status_select'));
+                                       break;
+                               case 'filter':
+                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('status_filter'));
+                                       break;
+                       }
+ 
+                       $status_entries= $this->so->select_status_list();
+ 
+                       while (is_array($status_entries) && list(,$status) = 
each($status_entries))
+                       {
+                               $sel_status = '';
+                               if ($status['id']==$selected)
+                               {
+                                       $sel_status = 'selected';
+                               }
+ 
+                               $status_list[] = array
+                               (
+                                       'id'            => $status['id'],
+                                       'name'          => $status['name'],
+                                       'selected'      => $sel_status
+                               );
+                       }
+ 
+                       for ($i=0;$i<count($status_list);$i++)
+                       {
+                               if ($status_list[$i]['selected'] != 'selected')
+                               {
+                                       unset($status_list[$i]['selected']);
+                               }
+                       }
+ 
+                       return $status_list;
+               }
  
                function read()
***************
*** 103,106 ****
--- 143,154 ----
                }
  
+               function read_agreement()
+               {
+                       $agreement = $this->so->read_agreement(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
+                                                                               
        'filter' => $this->filter,'cat_id' => 
$this->cat_id,'allrows'=>$this->allrows));
+                       $this->total_records = $this->so->total_records;
+                       return $agreement;
+               }
+ 
                function read_activity_prize($activity_id,$vendor_id)
                {
***************
*** 138,141 ****
--- 186,195 ----
                }
  
+               function read_single_agreement($id='')
+               {
+                       return $this->so->read_single_agreement($id);
+               }
+ 
+ 
                function read_category_name($cat_id)
                {
***************
*** 412,423 ****
  
  
!               function check_category_num($num='')
                {
!                       return $this->so->check_category_num($num);
                }
  
                function save_activity($values,$action='')
                {
- 
                        if ($action=='edit')
                        {
--- 466,476 ----
  
  
!               function check_activity_num($num='')
                {
!                       return $this->so->check_activity_num($num);
                }
  
                function save_activity($values,$action='')
                {
                        if ($action=='edit')
                        {
***************
*** 432,435 ****
--- 485,507 ----
                }
  
+               function check_agreement_num($num='')
+               {
+                       return $this->so->check_agreement_num($num);
+               }
+ 
+               function save_agreement($values,$action='')
+               {
+                       if ($action=='edit')
+                       {
+                               $receipt = $this->so->edit_agreement($values);
+                       }
+                       else
+                       {
+                               
$values['agreement_id']=$this->socommon->next_id('fm_wo_agreement');
+                               $receipt = $this->so->add_agreement($values);
+                       }
+                       return $receipt;
+               }
+ 
                function delete_activity_vendor($activity_id,$vendor_id)
                {
***************
*** 445,448 ****
--- 517,525 ----
                {
                        
$this->so->delete_prize_index($activity_id,$vendor_id,$index_count);
+               }
+ 
+               function delete_agreement($agreement_id)
+               {
+                       $this->so->delete_agreement($agreement_id);
                }
        }

Index: class.soequipment.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soequipment.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** class.soequipment.inc.php   25 Feb 2003 11:29:29 -0000      1.8
--- class.soequipment.inc.php   5 Mar 2003 14:31:49 -0000       1.9
***************
*** 30,37 ****
                }
  
- 
                function select_status_list()
                {
- 
                        $this->db->query("SELECT id, descr FROM 
fm_equipment_status ORDER BY id ");
  
--- 30,35 ----

Index: class.sopricebook.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.sopricebook.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** class.sopricebook.inc.php   4 Mar 2003 19:32:03 -0000       1.4
--- class.sopricebook.inc.php   5 Mar 2003 14:31:49 -0000       1.5
***************
*** 140,144 ****
                }
  
!               function check_category_num($num='')
                {
                        $this->db->query("SELECT count(*) FROM fm_wo_activities 
where num='$num'");
--- 140,144 ----
                }
  
!               function check_activity_num($num='')
                {
                        $this->db->query("SELECT count(*) FROM fm_wo_activities 
where num='$num'");
***************
*** 152,155 ****
--- 152,167 ----
                }
  
+               function check_agreement_num($num='')
+               {
+                       $this->db->query("SELECT count(*) FROM fm_wo_agreement 
where num='$num'");
+ 
+                       $this->db->next_record();
+ 
+                       if ( $this->db->f(0))
+                       {
+                               return True;
+                       }
+               }
+ 
                function read($data)
                {
***************
*** 235,238 ****
--- 247,340 ----
                }
  
+               function read_agreement($data)
+               {
+                       if(is_array($data))
+                       {
+                               if ($data['start'])
+                               {
+                                       $start=$data['start'];
+                               }
+                               else
+                               {
+                                       $start=0;
+                               }
+                               $filter = 
(isset($data['filter'])?$data['filter']:'none');
+                               $query = 
(isset($data['query'])?$data['query']:'');
+                               $sort = 
(isset($data['sort'])?$data['sort']:'DESC');
+                               $order = 
(isset($data['order'])?$data['order']:'');
+                               $cat_id = 
(isset($data['cat_id'])?$data['cat_id']:0);
+                               $allrows                = 
(isset($data['allrows'])?$data['allrows']:'');
+                       }
+ 
+                       if ($order)
+                       {
+                               $ordermethod = " order by $order $sort";
+                       }
+                       else
+                       {
+                               $ordermethod = ' order by id asc';
+                       }
+ 
+                       $where = 'WHERE';
+ 
+                       if ($cat_id)
+                       {
+                               $filtermethod .= " $where status='$cat_id' ";
+                               $where = 'AND';
+                       }
+ 
+                       if($query)
+                       {
+                               $query = ereg_replace("'",'',$query);
+                               $query = ereg_replace('"','',$query);
+ 
+                               $querymethod = " $where (descr LIKE '%$query%' 
or num LIKE '%$query%')";
+                       }
+ 
+                       $sql = "SELECT * FROM  fm_wo_agreement $filtermethod 
$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())
+                       {
+                               $ngrants = 
(int)$this->grants[$this->db->f('building_owner')];
+                               $agreement[] = array
+                               (
+                                       'agreement_id'          => 
$this->db->f('id'),
+                                       'num'                           => 
$this->db->f('num'),
+                                       'status'                        => 
$this->db->f('status'),
+                                       'descr'                         => 
stripslashes($this->db->f('descr')),
+                                       'grants'                        => 
$ngrants
+                               );
+                       }
+ //            _debug_array($agreement);
+                       return $agreement;
+               }
+ 
+               function select_status_list()
+               {
+                       $this->db->query("SELECT id, descr FROM 
fm_wo_agreement_status ORDER BY id ");
+ 
+                       $i = 0;
+                       while ($this->db->next_record())
+                       {
+                               $status_entries[$i]['id']                       
        = $this->db->f('id');
+                               $status_entries[$i]['name']                     
        = stripslashes($this->db->f('descr'));
+                               $i++;
+                       }
+                       return $status_entries;
+               }
+ 
+ 
                function read_activity_prize($data)
                {
***************
*** 497,500 ****
--- 599,619 ----
                }
  
+               function read_single_agreement($id)
+               {
+                       $sql = "SELECT * FROM fm_wo_agreement where id='$id'";
+ 
+                       $this->db->query($sql,__LINE__,__FILE__);
+ 
+                       if ($this->db->next_record())
+                       {
+                               $agreement['agreement_id']      = $id;
+                               $agreement['num']                       = 
$this->db->f('num');
+                               $agreement['status']            = 
$this->db->f('status');
+                               $agreement['descr']                     = 
stripslashes($this->db->f('descr'));
+ 
+                               return $agreement;
+                       }
+               }
+ 
                function add_activity($values)
                {
***************
*** 538,541 ****
--- 657,690 ----
                }
  
+               function add_agreement($values)
+               {
+                       $values['descr'] = 
$this->db->db_addslashes($values['descr']);
+ 
+                       $this->db->query("INSERT INTO fm_wo_agreement 
(id,num,status,descr) "
+                               . "VALUES ('" .
+                               $values['agreement_id']. "','" .
+                               $values['num'] . "','" .
+                               $values['status'] . "','" .
+                               $values['descr']. "')",__LINE__,__FILE__);
+ 
+                       $receipt['message'][] = array('msg'=>lang('Agreement 
has been saved'));
+                       $receipt['agreement_id'] = $values['agreement_id'];
+                       return $receipt;
+               }
+ 
+               function edit_agreement($values)
+               {
+                       $values['descr'] = 
$this->db->db_addslashes($values['descr']);
+ 
+                       $this->db->query("UPDATE fm_wo_agreement set
+                               num='" . $values['num'] . "',
+                               status='"       . $values['status'] . "',
+                               descr='" . $values['descr']
+                               . "' WHERE id= '" . $values['agreement_id'] . 
"'",__LINE__,__FILE__);
+ 
+                       $receipt['message'][] = array('msg'=>lang('Agreement 
has been edited'));
+                       return $receipt;
+               }
+ 
                function delete_activity_vendor($activity_id,$vendor_id)
                {
***************
*** 565,568 ****
--- 714,724 ----
  
                }
+ 
+               function delete_agreement($agreement_id)
+               {
+                       $this->db->query("DELETE FROM fm_wo_agreement WHERE 
id='$agreement_id'",__LINE__,__FILE__);
+ //how to handle the activities and vendors ...?
+               }
+ 
  
                function add_activity_vendor($values)

Index: class.sostandard_2.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.sostandard_2.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** class.sostandard_2.inc.php  4 Mar 2003 10:48:52 -0000       1.6
--- class.sostandard_2.inc.php  5 Mar 2003 14:31:49 -0000       1.7
***************
*** 110,113 ****
--- 110,116 ----
                                        $table='fm_equipment_status';
                                        break;
+                               case 'agreement_status':
+                                       $table='fm_wo_agreement_status';
+                                       break;
                                case 'accounting':
                                        $table='fm_wo_accounts';

Index: class.uipricebook.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uipricebook.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** class.uipricebook.inc.php   4 Mar 2003 19:32:03 -0000       1.4
--- class.uipricebook.inc.php   5 Mar 2003 14:31:49 -0000       1.5
***************
*** 24,28 ****
                        'activity'                      => True,
                        'index'                         => True,
!                       'view'                          => True,
                        'edit_activity'         => True,
                        'activity_vendor'       => True,
--- 24,29 ----
                        'activity'                      => True,
                        'index'                         => True,
!                       'agreement'             => True,
!                       'edit_agreement'        => True,
                        'edit_activity'         => True,
                        'activity_vendor'       => True,
***************
*** 239,242 ****
--- 240,482 ----
                }
  
+               function agreement()
+               {
+                       
$GLOBALS['phpgw']->session->appsession('referer',$this->currentapp,'');
+ 
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('pricebook',
+                                                                               
'menu',
+                                                                               
'nextmatchs',
+                                                                               
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP . 
'app_header',
+                                                                               
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP . 
'filter_select',
+                                                                               
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP . 
'search_field'));
+ 
+                       $links = $this->bocommon->menu();
+ 
+                       $agreement_list = $this->bo->read_agreement();
+ 
+                       while (is_array($agreement_list) && list(,$agreement) = 
each($agreement_list))
+                       {
+                               $content[] = array
+                               (
+                                       'agreement_id'                          
=> $agreement['agreement_id'],
+                                       'num'                                   
        => $agreement['num'],
+                                       'status'                                
        => lang($agreement['status']),
+                                       'descr'                                 
        => $agreement['descr'],
+                                       'link_edit'                             
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uipricebook.edit_agreement&agreement_id='
 . $agreement['agreement_id']),
+                                       'link_delete'                           
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uipricebook.delete&method=agreement&agreement_id='
 . $agreement['agreement_id'] .'&start=' . $this->start),
+                                       'lang_edit_statustext'          => 
lang('edit the agreement'),
+                                       'lang_delete_statustext'        => 
lang('Delete this agreement'),
+                                       'text_edit'                             
        => lang('edit'),
+                                       'text_delete'                           
=> lang('delete')
+                               );
+                       }
+ 
+                       $table_header[] = array
+                       (
+                               'lang_id'               => lang('ID'),
+                               'sort_num'      => 
$this->nextmatchs->show_sort_order(array
+                                                                               
(
+                                                                               
        'sort'  => $this->sort,
+                                                                               
        'var'   =>      'num',
+                                                                               
        'order' =>      $this->order,
+                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uipricebook.agreement',
+                                                                               
                                                        'cat_id'        
=>$this->cat_id,
+                                                                               
                                                        'allrows'       
=>$this->allrows)
+                                                                               
)),
+                               'lang_num'                      => 
lang('Activity Num'),
+                               'lang_delete'           => lang('Delete'),
+                               'lang_descr'            => lang('Description'),
+                               'lang_edit'                     => lang('edit')
+                       );
+ 
+                       $link_data = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uipricebook.agreement',
+                                               'sort'                  
=>$this->sort,
+                                               'order'                 
=>$this->order,
+                                               'cat_id'                
=>$this->cat_id,
+                                               'filter'                
=>$this->filter,
+                                               'query'                 
=>$this->query
+                       );
+ 
+                       $table_add[] = array
+                       (
+                               'lang_add'                              => 
lang('add'),
+                               'lang_add_statustext'   => lang('add an 
activity'),
+                               'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uipricebook.edit_agreement')
+                       );
+ 
+                       if(!$this->allrows)
+                       {
+                               $record_limit   = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
+                       }
+                       else
+                       {
+                               $record_limit   = $this->bo->total_records;
+                       }
+ 
+                       $data = array
+                       (
+                               'error'                                         
        => $receipt['error'],
+                               'message'                                       
        => $receipt['message'],
+                               'links'                                         
        => $links,
+                               'allrows'                                       
        => $this->allrows,
+                               'allow_allrows'                                 
=> true,
+                               'start_record'                                  
=> $this->start,
+                               'record_limit'                                  
=> $record_limit,
+                               'num_records'                                   
=> count($agreement_list),
+                               'all_records'                                   
=> $this->bo->total_records,
+                               'lang_select_all'                               
=> lang('Select All'),
+                               'img_check'                                     
        => 
$GLOBALS['phpgw']->common->get_image_path($this->currentapp).'/check.gif',
+                               'check_source'                                  
=> './'.$this->currentapp.'/inc/check.js',
+                               'link_url'                                      
        => $GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'img_path'                                      
        => $GLOBALS['phpgw']->common->get_image_path('phpgwapi'),
+                               'appname'                                       
        => lang($this->currentapp),
+                               'function_msg'                                  
=> lang('list agreement'),
+                               'lang_status_statustext'                => 
lang('Select the status the agreement belongs to. To do not use a category 
select NO STATUS'),
+                               'status_name'                                   
=> 'cat_id',
+                               'lang_no_status'                                
=> lang('No status'),
+                               'status_list'                                   
=> $this->bo->select_status_list('filter',$this->cat_id),
+                               'select_action'                                 
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'filter_list'                                   
=> $this->nextmatchs->xslt_filter(array('filter' => $this->filter,'yours' => 
'yes')),
+                               'lang_filter_statustext'                => 
lang('Select the filter. To show all entries select SHOW ALL'),
+                               'lang_searchfield_statustext'   => lang('Enter 
the search string. To show all entries, empty this field and press the SUBMIT 
button again'),
+                               'lang_searchbutton_statustext'  => lang('Submit 
the search string'),
+                               'query'                                         
        => $this->query,
+                               'lang_submit'                                   
=> lang('submit'),
+                               'table_header_agreement'                => 
$table_header,
+                               'values_agreement'                              
=> $content,
+                               'table_add'                                     
        => $table_add,
+                               'update_action'                                 
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uipricebook.agreement')
                       );
+ 
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('agreement' => $data));
+                       $this->save_sessiondata();
+               }
+ 
+               function edit_agreement()
+               {
+                       $agreement_id           = 
get_var('agreement_id',array('POST','GET'));
+                       $values                         = 
get_var('values',array('POST','GET'));
+ 
+                       if(!$values['cat_id'])
+                       {
+                               $values['cat_id']       = $agreement;
+                       }
+ 
+                       
$GLOBALS['phpgw']->xslttpl->add_file(array('pricebook',$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default')
 . SEP . 'app_header'));
+ 
+                       if ($values['save'])
+                       {
+                               if(!$values['num'])
+                               {
+                                       
$receipt['error'][]=array('msg'=>lang('Please enter an agreement code !'));
+                                       $error_id=true;
+                               }
+                               if(!$values['status'])
+                               {
+                                       
$receipt['error'][]=array('msg'=>lang('Please select a status !'));
+                               }
+ 
+ 
+                               if($values['num']  && !$agreement_id)
+                               {
+                                       
if($this->bo->check_agreement_num($values['num']))
+                                       {
+                                               
$receipt['error'][]=array('msg'=>lang('This agreement code is already 
registered!') . '[ '.$values['num'] .' ]');
+                                               $error_id=true;
+                                       }
+                               }
+ 
+                               if($agreement_id)
+                               {
+                                       $action='edit';
+                               }
+ 
+                               if(!$receipt['error'])
+                               {
+                                       $receipt = 
$this->bo->save_agreement($values,$action);
+                                       if(!$agreement_id)
+                                       {
+                                               
$agreement_id=$receipt['agreement_id'];
+                                       }
+ 
+                               }
+ 
+                               if($agreement_id)
+                               {
+                                       $values['agreement_id']=$agreement_id;
+                                       $action='edit';
+                               }
+                               else
+                               {
+                                       $agreement_id = $values['agreement_id'];
+                               }
+                       }
+                       else
+                       {
+                               $values['agreement_id']= $agreement_id;
+                               if($agreement_id)
+                               {
+                                       $values = 
$this->bo->read_single_agreement($agreement_id);
+                               }
+                       }
+ 
+ //_debug_array($values);
+                       if ($agreement_id)
+                       {
+                               $function_msg = lang('edit agreement');
+                       }
+                       else
+                       {
+                               $function_msg = lang('add agreement');
+                       }
+ 
+                       if ($values['cat_id'] > 0)
+                       {
+                               $this->cat_id = $values['cat_id'];
+                       }
+ 
+                       if($error_id)
+                       {
+                               unset($values['num']);
+                       }
+ 
+                       $link_data = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uipricebook.edit_agreement',
+                               'agreement_id'  => $agreement_id
+                       );
+ 
+                       $data = array
+                       (
+                               'appname'                                       
        => lang('Pricebook'),
+                               'function_msg'                                  
=> $function_msg,
+                               'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'done_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uipricebook.agreement'),
+                               'lang_agreement_id'                             
=> lang('Agreement ID'),
+                               'lang_num'                                      
        => lang('Agreement code'),
+                               'lang_status'                                   
=> lang('Status'),
+                               'status_list'                                   
=> $this->bo->select_status_list('select',$values['status']),
+                               'select_status_name'                    => 
'values[status]',
+                               'lang_no_status'                                
=> lang('Select status'),
+ 
+                               'lang_save'                                     
        => lang('save'),
+                               'lang_done'                                     
        => lang('done'),
+                               'lang_descr'                                    
=> lang('description'),
+                               'value_agreement_id'                    => 
$values['agreement_id'],
+                               'value_num'                                     
        => $values['num'],
+                               'value_descr'                                   
=> $values['descr'],
+                               'error'                                         
        => $receipt['error'],
+                               'message'                                       
        => $receipt['message'],
+                               'lang_num_statustext'                   => 
lang('A unique code for this activity'),
+                               'lang_done_statustext'                  => 
lang('Back to the list'),
+                               'lang_save_statustext'                  => 
lang('Save the building'),
+                               'lang_descr_statustext'                 => 
lang('Enter the description for this activity')
+                       );
+ 
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_agreement' => $data));
+               }
+ 
+ 
                function prizing()
                {
***************
*** 736,740 ****
                                if($values['num']  && !$activity_id)
                                {
!                                       
if($this->bo->check_category_num($values['num']))
                                        {
                                                
$receipt['error'][]=array('msg'=>lang('This activity code is already 
registered!') . '[ '.$values['num'] .' ]');
--- 976,980 ----
                                if($values['num']  && !$activity_id)
                                {
!                                       
if($this->bo->check_activity_num($values['num']))
                                        {
                                                
$receipt['error'][]=array('msg'=>lang('This activity code is already 
registered!') . '[ '.$values['num'] .' ]');
***************
*** 860,863 ****
--- 1100,1104 ----
                        $vendor_id              = 
get_var('vendor_id',array('GET'));
                        $index_count    = get_var('index_count',array('GET'));
+                       $agreement_id   = get_var('agreement_id',array('GET'));
                        $confirm                = 
get_var('confirm',array('POST'));
  
***************
*** 913,917 ****
--- 1154,1174 ----
                                }
                        }
+                       elseif($method=='agreement')
+                       {
+                               $link_data = array
+                               (
+                                       'menuaction' => 
$this->currentapp.'.uipricebook.agreement',
+                                       'start'         => $this->start
+                               );
+ 
+                               $function_msg   =lang('Delete agreement and all 
the activities associated with it!');
+                               $delete_action  = 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uipricebook.delete&method='
 . $method . '&agreement_id=' . $agreement_id . '&start=' . $this->start);
  
+                               if (get_var('confirm',array('POST')))
+                               {
+                                       
$this->bo->delete_agreement($agreement_id);
+                                       Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
+                               }
+                       }
  
                        
$GLOBALS['phpgw']->xslttpl->add_file(array($GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default')
 . SEP . 'app_delete',

Index: class.uistandard_3.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uistandard_3.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.uistandard_3.inc.php  21 Feb 2003 10:28:59 -0000      1.3
--- class.uistandard_3.inc.php  5 Mar 2003 14:31:49 -0000       1.4
***************
*** 199,217 ****
                                'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
                                'done_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uistandard_3.index&type='.$type),
!                               'lang_id'                               => 
lang('standard ID'),
                                'lang_num'                                      
        => lang('Name'),
                                'lang_descr'                                    
=> lang('Descr'),
                                'lang_save'                                     
        => lang('save'),
                                'lang_done'                                     
        => lang('done'),
!                               'value_id'                              => $id,
!                               'value_num'                                     
=> $standard['num'],
                                'value_generaladdress'                  => 
$standard['general_address'],
                                'message'                                       
        => $message,
!                               'lang_id_standardtext'  => lang('Enter the 
standard ID'),
!                               'lang_descr_standardtext'                       
=> lang('Enter a description the standard'),
!                               'lang_generaladdress_standardtext'=> 
lang('Enter the general address'),
!                               'lang_done_standardtext'                        
=> lang('Back to the list'),
!                               'lang_save_standardtext'                        
=> lang('Save the standard'),
!                               'type_id'                               => 
$standard['type_id'],
                                'location_code'                                 
=> $standard['location_code'],
                                'value_descr'                                   
=> $standard['descr']
--- 199,216 ----
                                'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
                                'done_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uistandard_3.index&type='.$type),
!                               'lang_id'                                       
        => lang('standard ID'),
                                'lang_num'                                      
        => lang('Name'),
                                'lang_descr'                                    
=> lang('Descr'),
                                'lang_save'                                     
        => lang('save'),
                                'lang_done'                                     
        => lang('done'),
!                               'value_id'                                      
        => $id,
!                               'value_num'                                     
        => $standard['num'],
                                'value_generaladdress'                  => 
$standard['general_address'],
                                'message'                                       
        => $message,
!                               'lang_id_standardtext'                  => 
lang('Enter the standard ID'),
!                               'lang_descr_standardtext'               => 
lang('Enter a description the standard'),
!                               'lang_done_standardtext'                => 
lang('Back to the list'),
!                               'lang_save_standardtext'                => 
lang('Save the standard'),
!                               'type_id'                                       
        => $standard['type_id'],
                                'location_code'                                 
=> $standard['location_code'],
                                'value_descr'                                   
=> $standard['descr']

Index: hook_admin.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/hook_admin.inc.php,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -r1.19 -r1.20
*** hook_admin.inc.php  4 Mar 2003 10:48:52 -0000       1.19
--- hook_admin.inc.php  5 Mar 2003 14:31:49 -0000       1.20
***************
*** 38,41 ****
--- 38,42 ----
                                'Workorders status'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uistandard_2.index&type=workorder_status'),
                                'Equipment status'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uistandard_2.index&type=equipment_status'),
+                               'Agreement status'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uistandard_2.index&type=agreement_status'),
                                'Unit'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uistandard_2.index&type=unit'),
                                'Request status'=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$appname.'.uistandard_2.index&type=request_status'),





reply via email to

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