Skip to content

Commit

Permalink
Merge pull request osTicket#5204 from aydreeihn/issue/inline-field-in…
Browse files Browse the repository at this point in the history
…tegrity

Inline Edit Fields With Data Integrity
  • Loading branch information
protich authored Nov 25, 2019
2 parents 933bb1f + 6015d04 commit 7578d5c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 0 additions & 1 deletion include/class.forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -1332,7 +1332,6 @@ function getLocal($subtag, $default=false) {
}

function getEditForm($source=null) {

$fields = array(
'field' => $this,
'comments' => new TextareaField(array(
Expand Down
2 changes: 1 addition & 1 deletion include/staff/templates/dynamic-form.tmpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
?>" data-entry-id="<?php echo $field->getAnswer()->get('entry_id');
?>"> <i class="icon-trash"></i> </a></div><?php
}
if ($a && !$a->getValue() && $field->isRequiredForClose()) {
if ($a && !$a->getValue() && $field->isRequiredForClose() && get_class($field) != 'BooleanField') {
?><i class="icon-warning-sign help-tip warning"
data-title="<?php echo __('Required to close ticket'); ?>"
data-content="<?php echo __('Data is required in this field in order to close the related ticket'); ?>"
Expand Down
7 changes: 7 additions & 0 deletions include/staff/ticket-view.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,13 @@ class="icon-building icon-fixed-width"></i> <?php
}
else
echo $v;

$a = $field->getAnswer();
$hint = ($field->isRequiredForClose() && $a && !$a->getValue() && get_class($field) != 'BooleanField') ?
sprintf('<i class="icon-warning-sign help-tip warning field-label" data-title="%s" data-content="%s"
/></i>', __('Required to close ticket'),
__('Data is required in this field in order to close the related ticket')) : '';
echo $hint;
?>
</a>
<?php
Expand Down

0 comments on commit 7578d5c

Please sign in to comment.