[TYPO3-core] RFC: Inline Relational Record Editing (IRRE)

Ingmar Schlecht ingmar at typo3.org
Tue Dec 12 22:35:49 CET 2006

Hi guys,

here's Oliver's IRRE patch for Beta 2.

It contains the following changes:
  - The possibility to have relations from different parent pages to a
    child table
  - Automatic sorting by a "sortby" field (e.g. the title)
  - Whether the child records are expanded/collapsed is saved in uc now
  - Bugfixes to:
	* IRRE relation to the same table - relation field within child
	  elements isn't shown (http://bugs.typo3.org/view.php?id=4616)
	* IRRE relation to the same table shows new records twice

Oliver and me have just gone through the patch bit by bit during a Skype
session, and everything seems to be fine to me.

If no-one objects, I'd like to commit it on Thursday.


Ingmar Schlecht wrote:
> This is a SVN patch request.
> This patch introduces Inline Relational Record Editing (IRRE) for
> tceforms and is written by Oliver Hader as his diploma thesis. It has
> been intensively reviewed by Sebastian and me during a real-life meeting
> in Hof, Germany, last weekend.
> Description:
> The main feature of IRRE is as simple as editing sub-records inside the
> parent record, and being able to add new sub-records just by clicking a
> "+" icon, which then loads the form for the sub-record using AJAX,
> without annoying form submits in between.
> Examples of such 1:n sub-record relationships would be "products" that
> have multiple "prices", or "persons" that have many "email-addresses".
> However, IRRE doesn't only offer to manage those sub-record
> relationships (1:n relations), but can also be used to manage m:n
> relationships (with or without attributes) by treating the records of
> the mm-table itself as exactly the same kind of sub-record table
> mentioned above, with the slight addition of a uniqueness-check.
> Example for a normal 1:n relationship:
> Say you have two tables, products and prices and you want to be able to
> add multiple prices to a product with the prices displayed inside of the
> products form (inline). First you need to configure both of the tables
> as usual in TCA, and then add a new field called "prices" of the type
> "inline" to the products table with the foreign_table configured to be
> "prices". The TCA-Configuration of the "prices" field of the "products"
> table would look like this:
>     "prices" => Array (
>         "label" => "Prices",
>         "config" => Array (
>             "type" => "inline",
>                 // Name of the child table:
>             "foreign_table" => "prices",
>                  // Field of the prices table in which the uid of the
> product it belongs to is stored:
>             "foreign_field" => "product",
>         )
>     )
> Further reading:
> http://wiki.typo3.org/index.php/Inline_Relational_Record_Editing (it's a
> must-read for patch reviewers)
> You can try the feature with the test extension and the source tarball
> located at http://inpublica.de/typo3/
> Branch: trunk
> Now, for those who want to review the patch:
> Changes have mainly been made to these four classes:
> 	tcemain	      writing data
> 	tceforms      displaying the form, makes use of
> 		      the new class t3lib_tceforms_inline
> 	transferdata  preprocessing of relation data
> 	loaddbgroup   managing relations
> New files are:
> 	t3lib/jsfunc.inlinerelational.js
> 		JavaScript for the AJAX stuff
> 	t3lib/class.t3lib_tceforms_inline.php
> 		New functions that could have been put into tceforms are
> 		put to a separate file to not make tceforms even bigger
> 	typo3/json.php
> 		BSD-licensed PHP class to convert PHP arrays to
> 		JavaScript JSON objects. Very handy for AJAX development
> 	typo3/alt_doc_ajax.php
> 		Script that's called by the AJAX request when you add a
> 		new sub-item.
> Still missing in the attached patch is support for refindex, but Oliver
> has already added that in the meantime (see
> http://svn.t3.digitaldistrict.de/cgi-bin/trac.cgi/changeset/5788) and
> I'll include it when finally committing it.
> I think this patch should go into trunk soon, so there is enough time to
> test and fix it if needed.
> cheers
> Ingmar
-------------- next part --------------
A non-text attachment was scrubbed...
Name: typo3_4.1-beta2-irre.patch
Type: text/x-diff
Size: 57102 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20061212/30df38b8/attachment-0001.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: doc_core_api.sxw
Type: application/vnd.sun.xml.writer
Size: 57960 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20061212/30df38b8/attachment-0001.sxw 

More information about the TYPO3-team-core mailing list