|
31 | 31 | # --------------------------------------------------------------------- |
32 | 32 | #} |
33 | 33 |
|
| 34 | +{% set is_helpdesk = get_current_interface() == 'helpdesk' %} |
34 | 35 | {% set timeline_btns_cls = left_regular_cls %} |
35 | 36 | {% set form_btns_cls = is_expanded ? right_expanded_cls : "col-lg" %} |
36 | 37 | {% set timeline_btn_layout = session('glpitimeline_action_btn_layout') %} |
|
43 | 44 |
|
44 | 45 | <div class="mx-n2 mb-n2 itil-footer itil-footer p-0 border-top" id="itil-footer"> |
45 | 46 | <div class="buttons-bar d-flex py-2"> |
46 | | - <div class="col {{ timeline_btns_cls }} ps-3 timeline-buttons d-flex"> |
| 47 | + <div class="col {{ not is_helpdesk ? timeline_btns_cls : '' }} ps-3 timeline-buttons d-flex"> |
47 | 48 | {% if not item.isNewItem() %} |
48 | 49 | {% set main_actions_itemtypes = timeline_itemtypes|filter((v, k) => v.hide_in_menu is not defined or v.hide_in_menu != true) %} |
49 | 50 |
|
|
58 | 59 | <div class="main-actions" style="display:inline-flex"> |
59 | 60 | {% endif %} |
60 | 61 | <button |
61 | | - class="btn btn-primary answer-action mb-2 {{ default_action != "answer" ? "action-" ~ default_action : "" }}" |
| 62 | + class="btn btn-primary answer-action {{ default_action != "answer" ? "action-" ~ default_action : "" }}" |
62 | 63 | data-bs-toggle="collapse" |
63 | 64 | data-bs-target="#new-{{ default_action_data.class }}-block" |
64 | 65 | > |
|
70 | 71 | {% if timeline_btn_layout == constant('Config::TIMELINE_ACTION_BTN_SPLITTED') %} |
71 | 72 | {% for action, timeline_itemtype in main_actions_itemtypes %} |
72 | 73 | {% if loop.index0 > 0 %} |
73 | | - <button class="ms-2 mb-2 btn btn-primary answer-action action-{{ action }}" data-bs-toggle="collapse" data-bs-target="#new-{{ timeline_itemtype.class }}-block"> |
| 74 | + <button class="ms-2 btn btn-primary answer-action action-{{ action }}" data-bs-toggle="collapse" data-bs-target="#new-{{ timeline_itemtype.class }}-block"> |
74 | 75 | <i class="{{ timeline_itemtype.icon }}"></i> |
75 | 76 | <span>{{ timeline_itemtype.short_label }}</span> |
76 | 77 | </button> |
|
79 | 80 | {% else %} |
80 | 81 | <button |
81 | 82 | type="button" |
82 | | - class="btn btn-primary dropdown-toggle dropdown-toggle-split mb-2 {{ default_action != "answer" ? "action-" ~ default_action : "" }}" |
| 83 | + class="btn btn-primary dropdown-toggle dropdown-toggle-split {{ default_action != "answer" ? "action-" ~ default_action : "" }}" |
83 | 84 | data-bs-toggle="dropdown" |
84 | 85 | aria-expanded="false" |
85 | 86 | > |
|
104 | 105 | <ul class="legacy-timeline-actions"> |
105 | 106 | {{ legacy_timeline_actions|default('')|raw }} |
106 | 107 | </ul> |
107 | | - {{ include('components/itilobject/timeline/filter_timeline.html.twig') }} |
| 108 | + |
| 109 | + <div class="ms-auto"></div> |
| 110 | + |
| 111 | + {% if item.canDeleteItem() %} |
| 112 | + <button class="btn btn-ghost-danger" type="submit" name="delete" form="itil-form"> |
| 113 | + <i class="ti ti-trash me-1"></i> |
| 114 | + <span>{{ __("Cancel ticket") }}</span> |
| 115 | + </button> |
| 116 | + {% endif %} |
| 117 | + |
| 118 | + {% if not is_helpdesk %} |
| 119 | + {{ include('components/itilobject/timeline/filter_timeline.html.twig') }} |
| 120 | + {% endif %} |
108 | 121 | {% endif %} |
109 | 122 | </div> |
110 | 123 |
|
111 | | - <div class="form-buttons {{ form_btns_cls }} d-flex justify-content-between ms-auto ms-lg-0 my-n2 py-2 pe-3 card-footer border-top-0 position-relative"> |
112 | | - <span class="d-none d-lg-block ms-n3" |
113 | | - data-bs-toggle="tooltip" data-bs-placement="top" title="{{ __('Toggle panels width') }}"> |
114 | | - <button type="button" class="switch-panel-width btn btn-icon btn-ghost-secondary px-0"> |
115 | | - <i class="{{ switch_btn_cls }}"></i> |
116 | | - </button> |
117 | | - <button type="button" class="collapse-panel btn btn-icon btn-ghost-secondary px-0 mr-1"> |
118 | | - <i class="ti ti-caret-right-filled"></i> |
119 | | - </button> |
120 | | - </span> |
121 | | - |
122 | | - <span> |
123 | | - {% if item.isNewItem() %} |
124 | | - <button class="btn btn-primary" type="submit" name="add" form="itil-form" |
125 | | - title="{{ _x('button', 'Add') }}"> |
126 | | - <i class="ti ti-plus"></i> |
127 | | - <span class="d-none d-lg-block">{{ _x('button', 'Add') }}</span> |
128 | | - </button> |
129 | | - {% else %} |
130 | | - |
131 | | - <div class="btn-group" role="group" id="right-actions"> |
132 | | - {% set is_locked = params['locked'] is defined and params['locked'] %} |
133 | | - {% set display_save_btn = not is_locked and (canupdate or can_requester or canpriority or canassign or canassigntome) %} |
134 | | - {% if display_save_btn %} |
135 | | - <button class="btn btn-primary" type="submit" name="update" form="itil-form" |
136 | | - title="{{ _x('button', 'Save') }}"> |
137 | | - <i class="ti ti-device-floppy"></i> |
138 | | - <span class="d-none d-xl-block">{{ _x('button', 'Save') }}</span> |
139 | | - </button> |
140 | | - {% endif %} |
141 | | - |
142 | | - {% if item.canDeleteItem() %} |
143 | | - {% if item.isDeleted() %} |
144 | | - <button class="btn btn-outline-secondary" type="submit" name="restore" form="itil-form" |
145 | | - title="{{ _x('button', 'Restore') }}"> |
146 | | - <i class="ti ti-trash-off"></i> |
147 | | - <span class="d-none d-lg-block">{{ _x('button', 'Restore') }}</span> |
| 124 | + {% if not is_helpdesk %} |
| 125 | + <div class="form-buttons {{ form_btns_cls }} d-flex justify-content-between ms-auto ms-lg-0 my-n2 py-2 pe-3 card-footer border-top-0 position-relative"> |
| 126 | + <span class="d-none d-lg-block ms-n3" |
| 127 | + data-bs-toggle="tooltip" data-bs-placement="top" title="{{ __('Toggle panels width') }}"> |
| 128 | + <button type="button" class="switch-panel-width btn btn-icon btn-ghost-secondary px-0"> |
| 129 | + <i class="{{ switch_btn_cls }}"></i> |
| 130 | + </button> |
| 131 | + <button type="button" class="collapse-panel btn btn-icon btn-ghost-secondary px-0 mr-1"> |
| 132 | + <i class="ti ti-caret-right-filled"></i> |
| 133 | + </button> |
| 134 | + </span> |
| 135 | + |
| 136 | + <span> |
| 137 | + {% if item.isNewItem() %} |
| 138 | + <button class="btn btn-primary" type="submit" name="add" form="itil-form" |
| 139 | + title="{{ _x('button', 'Add') }}"> |
| 140 | + <i class="ti ti-plus"></i> |
| 141 | + <span class="d-none d-lg-block">{{ _x('button', 'Add') }}</span> |
| 142 | + </button> |
| 143 | + {% else %} |
| 144 | + |
| 145 | + <div class="btn-group" role="group" id="right-actions"> |
| 146 | + {% set is_locked = params['locked'] is defined and params['locked'] %} |
| 147 | + {% set display_save_btn = not is_locked and (canupdate or can_requester or canpriority or canassign or canassigntome) %} |
| 148 | + {% if display_save_btn %} |
| 149 | + <button class="btn btn-primary" type="submit" name="update" form="itil-form" |
| 150 | + title="{{ _x('button', 'Save') }}"> |
| 151 | + <i class="ti ti-device-floppy"></i> |
| 152 | + <span class="d-none d-xl-block">{{ _x('button', 'Save') }}</span> |
148 | 153 | </button> |
| 154 | + {% endif %} |
149 | 155 |
|
150 | | - <button class="btn btn-outline-danger" type="submit" name="purge" form="itil-form" |
151 | | - title="{{ _x('button', 'Delete permanently') }}" |
152 | | - onclick="return confirm('{{ __('Confirm the final deletion?') }}');"> |
153 | | - <i class="ti ti-trash"></i> |
154 | | - <span class="d-none d-lg-block">{{ _x('button', 'Delete permanently') }}</span> |
155 | | - </button> |
156 | | - {% else %} |
157 | | - <button class="btn btn-outline-danger" type="submit" name="delete" form="itil-form" |
158 | | - title="{{ _x('button', 'Put in trashbin') }}" |
159 | | - data-bs-toggle="tooltip" data-bs-placement="top"> |
160 | | - <i class="ti ti-trash"></i> |
161 | | - </button> |
| 156 | + {% if item.canDeleteItem() %} |
| 157 | + {% if item.isDeleted() %} |
| 158 | + <button class="btn btn-outline-secondary" type="submit" name="restore" form="itil-form" |
| 159 | + title="{{ _x('button', 'Restore') }}"> |
| 160 | + <i class="ti ti-trash-off"></i> |
| 161 | + <span class="d-none d-lg-block">{{ _x('button', 'Restore') }}</span> |
| 162 | + </button> |
| 163 | + |
| 164 | + <button class="btn btn-outline-danger" type="submit" name="purge" form="itil-form" |
| 165 | + title="{{ _x('button', 'Delete permanently') }}" |
| 166 | + onclick="return confirm('{{ __('Confirm the final deletion?') }}');"> |
| 167 | + <i class="ti ti-trash"></i> |
| 168 | + <span class="d-none d-lg-block">{{ _x('button', 'Delete permanently') }}</span> |
| 169 | + </button> |
| 170 | + {% else %} |
| 171 | + <button class="btn btn-outline-danger" type="submit" name="delete" form="itil-form" |
| 172 | + title="{{ _x('button', 'Put in trashbin') }}" |
| 173 | + data-bs-toggle="tooltip" data-bs-placement="top"> |
| 174 | + <i class="ti ti-trash"></i> |
| 175 | + </button> |
| 176 | + {% endif %} |
162 | 177 | {% endif %} |
163 | | - {% endif %} |
164 | 178 |
|
165 | | - {% if canupdate %} |
166 | | - {{ include('components/form/single-action.html.twig', { |
167 | | - 'onlyicon': true |
168 | | - }) }} |
169 | | - {% endif %} |
170 | | - </div> |
| 179 | + {% if canupdate %} |
| 180 | + {{ include('components/form/single-action.html.twig', { |
| 181 | + 'onlyicon': true |
| 182 | + }) }} |
| 183 | + {% endif %} |
| 184 | + </div> |
| 185 | + |
| 186 | + {% endif %} |
| 187 | + </span> |
| 188 | + </div> |
| 189 | + {% endif %} |
171 | 190 |
|
172 | | - {% endif %} |
173 | | - </span> |
174 | | - </div> |
175 | 191 | </div> |
176 | 192 | </div> |
177 | 193 |
|
|
0 commit comments