2 commits - doc/kolab_wap-3.0.0.sql doc/sample-insert-resource_types.php
Jeroen van Meeuwen
vanmeeuwen at kolabsys.com
Thu Jun 21 14:17:03 CEST 2012
doc/kolab_wap-3.0.0.sql | 29 +++++++++--
doc/sample-insert-resource_types.php | 92 +++++++++++++++++++++++++++++++++++
2 files changed, 118 insertions(+), 3 deletions(-)
New commits:
commit df3b154d86cfe02c0ea92f09e27eace8c30c7ab9
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date: Thu Jun 21 13:16:40 2012 +0100
Add sample to insert resource_types
diff --git a/doc/sample-insert-resource_types.php b/doc/sample-insert-resource_types.php
new file mode 100644
index 0000000..45efd23
--- /dev/null
+++ b/doc/sample-insert-resource_types.php
@@ -0,0 +1,92 @@
+#!/usr/bin/php
+<?php
+
+ if (isset($_SERVER["REQUEST_METHOD"]) && !empty($SERVER["REQUEST_METHOD"])) {
+ die("Not intended for execution through the webserver, sorry!");
+ }
+
+ require_once("lib/functions.php");
+
+ $db = SQL::get_instance();
+
+ $result = $db->query("TRUNCATE `resource_types`");
+
+ $attributes = Array(
+ "auto_form_fields" => Array(
+ "mail" => Array(
+ "data" => Array(
+ "cn",
+ ),
+ ),
+ ),
+ "fields" => Array(
+ "objectclass" => Array(
+ "top",
+ "groupofuniquenames",
+ "kolabgroupofuniquenames",
+ ),
+ ),
+ "form_fields" => Array(
+ "cn" => Array(),
+ "uniquemember" => Array(
+ "type" => "list",
+ "autocomplete" => true,
+ "optional" => true,
+ ),
+ ),
+ );
+
+ $result = $db->query("INSERT INTO `resource_types` (`key`, `name`, `description`, `attributes`) " .
+ "VALUES ('collection','Resource Collection', 'A collection or pool of resources'," .
+ "'" . json_encode($attributes) . "')");
+
+ $attributes = Array(
+ "auto_form_fields" => Array(
+ "cn" => Array(
+ "data" => Array(
+ "cn",
+ ),
+ ),
+ "kolabtargetfolder" => Array(
+ "data" => Array(
+ "cn",
+ ),
+ ),
+ "mail" => Array(
+ "data" => Array(
+ "cn",
+ ),
+ ),
+ ),
+ "fields" => Array(
+ "objectclass" => Array(
+ "top",
+ "kolabsharedfolder",
+ "mailrecipient",
+ ),
+ "kolabfoldertype" => Array(
+ "event",
+ ),
+ ),
+ "form_fields" => Array(
+ "cn" => Array(),
+ ),
+ );
+
+ $result = $db->query("INSERT INTO `resource_types` (`key`, `name`, `description`, `attributes`) " .
+ "VALUES ('car','Car', 'A car'," .
+ "'" . json_encode($attributes) . "')");
+
+ $result = $db->query("INSERT INTO `resource_types` (`key`, `name`, `description`, `attributes`) " .
+ "VALUES ('confroom','Conference Room', 'A conference room'," .
+ "'" . json_encode($attributes) . "')");
+
+ $result = $db->query("INSERT INTO `resource_types` (`key`, `name`, `description`, `attributes`) " .
+ "VALUES ('beamer','Beamer', 'A portable beamer'," .
+ "'" . json_encode($attributes) . "')");
+
+ $result = $db->query("INSERT INTO `resource_types` (`key`, `name`, `description`, `attributes`) " .
+ "VALUES ('footballtickets','Football Season Tickets', 'Season tickets to the game (pretty good seats too!)'," .
+ "'" . json_encode($attributes) . "')");
+
+?>
commit 68a984a1638c5513e2e066305c1957c449d2f645
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date: Thu Jun 21 13:15:56 2012 +0100
Update kolab_wap.sql
diff --git a/doc/kolab_wap-3.0.0.sql b/doc/kolab_wap-3.0.0.sql
index 641cadd..35a1422 100644
--- a/doc/kolab_wap-3.0.0.sql
+++ b/doc/kolab_wap-3.0.0.sql
@@ -3,9 +3,9 @@
-- http://www.phpmyadmin.net
--
-- Host: localhost
--- Generation Time: May 25, 2012 at 12:21 PM
--- Server version: 5.5.23
--- PHP Version: 5.4.1
+-- Generation Time: Jun 21, 2012 at 12:14 PM
+-- Server version: 5.5.13
+-- PHP Version: 5.3.10
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
@@ -94,6 +94,29 @@ INSERT INTO `resource_types` (`id`, `key`, `name`, `description`, `attributes`)
-- --------------------------------------------------------
--
+-- Table structure for table `role_types`
+--
+
+CREATE TABLE IF NOT EXISTS `role_types` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `key` text NOT NULL,
+ `name` varchar(256) NOT NULL,
+ `description` text NOT NULL,
+ `attributes` longtext NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `name` (`name`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
+
+--
+-- Dumping data for table `role_types`
+--
+
+INSERT INTO `role_types` (`id`, `key`, `name`, `description`, `attributes`) VALUES
+(1, 'simple_managed', 'Standard Role', 'A standard role definition', '{"auto_form_fields":[],"fields":{"objectclass":["top","ldapsubentry","nsroledefinition","nssimpleroledefinition","nsmanagedroledefinition"]},"form_fields":{"cn":[],"description":[]}}');
+
+-- --------------------------------------------------------
+
+--
-- Table structure for table `user_types`
--
More information about the commits
mailing list