4include_once(
"./Services/Tracking/classes/class.ilLPTableBaseGUI.php");
 
   20    public function __construct($a_parent_obj, $a_parent_cmd, array $a_preselect = 
null, $a_load_items = 
true)
 
   24        $this->preselected = $a_preselect;
 
   26        $this->
setId(
"lpobjstattbl");
 
   28        parent::__construct($a_parent_obj, $a_parent_cmd);
 
   35        $this->
addColumn($lng->txt(
"trac_title"), 
"title");
 
   36        $this->
addColumn($lng->txt(
"object_id"), 
"obj_id");
 
   37        if (strpos($this->filter[
"yearmonth"], 
"-") === 
false) {
 
   38            foreach ($this->
getMonthsYear($this->filter[
"yearmonth"]) as $num => $caption) {
 
   39                $this->
addColumn($caption, 
"month_" . $num);
 
   42        $this->
addColumn($lng->txt(
"total"), 
"total");
 
   44        $this->
setTitle($this->lng->txt(
"trac_object_stat_access"));
 
   47        $this->
addMultiCommand(
"showAccessGraph", $lng->txt(
"trac_show_graph"));
 
   51        $this->
setFormAction($ilCtrl->getFormAction($a_parent_obj, $a_parent_cmd));
 
   52        $this->
setRowTemplate(
"tpl.lp_object_statistics_row.html", 
"Services/Tracking");
 
   68        if ($a_field != 
"title") {
 
   84        include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
 
   88        $si->readFromSession();
 
   89        if (!
$si->getValue()) {
 
   92        $this->filter[
"type"] = 
$si->getValue();
 
   95        include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
 
   97        $ti->setMaxLength(64);
 
  100        $ti->readFromSession();
 
  101        $this->filter[
"query"] = $ti->getValue();
 
  105        $si->setOptions(array(
"read_count"=>
$lng->txt(
"trac_read_count"),
 
  106            "spent_seconds"=>
$lng->txt(
"trac_spent_seconds"),
 
  107            "users"=>
$lng->txt(
"users")));
 
  109        $si->readFromSession();
 
  110        if (!
$si->getValue()) {
 
  111            $si->setValue(
"read_count");
 
  113        $this->filter[
"measure"] = 
$si->getValue();
 
  119        $si->readFromSession();
 
  120        if (!
$si->getValue()) {
 
  123        $this->filter[
"yearmonth"] = 
$si->getValue();
 
  130        if ($this->filter[
"type"] != 
"prtf") {
 
  134            if ($this->filter[
"type"] == 
"blog") {
 
  135                include_once 
'./Services/Tracking/classes/class.ilTrQuery.php';
 
  137                    $objects[$obj_id] = array($obj_id);
 
  142            include_once 
'./Services/Tracking/classes/class.ilTrQuery.php';
 
  144                $objects[$obj_id] = array($obj_id);
 
  149            $yearmonth = explode(
"-", $this->filter[
"yearmonth"]);
 
  150            if (
sizeof($yearmonth) == 1) {
 
  151                include_once 
'./Services/Tracking/classes/class.ilTrQuery.php';
 
  153                    $data[$obj_id][
"obj_id"] = $obj_id;
 
  156                    foreach ($months as $month => $values) {
 
  157                        $idx = $yearmonth[0] . 
"-" . str_pad($month, 2, 
"0", STR_PAD_LEFT);
 
  158                        $data[$obj_id][
"month_" . $idx] = (int) $values[$this->filter[
"measure"]];
 
  159                        $data[$obj_id][
"total"] += (int) $values[$this->filter[
"measure"]];
 
  163                include_once 
'./Services/Tracking/classes/class.ilTrQuery.php';
 
  165                    $data[$obj_id][
"obj_id"] = $obj_id;
 
  168                    foreach ($days as $day => $values) {
 
  169                        $data[$obj_id][
"day_" . $day] = (int) $values[$this->filter[
"measure"]];
 
  170                        $data[$obj_id][
"total"] += (int) $values[$this->filter[
"measure"]];
 
  176            foreach (array_keys($objects) as $obj_id) {
 
  177                if (!isset(
$data[$obj_id])) {
 
  178                    $data[$obj_id][
"obj_id"] = $obj_id;
 
  196        $this->tpl->setVariable(
"OBJ_ID", $a_set[
"obj_id"]);
 
  198        $this->tpl->setVariable(
"ICON_ALT", $this->lng->txt(
$type));
 
  199        $this->tpl->setVariable(
"TITLE_TEXT", $a_set[
"title"]);
 
  201        if ($this->preselected && in_array($a_set[
"obj_id"], $this->preselected)) {
 
  202            $this->tpl->setVariable(
"CHECKBOX_STATE", 
" checked=\"checked\"");
 
  206        if (strpos($this->filter[
"yearmonth"], 
"-") === 
false) {
 
  207            $this->tpl->setCurrentBlock(
"month");
 
  208            foreach (array_keys($this->
getMonthsYear($this->filter[
"yearmonth"])) as $num) {
 
  209                $value = (int) $a_set[
"month_" . $num];
 
  210                if ($this->filter[
"measure"] != 
"spent_seconds") {
 
  215                $this->tpl->setVariable(
"MONTH_VALUE", $value);
 
  216                $this->tpl->parseCurrentBlock();
 
  220        if ($this->filter[
"measure"] == 
"spent_seconds") {
 
  225        $this->tpl->setVariable(
"TOTAL", $sum);
 
  232        include_once 
"Services/Chart/classes/class.ilChart.php";
 
  234        $chart->setSize(700, 500);
 
  240        foreach ($this->
getData() as $object) {
 
  241            if (in_array($object[
"obj_id"], $a_graph_items)) {
 
  245                if (strpos($this->filter[
"yearmonth"], 
"-") === 
false) {
 
  246                    foreach (array_keys($this->
getMonthsYear($this->filter[
"yearmonth"])) as $idx => $num) {
 
  247                        $value = (int) $object[
"month_" . $num];
 
  248                        $max_value = max($max_value, $value);
 
  249                        if ($this->filter[
"measure"] != 
"spent_seconds") {
 
  252                        $series->addPoint($idx, $value);
 
  255                    for ($loop = 1; $loop<32; $loop++) {
 
  256                        $value = (int) $object[
"day_" . $loop];
 
  257                        $max_value = max($max_value, $value);
 
  258                        if ($this->filter[
"measure"] != 
"spent_seconds") {
 
  261                        $series->addPoint($loop, $value);
 
  271            ($this->filter[
"measure"] != 
"spent_seconds"),
 
  272            ($this->filter[
"measure"] == 
"spent_seconds")
 
  276        if (strpos($this->filter[
"yearmonth"], 
"-") === 
false) {
 
  277            foreach (array_values($this->
getMonthsYear($this->filter[
"yearmonth"], 
true)) as $idx => $caption) {
 
  278                $labels[$idx] = $caption;
 
  281            for ($loop = 1; $loop<32; $loop++) {
 
  282                $labels[$loop] = $loop . 
".";
 
  285        $chart->setTicks($labels, $value_ticks, 
true);
 
  297        $a_excel->
setCell($a_row, 1, $a_set[
"obj_id"]);
 
  300        if (strpos($this->filter[
"yearmonth"], 
"-") === 
false) {
 
  301            foreach (array_keys($this->
getMonthsYear($this->filter[
"yearmonth"])) as $num) {
 
  302                $value = (int) $a_set[
"month_" . $num];
 
  303                if ($this->filter[
"measure"] != 
"spent_seconds") {
 
  307                $a_excel->
setCell($a_row, ++$col, $value);
 
  311        if ($this->filter[
"measure"] == 
"spent_seconds") {
 
  314            $sum = (int) $a_set[
"total"];
 
  318        $a_excel->
setCell($a_row, ++$col, $sum);
 
  328        $a_csv->addColumn($a_set[
"obj_id"]);
 
  330        if (strpos($this->filter[
"yearmonth"], 
"-") === 
false) {
 
  331            foreach (array_keys($this->
getMonthsYear($this->filter[
"yearmonth"])) as $num) {
 
  332                $value = (int) $a_set[
"month_" . $num];
 
  333                if ($this->filter[
"measure"] != 
"spent_seconds") {
 
  337                $a_csv->addColumn($value);
 
  341        if ($this->filter[
"measure"] == 
"spent_seconds") {
 
  344            $sum = (int) $a_set[
"total"];
 
  348        $a_csv->addColumn($sum);
 
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
An exception for terminatinating execution or to throw for unit testing.
static getInstanceByType($a_type, $a_id)
Get type instance.
setCell($a_row, $a_col, $a_value, $a_datatype=null)
Set cell value.
TableGUI class for learning progress.
fillRowExcel(ilExcel $a_excel, &$a_row, $a_set)
Excel Version of Fill Row.
__construct($a_parent_obj, $a_parent_cmd, array $a_preselect=null, $a_load_items=true)
Constructor.
fillRow($a_set)
Fill table row.
fillMetaExcel(ilExcel $a_excel, &$a_row)
Add meta information to excel export.
fillRowCSV($a_csv, $a_set)
CSV Version of Fill Row.
fillMetaCSV($a_csv)
Add meta information to csv export.
numericOrdering($a_field)
Should this field be sorted numeric?
getGraph(array $a_graph_items)
TableGUI class for learning progress.
formatSeconds($seconds, $a_shorten_zero=false)
getCurrentFilter($as_query=false)
getMonthsYear($a_year=null, $a_short=false)
buildValueScale($a_max_value, $a_anonymize=false, $a_format_seconds=false)
anonymizeValue($a_value, $a_force_number=false)
getMonthsFilter($a_short=false)
getPossibleTypes($a_split_learning_resources=false, $a_include_digilib=false, $a_allow_undefined_lp=false)
Get possible subtypes.
searchObjects(array $filter, $permission, array $preset_obj_ids=null, $a_check_lp_activation=true)
Search objects that match current filters.
static _lookupTitle($a_id)
lookup object title
static _getIcon( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
static _lookupType($a_id, $a_reference=false)
lookup object type
setEnableHeader($a_enableheader)
Set Enable Header.
setDisableFilterHiding($a_val=true)
Set disable filter hiding.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
setExportFormats(array $formats)
Set available export formats.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setData($a_data)
set table data @access public
setResetCommand($a_val, $a_caption=null)
Set reset filter command.
setEnableTitle($a_enabletitle)
Set Enable Title.
setEnableNumInfo($a_val)
Set enable num info.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
addMultiCommand($a_cmd, $a_text)
Add Command button.
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setFilterCommand($a_val, $a_caption=null)
Set filter command.
This class represents a text property in a property form.
static getObjectAccessStatistics(array $a_ref_ids, $a_year, $a_month=null)
static getWorkspaceBlogs($a_title=null)
static getPortfolios($a_title=null)