.crmCaseType table td select {
width: 10em;
+}
+
+tr.forked {
+ font-weight: bold;
}
\ No newline at end of file
})
};
},
+ 'revert': function (options) {
+ return {
+ message: ts('Are you sure you want to revert this?'),
+ options: {no: ts('Cancel'), yes: ts('Revert')},
+ width: 300,
+ title: ts('Revert %1?', {
+ 1: options.obj.title || options.obj.label || options.obj.name || ts('the record')
+ })
+ };
+ },
'delete': function (options) {
return {
message: ts('Are you sure you want to delete this?'),
}
});
};
+ $scope.revertCaseType = function (caseType) {
+ caseType.definition = 'null';
+ caseType.is_forked = '0';
+ crmApi('CaseType', 'create', caseType, true)
+ .then(function (data) {
+ if (data.is_error) {
+ caseType.is_forked = '1'; // restore
+ $scope.$digest();
+ }
+ });
+ };
});
})(angular, CRM.$, CRM._);
\ No newline at end of file
class="crm-entity"
ng-class-even="'even-row even'"
ng-class-odd="'odd-row odd'"
- ng-class="{disabled: 0==caseType.is_active}">
+ ng-class="{disabled: 0==caseType.is_active, forked: 1==caseType.is_forked}">
<td>{{caseType.title}}</td>
<td>{{caseType.name}}</td>
<td>{{caseType.description}}</td>
Disable
</a>
</li>
+ <li ng-show="caseType.is_forked">
+ <a class="action-item crm-hover-button"
+ crm-confirm="{type: 'revert', obj: caseType}"
+ on-yes="revertCaseType(caseType)">
+ Revert
+ </a>
+ </li>
<li>
<a class="action-item crm-hover-button"
crm-confirm="{type: 'delete', obj: caseType}"