ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\Survey\PrintView\ResultsPerUserPrintViewProviderGUI Class Reference
+ Inheritance diagram for ILIAS\Survey\PrintView\ResultsPerUserPrintViewProviderGUI:
+ Collaboration diagram for ILIAS\Survey\PrintView\ResultsPerUserPrintViewProviderGUI:

Public Member Functions

 __construct (\ilLanguage $lng, \ilCtrl $ctrl, int $ref_id)
 
 getTemplateInjectors ()
 
 getSelectionForm ()
 form which is featured in the modal form target is modified to open in new window (not yet possible with ks forms) the print/pdf message is added automatically More...
 
 getPages ()
 
- Public Member Functions inherited from ILIAS\Export\AbstractPrintViewProvider
 setOffline (bool $offline)
 Set output mode. More...
 
 getOnSubmitCode ()
 
 autoPageBreak ()
 
 getSelectionForm ()
 
 getPages ()
 
 getTemplateInjectors ()
 

Protected Member Functions

 getPrintHeader ()
 
- Protected Member Functions inherited from ILIAS\Export\AbstractPrintViewProvider
 getOutputMode ()
 Get output mode. More...
 

Protected Attributes

ilTree $tree
 
ILIAS Survey InternalGUIService $gui
 
ILIAS Survey Evaluation EvaluationManager $evaluation_manager
 
ILIAS Survey Evaluation EvaluationGUIRequest $request
 
ILIAS Survey Access AccessManager $access_manager
 
ilObjSurvey $survey
 
int $ref_id
 
ilLanguage $lng
 
ilCtrl $ctrl
 
- Protected Attributes inherited from ILIAS\Export\AbstractPrintViewProvider
 $offline = false
 

Additional Inherited Members

- Data Fields inherited from ILIAS\Export\AbstractPrintViewProvider
const PRINT = "print"
 
const OFFLINE = "offline"
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Survey\PrintView\ResultsPerUserPrintViewProviderGUI::__construct ( \ilLanguage  $lng,
\ilCtrl  $ctrl,
int  $ref_id 
)

Definition at line 40 of file class.ResultsPerUserPrintViewProviderGUI.php.

References ILIAS\Survey\PrintView\ResultsPerUserPrintViewProviderGUI\$ctrl, $DIC, ILIAS\Survey\PrintView\ResultsPerUserPrintViewProviderGUI\$lng, ILIAS\Survey\PrintView\ResultsPerUserPrintViewProviderGUI\$ref_id, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

44  {
45  global $DIC;
46 
47  $this->lng = $lng;
48  $this->ctrl = $ctrl;
49  $this->ref_id = $ref_id;
50  $this->survey = new \ilObjSurvey($this->ref_id);
51  $this->access_manager = $DIC->survey()
52  ->internal()
53  ->domain()
54  ->access($this->ref_id, $DIC->user()->getId());
55  $this->request = $DIC->survey()
56  ->internal()
57  ->gui()
58  ->evaluation($this->survey)
59  ->request();
60  $this->evaluation_manager = $DIC->survey()
61  ->internal()
62  ->domain()
63  ->evaluation(
64  $this->survey,
65  $DIC->user()->getId(),
66  $this->request->getAppraiseeId(),
67  $this->request->getRaterId()
68  );
69  $this->gui = $DIC->survey()
70  ->internal()
71  ->gui();
72  $this->tree = $DIC->repositoryTree();
73  }
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

Member Function Documentation

◆ getPages()

ILIAS\Survey\PrintView\ResultsPerUserPrintViewProviderGUI::getPages ( )
Returns
string[]

Implements ILIAS\Export\PrintViewProvider.

Definition at line 123 of file class.ResultsPerUserPrintViewProviderGUI.php.

References Vendor\Package\$d, $data, ILIAS\Survey\PrintView\ResultsPerUserPrintViewProviderGUI\getPrintHeader(), and null.

