dev/core#107 Refactor selection of default assignee by relationship type
[civicrm-core.git] / ang / crmCaseType / timelineTable.html
CommitLineData
4c58e251
TO
1<!--
2Controller: CaseTypeCtrl
3Required vars: activitySet
4-->
5<table>
6 <thead>
7 <tr>
4324b8d7 8 <th></th>
7abbf317
CW
9 <th>{{ts('Activity')}}</th>
10 <th>{{ts('Status')}}</th>
11 <th>{{ts('Reference')}}</th>
12 <th>{{ts('Offset')}}</th>
13 <th>{{ts('Select')}}</th>
ad8d1ce3 14 <th>{{ts('Default assignee')}}</th>
4c58e251
TO
15 <th></th>
16 </tr>
17 </thead>
18
c45daff0 19 <tbody ui-sortable ng-model="activitySet.activityTypes">
4c58e251
TO
20 <tr ng-repeat="activity in activitySet.activityTypes">
21 <td>
77ec5a8d 22 <i class="crm-i fa-arrows grip-n-drag"></i>
4324b8d7
CW
23 </td>
24 <td>
ad8d1ce3
RO
25 <i class="crm-i {{activityTypes[activity.name].icon}}"></i>
26 {{activity.label}}
4c58e251
TO
27 </td>
28 <td>
29d7a6e7 29 <select
a2e9f07c 30 ui-jq="select2"
ad8d1ce3 31 ui-options="{dropdownAutoWidth: true}"
29d7a6e7 32 ng-model="activity.status"
be5aae33 33 ng-options="actStatus.name as actStatus.label for actStatus in activityStatuses|orderBy:'label'"
29d7a6e7 34 >
24f6e9ac 35 <option value=""></option>
dc7a657e 36 </select>
4c58e251
TO
37 </td>
38 <td>
29d7a6e7 39 <select
a2e9f07c 40 ui-jq="select2"
ad8d1ce3 41 ui-options="{dropdownAutoWidth: true}"
29d7a6e7 42 ng-model="activity.reference_activity"
093f1cfd 43 ng-options="activityType.name as activityType.label for activityType in caseType.definition.timelineActivityTypes"
29d7a6e7 44 >
12b84ade 45 <option value="">-- Case Start --</option>
dc7a657e 46 </select>
4c58e251
TO
47 </td>
48 <td>
29d7a6e7 49 <input
4324b8d7 50 class="number crm-form-text"
29d7a6e7 51 type="text"
ba0fd8dd 52 ng-pattern="/^-?[0-9]*$/"
29d7a6e7 53 ng-model="activity.reference_offset"
d56abcbf 54 >
4c58e251
TO
55 </td>
56 <td>
29d7a6e7 57 <select
a2e9f07c 58 ui-jq="select2"
ad8d1ce3 59 ui-options="{dropdownAutoWidth: true}"
29d7a6e7 60 ng-model="activity.reference_select"
69ca66d2 61 ng-options="key as value for (key,value) in {newest: ts('Newest'), oldest: ts('Oldest')}"
29d7a6e7 62 >
dc7a657e 63 </select>
4c58e251 64 </td>
ad8d1ce3
RO
65 <td>
66 <select
67 ui-jq="select2"
68 ui-options="{dropdownAutoWidth: true}"
69 ng-model="activity.default_assignee_type"
70 ng-options="option.value as option.label for option in defaultAssigneeTypes"
71 ng-change="clearActivityDefaultAssigneeValues(activity)"
72 ></select>
73
74 <p ng-if="activity.default_assignee_type === defaultAssigneeTypeValues.BY_RELATIONSHIP">
75 <select
76 ui-jq="select2"
77 ui-options="{dropdownAutoWidth: true}"
78 ng-model="activity.default_assignee_relationship"
68098e7b 79 ng-options="option.value as option.label for option in defaultRelationshipTypeOptions"
ad8d1ce3
RO
80 required
81 ></select>
82 </p>
83
84 <p ng-if="activity.default_assignee_type === defaultAssigneeTypeValues.SPECIFIC_CONTACT">
85 <input
86 type="text"
87 ng-model="activity.default_assignee_contact"
88 placeholder="- Select contact -"
89 crm-entityref="{ entity: 'Contact' }"
90 data-create-links="true"
91 required />
92 </p>
93 </td>
4c58e251 94 <td>
259a7652 95 <a class="crm-hover-button"
77ec5a8d 96 crm-icon="fa-trash"
259a7652 97 ng-show="isActivityRemovable(activitySet, activity)"
3e5e512f 98 ng-click="removeItem(activitySet.activityTypes, activity)"
7abbf317 99 title="{{ts('Remove')}}">
059cd0c2 100 </a>
4c58e251
TO
101 </td>
102 </tr>
c45daff0
TO
103 </tbody>
104
105 <tfoot>
95fd24c0 106 <tr class="addRow">
ad8d1ce3 107 <td colspan="8">
d56abcbf 108 <span crm-add-name=""
4324b8d7 109 crm-options="activityTypeOptions"
95fd24c0
TO
110 crm-var="newActivity"
111 crm-on-add="addActivity(activitySet, newActivity)"
00eee619 112 placeholder="{{ts('Add activity')}}"
d56abcbf 113 ></span>
95fd24c0
TO
114 </td>
115 </tr>
c45daff0 116 </tfoot>
4c58e251 117</table>