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();
 }
示例#2
0
 /**
  * Get formatted mail body text of user profile data.
  *
  * @param	object	  Language object (choose user language of recipient) or null to use language of current user
  */
 function getProfileAsString(&$a_language)
 {
     include_once './Services/AccessControl/classes/class.ilObjRole.php';
     include_once './Services/Utilities/classes/class.ilFormat.php';
     global $lng, $rbacreview;
     $language =& $a_language;
     $language->loadLanguageModule('registration');
     $language->loadLanguageModule('crs');
     $body = '';
     $body .= $language->txt("login") . ": " . $this->getLogin() . "\n";
     if (strlen($this->getUTitle())) {
         $body .= $language->txt("title") . ": " . $this->getUTitle() . "\n";
     }
     if (strlen($this->getGender())) {
         $gender = $this->getGender() == 'm' ? $language->txt('gender_m') : $language->txt('gender_f');
         $body .= $language->txt("gender") . ": " . $gender . "\n";
     }
     if (strlen($this->getFirstname())) {
         $body .= $language->txt("firstname") . ": " . $this->getFirstname() . "\n";
     }
     if (strlen($this->getLastname())) {
         $body .= $language->txt("lastname") . ": " . $this->getLastname() . "\n";
     }
     if (strlen($this->getInstitution())) {
         $body .= $language->txt("institution") . ": " . $this->getInstitution() . "\n";
     }
     if (strlen($this->getDepartment())) {
         $body .= $language->txt("department") . ": " . $this->getDepartment() . "\n";
     }
     if (strlen($this->getStreet())) {
         $body .= $language->txt("street") . ": " . $this->getStreet() . "\n";
     }
     if (strlen($this->getCity())) {
         $body .= $language->txt("city") . ": " . $this->getCity() . "\n";
     }
     if (strlen($this->getZipcode())) {
         $body .= $language->txt("zipcode") . ": " . $this->getZipcode() . "\n";
     }
     if (strlen($this->getCountry())) {
         $body .= $language->txt("country") . ": " . $this->getCountry() . "\n";
     }
     if (strlen($this->getSelectedCountry())) {
         $body .= $language->txt("sel_country") . ": " . $this->getSelectedCountry() . "\n";
     }
     if (strlen($this->getPhoneOffice())) {
         $body .= $language->txt("phone_office") . ": " . $this->getPhoneOffice() . "\n";
     }
     if (strlen($this->getPhoneHome())) {
         $body .= $language->txt("phone_home") . ": " . $this->getPhoneHome() . "\n";
     }
     if (strlen($this->getPhoneMobile())) {
         $body .= $language->txt("phone_mobile") . ": " . $this->getPhoneMobile() . "\n";
     }
     if (strlen($this->getFax())) {
         $body .= $language->txt("fax") . ": " . $this->getFax() . "\n";
     }
     if (strlen($this->getEmail())) {
         $body .= $language->txt("email") . ": " . $this->getEmail() . "\n";
     }
     if (strlen($this->getHobby())) {
         $body .= $language->txt("hobby") . ": " . $this->getHobby() . "\n";
     }
     if (strlen($this->getComment())) {
         $body .= $language->txt("referral_comment") . ": " . $this->getComment() . "\n";
     }
     if (strlen($this->getMatriculation())) {
         $body .= $language->txt("matriculation") . ": " . $this->getMatriculation() . "\n";
     }
     if (strlen($this->getCreateDate())) {
         ilDatePresentation::setUseRelativeDates(false);
         ilDatePresentation::setLanguage($language);
         $date = ilDatePresentation::formatDate(new ilDateTime($this->getCreateDate(), IL_CAL_DATETIME));
         ilDatePresentation::resetToDefaults();
         $body .= $language->txt("create_date") . ": " . $date . "\n";
     }
     foreach ($rbacreview->getGlobalRoles() as $role) {
         if ($rbacreview->isAssigned($this->getId(), $role)) {
             $gr[] = ilObjRole::_lookupTitle($role);
         }
     }
     if (count($gr)) {
         $body .= $language->txt('reg_role_info') . ': ' . implode(',', $gr) . "\n";
     }
     // Time limit
     if ($this->getTimeLimitUnlimited()) {
         $body .= $language->txt('time_limit') . ": " . $language->txt('crs_unlimited') . "\n";
     } else {
         ilDatePresentation::setUseRelativeDates(false);
         ilDatePresentation::setLanguage($language);
         $period = ilDatePresentation::formatPeriod(new ilDateTime($this->getTimeLimitFrom(), IL_CAL_UNIX), new ilDateTime($this->getTimeLimitUntil(), IL_CAL_UNIX));
         ilDatePresentation::resetToDefaults();
         $start = new ilDateTime($this->getTimeLimitFrom(), IL_CAL_UNIX);
         $end = new ilDateTime($this->getTimeLimitUntil(), IL_CAL_UNIX);
         $body .= $language->txt('time_limit') . ': ' . $start->get(IL_CAL_DATETIME);
         $body .= $language->txt('time_limit') . ': ' . $end->get(IL_CAL_DATETIME);
         #$body .= $language->txt('time_limit').': '.$period;
         /*
         $body .= ($language->txt('time_limit').": ".$language->txt('crs_from')." ".
         		  ilFormat::formatUnixTime($this->getTimeLimitFrom(), true)." ".
         		  $language->txt('crs_to')." ".
         		  ilFormat::formatUnixTime($this->getTimeLimitUntil(), true)."\n");
         */
     }
     return $body;
 }