/**
  * Check if course allocation is activated for one recipient of the 
  * @param ilECSSetting $server
  * @param type $a_content_id
  */
 public function checkAllocationActivation(ilECSSetting $server, $a_content_id)
 {
     try {
         include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseConnector.php';
         $crs_reader = new ilECSCourseConnector($server);
         $details = $crs_reader->getCourse($a_content_id, true);
         $this->mid = $details->getMySender();
         // Check if import is enabled
         include_once './Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
         $part = ilECSParticipantSetting::getInstance($this->getServer()->getServerId(), $this->getMid());
         if (!$part->isImportEnabled()) {
             $GLOBALS['ilLog']->write(__METHOD__ . ': Import disabled for mid ' . $this->getMid());
             return false;
         }
         // Check course allocation setting
         include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
         $gl_settings = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid());
         $enabled = $gl_settings->isCourseAllocationEnabled();
         if (!$enabled) {
             $GLOBALS['ilLog']->write(__METHOD__ . ': Course allocation disabled for ' . $this->getMid());
         }
         return $enabled;
     } catch (ilECSConnectorException $e) {
         $GLOBALS['ilLog']->write(__METHOD__ . ': Reading course details failed with message ' . $e->getMessage());
         return false;
     }
 }
 /**
  * Fill row
  * @param array $a_set
  */
 public function fillRow($a_set)
 {
     global $ilCtrl;
     // show title if available
     if ($a_set['term']) {
         $this->tpl->setVariable('VAL_TITLE', $a_set['term']);
     } else {
         $this->tpl->setVariable('VAL_TITLE', $a_set['title']);
     }
     $this->tpl->setVariable('TXT_STATUS', $this->lng->txt('status'));
     $this->tpl->setVariable('VAL_STATUS', ilECSMappingUtils::mappingStatusToString($a_set['status']));
     // Actions
     include_once './Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php';
     $list = new ilAdvancedSelectionListGUI();
     $list->setSelectionHeaderClass('small');
     $list->setItemLinkClass('small');
     $list->setId('actl_' . $a_set['id']);
     $list->setListTitle($this->lng->txt('actions'));
     $ilCtrl->setParameter($this->getParentObject(), 'tid', $a_set['id']);
     $this->tpl->setVariable('EDIT_TITLE', $this->ctrl->getLinkTarget($this->getParentObject(), 'dInitEditTree'));
     $list->addItem($this->lng->txt('edit'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'dInitEditTree'));
     include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
     if ($a_set['status'] != ilECSMappingUtils::MAPPED_UNMAPPED && ilECSNodeMappingSettings::getInstance()->isDirectoryMappingEnabled()) {
         $list->addItem($this->lng->txt('ecs_cms_tree_synchronize'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'dSynchronizeTree'));
     }
     $list->addItem($this->lng->txt('delete'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'dConfirmDeleteTree'));
     $this->tpl->setVariable('ACTIONS', $list->getHTML());
     $ilCtrl->clearParameters($this->getParentObject());
 }
 /**
  * Get singeleton instance
  * @return ilECSNodeMappingSettings
  */
 public static function getInstance()
 {
     if (self::$instance) {
         return self::$instance;
     }
     return self::$instance = new ilECSNodeMappingSettings();
 }
 /**
  * @maybe 
  * Constructor
  */
 public function __construct(ilECSSetting $server)
 {
     $this->server = $server;
     $this->mapping = ilECSNodeMappingSettings::getInstance();
     include_once './Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
     $this->mid = ilECSParticipantSettings::loookupCmsMid($this->getServer()->getServerId());
 }
 /**
  * @maybe 
  * Constructor
  */
 public function __construct(ilECSSetting $server, $a_mid)
 {
     $this->server = $server;
     $this->mid = $a_mid;
     $this->mapping = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid());
     include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseUrl.php';
     $this->course_url = new ilECSCourseUrl();
 }
 /**
  * Constructor
  */
 public function __construct(ilECSSetting $server, $mid, $tree_id)
 {
     $this->server = $server;
     $this->mid = $mid;
     $this->tree = new ilECSCmsTree($tree_id);
     $this->tree_id = $tree_id;
     include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
     $this->global_settings = ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->mid);
 }
 /**
  * Get singeleton instance
  * @return ilECSNodeMappingSettings
  */
 public static function getInstance()
 {
     $GLOBALS['ilLog']->write(__METHOD__ . ': Deprecated call...');
     $GLOBALS['ilLog']->logStack();
     if (self::$instance) {
         return self::$instance;
     }
     return self::$instance = new ilECSNodeMappingSettings();
 }
 /**
  * Set Sub tabs
  * @global ilTabsGUI $ilTabs
  * @param string $a_tab 
  */
 protected function setSubTabs($a_tab)
 {
     global $ilTabs;
     if ($a_tab == self::TAB_DIRECTORY) {
         $ilTabs->addSubTab('dMappingOverview', $this->lng->txt('ecs_cc_mapping_overview'), $this->ctrl->getLinkTarget($this, 'dMappingOverview'));
         $ilTabs->addSubTab('dTrees', $this->lng->txt('ecs_cms_dir_tree'), $this->ctrl->getLinkTarget($this, 'dTrees'));
         $ilTabs->addSubTab('dSettings', $this->lng->txt('settings'), $this->ctrl->getLinkTarget($this, 'dSettings'));
     }
     if ($a_tab == self::TAB_COURSE) {
         // Check if attributes are available
         include_once './Services/WebServices/ECS/classes/Course/class.ilECSCourseAttributes.php';
         $atts = ilECSCourseAttributes::getInstance($this->getServer()->getServerId(), $this->getMid());
         include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
         if (ilECSNodeMappingSettings::getInstanceByServerMid($this->getServer()->getServerId(), $this->getMid())->isCourseAllocationEnabled()) {
             $ilTabs->addSubTab('cInitTree', $this->lng->txt('ecs_cmap_overview'), $this->ctrl->getLinkTarget($this, 'cInitOverview'));
         }
         $ilTabs->addSubTab('cSettings', $this->lng->txt('settings'), $this->ctrl->getLinkTarget($this, 'cSettings'));
     }
 }
 /**
  * Check if course allocation is activated for one recipient of the 
  * @param ilECSSetting $server
  * @param type $a_content_id
  */
 public function checkAllocationActivation(ilECSSetting $server, $a_content_id)
 {
     include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
     $gl_settings = ilECSNodeMappingSettings::getInstance();
     return $gl_settings->isCourseAllocationEnabled();
 }
 /**
  * init handler
  */
 private function init()
 {
     include_once './Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
     $this->mid = ilECSParticipantSettings::loookupCmsMid($this->getServer()->getServerId());
     include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
     $this->mapping = ilECSNodeMappingSettings::getInstance();
 }