Up to [Local Repository] / interchange / code / UI_Tag
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
consistent usage of "No records" string (#43)
Fix incorrect license in headers GPL v2 -> GPL v2 "or later". Update copyrights.
Fix incorrect license in headers GPL v2 -> GPL v2 "or later". Update copyrights.
* Move filter/label resolution forward so that sorts don't kill them. * Make flex_group.html more flexible by allowing calls from pages besides flex_select.html.
Big copyright and version number update to prepare for 5.3.2 release.
* Add ability to put a radio box in the flex-select form. Allows many-to-one targeting such as a user merge feature.
Header/license fix or Version update+minor formatting fix, or both
* Fix problem where we don't reject multiple return tables.
* Fix missing mv_session_id instances found by Sean Benton (IC@neurometrics.net).
* Make ui_meta_view apply to "edit checked".
* Change MULTIPLE_KEYS to COMPOSITE_KEY for better intuitiveness.
* Add new Class DBI_CompositeKey which allows multiple-key tables to
be used in Interchange in the majority of ways other tables are
used.
Setup is simple. Just use a normal DBI looking table, then
add
Database foo MULTIPLE_KEYS key1 key2 key3
This implies:
Database foo Class DBI_CompositeKey
If you have not already set up the table as a DBI type
(i.e. "Database foo foo.txt dbi:mysql:foobase") then
this will fail.
You should definitely have a COLUMN_DEF for each key. CREATE_SQL
or using NoImport works fine, too.
If you want a unique constraint you have to add it. If you
don't have unique set, you may get anomalous behavior.
-- Keys are passed via arrays, hashes, or null-separation. For
instance:
[data table=foo col=value1 key.0=foo key.1=bar key.2=baz]
[data table=foo col=value1 key.key1=foo key.key2=bar key.key3=baz]
[data table=foo col=value1 key=` join "\0", qw/foo bar baz/`]
All three of the above will return the same thing, as will:
[perl tables=foo]
my $db = $Db{foo};
my @key = qw/foo bar baz/;
my %key = (
key1 => 'foo',
key2 => 'bar',
key3 => 'baz',
);
my $try1 = $db->field(\@key, 'value1');
my $try2 = $db->field(\%key, 'value1');
my $try3 = $db->field( join("\0", @key), 'value1');
if($try1 eq $try2 and $try1 eq $try3) {
return "Access methods returned same value.";
}
else {
return "ERROR: Access methods returned differing values.";
}
[/perl]
-- [import-fields table=foo] works, but the {cleanse} option is
not allowed.
-- [import table=foo ...] works.
-- Exports work.
-- Imports from text files work, i.e. removing .sql file.
-- Table editor works.
-- Flex-select works. There is not as yet a batch delete, but that
should be possible in the future. "Edit keys in sequence" is unlikely
to ever work.
-- Autonumbering and AUTO_SEQUENCE are obviously moot.
-- $db->set_slice(), $db->get_slice work. So does $db->delete_record().
All use the same key types as other access methods.
-- $db->set_row() works, but doesn't do the one-field insert behavior.
Probably a plus. 8-) It should set _Default_ary, but that is not
tested.
* Allow filter to be passed as parameter to [flex-select].
[flex-select
filter.order_date=convert_date
table=transactions
/]
will put that filter in without having to define the field metadata
or the mv_data_fields setting.
Mods so that key column can have formatting options via mv_metadata just like all other columns in a table. This is a bit different than my original RFC mod post: added in logic for calcs and entity encoding. The value that is passed to the flex_editor is unadulterated in all cases.
Added hard-coded 'nh=1' to override HIDE_FIELD setting for any table in UI
* Put the query-by-example form back in flex_select (triggered by the LARGE parameter in database definition). * Fix the long-standing problem that sorts and groupings would not work on query-by-example search returns.
* Enhance flex_select to accept a SQL query either in the opt hash or from metadata. There are some shortcomings: -- More list cannot be used -- Limit can be used but as we said, no more list Will change the column header/label value if a field is specified with "field as 'Header value'". * TODO: Handle count(*), max(*), etc. and GROUP BY. Maybe someday -- would be a nice report display mechanism.
* Add [flex-select] tag, complete replacement for and enhancement to
the admin/flex_select.html page in the UI.
* Each colunn can have individual sort settings, and can individually
be specified to use alphabetic more lists when it is the sorting
column. (ui_more_alpha, ui_sort_option)
* Group "magnifying glass" can be turned off in metadata. (fs_no_group)
* Filters can be specified in metadata instead of just ui_data_fields.
(fs_display_filter)
* Links to other pages specifying the field value can be done
easily. For example, to add a per-sku link on the products
table to the item_options page, put in ui_data_fields
sku
sku-options
price
description
In the metadata for products::sku-options, do:
'extended.fs_link_page' => 'admin/item_options',
'extended.fs_link_parm' => 'item_id',
'extended.fs_link_anchor' => 'Edit Options',
That will produce:
<a href="__CGI_URL__/admin/item_options?item_id=SKU">Edit Options</a>
Can be shorthand-set in ui_data_fields with:
sku
sku-admin/item_options:item_id:Edit Options
price
description
* Columns can be calculated values by putting embedded perl code in
fs_data_calc. The current row hash (with all values in the select colums)
is put in $Vend::Interpolate::item. You can set tables to be pre-opened
in fs_data_tables.
This code in products::prod_group::extended.fs_data_calc:
if($item->{prod_group} eq $prev) {
return "''";
}
else {
return $prev = $item->{prod_group};
}
will produce ditto marks if a prod_group is duplicated.
* An explicit "edit record" link can be enabled. (explicit_edit)
* The edit link on the key column can be disabled. (no_code_link)
* Checkboxes can be disabled. (no_checkbox)
* Check All/Uncheck All JavaScript links can be automatically inserted.
(check_uncheck_all)
* The lines can be numbered. (number_list)
* Header cell and data cell CSS is completely settable in metadata on a
per-column basis.
'extended.header_link_class' => 'Header row link CSS class',
'extended.header_cell_class' => 'Header cell CSS class',
'extended.header_cell_style' => 'Header cell CSS style',
'extended.data_cell_class' => 'Data cell CSS class',
'extended.data_cell_style' => 'Data cell CSS style',
While no metadata edit is provided for data_cell_width, data_cell_height,
data_cell_align, they would be honored if set.
The header rows and data rows can be set in the table metadata:
'extended.header_row_class' => 'Header row CSS class',
'extended.header_row_style' => 'Header row CSS style',
'extended.data_row_class_odd' => 'Data row CSS class, odd numbers',
'extended.data_row_class_even' => 'Data row CSS class, even numbers',