});
crmCaseType.controller('CaseTypeListCtrl', function($scope, crmApi, caseTypes) {
+ var ts = $scope.ts = CRM.ts(null);
+
$scope.caseTypes = caseTypes.values;
$scope.toggleCaseType = function (caseType) {
caseType.is_active = (caseType.is_active == '1') ? '0' : '1';
$scope.deleteCaseType = function (caseType) {
crmApi('CaseType', 'delete', {id: caseType.id}, {
error: function (data) {
- CRM.alert(data.error_message, ts('Error'));
+ CRM.alert(data.error_message, ts('Error'), 'error');
}
})
.then(function (data) {
<table class="form-layout-compressed">
<tbody>
<tr>
- <td class="label">Label</td>
+ <td class="label">{{ts('Label')}}</td>
<td>
<input type="text" name="label" ng-model="activitySet.label"/>
</td>
</tr>
<tr>
- <td class="label">Name</td>
+ <td class="label">{{ts('Name')}}</td>
<td>
<input type="text" name="name" ng-model="activitySet.name" ng-disabled="locks.activitySetName" />
<a crm-ui-lock binding="locks.activitySetName"></a>
</td>
</tr>
<tr>
- <td class="label">Workflow</td>
+ <td class="label">{{ts('Workflow')}}</td>
<td>
{{ getWorkflowName(activitySet) }}
</td>
<table>
<thead>
<tr>
- <th>Activity Type</th>
- <th>Max Instances</th>
+ <th>{{ts('Activity Type')}}</th>
+ <th>{{ts('Max Instances')}}</th>
<th></th>
</tr>
</thead>
<input class="number" type="text" ng-pattern="/^[0-9]*$/" ng-model="activityType.max_instances" />
</td>
<td>
- <a crm-icon="trash" class="crm-hover-button" ng-click="removeItem(caseType.definition.activityTypes, activityType)" title="Remove"></a>
+ <a crm-icon="trash" class="crm-hover-button" ng-click="removeItem(caseType.definition.activityTypes, activityType)" title="{{ts('Remove')}}"></a>
</td>
</tr>
</tbody>
<tfoot>
<tr class="addRow">
<td colspan="3">
- Add activity type:
+ {{ts('Add activity type:')}}
<span crm-add-name
crm-options="activityTypeNames"
crm-var="newActivity"
<a crm-ui-lock binding="locks.caseTypeName"></a>
<div ng-show="!isValidName(caseType.name)">
- <em>WARNING: The case type name includes deprecated characters.</em>
+ <em>{{ts('WARNING: The case type name includes deprecated characters.')}}</em>
</div>
<div ng-show="caseType.id && !locks.caseTypeName">
- <em>WARNING: If any external files or programs reference the old "Name", then they must be updated manually.</em>
+ <em>{{ts('WARNING: If any external files or programs reference the old "Name", then they must be updated manually.')}}</em>
</div>
</div>
<div crm-ui-field="{name: 'caseTypeDetailForm.description', title: ts('Description')}">
<form name="editCaseTypeForm" unsaved-warning-form>
<div class="crm-block crm-form-block crmCaseType">
<div class="help">
- Use this screen to define or update the Case Roles, Activity Types, and Timelines for a case type (<a href="http://book.civicrm.org/user/current/case-management/setup/" target="_blank">learn more...</a>).
+ {{ts('Use this screen to define or update the Case Roles, Activity Types, and Timelines for a case type.')}} <a href="http://book.civicrm.org/user/current/case-management/setup/" target="_blank">{{ts('Learn more...')}}</a>).
</div>
<div class="crm-submit-buttons">
- <span class="crm-button">
- <input type="submit" ng-click="editCaseTypeForm.$setPristine(); save()" ng-disabled="editCaseTypeForm.$invalid" value="Save" />
- </span>
- <span class="crm-button">
- <input type="submit" ng-click="editCaseTypeForm.$setPristine(); goto('caseType')" value="Cancel" />
- </span>
+ <button crm-icon="check" ng-click="editCaseTypeForm.$setPristine(); save()" ng-disabled="editCaseTypeForm.$invalid">
+ {{ts('Save')}}
+ </button>
+ <button crm-icon="close" ng-click="editCaseTypeForm.$setPristine(); goto('caseType')">
+ {{ts('Cancel')}}
+ </button>
</div>
<div ng-include="'~/crmCaseType/caseTypeDetails.html'"></div>
- <h2 ng-show="isForkable()">Roles</h2>
+ <h2 ng-show="isForkable()">{{ts('Roles')}}</h2>
<div ng-show="isForkable()" ng-include="'~/crmCaseType/rolesTable.html'"></div>
- <h2 ng-show="isForkable()">Activities</h2>
+ <h2 ng-show="isForkable()">{{ts('Activities')}}</h2>
<div ng-show="isForkable()" class="crmCaseType-acttab" ui-jq="tabs" ui-options="{show: true, hide: true}">
<ul>
- <li><a href="#acttab-actType">Activity Types</a></li>
+ <li><a href="#acttab-actType">{{ts('Activity Types')}}</a></li>
<li ng-repeat="activitySet in caseType.definition.activitySets">
<a href="#acttab-{{$index}}">{{ activitySet.label }}</a>
- <span class="ui-icon ui-icon-trash" title="Remove"
+ <span class="ui-icon ui-icon-trash" title="{{ts('Remove')}}"
ng-hide="activitySet.name == 'standard_timeline'"
- ng-click="removeItem(caseType.definition.activitySets, activitySet)">Remove</span>
+ ng-click="removeItem(caseType.definition.activitySets, activitySet)">{{ts('Remove')}}</span>
<!-- Weird spacing:
<a class="crm-hover-button" ng-click="removeItem(caseType.definition.activitySets, activitySet)">
<span class="ui-icon delete-icon" title="Remove">Remove</span>
</a>
-->
</li>
- <select ng-model="newActivitySetWorkflow" ng-change="addActivitySet(newActivitySetWorkflow); newActivitySetWorkflow='';">
- <option value="">(Add)</option>
- <option value="timeline" ng-show="isNewActivitySetAllowed('timeline')">Timeline</option>
- <option value="sequence" ng-show="isNewActivitySetAllowed('sequence')">Sequence</option>
+ <select class="crm-form-select" ng-model="newActivitySetWorkflow" ng-change="addActivitySet(newActivitySetWorkflow); newActivitySetWorkflow='';">
+ <option value="">{{ts('Add...')}}</option>
+ <option value="timeline" ng-show="isNewActivitySetAllowed('timeline')">{{ts('Timeline')}}</option>
+ <option value="sequence" ng-show="isNewActivitySetAllowed('sequence')">{{ts('Sequence')}}</option>
</select>
</ul>
<div ng-include="activityTableTemplate(activitySet)"></div>
<div class="crm-accordion-wrapper collapsed">
- <div class="crm-accordion-header">Advanced</div>
+ <div class="crm-accordion-header">{{ts('Advanced')}}</div>
<div class="crm-accordion-body" ng-include="'~/crmCaseType/activitySetDetails.html'"></div>
</div>
</div>
</div>
- <!--<button ng-click="dump()">Log</button>-->
<div class="crm-submit-buttons">
- <span class="crm-button">
- <input type="submit" ng-click="editCaseTypeForm.$setPristine(); save()" ng-disabled="editCaseTypeForm.$invalid" value="Save" />
- </span>
- <span class="crm-button">
- <input type="submit" ng-click="editCaseTypeForm.$setPristine(); goto('caseType')" value="Cancel" />
- </span>
+ <button crm-icon="check" ng-click="editCaseTypeForm.$setPristine(); save()" ng-disabled="editCaseTypeForm.$invalid">
+ {{ts('Save')}}
+ </button>
+ <button crm-icon="close" ng-click="editCaseTypeForm.$setPristine(); goto('caseType')">
+ {{ts('Cancel')}}
+ </button>
</div>
</div>
</form>
Required vars: caseTypes
-->
<div class="help">
- A Case Type describes a group of related tasks, interactions, or processes.
+ {{ts('A Case Type describes a group of related tasks, interactions, or processes.')}}
</div>
<table class="display">
<thead>
<tr>
- <th>Title</th>
- <th>Name</th>
- <th>Description</th>
- <th>Enabled?</th>
+ <th>{{ts('Title')}}</th>
+ <th>{{ts('Name')}}</th>
+ <th>{{ts('Description')}}</th>
+ <th>{{ts('Enabled?')}}</th>
<th></th>
</tr>
</thead>
<td>{{caseType.title}}</td>
<td>{{caseType.name}}</td>
<td>{{caseType.description}}</td>
- <td>{{caseType.is_active == 1 ? 'Yes' : 'No'}}</td>
+ <td>{{caseType.is_active == 1 ? ts('Yes') : ts('No')}}</td>
<!-- FIXME: Can't figure out how styling in other tables gets the nowrap effect... in absence of a consistent fix, KISS -->
<td style="white-space: nowrap">
<span>
- <a class="action-item crm-hover-button" ng-href="#/caseType/{{caseType.id}}">Edit</a>
+ <a class="action-item crm-hover-button" ng-href="#/caseType/{{caseType.id}}">{{ts('Edit')}}</a>
<span class="btn-slide crm-hover-button">
- more
+ {{ts('more')}}
<ul class="panel" style="display: none;">
<li ng-hide="caseType.is_active">
<a class="action-item crm-hover-button" ng-click="toggleCaseType(caseType)">
- Enable
+ {{ts('Enable')}}
</a>
</li>
<li ng-show="caseType.is_active">
<a class="action-item crm-hover-button"
crm-confirm="{type: 'disable', obj: caseType}"
on-yes="toggleCaseType(caseType)">
- Disable
+ {{ts('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
+ {{ts('Revert')}}
</a>
</li>
<li>
<a class="action-item crm-hover-button"
crm-confirm="{type: 'delete', obj: caseType}"
on-yes="deleteCaseType(caseType)">
- Delete
+ {{ts('Delete')}}
</a>
</li>
</ul>
</table>
<div class="crm-submit-buttons">
- <a ng-href="#/caseType/new" class="button"><span><div class="icon ui-icon-circle-plus"></div>New Case Type</span></a>
+ <a ng-href="#/caseType/new" class="button"><span><div class="icon ui-icon-circle-plus"></div>{{ts('New Case Type')}}</span></a>
</div>
\ No newline at end of file
<table>
<thead>
<tr>
- <th>Name</th>
- <th>Assign to Creator</th>
- <th>Is Manager</th>
+ <th>{{ts('Name')}}</th>
+ <th>{{ts('Assign to Creator')}}</th>
+ <th>{{ts('Is Manager')}}</th>
<th></th>
</tr>
</thead>
<td><input type="checkbox" ng-model="relType.creator" ng-true-value="1" ng-false-value="0"/></td>
<td><input type="radio" ng-model="relType.manager" value="1" ng-change="onManagerChange(relType)"/></td>
<td>
- <a crm-icon="trash" class="crm-hover-button" ng-click="removeItem(caseType.definition.caseRoles,relType)" title="Remove"></a>
+ <a crm-icon="trash" class="crm-hover-button" ng-click="removeItem(caseType.definition.caseRoles,relType)" title="{{ts('Remove')}}"></a>
</td>
</tr>
</tbody>
<tfoot>
<tr class="addRow">
<td colspan="4">
- Add role:
+ {{ts('Add role:')}}
<span crm-add-name
crm-options="relationshipTypeNames"
crm-var="newRole"
<table>
<thead>
<tr>
- <th>Activity</th>
+ <th>{{ts('Activity')}}</th>
<th></th>
</tr>
</thead>
{{ activity.name }}
</td>
<td>
- <a crm-icon="trash" class="crm-hover-button" ng-click="removeItem(activitySet.activityTypes, activity)" title="Remove"></a>
+ <a crm-icon="trash" class="crm-hover-button" ng-click="removeItem(activitySet.activityTypes, activity)" title="{{ts('Remove')}}"></a>
</td>
</tr>
</tbody>
<tfoot>
<tr class="addRow">
<td colspan="3">
- Add activity:
+ {{ts('Add activity:')}}
<span crm-add-name
crm-options="activityTypeNames"
crm-var="newActivity"
<table>
<thead>
<tr>
- <th>Activity</th>
- <th>Status</th>
- <th>Reference</th>
- <th>Offset</th>
- <th>Select</th>
+ <th>{{ts('Activity')}}</th>
+ <th>{{ts('Status')}}</th>
+ <th>{{ts('Reference')}}</th>
+ <th>{{ts('Offset')}}</th>
+ <th>{{ts('Select')}}</th>
<th></th>
</tr>
</thead>
crm-icon="trash"
ng-show="isActivityRemovable(activitySet, activity)"
ng-click="removeItem(activitySet.activityTypes, activity)"
- title="Remove">
+ title="{{ts('Remove')}}">
</a>
</td>
</tr>
<tfoot>
<tr class="addRow">
<td colspan="6">
- Add activity:
+ {{ts('Add activity:')}}
<span crm-add-name
crm-options="activityTypeNames"
crm-var="newActivity"