mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 08:34:29 +01:00
Initial revision
This commit is contained in:
parent
bdd24516b5
commit
b0a51a63c4
146
resources/inc/class.bo_acl.inc.php
Executable file
146
resources/inc/class.bo_acl.inc.php
Executable file
@ -0,0 +1,146 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* eGroupWare - resources *
|
||||
* http://www.egroupware.org *
|
||||
* -------------------------------------------- *
|
||||
* 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. *
|
||||
* -------------------------------------------- *
|
||||
\**************************************************************************/
|
||||
|
||||
|
||||
class bo_acl
|
||||
{
|
||||
/*! @var $permissions Holds alls permissions for resources of user */
|
||||
var $permissions;
|
||||
|
||||
var $acl;
|
||||
var $start = 0;
|
||||
var $query = '';
|
||||
var $sort = '';
|
||||
var $total = 0;
|
||||
var $accounts;
|
||||
var $cats;
|
||||
|
||||
var $debug;
|
||||
var $use_session = False;
|
||||
|
||||
function bo_acl($session=False)
|
||||
{
|
||||
$this->so = CreateObject('resources.so_acl');
|
||||
$this->permissions = $this->so->get_permissions($GLOBALS['phpgw_info']['user']['account_id'],true);
|
||||
|
||||
$this->egw_cats = createobject('phpgwapi.categories');
|
||||
|
||||
$this->accounts = $GLOBALS['phpgw']->accounts->get_list();
|
||||
$this->debug = False;
|
||||
//all this is only needed when called from uiacl. not from ui,
|
||||
if($session)
|
||||
{
|
||||
$this->read_sessiondata();
|
||||
$this->use_session = True;
|
||||
foreach(array('start','query','sort','order') as $var)
|
||||
{
|
||||
if (isset($_POST[$var]))
|
||||
{
|
||||
$this->$var = $_POST[$var];
|
||||
}
|
||||
elseif (isset($_GET[$var]))
|
||||
{
|
||||
$this->$var = $_GET[$var];
|
||||
}
|
||||
}
|
||||
$this->save_sessiondata();
|
||||
$this->cats = $this->egw_cats->return_array('all',$this->start,True,$this->query,$this->sort,'cat_name',True);
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
@function get_readcats
|
||||
@abstract get list of readable cats for current user
|
||||
@author Cornelius Weiß <egw@von-und-zu-weiss.de>
|
||||
@param int $perm_type one of PHPGW_ACL_READ, PHPGW_ACL_ADD, PHPGW_ACL_EDIT, PHPGW_ACL_DELETE
|
||||
@return array cat_name => cat_id
|
||||
TODO mark subcats and so on!
|
||||
*/
|
||||
function get_cats($perm_type)
|
||||
{
|
||||
foreach($this->permissions as $cat_id => $rights)
|
||||
{
|
||||
if(strstr($cat_id,'L') && $rights & $perm_type)
|
||||
{
|
||||
$cat_id = substr($cat_id,1);
|
||||
$readcats[$cat_id] = $this->egw_cats->id2name($cat_id);
|
||||
}
|
||||
}
|
||||
return $readcats;
|
||||
}
|
||||
|
||||
function save_sessiondata()
|
||||
{
|
||||
$data = array(
|
||||
'start' => $this->start,
|
||||
'query' => $this->query,
|
||||
'sort' => $this->sort,
|
||||
'order' => $this->order,
|
||||
'limit' => $this->limit,
|
||||
);
|
||||
if($this->debug) { echo '<br>Read:'; _debug_array($data); }
|
||||
$GLOBALS['phpgw']->session->appsession('session_data','resources_acl',$data);
|
||||
}
|
||||
|
||||
function read_sessiondata()
|
||||
{
|
||||
$data = $GLOBALS['phpgw']->session->appsession('session_data','resources_acl');
|
||||
if($this->debug) { echo '<br>Read:'; _debug_array($data); }
|
||||
|
||||
$this->start = $data['start'];
|
||||
$this->query = $data['query'];
|
||||
$this->sort = $data['sort'];
|
||||
$this->order = $data['order'];
|
||||
$this->limit = $data['limit'];
|
||||
}
|
||||
|
||||
function get_rights($cat_id)
|
||||
{
|
||||
return $this->so->get_rights('L'.$cat_id);
|
||||
}
|
||||
|
||||
function is_permitted($cat_id,$right)
|
||||
{
|
||||
return $this->permissions['L'.$cat_id] & $right;
|
||||
}
|
||||
|
||||
function is_readable($cat_id)
|
||||
{
|
||||
return $this->is_permitted($cat_id,PHPGW_ACL_READ);
|
||||
}
|
||||
|
||||
function is_writeable($cat_id)
|
||||
{
|
||||
return $this->is_permitted($cat_id,PHPGW_ACL_ADD);
|
||||
}
|
||||
|
||||
function set_rights($cat_id,$read,$write)
|
||||
{
|
||||
$readcat = $read ? $read : array();
|
||||
$writecat = $write ? $write : array();
|
||||
|
||||
$this->so->remove_location('L' . $cat_id);
|
||||
reset($this->accounts);
|
||||
while (list($null,$account) = each($this->accounts))
|
||||
{
|
||||
$account_id = $account['account_id'];
|
||||
//write implies read
|
||||
$rights = in_array($account_id,$writecat) ?
|
||||
(PHPGW_ACL_READ | PHPGW_ACL_ADD | PHPGW_ACL_EDIT | PHPGW_ACL_DELETE) :
|
||||
(in_array($account_id,$readcat) ? PHPGW_ACL_READ : False);
|
||||
if ($rights)
|
||||
{
|
||||
$GLOBALS['phpgw']->acl->add_repository('resources','L'.$cat_id,$account_id,$rights);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
115
resources/inc/class.bo_resources.inc.php
Executable file
115
resources/inc/class.bo_resources.inc.php
Executable file
@ -0,0 +1,115 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* eGroupWare - resources - Resource Management System *
|
||||
* http://www.egroupware.org *
|
||||
* Written by Lukas Weiss [ichLukas@gmx.net] and *
|
||||
* Cornelius Weiss [nelius@gmx.net] *
|
||||
* ----------------------------------------------- *
|
||||
* 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. *
|
||||
\**************************************************************************/
|
||||
|
||||
class bo_resources
|
||||
{
|
||||
/*var $public_functions = array
|
||||
(
|
||||
'get_rows' => True
|
||||
);*/
|
||||
|
||||
function bo_resources()
|
||||
{
|
||||
$this->so = CreateObject('resources.so_resources');
|
||||
$this->acl = CreateObject('resources.bo_acl');
|
||||
}
|
||||
|
||||
/*!
|
||||
@function get_rows
|
||||
@abstract get rows for resources list
|
||||
@autor Cornelius Weiß <egw@von-und-zu-weiss.de>
|
||||
*/
|
||||
function get_rows($query,&$rows,&$readonlys)
|
||||
{
|
||||
$query['search'] = $query['search'] ? $query['search'] : '*';
|
||||
|
||||
$criteria = array( 'name' => $query['search'],
|
||||
'short_description' => $query['search']
|
||||
);
|
||||
$cats = $query['filter'] ? array($query['filter'] => '') : $this->acl->get_cats(PHPGW_ACL_READ);
|
||||
|
||||
$rows = array( 0 => array( 'id' => '',
|
||||
'name' => '',
|
||||
'short_description' => '',
|
||||
'useable' => '',
|
||||
'bookable' => '',
|
||||
'cat_id' => '',
|
||||
'location' => ''
|
||||
));
|
||||
|
||||
$order_by = $query['order'] ? $query['order'].' '. $query['sort'] : '';
|
||||
|
||||
$nr = $this->so->search($criteria,$cats,&$rows,$order_by,$offset=$query['start'],$num_rows=0);
|
||||
|
||||
foreach($rows as $num => $resource)
|
||||
{
|
||||
if (!$this->acl->is_permitted($resource['cat_id'],PHPGW_ACL_EDIT))
|
||||
{
|
||||
$readonlys["edit[$resource[id]]"] = true;
|
||||
}
|
||||
if (!$this->acl->is_permitted($resource['cat_id'],PHPGW_ACL_DELETE))
|
||||
{
|
||||
$readonlys["delete[$resource[id]]"] = true;
|
||||
}
|
||||
if (!$resource['bookable'] /* && calender-acl viewable */)
|
||||
{
|
||||
$readonlys["bookable[$resource[id]]"] = true;
|
||||
}
|
||||
}
|
||||
return $nr;
|
||||
}
|
||||
|
||||
/*!
|
||||
@function read
|
||||
@abstract reads a resource exept binary datas
|
||||
@param int $id resource id
|
||||
@return array with key => value or false if not found or allowed
|
||||
*/
|
||||
function read($id)
|
||||
{
|
||||
if(!$this->acl->is_permitted($this->so->get_value('cat_id',$id),PHPGW_ACL_READ))
|
||||
{
|
||||
echo lang('You are not permitted to get information about this resource!') . '<br>';
|
||||
echo lang('Notify your administrator to correct this situation') . '<br>';
|
||||
return false;
|
||||
}
|
||||
return /* all exept pictures(blobs) */$this->so->read($id);
|
||||
}
|
||||
|
||||
function save($content)
|
||||
{
|
||||
return $this->so->save_data($content);
|
||||
}
|
||||
|
||||
function delete($id)
|
||||
{
|
||||
return $this->so->delete(array('id'=>$id));
|
||||
}
|
||||
|
||||
function get_images($params)
|
||||
{
|
||||
$id = implode($params);
|
||||
$picture = $this->so->get_value('picture',$id);
|
||||
if($picture)
|
||||
{
|
||||
// $picture = GD($picture);
|
||||
header('Content-type: image/png');
|
||||
echo $picture;
|
||||
}
|
||||
header('Content-type: image/png');
|
||||
echo file_get_contents(PHPGW_INCLUDE_ROOT.'/contactcenter/templates/default/images/photo.png');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
74
resources/inc/class.so_acl.inc.php
Executable file
74
resources/inc/class.so_acl.inc.php
Executable file
@ -0,0 +1,74 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* eGroupWare - Resources *
|
||||
* http://www.egroupware.org *
|
||||
* -------------------------------------------- *
|
||||
* 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. *
|
||||
* -------------------------------------------- *
|
||||
\**************************************************************************/
|
||||
|
||||
class so_acl
|
||||
{
|
||||
var $db;
|
||||
|
||||
function so_acl()
|
||||
{
|
||||
copyobj($GLOBALS['phpgw']->db,$this->db);
|
||||
}
|
||||
|
||||
function get_rights($location)
|
||||
{
|
||||
$result = array();
|
||||
$sql = "SELECT acl_account, acl_rights from phpgw_acl WHERE acl_appname = 'resources' AND acl_location = '$location'";
|
||||
$this->db->query($sql,__LINE__,__FILE__);
|
||||
while($this->db->next_record())
|
||||
{
|
||||
$result[$this->db->f('acl_account')] = $this->db->f('acl_rights');
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
function remove_location($location)
|
||||
{
|
||||
$sql = "delete from phpgw_acl where acl_appname='resources' and acl_location='$location'";
|
||||
$this->db->query($sql,__LINE__,__FILE__);
|
||||
}
|
||||
|
||||
/*!
|
||||
@function get_permission
|
||||
@abstract gets permissions for resources of user
|
||||
@discussion This function is needed, cause eGW api dosn't provide a usefull function for that topic!
|
||||
@discussion Using api-functions for that, would resault bad performace :-(
|
||||
@autor autor of news_admin ?
|
||||
|
||||
@param int $user user_id we want to get perms for
|
||||
@param bool $inc_groups get rights due to groupmembership of user
|
||||
|
||||
*/
|
||||
function get_permissions($user, $inc_groups)
|
||||
{
|
||||
$groups = $GLOBALS['phpgw']->acl->get_location_list_for_id('phpgw_group', 1, $user);
|
||||
$result = array();
|
||||
$sql = 'SELECT acl_location, acl_rights FROM phpgw_acl ';
|
||||
$sql .= "WHERE acl_appname = 'resources' ";
|
||||
if($inc_groups)
|
||||
{
|
||||
$sql .= 'AND acl_account IN('. (int)$user;
|
||||
$sql .= ($groups ? ',' . implode(',', $groups) : '');
|
||||
$sql .= ')';
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql .= 'AND acl_account ='. (int)$user;
|
||||
}
|
||||
$this->db->query($sql,__LINE__,__FILE__);
|
||||
while ($this->db->next_record())
|
||||
{
|
||||
$result[$this->db->f('acl_location')] |= $this->db->f('acl_rights');
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
113
resources/inc/class.so_resources.inc.php
Executable file
113
resources/inc/class.so_resources.inc.php
Executable file
@ -0,0 +1,113 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* eGroupWare - resources - Resource Management System *
|
||||
* http://www.egroupware.org *
|
||||
* Written by Cornelius Weiss [nelius@gmx.net] *
|
||||
* ----------------------------------------------- *
|
||||
* 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. *
|
||||
\**************************************************************************/
|
||||
|
||||
class so_resources
|
||||
{
|
||||
function so_resources()
|
||||
{
|
||||
$this->db = $GLOBALS['phpgw']->db;
|
||||
$this->rs_table = 'egw_resources';
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
@function search
|
||||
@abstract searches db for rows matching searchcriteria and categories
|
||||
@discussion '*' is replaced with sql-wildcard '%'
|
||||
|
||||
@param array $criteria array of key => value for search. (or'ed together)
|
||||
@param array $cats array of cat_id => cat_name to be searched
|
||||
@param &array $data reference of data array with cols to return in first row ( key => '')
|
||||
@param string $order_by fieldnames + {ASC|DESC} separated by colons ','
|
||||
@param int $offset row to start from, default 0
|
||||
@param int $num_rows number of rows to return (optional), default -1 = all, 0 will use $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs']
|
||||
|
||||
@return int number of matching rows
|
||||
*/
|
||||
function search($criteria,$cats,&$data,$order_by='',$offset=false,$num_rows=-1)
|
||||
{
|
||||
$select = implode(',',array_keys($data[0]));
|
||||
foreach($criteria as $col => $value)
|
||||
{
|
||||
$where .= ($where ? " OR " : " ( " ). $col . ((strstr($value,'*') || strstr($value,'*')) ?
|
||||
" LIKE '" . strtr(str_replace('_','\\_',addslashes($value)),'*?','%_') ."'":
|
||||
"='" .$value."'");
|
||||
}
|
||||
$where .= " ) ";
|
||||
foreach ((array)$cats as $cat_id => $cat_name)
|
||||
{
|
||||
$wherecats .= ($wherecats ? " OR " : " AND ( " ) .'cat_id' . "='".$cat_id."'";
|
||||
}
|
||||
$wherecats .= " ) ";
|
||||
|
||||
$this->db->query( 'SELECT '.$select." FROM ".$this->rs_table." WHERE ".$where.$wherecats.
|
||||
($order_by != '' ? " ORDER BY $order_by" : ''),__LINE__,__FILE__);
|
||||
|
||||
$nr = $this->db->nf();
|
||||
if($offset > 0)
|
||||
{
|
||||
$this->db->seek($offset-1);
|
||||
}
|
||||
if($num_rows==0)
|
||||
{
|
||||
$num_rows = $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
|
||||
}
|
||||
for ($n = 1; $this->db->next_record() && $n!=$num_rows+1; ++$n)
|
||||
{
|
||||
$data[$n] = $this->db->row();
|
||||
}
|
||||
return $nr;
|
||||
}
|
||||
|
||||
/*!
|
||||
@function get_value
|
||||
@abstract gets the value of $key from resource of $id
|
||||
@param string $key key of value to get
|
||||
@param int $id resource id
|
||||
@return mixed value of key and resource, false if key or id not found.
|
||||
*/
|
||||
function get_value($key,$id)
|
||||
{
|
||||
if($this->db->query( "SELECT ". $key . " FROM ".$this->rs_table." WHERE id = ".$id,__LINE__,__FILE__))
|
||||
{
|
||||
$this->db->next_record();
|
||||
(array)$value = $this->db->row();
|
||||
return $value[$key];
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*!
|
||||
@function read
|
||||
@abstract reads a resource exept binary datas
|
||||
@param int $id resource id
|
||||
@return array with key => value or false if not found
|
||||
*/
|
||||
function read($id)
|
||||
{
|
||||
$tabledef = $this->db->metadata($table=$this->rs_table,$full=false);
|
||||
foreach($tabledef as $n => $fielddef)
|
||||
{
|
||||
if(!$fielddef['binary'])
|
||||
{
|
||||
$readfields[$n] = $fielddef['name'];
|
||||
}
|
||||
}
|
||||
|
||||
if($this->db->query( "SELECT ". implode(',',$readfields) . " FROM ".$this->rs_table." WHERE id = ".$id,__LINE__,__FILE__))
|
||||
{
|
||||
$this->db->next_record();
|
||||
return $this->db->row();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
130
resources/inc/class.ui_acl.inc.php
Executable file
130
resources/inc/class.ui_acl.inc.php
Executable file
@ -0,0 +1,130 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* eGroupWare - resources *
|
||||
* http://www.egroupware.org *
|
||||
* -------------------------------------------- *
|
||||
* 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 ui_acl
|
||||
{
|
||||
var $start = 0;
|
||||
var $query = '';
|
||||
var $sort = '';
|
||||
var $order = '';
|
||||
var $bo;
|
||||
var $accounts;
|
||||
var $nextmatchs = '';
|
||||
var $rights;
|
||||
var $public_functions = array(
|
||||
'acllist' => True,
|
||||
);
|
||||
|
||||
function ui_acl()
|
||||
{
|
||||
$this->bo = createobject('resources.bo_acl',True);
|
||||
$this->accounts = $GLOBALS['phpgw']->accounts->get_list();
|
||||
$this->nextmatchs = createobject('phpgwapi.nextmatchs');
|
||||
$this->start = $this->bo->start;
|
||||
$this->query = $this->bo->query;
|
||||
$this->order = $this->bo->order;
|
||||
$this->sort = $this->bo->sort;
|
||||
$this->cat_id = $this->bo->cat_id;
|
||||
}
|
||||
|
||||
function acllist()
|
||||
{
|
||||
if (!$GLOBALS['phpgw']->acl->check('run',1,'admin'))
|
||||
{
|
||||
$this->deny();
|
||||
}
|
||||
|
||||
if ($_POST['btnDone'])
|
||||
{
|
||||
$GLOBALS['phpgw']->redirect_link('/admin/index.php');
|
||||
}
|
||||
|
||||
$GLOBALS['phpgw']->common->phpgw_header();
|
||||
echo parse_navbar();
|
||||
|
||||
if ($_POST['btnSave'])
|
||||
{
|
||||
foreach($_POST['catids'] as $cat_id)
|
||||
{
|
||||
$this->bo->set_rights($cat_id,$_POST['inputread'][$cat_id],$_POST['inputwrite'][$cat_id]);
|
||||
}
|
||||
}
|
||||
|
||||
$GLOBALS['phpgw']->template->set_file('acl', 'acl.tpl');
|
||||
$GLOBALS['phpgw']->template->set_block('acl','cat_list','Cblock');
|
||||
$GLOBALS['phpgw']->template->set_var(array(
|
||||
'title' => $GLOBALS['phpgw_info']['apps']['resources']['title'] . ' - ' . lang('Configure Access Permissions'),
|
||||
'lang_search' => lang('Search'),
|
||||
'lang_save' => lang('Save'),
|
||||
'lang_done' => lang('Done'),
|
||||
'lang_read' => lang('Read permissions'),
|
||||
'lang_write' => lang('Write permissions'),
|
||||
'lang_implies' => lang('implies read permission'),
|
||||
));
|
||||
|
||||
$left = $this->nextmatchs->left('/index.php',$this->start,$this->bo->catbo->total_records,'menuaction=resources.uiacl.acllist');
|
||||
$right = $this->nextmatchs->right('/index.php',$this->start,$this->bo->catbo->total_records,'menuaction=resources.uiacl.acllist');
|
||||
|
||||
$GLOBALS['phpgw']->template->set_var(array(
|
||||
'left' => $left,
|
||||
'right' => $right,
|
||||
'lang_showing' => $this->nextmatchs->show_hits($this->bo->catbo->total_records,$this->start),
|
||||
'th_bg' => $GLOBALS['phpgw_info']['theme']['th_bg'],
|
||||
'sort_cat' => $this->nextmatchs->show_sort_order(
|
||||
$this->sort,'cat_name','cat_name','/index.php',lang('Category'),'&menuaction=resources.uiacl.acllist'
|
||||
),
|
||||
'query' => $this->query,
|
||||
));
|
||||
|
||||
@reset($this->bo->cats);
|
||||
while (list(,$cat) = @each($this->bo->cats))
|
||||
{
|
||||
$this->rights = $this->bo->get_rights($cat['id']);
|
||||
|
||||
$tr_color = $this->nextmatchs->alternate_row_color($tr_color);
|
||||
$GLOBALS['phpgw']->template->set_var(array(
|
||||
'tr_color' => $tr_color,
|
||||
'catname' => $cat['name'],
|
||||
'catid' => $cat['id'],
|
||||
'read' => $this->selectlist(PHPGW_ACL_READ),
|
||||
'write' => $this->selectlist(PHPGW_ACL_ADD)
|
||||
));
|
||||
$GLOBALS['phpgw']->template->parse('Cblock','cat_list',True);
|
||||
}
|
||||
$GLOBALS['phpgw']->template->pfp('out','acl',True);
|
||||
}
|
||||
|
||||
function selectlist($right)
|
||||
{
|
||||
reset($this->bo->accounts);
|
||||
while (list($null,$account) = each($this->bo->accounts))
|
||||
{
|
||||
$selectlist .= '<option value="' . $account['account_id'] . '"';
|
||||
if($this->rights[$account['account_id']] & $right)
|
||||
{
|
||||
$selectlist .= ' selected="selected"';
|
||||
}
|
||||
$selectlist .= '>' . $account['account_firstname'] . ' ' . $account['account_lastname']
|
||||
. ' [ ' . $account['account_lid'] . ' ]' . '</option>' . "\n";
|
||||
}
|
||||
return $selectlist;
|
||||
}
|
||||
|
||||
function deny()
|
||||
{
|
||||
echo '<p><center><b>'.lang('Access not permitted').'</b></center>';
|
||||
$GLOBALS['phpgw']->common->phpgw_exit(True);
|
||||
}
|
||||
}
|
||||
?>
|
145
resources/inc/class.ui_resources.inc.php
Executable file
145
resources/inc/class.ui_resources.inc.php
Executable file
@ -0,0 +1,145 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* eGroupWare - resources - Resource Management System *
|
||||
* http://www.egroupware.org *
|
||||
* Written by Lukas Weiss [ichLukas@gmx.net] and *
|
||||
* Cornelius Weiss [nelius@gmx.net] *
|
||||
* ----------------------------------------------- *
|
||||
* 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. *
|
||||
\**************************************************************************/
|
||||
|
||||
class ui_resources
|
||||
{
|
||||
var $public_functions = array(
|
||||
'index' => True,
|
||||
'edit' => True,
|
||||
'writeLangFile' => True
|
||||
);
|
||||
|
||||
/*!
|
||||
@function ui_resources
|
||||
@abstract constructor of class ui_resources
|
||||
*/
|
||||
function ui_resources()
|
||||
{
|
||||
$this->tmpl = CreateObject('etemplate.etemplate','resources.show');
|
||||
$this->bo = CreateObject('resources.bo_resources');
|
||||
|
||||
if(!@is_object($GLOBALS['phpgw']->js))
|
||||
{
|
||||
$GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript');
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
@function index
|
||||
@abstract main resources list.
|
||||
@param array $content content from eTemplate callback
|
||||
|
||||
FIXME don't translate cats in nextmach
|
||||
*/
|
||||
function index($content='')
|
||||
{
|
||||
if (is_array($content))
|
||||
{
|
||||
if (isset($content['nm']['rows']))
|
||||
{
|
||||
if (isset($content['nm']['rows']['edit']))
|
||||
{
|
||||
list($id) = each($content['nm']['rows']['edit']);
|
||||
return $this->edit($id);
|
||||
}
|
||||
elseif (isset($content['nm']['rows']['delete']))
|
||||
{
|
||||
list($id) = each($content['nm']['rows']['delete']);
|
||||
return $this->delete($id);
|
||||
}
|
||||
}
|
||||
if (isset($content['add']))
|
||||
{
|
||||
return $this->edit(0);
|
||||
}
|
||||
}
|
||||
|
||||
$content['nm']['get_rows'] = 'resources.bo_resources.get_rows';
|
||||
$content['nm']['no_filter'] = False;
|
||||
$content['nm']['filter_label'] = lang('Category');
|
||||
$content['nm']['filter_help'] = lang('Select a category'); // is this used???
|
||||
$content['nm']['options-filter']= array('0' => lang('all categories'));
|
||||
$content['nm']['options-filter']+= $this->bo->acl->get_cats(PHPGW_ACL_READ);
|
||||
$content['nm']['no_filter2'] = True;
|
||||
$content['nm']['no_cat'] = True;
|
||||
|
||||
// check if user is permitted to add resources
|
||||
if(!$this->bo->acl->get_cats(PHPGW_ACL_ADD))
|
||||
{
|
||||
$no_button['add'] = true;
|
||||
}
|
||||
|
||||
$this->tmpl->read('resources.show');
|
||||
$this->tmpl->exec('resources.ui_resources.index',$content,$sel_options,$no_button,$preserv);
|
||||
}
|
||||
|
||||
/*!
|
||||
@function edit
|
||||
@abstract invokes add or edit dialog for resources
|
||||
@param mixed $content int for resource_id to edit ( 0 for new ). array if callback from dialog.
|
||||
@param string $msg message to display on top of dialog
|
||||
*/
|
||||
function edit($content='',$msg='')
|
||||
{
|
||||
if (is_array($content))
|
||||
{
|
||||
if(isset($content['delete']))
|
||||
{
|
||||
return $this->delete($content['id']);
|
||||
}
|
||||
if(isset($content['save']))
|
||||
{
|
||||
if(!$content['cat_id'])
|
||||
{
|
||||
return $this->edit($content['id'],'please choose a category');
|
||||
}
|
||||
$this->bo->save($content);
|
||||
}
|
||||
return $this->index();
|
||||
}
|
||||
|
||||
$sel_options = array( // the options for our type selectbox
|
||||
//'type' => $this-> types
|
||||
);
|
||||
$no_button = array( // button not to show
|
||||
);
|
||||
if ($content > 0)
|
||||
{
|
||||
$preserv = array(
|
||||
'id' => $content
|
||||
);
|
||||
$content = $this->bo->read($content);
|
||||
}
|
||||
$content['msg'] = $msg;
|
||||
$this->tmpl->read('resources.edit');
|
||||
$this->tmpl->exec('resources.ui_resources.edit',$content,$sel_options,$no_button,$preserv);
|
||||
|
||||
}
|
||||
|
||||
/*!
|
||||
@function show
|
||||
@abstract showes a single resource
|
||||
@param int $id resource id
|
||||
*/
|
||||
function show($id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function delete($id)
|
||||
{
|
||||
// Wollen sie Dieses bla bla wirklich löschen --> ja (Wie bekommt man mit eTemplate ein Javascript Dialog???)
|
||||
$this->bo->delete($id);
|
||||
return $this->show();
|
||||
}
|
||||
}
|
27
resources/inc/hook_admin.inc.php
Executable file
27
resources/inc/hook_admin.inc.php
Executable file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* eGroupWare *
|
||||
* http://www.egroupware.org *
|
||||
* Written by Joseph Engo <jengo@phpgroupware.org> *
|
||||
* -------------------------------------------- *
|
||||
* 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$ */
|
||||
|
||||
//$file['Site Configuration'] = $GLOBALS['phpgw']->link('/index.php', array(menuaction => 'myapp.uiobj.admin_method');
|
||||
//display_section('myapp',$file);
|
||||
|
||||
{
|
||||
$file = Array
|
||||
(
|
||||
'Global Categories' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index&appname=' . $appname),
|
||||
'Configure Access Permissions' => $GLOBALS['phpgw']->link('/index.php','menuaction=resources.ui_acl.acllist'),
|
||||
// 'eGW SMF bridge' => $GLOBALS['phpgw']->link('/index.php','menuaction=resources.ui_smfbridge.egw2smf')
|
||||
//'Configure RSS exports' => $GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uiexport.exportlist'),
|
||||
);
|
||||
display_section($appname,$appname,$file);
|
||||
}
|
||||
?>
|
24
resources/index.php
Executable file
24
resources/index.php
Executable file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* eGroupWare - resources - Resource Management System *
|
||||
* http://www.egroupware.org *
|
||||
* Written by Lukas Weiss [ichLukas@gmx.net] and *
|
||||
* Cornelius Weiss [nelius@gmx.net] *
|
||||
* ----------------------------------------------- *
|
||||
* 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. *
|
||||
\**************************************************************************/
|
||||
|
||||
|
||||
$GLOBALS['phpgw_info']['flags'] = array(
|
||||
'currentapp' => 'resources',
|
||||
'noheader' => True,
|
||||
'nonavbar' => True
|
||||
);
|
||||
include('../header.inc.php');
|
||||
|
||||
header('Location: '.$GLOBALS['phpgw']->link('/index.php','menuaction=resources.ui_resources.index'));
|
||||
$GLOBALS['phpgw_info']['flags']['nodisplay'] = True;
|
||||
exit;
|
27
resources/setup/etemplates.inc.php
Normal file
27
resources/setup/etemplates.inc.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
// eTemplates for Application 'resources', generated by etemplate.dump() 2004-11-25 13:16
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
$templ_data[] = array('name' => 'resources.add','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:3:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:2:{s:4:"type";s:8:"template";s:4:"name";s:19:"resources.edit_tabs";}}i:2;a:1:{s:1:"A";a:2:{s:4:"type";s:8:"template";s:4:"name";s:21:"resources.add_buttons";}}}','size' => '100%','style' => '','modified' => '1094579218',);
|
||||
|
||||
$templ_data[] = array('name' => 'resources.add_buttons','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:2:{i:0;a:1:{s:1:"C";s:4:"100%";}i:1;a:3:{s:1:"A";a:4:{s:4:"type";s:6:"button";s:5:"label";s:4:"Save";s:4:"name";s:4:"save";s:4:"help";s:21:"Saves entry and exits";}s:1:"B";a:3:{s:4:"type";s:6:"button";s:5:"label";s:6:"Cancel";s:4:"name";s:6:"cancel";}s:1:"C";a:2:{s:4:"type";s:5:"label";s:5:"align";s:5:"right";}}}','size' => '100%','style' => '','modified' => '1094579498',);
|
||||
|
||||
$templ_data[] = array('name' => 'resources.edit','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:4:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:4:"name";s:3:"msg";}}i:2;a:1:{s:1:"A";a:2:{s:4:"type";s:8:"template";s:4:"name";s:19:"resources.edit_tabs";}}i:3;a:1:{s:1:"A";a:2:{s:4:"type";s:8:"template";s:4:"name";s:22:"resources.edit_buttons";}}}','size' => '100%','style' => '','modified' => '1099310308',);
|
||||
|
||||
$templ_data[] = array('name' => 'resources.edit_buttons','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:2:{i:0;a:1:{s:1:"C";s:4:"100%";}i:1;a:3:{s:1:"A";a:4:{s:4:"type";s:6:"button";s:5:"label";s:4:"Save";s:4:"name";s:4:"save";s:4:"help";s:21:"Saves entry and exits";}s:1:"B";a:3:{s:4:"type";s:6:"button";s:5:"label";s:6:"Cancel";s:4:"name";s:6:"cancel";}s:1:"C";a:4:{s:4:"type";s:6:"button";s:5:"label";s:6:"Delete";s:5:"align";s:5:"right";s:4:"name";s:6:"delete";}}}','size' => '100%','style' => '','modified' => '1093597552',);
|
||||
|
||||
$templ_data[] = array('name' => 'resources.edit_tabs','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:4:{i:0;a:3:{s:1:"A";s:3:"250";s:2:"c1";s:6:"row_on";s:2:"c2";s:7:"row_off";}i:1;a:2:{s:1:"A";a:4:{s:4:"type";s:4:"text";s:5:"label";s:4:"Name";s:4:"name";s:4:"name";s:4:"help";s:16:"Name of resource";}s:1:"B";a:5:{s:4:"type";s:10:"select-cat";s:4:"size";s:10:"select one";s:5:"label";s:8:"Category";s:4:"name";s:6:"cat_id";s:4:"help";s:44:"Which category does this resource belong to?";}}i:2;a:2:{s:1:"A";a:5:{s:4:"type";s:3:"tab";s:4:"span";s:3:"all";s:5:"label";s:60:"General|Accessories|Pictures|Page|Location|Prizeing|Calendar";s:4:"name";s:60:"general|accessories|pictures|page|location|prizeing|calendar";s:4:"help";s:194:"General informations about resource|Informations about the location of resource|Prizeing information for booking or buying|Web-Page of resource|Pictures or resource|The Calendar of this resource";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:3;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:4:"span";s:3:"all";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}}','size' => '100%','style' => '','modified' => '1094577031',);
|
||||
|
||||
$templ_data[] = array('name' => 'resources.edit_tabs.general','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:7:{i:0;a:1:{s:1:"C";s:2:"10";}i:1;a:4:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:19:"Description (short)";}s:1:"B";a:4:{s:4:"type";s:4:"text";s:4:"size";s:6:"50,100";s:4:"name";s:17:"short_description";s:4:"help";s:29:"Short description of resource";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:29:"Short description of resource";}}i:2;a:4:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:8:"Location";}s:1:"B";a:4:{s:4:"type";s:4:"text";s:4:"size";s:6:"50,100";s:4:"name";s:8:"location";s:4:"help";s:20:"Location of resource";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:28:"Where to find this resource?";}}i:3;a:4:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:8:"Quantity";}s:1:"B";a:4:{s:4:"type";s:4:"text";s:4:"size";s:4:"5,10";s:4:"name";s:8:"quantity";s:4:"help";s:20:"Quantity of resource";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:20:"Quantity of resource";}}i:4;a:4:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:7:"Useable";}s:1:"B";a:4:{s:4:"type";s:4:"text";s:4:"size";s:4:"5,10";s:4:"name";s:7:"useable";s:4:"help";s:29:"How many of them are useable?";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:38:"How many of the resources are useable?";}}i:5;a:4:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:8:"Bookable";}s:1:"B";a:3:{s:4:"type";s:8:"checkbox";s:4:"name";s:8:"bookable";s:4:"help";s:21:"Is resource bookable?";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:26:"Is this resource bookable?";}}i:6;a:4:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:7:"Buyable";}s:1:"B";a:3:{s:4:"type";s:8:"checkbox";s:4:"name";s:7:"buyable";s:4:"help";s:20:"Is resource buyable?";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:25:"Is this resource buyable?";}}}','size' => '100%','style' => '','modified' => '1093597682',);
|
||||
|
||||
$templ_data[] = array('name' => 'resources.edit_tabs.page','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:2:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:3:{s:4:"type";s:8:"htmlarea";s:4:"name";s:16:"long_description";s:4:"help";s:26:"Web-Site for this resource";}}}','size' => '100%','style' => '','modified' => '1093599237',);
|
||||
|
||||
$templ_data[] = array('name' => 'resources.show','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:3:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:3:{s:4:"type";s:9:"nextmatch";s:4:"size";s:19:"resources.show.rows";s:4:"name";s:2:"nm";}}i:2;a:1:{s:1:"A";a:3:{s:4:"type";s:6:"button";s:5:"label";s:3:"Add";s:4:"name";s:3:"add";}}}','size' => '100%','style' => '','modified' => '1098892283',);
|
||||
|
||||
$templ_data[] = array('name' => 'resources.show.actions','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:3:{i:0;a:3:{s:1:"F";s:2:"3%";s:2:"c1";s:3:"nmh";s:2:"c2";s:3:"nmr";}i:1;a:6:{s:1:"A";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:4:"Name";s:4:"name";s:4:"name";}s:1:"B";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:17:"Short description";s:4:"name";s:17:"short_description";}s:1:"C";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:7:"Useable";s:4:"name";s:7:"useable";}s:1:"D";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:8:"Category";s:4:"name";s:6:"cat_id";}s:1:"E";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:8:"Location";s:4:"name";s:8:"location";}s:1:"F";a:3:{s:4:"type";s:8:"template";s:5:"align";s:5:"right";s:4:"name";s:29:"resources.show.actions_header";}}i:2;a:6:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:12:"${row}[name]";}s:1:"B";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:25:"${row}[short_description]";}s:1:"C";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:14:"${row}[usable]";}s:1:"D";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:16:"${row}[category]";}s:1:"E";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:16:"${row}[location]";}s:1:"F";a:3:{s:4:"type";s:6:"button";s:5:"align";s:5:"right";s:4:"name";s:20:"lukas[$row_cont[id]]";}}}','size' => '100%','style' => '','modified' => '1098891355',);
|
||||
|
||||
$templ_data[] = array('name' => 'resources.show.actions_header','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:2:{i:0;a:0:{}i:1;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:6:"Action";}s:1:"B";a:3:{s:4:"type";s:6:"button";s:4:"size";s:9:"check.png";s:4:"name";s:30:"javascript:check_all(\'select\')";}}}','size' => '','style' => '','modified' => '1094025049',);
|
||||
|
||||
$templ_data[] = array('name' => 'resources.show.rows','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:3:{i:0;a:3:{s:1:"F";s:2:"3%";s:2:"c1";s:3:"nmh";s:2:"c2";s:3:"nmr";}i:1;a:6:{s:1:"A";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:4:"Name";s:4:"name";s:4:"name";}s:1:"B";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:17:"Short description";s:4:"name";s:17:"short_description";}s:1:"C";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:7:"Useable";s:4:"name";s:7:"useable";}s:1:"D";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:8:"Category";s:4:"name";s:6:"cat_id";}s:1:"E";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:8:"Location";s:4:"name";s:8:"location";}s:1:"F";a:3:{s:4:"type";s:8:"template";s:5:"align";s:5:"right";s:4:"name";s:29:"resources.show.actions_header";}}i:2;a:6:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:12:"${row}[name]";}s:1:"B";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:25:"${row}[short_description]";}s:1:"C";a:4:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:5:"align";s:5:"right";s:4:"name";s:15:"${row}[useable]";}s:1:"D";a:4:{s:4:"type";s:10:"select-cat";s:7:"no_lang";s:1:"1";s:4:"name";s:14:"${row}[cat_id]";s:8:"readonly";s:1:"1";}s:1:"E";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:16:"${row}[location]";}s:1:"F";a:8:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"5";s:5:"align";s:5:"right";i:1;a:3:{s:4:"type";s:6:"button";s:4:"size";s:8:"view.gif";s:4:"name";s:19:"view[$row_cont[id]]";}i:2;a:3:{s:4:"type";s:6:"button";s:4:"size";s:10:"browse.gif";s:4:"name";s:19:"book[$row_cont[id]]";}i:3;a:3:{s:4:"type";s:6:"button";s:4:"size";s:8:"edit.gif";s:4:"name";s:19:"edit[$row_cont[id]]";}i:4;a:3:{s:4:"type";s:6:"button";s:4:"size";s:10:"delete.gif";s:4:"name";s:21:"delete[$row_cont[id]]";}i:5;a:2:{s:4:"type";s:8:"checkbox";s:4:"name";s:20:"check[$row_cont[id]]";}}}}','size' => '100%','style' => '','modified' => '1099307314',);
|
||||
|
27
resources/setup/etemplates.old.inc.php
Executable file
27
resources/setup/etemplates.old.inc.php
Executable file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
// eTemplates for Application 'resources', generated by etemplate.dump() 2004-10-31 17:30
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
$templ_data[] = array('name' => 'resources.add','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:3:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:2:{s:4:"type";s:8:"template";s:4:"name";s:19:"resources.edit_tabs";}}i:2;a:1:{s:1:"A";a:2:{s:4:"type";s:8:"template";s:4:"name";s:21:"resources.add_buttons";}}}','size' => '100%','style' => '','modified' => '1094579218',);
|
||||
|
||||
$templ_data[] = array('name' => 'resources.add_buttons','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:2:{i:0;a:1:{s:1:"C";s:4:"100%";}i:1;a:3:{s:1:"A";a:4:{s:4:"type";s:6:"button";s:5:"label";s:4:"Save";s:4:"name";s:4:"save";s:4:"help";s:21:"Saves entry and exits";}s:1:"B";a:3:{s:4:"type";s:6:"button";s:5:"label";s:6:"Cancel";s:4:"name";s:6:"cancel";}s:1:"C";a:2:{s:4:"type";s:5:"label";s:5:"align";s:5:"right";}}}','size' => '100%','style' => '','modified' => '1094579498',);
|
||||
|
||||
$templ_data[] = array('name' => 'resources.edit','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:3:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:2:{s:4:"type";s:8:"template";s:4:"name";s:19:"resources.edit_tabs";}}i:2;a:1:{s:1:"A";a:2:{s:4:"type";s:8:"template";s:4:"name";s:22:"resources.edit_buttons";}}}','size' => '100%','style' => '','modified' => '1093599486',);
|
||||
|
||||
$templ_data[] = array('name' => 'resources.edit_buttons','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:2:{i:0;a:1:{s:1:"C";s:4:"100%";}i:1;a:3:{s:1:"A";a:4:{s:4:"type";s:6:"button";s:5:"label";s:4:"Save";s:4:"name";s:4:"save";s:4:"help";s:21:"Saves entry and exits";}s:1:"B";a:3:{s:4:"type";s:6:"button";s:5:"label";s:6:"Cancel";s:4:"name";s:6:"cancel";}s:1:"C";a:4:{s:4:"type";s:6:"button";s:5:"label";s:6:"Delete";s:5:"align";s:5:"right";s:4:"name";s:6:"delete";}}}','size' => '100%','style' => '','modified' => '1093597552',);
|
||||
|
||||
$templ_data[] = array('name' => 'resources.edit_tabs','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:4:{i:0;a:3:{s:1:"A";s:3:"250";s:2:"c1";s:6:"row_on";s:2:"c2";s:7:"row_off";}i:1;a:2:{s:1:"A";a:4:{s:4:"type";s:4:"text";s:5:"label";s:4:"Name";s:4:"name";s:4:"name";s:4:"help";s:16:"Name of resource";}s:1:"B";a:5:{s:4:"type";s:10:"select-cat";s:4:"size";s:10:"select one";s:5:"label";s:8:"Category";s:4:"name";s:6:"cat_id";s:4:"help";s:44:"Which category does this resource belong to?";}}i:2;a:2:{s:1:"A";a:5:{s:4:"type";s:3:"tab";s:4:"span";s:3:"all";s:5:"label";s:60:"General|Accessories|Pictures|Page|Location|Prizeing|Calendar";s:4:"name";s:60:"general|accessories|pictures|page|location|prizeing|calendar";s:4:"help";s:194:"General informations about resource|Informations about the location of resource|Prizeing information for booking or buying|Web-Page of resource|Pictures or resource|The Calendar of this resource";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:3;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:4:"span";s:3:"all";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}}','size' => '100%','style' => '','modified' => '1094577031',);
|
||||
|
||||
$templ_data[] = array('name' => 'resources.edit_tabs.general','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:7:{i:0;a:1:{s:1:"C";s:2:"10";}i:1;a:4:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:19:"Description (short)";}s:1:"B";a:4:{s:4:"type";s:4:"text";s:4:"size";s:6:"50,100";s:4:"name";s:17:"short_description";s:4:"help";s:29:"Short description of resource";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:29:"Short description of resource";}}i:2;a:4:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:8:"Location";}s:1:"B";a:4:{s:4:"type";s:4:"text";s:4:"size";s:6:"50,100";s:4:"name";s:8:"location";s:4:"help";s:20:"Location of resource";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:28:"Where to find this resource?";}}i:3;a:4:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:8:"Quantity";}s:1:"B";a:4:{s:4:"type";s:4:"text";s:4:"size";s:4:"5,10";s:4:"name";s:8:"quantity";s:4:"help";s:20:"Quantity of resource";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:20:"Quantity of resource";}}i:4;a:4:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:7:"Useable";}s:1:"B";a:4:{s:4:"type";s:4:"text";s:4:"size";s:4:"5,10";s:4:"name";s:7:"useable";s:4:"help";s:29:"How many of them are useable?";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:38:"How many of the resources are useable?";}}i:5;a:4:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:8:"Bookable";}s:1:"B";a:3:{s:4:"type";s:8:"checkbox";s:4:"name";s:8:"bookable";s:4:"help";s:21:"Is resource bookable?";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:26:"Is this resource bookable?";}}i:6;a:4:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:7:"Buyable";}s:1:"B";a:3:{s:4:"type";s:8:"checkbox";s:4:"name";s:7:"buyable";s:4:"help";s:20:"Is resource buyable?";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:25:"Is this resource buyable?";}}}','size' => '100%','style' => '','modified' => '1093597682',);
|
||||
|
||||
$templ_data[] = array('name' => 'resources.edit_tabs.page','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:2:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:3:{s:4:"type";s:8:"htmlarea";s:4:"name";s:16:"long_description";s:4:"help";s:26:"Web-Site for this resource";}}}','size' => '100%','style' => '','modified' => '1093599237',);
|
||||
|
||||
$templ_data[] = array('name' => 'resources.show','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:3:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:3:{s:4:"type";s:9:"nextmatch";s:4:"size";s:19:"resources.show.rows";s:4:"name";s:2:"nm";}}i:2;a:1:{s:1:"A";a:3:{s:4:"type";s:6:"button";s:5:"label";s:3:"Add";s:4:"name";s:3:"add";}}}','size' => '100%','style' => '','modified' => '1098892283',);
|
||||
|
||||
$templ_data[] = array('name' => 'resources.show.actions','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:3:{i:0;a:3:{s:1:"F";s:2:"3%";s:2:"c1";s:3:"nmh";s:2:"c2";s:3:"nmr";}i:1;a:6:{s:1:"A";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:4:"Name";s:4:"name";s:4:"name";}s:1:"B";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:17:"Short description";s:4:"name";s:17:"short_description";}s:1:"C";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:7:"Useable";s:4:"name";s:7:"useable";}s:1:"D";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:8:"Category";s:4:"name";s:6:"cat_id";}s:1:"E";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:8:"Location";s:4:"name";s:8:"location";}s:1:"F";a:3:{s:4:"type";s:8:"template";s:5:"align";s:5:"right";s:4:"name";s:29:"resources.show.actions_header";}}i:2;a:6:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:12:"${row}[name]";}s:1:"B";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:25:"${row}[short_description]";}s:1:"C";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:14:"${row}[usable]";}s:1:"D";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:16:"${row}[category]";}s:1:"E";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:16:"${row}[location]";}s:1:"F";a:3:{s:4:"type";s:6:"button";s:5:"align";s:5:"right";s:4:"name";s:20:"lukas[$row_cont[id]]";}}}','size' => '100%','style' => '','modified' => '1098891355',);
|
||||
|
||||
$templ_data[] = array('name' => 'resources.show.actions_header','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:2:{i:0;a:0:{}i:1;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:6:"Action";}s:1:"B";a:3:{s:4:"type";s:6:"button";s:4:"size";s:9:"check.png";s:4:"name";s:30:"javascript:check_all(\'select\')";}}}','size' => '','style' => '','modified' => '1094025049',);
|
||||
|
||||
$templ_data[] = array('name' => 'resources.show.rows','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:3:{i:0;a:3:{s:1:"F";s:2:"3%";s:2:"c1";s:3:"nmh";s:2:"c2";s:3:"nmr";}i:1;a:6:{s:1:"A";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:4:"Name";s:4:"name";s:4:"name";}s:1:"B";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:17:"Short description";s:4:"name";s:17:"short_description";}s:1:"C";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:7:"Useable";s:4:"name";s:7:"useable";}s:1:"D";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:8:"Category";s:4:"name";s:6:"cat_id";}s:1:"E";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:8:"Location";s:4:"name";s:8:"location";}s:1:"F";a:3:{s:4:"type";s:8:"template";s:5:"align";s:5:"right";s:4:"name";s:29:"resources.show.actions_header";}}i:2;a:6:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:12:"${row}[name]";}s:1:"B";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:25:"${row}[short_description]";}s:1:"C";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:14:"${row}[usable]";}s:1:"D";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:16:"${row}[category]";}s:1:"E";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:16:"${row}[location]";}s:1:"F";a:8:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"5";s:5:"align";s:5:"right";i:1;a:3:{s:4:"type";s:6:"button";s:4:"size";s:8:"view.gif";s:4:"name";s:19:"view[$row_cont[id]]";}i:2;a:3:{s:4:"type";s:6:"button";s:4:"size";s:10:"browse.gif";s:4:"name";s:19:"book[$row_cont[id]]";}i:3;a:3:{s:4:"type";s:6:"button";s:4:"size";s:8:"edit.gif";s:4:"name";s:19:"edit[$row_cont[id]]";}i:4;a:3:{s:4:"type";s:6:"button";s:4:"size";s:10:"delete.gif";s:4:"name";s:21:"delete[$row_cont[id]]";}i:5;a:2:{s:4:"type";s:8:"checkbox";s:4:"name";s:20:"check[$row_cont[id]]";}}}}','size' => '100%','style' => '','modified' => '1098908237',);
|
||||
|
28
resources/setup/old/tables_baseline.inc.php
Executable file
28
resources/setup/old/tables_baseline.inc.php
Executable file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* eGroupWare - Setup *
|
||||
* http://www.eGroupWare.org *
|
||||
* Created by eTemplates DB-Tools written by ralfbecker@outdoor-training.de *
|
||||
* -------------------------------------------- *
|
||||
* 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$ */
|
||||
|
||||
|
||||
$phpgw_baseline = array(
|
||||
'egw_resources' => array(
|
||||
'fd' => array(
|
||||
'id' => array('type' => 'auto'),
|
||||
'name' => array('type' => 'varchar','precision' => '100'),
|
||||
'short_descreption' => array('type' => 'varchar','precision' => '100')
|
||||
),
|
||||
'pk' => array('id'),
|
||||
'fk' => array(),
|
||||
'ix' => array(),
|
||||
'uc' => array()
|
||||
)
|
||||
);
|
38
resources/setup/old/tables_current.inc.php
Executable file
38
resources/setup/old/tables_current.inc.php
Executable file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* eGroupWare - Setup *
|
||||
* http://www.eGroupWare.org *
|
||||
* Created by eTemplates DB-Tools written by ralfbecker@outdoor-training.de *
|
||||
* -------------------------------------------- *
|
||||
* 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$ */
|
||||
|
||||
|
||||
$phpgw_baseline = array(
|
||||
'egw_resources' => array(
|
||||
'fd' => array(
|
||||
'id' => array('type' => 'auto'),
|
||||
'name' => array('type' => 'varchar','precision' => '100'),
|
||||
'short_description' => array('type' => 'varchar','precision' => '100'),
|
||||
'cat_id' => array('type' => 'int','precision' => '11','nullable' => False),
|
||||
'quantity' => array('type' => 'varchar','precision' => '11'),
|
||||
'useable' => array('type' => 'varchar','precision' => '11'),
|
||||
'location' => array('type' => 'varchar','precision' => '100'),
|
||||
'bookable' => array('type' => 'varchar','precision' => '1'),
|
||||
'buyable' => array('type' => 'varchar','precision' => '1'),
|
||||
'prize' => array('type' => 'varchar','precision' => '200'),
|
||||
'long_description' => array('type' => 'longtext'),
|
||||
'picture' => array('type' => 'blob'),
|
||||
'accessories' => array('type' => 'varchar','precision' => '50')
|
||||
),
|
||||
'pk' => array('id'),
|
||||
'fk' => array(),
|
||||
'ix' => array(),
|
||||
'uc' => array()
|
||||
)
|
||||
);
|
38
resources/setup/old/tables_current.old.inc.php
Executable file
38
resources/setup/old/tables_current.old.inc.php
Executable file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* eGroupWare - Setup *
|
||||
* http://www.eGroupWare.org *
|
||||
* Created by eTemplates DB-Tools written by ralfbecker@outdoor-training.de *
|
||||
* -------------------------------------------- *
|
||||
* 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$ */
|
||||
|
||||
|
||||
$phpgw_baseline = array(
|
||||
'egw_resources' => array(
|
||||
'fd' => array(
|
||||
'id' => array('type' => 'auto'),
|
||||
'name' => array('type' => 'varchar','precision' => '100'),
|
||||
'short_description' => array('type' => 'varchar','precision' => '100'),
|
||||
'cat_id' => array('type' => 'varchar','precision' => '11','nullable' => False),
|
||||
'quantity' => array('type' => 'varchar','precision' => '11'),
|
||||
'useable' => array('type' => 'varchar','precision' => '11'),
|
||||
'location' => array('type' => 'varchar','precision' => '100'),
|
||||
'bookable' => array('type' => 'varchar','precision' => '1'),
|
||||
'buyable' => array('type' => 'varchar','precision' => '1'),
|
||||
'prize' => array('type' => 'varchar','precision' => '200'),
|
||||
'long_description' => array('type' => 'longtext'),
|
||||
'picture' => array('type' => 'blob'),
|
||||
'accessories' => array('type' => 'varchar','precision' => '50')
|
||||
),
|
||||
'pk' => array('id'),
|
||||
'fk' => array(),
|
||||
'ix' => array(),
|
||||
'uc' => array()
|
||||
)
|
||||
);
|
158
resources/setup/old/tables_update.inc.php
Executable file
158
resources/setup/old/tables_update.inc.php
Executable file
@ -0,0 +1,158 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* eGroupWare - Setup *
|
||||
* http://www.eGroupWare.org *
|
||||
* Created by eTemplates DB-Tools written by ralfbecker@outdoor-training.de *
|
||||
* -------------------------------------------- *
|
||||
* 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$ */
|
||||
|
||||
$test[] = '';
|
||||
function resources_upgrade()
|
||||
{
|
||||
$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','cat_id',array(
|
||||
'type' => 'int',
|
||||
'precision' => '11'
|
||||
));
|
||||
|
||||
$GLOBALS['setup_info']['resources']['currentver'] = '001';
|
||||
return $GLOBALS['setup_info']['resources']['currentver'];
|
||||
}
|
||||
|
||||
|
||||
$test[] = '';
|
||||
function resources_upgrade()
|
||||
{
|
||||
$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','quantity',array(
|
||||
'type' => 'int',
|
||||
'precision' => '11'
|
||||
));
|
||||
|
||||
$GLOBALS['setup_info']['resources']['currentver'] = '001';
|
||||
return $GLOBALS['setup_info']['resources']['currentver'];
|
||||
}
|
||||
|
||||
|
||||
$test[] = '';
|
||||
function resources_upgrade()
|
||||
{
|
||||
$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','useable',array(
|
||||
'type' => 'int',
|
||||
'precision' => '11'
|
||||
));
|
||||
$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','location',array(
|
||||
'type' => 'varchar',
|
||||
'precision' => '100'
|
||||
));
|
||||
|
||||
$GLOBALS['setup_info']['resources']['currentver'] = '001';
|
||||
return $GLOBALS['setup_info']['resources']['currentver'];
|
||||
}
|
||||
|
||||
|
||||
$test[] = '';
|
||||
function resources_upgrade()
|
||||
{
|
||||
$GLOBALS['phpgw_setup']->oProc->RenameColumn('egw_resources','short_descreption','short_description');
|
||||
$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','bookable',array(
|
||||
'type' => 'int',
|
||||
'precision' => '1'
|
||||
));
|
||||
$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','buyable',array(
|
||||
'type' => 'int',
|
||||
'precision' => '1'
|
||||
));
|
||||
$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','prize',array(
|
||||
'type' => 'varchar',
|
||||
'precision' => '200'
|
||||
));
|
||||
$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','long_description',array(
|
||||
'type' => 'longtext'
|
||||
));
|
||||
$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','picture',array(
|
||||
'type' => 'blob'
|
||||
));
|
||||
$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','accessories',array(
|
||||
'type' => 'varchar',
|
||||
'precision' => '50'
|
||||
));
|
||||
|
||||
$GLOBALS['setup_info']['resources']['currentver'] = '008';
|
||||
return $GLOBALS['setup_info']['resources']['currentver'];
|
||||
}
|
||||
|
||||
|
||||
$test[] = '0.0.1.008';
|
||||
function resources_upgrade0_0_1_008()
|
||||
{
|
||||
$GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_resources','cat_id',array(
|
||||
'type' => 'int',
|
||||
'precision' => '2'
|
||||
));
|
||||
|
||||
$GLOBALS['setup_info']['resources']['currentver'] = '0.0.1.008';
|
||||
return $GLOBALS['setup_info']['resources']['currentver'];
|
||||
}
|
||||
|
||||
|
||||
$test[] = '0.0.1.008';
|
||||
function resources_upgrade0_0_1_008()
|
||||
{
|
||||
$GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_resources','cat_id',array(
|
||||
'type' => 'varchar',
|
||||
'precision' => '11'
|
||||
));
|
||||
$GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_resources','quantity',array(
|
||||
'type' => 'varchar',
|
||||
'precision' => '11'
|
||||
));
|
||||
$GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_resources','useable',array(
|
||||
'type' => 'varchar',
|
||||
'precision' => '11'
|
||||
));
|
||||
$GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_resources','bookable',array(
|
||||
'type' => 'varchar',
|
||||
'precision' => '1'
|
||||
));
|
||||
$GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_resources','buyable',array(
|
||||
'type' => 'varchar',
|
||||
'precision' => '1'
|
||||
));
|
||||
|
||||
$GLOBALS['setup_info']['resources']['currentver'] = '0.0.1.008';
|
||||
return $GLOBALS['setup_info']['resources']['currentver'];
|
||||
}
|
||||
|
||||
|
||||
$test[] = '0.0.1.008';
|
||||
function resources_upgrade0_0_1_008()
|
||||
{
|
||||
$GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_resources','cat_id',array(
|
||||
'type' => 'varchar',
|
||||
'precision' => '11',
|
||||
'nullable' => False
|
||||
));
|
||||
|
||||
$GLOBALS['setup_info']['resources']['currentver'] = '0.0.1.009';
|
||||
return $GLOBALS['setup_info']['resources']['currentver'];
|
||||
}
|
||||
|
||||
|
||||
$test[] = '0.0.1.009';
|
||||
function resources_upgrade0_0_1_009()
|
||||
{
|
||||
$GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_resources','cat_id',array(
|
||||
'type' => 'int',
|
||||
'precision' => '11',
|
||||
'nullable' => False
|
||||
));
|
||||
|
||||
$GLOBALS['setup_info']['resources']['currentver'] = '0.0.1.010';
|
||||
return $GLOBALS['setup_info']['resources']['currentver'];
|
||||
}
|
||||
?>
|
144
resources/setup/old/tables_update.old.inc.php
Executable file
144
resources/setup/old/tables_update.old.inc.php
Executable file
@ -0,0 +1,144 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* eGroupWare - Setup *
|
||||
* http://www.eGroupWare.org *
|
||||
* Created by eTemplates DB-Tools written by ralfbecker@outdoor-training.de *
|
||||
* -------------------------------------------- *
|
||||
* 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$ */
|
||||
|
||||
$test[] = '';
|
||||
function resources_upgrade()
|
||||
{
|
||||
$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','cat_id',array(
|
||||
'type' => 'int',
|
||||
'precision' => '11'
|
||||
));
|
||||
|
||||
$GLOBALS['setup_info']['resources']['currentver'] = '001';
|
||||
return $GLOBALS['setup_info']['resources']['currentver'];
|
||||
}
|
||||
|
||||
|
||||
$test[] = '';
|
||||
function resources_upgrade()
|
||||
{
|
||||
$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','quantity',array(
|
||||
'type' => 'int',
|
||||
'precision' => '11'
|
||||
));
|
||||
|
||||
$GLOBALS['setup_info']['resources']['currentver'] = '001';
|
||||
return $GLOBALS['setup_info']['resources']['currentver'];
|
||||
}
|
||||
|
||||
|
||||
$test[] = '';
|
||||
function resources_upgrade()
|
||||
{
|
||||
$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','useable',array(
|
||||
'type' => 'int',
|
||||
'precision' => '11'
|
||||
));
|
||||
$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','location',array(
|
||||
'type' => 'varchar',
|
||||
'precision' => '100'
|
||||
));
|
||||
|
||||
$GLOBALS['setup_info']['resources']['currentver'] = '001';
|
||||
return $GLOBALS['setup_info']['resources']['currentver'];
|
||||
}
|
||||
|
||||
|
||||
$test[] = '';
|
||||
function resources_upgrade()
|
||||
{
|
||||
$GLOBALS['phpgw_setup']->oProc->RenameColumn('egw_resources','short_descreption','short_description');
|
||||
$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','bookable',array(
|
||||
'type' => 'int',
|
||||
'precision' => '1'
|
||||
));
|
||||
$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','buyable',array(
|
||||
'type' => 'int',
|
||||
'precision' => '1'
|
||||
));
|
||||
$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','prize',array(
|
||||
'type' => 'varchar',
|
||||
'precision' => '200'
|
||||
));
|
||||
$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','long_description',array(
|
||||
'type' => 'longtext'
|
||||
));
|
||||
$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','picture',array(
|
||||
'type' => 'blob'
|
||||
));
|
||||
$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','accessories',array(
|
||||
'type' => 'varchar',
|
||||
'precision' => '50'
|
||||
));
|
||||
|
||||
$GLOBALS['setup_info']['resources']['currentver'] = '008';
|
||||
return $GLOBALS['setup_info']['resources']['currentver'];
|
||||
}
|
||||
|
||||
|
||||
$test[] = '0.0.1.008';
|
||||
function resources_upgrade0_0_1_008()
|
||||
{
|
||||
$GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_resources','cat_id',array(
|
||||
'type' => 'int',
|
||||
'precision' => '2'
|
||||
));
|
||||
|
||||
$GLOBALS['setup_info']['resources']['currentver'] = '0.0.1.008';
|
||||
return $GLOBALS['setup_info']['resources']['currentver'];
|
||||
}
|
||||
|
||||
|
||||
$test[] = '0.0.1.008';
|
||||
function resources_upgrade0_0_1_008()
|
||||
{
|
||||
$GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_resources','cat_id',array(
|
||||
'type' => 'varchar',
|
||||
'precision' => '11'
|
||||
));
|
||||
$GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_resources','quantity',array(
|
||||
'type' => 'varchar',
|
||||
'precision' => '11'
|
||||
));
|
||||
$GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_resources','useable',array(
|
||||
'type' => 'varchar',
|
||||
'precision' => '11'
|
||||
));
|
||||
$GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_resources','bookable',array(
|
||||
'type' => 'varchar',
|
||||
'precision' => '1'
|
||||
));
|
||||
$GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_resources','buyable',array(
|
||||
'type' => 'varchar',
|
||||
'precision' => '1'
|
||||
));
|
||||
|
||||
$GLOBALS['setup_info']['resources']['currentver'] = '0.0.1.008';
|
||||
return $GLOBALS['setup_info']['resources']['currentver'];
|
||||
}
|
||||
|
||||
|
||||
$test[] = '0.0.1.008';
|
||||
function resources_upgrade0_0_1_008()
|
||||
{
|
||||
$GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_resources','cat_id',array(
|
||||
'type' => 'varchar',
|
||||
'precision' => '11',
|
||||
'nullable' => False
|
||||
));
|
||||
|
||||
$GLOBALS['setup_info']['resources']['currentver'] = '0.0.1.009';
|
||||
return $GLOBALS['setup_info']['resources']['currentver'];
|
||||
}
|
||||
?>
|
28
resources/setup/setup.inc.php
Executable file
28
resources/setup/setup.inc.php
Executable file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
$setup_info['resources']['name'] = 'resources';
|
||||
$setup_info['resources']['title'] = 'Resource Management';
|
||||
$setup_info['resources']['version'] = '0.0.1.011';
|
||||
$setup_info['resources']['app_order'] = 1;
|
||||
$setup_info['resources']['tables'] = array('egw_resources');
|
||||
$setup_info['resources']['enable'] = 1;
|
||||
|
||||
/* The hooks this app includes, needed for hooks registration */
|
||||
$setup_info['resources']['hooks'][] = 'admin';
|
||||
// $setup_info['resources']['hooks'][] = 'home';
|
||||
// $setup_info['resources']['hooks'][] = 'sidebox_menu';
|
||||
// $setup_info['resources']['hooks'][] = 'settings';
|
||||
// $setup_info['resources']['hooks'][] = 'preferences'
|
||||
|
||||
/* Dependencies for this app to work */
|
||||
$setup_info['resources']['depends'][] = array(
|
||||
'appname' => 'phpgwapi',
|
||||
'versions' => Array('1.0.0','1.0.1')
|
||||
);
|
||||
$setup_info['resources']['depends'][] = array( // this is only necessary as long the etemplate-class is not in the api
|
||||
'appname' => 'etemplate',
|
||||
'versions' => Array('1.0.0')
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
27
resources/setup/setup.old.inc.php
Executable file
27
resources/setup/setup.old.inc.php
Executable file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
$setup_info['resources']['name'] = 'resources';
|
||||
$setup_info['resources']['title'] = 'Resource Management';
|
||||
$setup_info['resources']['version'] = '0.0.1.010';
|
||||
$setup_info['resources']['app_order'] = 1;
|
||||
$setup_info['resources']['tables'] = array('egw_resources');
|
||||
$setup_info['resources']['enable'] = 1;
|
||||
|
||||
/* The hooks this app includes, needed for hooks registration */
|
||||
$setup_info['resources']['hooks'][] = 'admin';
|
||||
// $setup_info['resources']['hooks'][] = 'home';
|
||||
// $setup_info['resources']['hooks'][] = 'sidebox_menu';
|
||||
// $setup_info['resources']['hooks'][] = 'settings';
|
||||
// $setup_info['resources']['hooks'][] = 'preferences'
|
||||
|
||||
/* Dependencies for this app to work */
|
||||
$setup_info['resources']['depends'][] = array(
|
||||
'appname' => 'phpgwapi',
|
||||
'versions' => Array('1.0.0','1.0.1')
|
||||
);
|
||||
$setup_info['resources']['depends'][] = array( // this is only necessary as long the etemplate-class is not in the api
|
||||
'appname' => 'etemplate',
|
||||
'versions' => Array('1.0.0')
|
||||
);
|
||||
|
||||
|
||||
|
38
resources/setup/tables_baseline.inc.php
Executable file
38
resources/setup/tables_baseline.inc.php
Executable file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* eGroupWare - Setup *
|
||||
* http://www.eGroupWare.org *
|
||||
* Created by eTemplates DB-Tools written by ralfbecker@outdoor-training.de *
|
||||
* -------------------------------------------- *
|
||||
* 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$ */
|
||||
|
||||
|
||||
$phpgw_baseline = array(
|
||||
'egw_resources' => array(
|
||||
'fd' => array(
|
||||
'id' => array('type' => 'auto'),
|
||||
'name' => array('type' => 'varchar','precision' => '100'),
|
||||
'short_description' => array('type' => 'varchar','precision' => '100'),
|
||||
'cat_id' => array('type' => 'int','precision' => '11','nullable' => False),
|
||||
'quantity' => array('type' => 'varchar','precision' => '11'),
|
||||
'useable' => array('type' => 'varchar','precision' => '11'),
|
||||
'location' => array('type' => 'varchar','precision' => '100'),
|
||||
'bookable' => array('type' => 'varchar','precision' => '1'),
|
||||
'buyable' => array('type' => 'varchar','precision' => '1'),
|
||||
'prize' => array('type' => 'varchar','precision' => '200'),
|
||||
'long_description' => array('type' => 'longtext'),
|
||||
'picture' => array('type' => 'blob'),
|
||||
'accessories' => array('type' => 'varchar','precision' => '50')
|
||||
),
|
||||
'pk' => array('id'),
|
||||
'fk' => array(),
|
||||
'ix' => array(),
|
||||
'uc' => array()
|
||||
)
|
||||
);
|
38
resources/setup/tables_current.inc.php
Executable file
38
resources/setup/tables_current.inc.php
Executable file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* eGroupWare - Setup *
|
||||
* http://www.eGroupWare.org *
|
||||
* Created by eTemplates DB-Tools written by ralfbecker@outdoor-training.de *
|
||||
* -------------------------------------------- *
|
||||
* 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$ */
|
||||
|
||||
|
||||
$phpgw_baseline = array(
|
||||
'egw_resources' => array(
|
||||
'fd' => array(
|
||||
'id' => array('type' => 'auto'),
|
||||
'name' => array('type' => 'varchar','precision' => '100'),
|
||||
'short_description' => array('type' => 'varchar','precision' => '100'),
|
||||
'cat_id' => array('type' => 'int','precision' => '11','nullable' => False),
|
||||
'quantity' => array('type' => 'int','precision' => '11'),
|
||||
'useable' => array('type' => 'int','precision' => '11'),
|
||||
'location' => array('type' => 'varchar','precision' => '100'),
|
||||
'bookable' => array('type' => 'varchar','precision' => '1'),
|
||||
'buyable' => array('type' => 'varchar','precision' => '1'),
|
||||
'prize' => array('type' => 'varchar','precision' => '200'),
|
||||
'long_description' => array('type' => 'longtext'),
|
||||
'picture' => array('type' => 'blob'),
|
||||
'accessories' => array('type' => 'varchar','precision' => '50')
|
||||
),
|
||||
'pk' => array('id'),
|
||||
'fk' => array(),
|
||||
'ix' => array(),
|
||||
'uc' => array()
|
||||
)
|
||||
);
|
38
resources/setup/tables_current.old.inc.php
Executable file
38
resources/setup/tables_current.old.inc.php
Executable file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* eGroupWare - Setup *
|
||||
* http://www.eGroupWare.org *
|
||||
* Created by eTemplates DB-Tools written by ralfbecker@outdoor-training.de *
|
||||
* -------------------------------------------- *
|
||||
* 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$ */
|
||||
|
||||
|
||||
$phpgw_baseline = array(
|
||||
'egw_resources' => array(
|
||||
'fd' => array(
|
||||
'id' => array('type' => 'auto'),
|
||||
'name' => array('type' => 'varchar','precision' => '100'),
|
||||
'short_description' => array('type' => 'varchar','precision' => '100'),
|
||||
'cat_id' => array('type' => 'int','precision' => '11','nullable' => False),
|
||||
'quantity' => array('type' => 'varchar','precision' => '11'),
|
||||
'useable' => array('type' => 'varchar','precision' => '11'),
|
||||
'location' => array('type' => 'varchar','precision' => '100'),
|
||||
'bookable' => array('type' => 'varchar','precision' => '1'),
|
||||
'buyable' => array('type' => 'varchar','precision' => '1'),
|
||||
'prize' => array('type' => 'varchar','precision' => '200'),
|
||||
'long_description' => array('type' => 'longtext'),
|
||||
'picture' => array('type' => 'blob'),
|
||||
'accessories' => array('type' => 'varchar','precision' => '50')
|
||||
),
|
||||
'pk' => array('id'),
|
||||
'fk' => array(),
|
||||
'ix' => array(),
|
||||
'uc' => array()
|
||||
)
|
||||
);
|
30
resources/setup/tables_update.inc.php
Executable file
30
resources/setup/tables_update.inc.php
Executable file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* eGroupWare - Setup *
|
||||
* http://www.eGroupWare.org *
|
||||
* Created by eTemplates DB-Tools written by ralfbecker@outdoor-training.de *
|
||||
* -------------------------------------------- *
|
||||
* 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$ */
|
||||
|
||||
$test[] = '0.0.1.010';
|
||||
function resources_upgrade0_0_1_010()
|
||||
{
|
||||
$GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_resources','quantity',array(
|
||||
'type' => 'int',
|
||||
'precision' => '11'
|
||||
));
|
||||
$GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_resources','useable',array(
|
||||
'type' => 'int',
|
||||
'precision' => '11'
|
||||
));
|
||||
|
||||
$GLOBALS['setup_info']['resources']['currentver'] = '0.0.1.011';
|
||||
return $GLOBALS['setup_info']['resources']['currentver'];
|
||||
}
|
||||
?>
|
56
resources/setup/tables_update.old.inc.php
Executable file
56
resources/setup/tables_update.old.inc.php
Executable file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* eGroupWare - Setup *
|
||||
* http://www.eGroupWare.org *
|
||||
* Created by eTemplates DB-Tools written by ralfbecker@outdoor-training.de *
|
||||
* -------------------------------------------- *
|
||||
* 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$ */
|
||||
|
||||
$test[] = '';
|
||||
function resources_upgrade()
|
||||
{
|
||||
$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','cat_id',array(
|
||||
'type' => 'int',
|
||||
'precision' => '11'
|
||||
));
|
||||
|
||||
$GLOBALS['setup_info']['resources']['currentver'] = '001';
|
||||
return $GLOBALS['setup_info']['resources']['currentver'];
|
||||
}
|
||||
|
||||
|
||||
$test[] = '';
|
||||
function resources_upgrade()
|
||||
{
|
||||
$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','quantity',array(
|
||||
'type' => 'int',
|
||||
'precision' => '11'
|
||||
));
|
||||
|
||||
$GLOBALS['setup_info']['resources']['currentver'] = '001';
|
||||
return $GLOBALS['setup_info']['resources']['currentver'];
|
||||
}
|
||||
|
||||
|
||||
$test[] = '';
|
||||
function resources_upgrade()
|
||||
{
|
||||
$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','useable',array(
|
||||
'type' => 'int',
|
||||
'precision' => '11'
|
||||
));
|
||||
$GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','location',array(
|
||||
'type' => 'varchar',
|
||||
'precision' => '100'
|
||||
));
|
||||
|
||||
$GLOBALS['setup_info']['resources']['currentver'] = '001';
|
||||
return $GLOBALS['setup_info']['resources']['currentver'];
|
||||
}
|
||||
?>
|
49
resources/templates/default/acl.tpl
Executable file
49
resources/templates/default/acl.tpl
Executable file
@ -0,0 +1,49 @@
|
||||
<center>
|
||||
<table border="0" cellspacing="2" cellpadding="2" width="60%">
|
||||
<tr>
|
||||
<td colspan="3" align="center" bgcolor="#c9c9c9"><b>{title}<b/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" align="left">
|
||||
<table border="0" width="100%">
|
||||
<tr>
|
||||
{left}
|
||||
<td align="center">{lang_showing}</td>
|
||||
{right}
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td colspan="3" align="right">
|
||||
<form method="POST"><input type="text" name="query" value="{query}" /> <input type="submit" name="btnSearch" value="{lang_search}" /></form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<form method="POST">
|
||||
<table border="0" cellspacing="2" cellpadding="2" width="60%">
|
||||
<tr bgcolor="{th_bg}" valign="middle" align="center">
|
||||
<td>{sort_cat}</td>
|
||||
<td>{lang_read}</td>
|
||||
<td>{lang_write}<br>({lang_implies})</td>
|
||||
</tr>
|
||||
<!-- BEGIN cat_list -->
|
||||
<tr bgcolor="{tr_color}">
|
||||
<td>
|
||||
{catname}
|
||||
<input type="hidden" name="catids[]" value="{catid}" />
|
||||
</td>
|
||||
<td align="center"><select multiple="multiple" size="5" name="inputread[{catid}][]">{read}</select></td>
|
||||
<td align="center"><select multiple="multiple" size="5" name="inputwrite[{catid}][]">{write}</select></td>
|
||||
</tr>
|
||||
<!-- END cat_list -->
|
||||
<tr>
|
||||
<td colspan="3" align="center">
|
||||
<input type="submit" name="btnSave" value="{lang_save}">
|
||||
<input type="submit" name="btnDone" value="{lang_done}">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</center>
|
BIN
resources/templates/default/images/arrow_ltr.png
Executable file
BIN
resources/templates/default/images/arrow_ltr.png
Executable file
Binary file not shown.
BIN
resources/templates/default/images/bookable.gif
Executable file
BIN
resources/templates/default/images/bookable.gif
Executable file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
BIN
resources/templates/default/images/bookable.png
Executable file
BIN
resources/templates/default/images/bookable.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 952 B |
BIN
resources/templates/default/images/check.png
Executable file
BIN
resources/templates/default/images/check.png
Executable file
Binary file not shown.
Loading…
Reference in New Issue
Block a user