[Rt-commit] rt branch, 4.6/inline-edit, updated. rt-4.4.1-131-g6f58934
Shawn Moore
shawn at bestpractical.com
Mon Sep 12 15:49:11 EDT 2016
The branch, 4.6/inline-edit has been updated
via 6f589346cd77d1b003901f64e5a0b8a4f022010c (commit)
via a964e352dda93d04cda3323b95578c71ebde0da2 (commit)
from ff2dfc5ceed6783e8fe9bced3949dd6b1099f72b (commit)
Summary of changes:
etc/RT_Config.pm.in | 9 +++++++++
lib/RT/Config.pm | 9 +++++++++
share/html/Elements/CollectionAsTable/Row | 3 +++
share/static/js/util.js | 3 ++-
4 files changed, 23 insertions(+), 1 deletion(-)
- Log -----------------------------------------------------------------
commit a964e352dda93d04cda3323b95578c71ebde0da2
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Mon Sep 12 19:31:04 2016 +0000
Capture tbody sooner
This way we better avoid inconsistencies if the DOM changes before the ajax
response comes back.
diff --git a/share/static/js/util.js b/share/static/js/util.js
index f9abdc2..1bda962 100644
--- a/share/static/js/util.js
+++ b/share/static/js/util.js
@@ -593,6 +593,7 @@ jQuery(function () {
jQuery(document).on('focusout', 'td.editing form', function () {
var editor = jQuery(this);
var cell = editor.closest('td');
+ var tbody = cell.closest('tbody');
var value = cell.find('.value');
var params = editor.serialize();
@@ -615,7 +616,7 @@ jQuery(function () {
},
complete : function () {
refreshCollectionListRow(
- cell.closest('tbody'),
+ tbody,
function () { },
function (xhr, error) {
jQuery.jGrowl(error, { sticky: true, themeState: 'none' });
commit 6f589346cd77d1b003901f64e5a0b8a4f022010c
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Mon Sep 12 19:49:01 2016 +0000
Add InlineEdit config and preference
diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 4627f22..4b4dfeb 100644
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1457,6 +1457,15 @@ ticket display page automatically.
Set($SearchResultsAutoRedirect, 0);
+=item C<$InlineEdit>
+
+Allows users to update tickets directly on search results and ticket display
+pages.
+
+=cut
+
+Set($InlineEdit, 1);
+
=back
diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index dfb3a61..5d3c109 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -527,6 +527,15 @@ our %META;
Description => 'Hide unset fields?' # loc
}
},
+ InlineEdit => {
+ Section => 'Ticket display',
+ Overridable => 1,
+ SortOrder => 12,
+ Widget => '/Widgets/Form/Boolean',
+ WidgetArguments => {
+ Description => 'Enable inline edit?' # loc
+ }
+ },
# User overridable locale options
DateTimeFormat => {
diff --git a/share/html/Elements/CollectionAsTable/Row b/share/html/Elements/CollectionAsTable/Row
index c11c8c0..688d77f 100644
--- a/share/html/Elements/CollectionAsTable/Row
+++ b/share/html/Elements/CollectionAsTable/Row
@@ -55,6 +55,7 @@ $Warning => undef
$ColumnMap => {}
$Class => 'RT__Ticket'
$Classes => ''
+$InlineEdit => RT->Config->Get('InlineEdit', $session{CurrentUser})
</%ARGS>
<%init>
$m->out( '<tbody class="list-item" data-index="'.$m->interp->apply_escapes($i, 'h').'" ' . ( $record->can('id') ? ' data-record-id="'.$record->id.'"' : '' ) . ( $Warning ? ' data-warning=1' : ''). '>' );
@@ -106,6 +107,8 @@ foreach my $column (@Format) {
);
}
+ delete $attrs{edit} if !$InlineEdit;
+
$attrs{colspan} = $column->{span};
$item += ($attrs{'colspan'} || 1);
-----------------------------------------------------------------------
More information about the rt-commit
mailing list