4include_once(
"./Services/Tracking/classes/class.ilLPTableBaseGUI.php");
 
   20        function __construct($a_parent_obj, $a_parent_cmd, array $a_preselect = 
null, $a_load_items = 
true)
 
   24                $this->preselected = $a_preselect;
 
   26                $this->
setId(
"lpobjstatdlytbl");
 
   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                for($loop = 0; $loop<24; $loop+=2)
 
   39                        $this->
addColumn(str_pad($loop, 2, 
"0", STR_PAD_LEFT).
":00-<br />".
 
   40                                str_pad($loop+2, 2, 
"0", STR_PAD_LEFT).
":00 ", 
"hour".$loop, 
"", 
false, 
"ilRight");
 
   42                $this->
addColumn($lng->txt(
"total"), 
"sum", 
"", 
false, 
"ilRight");
 
   44                $this->
setTitle($this->lng->txt(
"trac_object_stat_daily"));
 
   51                $this->
setFormAction($ilCtrl->getFormAction($a_parent_obj, $a_parent_cmd));
 
   52                $this->
setRowTemplate(
"tpl.lp_object_statistics_daily_row.html", 
"Services/Tracking");
 
   69                if($a_field != 
"title")
 
   86                include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
 
   90                $si->readFromSession();
 
   95                $this->filter[
"type"] = 
$si->getValue();
 
   98                include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
 
  100                $ti->setMaxLength(64);
 
  103                $ti->readFromSession();
 
  104                $this->filter[
"query"] = $ti->getValue();
 
  108                $si->setOptions(array(
"read_count"=>
$lng->txt(
"trac_read_count"),
 
  109                        "spent_seconds"=>
$lng->txt(
"trac_spent_seconds")));
 
  111                $si->readFromSession();
 
  114                        $si->setValue(
"read_count");
 
  116                $this->filter[
"measure"] = 
$si->getValue();
 
  122                $si->readFromSession();
 
  125                        $si->setValue(date(
"Y-m"));
 
  127                $this->filter[
"yearmonth"] = 
$si->getValue();
 
  137                        include_once 
"Services/Tracking/classes/class.ilTrQuery.php";
 
  139                        $yearmonth = explode(
"-", $this->filter[
"yearmonth"]);
 
  140                        if(
sizeof($yearmonth) == 1)
 
  149                        foreach($stat_objects as $obj_id => $hours)
 
  151                                $data[$obj_id][
"obj_id"] = $obj_id;
 
  154                                foreach($hours as $hour => $values)
 
  157                                        $data[$obj_id][
"hour".floor($hour/2)*2] += (int)$values[$this->filter[
"measure"]];
 
  158                                        $data[$obj_id][
"sum"] += (int)$values[$this->filter[
"measure"]];
 
  161                                        $data[$obj_id][
"graph"][
"hour".$hour] = $values[$this->filter[
"measure"]];
 
  166                        foreach($objects as $obj_id => $ref_ids)
 
  168                                if(!isset(
$data[$obj_id]))
 
  170                                        $data[$obj_id][
"obj_id"] = $obj_id;
 
  188                $this->tpl->setVariable(
"OBJ_ID", $a_set[
"obj_id"]);
 
  190                $this->tpl->setVariable(
"ICON_ALT", $this->lng->txt($type));
 
  191                $this->tpl->setVariable(
"TITLE_TEXT", $a_set[
"title"]);
 
  193                if($this->preselected && in_array($a_set[
"obj_id"], $this->preselected))
 
  195                        $this->tpl->setVariable(
"CHECKBOX_STATE", 
" checked=\"checked\"");
 
  198                $this->tpl->setCurrentBlock(
"hour");
 
  199                for($loop = 0; $loop<24; $loop+=2)
 
  201                        $value = (int)$a_set[
"hour".$loop];
 
  202                        if($this->filter[
"measure"] != 
"spent_seconds")
 
  210                        $this->tpl->setVariable(
"HOUR_VALUE", $value);
 
  211                        $this->tpl->parseCurrentBlock();
 
  214                if($this->filter[
"measure"] == 
"spent_seconds")
 
  222                $this->tpl->setVariable(
"TOTAL", $sum);
 
  229                include_once 
"Services/Chart/classes/class.ilChart.php";
 
  231                $chart->setsize(700, 500);
 
  234                $chart->setLegend($legend);
 
  237                foreach($this->
getData() as $object)
 
  239                        if(in_array($object[
"obj_id"], $a_graph_items))
 
  244                                for($loop = 0; $loop<24; $loop++)
 
  246                                        $value = (int)$object[
"graph"][
"hour".$loop];
 
  247                                        $max_value = max($max_value, $value);
 
  248                                        if($this->filter[
"measure"] != 
"spent_seconds")
 
  252                                        $series->addPoint($loop, $value);
 
  255                                $chart->addData($series);
 
  259                $value_ticks = $this->
buildValueScale($max_value, ($this->filter[
"measure"] != 
"spent_seconds"),
 
  260                        ($this->filter[
"measure"] == 
"spent_seconds"));
 
  263                for($loop = 0; $loop<24; $loop++)
 
  265                        $labels[$loop] = str_pad($loop, 2, 
"0", STR_PAD_LEFT);
 
  267                $chart->setTicks($labels, $value_ticks, 
true);
 
  269                return $chart->getHTML();
 
  280                $a_worksheet->write($a_row, 0, $a_set[
"obj_id"]);
 
  283                for($loop = 0; $loop<24; $loop+=2)
 
  285                        $value = (int)$a_set[
"hour".$loop];
 
  286                        if($this->filter[
"measure"] != 
"spent_seconds")
 
  292                        $a_worksheet->write($a_row, $col, $value);
 
  295                if($this->filter[
"measure"] == 
"spent_seconds")
 
  299                        $sum = (int)$a_set[
"sum"];
 
  306                $a_worksheet->write($a_row, $col, $sum);
 
  317                $a_csv->addColumn($a_set[
"obj_id"]);
 
  319                for($loop = 0; $loop<24; $loop+=2)
 
  321                        $value = (int)$a_set[
"hour".$loop];
 
  322                        if($this->filter[
"measure"] != 
"spent_seconds")
 
  327                        $a_csv->addColumn($value);
 
  330                if($this->filter[
"measure"] == 
"spent_seconds")
 
  334                        $sum = (int)$a_set[
"sum"];
 
  340                $a_csv->addColumn($sum);
 
static getInstanceByType($a_type, $a_id)
Get type instance.
TableGUI class for learning progress.
fillRowExcel($a_worksheet, &$a_row, $a_set)
Excel Version of Fill Row.
numericOrdering($a_field)
Should this field be sorted numeric?
fillRow($a_set)
Fill table row.
fillRowCSV($a_csv, $a_set)
CSV Version of Fill Row.
__construct($a_parent_obj, $a_parent_cmd, array $a_preselect=null, $a_load_items=true)
Constructor.
getGraph(array $a_graph_items)
TableGUI class for learning progress.
searchObjects(array $filter, $permission, array $preset_obj_ids=null)
Search objects that match current filters.
formatSeconds($seconds, $a_shorten_zero=false)
getCurrentFilter($as_query=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.
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
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="")
Add a column to the header.
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.
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 getObjectDailyStatistics(array $a_ref_ids, $a_year, $a_month=null)