|
261 |
isMultiAction: true, |
261 |
isMultiAction: true, |
262 |
enablingMode: "some", |
262 |
enablingMode: "some", |
263 |
canExecute: checkUCC('lockInput', lang.hitch(this, function(item) { |
263 |
canExecute: checkUCC('lockInput', lang.hitch(this, function(item) { |
264 |
return !this._demo.running && isConnected(item) && item.user && item.user[0] && (!item.teacher || item.teacher[0] === false) && item.InputLock; |
264 |
return !this._demo.running && isConnected(item) && item.user && item.user[0] && (!item.teacher || item.teacher[0] === false) && item.InputLock[0] === false; |
265 |
})), |
265 |
})), |
266 |
callback: lang.hitch(this, '_lockInput', true) |
266 |
callback: lang.hitch(this, '_lockInput', true) |
267 |
}, { |
267 |
}, { |
|
271 |
isMultiAction: true, |
271 |
isMultiAction: true, |
272 |
enablingMode: "some", |
272 |
enablingMode: "some", |
273 |
canExecute: checkUCC('unlockInput', lang.hitch(this, function(item) { |
273 |
canExecute: checkUCC('unlockInput', lang.hitch(this, function(item) { |
274 |
return !this._demo.running && isConnected(item) && item.user && item.user[0] && (!item.teacher || item.teacher[0] === false) && item.InputLock; |
274 |
return !this._demo.running && isConnected(item) && item.user && item.user[0] && (!item.teacher || item.teacher[0] === false) && item.InputLock[0] === true; |
275 |
})), |
275 |
})), |
276 |
callback: lang.hitch(this, '_lockInput', false) |
276 |
callback: lang.hitch(this, '_lockInput', false) |
277 |
}, { |
277 |
}, { |
|
292 |
isMultiAction: true, |
292 |
isMultiAction: true, |
293 |
enablingMode: "some", |
293 |
enablingMode: "some", |
294 |
canExecute: checkUCC('ScreenLock', lang.hitch(this, function(item) { |
294 |
canExecute: checkUCC('ScreenLock', lang.hitch(this, function(item) { |
295 |
return !this._demo.running && isConnected(item) && item.user && item.user[0] && (!item.teacher || item.teacher[0] === false); |
295 |
return !this._demo.running && isConnected(item) && item.user && item.user[0] && (!item.teacher || item.teacher[0] === false) && item.ScreenLock[0] === false; |
296 |
})), |
296 |
})), |
297 |
callback: lang.hitch(this, '_lockScreen', true) |
297 |
callback: lang.hitch(this, '_lockScreen', true) |
298 |
}, { |
298 |
}, { |
|
303 |
isMultiAction: true, |
303 |
isMultiAction: true, |
304 |
enablingMode: "some", |
304 |
enablingMode: "some", |
305 |
canExecute: checkUCC('ScreenUnLock', lang.hitch(this, function(item) { |
305 |
canExecute: checkUCC('ScreenUnLock', lang.hitch(this, function(item) { |
306 |
return !this._demo.running && isConnected(item) && item.user && item.user[0] && (!item.teacher || item.teacher[0] === false); |
306 |
return !this._demo.running && isConnected(item) && item.user && item.user[0] && (!item.teacher || item.teacher[0] === false) && item.ScreenLock[0] === true; |
307 |
})), |
307 |
})), |
308 |
callback: lang.hitch(this, '_lockScreen', false) |
308 |
callback: lang.hitch(this, '_lockScreen', false) |
309 |
}]; |
309 |
}]; |
|
422 |
|
422 |
|
423 |
_lockInput: function(lock, ids, items) { |
423 |
_lockInput: function(lock, ids, items) { |
424 |
array.forEach(items, lang.hitch(this, function(comp) { |
424 |
array.forEach(items, lang.hitch(this, function(comp) { |
425 |
if (comp.connection[0] != 'connected' || // not connected |
|
|
426 |
!comp.user || !comp.user[0] || // no user logged on |
427 |
(comp.teacher && comp.teacher[0] === true) || // teacher logged in |
428 |
comp.InputLock[0] === null || // unclear status |
429 |
comp.InputLock[0] === lock // already locked/unlocked |
430 |
) { |
431 |
// ignore them |
432 |
return; |
433 |
} |
434 |
this.umcpCommand('computerroom/lock', { |
425 |
this.umcpCommand('computerroom/lock', { |
435 |
computer: comp.id[0], |
426 |
computer: comp.id[0], |
436 |
device: 'input', |
427 |
device: 'input', |
|
443 |
|
434 |
|
444 |
_lockScreen: function(lock, ids, items) { |
435 |
_lockScreen: function(lock, ids, items) { |
445 |
array.forEach(items, lang.hitch(this, function(comp) { |
436 |
array.forEach(items, lang.hitch(this, function(comp) { |
446 |
if (comp.connection[0] != 'connected' || // not connected |
|
|
447 |
!comp.user || !comp.user[0] || // no user logged on |
448 |
(comp.teacher && comp.teacher[0] === true) || // teacher logged in |
449 |
comp.ScreenLock[0] === null || // unclear status |
450 |
comp.ScreenLock[0] === lock // already locked/unlocked |
451 |
) { |
452 |
// ignore them |
453 |
return; |
454 |
} |
455 |
this.umcpCommand('computerroom/lock', { |
437 |
this.umcpCommand('computerroom/lock', { |
456 |
computer: comp.id[0], |
438 |
computer: comp.id[0], |
457 |
device: 'screen', |
439 |
device: 'screen', |