PluginProbe
ShiftController Employee Shift Scheduling / 4.9.66
ShiftController Employee Shift Scheduling v4.9.66
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
← All changes | sh4/app/command.php +4 -8 trunk4.9.66 View file →
@@ -20,9 +20,9 @@
20 20 }
21 21
22 22 class SH4_App_Command implements SH4_App_ICommand
23 23 {
24 - public $self, $crudFactory, $settings, $shiftTypesCommand, $calendarsCommand, $employeesCommand, $shiftsCommand;
24 + public $crudFactory, $settings, $shiftTypesCommand, $calendarsCommand, $employeesCommand, $shiftsCommand;
25 25
26 26 public function __construct(
27 27 HC3_CrudFactory $crudFactory,
28 28 HC3_Settings $settings,
@@ -39,9 +39,8 @@
39 39 $this->shiftTypesCommand = $hooks->wrap( $shiftTypesCommand );
40 40 $this->calendarsCommand = $hooks->wrap( $calendarsCommand );
41 41 $this->employeesCommand = $hooks->wrap( $employeesCommand );
42 42 $this->shiftsCommand = $hooks->wrap( $shiftsCommand );
43 - $this->self = $hooks->wrap( $this );
44 43 }
45 44
46 45 public function uninstall()
47 46 {
@@ -187,14 +186,16 @@
187 186
188 187 $this->settings->set( $settingName, $employeesIds );
189 188 }
190 189
191 - public function linkEmployeeToUserById( $employeeId, $userId )
190 + public function linkEmployeeToUser( SH4_Employees_Model $employee, HC3_Users_Model $user )
192 191 {
192 + $employeeId = $employee->getId();
193 193 if( ! $employeeId ){
194 194 return;
195 195 }
196 196
197 + $userId = $user->getId();
197 198 if( ! $userId ){
198 199 return;
199 200 }
200 201
@@ -201,13 +202,8 @@
201 202 $crud = $this->crudFactory->make('employee');
202 203
203 204 $values = array( 'user_id' => $userId );
204 205 $results = $crud->update( $employeeId, $values );
205 - }
206 -
207 - public function linkEmployeeToUser( SH4_Employees_Model $employee, HC3_Users_Model $user )
208 - {
209 - return $this->self->linkEmployeeToUserById( $employee->getId(), $user->getId() );
210 206 }
211 207
212 208 public function unlinkEmployeeFromUser( SH4_Employees_Model $employee )
213 209 {