4include_once 
"./Services/Object/classes/class.ilObjectGUI.php";
 
   35                $lng->loadLanguageModule(
"survey");
 
   37                $this->ctrl->saveParameter($this, 
"ref_id");
 
   41                parent::__construct(
"", (
int)
$_GET[
"ref_id"], 
true, 
false);
 
   46                global $ilNavigationHistory, $ilTabs;
 
   48                $this->external_rater_360 = 
false;
 
   49                if(!$this->creation_mode &&
 
   50                        $this->object->get360Mode() &&
 
   51                        $_SESSION[
"anonymous_id"][$this->object->getId()] && 
 
   53                                $_SESSION[
"anonymous_id"][$this->object->getId()]))
 
   55                        $this->external_rater_360 = 
true;
 
   58                if(!$this->external_rater_360)
 
   70                                $this->ctrl->setParameterByClass(
"ilobjsurveygui", 
"ref_id", $this->ref_id);
 
   71                                $link = $this->ctrl->getLinkTargetByClass(
"ilobjsurveygui", 
"");
 
   72                                $ilNavigationHistory->addItem($this->ref_id, $link, 
"svy");
 
   76                $cmd = $this->ctrl->getCmd(
"properties");                                               
 
   79                if (
$cmd == 
"saveTags")
 
   81                        $this->ctrl->setCmdClass(
"ilinfoscreengui");
 
   85                if(!$this->ctrl->getCmdClass() && 
$cmd == 
"questionsrepo")
 
   87                        $_REQUEST[
"pgov"] = 1;
 
   88                        $this->ctrl->setCmd(
"questions");
 
   89                        $this->ctrl->setCmdClass(
"ilsurveyeditorgui");
 
   92                $next_class = $this->ctrl->getNextClass($this);
 
   93                $this->ctrl->setReturn($this, 
"properties");
 
   97                $this->log->debug(
"next_class= $next_class");
 
  100                        case "ilinfoscreengui":
 
  101                                if(!in_array($this->ctrl->getCmdClass(),
 
  102                                        array(
'ilpublicuserprofilegui', 
'ilobjportfoliogui')))
 
  110                                        $ilTabs->clearTargets();
 
  111                                        include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
 
  113                                        $this->ctrl->forwardCommand(
$info);
 
  117                        case 'ilobjectmetadatagui':
 
  119                                $ilTabs->activateTab(
"meta_data");
 
  121                                include_once 
'Services/Object/classes/class.ilObjectMetaDataGUI.php';
 
  123                                $this->ctrl->forwardCommand($md_gui);
 
  126                        case "ilsurveyevaluationgui":
 
  127                                $ilTabs->activateTab(
"svy_results");
 
  129                                include_once(
"./Modules/Survey/classes/class.ilSurveyEvaluationGUI.php");
 
  131                                $this->ctrl->forwardCommand($eval_gui);
 
  134                        case "ilsurveyexecutiongui":
 
  135                                $ilTabs->clearTargets();
 
  136                                include_once(
"./Modules/Survey/classes/class.ilSurveyExecutionGUI.php");
 
  138                                $this->ctrl->forwardCommand($exec_gui);
 
  141                        case 'ilpermissiongui':
 
  142                                $ilTabs->activateTab(
"perm_settings");
 
  144                                include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
 
  146                                $this->ctrl->forwardCommand($perm_gui);
 
  149                        case 'ilobjectcopygui':
 
  150                                include_once 
'./Services/Object/classes/class.ilObjectCopyGUI.php';
 
  153                                $this->ctrl->forwardCommand($cp);
 
  156                        case "ilcommonactiondispatchergui":
 
  157                                include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
 
  159                                $this->ctrl->forwardCommand($gui);
 
  163                        case 'ilsurveyskillgui':
 
  164                                $ilTabs->activateTab(
"survey_competences");
 
  165                                include_once(
"./Modules/Survey/classes/class.ilSurveySkillGUI.php");
 
  167                                $this->ctrl->forwardCommand($gui);
 
  170                        case 'ilsurveyskilldeterminationgui':
 
  171                                $ilTabs->activateTab(
"maintenance");
 
  172                                include_once(
"./Modules/Survey/classes/class.ilSurveySkillDeterminationGUI.php");
 
  174                                $this->ctrl->forwardCommand($gui);
 
  177                        case 'ilsurveyeditorgui':
 
  179                                $ilTabs->activateTab(
"survey_questions");
 
  180                                include_once(
"./Modules/Survey/classes/class.ilSurveyEditorGUI.php");
 
  182                                $this->ctrl->forwardCommand($gui);
 
  185                        case 'ilsurveyconstraintsgui':
 
  187                                $ilTabs->activateTab(
"constraints");
 
  188                                include_once(
"./Modules/Survey/classes/class.ilSurveyConstraintsGUI.php");
 
  190                                $this->ctrl->forwardCommand($gui);
 
  193                        case 'ilsurveyparticipantsgui':         
 
  194                                if(!$this->object->get360Mode())
 
  196                                        $ilTabs->activateTab(
"maintenance");                            
 
  200                                        $ilTabs->activateTab(
"survey_360_appraisees");
 
  202                                include_once(
"./Modules/Survey/classes/class.ilSurveyParticipantsGUI.php");
 
  204                                $this->ctrl->forwardCommand($gui);
 
  207                        case "illearningprogressgui":
 
  208                                $ilTabs->activateTab(
"learning_progress");
 
  209                                include_once(
"./Services/Tracking/classes/class.ilLearningProgressGUI.php");
 
  211                                        $this->object->getRefId());
 
  212                                $this->ctrl->forwardCommand($new_gui);                          
 
  216                                $ilTabs->activateTab(
"export");
 
  217                                include_once(
"./Services/Export/classes/class.ilExportGUI.php");
 
  219                                $exp_gui->addFormat(
"xml");
 
  220                                $this->ctrl->forwardCommand($exp_gui);
 
  227                                $this->log->debug(
"Default cmd= $cmd");
 
  233                if (strtolower(
$_GET[
"baseClass"]) != 
"iladministrationgui" &&
 
  249                include_once(
"./Modules/Survey/classes/class.ilSurveyEvaluationGUI.php");
 
  251                $this->ctrl->setCmdClass(get_class($eval_gui));
 
  252                $this->ctrl->redirect($eval_gui, 
"evaluation");
 
  257                include_once 
"Services/Administration/classes/class.ilSettingsTemplate.php";
 
  261                        foreach($templates as $item)
 
  263                                $a_options[
"svytpl_".$item[
"id"]] = array($item[
"title"],
 
  264                                        nl2br(trim($item[
"description"])));
 
  269                $a_options[
"svy360_1"] = array($this->lng->txt(
"survey_360_mode"),
 
  270                        $this->lng->txt(
"survey_360_mode_info"));
 
  280                $a_new_object->loadFromDb();
 
  285                        $a_new_object->applySettingsTemplate(
$tpl);
 
  289                if($a_new_object->get360Mode())
 
  295                $a_new_object->saveToDB();
 
  300                        $a_new_object->
getRefId().
"&cmd=properties");
 
  317                $ilHelp->setScreenIdComponent(
"svy");
 
  319                $hidden_tabs = array();
 
  320                $template = $this->
object->getTemplate();
 
  323                        include_once 
"Services/Administration/classes/class.ilSettingsTemplate.php";
 
  325                        $hidden_tabs = $template->getHiddenTabs();
 
  330                        $this->tabs_gui->addTab(
"survey_questions",
 
  331                                $this->lng->txt(
"survey_questions"),
 
  332                                $this->ctrl->getLinkTargetByClass(array(
"ilsurveyeditorgui", 
"ilsurveypagegui"), 
"renderPage"));
 
  337                        $this->tabs_gui->addTab(
"info_short",
 
  338                                $this->lng->txt(
"info_short"),
 
  339                                $this->ctrl->getLinkTarget($this,
'infoScreen'));
 
  345                        $this->tabs_gui->addTab(
"settings",
 
  346                                $this->lng->txt(
"settings"),
 
  347                                $this->ctrl->getLinkTarget($this,
'properties'));
 
  351                        if($this->object->get360Mode() && 
 
  352                                $this->object->get360SelfRaters() &&
 
  353                                $this->object->isAppraisee(
$ilUser->getId()) &&
 
  354                                !$this->object->isAppraiseeClosed(
$ilUser->getId()))
 
  356                                $this->tabs_gui->addTab(
"survey_360_edit_raters",
 
  357                                        $this->lng->txt(
"survey_360_edit_raters"),
 
  358                                        $this->ctrl->getLinkTargetByClass(
'ilsurveyparticipantsgui',
'editRaters'));     
 
  366                        !in_array(
"constraints", $hidden_tabs) &&
 
  367                        !$this->object->get360Mode())
 
  370                        $this->tabs_gui->addTab(
"constraints",
 
  371                                $this->lng->txt(
"constraints"),
 
  372                                 $this->ctrl->getLinkTargetByClass(
"ilsurveyconstraintsgui", 
"constraints"));
 
  378                        if($this->object->get360Mode())
 
  381                                include_once(
"./Services/Skill/classes/class.ilSkillManagementSettings.php");
 
  383                                if ($this->object->get360SkillService() && $skmg_set->isActivated())
 
  385                                        $this->tabs_gui->addTab(
"survey_competences",
 
  386                                                $this->lng->txt(
"survey_competences"),
 
  387                                                $this->ctrl->getLinkTargetByClass(
"ilsurveyskillgui", 
"listQuestionAssignment"));
 
  390                                $this->tabs_gui->addTab(
"survey_360_appraisees",
 
  391                                        $this->lng->txt(
"survey_360_appraisees"),
 
  392                                        $this->ctrl->getLinkTargetByClass(
'ilsurveyparticipantsgui', 
'listAppraisees'));                                                
 
  397                                $this->tabs_gui->addTab(
"maintenance",
 
  398                                        $this->lng->txt(
"maintenance"),
 
  399                                        $this->ctrl->getLinkTargetByClass(
'ilsurveyparticipantsgui', 
'maintenance'));
 
  403                include_once 
