Skip to content

Commit

Permalink
boolean comparison fails when string or not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
demeritcowboy committed Jan 20, 2020
1 parent 43c175b commit 6fc8ca2
Show file tree
Hide file tree
Showing 2 changed files with 1,490 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ang/crmCaseType/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,29 +35,30 @@ <h1 crm-page-title>{{ts('Case Types')}}</h1>
<span>
<a class="action-item crm-hover-button" ng-href="#/caseType/{{caseType.id}}">{{ts('Edit')}}</a>

<span class="btn-slide crm-hover-button" ng-show="!caseType.is_reserved || (!caseType.is_active || caseType.is_forked)">
<!-- The variables used in ng-show below can take on any of the values from the set {0, 1, "0", "1", undefined}, so use explicit ==1 or !=1 to cover all possibilities properly. -->
<span class="more-panel btn-slide crm-hover-button" ng-show="caseType.is_reserved!=1 || (caseType.is_active!=1 || caseType.is_forked==1)">
{{ts('more')}}
<ul class="panel" style="display: none;">
<li ng-hide="caseType.is_active">
<li class="panel-item-enable" ng-hide="caseType.is_active==1">
<a class="action-item crm-hover-button" ng-click="toggleCaseType(caseType)">
{{ts('Enable')}}
</a>
</li>
<li ng-show="caseType.is_active && !caseType.is_reserved">
<li class="panel-item-disable" ng-show="caseType.is_active==1 && caseType.is_reserved!=1">
<a class="action-item crm-hover-button"
crm-confirm="{type: 'disable', obj: caseType}"
on-yes="toggleCaseType(caseType)">
{{ts('Disable')}}
</a>
</li>
<li ng-show="caseType.is_forked">
<li class="panel-item-revert" ng-show="caseType.is_forked==1">
<a class="action-item crm-hover-button"
crm-confirm="{type: 'revert', obj: caseType}"
on-yes="revertCaseType(caseType)">
{{ts('Revert')}}
</a>
</li>
<li ng-show="!caseType.is_reserved">
<li class="panel-item-delete" ng-show="caseType.is_reserved!=1">
<a class="action-item crm-hover-button"
crm-confirm="{type: 'delete', obj: caseType}"
on-yes="deleteCaseType(caseType)">
Expand Down
Loading

0 comments on commit 6fc8ca2

Please sign in to comment.