phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: inv/inc class.boinventory.inc.php,1.7,1.8 class.


From: Bettina Gille <address@hidden>
Subject: [Phpgroupware-cvs] CVS: inv/inc class.boinventory.inc.php,1.7,1.8 class.soinventory.inc.php,1.6,1.7 class.uiinventory.inc.php,1.7,1.8
Date: Thu, 31 Jan 2002 17:33:10 -0500

Update of /cvsroot/phpgroupware/inv/inc
In directory subversions:/tmp/cvs-serv6078/inc

Modified Files:
        class.boinventory.inc.php class.soinventory.inc.php 
        class.uiinventory.inc.php 
Log Message:
update

Index: class.boinventory.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/inv/inc/class.boinventory.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** class.boinventory.inc.php   18 Jan 2002 00:00:35 -0000      1.7
--- class.boinventory.inc.php   31 Jan 2002 22:33:07 -0000      1.8
***************
*** 36,39 ****
--- 36,41 ----
                var $cat_id;
                var $product_id;
+               var $status;
+               var $selection;
  
                var $public_functions = array
***************
*** 68,71 ****
--- 70,76 ----
                        $action         = $GLOBALS['HTTP_POST_VARS']['action'] 
? $GLOBALS['HTTP_POST_VARS']['action'] : $GLOBALS['HTTP_GET_VARS']['action'];
                        $product_id = $GLOBALS['HTTP_POST_VARS']['product_id'] 
? $GLOBALS['HTTP_POST_VARS']['product_id'] : 
$GLOBALS['HTTP_GET_VARS']['product_id'];
+                       $status         = $GLOBALS['HTTP_POST_VARS']['status'] 
? $GLOBALS['HTTP_POST_VARS']['status'] : $GLOBALS['HTTP_GET_VARS']['status'];
+                       $dist           = $GLOBALS['HTTP_POST_VARS']['dist'] ? 
$GLOBALS['HTTP_POST_VARS']['dist'] : $GLOBALS['HTTP_GET_VARS']['dist'];
+                       $selection      = 
$GLOBALS['HTTP_POST_VARS']['selection'] ? 
$GLOBALS['HTTP_POST_VARS']['selection'] : 
$GLOBALS['HTTP_GET_VARS']['selection'];
  
                        if(!empty($start) || $start == '0' || $start == 0)
***************
*** 126,129 ****
--- 131,146 ----
                                $this->action = $action;
                        }
+                       if(isset($status) && !empty($status))
+                       {
+                               $this->status = $status;
+                       }
+                       if(isset($dist) && !empty($dist))
+                       {
+                               $this->dist = $dist;
+                       }
+                       if(isset($selection) && !empty($selection))
+                       {
+                               $this->selection = $selection;
+                       }
                }
  
***************
*** 145,157 ****
                        $data = 
$GLOBALS['phpgw']->session->appsession('session_data','inv');
  
