[Rt-commit] rt branch 5.0/add-boolean-select-render-type-special-unset created. rt-5.0.3-127-g5e295c5e29

BPS Git Server git at git.bestpractical.com
Mon Oct 3 13:11:01 UTC 2022


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 5.0/add-boolean-select-render-type-special-unset has been created
        at  5e295c5e29c12a3d80208fae2cbe67286cbdc04d (commit)

- Log -----------------------------------------------------------------
commit 5e295c5e29c12a3d80208fae2cbe67286cbdc04d
Author: Brian Conry <bconry at bestpractical.com>
Date:   Mon Jul 11 15:45:20 2022 -0500

    Add option for special rendering of an unset CF
    
    Previously all unset custom fields were rendered as '(no value)'.
    
    Thic change adds logic to look for a comp named:
    '/Elements/ShowCustomField' . ${CFType} . ${CFRenderType} . 'Unset'
    and use that component if it exists.  This allows a custom field
    type/render type combination to customize its display when unset.
    
    Without this change a Checkbox custom field displays as '(no value0"
    instead of as an unchecked box.

diff --git a/share/html/Elements/ShowCustomFieldSelectCheckboxUnset b/share/html/Elements/ShowCustomFieldSelectCheckboxUnset
new file mode 100644
index 0000000000..d5fe6acc8f
--- /dev/null
+++ b/share/html/Elements/ShowCustomFieldSelectCheckboxUnset
@@ -0,0 +1,51 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2022 Best Practical Solutions, LLC
+%#                                          <sales at bestpractical.com>
+%#
+%# (Except where explicitly superseded by other copyright notices)
+%#
+%#
+%# LICENSE:
+%#
+%# This work is made available to you under the terms of Version 2 of
+%# the GNU General Public License. A copy of that license should have
+%# been provided with this software, but in any event can be snarfed
+%# from www.gnu.org.
+%#
+%# This work is distributed in the hope that it will be useful, but
+%# WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+%# General Public License for more details.
+%#
+%# You should have received a copy of the GNU General Public License
+%# along with this program; if not, write to the Free Software
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
+%#
+%#
+%# CONTRIBUTION SUBMISSION POLICY:
+%#
+%# (The following paragraph is not intended to limit the rights granted
+%# to you to modify and distribute this software under the terms of
+%# the GNU General Public License and is only of importance to you if
+%# you choose to contribute your changes and enhancements to the
+%# community by submitting them to Best Practical Solutions, LLC.)
+%#
+%# By intentionally submitting any modifications, corrections or
+%# derivatives to this work, or any other work intended for use with
+%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+%# you are the copyright holder for those contributions and you grant
+%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
+%# royalty-free, perpetual, license to use, copy, create derivative
+%# works based on those contributions, and sublicense and distribute
+%# those contributions and any derivatives thereof.
+%#
+%# END BPS TAGGED BLOCK }}}
+<input type="checkbox" disabled="disabled" class="custom-control"/>
+<%ARGS>
+$CustomFieldObj => undef
+</%ARGS>
diff --git a/share/html/Elements/ShowCustomFields b/share/html/Elements/ShowCustomFields
index 25d403f11f..fc6c7dc8b5 100644
--- a/share/html/Elements/ShowCustomFields
+++ b/share/html/Elements/ShowCustomFields
@@ -83,7 +83,12 @@ if ( $CustomField->LookupType eq 'RT::Queue-RT::Ticket-RT::Transaction' ) {
     <div class="value col-<% $ValueCols %> <% $count ? '' : ' no-value' %>">
       <span class="current-value">
 % unless ( $count ) {
+%   my $comp = 'ShowCustomField' . $CustomField->Type . $CustomField->RenderType . 'Unset';
+%   if ( $m->comp_exists( $comp ) ) {
+%       $m->comp( $comp, CustomFieldObj => $CustomField );
+%   } else {
 <&|/l&>(no value)</&>
+%   }
 % } elsif ( $count == 1 ) {
 %   $print_value->( $CustomField, $Values->First );
 % } else {

-----------------------------------------------------------------------


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list