Commit 946ea36fd6febdba1494f70407f6ac9e27b3140f

Authored by Elena.Budnik
1 parent 7d33380d

redmine 6884 shared catalog

src/InputOutput/IHMImpl/TimeTables/IHMInputOutputTTClass.php
@@ -39,15 +39,17 @@ class IHMInputOutputTTClass implements InputOutputInterface @@ -39,15 +39,17 @@ class IHMInputOutputTTClass implements InputOutputInterface
39 { 39 {
40 //create a list of data to treat 40 //create a list of data to treat
41 $processData = new TTRequestDataClass(); 41 $processData = new TTRequestDataClass();
42 - if (strpos($tt->id,"sharedtimeTable_") === 0) {  
43 - //Shared TimeTable  
44 - $result = IHMSharedObjectsClass::getPath("timeTable", $tt->id); 42 +
  43 + if (strpos($tt->id,"sharedtimeTable_") === 0 || strpos($tt->id,"sharedcatalog_") === 0) {
  44 + //Shared TimeTable /Catalog
  45 + $objectType = strpos($tt->id,"timeTable") != 0 ? "timeTable" : "catalog";
  46 + $result = IHMSharedObjectsClass::getPath($objectType, $tt->id);
45 if (!$result['success']) 47 if (!$result['success'])
46 - throw new Exception('Shared TimeTable '.$tt->name.' not found'); 48 + throw new Exception('Shared '.$objectType.' '.$tt->name.' not found');
47 $ttName = $result['path']; 49 $ttName = $result['path'];
48 } 50 }
49 else { 51 else {
50 - //User TimeTable 52 + //User TimeTable / Catalog
51 $ttName = IHMConfigClass::getUserTTPath().$tt->id.'.xml'; 53 $ttName = IHMConfigClass::getUserTTPath().$tt->id.'.xml';
52 } 54 }
53 if (!file_exists($ttName)) 55 if (!file_exists($ttName))