Modifier: add a description field

fixes #465
This commit is contained in:
Thomas Gelf 2017-07-14 14:45:25 +02:00
parent 2cdba2aa65
commit 95769c3ee2
6 changed files with 33 additions and 2 deletions

View File

@ -41,6 +41,15 @@ class ImportRowModifierForm extends DirectorObjectForm
),
));
$this->addElement('textarea', 'description', array(
'label' => $this->translate('Description'),
'description' => $this->translate(
'An extended description for this Import Row Modifier. This should explain'
. " it's purpose and why it has been put in place at all."
),
'rows' => '3',
));
$error = false;
try {
$mods = $this->enumModifiers();

View File

@ -12,11 +12,19 @@ class PropertymodifierTable extends QuickTable
'id' => 'm.id',
'source_id' => 'm.source_id',
'source_name' => 's.source_name',
'property' => 'CASE WHEN m.target_property IS NULL'
'property' => 'CASE WHEN m.description IS NULL THEN'
. ' CASE WHEN m.target_property IS NULL'
. ' THEN m.property_name'
. " ELSE m.target_property || ' <- ' || m.property_name END",
. " ELSE m.target_property || ' <- ' || m.property_name END"
. ' ELSE'
. ' CASE WHEN m.target_property IS NULL'
. ' THEN m.property_name'
. " ELSE m.target_property || ' <- ' || m.property_name END"
. " || ': ' || m.description END",
'provider_class' => 'm.provider_class',
'priority' => 'm.priority',
'description' => 'CASE WHEN s.description IS NULL THEN s.source_name'
. " ELSE s.source_name || ': ' || s.description END",
);
}

View File

@ -0,0 +1,6 @@
ALTER TABLE import_row_modifier
ADD COLUMN description TEXT DEFAULT NULL;
INSERT INTO director_schema_migration
(schema_version, migration_time)
VALUES (138, NOW());

View File

@ -1270,6 +1270,7 @@ CREATE TABLE import_row_modifier (
target_property VARCHAR(255) DEFAULT NULL,
provider_class VARCHAR(72) NOT NULL,
priority SMALLINT UNSIGNED NOT NULL,
description TEXT DEFAULT NULL,
PRIMARY KEY (id),
KEY search_idx (property_name),
CONSTRAINT row_modifier_import_source

View File

@ -0,0 +1,6 @@
ALTER TABLE import_row_modifier
ADD COLUMN description text DEFAULT NULL;
INSERT INTO director_schema_migration
(schema_version, migration_time)
VALUES (138, NOW());

View File

@ -1406,6 +1406,7 @@ CREATE TABLE import_row_modifier (
target_property character varying(255) DEFAULT NULL,
provider_class character varying(72) NOT NULL,
priority integer NOT NULL,
description text DEFAULT NULL,
PRIMARY KEY (id),
CONSTRAINT row_modifier_import_source
FOREIGN KEY (source_id)