word/edit: remap/rename priority levels
[sheet.git] / word / edit.plp
index f755f25752b76744373b4573147563c2c91214d4..8b9311c3db4200cc6c49463bebe53a42c30c03dd 100644 (file)
@@ -72,6 +72,7 @@ my $user = eval {
 };
 
 my %lang = (
+       '' => ['(reference)'],
        nl => ["\N{REGIONAL INDICATOR SYMBOL LETTER N}\N{REGIONAL INDICATOR SYMBOL LETTER L}", 'nederlands'],
        en => ["\N{REGIONAL INDICATOR SYMBOL LETTER G}\N{REGIONAL INDICATOR SYMBOL LETTER B}", 'english'],
        eo => [qq'<span style="color:green">\N{BLACK STAR}</span>', 'esperanto'],
@@ -89,7 +90,9 @@ my %wordcol = (
        prio    => [
                {-label => 'Level', -select => sub {
                        my ($row) = @_;
-                       my @enum = qw[ essential basic common distinctive optional invisible ];
+                       my @enum = qw[
+                               essential ubiquitous basic common distinctive specialised rare invisible
+                       ];
                        return {
                                ('' => 'parent') x (defined $row->{ref}),
                                map { $_ => $enum[$_] } 0 .. $#enum
@@ -158,7 +161,7 @@ elsif (defined $post{form}) {{
        my $imagecol = $row->{image};  # backup image subcolumns
        ref $_ eq 'HASH' and $_ = encode_json($_) for values %{$row};
 
-       if (!$row->{form}) {
+       if (!$row->{form} and $row->{lang}) {
                if ($row->{ref} ne 'delete') {
                        Alert("Empty title",
                                "Confirm removal by setting <em>Reference</em> to <q>delete</q>."
@@ -223,9 +226,9 @@ elsif (defined $post{form}) {{
        }
 }}
 else {
-       $row->{lang} //= $user->{editlang}->[0];
+       $row->{lang} //= $user->{editlang}->[0] unless exists $row->{lang};
        $row->{$_} = $get{$_} for keys %get;
-       $row->{prio} = defined $row->{ref} ? undef : 1 unless exists $row->{prio};
+       $row->{prio} = defined $row->{ref} ? undef : 4 unless exists $row->{prio};
 }
 
 eval {