[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: stocks/inc class.bo.inc.php,1.2,1.3 class.ui.inc
From: |
Bettina Gille <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: stocks/inc class.bo.inc.php,1.2,1.3 class.ui.inc.php,1.3,1.4 hook_add_def_pref.inc.php,1.2,1.3 hook_home.inc.php,1.8,1.9 hook_preferences.inc.php,1.7,1.8 |
Date: |
Mon, 21 Jan 2002 18:03:56 -0500 |
Update of /cvsroot/phpgroupware/stocks/inc
In directory subversions:/tmp/cvs-serv23826/inc
Modified Files:
class.bo.inc.php class.ui.inc.php hook_add_def_pref.inc.php
hook_home.inc.php hook_preferences.inc.php
Log Message:
update
Index: class.bo.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/stocks/inc/class.bo.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.bo.inc.php 21 Jan 2002 00:19:02 -0000 1.2
--- class.bo.inc.php 21 Jan 2002 23:03:54 -0000 1.3
***************
*** 129,144 ****
{
$prefs['mainscreen'] =
$GLOBALS['phpgw_info']['user']['preferences']['stocks']['mainscreen'];
- $prefs['LNUX'] =
$GLOBALS['phpgw_info']['user']['preferences']['stocks']['LNUX'];
- $prefs['RHAT'] =
$GLOBALS['phpgw_info']['user']['preferences']['stocks']['RHAT'];
}
else
{
! $prefs['mainscreen'] = 'enabled';
! $prefs['LNUX'] = 'VA%20Linux';
! $prefs['RHAT'] = 'RedHat';
}
return $prefs;
}
function read_stocks()
{
--- 129,148 ----
{
$prefs['mainscreen'] =
$GLOBALS['phpgw_info']['user']['preferences']['stocks']['mainscreen'];
}
else
{
! $prefs['mainscreen'] = 'disabled';
}
return $prefs;
}
+ function get_default()
+ {
+ $def = array();
+ $def['LNUX'] = 'VA%20Linux';
+ $def['RHAT'] = 'Redhat';
+ return $def;
+ }
+
function read_stocks()
{
***************
*** 153,156 ****
--- 157,162 ----
function save_stock($values)
{
+ $values['sysmbol'] =
urlencode(strtoupper($values['symbol']));
+
if ($values['id'] && $values['id'] != 0)
{
***************
*** 176,181 ****
while (list($null,$stock) = each($stocks))
{
! $symbol =
rawurldecode($stock['symbol']);
! $name = rawurldecode($stock['name']);
if ($symbol)
--- 182,187 ----
while (list($null,$stock) = each($stocks))
{
! $symbol =
rawurldecode($stock['symbol']);
! $name = rawurldecode($stock['name']);
if ($symbol)
***************
*** 191,197 ****
else
{
! $prefs = $this->read_prefs();
! $stocklist['LNUX'] =
rawurldecode($prefs['LNUX']);
! $stocklist['RHAT'] =
rawurldecode($prefs['RHAT']);
}
return $stocklist;
--- 197,203 ----
else
{
! $def = $this->get_default();
! $stocklist['LNUX'] = rawurldecode($def['LNUX']);
! $stocklist['RHAT'] = rawurldecode($def['RHAT']);
}
return $stocklist;
Index: class.ui.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/stocks/inc/class.ui.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.ui.inc.php 21 Jan 2002 00:38:28 -0000 1.3
--- class.ui.inc.php 21 Jan 2002 23:03:54 -0000 1.4
***************
*** 34,38 ****
'index' => True,
'preferences' => True,
! 'edit_stock' => True
);
--- 34,40 ----
'index' => True,
'preferences' => True,
! 'edit_stock' => True,
! 'list_stocks' => True,
! 'add_stock' => True
);
***************
*** 56,59 ****
--- 58,79 ----
$this->t->set_var('lang_delete',lang('Delete'));
$this->t->set_var('lang_save',lang('Save'));
+ $this->t->set_var('lang_stocks',lang('Stock Quotes'));
+ $this->t->set_var('lang_done',lang('Done'));
+ }
+
+ function display_app_header()
+ {
+ $this->t->set_file(array('header' => 'header.tpl'));
+ $this->t->set_block('header','stock_header');
+
+ $this->set_app_langs();
+
+
$this->t->set_var('link_stocks',$GLOBALS['phpgw']->link('/index.php','menuaction=stocks.ui.list_stocks'));
+ $this->t->set_var('lang_select_stocks',lang('Select
stocks to display'));
+
+ $this->t->fp('app_header','stock_header');
+
+ $GLOBALS['phpgw']->common->phpgw_header();
+ echo parse_navbar();
}
***************
*** 63,67 ****
. '<table cellspacing="1" cellpadding="2" border="0"
bgcolor="white">'
. '<tr><td><b>' . lang('Name') . '</b></td><td><b>' .
lang('Symbol') . '</b></td><td align="right"><b>' . lang('Price') .
'</b></td><td align="right">'
! . '<b> ' . lang('Change') . '</b></td><td
align="right"><b>' . lang('%') . ' ' . lang('Change') . '</b></td><td
align="center"><b>' . lang('Date') . '</b></td><td align="center">'
. '<b>' . lang('Time') .
'</b></td></tr>';
--- 83,87 ----
. '<table cellspacing="1" cellpadding="2" border="0"
bgcolor="white">'
. '<tr><td><b>' . lang('Name') . '</b></td><td><b>' .
lang('Symbol') . '</b></td><td align="right"><b>' . lang('Price') .
'</b></td><td align="right">'
! . '<b> ' . lang('Change') . '</b></td><td
align="right"><b>% ' . lang('Change') . '</b></td><td align="center"><b>'
. lang('Date') . '</b></td><td align="center">'
. '<b>' . lang('Time') .
'</b></td></tr>';
***************
*** 107,113 ****
function index()
{
! $GLOBALS['phpgw']->common->phpgw_header();
! echo parse_navbar();
!
$this->t->set_file(array('quotes_list' => 'main.tpl'));
$this->t->set_var('quotes',$this->return_quotes());
--- 127,131 ----
function index()
{
! $this->display_app_header();
$this->t->set_file(array('quotes_list' => 'main.tpl'));
$this->t->set_var('quotes',$this->return_quotes());
***************
*** 115,141 ****
}
! function preferences()
{
! $action = $GLOBALS['HTTP_GET_VARS']['action'] ?
$GLOBALS['HTTP_GET_VARS']['action'] : $GLOBALS['HTTP_POST_VARS']['action'];
! $name = $GLOBALS['HTTP_POST_VARS']['name'];
! $symbol = $GLOBALS['HTTP_POST_VARS']['symbol'];
! $mainscreen = $GLOBALS['HTTP_POST_VARS']['mainscreen'];
! $stock_id =
$GLOBALS['HTTP_POST_VARS']['stock_id'];
! $submit = $GLOBALS['HTTP_POST_VARS']['submit'];
! if ($submit)
! {
! $this->bo->save_stock(array('access' =>
'public','name' => $name,'symbol' => $symbol));
! Header('Location: ' .
$GLOBALS['phpgw']->link('/index.php','menuaction=stocks.ui.preferences'));
! $GLOBALS['phpgw']->common->phpgw_exit();
! }
if ($action == 'delete')
{
$this->bo->delete_stock($stock_id);
! Header('Location: ' .
$GLOBALS['phpgw']->link('/index.php','menuaction=stocks.ui.preferences'));
$GLOBALS['phpgw']->common->phpgw_exit();
}
if ($mainscreen)
{
--- 133,200 ----
}
! function list_stocks()
{
! $action = $GLOBALS['HTTP_GET_VARS']['action'] ?
$GLOBALS['HTTP_GET_VARS']['action'] : $GLOBALS['HTTP_POST_VARS']['action'];
! $stock_id = $GLOBALS['HTTP_GET_VARS']['stock_id'];
! $link_data = array
! (
! 'menuaction' => 'stocks.ui.list_stocks'
! );
if ($action == 'delete')
{
$this->bo->delete_stock($stock_id);
! Header('Location: ' .
$GLOBALS['phpgw']->link('/index.php',$link_data));
$GLOBALS['phpgw']->common->phpgw_exit();
}
+ $this->display_app_header();
+
+ $this->t->set_file(array('stock_list_t' => 'list.tpl'));
+ $this->t->set_block('stock_list_t','stock_list','list');
+
+ $this->t->set_var('lang_list',lang('Stock Quotes
list'));
+ $this->t->set_var('h_lang_edit',lang('Edit'));
+ $this->t->set_var('h_lang_delete',lang('Delete'));
+
$this->t->set_var('doneurl',$GLOBALS['phpgw']->link('/index.php','menuaction=stocks.ui.index'));
+
+ $stocks = $this->bo->read_stocks();
+
+ if (is_array($stocks))
+ {
+ while (list($null,$stock) = each($stocks))
+ {
+
$this->nextmatchs->template_alternate_row_color(&$this->t);
+
+ $this->t->set_var(array
+ (
+ 'dsymbol' =>
rawurldecode($stock['symbol']),
+ 'dname' =>
rawurldecode($stock['name'])
+ ));
+
+
$this->t->set_var('delete',$GLOBALS['phpgw']->link('/index.php','menuaction=stocks.ui.list_stocks&action=delete&stock_id='
+
.
$stock['id']));
+
+
$this->t->set_var('edit',$GLOBALS['phpgw']->link('/index.php','menuaction=stocks.ui.edit_stock&stock_id='
+
. $stock['id']));
+
+ $this->t->fp('list','stock_list',True);
+ }
+ }
+ $link_data['menuaction'] = 'stocks.ui.add_stock';
+
$this->t->set_var('addurl',$GLOBALS['phpgw']->link('/index.php',$link_data));
+ $this->t->pfp('out','stock_list_t',True);
+ }
+
+ function preferences()
+ {
+ $mainscreen = $GLOBALS['HTTP_POST_VARS']['mainscreen'];
+
+ $link_data = array
+ (
+ 'menuaction' => 'stocks.ui.preferences'
+ );
+
if ($mainscreen)
{
***************
*** 154,158 ****
$GLOBALS['phpgw']->preferences->save_repository(True);
! Header('Location: ' .
$GLOBALS['phpgw']->link('/index.php','menuaction=stocks.ui.preferences'));
$GLOBALS['phpgw']->common->phpgw_exit();
}
--- 213,217 ----
$GLOBALS['phpgw']->preferences->save_repository(True);
! Header('Location: ' .
$GLOBALS['phpgw']->link('/index.php',$link_data));
$GLOBALS['phpgw']->common->phpgw_exit();
}
***************
*** 161,167 ****
echo parse_navbar();
! $this->t->set_file(array('stock_prefs' =>
'preferences.tpl',
! 'stock_prefs_t'
=> 'preferences.tpl'));
!
$this->t->set_block('stock_prefs_t','stock_prefs','prefs');
$this->set_app_langs();
--- 220,224 ----
echo parse_navbar();
! $this->t->set_file(array('stock_prefs' =>
'preferences.tpl'));
$this->set_app_langs();
***************
*** 169,203 ****
$prefs = $this->bo->read_prefs();
! $hidden_vars = '<input type="hidden" name="symbol"
value="' . $symbol . '">' . "\n"
! . '<input type="hidden"
name="name" value="' . $name . '">' . "\n"
! . '<input type="hidden"
name="stock_id" value="' . $stock_id . '">' . "\n";
!
!
$this->t->set_var('actionurl',$GLOBALS['phpgw']->link('/stocks/preferences.php'));
$this->t->set_var('lang_action',lang('Stock Quote
preferences'));
- $this->t->set_var('h_lang_edit',lang('Edit'));
- $this->t->set_var('hidden_vars',$hidden_vars);
- $this->t->set_var('h_lang_delete',lang('Delete'));
-
- $stocks = $this->bo->read_stocks();
-
- if (is_array($stocks))
- {
- while (list($null,$stock) = each($stocks))
- {
-
$this->nextmatchs->template_alternate_row_color(&$this->t);
-
- $this->t->set_var(array
- (
- 'dsymbol' =>
rawurldecode($stock['symbol']),
- 'dname' =>
rawurldecode($stock['name'])
- ));
-
-
$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']));
-
$this->t->fp('prefs','stock_prefs',True);
- }
- }
if ($prefs['mainscreen'] == 'enabled')
--- 226,231 ----
$prefs = $this->bo->read_prefs();
!
$this->t->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php',$link_data));
$this->t->set_var('lang_action',lang('Stock Quote
preferences'));
if ($prefs['mainscreen'] == 'enabled')
***************
*** 214,221 ****
$this->t->set_var('newstatus',$GLOBALS['phpgw']->link('/index.php','menuaction=stocks.ui.preferences&mainscreen='
. $newstatus));
$this->t->set_var('lang_newstatus',lang($newstatus));
!
$this->t->set_var('add_action',$GLOBALS['phpgw']->link('/index.php','menuaction=stocks.ui.preferences&name='
. $name
!
. '&symbol=' .
$symbol));
! $this->t->pfp('out','stock_prefs_t',True);
}
--- 242,271 ----
$this->t->set_var('newstatus',$GLOBALS['phpgw']->link('/index.php','menuaction=stocks.ui.preferences&mainscreen='
. $newstatus));
$this->t->set_var('lang_newstatus',lang($newstatus));
+ $this->t->pfp('out','stock_prefs',True);
+ }
+
+ function add_stock()
+ {
+ $submit = $GLOBALS['HTTP_POST_VARS']['submit'];
+ $values = $GLOBALS['HTTP_POST_VARS']['values'];
+
+ if ($submit)
+ {
+ $values['symbol'] =
urlencode(strtoupper($values['symbol']));
+ $values['name'] =
urlencode($values['name']);
+ $this->bo->save_stock(array('access' =>
'public','name' => $values['name'],'symbol' => $values['symbol']));
+ Header('Location: ' .
$GLOBALS['phpgw']->link('/index.php','menuaction=stocks.ui.list_stocks'));
+ $GLOBALS['phpgw']->common->phpgw_exit();
+ }
+
+ $this->display_app_header();
+ $this->t->set_file(array('edit' =>
'preferences_edit.tpl'));
+
$this->t->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php','menuaction=stocks.ui.add_stock'));
+ $this->t->set_var('h_lang_edit',lang('Add stock'));
+
+ $this->t->set_var('symbol',$symbol);
+ $this->t->set_var('name',$name);
! $this->t->pfp('out','edit');
}
***************
*** 226,232 ****
$stock_id = $GLOBALS['HTTP_GET_VARS']['stock_id'];
if (! $stock_id)
{
! Header('Location: ' .
$GLOBALS['phpgw']->link('/index.php','menuaction=stocks.ui.preferences'));
$GLOBALS['phpgw']->common->phpgw_exit();
}
--- 276,288 ----
$stock_id = $GLOBALS['HTTP_GET_VARS']['stock_id'];
+ $link_data = array
+ (
+ 'menuaction' => 'stocks.ui.list_stocks',
+ 'stock_id' => $stock_id
+ );
+
if (! $stock_id)
{
! Header('Location: ' .
$GLOBALS['phpgw']->link('/index.php',$link_data));
$GLOBALS['phpgw']->common->phpgw_exit();
}
***************
*** 239,254 ****
$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_id" value="' . $stock_id . '">' . "\n");
--- 295,307 ----
$this->bo->save_stock($values);
! Header('Location: ' .
$GLOBALS['phpgw']->link('/index.php',$link_data));
$GLOBALS['phpgw']->common->phpgw_exit();
}
! $this->display_app_header();
$this->t->set_file(array('edit' =>
'preferences_edit.tpl'));
! $link_data['menuaction'] = 'stocks.ui.edit_stock';
!
$this->t->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php',$link_data));
$this->t->set_var('hidden_vars','<input type="hidden"
name="stock_id" value="' . $stock_id . '">' . "\n");
Index: hook_add_def_pref.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/stocks/inc/hook_add_def_pref.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** hook_add_def_pref.inc.php 20 Jan 2002 23:40:39 -0000 1.2
--- hook_add_def_pref.inc.php 21 Jan 2002 23:03:54 -0000 1.3
***************
*** 13,17 ****
global $pref;
$pref->change('stocks','mainscreen','disabled');
- $pref->change('stocks','LNUX','VA%20Linux');
- $pref->change('stocks','RHAT','RedHat');
?>
--- 13,15 ----
Index: hook_home.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/stocks/inc/hook_home.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** hook_home.inc.php 20 Jan 2002 23:40:39 -0000 1.8
--- hook_home.inc.php 21 Jan 2002 23:03:54 -0000 1.9
***************
*** 19,24 ****
unset($d1);
- $tmp_app_inc = $GLOBALS['phpgw']->common->get_inc_dir('stocks');
-
if ($GLOBALS['phpgw_info']['user']['apps']['stocks'] &&
$GLOBALS['phpgw_info']['user']['preferences']['stocks']['mainscreen']['enabled'])
{
--- 19,22 ----
***************
*** 26,30 ****
$portalbox = CreateObject('phpgwapi.listbox',
! Array(
'title' => $title,
'primary' =>
$GLOBALS['phpgw_info']['theme']['navbar_bg'],
--- 24,29 ----
$portalbox = CreateObject('phpgwapi.listbox',
! Array
! (
'title' => $title,
'primary' =>
$GLOBALS['phpgw_info']['theme']['navbar_bg'],
***************
*** 39,43 ****
$app_id = $GLOBALS['phpgw']->applications->name2id('stocks');
$GLOBALS['portal_order'][] = $app_id;
! $var = Array(
'up' => Array('url' => '/set_box.php', 'app'
=> $app_id),
'down' => Array('url' => '/set_box.php', 'app'
=> $app_id),
--- 38,43 ----
$app_id = $GLOBALS['phpgw']->applications->name2id('stocks');
$GLOBALS['portal_order'][] = $app_id;
! $var = Array
! (
'up' => Array('url' => '/set_box.php', 'app'
=> $app_id),
'down' => Array('url' => '/set_box.php', 'app'
=> $app_id),
Index: hook_preferences.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/stocks/inc/hook_preferences.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** hook_preferences.inc.php 20 Jan 2002 23:40:39 -0000 1.7
--- hook_preferences.inc.php 21 Jan 2002 23:03:54 -0000 1.8
***************
*** 17,21 ****
$file = Array
(
! 'Select displayed stocks' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=stocks.ui.preferences')
);
--- 17,21 ----
$file = Array
(
! 'Preferences' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=stocks.ui.preferences')
);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: stocks/inc class.bo.inc.php,1.2,1.3 class.ui.inc.php,1.3,1.4 hook_add_def_pref.inc.php,1.2,1.3 hook_home.inc.php,1.8,1.9 hook_preferences.inc.php,1.7,1.8,
Bettina Gille <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] CVS: stocks/templates/default list.tpl,NONE,1.1 main.tpl,1.3,1.4 preferences.tpl,1.2,1.3 preferences_edit.tpl,1.6,1.7
- Next by Date:
[Phpgroupware-cvs] CVS: stocks/inc class.bo.inc.php,1.3,1.4 class.ui.inc.php,1.4,1.5
- Previous by thread:
[Phpgroupware-cvs] CVS: stocks/templates/default list.tpl,NONE,1.1 main.tpl,1.3,1.4 preferences.tpl,1.2,1.3 preferences_edit.tpl,1.6,1.7
- Next by thread:
[Phpgroupware-cvs] CVS: stocks/inc class.bo.inc.php,1.3,1.4 class.ui.inc.php,1.4,1.5
- Index(es):