/**
  * Translate operator
  * @param type $a_operator
  */
 public static function translateOperator($a_obj_id, $a_operator)
 {
     switch ($a_operator) {
         case ilConditionHandler::OPERATOR_LP:
             $GLOBALS['lng']->loadLanguageModule('trac');
             include_once './Services/Tracking/classes/class.ilLPObjSettings.php';
             $obj_settings = new ilLPObjSettings($a_obj_id);
             return ilLPObjSettings::_mode2Text($obj_settings->getMode());
         default:
             $GLOBALS['lng']->loadLanguageModule('rbac');
             return $GLOBALS['lng']->txt('condition_' . $a_operator);
     }
 }
 protected function fillRowCSV($a_csv, $a_set)
 {
     $a_csv->addColumn($this->lng->txt($a_set["type"]));
     $a_csv->addColumn($a_set["title"]);
     $a_csv->addColumn(ilLearningProgressBaseGUI::_getStatusText($a_set["status"]));
     ilDatePresentation::setUseRelativeDates(false);
     $a_csv->addColumn(ilDatePresentation::formatDate(new ilDateTime($a_set['status_changed'], IL_CAL_DATETIME)));
     ilDatePresentation::resetToDefaults();
     $a_csv->addColumn(sprintf("%d%%", $a_set["percentage"]));
     $a_csv->addColumn($a_set["mark"]);
     $a_csv->addColumn($a_set["comment"]);
     $a_csv->addColumn(ilLPObjSettings::_mode2Text($a_set["u_mode"]));
     /*
     // path
     $path = $this->buildPath($a_set["ref_ids"]);
     if($path)
     {
     	$col = 7;
     	foreach($path as $path_item)
     	{
     		$a_csv->addColumn(strip_tags($path_item));
     		$col++;
     	}
     }
     */
     $a_csv->addRow();
 }
 function __showEditUser($a_user_id, $a_ref_id, $a_cancel, $a_sub_id = false)
 {
     global $ilObjDataCache, $lng, $ilCtrl;
     include_once 'Services/Tracking/classes/class.ilLPMarks.php';
     if (!$a_sub_id) {
         $obj_id = $ilObjDataCache->lookupObjId($a_ref_id);
     } else {
         $ilCtrl->setParameter($this, 'userdetails_id', $a_sub_id);
         $obj_id = $ilObjDataCache->lookupObjId($a_sub_id);
     }
     $marks = new ilLPMarks($obj_id, $a_user_id);
     $tpl = new ilTemplate('tpl.lp_edit_user.html', true, true, 'Services/Tracking');
     $tpl->setVariable("OBJ_TITLE", $lng->txt("edit") . ": " . $ilObjDataCache->lookupTitle($obj_id));
     $tpl->setVariable("OBJ_SUBTITLE", $this->lng->txt('trac_mode') . ": " . ilLPObjSettings::_mode2Text(ilLPObjSettings::_lookupMode($obj_id)));
     $ilCtrl->setParameter($this, 'user_id', $a_user_id);
     $ilCtrl->setParameter($this, 'details_id', $a_ref_id);
     $tpl->setVariable("FORMACTION", $ilCtrl->getFormAction($this));
     $tpl->setVariable("TYPE_IMG", ilObjUser::_getPersonalPicturePath($a_user_id, 'xxsmall'));
     $tpl->setVariable("ALT_IMG", $ilObjDataCache->lookupTitle($a_user_id));
     $tpl->setVariable("TXT_LP", $lng->txt('trac_learning_progress_tbl_header'));
     $tpl->setVariable("COMMENT", ilUtil::prepareFormOutput($marks->getComment(), false));
     $type = $ilObjDataCache->lookupType($obj_id);
     if ($type != 'lm') {
         $tpl->setVariable("TXT_MARK", $lng->txt('trac_mark'));
         $tpl->setVariable("MARK", ilUtil::prepareFormOutput($marks->getMark(), false));
     }
     $tpl->setVariable("TXT_COMMENT", $lng->txt('trac_comment'));
     $mode = ilLPObjSettings::_lookupMode($obj_id);
     if ($mode == LP_MODE_MANUAL or $mode == LP_MODE_MANUAL_BY_TUTOR) {
         include_once "./Services/Tracking/classes/class.ilLPStatus.php";
         $completed = ilLPStatus::_lookupStatus($obj_id, $a_user_id);
         $tpl->setVariable("mode_manual");
         $tpl->setVariable("TXT_COMPLETED", $lng->txt('trac_completed'));
         $tpl->setVariable("CHECK_COMPLETED", ilUtil::formCheckbox($completed == LP_STATUS_COMPLETED_NUM, 'completed', '1'));
     }
     $tpl->setVariable("TXT_CANCEL", $lng->txt('cancel'));
     $tpl->setVariable("TXT_SAVE", $lng->txt('save'));
     $tpl->setVariable("CMD_CANCEL", $a_cancel);
     return $tpl->get();
 }
Ejemplo n.º 4
0
 public function getModeText($a_mode)
 {
     return ilLPObjSettings::_mode2Text($a_mode);
 }
 /**
  * Parse one item
  * @param array $item
  */
 protected function parseCollectionItem($item)
 {
     $tmp['ref_id'] = $item;
     $tmp['id'] = $item;
     $tmp['obj_id'] = ilObject::_lookupObjId($item);
     $tmp['type'] = ilObject::_lookupType($tmp['obj_id']);
     $tmp['title'] = ilObject::_lookupTitle($tmp['obj_id']);
     $tmp['description'] = ilObject::_lookupDescription($tmp['obj_id']);
     // mode to text (sorting)
     $tmp["mode_id"] = ilLPObjSettings::_lookupMode($tmp['obj_id']);
     $tmp["mode"] = ilLPObjSettings::_mode2Text($tmp["mode_id"]);
     // status (sorting)
     $tmp["status"] = $this->getCollection()->isAssigned($item);
     return $tmp;
 }
 protected function parseTitle($a_obj_id, $action, $a_user_id = false)
 {
     global $lng, $ilObjDataCache, $ilUser;
     $user = "";
     if ($a_user_id) {
         if ($a_user_id != $ilUser->getId()) {
             $a_user = ilObjectFactory::getInstanceByObjId($a_user_id);
         } else {
             $a_user = $ilUser;
         }
         $user .= ", " . $a_user->getFullName();
         // " [".$a_user->getLogin()."]";
     }
     if ($a_obj_id != ROOT_FOLDER_ID) {
         $this->setTitle($lng->txt($action) . ": " . $ilObjDataCache->lookupTitle($a_obj_id) . $user);
         $this->setDescription($this->lng->txt('trac_mode') . ": " . ilLPObjSettings::_mode2Text(ilLPObjSettings::_lookupMode($a_obj_id)));
     } else {
         $this->setTitle($lng->txt($action));
     }
 }