phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: stocks/inc hook_about.inc.php,NONE,1.1 class.bo.


From: Bettina Gille <address@hidden>
Subject: [Phpgroupware-cvs] CVS: stocks/inc hook_about.inc.php,NONE,1.1 class.bo.inc.php,1.1,1.2 class.so.inc.php,1.1,1.2 class.ui.inc.php,1.1,1.2
Date: Sun, 20 Jan 2002 19:19:06 -0500

Update of /cvsroot/phpgroupware/stocks/inc
In directory subversions:/tmp/cvs-serv21191/inc

Modified Files:
        class.bo.inc.php class.so.inc.php class.ui.inc.php 
Added Files:
        hook_about.inc.php 
Log Message:
moved stocks to ntier

***** Error reading new file: [Errno 2] No such file or directory: 
'hook_about.inc.php'
Index: class.bo.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/stocks/inc/class.bo.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** class.bo.inc.php    20 Jan 2002 23:40:39 -0000      1.1
--- class.bo.inc.php    21 Jan 2002 00:19:02 -0000      1.2
***************
*** 146,149 ****
--- 146,154 ----
                }
  
+               function read_single($stock_id)
+               {
+                       return $this->so->read_single($stock_id);
+               }
+ 
                function save_stock($values)
                {

Index: class.so.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/stocks/inc/class.so.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** class.so.inc.php    20 Jan 2002 23:40:39 -0000      1.1
--- class.so.inc.php    21 Jan 2002 00:19:02 -0000      1.2
***************
*** 54,57 ****
--- 54,72 ----
                }
  
+               function read_single($stock_id)
+               {
+                       $this->db->query("SELECT * from phpgw_stocks where 
stock_id='" . $stock_id . "'",__LINE__,__FILE__);
+ 
+                       if ($this->db->next_record())
+                       {
+                               $stock['id']            = 
$this->db->f('stock_id');
+                               $stock['owner']         = 
$this->db->f('stock_owner');
+                               $stock['access']        = 
$this->db->f('stock_access');
+                               $stock['name']          = 
$this->db->f('stock_name');
+                               $stock['symbol']        = 
$this->db->f('stock_symbol');
+                       }
+                       return $stock;
+               }
+ 
                function add_stock($values)
                {
***************
*** 64,67 ****
--- 79,88 ----
                {
                        $this->db->query("DELETE from phpgw_stocks where 
stock_id='" . $stock_id . "'",__LINE__,__FILE__);
+               }
+ 
+               function edit_stock($values)
+               {
+                       $this->db->query("UPDATE phpgw_stocks set stock_name='" 
. $values['name'] . "', stock_symbol='" . $values['symbol']
+                                                       . " where stock_id='" . 
$values['id'] . "'",__LINE__,__FILE__);
                }
        }

Index: class.ui.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/stocks/inc/class.ui.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** class.ui.inc.php    20 Jan 2002 23:40:39 -0000      1.1
--- class.ui.inc.php    21 Jan 2002 00:19:02 -0000      1.2
***************
*** 33,37 ****
                (
                        'index'                 => True,
!                       'preferences'   => True
                );
  
--- 33,38 ----
                (
                        'index'                 => True,
!                       'preferences'   => True,
!                       'edit_stock'    => True
                );
  
***************
*** 54,57 ****
--- 55,59 ----
                        $this->t->set_var('lang_add_stock',lang('Add new 
stock'));
                        $this->t->set_var('lang_delete',lang('Delete'));
+                       $this->t->set_var('lang_save',lang('Save'));
                }
  
***************
*** 191,195 ****
                                        ));
  
!                                       
$this->t->set_var('edit',$GLOBALS['phpgw']->link('/stocks/preferences_edit.php','sym='
 . $dsymbol));
                                        
$this->t->set_var('delete',$GLOBALS['phpgw']->link('/index.php','menuaction=stocks.ui.preferences&action=delete&stock_id='
                                                                                
                . $stock['id']));
--- 193,198 ----
                                        ));
  
!                                       
$this->t->set_var('edit',$GLOBALS['phpgw']->link('/index.php','menuaction=stocks.ui.edit_stock&stock_id='
!                                                                               
                                                        . $stock['id']));
                                        
$this->t->set_var('delete',$GLOBALS['phpgw']->link('/index.php','menuaction=stocks.ui.preferences&action=delete&stock_id='
                                                                                
                . $stock['id']));
***************
*** 215,218 ****
--- 218,264 ----
                                                                                
                                                        . '&symbol=' . 
$symbol));
                        $this->t->pfp('out','stock_prefs_t',True);
+               }
+ 
+               function edit_stock()
+               {
+                       $submit         = $GLOBALS['HTTP_POST_VARS']['submit'];
+                       $values         = $GLOBALS['HTTP_POST_VARS']['values'];
+                       $stock_id       = 
$GLOBALS['HTTP_POST_VARS']['stock_id'];
+ 
+                       if ($stock_id)
+                       {
+                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=stocks.ui.preferences'));
+                               $GLOBALS['phpgw']->common->phpgw_exit();
+                       }
+ 
+                       if ($submit)
+                       {
+                               $values['symbol']       = 
urlencode(strtoupper($values['symbol']));
+                               $values['name']         = 
urlencode($values['name']);
+                               $values['id']           = $stock_id;
+ 
+                               $this->bo->save_stock($values);
+                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=stocks.ui.preferences'));
+                               $GLOBALS['phpgw']->common->phpgw_exit();
+                       }
+ 
+                       $GLOBALS['phpgw']->common->phpgw_header();
+                       echo parse_navbar();
+ 
+                       $this->set_app_langs();
+ 
+                       $this->t->set_file(array('edit' => 
'preferences_edit.tpl'));
+                       
$this->t->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php','menuaction=stocks.ui.edit_stock&stock_id='
 . $stock_id));
+                       $this->t->set_var('lang_action',lang('Stock Quote 
preferences'));
+ 
+                       $this->t->set_var('hidden_vars','<input type="hidden" 
name="stock_is" value="' . $stock_id . '">' . "\n");
+                       $this->t->set_var('h_lang_edit',lang('Edit stock'));
+ 
+                       $stock = $this->bo->read_single($stock_id);
+ 
+                       
$this->t->set_var('symbol',rawurldecode($stock['symbol']));
+                       $this->t->set_var('name',rawurldecode($stock['name']));
+ 
+                       $this->t->pfp('out','edit');
                }
        }




reply via email to

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