Commit d54a1a7b96160ba788209f60c9ae0a6bbc0fccda
1 parent
8be9a1a8
Exists in
master
and in
101 other branches
Fix load from shared catalog
Showing
1 changed file
with
4 additions
and
3 deletions
Show diff stats
php/classes/TimeTableMgr.php
... | ... | @@ -433,17 +433,18 @@ class TimeTableMgr extends AmdaObjectMgr |
433 | 433 | */ |
434 | 434 | public function loadIntervalsFromObject($id, $typeTT = '', $start = null, $limit = null) |
435 | 435 | { |
436 | - if ($typeTT == 'sharedtimeTable') { | |
436 | + if ($typeTT == 'sharedtimeTable' || $typeTT == 'sharedcatalog') { | |
437 | 437 | //Shared object |
438 | 438 | $sharedObjMgr = new SharedObjectsMgr(); |
439 | - $path = $sharedObjMgr->getDataFilePath('timeTable', $id); | |
439 | + $sharedType = ($typeTT == 'sharedcatalog') ? 'catalog' : 'timeTable'; | |
440 | + $path = $sharedObjMgr->getDataFilePath($sharedType, $id); | |
440 | 441 | } else { |
441 | 442 | $path = USERTTDIR . $id . '.xml'; |
442 | 443 | } |
443 | 444 | |
444 | 445 | //load intervals from TT id |
445 | 446 | if (!file_exists($path)) { |
446 | - return ['success' => false, 'message' => "Cannot find TT file " . $id]; | |
447 | + return ['success' => false, 'message' => "Cannot find TT file " . $id ]; | |
447 | 448 | } |
448 | 449 | |
449 | 450 | $this->objectDom->load($path); |
... | ... |