File tree Expand file tree Collapse file tree 4 files changed +56
-3
lines changed
zmsentities/src/Zmsentities/Schema Expand file tree Collapse file tree 4 files changed +56
-3
lines changed Original file line number Diff line number Diff line change
1
+ import $ from 'jquery'
2
+
3
+ class EndEmergencyView {
4
+
5
+ constructor ( element , options ) {
6
+ this . includeUrl = options . includeurl
7
+ this . scope = options . scope
8
+ this . workstationName = "" + options . workstationname
9
+ this . data = { }
10
+ this . $ = $ ( element )
11
+
12
+ this . $ . find ( '.emergency__button-end' ) . on ( 'click' , this . endEmergency . bind ( this ) )
13
+ }
14
+
15
+ endEmergency ( ) {
16
+ this . update ( { activated : "0" , calledByWorkstation : "-1" , acceptedByWorkstation : "-1" } )
17
+ this . sendEmergencyCancel ( )
18
+ }
19
+
20
+ update ( newData ) {
21
+ this . data = Object . assign ( { } , this . data , newData )
22
+ }
23
+
24
+ sendEmergencyCancel ( ) {
25
+ const url = `${ this . includeUrl } /scope/${ this . scope . id } /emergency/`
26
+
27
+ return new Promise ( ( resolve , reject ) => {
28
+ $ . ajax ( url , {
29
+ method : 'GET'
30
+ } ) . done ( ( ) => {
31
+ resolve ( )
32
+ } ) . fail ( err => {
33
+ console . log ( 'XHR error' , url , err )
34
+ reject ( err )
35
+ } )
36
+ } )
37
+ }
38
+ }
39
+
40
+ export default EndEmergencyView ;
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import PickupKeyboardHandheldView from "./page/pickup/keyboard-handheld"
26
26
import StatisticView from './page/statistic'
27
27
28
28
import LoginScopeSelectView from './block/scope/loginselectform'
29
+ import EmergencyEnd from './block/scope/emergencyend'
29
30
//import AvailabilityDayPage from './page/availabilityDay'
30
31
import WeekCalendarPage from './page/weekCalendar'
31
32
import printScopeAppointmentsByDay from './page/scopeAppointmentsByDay/print'
@@ -108,6 +109,10 @@ $('[data-scope-select-form]').each(function () {
108
109
new LoginScopeSelectView ( this , getDataAttributes ( this ) ) ;
109
110
} )
110
111
112
+ $ ( '.emergency-end' ) . each ( function ( ) {
113
+ new EmergencyEnd ( this , getDataAttributes ( this ) ) ;
114
+ } )
115
+
111
116
$ ( '.pickup-view' ) . each ( function ( ) {
112
117
new PickupView ( this , getDataAttributes ( this ) ) ;
113
118
} )
Original file line number Diff line number Diff line change 627
627
628
628
<fieldset >
629
629
<legend >Notruf</legend >
630
- <div class =" panel--heavy" >
630
+ <div class =" panel--heavy emergency-end"
631
+ data-scope =" {{workstation .scope | json_encode }}"
632
+ data-scopestate ={{ scopeState | json_encode | e (' html_attr' ) }}
633
+ data-labels ={{ dataLabels | json_encode | e (' html_attr' ) }}
634
+ data-includeurl =" {{ includeUrl() }}"
635
+ >
631
636
{{ formgroup(
632
637
{
633
638
" label" : null
634
639
},
635
640
[{
636
641
" type" :" checkbox" ,
637
642
" parameter" : {
638
- " label" : " Notruffunktion im Backend" ,
643
+ " label" : " Notruffunktion im Backend (Durch das Deaktivieren der Funktion wird auch ein aktuell bestehender Notruf am Standort beendet.) " ,
639
644
" name" : " preferences[workstation][emergencyEnabled]" ,
640
645
" value" : 1 ,
641
646
" checked" : scope .preferences .workstation .emergencyEnabled |default (0 ),
647
+ " class" : " emergency__button-end"
642
648
}
643
649
}]
644
650
) }}
Original file line number Diff line number Diff line change @@ -308,7 +308,9 @@ public function withLessData()
308
308
public function withCleanedUpFormData ()
309
309
{
310
310
$ entity = clone $ this ;
311
- unset($ entity ['save ' ]);
311
+ if (isset ($ entity ['save ' ])) {
312
+ unset($ entity ['save ' ]);
313
+ }
312
314
if (isset ($ entity ['removeImage ' ])) {
313
315
unset($ entity ['removeImage ' ]);
314
316
}
You can’t perform that action at this time.
0 commit comments