|
@@ 339-387 (lines=49) @@
|
| 336 |
|
|
| 337 |
|
|
| 338 |
|
|
| 339 |
|
function absences_confirmWaitingRecoverRequest($id_workperiod) |
| 340 |
|
{ |
| 341 |
|
require_once dirname(__FILE__).'/utilit/workperiod_recover_request.class.php'; |
| 342 |
|
require_once dirname(__FILE__).'/utilit/workperiod_recover_request.ui.php'; |
| 343 |
|
$W = bab_Widgets(); |
| 344 |
|
$page = $W->babPage(); |
| 345 |
|
|
| 346 |
|
$Icons = bab_functionality::get('Icons'); |
| 347 |
|
/*@var $Icons Func_Icons */ |
| 348 |
|
$Icons->includeCss(); |
| 349 |
|
|
| 350 |
|
$workperiod = absences_WorkperiodRecoverRequest::getById($id_workperiod); |
| 351 |
|
|
| 352 |
|
if (!$workperiod->getRow()) |
| 353 |
|
{ |
| 354 |
|
$page->addError(absences_translate('This entry does not exist')); |
| 355 |
|
$page->displayHtml(); |
| 356 |
|
return; |
| 357 |
|
} |
| 358 |
|
|
| 359 |
|
if ('' != $workperiod->status) |
| 360 |
|
{ |
| 361 |
|
$page->addError(absences_translate('This entry is not waiting for confirmation')); |
| 362 |
|
$page->displayHtml(); |
| 363 |
|
return; |
| 364 |
|
} |
| 365 |
|
|
| 366 |
|
|
| 367 |
|
if (!empty($_POST)) |
| 368 |
|
{ |
| 369 |
|
try { |
| 370 |
|
absences_confirmWaitingRecoverRequestSave($workperiod); |
| 371 |
|
|
| 372 |
|
} catch (Exception $e) |
| 373 |
|
{ |
| 374 |
|
$page->addError($e->getMessage()); |
| 375 |
|
} |
| 376 |
|
} |
| 377 |
|
|
| 378 |
|
|
| 379 |
|
$page->setTitle(absences_translate('Confirm the workperiod recovery request')); |
| 380 |
|
|
| 381 |
|
|
| 382 |
|
$editor = new absences_WorkperiodRecoverApprobEditor($workperiod); |
| 383 |
|
|
| 384 |
|
$page->addItem($editor); |
| 385 |
|
$page->setEmbedded(false); |
| 386 |
|
$page->displayHtml(); |
| 387 |
|
} |
| 388 |
|
|
| 389 |
|
|
| 390 |
|
|
|
@@ 458-506 (lines=49) @@
|
| 455 |
|
|
| 456 |
|
|
| 457 |
|
|
| 458 |
|
function absences_confirmWaitingCetDeposit($id_deposit) |
| 459 |
|
{ |
| 460 |
|
require_once dirname(__FILE__).'/utilit/cet_deposit_request.class.php'; |
| 461 |
|
require_once dirname(__FILE__).'/utilit/cet_deposit_request.ui.php'; |
| 462 |
|
$W = bab_Widgets(); |
| 463 |
|
$page = $W->babPage(); |
| 464 |
|
|
| 465 |
|
$Icons = bab_functionality::get('Icons'); |
| 466 |
|
/*@var $Icons Func_Icons */ |
| 467 |
|
$Icons->includeCss(); |
| 468 |
|
|
| 469 |
|
$deposit = absences_CetDepositRequest::getById($id_deposit); |
| 470 |
|
|
| 471 |
|
if (!$deposit->getRow()) |
| 472 |
|
{ |
| 473 |
|
$page->addError(absences_translate('This deposit does not exist')); |
| 474 |
|
$page->displayHtml(); |
| 475 |
|
return; |
| 476 |
|
} |
| 477 |
|
|
| 478 |
|
if ('' != $deposit->status) |
| 479 |
|
{ |
| 480 |
|
$page->addError(absences_translate('This deposit is not waiting for confirmation')); |
| 481 |
|
$page->displayHtml(); |
| 482 |
|
return; |
| 483 |
|
} |
| 484 |
|
|
| 485 |
|
|
| 486 |
|
if (!empty($_POST)) |
| 487 |
|
{ |
| 488 |
|
try { |
| 489 |
|
absences_confirmWaitingCetDepositSave($deposit); |
| 490 |
|
|
| 491 |
|
} catch (Exception $e) |
| 492 |
|
{ |
| 493 |
|
$page->addError($e->getMessage()); |
| 494 |
|
} |
| 495 |
|
} |
| 496 |
|
|
| 497 |
|
|
| 498 |
|
$page->setTitle(absences_translate('Confirm the time saving account deposit')); |
| 499 |
|
|
| 500 |
|
|
| 501 |
|
$editor = new absences_CetDepositRequestApprobEditor($deposit); |
| 502 |
|
|
| 503 |
|
$page->addItem($editor); |
| 504 |
|
$page->setEmbedded(false); |
| 505 |
|
$page->displayHtml(); |
| 506 |
|
} |
| 507 |
|
|
| 508 |
|
|
| 509 |
|
|