function step10() { $sql = e107::getDb(); $ns = e107::getRender(); $mes = e107::getMessage(); global $f; $stepCaption = 'Step 10: Migrate forum attachments'; $_SESSION['forumupdate']['attachment_total'] = $sql->count('forum_post', '(*)', "WHERE post_entry LIKE '%public/%' "); $_SESSION['forumupdate']['attachment_count'] = 0; $_SESSION['forumupdate']['attachment_last'] = 0; if ($_SESSION['forumupdate']['attachment_total'] == 0) { $text = "\n\t\tNo forum attachments found. \n\t\t<br /><br />\n\t\t<form method='post' action='" . e_SELF . "?step=11'>\n\t\t<input class='btn btn-success' type='submit' name='nextStep[11]' value='Proceed to step 11' />\n\t\t</form>\n\t\t"; $ns->tablerender($stepCaption, $text); return; } $text = "\n\t\tThis step will migrate the forum attachment information that was found in <b>" . $_SESSION['forumupdate']['attachment_total'] . "</b> posts.<br />\n\t\tAll files will be moved from the e107_files/public directory into the <b>" . e_MEDIA . "plugins/forum/ </b> directory and related posts will be updated accordingly.\n\t\t<br /><br />\n\t\t"; $text .= renderProgress("Begin attachment migration", 10); file_put_contents(e_LOG . "forum_upgrade_attachments.log", ''); // clear the log. $ns->tablerender($stepCaption, $mes->render() . $text); }
function renderAchievement($id, &$a, $guid) { // Skip show if not completed parent present or no_points not completed if ($a['parentAchievement'] || !$a['date'] && !$a['points'] && $guid) { return; } echo '<div class="ach_show' . ($a['date'] ? '' : ' locked') . '" onclick="showAchReq(this);">'; // Render icon echo '<img class=ach_icon src="' . getSpellIcon($a['iconId']) . '">'; echo '<div class=ach_frame></div>'; // Render points if ($a['points']) { echo '<div class=ach_point>' . $a['points'] . '</div>'; } echo '<div class=ach_title>' . $a['name'] . '</div>'; echo '<div class=ach_desc>' . $a['description'] . '</div>'; // echo '<div class=ach_desc>Flags - 0x'.dechex($a['flags']).' - '.$a['count'].'</div>'; // Render requirements echo '<div class=ach_req id=' . $id . '>'; if ($a['flags'] & CUSTOM_ACHIEVEMENT_SHOW) { getAchievementValue(&$a, &$value, &$maxvalue); if ($a['flags'] & ACHIEVEMENT_FLAG_BAR) { echo '<div class="sub bar">' . renderProgress($value, $maxvalue) . '</div>'; } else { if ($a['flags'] & ACHIEVEMENT_FLAG_MAX_USED) { echo '<div class="sub bar">' . renderProgress($value, $maxvalue) . '</div>'; } else { echo '<div class="sub ' . ($value >= $maxvalue ? 'compl' : '') . '">' . $value . '</div>'; } } } foreach ($a['requirement'] as $r) { if ($r['completionFlag'] & ACHIEVEMENT_CRITERIA_FLAG_HIDE_CRITERIA) { continue; } if ($r['completionFlag'] & ACHIEVEMENT_CRITERIA_FLAG_SHOW_PROGRESS_BAR) { echo '<div class=sub_bar>' . renderProgress(@$r['counter'], $r['value'], $r['completionFlag'] & ACHIEVEMENT_CRITERIA_FLAG_MONEY_COUNTER) . '</div>'; } else { $text = $r['name'] ? $r['name'] : $a['name']; $completed = $r['counter'] ? $r['counter'] >= $r['value'] ? 'compl' : '' : ''; // $text.="-> $r[id] - f=$r[completionFlag], c=$r[counter], d=$r[data], v=$r[value]"; echo '<div class="sub ' . $completed . '">' . $text . '</div>'; } } echo '<br clear="all"/></div>' . "\n"; // render date if ($a['date']) { echo '<div class=ach_date>' . getFormattedDate($a['date']) . '</div>'; } if ($a['titleReward']) { echo '<div class=ach_reward>' . $a['titleReward'] . '</div>'; } echo '</div>'; }
function show_task($id, $row, $modimg) { $out =& $GLOBALS['page']; $out->setWorkingZone('content'); $lang =& DoceboLanguage::createInstance('project', "lms"); $out->add('<div class="inline_block">' . "\n" . '<h2 class="heading">' . $lang->def("_PRJTASKS") . '</h2>'); $query = sql_query("SELECT * FROM " . $GLOBALS["prefix_lms"] . "_prj WHERE id='{$id}' LIMIT 1;"); $data = mysql_fetch_array($query); $progtot = $row["pprog"]; $out->add('<div class="content">' . '<table width="100%">' . '<tr><td>' . '<b>' . $lang->def("_PRJPROGTOT") . ':</b></td><td class="progress_td">'); if ($progtot < 100) { $class = "prjprogbar_g"; $img = "progbar_g"; } else { $class = "prjprogbar_r"; $img = "progbar_r"; } /*$out->add("<img class=\"$class\" src=\"".getPathImage()."prjman/$img.gif\" width=\"".($progtot*1.6)."\" alt=\"".$lang->def("_PROGRESS")."\" />\n");*/ $out->add(renderProgress($progtot, 0, 100, false)); $out->add("</td><td class=\"align_right\">{$progtot}%</td>\n"); $readlink = $modlink = ""; $dellink = ""; if (is_owner(Docebo::user()->getIdSt(), $id) || is_admin(Docebo::user()->getIdSt(), $id)) { $modlink = "<a href=\"index.php?modname=project&op=editprogtot&id=" . $id . "\"><img src=\"" . getPathImage() . "standard/edit.png\" alt=\"" . $lang->def("_MOD") . "\" /></a>"; $dellink = "<img src=\"" . getPathImage() . "standard/delete.png\" alt=\"" . $lang->def("_DEL") . "\" />"; } $out->add("<td class=\"image\">{$modlink}</td><td class=\"image\"> </td>\n"); $out->add("</tr>\n"); $query = sql_query("SELECT * FROM " . $GLOBALS["prefix_lms"] . "_prj_tasks WHERE pid='{$id}' ORDER BY tname;"); if ($query && mysql_num_rows($query) > 0) { while ($data = mysql_fetch_array($query)) { $tdesc = nl2br($data["tdesc"]); $tdesc = str_replace("'", "\\'", $tdesc); $tdesc = str_replace("\"", "\\'", $tdesc); $tdesc = str_replace("\n", "\\n", $tdesc); $tdesc = str_replace("\r", "\\r", $tdesc); $readlink = "<a href=\"index.php?modname=project&op=prjreaditem&type=task&id={$id}&itemid=" . $data["id"] . "\">" . $data["tname"] . "</a>"; $out->add("<tr><td><b>" . $readlink . "</b></td><td class=\"progress_td\">\n"); /*$out->add("<img src=\"".getPathImage()."prjman/progbar.gif\" class=\"prjprogbar\" width=\"".($data["tprog"]*1.6)."\" alt=\"\" />\n"); */ $out->add(renderProgress($data["tprog"], 0, 100, false)); $out->add("</td><td class=\"align_right\">" . $data["tprog"] . "%</td>\n"); $readlink = $modlink = ""; $dellink = ""; if (is_owner(Docebo::user()->getIdSt(), $id) || is_admin(Docebo::user()->getIdSt(), $id)) { $modlink = "<a href=\"index.php?modname=project&op=prjedititem&type=task&id={$id}&itemid=" . $data["id"] . "\"><img src=\"" . getPathImage() . "standard/edit.png\" alt=\"\" /></a>"; $dellink = "<a href=\"index.php?modname=project&op=prjdelitem&type=task&id={$id}&itemid=" . $data["id"] . "\"><img src=\"" . getPathImage() . "standard/delete.png\" alt=\"\" /></a>"; } $out->add("<td class=\"image\">{$modlink}</td><td class=\"image\">{$dellink}</td>\n"); $out->add("</tr>\n"); } } else { $out->add(Lang::t('_NO_DATA', 'standard')); } $out->add("</table>" . '</div>'); if (is_owner(Docebo::user()->getIdSt(), $id) || is_admin(Docebo::user()->getIdSt(), $id)) { $out->add('<div class="actions">' . '<a href="index.php?modname=project&op=prjadditem&type=task&id=' . $id . '">' . '<img src="' . getPathImage() . 'standard/add.png" alt="' . $lang->def("_NEW") . '" /> ' . $lang->def("_NEW") . '</a>' . '</div>' . "\n"); } $out->add('</div>'); }
function printElementOneUser(&$stack, $level) { if ($level > 0) { $arrData = $stack[$level]['folder']->otherValues; if (is_array($arrData) && $arrData[3] != '') { require_once _lms_ . '/class.module/track.object.php'; $status = Track_Object::getStatusFromId($stack[$level]['folder']->id, $this->stat_idUser); return printReport($status, TRUE, $arrData[1] !== '' ? true : false); } else { $this->tdb->stat_filter_on_items = TRUE; $totC = getSubStatStatusCount($this->stat_idUser, $this->tdb->idCourse, array('completed', 'passed'), $stack[$level]['folder'], $this->tdb); $totF = getSubStatStatusCount($this->stat_idUser, $this->tdb->idCourse, array('failed'), $stack[$level]['folder'], $this->tdb); $tot = count($this->tdb->getDescendantsId($stack[$level]['folder'])); $this->tdb->stat_filter_on_items = TRUE; $out = '<div class="fright" >'; $out .= renderProgress($totC, $totF, $tot, 130); $out .= '</div>'; return $out; } } }
$all_stats = '<div id="accordion"><h3>'; $all_stats .= '<span class="tempo">' . Lang::t('_TOTAL_TIME', 'course') . ': ' . $tot_time . ' '; // get status count value if (Docebo::course()->getValue('show_progress') == 1) { require_once $GLOBALS['where_lms'] . '/lib/lib.stats.php'; $total = getNumCourseItems($_SESSION['idCourse'], FALSE, getLogUserId(), FALSE); $tot_complete = getStatStatusCount(getLogUserId(), $_SESSION['idCourse'], array('completed', 'passed')); $tot_incomplete = $total - $tot_complete; $tot_passed = getStatStatusCount(getLogUserId(), $_SESSION['idCourse'], array('passed')); $tot_failed = getStatStatusCount(getLogUserId(), $_SESSION['idCourse'], array('failed')); } // print progress bar ------------------------------------------------- $user_stats_table = ""; if (Docebo::course()->getValue('show_progress') == 1 && true) { $user_stats_table = '<table id="user_stats" class="quick_table">' . '<thead><tr>' . (isset($user_stats['head'][0]) ? '<th scope="col">' . $user_stats['head'][0] . '</th>' : '') . (isset($user_stats['head'][1]) ? '<th scope="col">' . $user_stats['head'][1] . '</th>' : '') . (isset($user_stats['head'][2]) ? '<th scope="col">' . $user_stats['head'][2] . '</th>' : '') . '</tr></thead><tbody><tr>' . (isset($user_stats['body'][0]) ? '<td>' . $user_stats['body'][0] . '</td>' : '') . (isset($user_stats['body'][1]) ? '<td>' . $user_stats['body'][1] . '</td>' : '') . (isset($user_stats['body'][2]) ? '<td>' . $user_stats['body'][2] . '</td>' : '') . '</tr></tbody>' . '</table>'; $all_stats .= "</br>Progress:</span>" . renderProgress($tot_complete, $tot_failed, $total, false); } $course_stats_table = ""; if (Docebo::course()->getValue('show_progress') == 1 && true) { $course_stats_table .= '<table id="course_stats" class="quick_table">' . '<thead><tr>' . '<th scope="col">' . Lang::t('_PROGRESS_ALL', 'course') . '</th>' . '<th scope="col">' . Lang::t('_PROGRESS_COMPLETED', 'course') . '</th>' . '<th scope="col">' . Lang::t('_PROGRESS_INCOMPLETE', 'course') . '</th>' . '</tr></thead><tbody><tr>' . '<td>' . $total . '</td>' . '<td>' . $tot_complete . '</td>' . '<td>' . $tot_incomplete . '</td>' . '</tr></tbody>' . '</table>'; $course_stats_table .= "\n"; } $course_ex_stats_table = ""; if (Docebo::course()->getValue('show_progress') == 1 && true) { $course_ex_stats_table .= '<table id="course_exstats" class="quick_table">' . '<thead><tr>' . '<th scope="col">' . Lang::t('_PROGRESS_PASSED', 'course') . '</th>' . '<th scope="col">' . Lang::t('_PROGRESS_FAILED', 'course') . '</th>' . '</tr></thead><tbody><tr>' . '<td>' . $tot_passed . '</td>' . '<td>' . $tot_failed . '</td>' . '</tr></tbody>' . '</table>'; $course_ex_stats_table .= "\n"; } $all_stats .= '<div id="arrow"></div><div class="clear"></div>'; $all_stats .= '</h3><div>' . $user_stats_table . '' . $course_stats_table . '' . $course_ex_stats_table . $sponsor_img . '</div>'; $all_stats .= '</div>'; $menu_bottom .= $menu_left . $menu_right . '</div>';