[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: admin/inc class.bocategories.inc.php,1.3.2.1,1.3
From: |
Joseph Engo <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: admin/inc class.bocategories.inc.php,1.3.2.1,1.3.2.2 class.uicategories.inc.php,1.6.2.1,1.6.2.2 |
Date: |
Wed, 23 Jan 2002 15:47:05 -0500 |
Update of /cvsroot/phpgroupware/admin/inc
In directory subversions:/tmp/cvs-serv17501/inc
Modified Files:
Tag: Version-0_9_14-branch
class.bocategories.inc.php class.uicategories.inc.php
Log Message:
Created global application level categories
Index: class.bocategories.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/admin/inc/class.bocategories.inc.php,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.2
diff -C2 -r1.3.2.1 -r1.3.2.2
*** class.bocategories.inc.php 13 Jan 2002 23:59:24 -0000 1.3.2.1
--- class.bocategories.inc.php 23 Jan 2002 20:47:03 -0000 1.3.2.2
***************
*** 1,15 ****
<?php
! /**************************************************************************\
! * phpGroupWare - Admin - Global categories *
! * 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$ */
class bocategories
--- 1,16 ----
<?php
!
/**************************************************************************\
! * phpGroupWare - Admin - Global categories
*
! * 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$
! // $Source$
class bocategories
***************
*** 29,33 ****
function bocategories()
{
! $this->cats = CreateObject('phpgwapi.categories');
$this->read_sessiondata();
--- 30,41 ----
function bocategories()
{
! if ($GLOBALS['appname'])
! {
! $this->cats =
CreateObject('phpgwapi.categories',-1);
! }
! else
! {
! $this->cats =
CreateObject('phpgwapi.categories');
! }
$this->read_sessiondata();
***************
*** 93,97 ****
function get_list()
{
! if($this->debug) { echo '<br>querying: "' .
$this->query . '"'; }
return
$this->cats->return_sorted_array($this->start,True,$this->query,$this->sort,$this->order,True);
}
--- 101,108 ----
function get_list()
{
! if ($this->debug)
! {
! echo '<br>querying: "' . $this->query . '"';
! }
return
$this->cats->return_sorted_array($this->start,True,$this->query,$this->sort,$this->order,True);
}
Index: class.uicategories.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/admin/inc/class.uicategories.inc.php,v
retrieving revision 1.6.2.1
retrieving revision 1.6.2.2
diff -C2 -r1.6.2.1 -r1.6.2.2
*** class.uicategories.inc.php 13 Jan 2002 23:59:24 -0000 1.6.2.1
--- class.uicategories.inc.php 23 Jan 2002 20:47:03 -0000 1.6.2.2
***************
*** 1,14 ****
<?php
! /**************************************************************************\
! * phpGroupWare - Admin - Global categories *
! * 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$ */
class uicategories
--- 1,16 ----
<?php
!
/**************************************************************************\
! * phpGroupWare - Admin - Global categories
*
! * 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$
! // $Source$
class uicategories
***************
*** 35,39 ****
{
$this->bo =
CreateObject('admin.bocategories');
! $this->template = $GLOBALS['phpgw']->template;
$this->nextmatchs =
CreateObject('phpgwapi.nextmatchs');
--- 37,41 ----
{
$this->bo =
CreateObject('admin.bocategories');
! $this->template = $GLOBALS['phpgw']->template;
$this->nextmatchs =
CreateObject('phpgwapi.nextmatchs');
***************
*** 43,47 ****
$this->order = $this->bo->order;
$this->cat_id = $this->bo->cat_id;
! if($this->debug) { $this->_debug_sqsof(); }
}
--- 45,61 ----
$this->order = $this->bo->order;
$this->cat_id = $this->bo->cat_id;
! if ($this->debug)
! {
! $this->_debug_sqsof();
! }
!
! if ($GLOBALS['appname'])
! {
! $this->bo->cats->app_name = $GLOBALS['appname'];
! }
! else
! {
! $this->bo->cats->app_name = 'phpgw';
! }
}
***************
*** 103,122 ****
$this->template->set_var('lang_action',lang('Category
list'));
!
$this->template->set_var('add_action',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.add'));
!
$this->template->set_var('title_categories',lang('Global categories'));
$this->template->set_var('query',$this->query);
!
$this->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index'));
$this->template->set_var('doneurl',$GLOBALS['phpgw']->link('/admin/index.php'));
! if(!$start)
{
$start = 0;
}
- $this->bo->cats->app_name = 'phpgw';
$categories = $this->bo->get_list();
! $left =
$this->nextmatchs->left('/index.php',$this->start,$this->bo->cats->total_records,'menuaction=admin.uicategories.index');
! $right =
$this->nextmatchs->right('/index.php',$this->start,$this->bo->cats->total_records,'menuaction=admin.uicategories.index');
$this->template->set_var('left',$left);
$this->template->set_var('right',$right);
--- 117,142 ----
$this->template->set_var('lang_action',lang('Category
list'));
!
$this->template->set_var('add_action',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.add&appname='
. $GLOBALS['appname']));
! if ($GLOBALS['appname'])
! {
!
$this->template->set_var('title_categories',lang('%1 Global
categories',$GLOBALS['phpgw_info']['apps'][$GLOBALS['appname']]['title']));
! }
! else
! {
!
$this->template->set_var('title_categories',lang('Global categories'));
! }
$this->template->set_var('query',$this->query);
!
$this->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index&appname='
. $GLOBALS['appname']));
$this->template->set_var('doneurl',$GLOBALS['phpgw']->link('/admin/index.php'));
! if (!$start)
{
$start = 0;
}
$categories = $this->bo->get_list();
! $left =
$this->nextmatchs->left('/index.php',$this->start,$this->bo->cats->total_records,'menuaction=admin.uicategories.index&appname='
. $GLOBALS['apname']);
! $right =
$this->nextmatchs->right('/index.php',$this->start,$this->bo->cats->total_records,'menuaction=admin.uicategories.index&appname='
. $GLOBALS['apname']);
$this->template->set_var('left',$left);
$this->template->set_var('right',$right);
***************
*** 132,137 ****
$this->template->set_var(tr_color,$tr_color);
! $id = $categories[$i]['id'];
$level = $categories[$i]['level'];
if ($level > 0)
--- 152,158 ----
$this->template->set_var(tr_color,$tr_color);
! $id = $categories[$i]['id'];
$level = $categories[$i]['level'];
+ $owner = $categories[$i]['owner'];
if ($level > 0)
***************
*** 143,163 ****
$descr =
$GLOBALS['phpgw']->strip_html($categories[$i]['description']);
! if (!$descr) { $descr = ' '; }
! if ($level == 0)
{
$name = '<font color="FF0000"><b>' .
$GLOBALS['phpgw']->strip_html($categories[$i]['name']) . '</b></font>';
$descr = '<font color="FF0000"><b>' .
$descr . '</b></font>';
}
! $this->template->set_var(array('name' => $name,
! 'descr' => $descr));
!
$this->template->set_var('add_sub',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.add&cat_parent='
. $id));
$this->template->set_var('lang_sub_entry',lang('Add sub'));
!
$this->template->set_var('edit',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.edit&cat_id='
. $id));
!
$this->template->set_var('lang_edit_entry',lang('Edit'));
!
$this->template->set_var('delete',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.delete&cat_id='
. $id));
!
$this->template->set_var('lang_delete_entry',lang('Delete'));
$this->template->fp('list','cat_list',True);
--- 164,208 ----
$descr =
$GLOBALS['phpgw']->strip_html($categories[$i]['description']);
! if (! $descr)
! {
! $descr = ' ';
! }
! if ($level == 0 && $owner != -1)
{
$name = '<font color="FF0000"><b>' .
$GLOBALS['phpgw']->strip_html($categories[$i]['name']) . '</b></font>';
$descr = '<font color="FF0000"><b>' .
$descr . '</b></font>';
}
+ else
+ {
+ $name =
$GLOBALS['phpgw']->strip_html($categories[$i]['name']);
+ }
! $this->template->set_var(
! array
! (
! 'name' => $name,
! 'descr' => $descr
! )
! );
!
$this->template->set_var('add_sub',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.add&cat_parent='
. $id . '&appname=' . $GLOBALS['appname']));
$this->template->set_var('lang_sub_entry',lang('Add sub'));
!
! if ($GLOBALS['appname'] && $owner == -1)
! {
!
$this->template->set_var('link_edit','<a href="' .
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.edit&cat_id='
. $id . '&appname=' . $GLOBALS['appname']) . '">' . lang('Edit') . '</a>');
!
$this->template->set_var('link_delete','<a href="' .
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.delete&cat_id='
. $id . '&appname=' . $GLOBALS['appname']) . '">' . lang('Delete') . '</a>');
! }
! else if (! $GLOBALS['appname'])
! {
!
$this->template->set_var('link_edit','<a href="' .
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.edit&cat_id='
. $id . '&appname=' . $GLOBALS['appname']) . '">' . lang('Edit') . '</a>');
!
$this->template->set_var('link_delete','<a href="' .
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.delete&cat_id='
. $id . '&appname=' . $GLOBALS['appname']) . '">' . lang('Delete') . '</a>');
! }
! else
! {
!
$this->template->set_var('link_edit',' ');
!
$this->template->set_var('link_delete',' ');
! }
$this->template->fp('list','cat_list',True);
***************
*** 185,189 ****
$this->template->set_block('form','edit','edithandle');
! $this->bo->cats->app_name = 'phpgw';
if ($new_parent)
--- 230,234 ----
$this->template->set_block('form','edit','edithandle');
! $this->bo->cats->appname = 'phpgw';
if ($new_parent)
***************
*** 210,220 ****
{
$this->bo->save_cat($values);
!
$this->template->set_var('message',lang('Category x has been added !',
$cat_name));
}
}
! $this->template->set_var('title_categories',lang('Add
global category'));
!
$this->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.add'));
!
$this->template->set_var('doneurl',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index'));
$this->template->set_var('hidden_vars','<input
type="hidden" name="cat_id" value="' . $this->cat_id . '">');
$this->template->set_var('category_list',$this->bo->formatted_list(array('select'
=> 'select','all' => 'all','cat_parent' => $cat_parent)));
--- 255,272 ----
{
$this->bo->save_cat($values);
!
$this->template->set_var('message',lang('Category %1 has been added !',
$cat_name));
}
}
! if ($GLOBALS['appname'])
! {
!
$this->template->set_var('title_categories',lang('Add global category for
%1',$GLOBALS['phpgw_info']['apps'][$GLOBALS['appname']]['title']));
! }
! else
! {
!
$this->template->set_var('title_categories',lang('Add global category'));
! }
!
$this->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.add'
. '&appname=' . $GLOBALS['appname']));
!
$this->template->set_var('doneurl',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index'
. '&appname=' . $GLOBALS['appname']));
$this->template->set_var('hidden_vars','<input
type="hidden" name="cat_id" value="' . $this->cat_id . '">');
$this->template->set_var('category_list',$this->bo->formatted_list(array('select'
=> 'select','all' => 'all','cat_parent' => $cat_parent)));
***************
*** 232,236 ****
if (!$this->cat_id)
{
! Header('Location: ' .
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index'));
}
--- 284,288 ----
if (!$this->cat_id)
{
! Header('Location: ' .
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index&appname='
. $GLOBALS['appname']));
}
***************
*** 250,254 ****
$this->template->set_block('form','edit','edithandle');
- $this->bo->cats->app_name = 'phpgw';
$hidden_vars = '<input type="hidden" name="cat_id"
value="' . $this->cat_id . '">' . "\n";
--- 302,305 ----
***************
*** 265,270 ****
'id' => $this->cat_id,
'parent' => $cat_parent,
! 'descr' => $cat_description,
! 'name' => $cat_name,
'access' => 'public'
);
--- 316,321 ----
'id' => $this->cat_id,
'parent' => $cat_parent,
! 'descr' => $cat_description,
! 'name' => $cat_name,
'access' => 'public'
);
***************
*** 278,282 ****
{
$this->bo->save_cat($values);
!
$this->template->set_var('message',lang('Category x has been updated
!',$cat_name));
}
}
--- 329,333 ----
{
$this->bo->save_cat($values);
!
$this->template->set_var('message',lang('Category %1 has been updated
!',$cat_name));
}
}
***************
*** 284,291 ****
$cats = $this->bo->cats->return_single($this->cat_id);
! $this->template->set_var('title_categories',lang('Edit
global category'));
!
$this->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.edit'));
!
$this->template->set_var('deleteurl',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.delete&cat_id='
. $this->cat_id));
!
$this->template->set_var('doneurl',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index'));
$this->template->set_var('hidden_vars',$hidden_vars);
--- 335,350 ----
$cats = $this->bo->cats->return_single($this->cat_id);
! if ($GLOBALS['appname'])
! {
!
$this->template->set_var('title_categories',lang('Edit global category for
%1',$GLOBALS['phpgw_info']['apps'][$GLOBALS['appname']]['title']));
! }
! else
! {
!
$this->template->set_var('title_categories',lang('Edit global category'));
! }
!
!
$this->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.edit&appname='
. $GLOBALS['appname']));
!
$this->template->set_var('deleteurl',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.delete&cat_id='
. $this->cat_id . '&appname=' . $GLOBALS['appname']));
!
$this->template->set_var('doneurl',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index&appname='
. $GLOBALS['appname']));
$this->template->set_var('hidden_vars',$hidden_vars);
***************
*** 302,311 ****
function delete()
{
! if (!$this->cat_id)
{
! Header('Location: ' .
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index'));
}
- $this->bo->cats->app_name = 'phpgw';
if ($GLOBALS['HTTP_POST_VARS']['confirm'])
--- 361,369 ----
function delete()
{
! if (! $this->cat_id)
{
! Header('Location: ' .
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index&appname='
. $GLOBALS['appname']));
}
if ($GLOBALS['HTTP_POST_VARS']['confirm'])
***************
*** 319,323 ****
$this->bo->delete($this->cat_id);
}
! Header('Location: ' .
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index'));
}
else
--- 377,381 ----
$this->bo->delete($this->cat_id);
}
! Header('Location: ' .
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index&appname='
. $GLOBALS['appname']));
}
else
***************
*** 329,333 ****
$this->template->set_block('category_delete','done','donehandle');
! $nolink =
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index&cat_id='
. $this->cat_id);
$apps_cats = $this->bo->exists(array(
--- 387,391 ----
$this->template->set_block('category_delete','done','donehandle');
! $nolink =
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index&cat_id='
. $this->cat_id . '&appname=' . $GLOBALS['appname']);
$apps_cats = $this->bo->exists(array(
***************
*** 376,380 ****
$this->template->set_var('nolink',$nolink);
$this->template->set_var('lang_no',lang('No'));
!
$this->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.delete&cat_id='
. $this->cat_id));
$this->template->set_var('lang_yes',lang('Yes'));
$this->template->set_var('deletehandle','');
--- 434,438 ----
$this->template->set_var('nolink',$nolink);
$this->template->set_var('lang_no',lang('No'));
!
$this->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.delete&cat_id='
. $this->cat_id . '&appname=' . $GLOBALS['appname']));
$this->template->set_var('lang_yes',lang('Yes'));
$this->template->set_var('deletehandle','');
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: admin/inc class.bocategories.inc.php,1.3.2.1,1.3.2.2 class.uicategories.inc.php,1.6.2.1,1.6.2.2,
Joseph Engo <address@hidden> <=