4 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
27 $this->question = $a_question;
29 parent::__construct($a_parent_obj, $a_parent_cmd);
31 $this->
setId(
"il_svy_spl_sync");
33 $this->
setTitle($this->question->getTitle());
34 $this->
setDescription($lng->txt(
"survey_sync_question_copies_info"));
36 $this->
addCommandButton(
"synccopies", $lng->txt(
"survey_sync_question_copies"));
47 $this->
setRowTemplate(
"tpl.il_svy_qpl_sync.html",
"Modules/SurveyQuestionPool");
57 global $ilAccess,
$lng;
59 include_once
"Modules/Survey/classes/class.ilObjSurvey.php";
61 $table_data =
array();
62 foreach($this->question->getCopyIds(
true) as $survey_obj_id => $questions)
64 $survey_id =
new ilObjSurvey($survey_obj_id,
false);
65 $survey_id->loadFromDB();
66 $survey_id = $survey_id->getSurveyId();
77 if($ilAccess->checkAccess(
"edit",
"", $ref_id))
86 $message = $lng->txt(
"survey_sync_insufficient_permissions");
91 $message = $lng->txt(
"survey_has_datasets_warning");
95 $survey_path = $this->
buildPath($ref_ids);
97 foreach($questions as $question_id)
106 $table_data[] =
array(
107 "id" => $question_id,
109 "path" => $survey_path,
110 "message" => $message
127 $this->tpl->setVariable(
"TXT_PATH", $lng->txt(
"path"));
129 if($a_set[
"message"])
131 $this->tpl->setCurrentBlock(
"message");
132 $this->tpl->setVariable(
"TXT_MESSAGE", $a_set[
"message"]);
133 $this->tpl->parseCurrentBlock();
139 $this->tpl->setCurrentBlock(
"checkbox");
140 $this->tpl->setVariable(
"ID", $a_set[
"id"]);
141 $this->tpl->parseCurrentBlock();
145 $this->tpl->setVariable(
"TITLE", $a_set[
"title"]);
146 $this->tpl->setVariable(
"VALUE_PATH", implode(
"<br />", $a_set[
"path"]));
159 include_once
'./Services/Link/classes/class.ilLink.php';
170 $path_full = $tree->getPathFull($ref_id);
171 if(
sizeof($path_full))
173 foreach($path_full as
$data)
175 if(++
$counter < (count($path_full)-1))
179 $path .=
" » ";
180 if($ref_id != $data[
'ref_id'])
182 $path .= $data[
'title'];
186 $path .= (
'<a target="_top" href="'.
188 $data[
'title'].
'</a>');
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
setDescription($a_val)
Set description.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
Survey sync table GUI class.
static _hasDatasets($survey_id)
static _getTitle($question_id)
Returns the question title of a question with a given id.
__construct($a_parent_obj, $a_parent_cmd, SurveyQuestion $a_question)
Constructor.
static _lookupTitle($a_id)
lookup object title
static _getAllReferences($a_id)
get all reference ids of object
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
Basic class for all survey question types.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
importData()
Import data from DB.
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.
fillRow($a_set)
Fill table row.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
buildPath($ref_ids)
Build path with deep-link.