"./Modules/Survey/classes/class.ilObjSurveyAccess.php";
 
  408                        $this->tabs_gui->addTab(
"svy_results",
 
  409                                $this->lng->txt(
"svy_results"),
 
  410                                $this->ctrl->getLinkTargetByClass(
"ilsurveyevaluationgui", 
"evaluation"));
 
  414                include_once 
"./Services/Tracking/classes/class.ilLearningProgressAccess.php";
 
  417                        $this->tabs_gui->addTarget(
"learning_progress",
 
  418                                $this->ctrl->getLinkTargetByClass(array(
"ilobjsurveygui", 
"illearningprogressgui"), 
""),
 
  420                                array(
"illplistofobjectsgui", 
"illplistofsettingsgui", 
"illearningprogressgui", 
"illplistofprogressgui"));
 
  425                        if(!in_array(
"meta_data", $hidden_tabs))
 
  428                                include_once 
"Services/Object/classes/class.ilObjectMetaDataGUI.php";
 
  430                                $mdtab = $mdgui->getTab();
 
  433                                        $this->tabs_gui->addTab(
"meta_data",
 
  434                                                $this->lng->txt(
"meta_data"),
 
  439                        if(!in_array(
"export", $hidden_tabs))
 
  442                                $this->tabs_gui->addTab(
"export",
 
  443                                        $this->lng->txt(
"export"),
 
  444                                        $this->ctrl->getLinkTargetByClass(
"ilexportgui", 
""));                          
 
  451                        $this->tabs_gui->addTab(
"perm_settings",
 
  452                                $this->lng->txt(
"perm_settings"),
 
  453                                $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'), 
"perm"));
 
  474                if ($form->checkInput())
 
  478                        if(!$this->object->get360Mode())
 
  480                                if($form->getInput(
"tut"))
 
  484                                        $tut_logins = $form->getInput(
"tut_ids");
 
  485                                        foreach($tut_logins as $tut_login)
 
  488                                                if($tut_id && $rbacsystem->checkAccessOfUser($tut_id, 
"write", $this->object->getRefId()))
 
  490                                                        $tut_ids[] = $tut_id;
 
  495                                                $tut_ids = $form->getItemByPostVar(
"tut_ids");
 
  496                                                $tut_ids->setAlert($this->lng->txt(
"survey_notification_tutor_recipients_invalid"));                                    
 
  504                                if(!$this->object->get360Mode())
 
  506                                        if($form->getInput(
"rmd"))
 
  508                                                $rmd_start = $form->getItemByPostVar(
"rmd_start")->getDate();
 
  509                                                $rmd_end = $form->getItemByPostVar(
"rmd_end")->getDate();
 
  515                                                                $rmd_start = $rmd_end;
 
  519                                                $this->
object->setReminderStatus(
true);
 
  520                                                $this->
object->setReminderStart($rmd_start);
 
  521                                                $this->
object->setReminderEnd($rmd_end);
 
  522                                                $this->
object->setReminderFrequency($form->getInput(
"rmd_freq"));
 
  523                                                $this->
object->setReminderTarget($form->getInput(
"rmd_grp"));                                           
 
  524                                                $this->
object->setReminderTemplate(($form->getInput(
"rmdt") > 0)
 
  525                                                        ? $form->getInput(
"rmdt")
 
  530                                                $this->
object->setReminderStatus(
false);
 
  533                                        if($form->getInput(
"tut"))
 
  535                                                $this->
object->setTutorNotificationStatus(
true);                
 
  536                                                $this->
object->setTutorNotificationRecipients($tut_ids); 
 
  537                                                $this->
object->setTutorNotificationTarget($form->getInput(
"tut_grp"));
 
  541                                                $this->
object->setTutorNotificationStatus(
false);
 
  546                                if (
$_POST[
'online'] && count($this->object->questions) == 0)
 
  552                                $template_settings = 
null;
 
  553                                $template = $this->
object->getTemplate();
 
  556                                        include_once 
"Services/Administration/classes/class.ilSettingsTemplate.php";
 
  558                                        $template_settings = $template->getSettings();
 
  561                                include_once 
'Services/MetaData/classes/class.ilMD.php';
 
  562                                $md_obj = 
new ilMD($this->object->getId(), 0, 
"svy");
 
  563                                $md_section = $md_obj->getGeneral();
 
  567                                $md_section->update();
 
  570                                $md_desc_ids = $md_section->getDescriptionIds();
 
  573                                        $md_desc = $md_section->getDescription(array_pop($md_desc_ids));
 
  578                                $this->
object->setViewOwnResults(
$_POST[
"view_own"]);
 
  579                                $this->
object->setMailOwnResults(
$_POST[
"mail_own"]);
 
  580                                $this->
object->setMailConfirmation(
$_POST[
"mail_confirm"]);
 
  585                                $this->
object->update();
 
  587                                $this->
object->setStatus(
$_POST[
'online']);
 
  590                                $period = $form->getItemByPostVar(
"access_period");             
 
  591                                if($period->getStart() && $period->getEnd())
 
  593                                        $this->
object->setActivationLimited(
true);                                                                                      
 
  594                                        $this->
object->setActivationVisibility(
$_POST[
"access_visiblity"]);                                                                                     
 
  595                                        $this->
object->setActivationStartDate($period->getStart()->get(
IL_CAL_UNIX));
 
  596                                        $this->
object->setActivationEndDate($period->getEnd()->get(
IL_CAL_UNIX));                                                       
 
  600                                        $this->
object->setActivationLimited(
false);
 
  603                                if(!$template_settings[
"enabled_start_date"][
"hide"])
 
  605                                        $start = $form->getItemByPostVar(
"start_date");         
 
  609                                                $this->
object->setStartDateAndTime($datetime[0], $datetime[1]);
 
  613                                                $this->
object->setStartDate(
null);
 
  617                                if(!$template_settings[
"enabled_end_date"][
"hide"])
 
  619                                        $end = $form->getItemByPostVar(
"end_date");             
 
  623                                                $this->
object->setEndDateAndTime($datetime[0], $datetime[1]);
 
  627                                                $this->
object->setEndDate(
null);
 
  632                                include_once 
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
 
  633                                $introduction = 
$_POST[
"introduction"];
 
  634                                $this->
object->setIntroduction($introduction);
 
  636                                $this->
object->setOutro($outro);
 
  638                                if(!$template_settings[
"show_question_titles"][
"hide"])
 
  640                                        $this->
object->setShowQuestionTitles(
$_POST[
"show_question_titles"]);
 
  643                                if(!$template_settings[
"use_pool"][
"hide"])
 
  645                                        $this->
object->setPoolUsage(
$_POST[
"use_pool"]);
 
  648                                $this->
object->setMailNotification(
$_POST[
'mailnotification']);
 
  649                                $this->
object->setMailAddresses(
$_POST[
'mailaddresses']);
 
  650                                $this->
object->setMailParticipantData(
$_POST[
'mailparticipantdata']);
 
  653                                if($this->object->get360Mode())
 
  655                                        $this->
object->set360SelfEvaluation((
bool)
$_POST[
"self_eval"]);
 
  656                                        $this->
object->set360SelfAppraisee((
bool)$_POST[
"self_appr"]);
 
  657                                        $this->
object->set360SelfRaters((
bool)$_POST[
"self_rate"]);
 
  658                                        $this->
object->set360Results((
int)$_POST[
"ts_res"]);;
 
  659                                        $this->
object->set360SkillService((
int)$_POST[
"skill_service"]);
 
  663                                        if(!$template_settings[
"evaluation_access"][
"hide"])
 
  665                                                $this->
object->setEvaluationAccess(
$_POST[
"evaluation_access"]);
 
  671                                                $hide_codes = $template_settings[
"acc_codes"][
"hide"];
 
  672                                                $hide_anon = $template_settings[
"anonymization_options"][
"hide"];                                               
 
  673                                                if(!$hide_codes || !$hide_anon)
 
  675                                                        $current = $this->
object->getAnonymize();
 
  680                                                                $codes = (bool)
$_POST[
"acc_codes"];
 
  689                                                                $anon = ((string)
$_POST[
"anonymization_options"] == 
"statanon");        
 
  720                                                                $this->
object->setAnonymousUserList(
$_POST[
"anon_list"]);               
 
  724                                                        unset(
$_SESSION[
"anonymous_id"][$this->object->getId()]);
 
  729                                $this->
object->saveToDb();
 
  739                                $this->ctrl->redirect($this, 
"properties");
 
  748                $form->setValuesByPost();
 
  759                $template_settings = $hide_rte_switch = 
null;
 
  760                $template = $this->
object->getTemplate();
 
  763                        include_once 
"Services/Administration/classes/class.ilSettingsTemplate.php";
 
  766                        $template_settings = $template->getSettings();
 
  767                        $hide_rte_switch = $template_settings[
"rte_switch"][
"hide"];
 
  770                include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
 
  772                $form->setFormAction($this->ctrl->getFormAction($this));
 
  773                $form->setTableWidth(
"100%");
 
  774                $form->setId(
"survey_properties");
 
  778                $header->setTitle($this->lng->txt(
"settings"));
 
  784                include_once 
'Services/MetaData/classes/class.ilMD.php';
 
  785                $md_obj = 
new ilMD($this->object->getId(), 0, 
"svy");
 
  786                $md_section = $md_obj->getGeneral();
 
  789                $title->setRequired(
true);
 
  790                $title->setValue($md_section->getTitle());
 
  793                $ids = $md_section->getDescriptionIds();
 
  796                        $desc_obj = $md_section->getDescription(array_pop($ids));
 
  801                        $desc->setValue($desc_obj->getDescription());
 
  802                        $form->addItem($desc);
 
  806                $pool_usage = 
new ilRadioGroupInputGUI($this->lng->txt(
"survey_question_pool_usage"), 
"use_pool");              
 
  807                $opt = 
new ilRadioOption($this->lng->txt(
"survey_question_pool_usage_active"), 1);
 
  808                $opt->setInfo($this->lng->txt(
"survey_question_pool_usage_active_info"));
 
  809                $pool_usage->addOption($opt);
 
  810                $opt = 
new ilRadioOption($this->lng->txt(
"survey_question_pool_usage_inactive"), 0);
 
  811                $opt->setInfo($this->lng->txt(
"survey_question_pool_usage_inactive_info"));
 
  812                $pool_usage->addOption($opt);
 
  813                $pool_usage->setValue($this->object->getPoolUsage());
 
  814                $form->addItem($pool_usage);
 
  817                if($this->object->get360Mode())
 
  819                        $self_eval = 
new ilCheckboxInputGUI($this->lng->txt(
"survey_360_self_evaluation"), 
"self_eval");
 
  820                        $self_eval->setInfo($this->lng->txt(
"survey_360_self_evaluation_info"));
 
  821                        $self_eval->setChecked($this->object->get360SelfEvaluation());
 
  822                        $form->addItem($self_eval);
 
  824                        $self_rate = 
new ilCheckboxInputGUI($this->lng->txt(
"survey_360_self_raters"), 
"self_rate");
 
  825                        $self_rate->setInfo($this->lng->txt(
"survey_360_self_raters_info"));
 
  826                        $self_rate->setChecked($this->object->get360SelfRaters());
 
  827                        $form->addItem($self_rate);
 
  829                        $self_appr = 
new ilCheckboxInputGUI($this->lng->txt(
"survey_360_self_appraisee"), 
"self_appr");
 
  830                        $self_appr->setInfo($this->lng->txt(
"survey_360_self_appraisee_info"));
 
  831                        $self_appr->setChecked($this->object->get360SelfAppraisee());
 
  832                        $form->addItem($self_appr);
 
  838                include_once 
"Services/Object/classes/class.ilObjectActivation.php";
 
  839                $this->lng->loadLanguageModule(
'rep');
 
  842                $section->setTitle($this->lng->txt(
'rep_activation_availability'));
 
  846                $act_obj_info = $act_ref_info = 
"";
 
  849                        $act_obj_info = 
' '.$this->lng->txt(
'rep_activation_online_object_info');
 
  850                        $act_ref_info = $this->lng->txt(
'rep_activation_access_ref_info');
 
  854                $online->setInfo($this->lng->txt(
'svy_activation_online_info').$act_obj_info);
 
  855                $online->setChecked($this->object->isOnline());
 
  856                $form->addItem($online);                                
 
  858                include_once 
"Services/Form/classes/class.ilDateDurationInputGUI.php";
 
  860                $dur->setShowTime(
true);                                                
 
  861                $date = $this->
object->getActivationStartDate();                                
 
  865                $date = $this->
object->getActivationEndDate();
 
  869                $form->addItem($dur);           
 
  871                        $visible = 
new ilCheckboxInputGUI($this->lng->txt(
'rep_activation_limited_visibility'), 
'access_visiblity');
 
  872                        $visible->setInfo($this->lng->txt(
'svy_activation_limited_visibility_info'));
 
  873                        $visible->setChecked($this->object->getActivationVisibility());
 
  874                        $dur->addSubItem($visible);
 
  880                $section->setTitle($this->lng->txt(
'svy_settings_section_before_start'));
 
  885                $intro->setValue($this->object->prepareTextareaOutput($this->object->getIntroduction()));
 
  888                $intro->setUseRte(TRUE);
 
  889                $intro->setInfo($this->lng->txt(
"survey_introduction_info"));
 
  890                include_once 
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
 
  892                $intro->addPlugin(
"latex");
 
  893                $intro->addButton(
"latex");
 
  894            $intro->addButton(
"pastelatex");
 
  895                $intro->setRTESupport($this->object->getId(), 
"svy", 
"survey", 
null, $hide_rte_switch);
 
  896                $form->addItem($intro);
 
  902                $section->setTitle($this->lng->txt(
'svy_settings_section_access'));
 
  906                $start = $this->
object->getStartDate();         
 
  909                $startingtime->setShowTime(
true);                               
 
  914                $form->addItem($startingtime);
 
  917                $end = $this->
object->getEndDate();     
 
  920                $endingtime->setShowTime(
true);         
 
  925                $form->addItem($endingtime);
 
  928                if(!$this->object->get360Mode())
 
  931                        $codes->setInfo($this->lng->txt(
"survey_access_codes_info"));
 
  932                        $codes->setChecked(!$this->object->isAccessibleWithoutCode());
 
  933                        $form->addItem($codes);
 
  937                                $codes->setDisabled(
true);                              
 
  945                $section->setTitle($this->lng->txt(
'svy_settings_section_question_behaviour'));
 
  949                $show_question_titles = 
new ilCheckboxInputGUI($this->lng->txt(
"svy_show_questiontitles"), 
"show_question_titles");
 
  950                $show_question_titles->setValue(1);
 
  951                $show_question_titles->setChecked($this->object->getShowQuestionTitles());
 
  952                $form->addItem($show_question_titles);
 
  958                $info->setTitle($this->lng->txt(
"svy_settings_section_finishing"));
 
  959                $form->addItem(
$info);
 
  961                $view_own = 
new ilCheckboxInputGUI($this->lng->txt(
"svy_results_view_own"), 
"view_own");
 
  962                $view_own->setInfo($this->lng->txt(
"svy_results_view_own_info"));
 
  963                $view_own->setChecked($this->object->hasViewOwnResults());
 
  964                $form->addItem($view_own);
 
  966                $mail_confirm = 
new ilCheckboxInputGUI($this->lng->txt(
"svy_results_mail_confirm"), 
"mail_confirm");
 
  967                $mail_confirm->setInfo($this->lng->txt(
"svy_results_mail_confirm_info"));
 
  968                $mail_confirm->setChecked($this->object->hasMailConfirmation());
 
  969                $form->addItem($mail_confirm);          
 
  971                        $mail_own = 
new ilCheckboxInputGUI($this->lng->txt(
"svy_results_mail_own"), 
"mail_own");
 
  972                        $mail_own->setInfo($this->lng->txt(
"svy_results_mail_own_info"));
 
  973                        $mail_own->setChecked($this->object->hasMailOwnResults());
 
  974                        $mail_confirm->addSubItem($mail_own);           
 
  978                $finalstatement->setValue($this->object->prepareTextareaOutput($this->object->getOutro()));
 
  979                $finalstatement->setRows(10);
 
  980                $finalstatement->setCols(80);
 
  981                $finalstatement->setUseRte(TRUE);
 
  983                $finalstatement->addPlugin(
"latex");
 
  984                $finalstatement->addButton(
"latex");
 
  985                $finalstatement->addButton(
"pastelatex");
 
  986                $finalstatement->setRTESupport($this->object->getId(), 
"svy", 
"survey", 
null, $hide_rte_switch);
 
  987                $form->addItem($finalstatement);
 
  990                $mailnotification = 
new ilCheckboxInputGUI($this->lng->txt(
"mailnotification"), 
"mailnotification");
 
  992                $mailnotification->setInfo($this->lng->txt(
"svy_result_mail_notification_info")); 
 
  993                $mailnotification->setValue(1);
 
  994                $mailnotification->setChecked($this->object->getMailNotification());
 
  997                $mailaddresses = 
new ilTextInputGUI($this->lng->txt(
"mailaddresses"), 
"mailaddresses");
 
  998                $mailaddresses->setValue($this->object->getMailAddresses());
 
  999                $mailaddresses->setSize(80);
 
 1000                $mailaddresses->setInfo($this->lng->txt(
'mailaddresses_info'));
 
 1001                $mailaddresses->setRequired(
true);
 
 1004                $participantdata = 
new ilTextAreaInputGUI($this->lng->txt(
"mailparticipantdata"), 
"mailparticipantdata");
 
 1005                $participantdata->setValue($this->object->getMailParticipantData());
 
 1006                $participantdata->setRows(6);
 
 1007                $participantdata->setCols(80);
 
 1008                $participantdata->setUseRte(
false);
 
 1009                $participantdata->setInfo($this->lng->txt(
"mailparticipantdata_info"));
 
 1012                $placeholders = array(
 
 1013                        "FIRST_NAME" => 
"firstname",
 
 1014                        "LAST_NAME" => 
"lastname",                      
 
 1018                foreach($placeholders as $placeholder => $caption)
 
 1020                        $txt[] = 
"[".strtoupper($placeholder).
"]: ".$this->lng->txt($caption);
 
 1023                $participantdatainfo = 
new ilNonEditableValueGUI($this->lng->txt(
"mailparticipantdata_placeholder"), 
"", 
true);
 
 1024                $participantdatainfo->setValue(
$txt);
 
 1026                $mailnotification->addSubItem($mailaddresses);
 
 1027                $mailnotification->addSubItem($participantdata);
 
 1028                $mailnotification->addSubItem($participantdatainfo);
 
 1029                $form->addItem($mailnotification);
 
 1032                if(!$this->object->get360Mode())
 
 1036                        $has_parent = 
$tree->checkForParentType($this->object->getRefId(), 
"grp");
 
 1039                                $has_parent = 
$tree->checkForParentType($this->object->getRefId(), 
"crs");
 
 1041                        $num_inv = 
sizeof($this->
object->getInvitedUsers());
 
 1044                        $tut = 
new ilCheckboxInputGUI($this->lng->txt(
"survey_notification_tutor_setting"), 
"tut");
 
 1045                        $tut->setChecked($this->object->getTutorNotificationStatus());
 
 1046                        $form->addItem($tut);
 
 1048                        $tut_logins = array();
 
 1049                        $tuts = $this->
object->getTutorNotificationRecipients();
 
 1052                                foreach($tuts as $tut_id)
 
 1057                                                $tut_logins[] = $tmp[
"login"];
 
 1061                        $tut_ids = 
new ilTextInputGUI($this->lng->txt(
"survey_notification_tutor_recipients"), 
"tut_ids");
 
 1062                        $tut_ids->setDataSource($this->ctrl->getLinkTarget($this, 
"doAutoComplete", 
"", 
true));
 
 1063                        $tut_ids->setRequired(
true);
 
 1064                        $tut_ids->setMulti(
true);               
 
 1065                        $tut_ids->setMultiValues($tut_logins);
 
 1066                        $tut_ids->setValue(array_shift($tut_logins));           
 
 1067                        $tut->addSubItem($tut_ids);
 
 1069                        $tut_grp = 
new ilRadioGroupInputGUI($this->lng->txt(
"survey_notification_target_group"), 
"tut_grp");
 
 1070                        $tut_grp->setRequired(
true);
 
 1071                        $tut_grp->setValue($this->object->getTutorNotificationTarget());
 
 1072                        $tut->addSubItem($tut_grp);
 
 1074                        $tut_grp_crs = 
new ilRadioOption($this->lng->txt(
"survey_notification_target_group_parent_course"), 
 
 1078                                $tut_grp_crs->setInfo($this->lng->txt(
"survey_notification_target_group_parent_course_inactive"));
 
 1082                                $tut_grp_crs->setInfo(
sprintf($this->lng->txt(
"survey_notification_target_group_invited_info"),
 
 1083                                        count($this->object->getNotificationTargetUserIds(
false))));
 
 1085                        $tut_grp->addOption($tut_grp_crs);
 
 1087                        $tut_grp_inv = 
new ilRadioOption($this->lng->txt(
"survey_notification_target_group_invited"), 
 
 1089                        $tut_grp_inv->setInfo(
sprintf($this->lng->txt(
"survey_notification_target_group_invited_info"), $num_inv));
 
 1090                        $tut_grp->addOption($tut_grp_inv);
 
 1097                if(!$this->object->get360Mode())
 
 1100                        $info->setTitle($this->lng->txt(
"svy_settings_section_reminders"));
 
 1101                        $form->addItem(
$info);          
 
 1104                        $rmd->setChecked($this->object->getReminderStatus());
 
 1105                        $form->addItem($rmd);
 
 1107                        $rmd_start = 
new ilDateTimeInputGUI($this->lng->txt(
"survey_reminder_start"), 
"rmd_start");
 
 1108                        $rmd_start->setRequired(
true);
 
 1109                        $start = $this->
object->getReminderStart();
 
 1112                                $rmd_start->setDate(
$start);
 
 1114                        $rmd->addSubItem($rmd_start);
 
 1116                        $end = $this->
object->getReminderEnd();
 
 1117                        $rmd_end = 
new ilDateTimeInputGUI($this->lng->txt(
"survey_reminder_end"), 
"rmd_end");           
 
 1120                                $rmd_end->setDate($end);
 
 1122                        $rmd->addSubItem($rmd_end);
 
 1124                        $rmd_freq = 
new ilNumberInputGUI($this->lng->txt(
"survey_reminder_frequency"), 
"rmd_freq");
 
 1125                        $rmd_freq->setRequired(
true);
 
 1126                        $rmd_freq->setSize(3);          
 
 1127                        $rmd_freq->setSuffix($this->lng->txt(
"survey_reminder_frequency_days"));
 
 1128                        $rmd_freq->setValue($this->object->getReminderFrequency());
 
 1129                        $rmd_freq->setMinValue(1);
 
 1130                        $rmd->addSubItem($rmd_freq);
 
 1132                        $rmd_grp = 
new ilRadioGroupInputGUI($this->lng->txt(
"survey_notification_target_group"), 
"rmd_grp");
 
 1133                        $rmd_grp->setRequired(
true);
 
 1134                        $rmd_grp->setValue($this->object->getReminderTarget());
 
 1135                        $rmd->addSubItem($rmd_grp);
 
 1137                        $rmd_grp_crs = 
new ilRadioOption($this->lng->txt(
"survey_notification_target_group_parent_course"), 
 
 1141                                $rmd_grp_crs->setInfo($this->lng->txt(
"survey_notification_target_group_parent_course_inactive"));
 
 1145                                $rmd_grp_crs->setInfo(
sprintf($this->lng->txt(
"survey_notification_target_group_invited_info"),
 
 1146                                        count($this->object->getNotificationTargetUserIds(
false))));
 
 1148                        $rmd_grp->addOption($rmd_grp_crs);
 
 1150                        $rmd_grp_inv = 
new ilRadioOption($this->lng->txt(
"survey_notification_target_group_invited"), 
 
 1152                        $rmd_grp_inv->setInfo(
sprintf($this->lng->txt(
"survey_notification_target_group_invited_info"), $num_inv));
 
 1153                        $rmd_grp->addOption($rmd_grp_inv);
 
 1155                        $mtmpl = $this->
object->getReminderMailTemplates();
 
 1159                                $rmdt->setRequired(
true);
 
 1160                                $rmdt->addOption(
new ilRadioOption($this->lng->txt(
"svy_reminder_mail_template_none"), -1));                            
 
 1161                                foreach($mtmpl as $mtmpl_id => $mtmpl_caption)
 
 1164                                        $rmdt->addOption($option);
 
 1166                                $rmdt->setValue($this->object->getReminderTemplate()
 
 1167                                        ? $this->object->getReminderTemplate()
 
 1169                                $rmd->addSubItem($rmdt);
 
 1177                $results->setTitle($this->lng->txt(
"results"));
 
 1181                if(!$this->object->get360Mode())
 
 1183                        $evaluation_access = 
new ilRadioGroupInputGUI($this->lng->txt(
'evaluation_access'), 
"evaluation_access");
 
 1186                        $option->setInfo($this->lng->txt(
"svy_evaluation_access_off_info"));
 
 1187                        $evaluation_access->addOption($option);
 
 1190                        $option->setInfo($this->lng->txt(
"svy_evaluation_access_all_info"));
 
 1191                        $evaluation_access->addOption($option);
 
 1194                        $option->setInfo($this->lng->txt(
"svy_evaluation_access_participants_info"));
 
 1195                        $evaluation_access->addOption($option);
 
 1197                        $evaluation_access->setValue($this->object->getEvaluationAccess());
 
 1198                        $form->addItem($evaluation_access);
 
 1201                        $anonymization_options = 
new ilRadioGroupInputGUI($this->lng->txt(
"survey_results_anonymization"), 
"anonymization_options");    
 
 1203                        $option = 
new ilCheckboxOption($this->lng->txt(
"survey_results_personalized"), 
"statpers");
 
 1204                        $option->setInfo($this->lng->txt(
"survey_results_personalized_info"));                  
 
 1205                        $anonymization_options->addOption($option);
 
 1207                        $option = 
new ilCheckboxOption($this->lng->txt(
"survey_results_anonymized"), 
"statanon");
 
 1208                        $option->setInfo($this->lng->txt(
"survey_results_anonymized_info"));                    
 
 1209                        $anonymization_options->addOption($option);                                     
 
 1210                        $anonymization_options->setValue($this->object->hasAnonymizedResults()
 
 1213                        $form->addItem($anonymization_options);
 
 1215                        $surveySetting = 
new ilSetting(
"survey");
 
 1216                        if($surveySetting->get(
"anonymous_participants", 
false))
 
 1219                                if($surveySetting->get(
"anonymous_participants_min", 0))
 
 1221                                        $min = 
" (".$this->lng->txt(
"svy_anonymous_participants_min").
": ".
 
 1222                                                $surveySetting->get(
"anonymous_participants_min").
")";
 
 1225                                $anon_list = 
new ilCheckboxInputGUI($this->lng->txt(
"svy_anonymous_participants_svy"), 
"anon_list");
 
 1226                                $anon_list->setInfo($this->lng->txt(
"svy_anonymous_participants_svy_info").$min);
 
 1227                                $anon_list->setChecked($this->object->hasAnonymousUserList());
 
 1228                                $option->addSubItem($anon_list);                                
 
 1231                        if ($this->object->_hasDatasets($this->object->getSurveyId()))
 
 1233                                $anonymization_options->setDisabled(
true);
 
 1236                                        $anon_list->setDisabled(
true);
 
 1244                        $ts_results->setValue($this->object->get360Results());
 
 1247                        $option->setInfo($this->lng->txt(
"survey_360_results_none_info"));
 
 1248                        $ts_results->addOption($option);
 
 1251                        $option->setInfo($this->lng->txt(
"survey_360_results_own_info"));
 
 1252                        $ts_results->addOption($option);
 
 1255                        $option->setInfo($this->lng->txt(
"survey_360_results_all_info"));
 
 1256                        $ts_results->addOption($option);
 
 1257                        $form->addItem($ts_results);            
 
 1263                include_once(
"./Services/Skill/classes/class.ilSkillManagementSettings.php");
 
 1265                if($this->object->get360Mode() && $skmg_set->isActivated())
 
 1268                        $other->setTitle($this->lng->txt(
"other"));
 
 1269                        $form->addItem($other);
 
 1271                        $skill_service = 
new ilCheckboxInputGUI($this->lng->txt(
"survey_activate_skill_service"), 
"skill_service");
 
 1272                        $skill_service->setInfo($this->lng->txt(
"survey_activate_skill_service_info"));
 
 1273                        $skill_service->setChecked($this->object->get360SkillService());
 
 1274                        $form->addItem($skill_service);
 
 1278                $form->addCommandButton(
"saveProperties", $this->lng->txt(
"save"));
 
 1281                if($template_settings)
 
 1283                        foreach($template_settings as $id => $item)
 
 1287                                        $form->removeItemByPostVar($id);
 
 1302                global $ilTabs, $ilHelp;
 
 1306                $ilTabs->activateTab(
"settings");
 
 1309                if ($this->object->get360Mode())
 
 1311                        $ilHelp->setScreenId(
"settings_360");
 
 1321                if($this->object->getTemplate())
 
 1323                        $link = $this->ctrl->getLinkTarget($this, 
"confirmResetTemplate");
 
 1324                        $link = 
"<a href=\"".$link.
"\">".$this->lng->txt(
"survey_using_template_link").
"</a>";
 
 1325                        $message = 
"<div style=\"margin-top:10px\">".
 
 1326                                $this->tpl->getMessageHTML(
sprintf($this->lng->txt(
"survey_using_template"), 
 
 1331                $this->tpl->setContent($a_form->getHTML().$message);
 
 1336                $fields = array(
'login',
'firstname',
'lastname',
'email');
 
 1338                include_once 
'./Services/User/classes/class.ilUserAutoComplete.php';
 
 1340                $auto->setSearchFields($fields);
 
 1341                $auto->setResultField(
'login');
 
 1342                $auto->enableFieldSearchableCheck(
true);
 
 1343                $auto->setMoreLinkAvailable(
true);
 
 1345                if(($_REQUEST[
'fetchall']))
 
 1360                $this->tpl->addBlockFile(
"ADM_CONTENT", 
"adm_content", 
"tpl.il_svy_svy_confirm_resettemplate.html", 
"Modules/Survey");
 
 1361                $this->tpl->setCurrentBlock(
"adm_content");
 
 1362                $this->tpl->setVariable(
"BTN_CONFIRM_REMOVE", $this->lng->txt(
"confirm"));
 
 1363                $this->tpl->setVariable(
"BTN_CANCEL_REMOVE", $this->lng->txt(
"cancel"));
 
 1364                $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this, 
"resetTemplateObject"));
 
 1365                $this->tpl->parseCurrentBlock();
 
 1373                $this->
object->setTemplate(
null);
 
 1374                $this->
object->saveToDB();
 
 1377                $this->ctrl->redirect($this, 
"properties");
 
 1388                include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1390                $form->setTarget(
"_top");
 
 1391                $form->setFormAction($this->ctrl->getFormAction($this));
 
 1392                $form->setTitle($this->lng->txt(
"import_svy"));
 
 1394                include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
 
 1395                $fi = 
new ilFileInputGUI($this->lng->txt(
"import_file"), 
"importfile");
 
 1396                $fi->setSuffixes(array(
"zip"));
 
 1397                $fi->setRequired(
true);
 
 1398                $form->addItem($fi);
 
 1400                include_once(
"./Modules/Survey/classes/class.ilObjSurvey.php");
 
 1402                $questionspools = $svy->getAvailableQuestionpools(
true, 
true, 
true);
 
 1404                $pools = 
new ilSelectInputGUI($this->lng->txt(
"select_questionpool_short"), 
"spl");
 
 1405                $pools->setOptions(array(
""=>$this->lng->txt(
"dont_use_questionpool")) + $questionspools);
 
 1406                $pools->setRequired(
false);
 
 1407                $form->addItem($pools);
 
 1409                $form->addCommandButton(
"importSurvey", $this->lng->txt(
"import"));
 
 1410                $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
 
 1422                $parent_id = 
$_GET[
"ref_id"];
 
 1423                $new_type = $_REQUEST[
"new_type"];
 
 1428                $this->lng->loadLanguageModule($new_type);
 
 1429                $this->ctrl->setParameter($this, 
"new_type", $new_type);
 
 1432                if ($form->checkInput())
 
 1434                        include_once(
"./Modules/Survey/classes/class.ilObjSurvey.php");
 
 1436                        $newObj->setType($new_type);
 
 1437                        $newObj->setTitle(
"dummy");
 
 1438                        $newObj->setDescription(
"dummy");
 
 1439                        $newObj->create(
true);
 
 1444                        $this->log->debug(
"form->getInput(spl) = ".$form->getInput(
"spl"));
 
 1446                        $error = $newObj->importObject($_FILES[
"importfile"], $form->getInput(
"spl"));
 
 1456                                "&baseClass=ilObjSurveyGUI");
 
 1459                        include_once 
"Services/Administration/classes/class.ilSettingsTemplate.php";
 
 1464                                $tpl->addJavaScript(
"./Modules/Scorm2004/scripts/questions/jquery.js");
 
 1467                                $this->tpl->setCurrentBlock(
"template_option");
 
 1468                                $this->tpl->setVariable(
"VAL_TEMPLATE_OPTION", 
"");
 
 1469                                $this->tpl->setVariable(
"TXT_TEMPLATE_OPTION", $this->lng->txt(
"none"));
 
 1470                                $this->tpl->parseCurrentBlock();
 
 1472                                foreach($templates as $item)
 
 1474                                        $this->tpl->setCurrentBlock(
"template_option");
 
 1475                                        $this->tpl->setVariable(
"VAL_TEMPLATE_OPTION", $item[
"id"]);
 
 1476                                        $this->tpl->setVariable(
"TXT_TEMPLATE_OPTION", $item[
"title"]);
 
 1477                                        $this->tpl->parseCurrentBlock();
 
 1479                                        $desc = str_replace(
"\n", 
"", nl2br($item[
"description"]));
 
 1480                                        $desc = str_replace(
"\r", 
"", $desc);
 
 1482                                        $this->tpl->setCurrentBlock(
"js_data");
 
 1483                                        $this->tpl->setVariable(
"JS_DATA_ID", $item[
"id"]);
 
 1484                                        $this->tpl->setVariable(
"JS_DATA_TEXT", $desc);
 
 1485                                        $this->tpl->parseCurrentBlock();
 
 1488                                $this->tpl->setCurrentBlock(
"templates");
 
 1489                                $this->tpl->setVariable(
"TXT_TEMPLATE", $this->lng->txt(
"svy_settings_template"));
 
 1490                                $this->tpl->parseCurrentBlock();
 
 1495                $form->setValuesByPost();
 
 1496                $tpl->setContent($form->getHtml());
 
 1511                $this->ctrl->setCmd(
"showSummary");
 
 1512                $this->ctrl->setCmdClass(
"ilinfoscreengui");
 
 1521                global $ilTabs, 
$ilUser, $ilToolbar, $ilAccess;
 
 1523                if (!$this->external_rater_360)
 
 1531                $ilTabs->activateTab(
"info_short");
 
 1533                include_once 
"./Modules/Survey/classes/class.ilSurveyExecutionGUI.php";
 
 1536                include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
 
 1538                $info->enablePrivateNotes();
 
 1541                $is_appraisee = 
false; 
 
 1544                if($this->object->get360Mode() && 
 
 1545                        $this->object->isAppraisee(
$ilUser->getId()))
 
 1547                        $is_appraisee = 
true;
 
 1549                        $info->addSection($this->lng->txt(
"survey_360_appraisee_info"));
 
 1551                        $appr_data = $this->
object->getAppraiseesData();
 
 1552                        $appr_data = $appr_data[
$ilUser->getId()];
 
 1553                        $info->addProperty($this->lng->txt(
"survey_360_raters_status_info"), $appr_data[
"finished"]);           
 
 1555                        if(!$appr_data[
"closed"])
 
 1557                                include_once 
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
 
 1559                                $button->setCaption(
"survey_360_appraisee_close_action");
 
 1560                                $button->setUrl($this->ctrl->getLinkTargetByClass(
"ilsurveyparticipantsgui", 
"confirmappraiseeclose"));
 
 1561                                $close_button_360 = 
'<div>'.$button->render().
'</div>';
 
 1563                                $txt = 
"survey_360_appraisee_close_action_info";
 
 1564                                if($this->object->get360SkillService())
 
 1568                                $info->addProperty($this->lng->txt(
"status"), 
 
 1569                                        $close_button_360.$this->lng->txt(
$txt));                                                                       
 
 1576                                $info->addProperty($this->lng->txt(
"status"), 
 
 1577                                        sprintf($this->lng->txt(
"survey_360_appraisee_close_action_status"),
 
 1586                $code_input = 
false;
 
 1587                $anonymous_code = 
$_POST[
"anonymous_id"];       
 
 1588                if ($anonymous_code)
 
 1592                        if(!$this->object->checkSurveyCode($anonymous_code)) 
 
 1594                                $anonymous_code = 
null;
 
 1599                                $this->
object->bindSurveyCodeToUser($ilUser->getId(), $anonymous_code);
 
 1602                if ($anonymous_code)
 
 1604                        $_SESSION[
"anonymous_id"][$this->
object->getId()] = $anonymous_code;                    
 
 1608                        $anonymous_code = 
$_SESSION[
"anonymous_id"][$this->
object->getId()];                                                                                    
 
 1616                if($this->object->getAnonymize() && !$anonymous_code)
 
 1618                        $anonymous_code = $this->
object->findCodeForUser($ilUser->getId());                                             
 
 1622                $participant_status = $this->
object->getUserSurveyExecutionStatus($anonymous_code);
 
 1623                if($participant_status)
 
 1625                        $anonymous_code = $participant_status[
"code"];                          
 
 1626                        $participant_status = $participant_status[
"runs"];
 
 1630                if(!$this->object->isAccessibleWithoutCode() && 
 
 1633                        (!$anonymous_code || !$this->object->isAnonymousKey($anonymous_code)))
 
 1635                         $anonymous_code = 
null;
 
 1640                $_SESSION[
"anonymous_id"][$this->
object->getId()] = $anonymous_code;
 
 1641                $survey_started = $this->
object->isSurveyStarted($ilUser->getId(), $anonymous_code);    
 
 1643                $showButtons = $big_button = 
false;
 
 1646                if(!$this->object->get360Mode() &&
 
 1647                                ($survey_started === 1 &&                                                                                       
 
 1648                                !(!$this->object->isAccessibleWithoutCode() && !$anonymous_code && 
$ilUser->getId() == ANONYMOUS_USER_ID)))     
 
 1652                        if(
$ilUser->getId() != ANONYMOUS_USER_ID)
 
 1654                                if($this->object->hasViewOwnResults())
 
 1656                                        include_once 
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
 
 1658                                        $button->setCaption(
"svy_view_own_results");                                                            
 
 1659                                        $button->setUrl($this->ctrl->getLinkTarget($this, 
"viewUserResults"));                                                                          
 
 1660                                        $ilToolbar->addButtonInstance($button);         
 
 1664                                if($this->object->hasMailConfirmation())
 
 1666                                        if($this->object->hasViewOwnResults())
 
 1668                                                $ilToolbar->addSeparator();
 
 1671                                        if(
$ilUser->getId() == ANONYMOUS_USER_ID ||
 
 1674                                                require_once 
"Services/Form/classes/class.ilTextInputGUI.php";                                                          
 
 1677                                                $mail->setValue(
$ilUser->getEmail());                                                                                                                   
 
 1678                                                $ilToolbar->addInputItem($mail, 
true);          
 
 1681                                        $ilToolbar->setFormAction($this->ctrl->getFormAction($this, 
"mailUserResults"));
 
 1683                                        include_once 
"Services/UIComponent/Button/classes/class.ilSubmitButton.php";
 
 1685                                        $button->setCaption(
"svy_mail_send_confirmation");
 
 1686                                        $button->setCommand(
"mailUserResults");
 
 1687                                        $ilToolbar->addButtonInstance($button);                                                                                                                                                         
 
 1694                        $canStart = $this->
object->canStartSurvey(
null, $this->external_rater_360);
 
 1696                        $showButtons = $canStart[
"result"];
 
 1699                                if($canStart[
"edit_settings"] &&
 
 1700                                        $ilAccess->checkAccess(
"write", 
"", $this->ref_id))
 
 1702                                        $canStart[
"messages"][] = 
"<a href=\"".$this->ctrl->getLinkTarget($this, 
"properties").
"\">» ".
 
 1703                                                $this->lng->txt(
"survey_edit_settings").
"</a>";
 
 1712                        if(!$is_appraisee &&
 
 1714                                !$this->object->isAccessibleWithoutCode())
 
 1716                                $info->setFormAction($this->ctrl->getFormAction($this, 
"infoScreen"));
 
 1717                                $info->addSection($this->lng->txt(
"anonymization"));
 
 1718                                $info->addProperty(
"", $this->lng->txt(
"anonymize_anonymous_introduction"));
 
 1719                                $info->addPropertyTextinput($this->lng->txt(
"enter_anonymous_id"), 
"anonymous_id", 
"", 8, 
"infoScreen", $this->lng->txt(
"submit"), 
true);
 
 1724                                if(!$this->object->get360Mode())
 
 1728                                                $info->addHiddenElement(
"anonymous_id", $anonymous_code);
 
 1730                                        if ($survey_started === 0)
 
 1732                                                $big_button = array(
"resume", $this->lng->txt(
"resume_survey"));
 
 1734                                        elseif ($survey_started === FALSE)
 
 1736                                                $big_button = array(
"start", $this->lng->txt(
"start_survey"));
 
 1742                                        $appr_ids = array();
 
 1747                                                $anonymous_id = $this->
object->getAnonymousIdByCode($anonymous_code);           
 
 1750                                                        $appr_ids = $this->
object->getAppraiseesToRate(0, $anonymous_id);
 
 1756                                        if(!$appr_ids && 
$ilUser->getId() != ANONYMOUS_USER_ID)
 
 1758                                                $appr_ids = $this->
object->getAppraiseesToRate($ilUser->getId());                                               
 
 1761                                        if(
sizeof($appr_ids))
 
 1764                                                $active_appraisees = array();
 
 1765                                                if($participant_status)
 
 1767                                                        foreach($participant_status as $item)
 
 1769                                                                $active_appraisees[$item[
"appr_id"]] = $item[
"finished"];
 
 1775                                                foreach($appr_ids as $appr_id)
 
 1777                                                        if($this->object->isAppraiseeClosed($appr_id))
 
 1780                                                                $list[$appr_id] = $this->lng->txt(
"survey_360_appraisee_is_closed");
 
 1782                                                        else if(array_key_exists($appr_id, $active_appraisees))
 
 1785                                                                if($active_appraisees[$appr_id])
 
 1787                                                                        $list[$appr_id] = $this->lng->txt(
"already_completed_survey");
 
 1792                                                                        $list[$appr_id] = array(
"resume", $this->lng->txt(
"resume_survey"));
 
 1798                                                                $list[$appr_id] = array(
"start", $this->lng->txt(
"start_survey"));
 
 1802                                                $info->addSection($this->lng->txt(
"survey_360_rate_other_appraisees"));
 
 1804                                                include_once 
"Services/User/classes/class.ilUserUtil.php";
 
 1805                                                foreach($list as $appr_id => $item)
 
 1809                                                        if(!is_array($item))
 
 1811                                                                $info->addProperty($appr_name, $item);                                                  
 
 1815                                                                $this->ctrl->setParameter($output_gui, 
"appr_id", $appr_id);
 
 1816                                                                $href = $this->ctrl->getLinkTarget($output_gui, $item[0]);
 
 1817                                                                $this->ctrl->setParameter($output_gui, 
"appr_id", 
"");
 
 1819                                                                include_once 
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
 
 1821                                                                $button->setCaption($item[1], 
false);
 
 1822                                                                $button->setUrl($href);                                                         
 
 1823                                                                $big_button_360 = 
'<div>'.$button->render().
'</div>';
 
 1825                                                                $info->addProperty($appr_name, $big_button_360);                                                        
 
 1829                                        else if(!$is_appraisee)
 
 1836                        if($this->object->get360Mode() &&
 
 1837                                $this->object->get360SelfAppraisee() && 
 
 1838                                !$this->object->isAppraisee(
$ilUser->getId()) &&
 
 1839                                $ilUser->getId() != ANONYMOUS_USER_ID) 
 
 1841                                $link = $this->ctrl->getLinkTargetByClass(
"ilsurveyparticipantsgui", 
"addSelfAppraisee");
 
 1842                                $link = 
'<a href="'.$link.
'">'.$this->lng->txt(
"survey_360_add_self_appraisee").
'</a>';                                         
 
 1843                                $info->addProperty(
" ", $link);                                                            
 
 1849                        $ilToolbar->setFormAction($this->ctrl->getFormAction($output_gui, 
"infoScreen"));
 
 1851                        include_once 
"Services/UIComponent/Button/classes/class.ilSubmitButton.php";
 
 1853                        $button->setCaption($big_button[1], 
false);
 
 1854                        $button->setCommand($big_button[0]);
 
 1855                        $button->setPrimary(
true);
 
 1856                        $ilToolbar->addButtonInstance($button);         
 
 1858                        $ilToolbar->setCloseFormTag(
false);
 
 1859                        $info->setOpenFormTag(
false);
 
 1868                if (strlen($this->object->getIntroduction()))
 
 1870                        $introduction = $this->
object->getIntroduction();
 
 1871                        $info->addSection($this->lng->txt(
"introduction"));
 
 1872                        $info->addProperty(
"", $this->object->prepareTextareaOutput($introduction).
 
 1873                                "<br />".$info->getHiddenToggleButton());
 
 1877                        $info->addSection(
"");
 
 1878                        $info->addProperty(
"", 
$info->getHiddenToggleButton());
 
 1881                $info->hideFurtherSections(
false);
 
 1883                if(!$this->object->get360Mode())
 
 1885                        $info->addSection($this->lng->txt(
"svy_general_properties"));
 
 1887                        $info->addProperty($this->lng->txt(
"survey_results_anonymization"), 
 
 1888                                !$this->object->hasAnonymizedResults()
 
 1889                                        ? $this->lng->txt(
"survey_results_personalized_info")
 
 1890                                        : $this->lng->txt(
"survey_results_anonymized_info"));
 
 1892                        include_once 
"./Modules/Survey/classes/class.ilObjSurveyAccess.php";
 
 1896                                $info->addProperty($this->lng->txt(
"evaluation_access"), $this->lng->txt(
"evaluation_access_info"));
 
 1900                $info->addMetaDataSections($this->object->getId(),0, $this->object->getType());
 
 1902                $this->ctrl->forwardCommand(
$info);
 
 1908                switch ($this->ctrl->getCmd())
 
 1914                        case "redirectQuestion":
 
 1915                                $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, 
"infoScreen"), 
"", 
$_GET[
"ref_id"]);
 
 1918                        case "checkEvaluationAccess":
 
 1919                        case "evaluationdetails":
 
 1920                        case "evaluationuser":
 
 1921                                $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTargetByClass(
"ilsurveyevaluationgui", 
"evaluation"), 
"", 
$_GET[
"ref_id"]);
 
 1926                        case "importSurvey":
 
 1930                                $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, 
"infoScreen"), 
"", 
$_GET[
"ref_id"]);
 
 1933                                $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, 
"infoScreen"), 
"", 
$_GET[
"ref_id"]);
 
 1936                                if ((
int)
$_GET[
"q_id"] && !(
int)$_REQUEST[
"new_for_survey"])
 
 1940                                        $q_id = (int)
$_GET[
"q_id"];
 
 1941                                        include_once 
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
 
 1943                                        $this->ctrl->setParameterByClass($q_type, 
"q_id", $q_id);
 
 1945                                                $this->ctrl->getLinkTargetByClass(array(
"ilSurveyEditorGUI", $q_type), 
"editQuestion"));                                                                                                                                                        
 
 1958        public static function _goto($a_target, $a_access_code = 
"")
 
 1960                global $ilAccess, 
$lng;
 
 1963                if (strlen($a_access_code))
 
 1966                        $_GET[
"baseClass"] = 
"ilObjSurveyGUI";
 
 1967                        $_GET[
"cmd"] = 
"infoScreen";
 
 1968                        $_GET[
"ref_id"] = $a_target;
 
 1969                        include(
"ilias.php");
 
 1973                if ($ilAccess->checkAccess(
"visible", 
"", $a_target) ||
 
 1974                        $ilAccess->checkAccess(
"read", 
"", $a_target))
 
 1976                        $_GET[
"baseClass"] = 
"ilObjSurveyGUI";
 
 1977                        $_GET[
"cmd"] = 
"infoScreen";
 
 1978                        $_GET[
"ref_id"] = $a_target;
 
 1979                        include(
"ilias.php");
 
 1982                else if ($ilAccess->checkAccess(
"read", 
"", ROOT_FOLDER_ID))
 
 1992                $rtpl = 
new ilTemplate(
"tpl.svy_view_user_results.html", 
true, 
true, 
"Modules/Survey");
 
 1994                $show_titles = (bool)$this->object->getShowQuestionTitles();
 
 1996                foreach($this->object->getSurveyPages() as $page)
 
 1998                        if(count($page) > 0)
 
 2001                                if(count($page) > 1)
 
 2003                                        if((
bool)$page[0][
"questionblock_show_blocktitle"])
 
 2005                                                $rtpl->setVariable(
"BLOCK_TITLE", trim($page[0][
"questionblock_title"]));
 
 2010                                foreach($page as $question)
 
 2012                                        $question_gui = $this->
object->getQuestionGUI($question[
"type_tag"], $question[
"question_id"]);
 
 2013                                        if(is_object($question_gui))
 
 2015                                                $rtpl->setCurrentBlock(
"question_bl");
 
 2018                                                if(strlen($question[
"heading"]))
 
 2020                                                        $rtpl->setVariable(
"HEADING", trim($question[
"heading"]));
 
 2023                                                $rtpl->setVariable(
"QUESTION_DATA", 
 
 2024                                                        $question_gui->getPrintView(
 
 2026                                                                (
bool)$question[
"questionblock_show_questiontext"], 
 
 2027                                                                $this->object->getId(),
 
 2028                                                                $this->object->loadWorkingData($question[
"question_id"], $a_active_id)
 
 2032                                                $rtpl->parseCurrentBlock();                                             
 
 2036                                $rtpl->setCurrentBlock(
"block_bl");
 
 2037                                $rtpl->parseCurrentBlock();
 
 2041                return $rtpl->get();            
 
 2048                $anonymous_code = 
$_SESSION[
"anonymous_id"][$this->
object->getId()];
 
 2049                $active_id = $this->
object->getActiveID($ilUser->getId(), $anonymous_code, 0);
 
 2050                if($this->object->isSurveyStarted(
$ilUser->getId(), $anonymous_code) !== 1 ||
 
 2053                        $this->ctrl->redirect($this, 
"infoScreen");
 
 2056                $ilTabs->clearTargets();
 
 2057                $ilTabs->setBackTarget($this->lng->txt(
"btn_back"), 
 
 2058                        $this->ctrl->getLinkTarget($this, 
"infoScreen"));
 
 2068                $show_titles = (bool)$this->object->getShowQuestionTitles();
 
 2070                foreach($this->object->getSurveyPages() as $page)
 
 2072                        if(count($page) > 0)
 
 2074                                $res[] = 
"\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
 
 2077                                if(count($page) > 1)
 
 2079                                        if((
bool)$page[0][
"questionblock_show_blocktitle"])
 
 2081                                                $res[$this->lng->txt(
"questionblock")] = trim($page[0][
"questionblock_title"]).
"\n";
 
 2087                                $page_res = array();
 
 2089                                foreach($page as $question)
 
 2091                                        $question_gui = $this->
object->getQuestionGUI($question[
"type_tag"], $question[
"question_id"]);
 
 2092                                        if(is_object($question_gui))
 
 2094                                                $question_parts = array();                                                                              
 
 2097                                                if(strlen($question[
"heading"]))
 
 2099                                                        $question_parts[$this->lng->txt(
"heading")] = trim($question[
"heading"]);
 
 2104                                                        $question_parts[$this->lng->txt(
"title")] = trim($question[
"title"]);
 
 2107                                                if((
bool)$question[
"questionblock_show_questiontext"])
 
 2109                                                        $question_parts[$this->lng->txt(
"question")] = trim(strip_tags($question_gui->object->getQuestionText()));
 
 2112                                                $answers = $question_gui->getParsedAnswers(
 
 2113                                                        $this->object->loadWorkingData($question[
"question_id"], $a_active_id),
 
 2117                                                if(
sizeof($answers))
 
 2120                                                        if(
sizeof($answers) > 1 || 
 
 2121                                                                get_class($question_gui) == 
"SurveyTextQuestionGUI")
 
 2127                                                        foreach($answers as $answer)
 
 2130                                                                if($answer[
"textanswer"])
 
 2132                                                                        $text = 
' ("'.$answer[
"textanswer"].
'")';
 
 2134                                                                if(!isset($answer[
"cols"]))
 
 2136                                                                        if(isset($answer[
"title"]))
 
 2138                                                                                $parts[] = $answer[
"title"].$text;
 
 2140                                                                        else if(isset($answer[
"value"]))
 
 2142                                                                                $parts[] = $answer[
"value"];
 
 2146                                                                                $parts[] = substr(
$text, 2, -1);
 
 2153                                                                        foreach($answer[
"cols"] as $col)
 
 2155                                                                                $tmp[] = $col[
"title"];
 
 2157                                                                        $parts[] = $answer[
"title"].
": ".implode(
", ", $tmp).$text;
 
 2161                                                        $question_parts[$this->lng->txt(
"answer")] = 
 
 2162                                                                ($multiline ? 
"\n" : 
"").implode(
"\n", $parts);
 
 2166                                                foreach($question_parts as $type => $value)
 
 2168                                                        $tmp[] = $type.
": ".$value;
 
 2170                                                $page_res[] = implode(
"\n", $tmp);
 
 2174                                $res[] = implode(
"\n\n-------------------------------\n\n", $page_res);
 
 2178                $res[] = 
"\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
 
 2180                return implode(
"\n", 
$res);
 
 2187                $finished = $this->
object->getSurveyParticipants(array($a_active_id));
 
 2188                $finished = array_pop($finished);
 
 2191                require_once 
"Services/Mail/classes/class.ilMail.php";  
 
 2192                require_once 
"Services/Link/classes/class.ilLink.php";
 
 2194                $body = ilMail::getSalutation(
$ilUser->getId()).
"\n\n";         
 
 2195                $body .= $this->lng->txt(
"svy_mail_own_results_body").
"\n";             
 
 2196                $body .= 
"\n".$this->lng->txt(
"obj_svy").
": ".$this->
object->getTitle().
"\n";                                   
 
 2198                $body .= 
"\n".$this->lng->txt(
"survey_results_finished").
": ".$finished.
"\n\n";
 
 2200                if($this->object->hasMailOwnResults())
 
 2202                        $subject = 
"svy_mail_own_results_subject";
 
 2207                        $subject = 
"svy_mail_confirmation_subject";
 
 2211                $body .= ilMail::_getInstallationSignature();
 
 2213                require_once 
"Services/Mail/classes/class.ilMail.php";
 
 2214                $mail = 
new ilMail(ANONYMOUS_USER_ID);
 
 2215                $mail->sendMimeMail(
 
 2219                        sprintf($this->lng->txt($subject), $this->object->getTitle()),
 
 2230                $anonymous_code = 
$_SESSION[
"anonymous_id"][$this->
object->getId()];
 
 2231                $active_id = $this->
object->getActiveID($ilUser->getId(), $anonymous_code, 0);
 
 2232                if($this->object->isSurveyStarted(
$ilUser->getId(), $anonymous_code) !== 1 ||
 
 2235                        $this->ctrl->redirect($this, 
"infoScreen");
 
 2238                $recipient = 
$_POST[
"mail"];    
 
 2241                        $recipient = 
$ilUser->getEmail();
 
 2245                        $this->ctrl->redirect($this, 
"infoScreen");
 
 2251                $this->ctrl->redirect($this, 
"infoScreen");
 
sprintf('%.4f', $callTime)
An exception for terminatinating execution or to throw for unit testing.
static _getTitle($question_id)
Returns the question title of a question with a given id.
static _getQuestionType($question_id)
Returns the question type of a question with a given id.
This class represents an option in a checkbox group.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
static setUseRelativeDates($a_status)
set use relative dates
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
Export User Interface Class.
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
const LP_CONTEXT_REPOSITORY
Class ilObjUserTrackingGUI.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
static getLogger($a_component_id)
Get component logger.
This class handles base functions for mail handling.
This class represents a non editable value in a property form.
static _getUsedHTMLTags($a_module="")
Returns an array of all allowed HTML tags for text editing.
static _hasEvaluationAccess($a_obj_id, $user_id)
propertiesObject(ilPropertyFormGUI $a_form=null)
Display and fill the properties form of the test.
afterSave(ilObject $a_new_object)
save object @access public
initPropertiesForm()
Init survey settings form.
infoScreenObject()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually,...
static _goto($a_target, $a_access_code="")
redirect script
sendUserResultsMail($a_active_id, $a_recipient)
initImportForm($a_new_type)
Init object import form.
savePropertiesObject()
Save the survey properties.
getUserResultsPlain($a_active_id)
addDidacticTemplateOptions(array &$a_options)
Add custom templates.
executeCommand()
execute command
importSurveyObject()
form for new survey object import
infoScreen()
show information screen
evaluationObject()
Redirects the evaluation object call to the ilSurveyEvaluationGUI class.
resetTemplateObject()
Enable all settings - remove template.
addLocatorItems()
should be overwritten to add object specific items (repository items are preloaded)
confirmResetTemplateObject()
Enable all settings - Confirmation.
getTabs()
adds tabs to tab gui object
getUserResultsTable($a_active_id)
const EVALUATION_ACCESS_PARTICIPANTS
const NOTIFICATION_INVITED_USERS
const NOTIFICATION_PARENT_COURSE
const EVALUATION_ACCESS_ALL
static _hasDatasets($survey_id)
const ANONYMIZE_FREEACCESS
const EVALUATION_ACCESS_OFF
static validateExternalRaterCode($a_ref_id, $a_code)
static _lookupId($a_user_str)
Lookup id by login.
static _lookupName($a_user_id)
lookup user name
GUI class for the workflow of copying objects.
Class ilObjectGUI Basic methods of all Output classes.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
getDidacticTemplateVar($a_type)
Get didactic template setting from creation screen.
putObjectInTree(ilObject $a_obj, $a_parent_node_id=null)
Add object to tree at given position.
prepareOutput($a_show_subobjects=true)
prepare output
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
getCreationMode()
get creation mode
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
addHeaderAction()
Add header action menu.
Class ilObject Basic functions for all objects.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
getRefId()
get reference id @access public
static _getAllReferences($a_id)
get all reference ids of object
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
This class represents an option in a radio group.
Settings template application class.
static getAllSettingsTemplates($a_type, $a_include_auto_generated=false)
Get all settings templates of type.
static lookupTitle($a_id)
Lookup title.
Skill management settings.
Class ilSurveyConstraintsGUI.
Survey evaluation graphical output.
Survey execution graphical output.
Class ilSurveyParticipantsGUI.
Survey skill determination GUI class.
Survey skill service GUI class.
special template class to simplify handling of ITX/PEAR
This class represents a text area property in a property form.
This class represents a text property in a property form.
Auto completion class for user lists.
static getNamePresentation($a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false)
Default behaviour is:
static is_email($a_email)
This preg-based function checks whether an e-mail address is formally valid.
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static redirect($a_script)
http redirect to other script
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.