Hi again
Peter Guhl schrieb:
Got the diff. Since it’s small I think I can post it (if I was wrong I
will soon find out
Here’s a diff agains the latest repository (at least the one which was
the latest yesterday No tests done yet, but I still think I may post it:
Index: D:/wwwroot/svn-etemplate/inc/class.db_tools.inc.php
— D:/wwwroot/svn-etemplate/inc/class.db_tools.inc.php (revision 25192)
+++ D:/wwwroot/svn-etemplate/inc/class.db_tools.inc.php (working copy)
@@ -22,6 +22,7 @@
‘needs_save’ => True,
);
- // $debug >= 5 shows debugging output
var $debug = 0;
var $editor; // editor eTemplate
var $data; // Table definitions
@@ -226,6 +227,7 @@
*/
function
needs_save($cont=’’,$posted_app=’’,$posted_table=’’,$edited_table=’’,$msg=’’)
{
-
//DEBUG
//echo
“
db_tools::needs_save(cont,’$posted_app’,’$posted_table’,edited_table,’$msg’)
cont=\n”; _debug_array($cont); echo “edited_table=”;
_debug_array($edited_table);
if (!$posted_app && is_array($cont))
{
@@ -250,7 +252,7 @@
}
if (!$this->write($this->app,$this->data))
{
ones, the users whiches to change too
ones, the users wishes to change too
$this->table = $cont[‘new_table’];
return
$this->needs_save(’’,$cont[‘app’],$cont[‘table’],$cont[‘edited_table’],
@@ -278,11 +280,13 @@
if (isset($this->data[$posted_table]) &&
$this->tables_identical($this->data[$posted_table],$edited_table))
{
or hit the user just write
app, or hit the user just write
{
$this->app = $new_app; // if we change init the data
empty
$this->data = array();
}
@@ -364,6 +368,10 @@
{
$col_defs[‘default’] = is_int($col_defs[‘default’]) ?
‘0’ : “’’”; // spezial value for empty, but set, default
}
$col_defs[‘filterpath’] == ‘’)
is_int($col_defs[‘filterpath’]) ? ‘0’ : “’’”; // spezial value for
empty, but set, filterpath
!$col_defs[‘nullable’];
$col_defs['n'] = $n;
@@ -458,6 +466,7 @@
switch ($prop)
{
case ‘default’:
not empty
case ‘precision’:
case ‘scale’:
@@ -1022,7 +1031,8 @@
‘precision’ => 0+$props[‘precision’],
‘scale’ => 0+$props[‘scale’],
‘nullable’ => !isset($props[‘nullable’]) ||
!!$props[‘nullable’],
@@ -1047,6 +1057,7 @@
$a = serialize($this->normalize($a));
$b = serialize($this->normalize($b));
: ‘False’)."
\n";
//echo “a: $a
\nb: $b
\n”;
You already have the .xet-File in this thread.
For making this a generally usable patch it might be better to rename
all “filterpath”-entries into “comment” (including, of course, the
column in the template). “filterpath” is what I need since I try to get
sort of a report generator working and this entry stores metadata to
build a category tree with all the fields the user should be able to
choose (in a way normal users might have a tiny chance of not getting
lost…).
In general you can add as many fields as you like just by adding a new
column to the template db-tools.edit and place appropriate handling of
the new field in any place “filterpath” pops out in this diff (there are
a few more lines which only contain a few clarifications and debuggings
I needee for finding out what’s going on in here - you can ignore that
if you like). Then the contents of these fields will be entered in the
table structure array of tables_current.inc.php and become part of the
table description in the db-object (they will not become part of the
databas structure itself - in most cases I think this is desired that
way since in most cases the database will be unable to store that meta
information anyway).
Regards
Peter
–
mit freundlichen Grüssen
Peter Guhl
Win-Lux GmbH
Obere Schöntalstrasse 22
CH - 8406 Winterthur
Telefon: +41 (0)81 330 51 51
Mobil +41 (0)76 437 03 09
Fax: +41 (0)81 332 44 58
Mail: peter.guhl@win-lux.ch
Skype: p_guhl
Web: http://www.win-lux.ch
******************* Vertraulichkeitserklärung ***********************
Diese Mitteilung resp. deren Beilagen können vertrauliche und/oder
persönliche Informationen enthalten, die einzig für den adressierten
Empfänger bestimmt sind. Jegliche Kenntnisnahme oder Weiterleitung durch
oder an Dritte ist untersagt. Wenn Sie nicht der adressierte Empfänger sind,
nehmen Sie bitte Kontakt mit dem Absender der Nachricht auf und löschen
Sie alle Kopien. Vielen Dank.
Check out the new SourceForge.net Marketplace.
It’s the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers