update global apps cats to turn on or off showing of global systemwide cats

This commit is contained in:
ceb 2002-03-19 02:35:38 +00:00
parent 8877a87554
commit cef59ed231
4 changed files with 47 additions and 12 deletions

View File

@ -17,7 +17,7 @@
(
'Site Configuration' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname=' . $appname),
'Edit custom fields' => $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uifields.index'),
'Global Categories' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index&appname=' . $appname)
'Global Categories' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index&appname=' . $appname . '&global_cats=True')
);
//Do not modify below this line
display_section($appname,$appname,$file);

View File

@ -97,10 +97,18 @@
}
}
function get_list()
function get_list($global_cats=False)
{
if($this->debug) { echo '<br>querying: "' . $this->query . '"'; }
return $this->cats->return_sorted_array($this->start,True,$this->query,$this->sort,$this->order,True);
if ($global_cats)
{
return $this->cats->return_sorted_array($this->start,True,$this->query,$this->sort,$this->order,True);
}
else
{
return $this->cats->return_sorted_array($this->start,True,$this->query,$this->sort,$this->order);
}
}
function save_cat($values)
@ -124,7 +132,14 @@
function formatted_list($data)
{
return $this->cats->formated_list($data['select'],$data['all'],$data['cat_parent'],True);
if ($data['global_cats'])
{
return $this->cats->formated_list($data['select'],$data['all'],$data['cat_parent'],True);
}
else
{
return $this->cats->formated_list($data['select'],$data['all'],$data['cat_parent']);
}
}
function delete($cat_id,$subs=False)

View File

@ -95,6 +95,8 @@
function index()
{
$global_cats = $GLOBALS['HTTP_POST_VARS']['global_cats'] ? $GLOBALS['HTTP_POST_VARS']['global_cats'] : $GLOBALS['HTTP_GET_VARS']['global_cats'];
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
@ -106,7 +108,8 @@
$link_data = array
(
'menuaction' => 'admin.uicategories.index',
'appname' => $GLOBALS['appname']
'appname' => $GLOBALS['appname'],
'global_cats' => $global_cats
);
$this->template->set_var('lang_action',lang('Category list'));
@ -128,7 +131,12 @@
$start = 0;
}
$categories = $this->bo->get_list();
if (!$global_cats)
{
$global_cats = False;
}
$categories = $this->bo->get_list($global_cats);
$left = $this->nextmatchs->left('/index.php',$this->start,$this->bo->cats->total_records,$link_data);
$right = $this->nextmatchs->right('/index.php',$this->start,$this->bo->cats->total_records,$link_data);
@ -229,10 +237,13 @@
function add()
{
$global_cats = $GLOBALS['HTTP_POST_VARS']['global_cats'] ? $GLOBALS['HTTP_POST_VARS']['global_cats'] : $GLOBALS['HTTP_GET_VARS']['global_cats'];
$link_data = array
(
'menuaction' => 'admin.uicategories.index',
'appname' => $GLOBALS['appname']
'appname' => $GLOBALS['appname'],
'global_cats' => $global_cats
);
$GLOBALS['phpgw']->common->phpgw_header();
@ -291,7 +302,9 @@
$link_data['menuaction'] = 'admin.uicategories.add';
$this->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php',$link_data));
$this->template->set_var('category_list',$this->bo->formatted_list(array('select' => 'select','all' => 'all','cat_parent' => $cat_parent)));
$this->template->set_var('category_list',$this->bo->formatted_list(array('select' => 'select','all' => 'all','cat_parent' => $cat_parent,
'global_cats' => $global_cats)));
$this->template->set_var('cat_name',$cat_name);
$this->template->set_var('cat_description',$cat_description);
@ -303,10 +316,13 @@
function edit()
{
$global_cats = $GLOBALS['HTTP_POST_VARS']['global_cats'] ? $GLOBALS['HTTP_POST_VARS']['global_cats'] : $GLOBALS['HTTP_GET_VARS']['global_cats'];
$link_data = array
(
'menuaction' => 'admin.uicategories.index',
'appname' => $GLOBALS['appname']
'appname' => $GLOBALS['appname'],
'global_cats' => $global_cats
);
if (!$this->cat_id)
@ -380,7 +396,8 @@
$this->template->set_var('cat_name',$GLOBALS['phpgw']->strip_html($cats[0]['name']));
$this->template->set_var('cat_description',$GLOBALS['phpgw']->strip_html($cats[0]['description']));
$this->template->set_var('category_list',$this->bo->formatted_list(array('select' => 'select','all' => 'all', 'cat_parent' => $cats[0]['parent'])));
$this->template->set_var('category_list',$this->bo->formatted_list(array('select' => 'select','all' => 'all','cat_parent' => $cats[0]['parent'],
'global_cats' => $global_cats)));
$this->template->set_var('edithandle','');
$this->template->set_var('addhandle','');
@ -390,10 +407,13 @@
function delete()
{
$global_cats = $GLOBALS['HTTP_POST_VARS']['global_cats'] ? $GLOBALS['HTTP_POST_VARS']['global_cats'] : $GLOBALS['HTTP_GET_VARS']['global_cats'];
$link_data = array
(
'menuaction' => 'admin.uicategories.index',
'appname' => $GLOBALS['appname']
'appname' => $GLOBALS['appname'],
'global_cats' => $global_cats
);
if (!$this->cat_id)

View File

@ -18,7 +18,7 @@
(
'Site Configuration' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname=' . $appname),
'Calendar Holiday Management' => $GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uiholiday.admin'),
'Global categories' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index&appname=' . $appname)
'Global categories' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index&appname=' . $appname . '&global_cats=True')
);
//Do not modify below this line
display_section($appname,$appname,$file);