本文整理汇总了PHP中ilDatePresentation::setUseRelativeDates方法的典型用法代码示例。如果您正苦于以下问题:PHP ilDatePresentation::setUseRelativeDates方法的具体用法?PHP ilDatePresentation::setUseRelativeDates怎么用?PHP ilDatePresentation::setUseRelativeDates使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilDatePresentation
的用法示例。
在下文中一共展示了ilDatePresentation::setUseRelativeDates方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCertificateVariablesForPresentation
/**
* Returns an array containing all variables and values which can be exchanged in the certificate
* The values should be calculated from real data. The $params parameter array should contain all
* necessary information to calculate the values.
*
* @param array $params An array of parameters to calculate the certificate parameter values
* @return array The certificate variables
*/
public function getCertificateVariablesForPresentation($params = array())
{
global $lng;
$lng->loadLanguageModule('certificate');
$user_data = $params["user_data"];
$vars = $this->getBaseVariablesForPresentation($user_data, $params["last_access"], null);
$vars["SKILL_TITLE"] = ilUtil::prepareFormOutput($this->skill->getTitleForCertificate());
$vars["SKILL_LEVEL_TITLE"] = ilUtil::prepareFormOutput($this->skill->getLevelTitleForCertificate($this->skill_level_id));
$vars["SKILL_TRIGGER_TITLE"] = ilUtil::prepareFormOutput($this->skill->getTriggerTitleForCertificate($this->skill_level_id));
// custom completion date
$achievement_date = ilBasicSkill::lookupLevelAchievementDate($user_data["usr_id"], $this->skill_level_id);
if ($achievement_date !== false) {
$old = ilDatePresentation::useRelativeDates();
ilDatePresentation::setUseRelativeDates(false);
$vars["DATE_COMPLETED"] = ilDatePresentation::formatDate(new ilDate($achievement_date, IL_CAL_DATETIME));
$vars["DATETIME_COMPLETED"] = ilDatePresentation::formatDate(new ilDateTime($achievement_date, IL_CAL_DATETIME));
ilDatePresentation::setUseRelativeDates($old);
} else {
$vars["DATE_COMPLETED"] = "";
$vars["DATETIME_COMPLETED"] = "";
}
foreach ($vars as $id => $caption) {
$insert_tags["[" . $id . "]"] = $caption;
}
return $insert_tags;
}
示例2: __construct
public function __construct($user_obj)
{
parent::__construct();
$this->user_obj = $user_obj;
$this->lng->loadLanguageModule('crs');
ilDatePresentation::setUseRelativeDates(false);
}
示例3: fillRow
/**
* @param array $row
*/
public function fillRow(array $row)
{
$old_value = ilDatePresentation::useRelativeDates();
ilDatePresentation::setUseRelativeDates(false);
$row['date'] = ilDatePresentation::formatDate(new ilDateTime($row['date'], IL_CAL_UNIX));
ilDatePresentation::setUseRelativeDates($old_value);
if (array_key_exists('percentage', $row)) {
$row['percentage'] = sprintf('%.2f', $row['percentage']) . '%';
}
// fill columns
if (!$this->isObjectiveOrientedPresentationEnabled()) {
$this->tpl->setVariable('VAL_SCORED', $row['scored']);
$this->tpl->setVariable('VAL_PASS', $row['pass']);
}
$this->tpl->setVariable('VAL_DATE', $row['date']);
if ($this->isObjectiveOrientedPresentationEnabled()) {
$this->tpl->setVariable('VAL_LO_OBJECTIVES', $row['objectives']);
$this->tpl->setVariable('VAL_LO_TRY', sprintf($this->lng->txt('tst_res_lo_try_n'), $row['pass']));
}
$this->tpl->setVariable('VAL_ANSWERED', $row['answered']);
if (isset($row['hints'])) {
$this->tpl->setVariable('VAL_HINTS', $row['hints']);
}
$this->tpl->setVariable('VAL_REACHED', $row['reached']);
$this->tpl->setVariable('VAL_PERCENTAGE', $row['percentage']);
if (!$this->pdf_view) {
$this->tpl->setVariable('VAL_PASS_DETAILS', $row['pass_details']);
}
}
示例4: sendAdvancedNotification
/**
* send an advanced notification to the owner of the test
* @param int $owner_id
* @param string $title
* @param sting $usr_data
* @param array $file_names
*/
public function sendAdvancedNotification($owner_id, $title, $usr_data, $file_names)
{
$this->initLanguage($owner_id);
$this->language->loadLanguageModule('assessment');
$this->initMail();
$this->setSubject(sprintf($this->language->txt('tst_user_finished_test'), $title));
$this->setBody(ilMail::getSalutation($owner_id, $this->getLanguage()));
$this->appendBody("\n\n");
$this->appendBody($this->language->txt('user_has_finished_a_test'));
$this->appendBody("\n\n");
$this->appendBody($this->language->txt('title') . ': ' . $title);
$this->appendBody("\n");
$this->appendBody($this->language->txt('username') . ': ' . $usr_data);
$this->appendBody("\n");
ilDatePresentation::setUseRelativeDates(false);
$this->appendBody($this->language->txt('tst_finished') . ': ' . ilDatePresentation::formatDate(new ilDateTime(time(), IL_CAL_UNIX)));
$this->appendBody("\n\n");
$this->appendBody($this->language->txt('tst_attached_xls_file'));
$this->appendBody("\n\n");
$this->appendBody($this->language->txt('tst_notification_explanation_admin'));
$this->appendBody("\n");
$this->setAttachments($file_names);
$this->getMail()->appendInstallationSignature(true);
$this->sendMail(array($owner_id), array('system'));
}
示例5: send
public function send()
{
global $lng;
$additional_information = $this->getAdditionalInformation();
$old_val = ilDatePresentation::useRelativeDates();
ilDatePresentation::setUseRelativeDates(false);
foreach ($this->getRecipients() as $rcp) {
try {
$this->handleCurrentRecipient($rcp);
} catch (ilMailException $e) {
continue;
}
$this->initMimeMail();
$this->initLanguageByIso2Code();
ilDatePresentation::setLanguage($this->getLanguage());
$date_for_deletion = ilDatePresentation::formatDate(new ilDate($additional_information["date"], IL_CAL_UNIX));
$this->setSubject($this->getLanguage()->txt('del_mail_subject'));
$body = sprintf($this->getLanguage()->txt("del_mail_body"), $rcp->fullname, "\n\n", $additional_information["www"], $date_for_deletion);
$this->appendBody($body);
$this->appendBody(ilMail::_getInstallationSignature());
$this->sendMimeMail($this->getCurrentRecipient());
}
ilDatePresentation::setUseRelativeDates($old_val);
ilDatePresentation::setLanguage($lng);
}
示例6: fillRow
/**
* fill row
*
* @access public
* @param
* @return
*/
public function fillRow($a_set)
{
global $ilUser, $ilAccess;
$this->tpl->setVariable('VAL_ID', $a_set['solution_id']);
if (strlen($a_set['webpath'])) {
$this->tpl->setVariable('VAL_FILE', '<a href="' . $a_set['webpath'] . $a_set['value1'] . '" target=\\"_blank\\">' . ilUtil::prepareFormOutput($a_set['value2']) . '</a>');
} else {
$this->tpl->setVariable('VAL_FILE', ilUtil::prepareFormOutput($a_set['value2']));
}
ilDatePresentation::setUseRelativeDates(false);
$this->tpl->setVariable('VAL_DATE', ilDatePresentation::formatDate(new ilDateTime($a_set["tstamp"], IL_CAL_UNIX)));
}
示例7: fillRow
/**
* @param array $row
*/
public function fillRow(array $row)
{
$old_value = ilDatePresentation::useRelativeDates();
ilDatePresentation::setUseRelativeDates(false);
$row['date'] = ilDatePresentation::formatDate(new ilDateTime($row['date'], IL_CAL_UNIX));
ilDatePresentation::setUseRelativeDates($old_value);
if (array_key_exists('percentage', $row)) {
$row['percentage'] = sprintf('%.2f', $row['percentage']) . '%';
}
if ($this->pdf_view && array_key_exists('pass_details', $row)) {
unset($row['pass_details']);
}
parent::fillRow($row);
}
示例8: initAttendanceList
/**
* Init attendance list object
*
* @return ilAttendanceList
*/
protected function initAttendanceList()
{
$members_obj = $this->initContainer(true);
include_once 'Services/Membership/classes/class.ilAttendanceList.php';
$list = new ilAttendanceList($this, $members_obj);
$list->setId('sessattlst');
$event_app = $this->object->getFirstAppointment();
ilDatePresentation::setUseRelativeDates(false);
$desc = ilDatePresentation::formatPeriod($event_app->getStart(), $event_app->getEnd());
ilDatePresentation::setUseRelativeDates(true);
$desc .= " " . $this->object->getTitle();
$list->setTitle($this->lng->txt('sess_attendance_list'), $desc);
$list->addPreset('mark', $this->lng->txt('trac_mark'), true);
$list->addPreset('comment', $this->lng->txt('trac_comment'), true);
if ($this->object->enabledRegistration()) {
$list->addPreset('registered', $this->lng->txt('event_tbl_registered'), true);
}
$list->addPreset('participated', $this->lng->txt('event_tbl_participated'), true);
$list->addBlank($this->lng->txt('sess_signature'));
$list->addUserFilter('registered', $this->lng->txt('event_list_registered_only'));
return $list;
}
示例9: fillRow
function fillRow($a_poll)
{
global $ilCtrl, $lng, $ilUser;
// handle messages
$mess = $this->poll_block->getMessage($ilUser->getId());
if ($mess) {
$this->tpl->setVariable("TXT_QUESTION", $mess);
return;
}
// nested form problem
if (!$_SESSION["il_cont_admin_panel"]) {
// vote
if ($this->poll_block->mayVote($ilUser->getId())) {
$this->tpl->setCurrentBlock("answer");
foreach ($a_poll->getAnswers() as $item) {
$this->tpl->setVariable("VALUE_ANSWER", $item["id"]);
$this->tpl->setVariable("TXT_ANSWER_VOTE", nl2br($item["answer"]));
$this->tpl->parseCurrentBlock();
}
$ilCtrl->setParameterByClass("ilobjpollgui", "ref_id", $this->getRefId());
$url = $ilCtrl->getLinkTargetByClass(array("ilrepositorygui", "ilobjpollgui"), "vote");
$ilCtrl->clearParametersByClass("ilobjpollgui");
$url .= "#poll" . $a_poll->getID();
$this->tpl->setVariable("URL_FORM", $url);
$this->tpl->setVariable("CMD_FORM", "vote");
$this->tpl->setVariable("TXT_SUBMIT", $lng->txt("poll_vote"));
}
// result
if ($this->poll_block->maySeeResults($ilUser->getId())) {
if (!$this->poll_block->mayNotResultsYet($ilUser->getId())) {
$perc = $this->poll_block->getPoll()->getVotePercentages();
$total = $perc["total"];
$perc = $perc["perc"];
$this->tpl->setVariable("TOTAL_ANSWERS", sprintf($lng->txt("poll_population"), $total));
$this->tpl->setCurrentBlock("answer_result");
foreach ($a_poll->getAnswers() as $item) {
$this->tpl->setVariable("TXT_ANSWER_RESULT", nl2br($item["answer"]));
$this->tpl->setVariable("PERC_ANSWER_RESULT", round($perc[$item["id"]]["perc"]));
$this->tpl->parseCurrentBlock();
}
} else {
$rel = ilDatePresentation::useRelativeDates();
ilDatePresentation::setUseRelativeDates(false);
$end = $this->poll_block->getPoll()->getVotingPeriodEnd();
$end = ilDatePresentation::formatDate(new ilDateTime($end, IL_CAL_UNIX));
ilDatePresentation::setUseRelativeDates($rel);
$this->tpl->setVariable("TOTAL_ANSWERS", $lng->txt("poll_block_message_already_voted") . ' ' . sprintf($lng->txt("poll_block_results_available_on"), $end));
}
} else {
if ($this->poll_block->getPoll()->hasUserVoted($ilUser->getId())) {
$this->tpl->setVariable("TOTAL_ANSWERS", $lng->txt("poll_block_message_already_voted"));
}
}
}
$this->tpl->setVariable("ANCHOR_ID", $a_poll->getID());
$this->tpl->setVariable("TXT_QUESTION", nl2br(trim($a_poll->getQuestion())));
$desc = trim($a_poll->getDescription());
if ($desc) {
$this->tpl->setVariable("TXT_DESC", nl2br($desc));
}
$img = $a_poll->getImageFullPath();
if ($img) {
$this->tpl->setVariable("URL_IMAGE", $img);
}
}
示例10: exportUserSpecificResults
/**
* Export the user specific results for the survey
*
* Export the user specific results for the survey
*
* @access private
*/
function exportUserSpecificResults($export_format, $export_label, $finished_ids)
{
global $ilLog;
// #13620
ilDatePresentation::setUseRelativeDates(false);
$csvfile = array();
$csvrow = array();
$csvrow2 = array();
$questions = array();
$questions =& $this->object->getSurveyQuestions(true);
array_push($csvrow, $this->lng->txt("lastname"));
// #12756
array_push($csvrow, $this->lng->txt("firstname"));
array_push($csvrow, $this->lng->txt("login"));
array_push($csvrow, $this->lng->txt('workingtime'));
// #13622
array_push($csvrow, $this->lng->txt('survey_results_finished'));
array_push($csvrow2, "");
array_push($csvrow2, "");
array_push($csvrow2, "");
array_push($csvrow2, "");
array_push($csvrow2, "");
if ($this->object->canExportSurveyCode()) {
array_push($csvrow, $this->lng->txt("codes"));
array_push($csvrow2, "");
}
/* #8211
if ($this->object->getAnonymize() == ilObjSurvey::ANONYMIZE_OFF)
{
array_push($csvrow, $this->lng->txt("gender"));
}
*/
$cellcounter = 1;
foreach ($questions as $question_id => $question_data) {
include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
$question = SurveyQuestion::_instanciateQuestion($question_data["question_id"]);
switch ($export_label) {
case "label_only":
$question->addUserSpecificResultsExportTitles($csvrow, true);
break;
case "title_only":
$question->addUserSpecificResultsExportTitles($csvrow, false);
break;
default:
$question->addUserSpecificResultsExportTitles($csvrow, false);
$question->addUserSpecificResultsExportTitles($csvrow2, true, false);
break;
}
$questions[$question_data["question_id"]] = $question;
}
array_push($csvfile, $csvrow);
if (sizeof($csvrow2) && implode("", $csvrow2)) {
array_push($csvfile, $csvrow2);
}
if (!$finished_ids) {
$participants =& $this->object->getSurveyFinishedIds();
} else {
$participants = $finished_ids;
}
$finished_data = array();
foreach ($this->object->getSurveyParticipants($participants) as $item) {
$finished_data[$item["active_id"]] = $item;
}
foreach ($participants as $user_id) {
if ($user_id < 1) {
continue;
}
$resultset =& $this->object->getEvaluationByUser($questions, $user_id);
$csvrow = array();
// #12756
array_push($csvrow, trim($resultset["lastname"]) ? $resultset["lastname"] : $resultset["name"]);
// anonymous
array_push($csvrow, $resultset["firstname"]);
array_push($csvrow, $resultset["login"]);
// #10579
if ($this->object->canExportSurveyCode()) {
array_push($csvrow, $user_id);
}
/* #8211
if ($this->object->getAnonymize() == ilObjSurvey::ANONYMIZE_OFF)
{
array_push($csvrow, $resultset["gender"]);
}
*/
$wt = $this->object->getWorkingtimeForParticipant($user_id);
array_push($csvrow, $wt);
$finished = $finished_data[$user_id];
if ((bool) $finished["finished"]) {
array_push($csvrow, ilDatePresentation::formatDate(new ilDateTime($finished["finished_tstamp"], IL_CAL_UNIX)));
} else {
array_push($csvrow, "-");
}
foreach ($questions as $question_id => $question) {
//.........这里部分代码省略.........
示例11: getExerciseInfo
function getExerciseInfo($a_assignment_id)
{
global $lng, $ilCtrl, $ilUser;
include_once "Modules/Exercise/classes/class.ilExAssignment.php";
$ass = new ilExAssignment($a_assignment_id);
$exercise_id = $ass->getExerciseId();
if (!$exercise_id) {
return;
}
// is the assignment still open?
$times_up = false;
if ($ass->getDeadline() && $ass->getDeadline() - time() <= 0) {
$times_up = true;
}
// exercise goto
include_once "./Services/Link/classes/class.ilLink.php";
$exc_ref_id = array_shift(ilObject::_getAllReferences($exercise_id));
$exc_link = ilLink::_getStaticLink($exc_ref_id, "exc");
$info = sprintf($lng->txt("blog_exercise_info"), $ass->getTitle(), "<a href=\"" . $exc_link . "\">" . ilObject::_lookupTitle($exercise_id) . "</a>");
// submit button
if (!$times_up) {
$ilCtrl->setParameter($this, "exc", $exercise_id);
$ilCtrl->setParameter($this, "ass", $a_assignment_id);
$submit_link = $ilCtrl->getLinkTarget($this, "finalize");
$ilCtrl->setParameter($this, "ass", "");
$ilCtrl->setParameter($this, "exc", "");
$info .= " <a class=\"submit emphsubmit\" href=\"" . $submit_link . "\">" . $lng->txt("blog_finalize_blog") . "</a>";
}
// submitted files
$submitted = ilExAssignment::getDeliveredFiles($exercise_id, $a_assignment_id, $ilUser->getId(), true);
if ($submitted) {
$submitted = array_pop($submitted);
$ilCtrl->setParameter($this, "ass", $a_assignment_id);
$dl_link = $ilCtrl->getLinkTarget($this, "downloadExcSubFile");
$ilCtrl->setParameter($this, "ass", "");
$rel = ilDatePresentation::useRelativeDates();
ilDatePresentation::setUseRelativeDates(false);
$info .= "<br />" . sprintf($lng->txt("blog_exercise_submitted_info"), ilDatePresentation::formatDate(new ilDateTime($submitted["ts"], IL_CAL_DATETIME)), "<a href=\"" . $dl_link . "\" class=\"submit\">" . $lng->txt("download") . "</a>");
ilDatePresentation::setUseRelativeDates($rel);
}
// work instructions incl. files
$tooltip = "";
$ass = $ass->getInstruction();
if ($ass) {
$tooltip .= nl2br($ass);
}
$ass_files = ilExAssignment::getFiles($exercise_id, $a_assignment_id);
if (count($ass_files) > 0) {
$tooltip .= "<br /><br />";
foreach ($ass_files as $file) {
$ilCtrl->setParameter($this, "ass", $a_assignment_id);
$ilCtrl->setParameter($this, "file", urlencode($file["name"]));
$dl_link = $ilCtrl->getLinkTarget($this, "downloadExcAssFile");
$ilCtrl->setParameter($this, "file", "");
$ilCtrl->setParameter($this, "ass", "");
$tooltip .= $file["name"] . ": <a href=\"" . $dl_link . "\">" . $lng->txt("download") . "</a>";
}
}
if ($tooltip) {
$ol_id = "exc_ass_" . $a_assignment_id;
include_once "Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php";
$overlay = new ilOverlayGUI($ol_id);
// overlay
$overlay->setAnchor($ol_id . "_tr");
$overlay->setTrigger($ol_id . "_tr", "click", $ol_id . "_tr");
$overlay->add();
$info .= "<div id=\"" . $ol_id . "_tr\"><a href=\"#\">" . $lng->txt("exc_instruction") . "</a></div>" . "<div id=\"" . $ol_id . "\" style=\"display:none; padding:10px;\" class=\"ilOverlay\">" . $tooltip . "</div>";
}
return "<div>" . $info . "</div>";
}
示例12: getTableHTML
public function getTableHTML()
{
global $lng, $ilCtrl, $ilUser;
$this->prepareOutput();
if (is_object($ilCtrl) && $this->getId() == "") {
$ilCtrl->saveParameter($this->getParentObject(), $this->getNavParameter());
}
if (!$this->getPrintMode()) {
// set form action
if ($this->form_action != "" && $this->getOpenFormTag()) {
$hash = "";
if (is_object($ilUser) && $ilUser->getPref("screen_reader_optimization")) {
$hash = "#" . $this->getTopAnchor();
}
$this->tpl->setCurrentBlock("tbl_form_header");
//$this->tpl->setVariable("FORMACTION", $this->getFormAction() . $hash);
//$this->tpl->setVariable("FORMNAME", $this->getFormName());
$this->tpl->parseCurrentBlock();
}
if ($this->form_action != "" && $this->getCloseFormTag()) {
$this->tpl->touchBlock("tbl_form_footer");
}
}
if (!$this->enabled['content']) {
return $this->render();
}
$this->determineOffsetAndOrder();
$this->setFooter("tblfooter", $this->lng->txt("previous"), $this->lng->txt("next"));
$data = $this->getData();
if ($this->dataExists()) {
// sort
if (!$this->getExternalSorting() && $this->enabled["sort"]) {
$data = ilUtil::sortArray($data, $this->getOrderField(), $this->getOrderDirection(), $this->numericOrdering($this->getOrderField()));
}
}
// fill rows
if ($this->dataExists()) {
if ($this->getPrintMode()) {
ilDatePresentation::setUseRelativeDates(false);
}
$this->tpl->addBlockFile("TBL_CONTENT", "tbl_content", $this->row_template, $this->row_template_dir);
foreach ($data as $set) {
$this->tpl->setCurrentBlock("tbl_content");
$this->css_row = $this->css_row != "tblrow1" ? "tblrow1" : "tblrow2";
$this->tpl->setVariable("CSS_ROW", $this->css_row);
$this->fillRow($set);
$this->tpl->setCurrentBlock("tbl_content");
$this->tpl->parseCurrentBlock();
}
} else {
// add standard no items text (please tell me, if it messes something up, alex, 29.8.2008)
$no_items_text = trim($this->getNoEntriesText()) != '' ? $this->getNoEntriesText() : $lng->txt("no_items");
$this->css_row = $this->css_row != "tblrow1" ? "tblrow1" : "tblrow2";
$this->tpl->setCurrentBlock("tbl_no_entries");
$this->tpl->setVariable('TBL_NO_ENTRY_CSS_ROW', $this->css_row);
$this->tpl->setVariable('TBL_NO_ENTRY_COLUMN_COUNT', $this->column_count);
$this->tpl->setVariable('TBL_NO_ENTRY_TEXT', trim($no_items_text));
$this->tpl->parseCurrentBlock();
}
return $this->render();
}
开发者ID:studer-raimann,项目名称:RoomSharing,代码行数:61,代码来源:class.ilRoomSharingParticipationsExportTableGUI.php
示例13: infoScreen
/**
* show information screen
*/
function infoScreen()
{
global $ilAccess, $ilTabs, $ilUser, $ilToolbar;
if (!$this->external_rater_360 && !$ilAccess->checkAccess("visible", "", $this->ref_id)) {
$this->ilias->raiseError($this->lng->txt("msg_no_perm_read"), $this->ilias->error_obj->MESSAGE);
}
$ilTabs->activateTab("info_short");
include_once "./Modules/Survey/classes/class.ilSurveyExecutionGUI.php";
$output_gui =& new ilSurveyExecutionGUI($this->object);
include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php";
$info = new ilInfoScreenGUI($this);
$info->enablePrivateNotes();
// "active" survey?
$canStart = $this->object->canStartSurvey(null, $this->external_rater_360);
$showButtons = $canStart["result"];
if (!$showButtons) {
if ($canStart["edit_settings"] && $ilAccess->checkAccess("write", "", $this->ref_id)) {
$canStart["messages"][] = "<a href=\"" . $this->ctrl->getLinkTarget($this, "properties") . "\">» " . $this->lng->txt("survey_edit_settings") . "</a>";
}
ilUtil::sendInfo(implode("<br />", $canStart["messages"]));
}
$big_button = false;
if ($showButtons) {
// closing survey?
$is_appraisee = false;
if ($this->object->get360Mode() && $this->object->isAppraisee($ilUser->getId())) {
$info->addSection($this->lng->txt("survey_360_appraisee_info"));
$appr_data = $this->object->getAppraiseesData();
$appr_data = $appr_data[$ilUser->getId()];
$info->addProperty($this->lng->txt("survey_360_raters_status_info"), $appr_data["finished"]);
if (!$appr_data["closed"]) {
include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
$button = ilLinkButton::getInstance();
$button->setCaption("survey_360_appraisee_close_action");
$button->setUrl($this->ctrl->getLinkTargetByClass("ilsurveyparticipantsgui", "confirmappraiseeclose"));
$close_button_360 = '<div>' . $button->render() . '</div>';
$txt = "survey_360_appraisee_close_action_info";
if ($this->object->get360SkillService()) {
$txt .= "_skill";
}
$info->addProperty($this->lng->txt("status"), $close_button_360 . $this->lng->txt($txt));
} else {
ilDatePresentation::setUseRelativeDates(false);
$dt = new ilDateTime($appr_data["closed"], IL_CAL_UNIX);
$info->addProperty($this->lng->txt("status"), sprintf($this->lng->txt("survey_360_appraisee_close_action_status"), ilDatePresentation::formatDate($dt)));
}
$is_appraisee = true;
}
// handle code
// validate incoming
$code_input = false;
$anonymous_code = $_POST["anonymous_id"];
if ($anonymous_code) {
$code_input = true;
// if(!$this->object->isUnusedCode($anonymous_code, $ilUser->getId()))
if (!$this->object->checkSurveyCode($anonymous_code)) {
$anonymous_code = null;
} else {
// #15860
$this->object->bindSurveyCodeToUser($ilUser->getId(), $anonymous_code);
}
}
if ($anonymous_code) {
$_SESSION["anonymous_id"][$this->object->getId()] = $anonymous_code;
} else {
$anonymous_code = $_SESSION["anonymous_id"][$this->object->getId()];
if ($anonymous_code) {
$code_input = true;
}
}
// try to find code for current (registered) user from existing run
if ($this->object->getAnonymize() && !$anonymous_code) {
$anonymous_code = $this->object->findCodeForUser($ilUser->getId());
}
// get existing runs for current user, might generate code
$participant_status = $this->object->getUserSurveyExecutionStatus($anonymous_code);
if ($participant_status) {
$anonymous_code = $participant_status["code"];
$participant_status = $participant_status["runs"];
}
// (final) check for proper anonymous code
if (!$this->object->isAccessibleWithoutCode() && !$is_appraisee && $code_input && (!$anonymous_code || !$this->object->isAnonymousKey($anonymous_code))) {
$anonymous_code = null;
ilUtil::sendInfo($this->lng->txt("wrong_survey_code_used"));
}
// :TODO: really save in session?
$_SESSION["anonymous_id"][$this->object->getId()] = $anonymous_code;
// code is mandatory and not given yet
if (!$is_appraisee && !$anonymous_code && !$this->object->isAccessibleWithoutCode()) {
$info->setFormAction($this->ctrl->getFormAction($this, "infoScreen"));
$info->addSection($this->lng->txt("anonymization"));
$info->addProperty("", $this->lng->txt("anonymize_anonymous_introduction"));
$info->addPropertyTextinput($this->lng->txt("enter_anonymous_id"), "anonymous_id", "", 8, "infoScreen", $this->lng->txt("submit"), true);
} else {
// trunk/default
if (!$this->object->get360Mode()) {
if ($anonymous_code) {
//.........这里部分代码省略.........
示例14: getBaseVariablesForPresentation
/**
* Get variable values
*
* @param array $a_user_data
* @param datetime $a_last_access
* @param datetime $a_completion_date
* @return array
*/
protected function getBaseVariablesForPresentation($a_user_data, $a_last_access = null, $a_completion_date = false)
{
global $lng;
$old = ilDatePresentation::useRelativeDates();
ilDatePresentation::setUseRelativeDates(false);
$salutation = "";
if (strlen($a_user_data["gender"])) {
$salutation = $lng->txt("salutation_" . $a_user_data["gender"]);
}
$birthday = "";
if ($a_user_data["birthday"]) {
$birthday = ilDatePresentation::formatDate(new ilDate($a_user_data["birthday"], IL_CAL_DATE));
}
$country = $a_user_data["sel_country"];
if ($country) {
$lng->loadLanguageModule("meta");
$country = $lng->txt("meta_c_" . $country);
} else {
$country = $a_user_data["country"];
}
$vars = array("USER_LOGIN" => ilUtil::prepareFormOutput(trim($a_user_data["login"])), "USER_FULLNAME" => ilUtil::prepareFormOutput(trim($a_user_data["title"] . " " . $a_user_data["firstname"] . " " . $a_user_data["lastname"])), "USER_FIRSTNAME" => ilUtil::prepareFormOutput($a_user_data["firstname"]), "USER_LASTNAME" => ilUtil::prepareFormOutput($a_user_data["lastname"]), "USER_TITLE" => ilUtil::prepareFormOutput($a_user_data["title"]), "USER_SALUTATION" => ilUtil::prepareFormOutput($salutation), "USER_BIRTHDAY" => ilUtil::prepareFormOutput($birthday), "USER_INSTITUTION" => ilUtil::prepareFormOutput($a_user_data["institution"]), "USER_DEPARTMENT" => ilUtil::prepareFormOutput($a_user_data["department"]), "USER_STREET" => ilUtil::prepareFormOutput($a_user_data["street"]), "USER_CITY" => ilUtil::prepareFormOutput($a_user_data["city"]), "USER_ZIPCODE" => ilUtil::prepareFormOutput($a_user_data["zipcode"]), "USER_COUNTRY" => ilUtil::prepareFormOutput($country));
if ($a_last_access) {
$vars["USER_LASTACCESS"] = ilDatePresentation::formatDate(new ilDateTime($a_last_access, IL_CAL_DATETIME));
}
$vars["DATE"] = ilDatePresentation::formatDate(new ilDate(time(), IL_CAL_UNIX));
$vars["DATETIME"] = ilDatePresentation::formatDate(new ilDateTime(time(), IL_CAL_UNIX));
if ($a_completion_date) {
$vars["DATE_COMPLETED"] = ilDatePresentation::formatDate(new ilDate($a_completion_date, IL_CAL_DATETIME));
$vars["DATETIME_COMPLETED"] = ilDatePresentation::formatDate(new ilDateTime($a_completion_date, IL_CAL_DATETIME));
}
ilDatePresentation::setUseRelativeDates($old);
return $vars;
}
示例15: fillRow
/**
* fill row
*
* @access public
* @param
* @return
*/
public function fillRow($data)
{
ilDatePresentation::setUseRelativeDates(false);
$this->tpl->setVariable("TITLE", ilUtil::prepareFormOutput($data['title']));
foreach ($this->getSelectedColumns() as $c) {
if (strcmp($c, 'description') == 0) {
$this->tpl->setCurrentBlock('description');
$this->tpl->setVariable("DESCRIPTION", ilUtil::prepareFormOutput($data['description']));
$this->tpl->parseCurrentBlock();
}
if (strcmp($c, 'author') == 0) {
$this->tpl->setCurrentBlock('author');
$this->tpl->setVariable("AUTHOR", ilUtil::prepareFormOutput($data['author']));
$this->tpl->parseCurrentBlock();
}
if (strcmp($c, 'ttype') == 0) {
$this->tpl->setCurrentBlock('ttype');
$this->tpl->setVariable("TYPE", ilUtil::prepareFormOutput($data['ttype']));
$this->tpl->parseCurrentBlock();
}
if (strcmp($c, 'created') == 0) {
$this->tpl->setCurrentBlock('created');
$this->tpl->setVariable('CREATED', ilDatePresentation::formatDate(new ilDateTime($data['created'], IL_CAL_UNIX)));
$this->tpl->parseCurrentBlock();
}
if (strcmp($c, 'updated') == 0) {
$this->tpl->setCurrentBlock('updated');
$this->tpl->setVariable('UPDATED', ilDatePresentation::formatDate(new ilDateTime($data['updated'], IL_CAL_UNIX)));
$this->tpl->parseCurrentBlock();
}
}
if (strcmp($this->outputmode, "detailed") == 0 || strcmp($this->outputmode, "detailed_printview") == 0) {
$this->tpl->setCurrentBlock("overview_row_detail");
include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
$question_gui = assQuestion::_instanciateQuestionGUI($data["question_id"]);
if (strcmp($this->outputmode, "detailed") == 0) {
$solutionoutput = $question_gui->getSolutionOutput($active_id = "", $pass = NULL, $graphicalOutput = FALSE, $result_output = FALSE, $show_question_only = FALSE, $show_feedback = FALSE, $show_correct_solution = true, $show_manual_scoring = false);
if (strlen($solutionoutput) == 0) {
$solutionoutput = $question_gui->getPreview();
}
$this->tpl->setVariable("DETAILS", $solutionoutput);
} else {
$this->tpl->setVariable("DETAILS", $question_gui->getPreview());
}
$this->tpl->parseCurrentBlock();
}
ilDatePresentation::setUseRelativeDates(true);
}