<?php
/**
* Tine 2.0
*
* @package Tinebase
* @subpackage Setup
* @license http://www.gnu.org/licenses/agpl.html AGPL3
* @copyright Copyright (c) 2008 Metaways Infosystems GmbH (http://www.metaways.de)
* @author Lars Kneschke <l.kneschke@metaways.de>
*/
/**
* Tinebase updates for version 0.x
*
* @package Tinebase
* @subpackage Setup
*/
class Tinebase_Setup_Update_Release0 extends Setup_Update_Abstract
{
/**
* update function 0
* has no real functionality, only shows how its done
*
*/
public function update_0()
{
// just show how it works
$tableDefinition =
'<table>
<name>test_table</name>
<version>1</version>
<declaration>
<field>
<name>id</name>
<type>integer</type>
<autoincrement>true</autoincrement>
</field>
<field>
<name>name</name>
<type>text</type>
<length>128</length>
<notnull>true</notnull>
</field>
<index>
<name>id</name>
<primary>true</primary>
<field>
<name>id</name>
</field>
</index>
</declaration>
</table>'
;
$table = Setup_Backend_Schema_Index_Factory::factory('String', $tableDefinition);
$this->_backend->createTable($table);
$this->_backend->dropTable('test_table');
}
/**
* update function 1
* adds application rights
*
*/
public function update_1()
{
$this->validateTableVersion('application_rights', '1');
$declaration = new Setup_Backend_Schema_Field();
$declaration->name = 'account_type';
$declaration->type = 'enum';
$declaration->notnull = 'true';
$declaration->value = array(Tinebase_Acl_Rights::ACCOUNT_TYPE_ANYONE, 'account', Tinebase_Acl_Rights::ACCOUNT_TYPE_GROUP);
$this->_backend->addCol('application_rights', $declaration);
$declaration = new Setup_Backend_Schema_Field();
$declaration->name = 'right';
$declaration->type = 'text';
$declaration->length = 64;
$declaration->notnull = 'true';
$this->_backend->alterCol('application_rights', $declaration);
$rightsTable = new Tinebase_Db_Table(array('name' => 'application_rights'));
$data = array(
'account_type' => Tinebase_Acl_Rights::ACCOUNT_TYPE_ANYONE
);
$where = array(
$this->_db->quoteIdentifier('account_id') . ' IS NULL',
$this->_db->quoteIdentifier('group_id') . ' IS NULL'
);
$rightsTable->update($data, $where);
$data = array(
'account_type' => 'account'
);
$where = array(
$this->_db->quoteIdentifier('account_id') . ' IS NOT NULL',
$this->_db->quoteIdentifier('group_id') . ' IS NULL'
);
$rightsTable->update($data, $where);
$data = array(
'account_type' => Tinebase_Acl_Rights::ACCOUNT_TYPE_GROUP
);
$where = array(
$this->_db->quoteIdentifier('account_id') . ' IS NULL',
$this->_db->quoteIdentifier('group_id') . ' IS NOT NULL'
);
$rightsTable->update($data, $where);
$data = array(
'account_id' => new Zend_Db_Expr('group_id'),
);
$where = array(
$rightsTable->getAdapter()->quoteInto($this->_db->quoteIdentifier('account_type') . ' = ?', Tinebase_Acl_Rights::ACCOUNT_TYPE_GROUP),
);
$rightsTable->update($data, $where);
$this->_backend->dropIndex('application_rights', 'account_id-group_id-application_id-right');
$index = new StdClass();
$index->name = 'account_id-account_type-application_id-right';
$index->unique = 'true';
$index->field = array();
$field = new StdClass();
$field->name = 'account_id';
$index->field[] = $field;
$field = new StdClass();
$field->name = 'account_type';
$index->field[] = $field;
$field = new StdClass();
$field->name = 'application_id';
$index->field[] = $field;
$field = new StdClass();
$field->name = 'right';
$index->field[] = $field;
$this->_backend->addIndex( 'application_rights', $index);
$this->_backend->dropCol('application_rights', 'group_id');
$this->setTableVersion('application_rights', '2');
$this->setApplicationVersion('Tinebase', '0.2');
}
/**
* update function 2
* adds roles (tables and user/admin role)
*
*/
public function update_2()
{
/************ create roles tables **************/
$tableDefinitions = array(
'<table>
<name>roles</name>
<version>1</version>
<declaration>
<field>
<name>id</name>
<type>integer</type>
<autoincrement>true</autoincrement>
</field>
<field>
<name>name</name>
<type>text</type>
<length>128</length>
<notnull>true</notnull>
</field>
<field>
<name>description</name>
<type>text</type>
<length>255</length>
<notnull>false</notnull>
</field>
<field>
<name>created_by</name>
<type>integer</type>
</field>
<field>
<name>creation_time</name>
<type>datetime</type>
</field>
<field>
<name>last_modified_by</name>
<type>integer</type>
</field>
<field>
<name>last_modified_time</name>
<type>datetime</type>
</field>
<index>
<name>id</name>
<primary>true</primary>
<field>
<name>id</name>
</field>
</index>
<index>
<name>name</name>
<unique>true</unique>
<field>
<name>name</name>
</field>
</index>
</declaration>
</table>
',
'<table>
<name>role_rights</name>
<version>1</version>
<declaration>
<field>
<name>id</name>
<type>integer</type>
<autoincrement>true</autoincrement>
</field>
<field>
<name>role_id</name>
<type>integer</type>
<unsigned>true</unsigned>
<notnull>true</notnull>
</field>
<field>
<name>application_id</name>
<type>integer</type>
<length>11</length>
<unsigned>true</unsigned>
<notnull>true</notnull>
没有合适的资源?快使用搜索试试~ 我知道了~
基于PHP的TineWeb的群件系统源码.zip
共2000个文件
js:734个
xml:498个
php:287个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 161 浏览量
2023-08-28
23:58:46
上传
评论
收藏 22.01MB ZIP 举报
温馨提示
基于PHP的TineWeb的群件系统源码.zip
资源推荐
资源详情
资源评论
收起资源包目录
基于PHP的TineWeb的群件系统源码.zip (2000个子文件)
ext-all.css 135KB
layout.css 108KB
ext-all-notheme.css 97KB
xtheme-access.css 41KB
Tinebase-FAT.css 40KB
xtheme-blue.css 38KB
xtheme-gray.css 38KB
tine20.css 28KB
Calendar-FAT.css 21KB
Felamimail-FAT.css 13KB
grid.css 11KB
form.css 10KB
button.css 8KB
style.css 7KB
tabs.css 7KB
panel.css 7KB
grid.css 7KB
grid.css 6KB
grid.css 6KB
panel-reset.css 6KB
toolbar.css 5KB
core.css 5KB
Admin-FAT.css 5KB
layout.css 5KB
Crm-FAT.css 5KB
date-picker.css 5KB
tree.css 5KB
Setup-FAT.css 4KB
menu.css 4KB
tree.css 4KB
tree.css 4KB
tree.css 4KB
window.css 3KB
form.css 3KB
button.css 3KB
toolbar.css 3KB
resizable.css 3KB
editor.css 3KB
tabs.css 3KB
date-picker.css 3KB
tabs.css 3KB
date-picker.css 3KB
date-picker.css 3KB
qtips.css 3KB
toolbar.css 3KB
tabs.css 3KB
toolbar.css 3KB
print.css 3KB
form.css 2KB
form.css 2KB
button.css 2KB
button.css 2KB
slider.css 2KB
panel.css 2KB
panel.css 2KB
panel.css 2KB
menu.css 2KB
window.css 2KB
Timetracker-FAT.css 2KB
window.css 2KB
window.css 2KB
core.css 2KB
menu.css 2KB
resizable.css 2KB
core.css 2KB
resizable.css 2KB
resizable.css 2KB
list-view.css 2KB
core.css 2KB
menu.css 2KB
box.css 1KB
box.css 1KB
box.css 1KB
box.css 1KB
layout.css 1KB
layout.css 1KB
layout.css 1KB
qtips.css 1KB
qtips.css 1KB
qtips.css 1KB
dialog.css 1KB
borders.css 1KB
dd.css 1KB
Tasks-FAT.css 965B
Addressbook-FAT.css 928B
debug.css 915B
combo.css 892B
combo.css 887B
combo.css 875B
list-view.css 852B
dialog.css 836B
dialog.css 833B
Sales-FAT.css 827B
dialog.css 826B
list-view.css 804B
list-view.css 804B
progress.css 797B
print.css 792B
combo.css 785B
dd.css 660B
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
易小侠
- 粉丝: 6506
- 资源: 9万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功