[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: notes/inc class.bo.inc.php,1.8,1.9 class.so.inc.
From: |
Bettina Gille <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: notes/inc class.bo.inc.php,1.8,1.9 class.so.inc.php,1.7,1.8 class.ui.inc.php,1.25,1.26 |
Date: |
Wed, 25 Sep 2002 21:49:48 -0400 |
Update of /cvsroot/phpgroupware/notes/inc
In directory subversions:/tmp/cvs-serv11169/inc
Modified Files:
class.bo.inc.php class.so.inc.php class.ui.inc.php
Log Message:
added xsl functions
Index: class.bo.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/notes/inc/class.bo.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** class.bo.inc.php 22 Sep 2002 23:04:12 -0000 1.8
--- class.bo.inc.php 26 Sep 2002 01:49:45 -0000 1.9
***************
*** 16,21 ****
{
var $start;
! var $search;
var $filter;
var $cat_id;
--- 16,23 ----
{
var $start;
! var $query;
var $filter;
+ var $sort;
+ var $order;
var $cat_id;
***************
*** 63,72 ****
}
! global $start, $search, $filter, $cat_id;
! if(isset($start)) { $this->start = $start; }
! if(isset($search)) { $this->search = $search; }
! if(!empty($filter)) { $this->filter = $filter; }
! if(isset($cat_id)) { $this->cat_id = $cat_id; }
}
--- 65,99 ----
}
! $start = get_var('start',array('POST','GET'));
! $query = get_var('query',array('POST','GET'));
! $sort = get_var('sort',array('POST','GET'));
! $order = get_var('order',array('POST','GET'));
! $filter = get_var('filter',array('POST','GET'));
! $cat_id = get_var('cat_id',array('POST','GET'));
! if(isset($start))
! {
! $this->start = $start;
! }
! if(isset($query))
! {
! $this->query = $query;
! }
! if(!empty($filter))
! {
! $this->filter = $filter;
! }
! if(isset($sort))
! {
! $this->sort = $sort;
! }
! if(isset($order))
! {
! $this->order = $order;
! }
! if(isset($cat_id))
! {
! $this->cat_id = $cat_id;
! }
}
***************
*** 135,142 ****
$data =
$GLOBALS['phpgw']->session->appsession('session_data','notes');
! $this->start = $data['start'];
! $this->search = $data['search'];
! $this->filter = $data['filter'];
! $this->cat_id = $data['cat_id'];
}
--- 162,171 ----
$data =
$GLOBALS['phpgw']->session->appsession('session_data','notes');
! $this->start = $data['start'];
! $this->query = $data['query'];
! $this->filter = $data['filter'];
! $this->sort = $data['sort'];
! $this->order = $data['order'];
! $this->cat_id = $data['cat_id'];
}
***************
*** 172,190 ****
}
! function read($start = '', $search = '', $filter = '', $cat_id
= '')
{
! if (is_array($start))
! {
! $params = $start;
! }
! else
! {
! $params['start'] = $start;
! $params['search'] = $search;
! $params['filter'] = $filter;
! $params['cat_id'] = $cat_id;
! }
!
! $notes =
$this->so->read($params['start'],$params['search'],$params['filter'],$params['cat_id']);
$this->total_records = $this->so->total_records;
--- 201,208 ----
}
! function read()
{
! $notes = $this->so->read(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
!
'filter' => $this->filter,'cat_id' => $this->cat_id));
$this->total_records = $this->so->total_records;
Index: class.so.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/notes/inc/class.so.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** class.so.inc.php 22 Sep 2002 23:04:12 -0000 1.7
--- class.so.inc.php 26 Sep 2002 01:49:45 -0000 1.8
***************
*** 24,32 ****
}
! function read($start, $search = '', $filter = '',$cat_id = '')
{
! if (! $filter)
{
! $filter = 'all';
}
--- 24,46 ----
}
! function read($data)
{
! if(is_array($data))
{
! $start =
(isset($data['start'])?$data['start']:0);
! $filter =
(isset($data['filter'])?$data['filter']:'all');
! $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);
! }
!
! if ($order)
! {
! $ordermethod = " order by $order $sort";
! }
! else
! {
! $ordermethod = ' order by note_date DESC';
}
***************
*** 58,79 ****
}
! if ($cat_id)
{
$filtermethod .= " AND note_category='$cat_id'
";
}
! if($search)
{
! $search = ereg_replace("'",'',$search);
! $search = ereg_replace('"','',$search);
! $searchmethod = " AND note_content LIKE
'%$search%'";
}
! $sql = "SELECT * FROM phpgw_notes WHERE $filtermethod
$searchmethod ORDER BY note_date DESC";
$this->db2->query($sql,__LINE__,__FILE__);
$this->total_records = $this->db2->num_rows();
! $this->db->limit_query($sql,$start,__LINE__,__FILE__);
while ($this->db->next_record())
--- 72,93 ----
}
! if ($cat_id > 0)
{
$filtermethod .= " AND note_category='$cat_id'
";
}
! if($query)
{
! $query = ereg_replace("'",'',$query);
! $query = ereg_replace('"','',$query);
! $querymethod = " AND note_content LIKE
'%$query%'";
}
! $sql = "SELECT * FROM phpgw_notes WHERE $filtermethod
$querymethod";
$this->db2->query($sql,__LINE__,__FILE__);
$this->total_records = $this->db2->num_rows();
! $this->db->limit_query($sql .
$ordermethod,$start,__LINE__,__FILE__);
while ($this->db->next_record())
Index: class.ui.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/notes/inc/class.ui.inc.php,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -r1.25 -r1.26
*** class.ui.inc.php 25 Sep 2002 04:05:06 -0000 1.25
--- class.ui.inc.php 26 Sep 2002 01:49:45 -0000 1.26
***************
*** 18,34 ****
var $cat_id;
var $start;
! var $search;
var $filter;
- var $message;
-
var $public_functions = array
(
'index' => True,
'view' => True,
- 'add' => True,
'edit' => True,
! 'delete' => True,
! 'preferences' => True
);
--- 18,32 ----
var $cat_id;
var $start;
! var $query;
! var $sort;
! var $order;
var $filter;
var $public_functions = array
(
'index' => True,
'view' => True,
'edit' => True,
! 'delete' => True
);
***************
*** 50,58 ****
$this->start = $this->bo->start;
! $this->search = $this->bo->search;
$this->filter = $this->bo->filter;
$this->cat_id = $this->bo->cat_id;
-
- $this->data = $this->bo->data;
}
--- 48,56 ----
$this->start = $this->bo->start;
! $this->query = $this->bo->query;
! $this->sort = $this->bo->sort;
! $this->order = $this->bo->order;
$this->filter = $this->bo->filter;
$this->cat_id = $this->bo->cat_id;
}
***************
*** 61,68 ****
$data = array
(
! 'start' => $this->start,
! 'search' => $this->search,
! 'filter' => $this->filter,
! 'cat_id' => $this->cat_id
);
$this->bo->save_sessiondata($data);
--- 59,68 ----
$data = array
(
! 'start' => $this->start,
! 'query' => $this->query,
! 'sort' => $this->sort,
! 'order' => $this->order,
! 'filter' => $this->filter,
! 'cat_id' => $this->cat_id
);
$this->bo->save_sessiondata($data);
***************
*** 71,76 ****
function set_app_langs()
{
- global $tr_color;
-
$this->t->set_var('bg_color',$GLOBALS['phpgw_info']['theme']['th_bg']);
$tr_color =
$this->nextmatchs->alternate_row_color($tr_color);
--- 71,74 ----
***************
*** 96,100 ****
function display_app_header()
{
! $this->t->set_file(array('header' => 'header.tpl'));
$this->t->set_block('header','notes_header');
--- 94,98 ----
function display_app_header()
{
! /*$this->t->set_file(array('header' => 'header.tpl'));
$this->t->set_block('header','notes_header');
***************
*** 103,107 ****
$this->t->set_var('link_categories',$GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uicategories.index&cats_app=notes&cats_level=True&global_cats=True'));
$this->t->set_var('link_notes',$GLOBALS['phpgw']->link('/notes/index.php','menuaction=notes.ui._list'));
! $this->t->fp('app_header','notes_header');
$GLOBALS['phpgw']->common->phpgw_header();
--- 101,105 ----
$this->t->set_var('link_categories',$GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uicategories.index&cats_app=notes&cats_level=True&global_cats=True'));
$this->t->set_var('link_notes',$GLOBALS['phpgw']->link('/notes/index.php','menuaction=notes.ui._list'));
! $this->t->fp('app_header','notes_header'); */
$GLOBALS['phpgw']->common->phpgw_header();
***************
*** 238,246 ****
$this->display_app_header();
! $this->tpl->add_file('list');
!
! $this->tpl->set_var('app_header',lang('list notes'));
! $notes_list =
$this->bo->read($this->start,$this->search,$this->filter,$this->cat_id);
while (is_array($notes_list) && list(,$note) =
each($notes_list))
--- 236,243 ----
$this->display_app_header();
!
$this->tpl->add_file(array('list',$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default')
. SEP . 'app_header',
!
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP .
'cat_select'));
! $notes_list = $this->bo->read();
while (is_array($notes_list) && list(,$note) =
each($notes_list))
***************
*** 266,276 ****
$table_header[] = array
(
! 'lang_content' => lang('content'),
! 'lang_date' => lang('date'),
! 'lang_view' => lang('view'),
! 'lang_edit' => lang('edit'),
! 'lang_delete' => lang('delete'),
! 'lang_note_id' => lang('note id'),
! 'lang_owner' => lang('owner')
);
--- 263,273 ----
$table_header[] = array
(
! 'lang_content' => lang('content'),
! 'lang_time_created' => lang('time created'),
! 'lang_view' => lang('view'),
! 'lang_edit' => lang('edit'),
! 'lang_delete' => lang('delete'),
! 'lang_note_id' => lang('note id'),
! 'lang_owner' => lang('owner')
);
***************
*** 284,290 ****
$data = array
(
! 'table_header' => $table_header,
! 'values' => $content,
! 'table_add' => $table_add
);
--- 281,292 ----
$data = array
(
! 'appname' =>
lang('notes'),
! 'function_msg' => lang('list
notes'),
! 'lang_select_category' => lang('select
category'),
! 'cat_list' =>
$this->cats->formatted_xslt_list(array('selected' => $this->cat_id,'globals' =>
True)),
! 'cat_action' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=notes.ui.index'),
! 'table_header' =>
$table_header,
! 'values' =>
$content,
! 'table_add' =>
$table_add
);
***************
*** 296,355 ****
}
- function add()
- {
- global $cat_id, $new_cat, $addnote, $note;
-
- /* if ($GLOBALS['spellcheck'])
- {
- $check_fields = array(
- 'content' => $GLOBALS['note']['content']
- );
-
- $spellcheck =
createobject('phpgwapi.spellcheck');
-
$spellcheck->check('notes.ui.add',$check_fields,array());
-
- return False;
- } */
-
- if ($new_cat)
- {
- $cat_id = $new_cat;
- }
-
- if ($addnote)
- {
- $note['category'] = $cat_id;
-
- $this->bo->save($note);
- // $this->t->set_var('message',lang('Note has been
added for x !',$GLOBALS['phpgw_info']['user']['fullname']));
- $this->cat_id = $cat_id;
- $this->_list();
- return False;
- }
- else
- {
- $this->display_app_header();
-
- $this->t->set_file(array('form' => 'form.tpl'));
- $this->t->set_block('form','add','addhandle');
- $this->t->set_block('form','edit','edithandle');
-
- $this->t->set_var('message','');
- $this->t->set_var('lang_action',lang('Add a
note for'));
-
$this->t->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php','menuaction=notes.ui.add&cat_id='
. $cat_id));
- $this->t->set_var('content',$note['content']);
-
$this->t->set_var('main_cat_list',$this->cats->formated_list('select','all',$cat_id,'True'));
-
- $this->t->set_var('access','<input
type="checkbox" name="note[access]" value="True" checked>');
-
- $this->t->set_var('lang_reset',lang('Clear
Form'));
- $this->t->set_var('lang_add',lang('Add note'));
- $this->t->set_var('edithandle','');
- $this->t->set_var('addhandle','');
- $this->t->pfp('out','form');
- $this->t->pfp('addhandle','add');
- }
- }
-
function edit()
{
--- 298,301 ----
***************
*** 359,363 ****
$this->display_app_header();
!
$this->tpl->add_file(array('form',$GLOBALS['phpgw']->common->get_tpl_dir('notes','default')
. SEP . 'cat_select'));
if ($values['save'])
--- 305,310 ----
$this->display_app_header();
!
$this->tpl->add_file(array('form',$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default')
. SEP . 'app_header',
!
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP .
'cat_select'));
if ($values['save'])
***************
*** 373,385 ****
{
$note = $this->bo->read_single($note_id);
! $this->tpl->set_var('app_header',lang('edit
note'));
}
else
{
! $this->tpl->set_var('app_header',lang('add
note'));
}
$data = array
(
'form_action' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=notes.ui.edit¬e_id=' .
$note_id),
'done_action' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=notes.ui.index'),
--- 320,334 ----
{
$note = $this->bo->read_single($note_id);
! $function_msg = lang('edit note');
}
else
{
! $function_msg = lang('add note');
}
$data = array
(
+ 'appname' =>
lang('notes'),
+ 'function_msg' =>
$function_msg,
'form_action' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=notes.ui.edit¬e_id=' .
$note_id),
'done_action' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=notes.ui.index'),
***************
*** 407,411 ****
}
-
function edit_old()
{
--- 356,359 ----
***************
*** 466,515 ****
function delete()
{
- // delete for xslttemplates
$note_id =
get_var('note_id',array('POST','GET'));
! $values = get_var('values',array('POST'));
! if (!is_array($values))
! {
! if (!$values)
! {
! $values =
get_var('id',array('POST','GET'));
! }
! if ($values > 0)
! {
! $this->tpl->read('notes.delete');
!
$this->tpl->exec('notes.ui.delete','','','',array('id' => $values));
! return;
! }
! }
! elseif ($values['confirm'])
! {
! $this->bo->delete($values['id']);
! }
! $this->index();
! }
! /*function delete($values=0)
! {
! // delete for etemplates
! if (!is_array($values))
{
! if (!$values)
! {
! $values =
get_var('id',array('POST','GET'));
! }
! if ($values > 0)
! {
! $this->tpl->read('notes.delete');
!
$this->tpl->exec('notes.ui.delete','','','',array('id' => $values));
! return;
! }
! }
! elseif ($values['confirm'])
! {
! $this->bo->delete($values['id']);
}
! $this->index();
! } */
function view()
--- 414,451 ----
function delete()
{
$note_id =
get_var('note_id',array('POST','GET'));
! $confirm = get_var('confirm',array('POST'));
! $link_data = array
! (
! 'menuaction' => 'notes.ui.index'
! );
! if (get_var('confirm',array('POST')))
{
! $this->bo->delete($note_id);
! Header('Location: ' .
$GLOBALS['phpgw']->link('/index.php',$link_data));
}
!
! $this->display_app_header();
!
!
$this->tpl->add_file(array($GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default')
. SEP . 'app_delete',
!
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP .
'app_header'));
!
! $data = array
! (
! 'appname' =>
lang('notes'),
! 'function_msg' => lang('delete note'),
! 'done_action' =>
$GLOBALS['phpgw']->link('/index.php',$link_data),
! 'delete_action' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=notes.ui.delete¬e_id=' .
$note_id),
! 'lang_confirm_msg' => lang('do you really
want to delete this entry'),
! 'lang_yes' => lang('yes'),
! 'lang_no' => lang('no')
! );
!
! $this->tpl->set_var('delete',$data);
!
! $this->tpl->pparse();
! }
function view()
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: notes/inc class.bo.inc.php,1.8,1.9 class.so.inc.php,1.7,1.8 class.ui.inc.php,1.25,1.26,
Bettina Gille <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] CVS: notes/setup phpgw_en.lang,1.7,1.8
- Next by Date:
[Phpgroupware-cvs] CVS: phpgwapi/inc class.sessions_db.inc.php,1.13,1.14 class.sessions_php4.inc.php,1.16,1.17
- Previous by thread:
[Phpgroupware-cvs] CVS: notes/setup phpgw_en.lang,1.7,1.8
- Next by thread:
[Phpgroupware-cvs] CVS: phpgwapi/inc class.sessions_db.inc.php,1.13,1.14 class.sessions_php4.inc.php,1.16,1.17
- Index(es):