123  : array
124  {
125  $print_pages = [];
126 
127  $data = $this->evaluation_manager->getUserSpecificResults();
128 
129  $selection = $this->request->getPrintSelection();
130  $active_ids = $this->request->getActiveIds();
131 
132  $table_gui = new \ilSurveyResultsUserTableGUI(null, '');
133  $filtered_data = [];
134  foreach ($data as $active_id => $d) {
135  if ($selection === "all" || in_array($active_id, $active_ids)) {
136  $filtered_data[$active_id] = $d;
137  }
138  }
139 
140  $table_gui->setData($filtered_data);
141 
142  $print_pages[] = $this->getPrintHeader() .
143  $table_gui->getHTML();
144 
145  return $print_pages;
146  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ getPrintHeader()

ILIAS\Survey\PrintView\ResultsPerUserPrintViewProviderGUI::getPrintHeader ( )
protected

Definition at line 148 of file class.ResultsPerUserPrintViewProviderGUI.php.

References $data, Vendor\Package\$f, $path, $r, ilLink\_getStaticLink(), ilDatePresentation\formatDate(), IL_CAL_UNIX, ILIAS\Repository\lng(), and ilDatePresentation\setUseRelativeDates().

Referenced by ILIAS\Survey\PrintView\ResultsPerUserPrintViewProviderGUI\getPages().

148  : string
149  {
150  $head = "<h2>" . $this->survey->getTitle() . "</h2>\n";
151  $path = "";
152  $path_full = $this->tree->getPathFull($this->survey->getRefId());
153  foreach ($path_full as $data) {
154  $path .= " &raquo; ";
155  $path .= $data['title'];
156  }
157 
159  $props = array(
160  $this->lng->txt("url") => \ilLink::_getStaticLink($this->survey->getRefId()),
161  $this->lng->txt("path") => $path,
162  $this->lng->txt("date") => \ilDatePresentation::formatDate(new \ilDateTime(time(), IL_CAL_UNIX)),
163  );
164 
165  $f = $this->gui->ui()->factory();
166  $r = $this->gui->ui()->renderer();
167  $l = $f->listing()->descriptive($props);
168 
169  return $head . $r->render($l);
170  }
static array static setUseRelativeDates(bool $a_status)
set use relative dates
const IL_CAL_UNIX
$path
Definition: ltiservices.php:29
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
$r
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSelectionForm()

ILIAS\Survey\PrintView\ResultsPerUserPrintViewProviderGUI::getSelectionForm ( )

form which is featured in the modal form target is modified to open in new window (not yet possible with ks forms) the print/pdf message is added automatically

Returns
ilPropertyFormGUI|null

Implements ILIAS\Export\PrintViewProvider.

Definition at line 84 of file class.ResultsPerUserPrintViewProviderGUI.php.

References ILIAS\Survey\PrintView\ResultsPerUserPrintViewProviderGUI\$ctrl, and ILIAS\Survey\PrintView\ResultsPerUserPrintViewProviderGUI\$lng.

85  {
86  $lng = $this->lng;
87  $ilCtrl = $this->ctrl;
88 
89  $form = new \ilPropertyFormGUI();
90 
91  $radg = new \ilRadioGroupInputGUI($lng->txt("svy_selection"), "print_selection");
92  $radg->setValue("all");
93  $op1 = new \ilRadioOption($lng->txt("svy_all_participants"), "all");
94  $radg->addOption($op1);
95  $op2 = new \ilRadioOption($lng->txt("svy_selected_participants"), "selected");
96  $radg->addOption($op2);
97 
98  $nl = new \ilNestedListInputGUI("", "active_ids");
99  $op2->addSubItem($nl);
100 
101  foreach ($this->access_manager->canReadResultOfParticipants() as $participant) {
102  $nl->addListNode(
103  $participant["active_id"],
104  $participant["fullname"],
105  0,
106  false,
107  false
108  );
109  }
110 
111  $form->addItem($radg);
112  $form->addCommandButton("printResultsPerUser", $lng->txt("print_view"));
113 
114  $form->setTitle($lng->txt("svy_print_selection"));
115  $form->setFormAction($ilCtrl->getFormActionByClass(
116  "ilSurveyEvaluationGUI",
117  "printResultsPerUser"
118  ));
119 
120  return $form;
121  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...

◆ getTemplateInjectors()

ILIAS\Survey\PrintView\ResultsPerUserPrintViewProviderGUI::getTemplateInjectors ( )
Returns
callable[] each callable gets the $tpl passed to inject css/js/...

Implements ILIAS\Export\PrintViewProvider.

Definition at line 75 of file class.ResultsPerUserPrintViewProviderGUI.php.

75  : array
76  {
77  return [
78  static function (\ilGlobalTemplate $tpl): void {
79  //$tpl add js/css
80  }
81  ];
82  }
special template class to simplify handling of ITX/PEAR

Field Documentation

◆ $access_manager

ILIAS Survey Access AccessManager ILIAS\Survey\PrintView\ResultsPerUserPrintViewProviderGUI::$access_manager
protected

Definition at line 34 of file class.ResultsPerUserPrintViewProviderGUI.php.

◆ $ctrl

◆ $evaluation_manager

ILIAS Survey Evaluation EvaluationManager ILIAS\Survey\PrintView\ResultsPerUserPrintViewProviderGUI::$evaluation_manager
protected

Definition at line 32 of file class.ResultsPerUserPrintViewProviderGUI.php.

◆ $gui

ILIAS Survey InternalGUIService ILIAS\Survey\PrintView\ResultsPerUserPrintViewProviderGUI::$gui
protected

Definition at line 31 of file class.ResultsPerUserPrintViewProviderGUI.php.

◆ $lng

◆ $ref_id

int ILIAS\Survey\PrintView\ResultsPerUserPrintViewProviderGUI::$ref_id
protected

◆ $request

ILIAS Survey Evaluation EvaluationGUIRequest ILIAS\Survey\PrintView\ResultsPerUserPrintViewProviderGUI::$request
protected

Definition at line 33 of file class.ResultsPerUserPrintViewProviderGUI.php.

◆ $survey

ilObjSurvey ILIAS\Survey\PrintView\ResultsPerUserPrintViewProviderGUI::$survey
protected

Definition at line 35 of file class.ResultsPerUserPrintViewProviderGUI.php.

◆ $tree

ilTree ILIAS\Survey\PrintView\ResultsPerUserPrintViewProviderGUI::$tree
protected

Definition at line 30 of file class.ResultsPerUserPrintViewProviderGUI.php.


The documentation for this class was generated from the following file: