diff options
Diffstat (limited to 'www/crm/wp-content/plugins/civicrm/civicrm/ang/crmCaseType')
8 files changed, 485 insertions, 0 deletions
diff --git a/www/crm/wp-content/plugins/civicrm/civicrm/ang/crmCaseType/activityTypesTable.html b/www/crm/wp-content/plugins/civicrm/civicrm/ang/crmCaseType/activityTypesTable.html new file mode 100644 index 00000000..a324f895 --- /dev/null +++ b/www/crm/wp-content/plugins/civicrm/civicrm/ang/crmCaseType/activityTypesTable.html @@ -0,0 +1,46 @@ +<!-- +Controller: CaseTypeCtrl +Required vars: caseType +--> +<table class="row-highlight"> + <thead> + <tr> + <th></th> + <th>{{ts('Activity Type')}}</th> + <th>{{ts('Max Instances')}}</th> + <th></th> + </tr> + </thead> + + <tbody ui-sortable ng-model="caseType.definition.activityTypes"> + <tr ng-repeat="activityType in caseType.definition.activityTypes"> + <td> + <i class="crm-i fa-arrows grip-n-drag"></i> + </td> + <td> + <i class="crm-i {{ activityTypes[activityType.name].icon }}"></i> + {{ activityType.name }} + </td> + <td> + <input class="crm-form-text number" type="text" ng-pattern="/^[1-9][0-9]*$/" ng-model="activityType.max_instances"> + </td> + <td> + <a crm-icon="fa-trash" class="crm-hover-button" ng-click="removeItem(caseType.definition.activityTypes, activityType)" title="{{ts('Remove')}}"></a> + </td> + </tr> + </tbody> + + <tfoot> + <tr class="addRow"> + <td></td> + <td colspan="3"> + <span crm-add-name + crm-options="activityTypeOptions" + crm-var="newActivity" + crm-on-add="addActivityType(newActivity)" + placeholder="{{ts('Add activity type')}}" + ></span> + </td> + </tr> + </tfoot> +</table> diff --git a/www/crm/wp-content/plugins/civicrm/civicrm/ang/crmCaseType/caseTypeDetails.html b/www/crm/wp-content/plugins/civicrm/civicrm/ang/crmCaseType/caseTypeDetails.html new file mode 100644 index 00000000..d11cc913 --- /dev/null +++ b/www/crm/wp-content/plugins/civicrm/civicrm/ang/crmCaseType/caseTypeDetails.html @@ -0,0 +1,67 @@ +<!-- +Controller: CaseTypeCtrl +Required vars: caseType + +The original form used table layout; don't know if we have an alternative, CSS-based layout +--> +<div class="crm-block" ng-form="caseTypeDetailForm" crm-ui-id-scope> + <div class="crm-group"> + <div crm-ui-field="{name: 'caseTypeDetailForm.title', title: ts('Title')}"> + <input + crm-ui-id="caseTypeDetailForm.title" + type="text" + name="title" + ng-model="caseType.title" + class="big crm-form-text" + required + /> + </div> + <div crm-ui-field="{name: 'caseTypeDetailForm.caseTypeName', title: ts('Name')}"> + <input + crm-ui-id="caseTypeDetailForm.caseTypeName" + type="text" + name="caseTypeName" + ng-model="caseType.name" + ng-disabled="locks.caseTypeName" + required + class="big crm-form-text"/> + + <a crm-ui-lock binding="locks.caseTypeName"></a> + + <div ng-show="!isValidName(caseType.name)"> + <em>{{ts('WARNING: The case type name includes deprecated characters.')}}</em> + </div> + <div ng-show="caseType.id && !locks.caseTypeName"> + <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')}"> + <textarea crm-ui-id="caseTypeDetailForm.description" name="description" ng-model="caseType.description" class="big crm-form-textarea"></textarea> + </div> + <div crm-ui-field="{title: ts('Enabled?')}"> + <input name="is_active" type="checkbox" ng-model="caseType.is_active" ng-true-value="'1'" ng-false-value="'0'"/> + </div> + <fieldset class="crm-collapsible"> + <legend class="collapsible-title">{{ ts('Activity assignment settings') }}</legend> + <div> + <div crm-ui-field="{name: 'caseTypeDetailForm.activityAsgmtGrps', title: ts('Restrict to Groups'), help: hs('activityAsgmtGrps')}"> + <input + name="activityAsgmtGrps" + crm-ui-id="caseTypeDetailForm.activityAsgmtGrps" + crm-entityref="{entity: 'Group', api: {params: {is_hidden: 0, is_active: 1}}, select: {allowClear: true, multiple: true, placeholder: ts('Select Group')}}" + ng-model="caseType.definition.activityAsgmtGrps" + /> + </div> + <div crm-ui-field="{title: ts('Restrict to Website Users'), help: hs('restrictActivityAsgmtToCmsUser')}"> + <input + name="restrictActivityAsgmtToCmsUser" + type="checkbox" + ng-model="caseType.definition.restrictActivityAsgmtToCmsUser" + ng-true-value="'1'" + ng-false-value="'0'" + /> + </div> + </div> + </fieldset> + </div> +</div> diff --git a/www/crm/wp-content/plugins/civicrm/civicrm/ang/crmCaseType/edit.html b/www/crm/wp-content/plugins/civicrm/civicrm/ang/crmCaseType/edit.html new file mode 100644 index 00000000..55c7faf4 --- /dev/null +++ b/www/crm/wp-content/plugins/civicrm/civicrm/ang/crmCaseType/edit.html @@ -0,0 +1,63 @@ +<!-- +Controller: CaseTypeCtrl +Required vars: caseType +--> +<h1 crm-page-title>{{caseType.title || ts('New Case Type')}}</h1> + +<div class="help"> + {{ts('Use this screen to define or update the Case Roles, Activity Types, and Timelines for a case type.')}} <a href="https://docs.civicrm.org/user/en/stable/case-management/set-up/" target="_blank">{{ts('Learn more...')}}</a> +</div> + +<form name="editCaseTypeForm" unsaved-warning-form> +<div class="crm-block crm-form-block crmCaseType"> + + <div ng-include="'~/crmCaseType/caseTypeDetails.html'"></div> + + <div ng-show="isForkable()" class="crmCaseType-acttab" ui-jq="tabs" ui-options="{show: true, hide: true}"> + <ul> + <li><a href="#acttab-roles">{{ts('Case Roles')}}</a></li> + <li><a href="#acttab-statuses">{{ts('Case Statuses')}}</a></li> + <li><a href="#acttab-actType">{{ts('Activity Types')}}</a></li> + <li ng-repeat="activitySet in caseType.definition.activitySets"> + <a href="#acttab-{{$index}}" class="crmCaseType-editable"> + <div crm-editable-tab-title title="{{ts('Click to edit')}}"> + <span>{{ activitySet.label }}</span> + </div> + </a> + <span class="crm-i fa-trash" title="{{ts('Remove')}}" + ng-hide="activitySet.name == 'standard_timeline'" + ng-click="removeItem(caseType.definition.activitySets, activitySet)"></span> + <!-- Weird spacing: + <a class="crm-hover-button" ng-click="removeItem(caseType.definition.activitySets, activitySet)"> + <span class="crm-i fa-trash" title="Remove">Remove</span> + </a> + --> + </li> + <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 id="acttab-roles" ng-include="'~/crmCaseType/rolesTable.html'"></div> + + <div id="acttab-actType" ng-include="'~/crmCaseType/activityTypesTable.html'"></div> + + <div id="acttab-statuses" ng-include="'~/crmCaseType/statusTable.html'"></div> + + <div ng-repeat="activitySet in caseType.definition.activitySets" id="acttab-{{$index}}"> + <div ng-include="activityTableTemplate(activitySet)"></div> + </div> + </div> + + <div class="crm-submit-buttons"> + <button crm-icon="fa-check" ng-click="editCaseTypeForm.$setPristine(); save()" ng-disabled="editCaseTypeForm.$invalid"> + {{ts('Save')}} + </button> + <button crm-icon="fa-times" ng-click="editCaseTypeForm.$setPristine(); goto('caseType')"> + {{ts('Cancel')}} + </button> + </div> +</div> +</form> diff --git a/www/crm/wp-content/plugins/civicrm/civicrm/ang/crmCaseType/list.html b/www/crm/wp-content/plugins/civicrm/civicrm/ang/crmCaseType/list.html new file mode 100644 index 00000000..a9caecc3 --- /dev/null +++ b/www/crm/wp-content/plugins/civicrm/civicrm/ang/crmCaseType/list.html @@ -0,0 +1,78 @@ +<!-- +Controller: CaseTypeListsCtrl +Required vars: caseTypes +--> +<h1 crm-page-title>{{ts('Case Types')}}</h1> + +<div class="help"> + {{ts('A Case Type describes a group of related tasks, interactions, or processes.')}} +</div> + +<div class="crm-content-block crm-block"> + + <table class="display"> + <thead> + <tr> + <th>{{ts('Title')}}</th> + <th>{{ts('Name')}}</th> + <th>{{ts('Description')}}</th> + <th>{{ts('Enabled?')}}</th> + <th></th> + </tr> + </thead> + <tbody> + <tr ng-repeat="caseType in caseTypes" + class="crm-entity" + ng-class-even="'even-row even'" + ng-class-odd="'odd-row odd'" + ng-class="{disabled: 0==caseType.is_active, forked: 1==caseType.is_forked}"> + <td>{{caseType.title}}</td> + <td>{{caseType.name}}</td> + <td>{{caseType.description}}</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}}">{{ts('Edit')}}</a> + + <span class="btn-slide crm-hover-button" ng-show="!caseType.is_reserved || (!caseType.is_active || caseType.is_forked)"> + {{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)"> + {{ts('Enable')}} + </a> + </li> + <li ng-show="caseType.is_active && !caseType.is_reserved"> + <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"> + <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"> + <a class="action-item crm-hover-button" + crm-confirm="{type: 'delete', obj: caseType}" + on-yes="deleteCaseType(caseType)"> + {{ts('Delete')}} + </a> + </li> + </ul> + </span> + </span> + </td> + </tr> + </tbody> + </table> + + <div class="crm-submit-buttons"> + <a ng-href="#/caseType/new" class="button"><span><i class="crm-i fa-plus-circle"></i> {{ts('New Case Type')}}</span></a> + </div> +</div> diff --git a/www/crm/wp-content/plugins/civicrm/civicrm/ang/crmCaseType/rolesTable.html b/www/crm/wp-content/plugins/civicrm/civicrm/ang/crmCaseType/rolesTable.html new file mode 100644 index 00000000..e7edee07 --- /dev/null +++ b/www/crm/wp-content/plugins/civicrm/civicrm/ang/crmCaseType/rolesTable.html @@ -0,0 +1,38 @@ +<!-- +Controller: CaseTypeCtrl +Required vars: caseType +--> +<table> + <thead> + <tr> + <th>{{ts('Name')}}</th> + <th>{{ts('Assign to Creator')}}</th> + <th>{{ts('Is Manager')}}</th> + <th></th> + </tr> + </thead> + <tbody> + <tr ng-repeat="relType in caseType.definition.caseRoles | orderBy:'name'" ng-class-even="'crm-entity even-row even'" ng-class-odd="'crm-entity odd-row odd'"> + <!-- display label (client-perspective) --> + <td>{{relType.displaylabel}}</td> + <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="fa-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"> + <span crm-add-name + crm-options="relationshipTypeOptions" + crm-var="newRole" + crm-on-add="addRole(caseType.definition.caseRoles, newRole)" + placeholder="{{ts('Add role')}}" + ></span> + </td> + </tr> + </tfoot> +</table> diff --git a/www/crm/wp-content/plugins/civicrm/civicrm/ang/crmCaseType/sequenceTable.html b/www/crm/wp-content/plugins/civicrm/civicrm/ang/crmCaseType/sequenceTable.html new file mode 100644 index 00000000..e07a11bd --- /dev/null +++ b/www/crm/wp-content/plugins/civicrm/civicrm/ang/crmCaseType/sequenceTable.html @@ -0,0 +1,41 @@ +<!-- +Controller: CaseTypeCtrl +Required vars: activitySet +--> +<table> + <thead> + <tr> + <th></th> + <th>{{ts('Activity')}}</th> + <th></th> + </tr> + </thead> + + <tbody ui-sortable ng-model="activitySet.activityTypes"> + <tr ng-repeat="activity in activitySet.activityTypes"> + <td> + <i class="crm-i fa-arrows grip-n-drag"></i> + </td> + <td> + <i class="crm-i {{ activityTypes[activity.name].icon }}"></i> + {{ activity.name }} + </td> + <td> + <a crm-icon="fa-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"> + <span crm-add-name + crm-options="activityTypeOptions" + crm-var="newActivity" + crm-on-add="addActivity(activitySet, newActivity)" + placeholder="{{ts('Add activity')}}" + ></span> + </td> + </tr> + </tfoot> +</table> diff --git a/www/crm/wp-content/plugins/civicrm/civicrm/ang/crmCaseType/statusTable.html b/www/crm/wp-content/plugins/civicrm/civicrm/ang/crmCaseType/statusTable.html new file mode 100644 index 00000000..890989a3 --- /dev/null +++ b/www/crm/wp-content/plugins/civicrm/civicrm/ang/crmCaseType/statusTable.html @@ -0,0 +1,35 @@ +<!-- +Controller: CaseTypeCtrl +Required vars: selectedStatuses +--> +<table> + <thead> + <tr> + <th></th> + <th>{{ts('Name')}}</th> + <th>{{ts('Class')}}</th> + </tr> + </thead> + + <tbody ng-model="selectedStatuses"> + <tr ng-repeat="(status,sel) in selectedStatuses"> + <td> + <input class="crm-form-checkbox" type="checkbox" ng-model="selectedStatuses[status]"/> + </td> + <td> + {{ caseStatuses[status].label }} + </td> + <td> + {{ caseStatuses[status].grouping }} + </td> + </tr> + </tbody> + + <tfoot> + <tr> + <td></td> + <td><a class="crm-hover-button action-item" ng-click="newStatus()" href><i class="crm-i fa-plus"></i> {{ ts('New Status') }}</a></td> + <td></td> + </tr> + </tfoot> +</table> diff --git a/www/crm/wp-content/plugins/civicrm/civicrm/ang/crmCaseType/timelineTable.html b/www/crm/wp-content/plugins/civicrm/civicrm/ang/crmCaseType/timelineTable.html new file mode 100644 index 00000000..4d044f1b --- /dev/null +++ b/www/crm/wp-content/plugins/civicrm/civicrm/ang/crmCaseType/timelineTable.html @@ -0,0 +1,117 @@ +<!-- +Controller: CaseTypeCtrl +Required vars: activitySet +--> +<table> + <thead> + <tr> + <th></th> + <th>{{ts('Activity')}}</th> + <th>{{ts('Status')}}</th> + <th>{{ts('Reference')}}</th> + <th>{{ts('Offset')}}</th> + <th>{{ts('Select')}}</th> + <th>{{ts('Default assignee')}}</th> + <th></th> + </tr> + </thead> + + <tbody ui-sortable ng-model="activitySet.activityTypes"> + <tr ng-repeat="activity in activitySet.activityTypes"> + <td> + <i class="crm-i fa-arrows grip-n-drag"></i> + </td> + <td> + <i class="crm-i {{activityTypes[activity.name].icon}}"></i> + {{activity.label}} + </td> + <td> + <select + ui-jq="select2" + ui-options="{dropdownAutoWidth: true}" + ng-model="activity.status" + ng-options="actStatus.name as actStatus.label for actStatus in activityStatuses|orderBy:'label'" + > + <option value=""></option> + </select> + </td> + <td> + <select + ui-jq="select2" + ui-options="{dropdownAutoWidth: true}" + ng-model="activity.reference_activity" + ng-options="activityType.name as activityType.label for activityType in caseType.definition.timelineActivityTypes" + > + <option value="">-- Case Start --</option> + </select> + </td> + <td> + <input + class="number crm-form-text" + type="text" + ng-pattern="/^-?[0-9]*$/" + ng-model="activity.reference_offset" + > + </td> + <td> + <select + ui-jq="select2" + ui-options="{dropdownAutoWidth: true}" + ng-model="activity.reference_select" + ng-options="key as value for (key,value) in {newest: ts('Newest'), oldest: ts('Oldest')}" + > + </select> + </td> + <td> + <select + ui-jq="select2" + ui-options="{dropdownAutoWidth: true}" + ng-model="activity.default_assignee_type" + ng-options="option.value as option.label for option in defaultAssigneeTypes" + ng-change="clearActivityDefaultAssigneeValues(activity)" + ></select> + + <p ng-if="activity.default_assignee_type === defaultAssigneeTypeValues.BY_RELATIONSHIP"> + <select + ui-jq="select2" + ui-options="{dropdownAutoWidth: true}" + ng-model="activity.default_assignee_relationship" + ng-options="option.value as option.label for option in defaultRelationshipTypeOptions" + required + ></select> + </p> + + <p ng-if="activity.default_assignee_type === defaultAssigneeTypeValues.SPECIFIC_CONTACT"> + <input + type="text" + ng-model="activity.default_assignee_contact" + placeholder="- Select contact -" + crm-entityref="{ entity: 'Contact' }" + data-create-links="true" + required /> + </p> + </td> + <td> + <a class="crm-hover-button" + crm-icon="fa-trash" + ng-show="isActivityRemovable(activitySet, activity)" + ng-click="removeItem(activitySet.activityTypes, activity)" + title="{{ts('Remove')}}"> + </a> + </td> + </tr> + </tbody> + + <tfoot> + <tr class="addRow"> + <td colspan="8"> + <span crm-add-name="" + crm-options="activityTypeOptions" + crm-var="newActivity" + crm-on-add="addActivity(activitySet, newActivity)" + placeholder="{{ts('Add activity')}}" + ></span> + </td> + </tr> + </tfoot> +</table> |