!                       $this->start    = $data['start'];
!                       $this->query    = $data['query'];
!                       $this->sort             = $data['sort'];
!                       $this->order    = $data['order'];
!                       $this->action   = $data['action'];
!                       $this->cat_id = $data['cat_id'];
!                       $this->oldcat = $data['oldcat'];
!                       $this->taxpercent = $data['taxpercent'];
!                       $this->number = $data['number'];
                        if(isset($data['product_id']))
                        {
--- 162,177 ----
                        $data = 
$GLOBALS['phpgw']->session->appsession('session_data','inv');
  
!                       $this->start            = $data['start'];
!                       $this->query            = $data['query'];
!                       $this->sort                     = $data['sort'];
!                       $this->order            = $data['order'];
!                       $this->action           = $data['action'];
!                       $this->status           = $data['status'];
!                       $this->dist                     = $data['dist'];
!                       $this->selection        = $data['selection'];
!                       $this->cat_id           = $data['cat_id'];
!                       $this->oldcat           = $data['oldcat'];
!                       $this->taxpercent       = $data['taxpercent'];
!                       $this->number           = $data['number'];
                        if(isset($data['product_id']))
                        {
***************
*** 238,242 ****
                }
  
!               function select_dist_list($dist = '') 
                {
                        $cols = array('org_name' => 'org_name');
--- 258,262 ----
                }
  
!               function select_dist_list() 
                {
                        $cols = array('org_name' => 'org_name');
***************
*** 246,250 ****
                        {
                                $html_dist_list .= '<option value="' . 
$entries[$i]['id'] . '"';
!                               if ($entries[$i]['id'] == $dist)
                                {
                                        $html_dist_list .= ' selected';
--- 266,270 ----
                        {
                                $html_dist_list .= '<option value="' . 
$entries[$i]['id'] . '"';
!                               if ($entries[$i]['id'] == $this->dist)
                                {
                                        $html_dist_list .= ' selected';
***************
*** 296,302 ****
                }
  
!               function read_products($limit,$object,$status)
                {
!                       $pro = 
$this->soinv->read_products($this->start,$limit,$this->query,$object,$this->cat_id,$this->sort,$this->order,$status);
                        $this->total_records = $this->soinv->total_records;
                        return $pro;
--- 316,328 ----
                }
  
!               function read_products()
                {
!                       switch ($this->selection)
!                       {
!                               case 'category':        $object_id = 
$this->cat_id; break;
!                               case 'dist':            $object_id = 
$this->dist; break;
!                       }
! 
!                       $pro = 
$this->soinv->read_products($this->start,True,$this->query,$this->selection,$object_id,$this->sort,$this->order,$this->status);
                        $this->total_records = $this->soinv->total_records;
                        return $pro;

Index: class.soinventory.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/inv/inc/class.soinventory.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** class.soinventory.inc.php   18 Jan 2002 03:39:21 -0000      1.6
--- class.soinventory.inc.php   31 Jan 2002 22:33:07 -0000      1.7
***************
*** 141,145 ****
                }
  
!               function read_products($start, $limit = True, $query = '', 
$object = 'category',$cat_id = '', $sort = '', $order = '',$status = 'active') 
                {
                        if ($order)
--- 141,145 ----
                }
  
!               function read_products($start, $limit = True, $query = '', 
$object = 'category',$object_id = '', $sort = '', $order = '',$status = 
'active') 
                {
                        if ($order)
***************
*** 159,168 ****
                        }
  
!                       if ($status == 'active') : $status_sort = " status !='" 
. $this->get_status_id() . "'";
!                       elseif ($status == 'minstock') : $status_sort = " 
status !='" . $this->get_status_id() . "' AND mstock >= stock AND mstock != 
'0'";
!                       elseif ($status == 'archive') : $status_sort = " status 
='" . $this->get_status_id() . "'";
!                       endif;
  
!                       $sql = "SELECT * from phpgw_inv_products WHERE 
$object='$cat_id' AND $status_sort $querymethod";
  
                        $this->db->limit_query($sql . 
$ordermethod,$start,__LINE__,__FILE__);
--- 159,171 ----
                        }
  
!                       switch ($status)
!                       {
!                               case 'active':          $status_sort = " status 
!='" . $this->get_status_id() . "'"; break;
!                               case 'receipt':         $status_sort = " status 
!='" . $this->get_status_id() . "'"; break;
!                               case 'minstock':        $status_sort = " status 
!='" . $this->get_status_id() . "' AND mstock >= stock AND mstock != '0'"; 
break;
!                               case 'archive':         $status_sort = " status 
='" . $this->get_status_id() . "'"; break;
!                       }
  
!                       $sql = "SELECT * from phpgw_inv_products WHERE 
$object='$object_id' AND $status_sort $querymethod";
  
                        $this->db->limit_query($sql . 
$ordermethod,$start,__LINE__,__FILE__);

Index: class.uiinventory.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/inv/inc/class.uiinventory.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** class.uiinventory.inc.php   18 Jan 2002 00:00:35 -0000      1.7
--- class.uiinventory.inc.php   31 Jan 2002 22:33:07 -0000      1.8
***************
*** 59,62 ****
--- 59,65 ----
                        $this->action                                           
        = $this->boinv->action;
                        $this->product_id                                       
        = $this->boinv->product_id;
+                       $this->status                                           
        = $this->boinv->status;
+                       $this->dist                                             
                = $this->boinv->dist;
+                       $this->selection                                        
        = $this->boinv->selection;
                }
  
***************
*** 72,76 ****
                                'cat_id'                => $this->cat_id,
                                'action'                => $this->action,
!                               'product_id'    => $this->product_id
                        );
                        $this->boinv->save_sessiondata($data);
--- 75,82 ----
                                'cat_id'                => $this->cat_id,
                                'action'                => $this->action,
!                               'product_id'    => $this->product_id,
!                               'status'                => $this->status,
!                               'dist'                  => $this->dist,
!                               'selection'             => $this->selection
                        );
                        $this->boinv->save_sessiondata($data);
***************
*** 157,163 ****
                        if ($this->action == 'subproduct')
                        {
!                               
$this->t->set_var('sub_products',$GLOBALS['phpgw']->link('/index.php','menuaction=inv.uiinventory.list_products&action=subproduct'));
 
!                               
$this->t->set_var('sub_minstock',$GLOBALS['phpgw']->link('/inv/listminstock.php','subproduct=True'));
!                               
$this->t->set_var('sub_receipt',$GLOBALS['phpgw']->link('/inv/listreceipt.php','subproduct=True'));
 
                                
$this->t->set_var('sublang_products',lang('Products'));
                                $this->t->set_var('sublang_minstock',lang('Out 
of stock products'));
--- 163,169 ----
                        if ($this->action == 'subproduct')
                        {
!                               
$this->t->set_var('sub_products',$GLOBALS['phpgw']->link('/index.php','menuaction=inv.uiinventory.list_products&action=subproduct&status=active&selection=category'));
 
!                               
$this->t->set_var('sub_minstock',$GLOBALS['phpgw']->link('/index.php','menuaction=inv.uiinventory.list_products&action=subproduct&status=minstock&selection=category'));
 
!                               
$this->t->set_var('sub_receipt',$GLOBALS['phpgw']->link('/index.php','menuaction=inv.uiinventory.list_products&action=subproduct&status=receipt&selection=dist'));
                                
$this->t->set_var('sublang_products',lang('Products'));
                                $this->t->set_var('sublang_minstock',lang('Out 
of stock products'));
***************
*** 178,182 ****
                                'menuaction'    => 
'inv.uiinventory.list_products',
                                'cat_id'                => $this->cat_id,
!                               'action'                => $this->action
                        );
  
--- 184,191 ----
                                'menuaction'    => 
'inv.uiinventory.list_products',
                                'cat_id'                => $this->cat_id,
!                               'action'                => $this->action,
!                               'status'                => $this->status,
!                               'dist'                  => $this->dist,
!                               'selection'             => $this->selection
                        );
  
***************
*** 197,201 ****
                        }
  
!                       $archive_id = $this->boinv->get_status_id('archive');
  
                        if (!$start)
--- 206,226 ----
                        }
  
! //                    $archive_id = $this->boinv->get_status_id('archive');
! 
!                       if ($this->selection == 'category')
!                       {
!                               $selection_list= '<form method="POST" action="' 
. $GLOBALS['phpgw']->link('/index.php',$link_data) . '" name="form">' . "\n"
!                                                       . '<select 
name="cat_id" onChange="this.form.submit();"><option value="">' . lang('Select 
category') . '</option>' . "\n"
!                                                       . 
$this->boinv->formatted_cat_list() . '</select>';
!                       }
!                       elseif ($this->selection == 'dist')
!                       {
!                               $selection_list= '<form method="POST" action="' 
. $GLOBALS['phpgw']->link('/index.php',$link_data) .'" name="form">' . "\n"
!                                                       . '<select name="dist" 
onChange="this.form.submit();"><option value="">' . lang('Select distributor')
!                                                       . 
$this->boinv->select_dist_list() . '</select>';
!                       }
! 
!                       $this->t->set_var('selection_list',$selection_list);
!                       
$this->t->set_var('selection_action',$GLOBALS['phpgw']->link('/index.php',$link_data));
  
                        if (!$start)
***************
*** 204,209 ****
                        }
  
                        $category = $this->boinv->return_single_cat();
!                       $products = 
$this->boinv->read_products(True,'category','active');
  
  //--------------------------------- nextmatch 
--------------------------------------------
--- 229,242 ----
                        }
  
+                       switch ($this->status)
+                       {
+                               case 'active':          $lang_action = 
lang('Product list'); break;
+                               case 'minstock':        $lang_action = 
lang('Out of stock product list'); break;
+                               case 'receipt':         $lang_action = 
lang('Stock receipt list'); break;
+                       }
+ 
+                       $this->t->set_var('lang_action',$lang_action);
                        $category = $this->boinv->return_single_cat();
!                       $products = $this->boinv->read_products();
  
  //--------------------------------- nextmatch 
--------------------------------------------
***************
*** 223,227 ****
                        
$this->t->set_var('sort_serial',$this->nextmatchs->show_sort_order($this->sort,'serial',$this->order,'/index.php',lang('Serial
 number'),$link_data));
                        
$this->t->set_var('sort_name',$this->nextmatchs->show_sort_order($this->sort,'name',$this->order,'/index.php',lang('Name'),$link_data));
!                       
$this->t->set_var('sort_dist',$this->nextmatchs->show_sort_order($this->sort,'dist',$this->order,'/index.php',lang('Distributor'),$link_data));
                        
$this->t->set_var('sort_status',$this->nextmatchs->show_sort_order($this->sort,'status',$this->order,'/index.php',lang('Status'),$link_data));
                        
$this->t->set_var('sort_cost',$this->nextmatchs->show_sort_order($this->sort,'cost',$this->order,'/index.php',lang('Cost'),$link_data));
--- 256,269 ----
                        
$this->t->set_var('sort_serial',$this->nextmatchs->show_sort_order($this->sort,'serial',$this->order,'/index.php',lang('Serial
 number'),$link_data));
                        
$this->t->set_var('sort_name',$this->nextmatchs->show_sort_order($this->sort,'name',$this->order,'/index.php',lang('Name'),$link_data));
! 
!                       if ($this->selection == 'category')
!                       {
!                               
$this->t->set_var('sort_selection',$this->nextmatchs->show_sort_order($this->sort,'dist',$this->order,'/index.php',lang('Distributor'),$link_data));
!                       }
!                       elseif ($this->selection == 'dist')
!                       {
!                               
$this->t->set_var('sort_selection',$this->nextmatchs->show_sort_order($this->sort,'category',$this->order,'/index.php',lang('Category'),$link_data));
!                       }
! 
                        
$this->t->set_var('sort_status',$this->nextmatchs->show_sort_order($this->sort,'status',$this->order,'/index.php',lang('Status'),$link_data));
                        
$this->t->set_var('sort_cost',$this->nextmatchs->show_sort_order($this->sort,'cost',$this->order,'/index.php',lang('Cost'),$link_data));
***************
*** 230,239 ****
                        
$this->t->set_var('sort_stock',$this->nextmatchs->show_sort_order($this->sort,'stock',$this->order,'/index.php',lang('Stock'),$link_data));
                        $this->t->set_var('currency',$prefs['currency']);
-                       $this->t->set_var('lang_action',lang('Product list'));
-                       
$this->t->set_var('cat_action',$GLOBALS['phpgw']->link('/index.php',$link_data));
                        
$this->t->set_var('search_action',$GLOBALS['phpgw']->link('/index.php',$link_data));
  
-                       
$this->t->set_var('category_list',$this->boinv->formatted_cat_list());
- 
  // -------------------------------- end declaration 
-----------------------------------------
  
--- 272,277 ----
***************
*** 247,255 ****
                                if (! $name) $name = '&nbsp;';
  
!                               $abid = $products[$i]['dist'];
!                               if (!$abid) { $dist = '&nbsp;'; }
!                               else
                                {
!                                       $dist = 
$this->boinv->read_single_contact($abid);
                                }
  
--- 285,301 ----
                                if (! $name) $name = '&nbsp;';
  
!                               if ($this->selection == 'category')
!                               {
!                                       $abid = $products[$i]['dist'];
!                                       if (!$abid) { $selection = '&nbsp;'; }
!                                       else
!                                       {
!                                               $dist = 
$this->boinv->read_single_contact($abid);
!                                               $selection = 
$dist[0]['org_name'];
!                                       }
!                               }
!                               elseif ($this->selection == 'dist')
                                {
!                                       $selection = 
$this->boinv->cats->id2name($products[$i]['category']);
                                }
  
***************
*** 262,266 ****
                                $this->t->set_var(array('num' => 
$GLOBALS['phpgw']->strip_html($products[$i]['num']),
                                                                                
'name' => $name,
!                                                                               
'dist' => $dist[0]['org_name'],
                                                                                
'status' => lang($this->boinv->return_value($products[$i]['status'])),
                                                                                
'cost' => $products[$i]['cost'],
--- 308,312 ----
                                $this->t->set_var(array('num' => 
$GLOBALS['phpgw']->strip_html($products[$i]['num']),
                                                                                
'name' => $name,
!                                                                               
'selection' => $selection,
                                                                                
'status' => lang($this->boinv->return_value($products[$i]['status'])),
                                                                                
'cost' => $products[$i]['cost'],




reply via email to

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