2005-02-23 12:48:59 +01:00
|
|
|
|
<?php
|
|
|
|
|
/**************************************************************************\
|
2005-02-25 12:35:51 +01:00
|
|
|
|
* eGroupWare - resources hooks *
|
2005-02-23 12:48:59 +01:00
|
|
|
|
* http://www.eGroupWare.org *
|
|
|
|
|
* Originally written by Ralf Becker <RalfBecker@outdoor-training.de> *
|
2005-06-11 14:59:11 +02:00
|
|
|
|
* Changes for resources by Cornelius Wei<EFBFBD><egw@von-und-zu-weiss.de> *
|
2005-02-23 12:48:59 +01:00
|
|
|
|
* *
|
|
|
|
|
* ------------------------------------------------------- *
|
|
|
|
|
* 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$ */
|
|
|
|
|
|
2005-02-25 12:35:51 +01:00
|
|
|
|
class resources_hooks
|
2005-02-23 12:48:59 +01:00
|
|
|
|
{
|
2005-02-25 12:35:51 +01:00
|
|
|
|
function admin_prefs_sidebox($args)
|
2005-02-23 12:48:59 +01:00
|
|
|
|
{
|
|
|
|
|
$appname = 'resources';
|
|
|
|
|
$location = is_array($args) ? $args['location'] : $args;
|
2005-06-12 15:14:46 +02:00
|
|
|
|
|
2005-02-23 12:48:59 +01:00
|
|
|
|
if ($location == 'sidebox_menu')
|
|
|
|
|
{
|
2005-06-12 15:14:46 +02:00
|
|
|
|
$title = $GLOBALS['egw_info']['apps']['resources']['title'].' '.lang('Menu');
|
|
|
|
|
$file[] = array(
|
|
|
|
|
'text' => lang('resources list'),
|
|
|
|
|
'no_lang' => true,
|
|
|
|
|
'link' => $GLOBALS['egw']->link('/index.php',array('menuaction' => 'resources.ui_resources.index' )),
|
|
|
|
|
// 'icon' =>
|
|
|
|
|
);
|
|
|
|
|
$file[] = array(
|
|
|
|
|
'text' => '<a class="textSidebox" href="'.$GLOBALS['egw']->link('/index.php',array('menuaction' => 'resources.ui_resources.edit')).
|
|
|
|
|
'" onclick="window.open(this.href,\'_blank\',\'dependent=yes,width=800,height=600,scrollbars=yes,status=yes\');
|
|
|
|
|
return false;">'.lang('add resource').'</a>',
|
|
|
|
|
'no_lang' => true,
|
|
|
|
|
'link' => false
|
2005-02-23 12:48:59 +01:00
|
|
|
|
);
|
2005-06-18 10:00:03 +02:00
|
|
|
|
// $file[] = array(
|
|
|
|
|
// 'text' => lang('planer'),
|
|
|
|
|
// 'no_lang' => true,
|
|
|
|
|
// 'link' => $GLOBALS['egw']->link('/index.php',array('menuaction' => 'resources.ui_calviews.planer' )),
|
|
|
|
|
// 'icon' =>
|
|
|
|
|
// );
|
2005-06-12 15:14:46 +02:00
|
|
|
|
display_sidebox($appname,$title,$file);
|
2005-02-23 12:48:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
2005-06-10 22:40:57 +02:00
|
|
|
|
/* if ($GLOBALS['egw_info']['user']['apps']['preferences'] && $location != 'admin')
|
2005-02-23 12:48:59 +01:00
|
|
|
|
{
|
|
|
|
|
$file = array(
|
2005-06-10 22:40:57 +02:00
|
|
|
|
'Preferences' => $GLOBALS['egw']->link('/preferences/preferences.php','appname='.$appname),
|
|
|
|
|
'Grant Access' => $GLOBALS['egw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app='.$appname),
|
|
|
|
|
'Edit Categories' => $GLOBALS['egw']->link('/index.php','menuaction=preferences.uicategories.index&cats_app=' . $appname . '&cats_level=True&global_cats=True')
|
2005-02-23 12:48:59 +01:00
|
|
|
|
);
|
|
|
|
|
if ($location == 'preferences')
|
|
|
|
|
{
|
|
|
|
|
display_section($appname,$file);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
display_sidebox($appname,lang('Preferences'),$file);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
*/
|
2005-06-10 22:40:57 +02:00
|
|
|
|
if ($GLOBALS['egw_info']['user']['apps']['admin'] && $location != 'preferences')
|
2005-02-23 12:48:59 +01:00
|
|
|
|
{
|
|
|
|
|
$file = Array(
|
2005-06-10 22:40:57 +02:00
|
|
|
|
'Site configuration' => $GLOBALS['egw']->link('/index.php',array(
|
2005-02-23 12:48:59 +01:00
|
|
|
|
'menuaction' => 'resources.ui_resources.admin' )),
|
2005-06-10 22:40:57 +02:00
|
|
|
|
'Global Categories' => $GLOBALS['egw']->link('/index.php',array(
|
2005-02-23 12:48:59 +01:00
|
|
|
|
'menuaction' => 'admin.uicategories.index',
|
|
|
|
|
'appname' => $appname,
|
|
|
|
|
'global_cats'=> True)),
|
2005-06-10 22:40:57 +02:00
|
|
|
|
'Configure Access Permissions' => $GLOBALS['egw']->link('/index.php',
|
2005-02-23 12:48:59 +01:00
|
|
|
|
'menuaction=resources.ui_acl.acllist')
|
2005-06-10 22:40:57 +02:00
|
|
|
|
// 'Custom fields, typ and status' => $GLOBALS['egw']->link('/index.php',array(
|
2005-02-23 12:48:59 +01:00
|
|
|
|
// 'menuaction' => 'infolog.uicustomfields.edit')),
|
2005-06-10 22:40:57 +02:00
|
|
|
|
// 'CSV-Import' => $GLOBALS['egw']->link('/infolog/csv_import.php')
|
2005-02-23 12:48:59 +01:00
|
|
|
|
);
|
|
|
|
|
if ($location == 'admin')
|
|
|
|
|
{
|
|
|
|
|
display_section($appname,$file);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
display_sidebox($appname,lang('Admin'),$file);
|
|
|
|
|
}
|
|
|
|
|
}
|
2005-02-25 09:55:37 +01:00
|
|
|
|
}
|
|
|
|
|
function search_link($args)
|
|
|
|
|
{
|
2005-06-12 11:56:49 +02:00
|
|
|
|
return array(
|
|
|
|
|
'query' => 'resources.bo_resources.link_query',
|
|
|
|
|
'title' => 'resources.bo_resources.link_title',
|
|
|
|
|
'view' => array('menuaction' => 'resources.ui_resources.show'),
|
|
|
|
|
'view_id' => 'id'
|
2005-02-25 12:15:27 +01:00
|
|
|
|
);
|
2005-02-23 12:48:59 +01:00
|
|
|
|
}
|
2005-06-11 14:59:11 +02:00
|
|
|
|
|
2005-06-12 09:15:13 +02:00
|
|
|
|
function calendar_resources($args)
|
2005-06-11 14:59:11 +02:00
|
|
|
|
{
|
2005-06-11 21:28:57 +02:00
|
|
|
|
return array(
|
2005-06-15 11:10:19 +02:00
|
|
|
|
'widget' => 'resources_select', // widget to use for the selection of resources
|
|
|
|
|
'info' => 'resources.bo_resources.get_calendar_info', // info method, returns array with id, type & name for a given id
|
|
|
|
|
'max_quantity' => 'useable', // if set, key for max. quantity in array returned by info method
|
|
|
|
|
'new_status' => 'resources.bo_resources.get_calendar_new_status', // method returning the status for new items, else 'U' is used
|
|
|
|
|
'type' => 'r', // one char type-identifiy for this resources
|
2005-06-11 21:28:57 +02:00
|
|
|
|
);
|
2005-06-11 14:59:11 +02:00
|
|
|
|
}
|
2005-02-23 12:48:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
?>
|