<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Custom_fields</title><link>https://sourceforge.net/p/postfixadmin/wiki/Custom_fields/</link><description>Recent changes to Custom_fields</description><atom:link href="https://sourceforge.net/p/postfixadmin/wiki/Custom_fields/feed" rel="self"/><language>en</language><lastBuildDate>Sat, 03 Jan 2015 22:02:15 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/postfixadmin/wiki/Custom_fields/feed" rel="self" type="application/rss+xml"/><item><title>Custom_fields modified by Christian Boltz</title><link>https://sourceforge.net/p/postfixadmin/wiki/Custom_fields/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -19,6 +19,7 @@

 * use a table name starting with "x_"
 * within that table, you can use any field and index names you want
+* you might want to have the fields "created", "modified" and "active" (which exist in most PostfixAdmin tables)
 * you may also create unique keys inside your tables
 * if you use PostgreSQL, names for indexes and unique keys must start with "x_" (better: "x_tablename_")
 * avoid foreign keys to PostfixAdmin's default tables if possible.
@@ -26,8 +27,15 @@
 Integrating the additional fields in PostfixAdmin
 ---

-After you have added your fields and/or tables to the database,
-* create the additional fields or tables in your database.
+### PostfixAdmin &amp;gt;= 3.0 ###
+
+* create the additional fields or tables in your database
+* write a *_struct_hook() function (see the x_struct_admin_modify() example in config.inc.php) to integrate your custom fields in PostfixAdmin
+* enable that function in $CONF\[*_struct_hook]
+
+You can also use a *_struct_hook() function to change or remove existing fields.
+
+### PostfixAdmin 2.3.x and older ###
+
+* create the additional fields or tables in your database
 * edit the PHP scripts and the templates to add your custom fields
-
-Future versions of PostfixAdmin (3.0) will provide an easier way to integrate custom fields, however it will take some time until we have that code ready.
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Christian Boltz</dc:creator><pubDate>Sat, 03 Jan 2015 22:02:15 -0000</pubDate><guid>https://sourceforge.net66bf9bef0191631e279f3e26a472a61e4db12073</guid></item><item><title>Custom_fields modified by Christian Boltz</title><link>https://sourceforge.net/p/postfixadmin/wiki/Custom_fields/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;From time to time we get requests for adding some fields in PostfixAdmin. Many of them are specific for one user and therefore don't end up in the official code. &lt;/p&gt;
&lt;p&gt;This page describes what you can do yourself.&lt;/p&gt;
&lt;h2 id="policy-for-database-changes"&gt;Policy for database changes&lt;/h2&gt;
&lt;p&gt;This policy is important to avoid that your custom fields conflict with any fields, tables or indexes we might add in future versions of PostfixAdmin.&lt;/p&gt;
&lt;h2 id="additional-fields-in-existing-tables"&gt;Additional fields in existing tables&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;you can use any fieldname starting with "x_"&lt;/li&gt;
&lt;li&gt;you can create indexes if needed - also prefix them with x_ (or tablename_x_ for PostgreSQL)&lt;/li&gt;
&lt;li&gt;avoid creating unique indexes and foreign keys if possible (they could make scheme changes difficult)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="additional-tables"&gt;Additional tables&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;use a table name starting with "x_"&lt;/li&gt;
&lt;li&gt;within that table, you can use any field and index names you want&lt;/li&gt;
&lt;li&gt;you may also create unique keys inside your tables&lt;/li&gt;
&lt;li&gt;if you use PostgreSQL, names for indexes and unique keys must start with "x_" (better: "x_tablename_")&lt;/li&gt;
&lt;li&gt;avoid foreign keys to PostfixAdmin's default tables if possible.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="integrating-the-additional-fields-in-postfixadmin"&gt;Integrating the additional fields in PostfixAdmin&lt;/h2&gt;
&lt;p&gt;After you have added your fields and/or tables to the database,&lt;br /&gt;
&lt;em&gt; create the additional fields or tables in your database.&lt;br /&gt;
&lt;/em&gt; edit the PHP scripts and the templates to add your custom fields&lt;/p&gt;
&lt;p&gt;Future versions of PostfixAdmin (3.0) will provide an easier way to integrate custom fields, however it will take some time until we have that code ready.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Christian Boltz</dc:creator><pubDate>Sat, 25 Oct 2014 20:49:24 -0000</pubDate><guid>https://sourceforge.neta39444229d3a7652c044a7a86f524934c812d535</guid></item></channel></rss>