phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: inv index.php,1.52,1.53


From: Bettina gille <address@hidden>
Subject: [Phpgroupware-cvs] CVS: inv index.php,1.52,1.53
Date: Mon, 14 Jan 2002 21:57:20 -0500

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

Modified Files:
        index.php 
Log Message:
start porting inv to ntier

Index: index.php
===================================================================
RCS file: /cvsroot/phpgroupware/inv/index.php,v
retrieving revision 1.52
retrieving revision 1.53
diff -C2 -r1.52 -r1.53
*** index.php   19 Jul 2001 00:13:57 -0000      1.52
--- index.php   15 Jan 2002 02:57:15 -0000      1.53
***************
*** 1,152 ****
  <?php
!       
/**************************************************************************\
!       * phpGroupWare - Inventory                                              
   *
!       * http://www.phpgroupware.org                                           
   *
!       * Written by Bettina Gille address@hidden                          *
!       * -----------------------------------------------                       
   *
!       * This program is free software; you can redistribute it and/or modify 
it  *
!       * under the terms of the GNU General Public License as published by the 
   *
!       * Free Software Foundation; either version 2 of the License, or (at 
your   *
!       * option) any later version.                                            
   *
!       
\**************************************************************************/
        /* $Id$ */
  
!       $phpgw_info['flags'] = array('currentapp' => 'inv',
!                                       'enable_nextmatchs_class' => True);
! 
        include('../header.inc.php');
  
!       $inventory = CreateObject('inv.inventory');
! 
!       $t = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
!       $t->set_file(array('cat_list_t' => 'listcategorys.tpl'));
!       $t->set_block('cat_list_t','cat_list','list');
! 
!       $c = CreateObject('phpgwapi.categories');
!       $grants = $phpgw->acl->get_grants('inv');
!       $grants[$phpgw_info['user']['account_id']] = PHPGW_ACL_READ + 
PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE;
! 
!       $hidden_vars = '<input type="hidden" name="sort" value="' . $sort . 
'">' . "\n"
!                               . '<input type="hidden" name="order" value="' . 
$order . '">' . "\n"
!                               . '<input type="hidden" name="query" value="' . 
$query . '">' . "\n"
!                               . '<input type="hidden" name="start" value="' . 
$start . '">' . "\n"
!                               . '<input type="hidden" name="filter" value="' 
. $filter . '">' . "\n";
! 
!       $t->set_var('lang_action',lang('Category list'));
!       $t->set_var('add_action',$phpgw->link('/inv/addcategory.php'));
!       $t->set_var('lang_add',lang('Add'));
!       $t->set_var('lang_search',lang('Search'));
!       $t->set_var('actionurl',$phpgw->link('/inv/index.php'));
! 
!       if (! $start) { $start = 0; }
! 
!       $cats = $c->return_array($type,$start,True,$query,$sort,$order);
! 
! //--------------------------------- nextmatch 
--------------------------------------------
! 
!       $left = 
$phpgw->nextmatchs->left('/inv/index.php',$start,$c->total_records);
!       $right = 
$phpgw->nextmatchs->right('/inv/index.php',$start,$c->total_records);
!       $t->set_var('left',$left);
!       $t->set_var('right',$right);
! 
!       
$t->set_var('lang_showing',$phpgw->nextmatchs->show_hits($c->total_records,$start));
! 
! // ------------------------------ end nextmatch 
------------------------------------------
! 
! //------------------- list header variable template-declarations 
-------------------------
! 
!       $t->set_var('th_bg',$phpgw_info['theme']['th_bg']);
!       
$t->set_var('sort_name',$phpgw->nextmatchs->show_sort_order($sort,'cat_name',$order,'/inv/index.php',lang('Name')));
!       
$t->set_var('sort_number',$phpgw->nextmatchs->show_sort_order($sort,'cat_data',$order,'/inv/index.php',lang('Category
 ID')));
!       
$t->set_var('sort_description',$phpgw->nextmatchs->show_sort_order($sort,'cat_description',$order,'/inv/index.php',lang('Description')));
!       
$t->set_var('sort_tax',$phpgw->nextmatchs->show_sort_order($sort,'cat_data',order,'/inv/index.php',lang('tax')));
!       $t->set_var('lang_products',lang('Products'));
!       $t->set_var('lang_procent',lang('%'));
!       $t->set_var('lang_sub',lang('Add sub'));
!       $t->set_var('lang_edit',lang('Edit'));
!       $t->set_var('lang_delete',lang('Delete'));
! 
! // -------------------------- end header declaration 
--------------------------------------
! 
!       for ($i=0;$i<count($cats);$i++)
!       {
!               $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
!               $t->set_var('tr_color',$tr_color);
! 
!               $data = unserialize($cats[$i]['data']);
!               $number = $phpgw->strip_html($data['number']);
!               if (! $number) { $number  = '&nbsp;'; }
!               $tax = sprintf("%01.2f",(float)$data['tax']);
!               if (! $tax) { $tax  = '&nbsp;'; }
!               $cat_id = $cats[$i]['id'];
!               $owner = $cats[$i]['owner'];
!               $level = $cats[$i]['level'];
! 
!               if ($level > 0)
!               { 
!                       $space = '&nbsp;&nbsp;';
!                       $spaceset = str_repeat($space,$level);
!                       $name = $spaceset . 
$phpgw->strip_html($cats[$i]['name']);
!               }
! 
!               $descr = $phpgw->strip_html($cats[$i]['description']);
!               if (! $descr) { $descr  = '&nbsp;'; }
! 
!               if ($level == 0)
!               {
!                       $name = '<font color=FF0000><b>' . 
$phpgw->strip_html($cats[$i]['name']) . '</b></font>';
!                       $number = '<font color=FF0000><b>' . $number . 
'</b></font>';
!                       $descr = '<font color=FF0000><b>' . $descr . 
'</b></font>'; 
!                       $tax = '<font color=FF0000><b>' . $tax . '</b></font>';
!               }
! 
! //-------------------------- template declaration for list records 
---------------------------                                                     
                                                          
!                                                                               
                                                                              
!               $t->set_var(array('name' => $name,                              
                                                                                
          
!                                               'number' => $number,
!                                               'descr' => $descr,              
                                                                                
             
!                                                       'tax' => $tax));        
                                                                                
                        
! 
!               
$t->set_var('products',$phpgw->link('/inv/listproducts.php','filter=' . $cat_id 
. '&subproduct=True'));
! 
!               if ($inventory->check_perms($grants[$owner],PHPGW_ACL_ADD) || 
$owner == $phpgw_info['user']['account_id'])
!               {
!                       
$t->set_var('add_sub',$phpgw->link('/inv/addcategory.php','cat_parent=' . 
$cat_id));
!                       $t->set_var('lang_sub_entry',lang('Add sub'));
!               }
!               else
!               {
!                       $t->set_var('add_sub','');
!                       $t->set_var('lang_sub_entry','&nbsp;');
!               }
! 
!               if ($inventory->check_perms($grants[$owner],PHPGW_ACL_EDIT) || 
$owner == $phpgw_info['user']['account_id'])
!               {
!                       
$t->set_var('edit',$phpgw->link('/inv/editcategory.php','cat_id=' . $cat_id));
!                       $t->set_var('lang_edit_entry',lang('Edit'));
!               }
!               else
!               {
!                       $t->set_var('edit','');
!                       $t->set_var('lang_edit_entry','&nbsp;');
!               }
!               if ($inventory->check_perms($grants[$owner],PHPGW_ACL_DELETE) 
|| $owner == $phpgw_info['user']['account_id'])
!               {
!                       
$t->set_var('delete',$phpgw->link('/inv/deletecategory.php','cat_id=' . 
$cat_id));
!                       $t->set_var('lang_delete_entry',lang('Delete'));
!               }
!               else
!               {
!                       $t->set_var('delete','');
!                       $t->set_var('lang_delete_entry','&nbsp;');
!               }
! 
!               $t->parse('list','cat_list',True);
!       }
! // ---------------------------- end record declaration 
-----------------------------------------
! 
!       $t->parse('out','cat_list_t',True);
!       $t->p('out');
! 
!       $phpgw->common->phpgw_footer();
  ?>
--- 1,38 ----
  <?php
!       /*******************************************************************\
!       * phpGroupWare - Inventory                                          *
!       * http://www.phpgroupware.org                                       *
!       *                                                                   *
!       * Inventar Manager                                                  *
!       * Written by Bettina Gille address@hidden                   *
!       *        and Joseph Engo <address@hidden>                   *
!       * -----------------------------------------------                   *
!       * Copyright (C) 2000,2001,2002 Bettina Gille                        *
!       *                                                                   *
!       * This program is free software; you can redistribute it and/or     *
!       * modify it under the terms of the GNU General Public License as    *
!       * published by the Free Software Foundation; either version 2 of    *
!       * the License, or (at your option) any later version.               *
!       *                                                                   *
!       * This program is distributed in the hope that it will be useful,   *
!       * but WITHOUT ANY WARRANTY; without even the implied warranty of    *
!       * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU  *
!       * General Public License for more details.                          *
!       *                                                                   *
!       * You should have received a copy of the GNU General Public License *
!       * along with this program; if not, write to the Free Software       *
!       * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.         *
!       \*******************************************************************/
        /* $Id$ */
  
!       $GLOBALS['phpgw_info']['flags'] = array
!       (
!               'currentapp' => 'inv',
!               'noheader'   => True,
!               'nonavbar'   => True
!       );
        include('../header.inc.php');
  
!       Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=inv.uiinventory.list_products&action=subproduct'));
!       $GLOBALS['phpgw']->common->phpgw_exit();
  ?>




reply via email to

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