Revision: 1396
http://mrbs.svn.sourceforge.net/mrbs/?rev=1396&view=rev
Author: cimorrison
Date: 2010-07-27 10:37:43 +0000 (Tue, 27 Jul 2010)
Log Message:
-----------
Updated documentation to cover custom fields in the entry and repeat tables.
Modified Paths:
--------------
mrbs/branches/custom_entry_fields/INSTALL
mrbs/branches/custom_entry_fields/web/edit_entry.php
Modified: mrbs/branches/custom_entry_fields/INSTALL
===================================================================
--- mrbs/branches/custom_entry_fields/INSTALL 2010-07-27 10:16:41 UTC (rev
1395)
+++ mrbs/branches/custom_entry_fields/INSTALL 2010-07-27 10:37:43 UTC (rev
1396)
@@ -126,17 +126,24 @@
ADDING EXTRA COLUMNS TO THE DATABASE TABLES
---------------------------------------------------------------------------
-It is possible to add extra columns to the room and users tables, if you need
-to hold extra information about rooms and users. For example you might want
-to add a column in the room table to record whether or not a room has a coffee
-machine and you might want to record the phone numbers of users. (Note that
-the users table is only used if you are using the 'db' authentication scheme).
+It is possible to add extra columns to the entry, repeat, room and users
+tables, if you need to hold extra information about bookings, rooms and users.
+For example you might want to add a column in the room table to record whether
+or not a room has a coffee machine and you might want to record the phone
+numbers of users. (Note that the users table is only used if you are using
+the 'db' authentication scheme). Similarly you might want to add a field
+to the entry and repeat tables to record the number of participants for
+a meeting.
To add extra columns, just go into your database administration tool, eg
phpMyAdmin, and add the extra columns manually. MRBS will then recognise them
and handle them automatically, displaying the information in the lists of rooms
and users and allowing you to edit the data in the appropriate forms.
+NOTE: if you are adding a field to the entry table you must add an
+identical field to the repeat table. If you do not MRBS will fail with
+a fatal error when you try and run it.
+
At the moment only text, varchar, int, smallint and tinyint columns are
supported, displayed as textarea, text or checkbox fields as appropriate.
Whether a varchar is displayed as a text or textarea input depends on its
@@ -145,7 +152,9 @@
Text descriptions are looked for in the lang files with the tag
room.column_name,
eg room.coffee_machine, or users.phone enabling translations to be provided.
-If not present, the column name will be used for labels etc.
+If not present, the column name will be used for labels etc. If you are adding
+columns to the entry and repeat tables then you only need to add the
+entry.column_name tags: you don't need to add a repeat.column_name tag.
[Note: smallints are assumed to be booleans because the boolean type in
PostgreSQL presents some problems in PHP when trying to process the results
Modified: mrbs/branches/custom_entry_fields/web/edit_entry.php
===================================================================
--- mrbs/branches/custom_entry_fields/web/edit_entry.php 2010-07-27
10:16:41 UTC (rev 1395)
+++ mrbs/branches/custom_entry_fields/web/edit_entry.php 2010-07-27
10:37:43 UTC (rev 1396)
@@ -1,6 +1,53 @@
<?php
// $Id$
+// If you want to add some extra columns to the entry and repeat tables to
+// record extra details about bookings then you can do so and this page should
+// automatically recognise them and handle them. NOTE: if you add a column
to
+// the entry table you must add an identical column to the repeat table.
+//
+// At the moment support is limited to the following column types:
+//
+// MySQL PostgreSQL Form input type
+// ----- ---------- ---------------
+// bigint bigint text
+// int integer text
+// mediumint text
+// smallint smallint checkbox
+// tinyint checkbox
+// text text textarea
+// tinytext textarea
+// character varying textarea
+// varchar(n) character varying(n) text/textarea, depending on the value of
n
+// character text
+// char(n) character(n) text/textarea, depending on the value of
n
+//
+// NOTE 1: For char(n) and varchar(n) fields, a text input will be presented if
+// n is less than or equal to $text_input_max, otherwise a textarea box will be
+// presented.
+//
+// NOTE 2: PostgreSQL booleans are not supported, due to difficulties in
+// handling the fields in a database independent way (a PostgreSQL boolean
+// will return a PHP boolean type when read by a PHP query, whereas a MySQL
+// tinyint returns an int). In order to have a boolean field in the room
+// table you should use a smallint in PostgreSQL or a smallint or a tinyint
+// in MySQL.
+//
+// You can put a description of the column that will be used as the label in
+// the form in the appropriate lang file(s) using the tag 'entry.[columnname]'.
+// (Note that it is not necessary to add a 'repeat.[columnname]' tag. The
+// entry tag is sufficient.)
+//
+// For example if you want to add a column recording the number of participants
+// you could add a column to the entry and repeat tables called 'participants'
+// of type int. Then in the appropriate lang file(s) you would add the line
+//
+// vocab["entry.participants"] = "Participants"; // or appropriate translation
+//
+// If MRBS can't find an entry for the field in the lang file, then it will use
+// the fieldname, eg 'coffee_machine'.
+
+
require_once "defaultincludes.inc";
require_once "mrbs_sql.inc";
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits