PluginProbe
ShiftController Employee Shift Scheduling / 4.9.95
ShiftController Employee Shift Scheduling v4.9.95
4.9.97 4.9.96 4.9.95 4.9.74 4.9.75 4.9.76 4.9.77 4.9.78 4.9.84 4.9.85 4.9.87 4.9.91 4.9.92 trunk 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 3.2.4 All 38 releases
shiftcontroller / sh4 / notifications / email / manager / delete.php

delete.php in ShiftController Employee Shift Scheduling 4.9.95, at sh4/notifications/email/manager/delete.php

52 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if (! defined('ABSPATH')) exit; // Exit if accessed directly
2 class SH4_Notifications_Email_Manager_Delete implements SH4_Notifications_INotification
3 {
4 public $self, $notificationsTemplate, $notificator, $appQuery;
5
6 public function __construct(
7 HC3_Hooks $hooks,
8 HC3_Notificator $notificator,
9 SH4_Notifications_Template $notificationsTemplate,
10 SH4_App_Query $appQuery
11 )
12 {
13 $this->self = $hooks->wrap( $this );
14
15 $this->notificationsTemplate = $hooks->wrap( $notificationsTemplate );
16 $this->notificator = $hooks->wrap( $notificator );
17 $this->appQuery = $hooks->wrap( $appQuery );
18 }
19
20 public function getTitle()
21 {
22 $return = '__Email__' . ': ' . '__Shift Deleted__' . ' ('. '__Manager__' . ')';
23 return $return;
24 }
25
26 public function execute( SH4_Shifts_Model $shift, $template )
27 {
28 $msg = $this->notificationsTemplate->parse( $template, $shift );
29
30 $calendar = $shift->getCalendar();
31 $managers = $this->appQuery->findManagersForCalendar( $calendar );
32
33 foreach( $managers as $user ){
34 $this->notificator
35 ->queue( $user, 'email_manager_delete', $msg )
36 ;
37 }
38 }
39
40 public function getDefaultTemplate()
41 {
42 $return = array();
43 $return[] = '__Shift Deleted__' . ' (#{ID})';
44
45 $return[] = '{CALENDAR}';
46 $return[] = '{DATETIME}';
47 $return[] = '{EMPLOYEE}';
48
49 $return = join("\n", $return);
50 return $return;
51 }
52 }