コード例 #1
0
 /**
  * Creates the output for user/group invitation to a survey
  */
 public function inviteObject()
 {
     global $ilAccess;
     global $rbacsystem;
     global $ilToolbar;
     global $lng;
     $this->parent_gui->handleWriteAccess();
     $this->setCodesSubtabs();
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTableWidth("500");
     $form->setId("invite");
     // invitation
     $header = new ilFormSectionHeaderGUI();
     $header->setTitle($this->lng->txt("invitation"));
     $form->addItem($header);
     // invitation mode
     $invitation = new ilRadioGroupInputGUI($this->lng->txt('invitation_mode'), "invitation");
     $invitation->setInfo($this->lng->txt('invitation_mode_desc'));
     $invitation->addOption(new ilRadioOption($this->lng->txt("invitation_off"), 0, ''));
     $surveySetting = new ilSetting("survey");
     if ($surveySetting->get("unlimited_invitation")) {
         $invitation->addOption(new ilRadioOption($this->lng->txt("unlimited_users"), 1, ''));
     }
     $invitation->addOption(new ilRadioOption($this->lng->txt("predefined_users"), 2, ''));
     $inv = 0;
     if ($this->object->getInvitation()) {
         $inv = $this->object->getInvitationMode() + 1;
     }
     $invitation->setValue($inv);
     $form->addItem($invitation);
     $form->addCommandButton("saveInvitationStatus", $this->lng->txt("save"));
     $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_svy_svy_invite.html", "Modules/Survey");
     $this->tpl->setVariable("INVITATION_TABLE", $form->getHTML());
     if ($this->object->getInvitation() && $this->object->getInvitationMode() == 1) {
         // search button
         include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
         ilRepositorySearchGUI::fillAutoCompleteToolbar($this, $tb, array('auto_complete_name' => $lng->txt('user'), 'submit_name' => $lng->txt('svy_invite_action')));
         $ilToolbar->addSpacer();
         $ilToolbar->addButton($this->lng->txt("svy_search_users"), $this->ctrl->getLinkTargetByClass('ilRepositorySearchGUI', ''));
         $this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
         $invited_users = $this->object->getUserData($this->object->getInvitedUsers());
         include_once "./Modules/Survey/classes/tables/class.ilSurveyInvitedUsersTableGUI.php";
         $table_gui = new ilSurveyInvitedUsersTableGUI($this, 'invite');
         $table_gui->setData($invited_users);
         $this->tpl->setVariable('TBL_INVITED_USERS', $table_gui->getHTML());
     }
 }
コード例 #2
0
 /**
  * Creates the output for user/group invitation to a survey
  */
 public function inviteObject()
 {
     global $ilAccess;
     global $rbacsystem;
     global $ilToolbar;
     global $lng;
     if (!$rbacsystem->checkAccess("visible,invite", $this->ref_id)) {
         // allow only read and write access
         ilUtil::sendInfo($this->lng->txt("cannot_edit_survey"), true);
         $path = $this->tree->getPathFull($this->object->getRefID());
         include_once "./Services/Utilities/classes/class.ilUtil.php";
         ilUtil::redirect($this->getReturnLocation("cancel", "./ilias.php?baseClass=ilRepositoryGUI&cmd=frameset&ref_id=" . $path[count($path) - 2]["child"]));
         return;
     }
     if ($this->object->getStatus() == ilObjSurvey::STATUS_OFFLINE) {
         ilUtil::sendInfo($this->lng->txt("survey_offline_message"));
         return;
     }
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTableWidth("500");
     $form->setId("invite");
     // invitation
     $header = new ilFormSectionHeaderGUI();
     $header->setTitle($this->lng->txt("invitation"));
     $form->addItem($header);
     // invitation mode
     $invitation = new ilRadioGroupInputGUI($this->lng->txt('invitation_mode'), "invitation");
     $invitation->setInfo($this->lng->txt('invitation_mode_desc'));
     $invitation->addOption(new ilRadioOption($this->lng->txt("invitation_off"), 0, ''));
     $surveySetting = new ilSetting("survey");
     if ($surveySetting->get("unlimited_invitation")) {
         $invitation->addOption(new ilRadioOption($this->lng->txt("unlimited_users"), 1, ''));
     }
     $invitation->addOption(new ilRadioOption($this->lng->txt("predefined_users"), 2, ''));
     $inv = 0;
     if ($this->object->getInvitation()) {
         $inv = $this->object->getInvitationMode() + 1;
     }
     $invitation->setValue($inv);
     $form->addItem($invitation);
     $form->addCommandButton("saveInvitationStatus", $this->lng->txt("save"));
     $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_svy_svy_invite.html", "Modules/Survey");
     $this->tpl->setVariable("INVITATION_TABLE", $form->getHTML());
     if ($this->object->getInvitation() && $this->object->getInvitationMode() == 1) {
         // search button
         include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
         ilRepositorySearchGUI::fillAutoCompleteToolbar($this, $tb, array('auto_complete_name' => $lng->txt('user'), 'submit_name' => $lng->txt('svy_invite_action')));
         $ilToolbar->addSpacer();
         $ilToolbar->addButton($this->lng->txt("svy_search_users"), $this->ctrl->getLinkTargetByClass('ilRepositorySearchGUI', ''));
         $this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
         $invited_users = $this->object->getUserData($this->object->getInvitedUsers());
         include_once "./Modules/Survey/classes/tables/class.ilSurveyInvitedUsersTableGUI.php";
         $table_gui = new ilSurveyInvitedUsersTableGUI($this, 'invite');
         $table_gui->setData($invited_users);
         $this->tpl->setVariable('TBL_INVITED_USERS', $table_gui->getHTML());
     }
 }