24require_once(
"./Services/COPage/classes/class.ilPCVerification.php");
 
   25require_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
 
   49    public function __construct(&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id = 
"")
 
   53        $this->tpl = 
$DIC[
"tpl"];
 
   54        $this->ctrl = 
$DIC->ctrl();
 
   55        $this->
user = $DIC->user();
 
   56        $this->lng = 
$DIC->language();
 
   57        parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
 
   66        $next_class = $this->ctrl->getNextClass($this);
 
   69        $cmd = $this->ctrl->getCmd();
 
   71        switch ($next_class) {
 
   94        $tpl->setContent($a_form->getHTML());
 
  111        $tpl->setContent($a_form->getHTML());
 
  130            $form->setTitle($this->lng->txt(
"cont_insert_verification"));
 
  132            $form->setTitle($this->lng->txt(
"cont_update_verification"));
 
  135        $lng->loadLanguageModule(
"wsp");
 
  136        $workspaceOptions = array();
 
  138        $certificateSource = 
new ilRadioGroupInputGUI($this->lng->txt(
'certificate_selection'), 
'certificate_selection');
 
  140        $workspaceRadioButton = 
new ilRadioOption($this->lng->txt(
'certificate_workspace_option'), 
'certificate_workspace_option');
 
  141        $persistentRadioButton = 
new ilRadioOption($this->lng->txt(
'certificate_persistent_option'), 
'certificate_persistent_option');
 
  148                if (in_array($node[
"type"], array(
"excv", 
"tstv", 
"crsv", 
"scov"))) {
 
  149                    $workspaceOptions[$node[
"obj_id"]] = $node[
"title"] . 
" (" . 
$lng->txt(
"wsp_type_" . $node[
"type"]) . 
")";
 
  152            asort($workspaceOptions);
 
  155        $workspaceCertificates = 
new ilSelectInputGUI($this->lng->txt(
"cont_verification_object"), 
"object");
 
  156        $workspaceCertificates->setRequired(
true);
 
  157        $workspaceCertificates->setOptions($workspaceOptions);
 
  163        $persistentOptions = array();
 
  168            $type = 
$lng->txt(
"wsp_type_" . $userCertificate->getObjType() . 
'v');
 
  169            $additionalInformation = 
' (' . 
$type . 
' / ' . $dateTime . 
')';
 
  170            $persistentOptions[$userCertificate->getObjId()] = 
$certificate->getObjectTitle() . $additionalInformation;
 
  173        $persistentObject = 
new ilSelectInputGUI($this->lng->txt(
"cont_verification_object"), 
"persistent_object");
 
  174        $persistentObject->setRequired(
true);
 
  175        $persistentObject->setOptions($persistentOptions);
 
  177        $persistentRadioButton->addSubItem($persistentObject);
 
  178        $workspaceRadioButton->addSubItem($workspaceCertificates);
 
  180        $certificateSource->addOption($persistentRadioButton);
 
  181        $certificateSource->addOption($workspaceRadioButton);
 
  183        $certificateSource->setValue(
'certificate_persistent_option');
 
  185        $form->addItem($certificateSource);
 
  188            $form->addCommandButton(
"create_verification", $this->lng->txt(
"save"));
 
  189            $form->addCommandButton(
"cancelCreate", $this->lng->txt(
"cancel"));
 
  191            $data = $this->content_obj->getData();
 
  193            if (
$data[
'type'] === 
'crta') {
 
  194                $certificateSource->setValue(
'certificate_persistent_option');
 
  195                $persistentObject->setValue(
$data[
"id"]);
 
  197                $certificateSource->setValue(
'certificate_workspace_option');
 
  198                $workspaceCertificates->setValue(
$data[
"id"]);
 
  202            $form->addCommandButton(
"update", $this->lng->txt(
"save"));
 
  203            $form->addCommandButton(
"cancelUpdate", $this->lng->txt(
"cancel"));
 
  216        if (
$form->checkInput()) {
 
  217            $option = 
$form->getInput(
'certificate_selection');
 
  219            if (
'certificate_workspace_option' === $option) {
 
  223                    $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
 
  224                    $verificationObjectId = 
$form->getInput(
"object");
 
  226                    $this->content_obj->setData(
$type, $verificationObjectId);
 
  228                    $this->updated = $this->pg_obj->update();
 
  229                    if ($this->updated === 
true) {
 
  230                        $this->ctrl->returnToParent($this, 
"jump" . $this->hier_id);
 
  233            } elseif (
'certificate_persistent_option' === $option) {
 
  234                $objectId = 
$form->getInput(
"persistent_object");
 
  236                $userId = $this->
user->getId();
 
  240                    $certificateFileService->createCertificateFile($userId, $objectId);
 
  242                    ilUtil::sendInfo($this->lng->txt(
'certificate_file_not_found_error'), 
true);
 
  243                    $this->log->warning($e->getMessage());
 
  245                    ilUtil::sendInfo($this->lng->txt(
'certificate_file_input_output_error'), 
true);
 
  246                    $this->log->error($e->getMessage());
 
  247                    return $this->ctrl->redirect($this, 
'initForm');
 
  250                    $this->log->error($e->getMessage());
 
  251                    return $this->ctrl->redirect($this, 
'initForm');
 
  255                $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
 
  256                $this->content_obj->setData(
'crta', $objectId);
 
  258                $this->updated = $this->pg_obj->update();
 
  259                if ($this->updated === 
true) {
 
  260                    $this->ctrl->returnToParent($this, 
"jump" . $this->hier_id);
 
  263                $this->log->info(
'File could not be created');
 
  276        if (
$form->checkInput()) {
 
  277            $option = 
$form->getInput(
'certificate_selection');
 
  278            if (
'certificate_workspace_option' === $option) {
 
  279                $object = 
$form->getInput(
"object");
 
  282                    $oldContentData = $this->content_obj->getData();
 
  284                    if (
'crta' === $oldContentData[
'type']) {
 
  285                        $userId = $this->
user->getId();
 
  286                        $oldObjectId = $oldContentData[
'id'];
 
  290                            $certificateFileService->deleteCertificateFile($userId, $oldObjectId);
 
  293                            $this->log->warning($e->getMessage());
 
  296                            $this->log->warning($e->getMessage());
 
  300                    $this->content_obj->setData(
$type, $object);
 
  301                    $this->updated = $this->pg_obj->update();
 
  302                    if ($this->updated === 
true) {
 
  303                        $this->ctrl->returnToParent($this, 
"jump" . $this->hier_id);
 
  306            } elseif (
'certificate_persistent_option' === $option) {
 
  307                $oldContentData = $this->content_obj->getData();
 
  309                $objectId = 
$form->getInput(
"persistent_object");
 
  314                    $userId = $this->
user->getId();
 
  316                    $certificateFileService->createCertificateFile($userId, $objectId);
 
  317                    if (
'crta' === $oldContentData[
'type']) {
 
  318                        $oldObjectId = $oldContentData[
'id'];
 
  319                        $certificateFileService->deleteCertificateFile($userId, $oldObjectId);
 
  322                    ilUtil::sendInfo($this->lng->txt(
'certificate_file_not_found_error'), 
true);
 
  323                    $this->log->warning($e->getMessage());
 
  325                    ilUtil::sendInfo($this->lng->txt(
'certificate_file_not_found_error'), 
true);
 
  326                    $this->log->warning($e->getMessage());
 
  328                    ilUtil::sendInfo($this->lng->txt(
'certificate_file_input_output_error'), 
true);
 
  329                    $this->log->warning($e->getMessage());
 
  332                    $this->log->error($e->getMessage());
 
  333                    return $this->ctrl->redirect($this, 
'initForm');
 
  336                $this->content_obj->setData(
'crta', $objectId);
 
  337                $this->updated = $this->pg_obj->update();
 
  338                if ($this->updated === 
true) {
 
  339                    $this->ctrl->returnToParent($this, 
"jump" . $this->hier_id);
 
  342                $this->log->info(
'File could not be created');
 
  346        $this->pg_obj->addHierIDs();
 
  350    private function initStorage(
int $objectId, 
string $subDirectory = 
'')
 
  355        $path = $storage->getAbsolutePath() . 
"/";
 
  357        if ($subDirectory !== 
'') {
 
  358            $path .= $subDirectory . 
"/";
 
  360            if (!is_dir(
$path)) {
 
An exception for terminatinating execution or to throw for unit testing.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
@classDescription Date and time handling
Base class for ILIAS Exception handling.
static _lookupType($a_id, $a_reference=false)
lookup object type
Class ilPCVerificationGUI.
__construct(&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id="")
Constructor @access public.
insert(ilPropertyFormGUI $a_form=null)
Insert new verification form.
initStorage(int $objectId, string $subDirectory='')
executeCommand()
execute command
update()
Update verification.
edit(ilPropertyFormGUI $a_form=null)
Edit verification form.
initForm($a_insert=false)
Init verification form.
create()
Create new verification.
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
displayValidationError()
display validation errors
This class represents an option in a radio group.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Tree handler for personal workspace.
if(@file_exists(dirname(__FILE__).'/lang/eng.php')) $certificate
Class FlySystemFileAccessTest.
if(isset($_POST['submit'])) $form