Author: nathangray
New Revision: 56046
URL: http://svn.stylite.de/viewvc/egroupware?rev=56046&view=rev
Log:
Move resources to new API
Removed:
trunk/resources/inc/class.resources_select_widget.inc.php
trunk/resources/setup/etemplates.inc.php
Modified:
trunk/resources/inc/class.bo_acl.inc.php
trunk/resources/inc/class.resources_bo.inc.php
trunk/resources/inc/class.resources_egw_record.inc.php
trunk/resources/inc/class.resources_export_csv.inc.php
trunk/resources/inc/class.resources_hooks.inc.php
trunk/resources/inc/class.resources_import_csv.inc.php
trunk/resources/inc/class.resources_reserve.inc.php
trunk/resources/inc/class.resources_so.inc.php
trunk/resources/inc/class.resources_tracking.inc.php
trunk/resources/inc/class.resources_ui.inc.php
trunk/resources/inc/class.resources_wizard_export_csv.inc.php
trunk/resources/inc/class.resources_wizard_import_csv.inc.php
trunk/resources/inc/class.ui_acl.inc.php
trunk/resources/setup/default_records.inc.php
trunk/resources/setup/setup.inc.php
trunk/resources/setup/tables_update.inc.php
trunk/resources/sitemgr/class.module_resources_reservation.inc.php
— trunk/resources/inc/class.bo_acl.inc.php (original)
+++ trunk/resources/inc/class.bo_acl.inc.php Thu May 5 22:22:04 2016
@@ -2,11 +2,14 @@
/**
+use EGroupware\Api;
+use EGroupware\Api\Acl;
/**
- ACL business object for resources
@@ -30,7 +33,7 @@
/**
- Instance of categories class for resources
-
-
-
@var egw_cats
*/
var $egw_cats;
@@ -46,7 +49,7 @@
define(‘EGW_ACL_DIRECT_BOOKING’,128);
define(‘EGW_ACL_CALREAD’,256);
@@ -86,7 +89,7 @@
* get list of cats where current user has given rights
*
* @author Cornelius Weiss egw@von-und-zu-weiss.de
-
-
@param int $perm_type one of EGW_ACL_READ, EGW_ACL_ADD, EGW_ACL_EDIT, EGW_ACL_DELETE, EGW_ACL_DIRECT_BOOKING
-
-
@param int $perm_type one of Acl::READ, Acl::ADD, Acl::EDIT, Acl::DELETE, EGW_ACL_DIRECT_BOOKING
-
@param int $parent_id=0 cat_id of parent to return only children of that category
-
@return array cat_id => cat_name
- TODO mark subcats and so on!
@@ -186,7 +189,7 @@
/**
- checks one of the following rights for current user:
-
-
- EGW_ACL_READ, EGW_ACL_ADD, EGW_ACL_EDIT, EGW_ACL_DELETE, EGW_ACL_DIRECT_BOOKING
-
- Acl::READ, Acl::ADD, Acl::EDIT, Acl::DELETE, EGW_ACL_DIRECT_BOOKING
-
-
@param int $cat_id
-
@param int $right
@@ -226,12 +229,12 @@
‘limit’ => $this->limit,
);
if($this->debug) { echo ‘
Read:’; _debug_array($data); }
-
Api\Cache::setSession('resources_acl', 'session_data', $data);
}
function read_sessiondata()
{
@@ -258,8 +261,8 @@
{
$account_id = $account[‘account_id’];
$rights = false;
-
$rights = in_array($account_id,$readcat) ? ($rights | EGW_ACL_READ) : false;
-
$rights = in_array($account_id,$writecat) ? ($rights | EGW_ACL_READ | EGW_ACL_ADD | EGW_ACL_EDIT | EGW_ACL_DELETE): $rights;
-
$rights = in_array($account_id,$readcat) ? ($rights | Acl::READ) : false;
-
$rights = in_array($account_id,$writecat) ? ($rights | Acl::READ | Acl::ADD | Acl::EDIT | Acl::DELETE): $rights;
$rights = in_array($account_id,$calreadcat) ? ($rights | EGW_ACL_CALREAD) : $rights;
$rights = in_array($account_id,$calbookcat) ? ($rights | EGW_ACL_DIRECT_BOOKING | EGW_ACL_CALREAD) : $rights;
$rights = in_array($account_id,$admincat) ? ($rights = 511) : $rights;
— trunk/resources/inc/class.resources_bo.inc.php (original)
+++ trunk/resources/inc/class.resources_bo.inc.php Thu May 5 22:22:04 2016
@@ -10,6 +10,11 @@
+use EGroupware\Api;
+use EGroupware\Api\Link;
+use EGroupware\Api\Egw;
+use EGroupware\Api\Acl;
+use EGroupware\Api\Vfs;
/**
- General business object for resources
@@ -29,13 +34,13 @@
/
var $so;
/*
-
- Instance of resources acl class
-
- Instance of resources Acl class
-
-
@var bo_acl
/
var $acl;
/*
-
- Instance of categories class for resources
-
- Instance of Api\Categories class for resources
*/
var $cats;
@@ -69,7 +74,7 @@
/**
* Constructor
*
-
-
@param int $user=null account_id of user to use for acl, default current user
-
-
@param int $user=null account_id of user to use for Acl, default current user
*/
function __construct($user=null)
{
@@ -78,9 +83,9 @@
$this->cats = $this->acl->egw_cats;
$this->cal_right_transform = array(
-
EGW_ACL_CALREAD => EGW_ACL_READ,
-
EGW_ACL_DIRECT_BOOKING => EGW_ACL_READ | EGW_ACL_ADD | EGW_ACL_EDIT | EGW_ACL_DELETE,
-
EGW_ACL_CAT_ADMIN => EGW_ACL_READ | EGW_ACL_ADD | EGW_ACL_EDIT | EGW_ACL_DELETE,
-
EGW_ACL_CALREAD => Acl::READ,
-
EGW_ACL_DIRECT_BOOKING => Acl::READ | Acl::ADD | Acl::EDIT | Acl::DELETE,
-
EGW_ACL_CAT_ADMIN => Acl::READ | Acl::ADD | Acl::EDIT | Acl::DELETE,
);
}
@@ -93,11 +98,11 @@
{
if(!$query[‘csv_export’])
{
-
Api\Cache::setSession('resources',$query['store_state'],$query);
//echo "<p>".__METHOD__."() query[filter]=$query[filter], prefs[resources][filter]={$GLOBALS['egw_info']['user']['preferences']['resources']['filter']}</p>\n";
if ($query['filter'] != $GLOBALS['egw_info']['user']['preferences']['resources']['filter'])
{
@@ -147,7 +152,7 @@
if ($query['filter'])
{
@@ -157,7 +162,7 @@
$filter[‘cat_id’] = $query[‘filter’];
}
}
@@ -189,10 +194,10 @@
return $nr;
}
@@ -200,14 +205,14 @@
{
$resource[‘class’] .= 'deleted ';
}
@@ -266,7 +271,7 @@
$rows[$num][‘admin’] = $this->acl->get_cat_admin($resource[‘cat_id’]);
}
@@ -286,7 +291,7 @@
{
return null; // not found
}
@@ -302,7 +307,7 @@
*/
function save($resource)
{
@@ -311,13 +316,13 @@
if(!$resource[‘res_id’])
{
$resource[‘res_owner’] = $GLOBALS[‘egw_info’][‘user’][‘account_id’];
@@ -360,7 +365,7 @@
// Check for restore of deleted, restore held links
if($old && $old[‘deleted’] && !$resource[‘deleted’])
{
@@ -370,22 +375,22 @@
}
// Update link title
-
egw_link::unlink(0,'resources',$resource['res_id'],'','resources',$old['accessory_of']);
-
Link::unlink(0,'resources',$resource['res_id'],'','resources',$old['accessory_of']);
// Check for resource changing to accessory - move its accessories to resource
if($old['accessory_of'] == -1 && $accessories = $this->get_acc_list($resource['res_id']))
{
foreach($accessories as $accessory => $name)
{
-
egw_link::unlink(0,'resources',$accessory,'','resources',$resource['res_id']);
-
Link::unlink(0,'resources',$accessory,'','resources',$resource['res_id']);
$acc = $this->read($accessory);
$acc['accessory_of'] = -1;
$this->so->save($acc);
@@ -394,7 +399,7 @@
}
if($resource[‘accessory_of’] != -1)
{
-
Link::link('resources',$resource['res_id'],'resources',$resource['accessory_of']);
}
if(!empty($resource['res_id']) && $this->so->get_value("cat_id",$resource['res_id']) != $resource['cat_id'] && $resource['accessory_of'] == -1)
@@ -432,19 +437,19 @@
*/
function delete($res_id)
{
-
if(!$this->acl->is_permitted($this->so->get_value('cat_id',$res_id),Acl::DELETE))
{
return lang('You are not permitted to delete this resource!');
}
// check if we only mark resources as deleted, or really delete them
$old = $this->read($res_id);
-
egw_link::unlink(0,'resources',$res_id,'','','',true);
-
Link::unlink(0,'resources',$res_id,'','','',true);
$accessories = $this->get_acc_list($res_id);
foreach($accessories as $acc_id => $name)
{
@@ -454,7 +459,7 @@
{
$acc[‘deleted’] = time();
$this->save($acc);
-
egw_link::unlink(0,'resources',$acc_id,'','','',true);
-
Link::unlink(0,'resources',$acc_id,'','','',true);
}
}
return false;
@@ -472,7 +477,7 @@
}
};
$this->remove_picture($res_id);
-
Link::unlink(0,'resources',$res_id);
// delete the resource from the calendar
ExecMethod('calendar.calendar_so.deleteaccount','r'.$res_id);
return false;
@@ -533,7 +538,7 @@
$resource[‘responsible’] = $this->acl->get_cat_admin($resource[‘cat_id’]);
// preseed the cache
-
Link::set_cache('resources',$resource['res_id'],$t=$this->link_title($resource));
}
return $data;
}
@@ -577,13 +582,13 @@
$only_keys = ‘res_id,name,short_description,bookable,useable’;
// If no read access to any category, just stop
@@ -610,11 +615,11 @@
{
$this->bocal = new calendar_bo();
}
@@ -717,7 +722,7 @@
{
if (!($resource = $this->read(array(‘res_id’ => $resource)))) return $resource;
}
@@ -748,7 +753,7 @@
$titles[$resource[‘res_id’]] = $this->link_title($resource);
}
}
@@ -790,7 +795,7 @@
imagejpeg($src_img,$tmp_name);
imagedestroy($src_img);
-
Link::attach_file('resources',$resouce_id,array(
'tmp_name' => $tmp_name,
'name' => self::PICTURE_NAME,
'type' => 'image/jpeg',
@@ -811,22 +816,21 @@
switch($resource[‘picture_src’])
{
case ‘own_src’:
-
$picture = Link::vfs_path('resources',$resource['res_id'],self::PICTURE_NAME,true); // vfs path
if ($fullsize)
{
@@ -851,7 +855,7 @@
*/
function remove_picture($res_id)
{
— trunk/resources/inc/class.resources_egw_record.inc.php (original)
+++ trunk/resources/inc/class.resources_egw_record.inc.php Thu May 5 22:22:04 2016
@@ -22,8 +22,8 @@
private $record = array();
static $types = array(
— trunk/resources/inc/class.resources_export_csv.inc.php (original)
+++ trunk/resources/inc/class.resources_export_csv.inc.php Thu May 5 22:22:04 2016
@@ -11,6 +11,9 @@
+use EGroupware\Api;
+use EGroupware\Api\Acl;
+
/**
- export resources to CSV
*/
@@ -34,7 +37,7 @@
$selection = array();
if ($options[‘selection’] == ‘search’) {
// ui selection with checkbox ‘selected’
@@ -83,7 +86,7 @@
// Check if we need to load the custom fields
$need_custom = false;
@@ -179,7 +182,7 @@
// In resources, not all categories are used
$filters[‘cat_id’][‘type’] = ‘select’;
$filters[‘cat_id’][‘name’] = ‘filter’;
— trunk/resources/inc/class.resources_hooks.inc.php (original)
+++ trunk/resources/inc/class.resources_hooks.inc.php Thu May 5 22:22:04 2016
@@ -10,6 +10,11 @@
+use EGroupware\Api;
+use EGroupware\Api\Framework;
+use EGroupware\Api\Egw;
+use EGroupware\Api\Acl;
+
/**
- General hook object for resources
- It encapsulats all the diffent hook methods
@@ -27,17 +32,17 @@
if ($location == ‘sidebox_menu’)
{
// Magic etemplate2 favorites menu (from nextmatch widget)
-
display_sidebox($appname, lang('Favorites'), egw_framework::favorite_list($appname, 'nextmatch-resources.show.rows-favorite'));
-
display_sidebox($appname, lang('Favorites'), Framework\Favorites::list_favorites($appname, 'nextmatch-resources.show.rows-favorite'));
$title = $GLOBALS['egw_info']['apps']['resources']['title'].' '.lang('Menu');
$file = array(
-
'Resources list' => Egw::link('/index.php',array(
'menuaction' => 'resources.resources_ui.index',
'ajax' => 'true')),
);
-
if($this->acl->get_cats(EGW_ACL_ADD))
-
{
-
$file['Add resource'] = "javascript:egw_openWindowCentered2('".egw::link('/index.php',array(
-
if($this->acl->get_cats(Acl::ADD))
-
{
-
$file['Add resource'] = "javascript:egw_openWindowCentered2('".Egw::link('/index.php',array(
'menuaction' => 'resources.resources_ui.edit',
'accessory_of' => -1
),false)."','_blank',800,600,'yes')";
@@ -48,12 +53,12 @@
if ($GLOBALS[‘egw_info’][‘user’][‘apps’][‘admin’])
{
$file = Array(
-
'Site Configuration' => egw::link('/index.php','menuaction=admin.admin_config.index&appname=' . $appname.'&ajax=true'),
-
'Global Categories' => egw::link('/index.php',array(
-
'Site Configuration' => Egw::link('/index.php','menuaction=admin.admin_config.index&appname=' . $appname.'&ajax=true'),
-
'Global Categories' => Egw::link('/index.php',array(
'menuaction' => 'admin.admin_categories.index',
'appname' => $appname,
'global_cats'=> true)),
-
'Configure Access Permissions' => Egw::link('/index.php',
'menuaction=resources.ui_acl.acllist'),
'Custom Fields'=>egw::link('/index.php',
'menuaction=admin.customfields.index&appname=resources'),
@@ -112,14 +117,14 @@
*/
function delete_category($args)
{
@@ -214,7 +219,7 @@
}
/**
-
- Hook to tell framework we use only global categories (return link data in that case and false otherwise)
-
- Hook to tell framework we use only global Api\Categories (return link data in that case and false otherwise)
-
-
@param string|array $data hook-data or location
-
@return boolean|array
— trunk/resources/inc/class.resources_import_csv.inc.php (original)
+++ trunk/resources/inc/class.resources_import_csv.inc.php Thu May 5 22:22:04 2016
@@ -11,6 +11,7 @@
+use EGroupware\Api;
/**
- class to import resources from CSV
@@ -191,7 +192,7 @@
}
}
default:
— trunk/resources/inc/class.resources_reserve.inc.php (original)
+++ trunk/resources/inc/class.resources_reserve.inc.php Thu May 5 22:22:04 2016
@@ -10,6 +10,10 @@
+use EGroupware\Api;
+use EGroupware\Api\Link;
+use EGroupware\Api\Framework;
+
class resources_reserve {
public function __construct() {
@@ -22,7 +26,7 @@
*/
public function book($content = array(), $arguments = array())
{
@@ -32,11 +36,11 @@
$register_code = ($_GET[‘confirm’] && preg_match(’/^[0-9a-f]{32}$/’,$_GET[‘confirm’])) ? $_GET[‘confirm’] : false;
if($register_code && $registration = registration_bo::confirm($register_code)) {
// Get calendar through link
@@ -50,7 +54,7 @@
‘quantity’ => 0
);
calendar_so::split_status($data[‘participant_types’][‘r’][$content[‘resource’]], $content[‘quantity’],$role);
@@ -83,7 +87,7 @@
// Use sitemgr’s default appointment length
if($GLOBALS[‘egw_info’][‘user’][‘account_lid’] != $GLOBALS[‘sitemgr_info’][‘anonymous_user’])
{
@@ -93,7 +97,7 @@
}
$end_time = $start_time + $duration;
@@ -104,14 +108,14 @@
$content[‘private’] = 0; // in case default_private is set
}
@@ -129,7 +133,7 @@
if($contact) {
// Make event
$event = array(
-
'title' => Link::title('addressbook', $contact_id),
'start' => $start_time,
'end' => $end_time,
'participants' => array(
@@ -160,7 +164,7 @@
$data += $content;
$data[‘msg’] = lang(‘Please choose a different time:’)."\n";
foreach($freetime as $slot) {
@@ -175,21 +179,21 @@
if(is_numeric($reg_id))
{
// Link to event
-
Link::link('registration', $reg_id, 'calendar', $result);
$reg = registration_bo::read($reg_id);
// Send email
$email_info = $config + array(
'title' => $data['name'],
-
'subject' => $data['name'] . ' ' . Api\DateTime::to($start_time),
'link' => $preserve['link'],
);
if($preserve['email_message'])
{
$email_info['message'] = lang($preserve['email_message'],
@@ -219,7 +223,7 @@
// Use sitemgr’s default appointment length
if($GLOBALS[‘egw_info’][‘user’][‘account_lid’] != $GLOBALS[‘sitemgr_info’][‘anonymous_user’])
{
@@ -263,7 +267,7 @@
}
public function ajax_update_planner($resource_id, $date) {
-
$response = Api\Json\Response::get();
$response->assign('exec[planner_div]','innerHTML',$this->get_planner(
$resource_id,
strtotime('yesterday',$date),
@@ -314,7 +318,7 @@
public function confirm($registration)
{
// Get calendar through link
-
$links = Link::get_links('registration', $registration['reg_id'],'calendar');
$bo = new calendar_boupdate();
$event = $bo->read(current($links));
if($registration['status'] == registration_bo::CONFIRMED)
— trunk/resources/inc/class.resources_so.inc.php (original)
+++ trunk/resources/inc/class.resources_so.inc.php Thu May 5 22:22:04 2016
@@ -10,13 +10,15 @@
+use EGroupware\Api;
+
/**
- General storage object for resources
-
-
@author Cornelius Weiss egw@von-und-zu-weiss.de
-
@package resources
*/
-class resources_so extends so_sql_cf
+class resources_so extends Api\Storage
{
function __construct()
{
— trunk/resources/inc/class.resources_tracking.inc.php (original)
+++ trunk/resources/inc/class.resources_tracking.inc.php Thu May 5 22:22:04 2016
@@ -6,17 +6,18 @@
-
@copyright 2012 Nathan Gray
-
@package resources
-
@sub-package history
+use EGroupware\Api;
/**
- Resources - tracking object for history
*/
-class resources_tracking extends bo_tracking
+class resources_tracking extends Api\Storage\Tracking
{
— trunk/resources/inc/class.resources_ui.inc.php (original)
+++ trunk/resources/inc/class.resources_ui.inc.php Thu May 5 22:22:04 2016
@@ -9,6 +9,12 @@
+use EGroupware\Api;
+use EGroupware\Api\Link;
+use EGroupware\Api\Framework;
+use EGroupware\Api\Acl;
+use EGroupware\Api\Etemplate;
/**
- General userinterface object for resources
@@ -31,7 +37,7 @@
function __construct()
{
// print_r($GLOBALS[‘egw_info’]); die();
// $this->calui = CreateObject(‘resources.ui_calviews’);
}
@@ -49,7 +55,7 @@
{
$sessiondata = $content[‘nm’];
unset($sessiondata[‘rows’]);
@@ -72,7 +78,7 @@
if(isset($row[‘view_acc’]))
{
$sessiondata[‘filter2’] = array_search(‘pressed’,$row[‘view_acc’]);
@@ -116,19 +122,19 @@
$content[‘nm’][‘row_id’] = ‘res_id’;
$content[‘nm’][‘favorites’] = true;
@@ -146,14 +152,14 @@
// check if user is permitted to add resources
// If they can't read any categories, they won't be able to save it
@@ -169,7 +175,7 @@
$options = array();
-
Api\Cache::setSession('resources', 'index_nm', $content['nm']);
$this->tmpl->read('resources.show');
return $this->tmpl->exec('resources.resources_ui.index',$content,$sel_options,$no_button,$preserv);
}
@@ -187,14 +193,14 @@
‘caption’ => ‘open’,
‘allowOnMultiple’ => false,
‘url’ => ‘menuaction=resources.resources_ui.edit&res_id=$id’,
-
'popup' => Link::get_registry('resources', 'add_popup'),
'group' => $group=1,
'disableClass' => 'rowNoEdit',
),
'add' => array(
'caption' => 'New resource',
'url' => 'menuaction=resources.resources_ui.edit&accessory_of=-1',
-
'popup' => Link::get_registry('resources', 'add_popup'),
'group' => $group,
'hideOnMobile' => true
),
@@ -211,7 +217,7 @@
‘icon’ => ‘new’,
‘group’ => $group,
‘url’ => ‘menuaction=resources.resources_ui.edit&res_id=0&accessory_of=$id’,
-
'popup' => Link::get_registry('resources', 'add_popup'),
'disableClass' => 'no_new_accessory',
'allowOnMultiple' => false
),
@@ -458,16 +464,16 @@
break;
}
}
-
egw_framework::refresh_opener($msg, 'resources',$content['res_id'],($button == 'delete'?'delete':'edit'));
-
Framework::refresh_opener($msg, 'resources',$content['res_id'],($button == 'delete'?'delete':'edit'));
if($button != 'apply')
{
-
egw_framework::window_close();
-
}
-
-
}
-
-
$nm_session_data = $GLOBALS['egw']->session->appsession('session_data','resources_index_nm');
-
Framework::window_close();
-
}
-
-
}
-
-
$nm_session_data = Api\Cache::getSession('resources', 'index_nm');
$res_id = is_numeric($content) ? (int)$content : $content['res_id'];
if (isset($_GET['res_id'])) $res_id = $_GET['res_id'];
if (isset($nm_session_data['filter2']) && $nm_session_data['filter2'] > 0) $accessory_of = $nm_session_data['filter2'];
@@ -520,7 +526,7 @@
$sel_options[‘status’] = resources_bo::$field2label;
//$sel_options['gen_src_list'] = $this->bo->get_genpicturelist();
@@ -545,12 +551,12 @@
// Permissions
$read_only = array();
-
$config = config::read('resources');
-
if(!$this->bo->acl->is_permitted($content['cat_id'],EGW_ACL_DELETE) ||
-
$config = Api\Config::read('resources');
-
if(!$this->bo->acl->is_permitted($content['cat_id'],Acl::DELETE) ||
($content['deleted'] && !$GLOBALS['egw_info']['user']['apps']['admin'] && $config['history'] == 'history'))
{
$read_only['delete'] = true;
@@ -564,7 +570,7 @@
}
// Disable custom tab if there are no custom fields defined
— trunk/resources/inc/class.resources_wizard_export_csv.inc.php (original)
+++ trunk/resources/inc/class.resources_wizard_export_csv.inc.php Thu May 5 22:22:04 2016
@@ -9,6 +9,8 @@
-
@author Nathan Gray
-
@version $Id$
*/
+use EGroupware\Api;
class resources_wizard_export_csv extends importexport_wizard_basic_export_csv
{
@@ -23,7 +25,7 @@
unset($this->export_fields[‘prize’]);
// Custom fields
— trunk/resources/inc/class.resources_wizard_import_csv.inc.php (original)
+++ trunk/resources/inc/class.resources_wizard_import_csv.inc.php Thu May 5 22:22:04 2016
@@ -9,6 +9,8 @@
-
@author Nathan Gray
-
@version $Id$
*/
+use EGroupware\Api;
class resources_wizard_import_csv extends importexport_wizard_basic_import_csv
{
@@ -44,7 +46,7 @@
‘accessory_of’ => lang(‘Accessory of’)
);
— trunk/resources/inc/class.ui_acl.inc.php (original)
+++ trunk/resources/inc/class.ui_acl.inc.php Thu May 5 22:22:04 2016
@@ -2,11 +2,15 @@
/**
+use EGroupware\Api;
+use EGroupware\Api\Egw;
+use EGroupware\Api\Acl;
/**
@@ -59,7 +63,7 @@
$this->bo->set_rights($cat_id,$_POST[‘inputread’][$cat_id],$_POST[‘inputwrite’][$cat_id],
$_POST[‘inputcalread’][$cat_id],$_POST[‘inputcalbook’][$cat_id],$_POST[‘inputadmin’][$cat_id]);
}
-
config::save_value('location_cats', implode(',', $_POST['location_cats']), 'resources');
-
Api\Config::save_value('location_cats', implode(',', $_POST['location_cats']), 'resources');
}
$template =& CreateObject('phpgwapi.Template',EGW_APP_TPL);
$template->set_file(array('acl' => 'acl.tpl'));
@@ -95,7 +99,7 @@
if ($this->bo->cats)
{
@@ -106,11 +110,11 @@
‘tr_color’ => $tr_color,
‘catname’ => $cat[‘name’],
‘catid’ => $cat[‘id’],
-
'read' => $this->selectlist(EGW_ACL_READ),
-
'write' => $this->selectlist(EGW_ACL_ADD),
-
'read' => $this->selectlist(Acl::READ),
-
'write' => $this->selectlist(Acl::ADD),
'calread' => $this->selectlist(EGW_ACL_CALREAD),
'calbook' =>$this->selectlist(EGW_ACL_DIRECT_BOOKING),
-
'admin' => '<option value="" selected="1">'.lang('choose Api\Categories admin').'</option>'.$this->selectlist(EGW_ACL_CAT_ADMIN,true),
'location_checked' => in_array($cat['id'], $location_cats) ? 'checked="1"' : '',
));
$template->parse('Cblock','cat_list',True);
@@ -167,7 +171,7 @@
{
$selectlist .= ’ selected=“selected”’;
}
-
$selectlist .= '>' . Api\Accounts::format_username($account['account_lid'],$account['account_firstname'],
$account['account_lastname'],$account['account_id']) . '</option>' . "\n";
}
return $selectlist;
@@ -200,6 +204,6 @@
function deny()
{
echo ‘
’.lang(‘Access not permitted’).’’;
— trunk/resources/setup/default_records.inc.php (original)
+++ trunk/resources/setup/default_records.inc.php Thu May 5 22:22:04 2016
@@ -9,14 +9,16 @@
+use EGroupware\Api;
+
$resources_table_prefix = ‘egw_resources’;
// Add a general category for resources
-$GLOBALS[‘egw_setup’]->db->insert($GLOBALS[‘egw_setup’]->cats_table,array(‘cat_parent’ => 0, ‘cat_owner’ => categories::GLOBAL_ACCOUNT,‘cat_access’ => ‘public’,‘cat_appname’ => ‘resources’,‘cat_name’ => ‘General resources’,‘cat_description’ => ‘This category has been added by setup’,‘last_mod’ => time()),false,LINE,FILE);
+$GLOBALS[‘egw_setup’]->db->insert($GLOBALS[‘egw_setup’]->cats_table,array(‘cat_parent’ => 0, ‘cat_owner’ => Api\Categories::GLOBAL_ACCOUNT,‘cat_access’ => ‘public’,‘cat_appname’ => ‘resources’,‘cat_name’ => ‘General resources’,‘cat_description’ => ‘This category has been added by setup’,‘last_mod’ => time()),false,LINE,FILE);
$cat_id = $GLOBALS[‘egw_setup’]->db->get_last_insert_id($GLOBALS[‘egw_setup’]->cats_table,‘cat_id’);
-$GLOBALS[‘egw_setup’]->db->insert($GLOBALS[‘egw_setup’]->cats_table,array(‘cat_parent’ => 0, ‘cat_owner’ => categories::GLOBAL_ACCOUNT,‘cat_access’ => ‘public’,‘cat_appname’ => ‘resources’,‘cat_name’ => ‘Locations’,‘cat_description’ => ‘This category has been added by setup’,‘last_mod’ => time()),false,LINE,FILE);
+$GLOBALS[‘egw_setup’]->db->insert($GLOBALS[‘egw_setup’]->cats_table,array(‘cat_parent’ => 0, ‘cat_owner’ => Api\Categories::GLOBAL_ACCOUNT,‘cat_access’ => ‘public’,‘cat_appname’ => ‘resources’,‘cat_name’ => ‘Locations’,‘cat_description’ => ‘This category has been added by setup’,‘last_mod’ => time()),false,LINE,FILE);
$locations_cat_id = $GLOBALS[‘egw_setup’]->db->get_last_insert_id($GLOBALS[‘egw_setup’]->cats_table,‘cat_id’);
-config::save_value(‘location_cats’, $location