ILIAS  release_8 Revision v8.23
ILIAS\Survey\PrintView\ResultsDetailsPrintViewProviderGUI Class Reference
+ Inheritance diagram for ILIAS\Survey\PrintView\ResultsDetailsPrintViewProviderGUI:
+ Collaboration diagram for ILIAS\Survey\PrintView\ResultsDetailsPrintViewProviderGUI:

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 ()
 
 autoPageBreak ()
 
- 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 EvaluationGUIRequest $request
 
ILIAS Survey Mode UIModifier $ui_modifier
 
ILIAS Survey Evaluation EvaluationManager $evaluation_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\ResultsDetailsPrintViewProviderGUI::__construct ( \ilLanguage  $lng,
\ilCtrl  $ctrl,
int  $ref_id 
)

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

References ILIAS\Survey\PrintView\ResultsDetailsPrintViewProviderGUI\$ctrl, $DIC, ILIAS\Survey\PrintView\ResultsDetailsPrintViewProviderGUI\$lng, ILIAS\Survey\PrintView\ResultsDetailsPrintViewProviderGUI\$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->request = $DIC->survey()
52  ->internal()
53  ->gui()
54  ->evaluation($this->survey)
55  ->request();
56  $this->evaluation_manager = $DIC->survey()
57  ->internal()
58  ->domain()
59  ->evaluation(
60  $this->survey,
61  $DIC->user()->getId(),
62  $this->request->getAppraiseeId(),
63  $this->request->getRaterId()
64  );
65  $this->ui_modifier = $DIC->survey()
66  ->internal()
67  ->gui()
68  ->modeUIModifier($this->survey->getMode());
69  $this->gui = $DIC->survey()
70  ->internal()
71  ->gui();
72  $this->tree = $DIC->repositoryTree();
73  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ autoPageBreak()

ILIAS\Survey\PrintView\ResultsDetailsPrintViewProviderGUI::autoPageBreak ( )

Implements ILIAS\Export\PrintViewProvider.

Definition at line 188 of file class.ResultsDetailsPrintViewProviderGUI.php.

188  : bool
189  {
190  return false;
191  }

◆ getPages()

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

Implements ILIAS\Export\PrintViewProvider.

Definition at line 125 of file class.ResultsDetailsPrintViewProviderGUI.php.

References ILIAS\Survey\PrintView\ResultsDetailsPrintViewProviderGUI\$request, SurveyQuestion\_instanciateQuestionEvaluation(), ILIAS\Survey\PrintView\ResultsDetailsPrintViewProviderGUI\getPrintHeader(), and ILIAS\Repository\lng().

125  : array
126  {
127  $print_pages = [];
128 
129  $finished_ids = $this->evaluation_manager->getFilteredFinishedIds();
130 
131  $selection = $this->request->getPrintSelection();
132  $qids = $this->request->getQuestionIds();
133 
134  $first = true;
135  foreach ($this->survey->getSurveyQuestions() as $qdata) {
136  $q_eval = \SurveyQuestion::_instanciateQuestionEvaluation($qdata["question_id"], $finished_ids);
137 
138  if ($selection !== "all" && !in_array($qdata["question_id"], $qids)) {
139  continue;
140  }
141 
142  $panels = $this->ui_modifier->getDetailPanels(
143  $this->survey->getSurveyParticipants(),
145  $q_eval
146  );
147  $panel_report = $this->gui->ui()->factory()->panel()->report(
148  $this->lng->txt("svy_eval_detail"),
149  $panels
150  );
151  $head = "";
152  if ($first) {
153  $head = $this->getPrintHeader();
154  $first = false;
155  }
156  $print_pages[] = $head . $this->gui->ui()->renderer()->render(
157  $panel_report
158  );
159  //$print_pages[] = $this->gui->ui()->renderer()->render($panels);
160  }
161  return $print_pages;
162  }
static _instanciateQuestionEvaluation(int $question_id, array $a_finished_ids=null)
+ Here is the call graph for this function:

◆ getPrintHeader()

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

Definition at line 164 of file class.ResultsDetailsPrintViewProviderGUI.php.

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

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

164  : string
165  {
166  $head = "<h2>" . $this->survey->getTitle() . "</h2>\n";
167  $path = "";
168  $path_full = $this->tree->getPathFull($this->survey->getRefId());
169  foreach ($path_full as $data) {
170  $path .= " &raquo; ";
171  $path .= $data['title'];
172  }
173 
175  $props = array(
176  $this->lng->txt("url") => \ilLink::_getStaticLink($this->survey->getRefId()),
177  $this->lng->txt("path") => $path,
178  $this->lng->txt("date") => \ilDatePresentation::formatDate(new \ilDateTime(time(), IL_CAL_UNIX)),
179  );
180 
181  $f = $this->gui->ui->factory();
182  $r = $this->gui->ui->renderer();
183  $l = $f->listing()->descriptive($props);
184 
185  return $head . $r->render($l);
186  }
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
const IL_CAL_UNIX
$path
Definition: ltiservices.php:32
static setUseRelativeDates(bool $a_status)
set use relative dates
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSelectionForm()

ILIAS\Survey\PrintView\ResultsDetailsPrintViewProviderGUI::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.ResultsDetailsPrintViewProviderGUI.php.

References ILIAS\Survey\PrintView\ResultsDetailsPrintViewProviderGUI\$ctrl, and ILIAS\Survey\PrintView\ResultsDetailsPrintViewProviderGUI\$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_questions"), "all");
94  $radg->addOption($op1);
95  $op2 = new \ilRadioOption($lng->txt("svy_selected_questions"), "selected");
96  $radg->addOption($op2);
97 
98  $nl = new \ilNestedListInputGUI("", "qids");
99  $op2->addSubItem($nl);
100 
101  foreach ($this->survey->getSurveyQuestions() as $qdata) {
102  $nl->addListNode(
103  $qdata["question_id"],
104  $qdata["title"],
105  0,
106  false,
107  false
108  );
109  }
110 
111  $form->addItem($radg);
112 
113 
114  $form->addCommandButton("printResultsDetails", $lng->txt("print_view"));
115 
116  $form->setTitle($lng->txt("svy_print_selection"));
117  $form->setFormAction($ilCtrl->getFormActionByClass(
118  "ilSurveyEvaluationGUI",
119  "printResultsDetails"
120  ));
121 
122  return $form;
123  }
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\ResultsDetailsPrintViewProviderGUI::getTemplateInjectors ( )
Returns
callable[] each callable gets the $tpl passed to inject css/js/...

Implements ILIAS\Export\PrintViewProvider.

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

References $tpl.

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
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41

Field Documentation

◆ $ctrl

◆ $evaluation_manager

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

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

◆ $gui

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

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

◆ $lng

◆ $ref_id

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

◆ $request

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

◆ $survey

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

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

◆ $tree

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

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

◆ $ui_modifier

ILIAS Survey Mode UIModifier ILIAS\Survey\PrintView\ResultsDetailsPrintViewProviderGUI::$ui_modifier
protected

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


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