39 use \ILIAS\Modules\OrgUnit\ARHelper\DIC;
69 protected ?
string $cmd = self::CMD_SHOW_CONTENT;
71 public function __construct(
int $a_id = 0,
int $a_id_type = self::REPOSITORY_NODE_ID,
int $a_parent_node_id = 0)
75 $this->storage = $DIC[
'resource_storage'];
79 $DIC->language()->loadLanguageModule(
'bibl');
80 $DIC->language()->loadLanguageModule(
'content');
81 $DIC->language()->loadLanguageModule(
'obj');
82 $DIC->language()->loadLanguageModule(
'cntr');
84 if (is_object($this->
object)) {
96 return self::CMD_VIEW;
114 $ilNavigationHistory = $DIC[
'ilNavigationHistory'];
117 $link = $this->dic()->ctrl()->getLinkTarget($this, $this->
getStandardCmd());
118 if ($this->
object != null) {
119 $ilNavigationHistory->addItem($this->
object->getRefId(), $link,
"bibl");
132 $next_class = $this->dic()->ctrl()->getNextClass($this);
133 $this->cmd = $this->dic()->ctrl()->getCmd();
134 switch ($next_class) {
135 case strtolower(ilInfoScreenGUI::class):
137 $this->dic()->tabs()->activateTab(self::TAB_ID_INFO);
138 $this->infoScreenForward();
140 case strtolower(ilCommonActionDispatcherGUI::class):
143 $this->
ctrl->forwardCommand($gui);
145 case strtolower(ilPermissionGUI::class):
147 $this->dic()->tabs()->activateTab(self::TAB_ID_PERMISSIONS);
150 case strtolower(ilObjectCopyGUI::class):
152 $cp->setType(
'bibl');
153 $this->dic()[
'tpl']->loadStandardTemplate();
154 $this->
ctrl->forwardCommand($cp);
156 case strtolower(ilExportGUI::class):
158 $this->dic()->tabs()->setTabActive(self::TAB_EXPORT);
160 $exp_gui->addFormat(
"xml");
161 $this->
ctrl->forwardCommand($exp_gui);
163 case strtolower(ilBiblFieldFilterGUI::class):
165 $this->dic()->tabs()->setTabActive(self::TAB_SETTINGS);
167 $this->tabs_gui->activateSubTab(self::SUB_TAB_FILTER);
172 $cmd = $this->
ctrl->getCmd(self::CMD_SHOW_CONTENT);
176 case self::CMD_EDIT_OBJECT:
177 case self::CMD_UPDATE_OBJECT:
179 $this->tabs_gui->activateSubTab(self::SUBTAB_SETTINGS);
197 $this->
ctrl->setCmd(
"showSummary");
198 $this->
ctrl->setCmdClass(ilInfoScreenGUI::class);
199 $this->infoScreenForward();
205 public function infoScreenForward():
void 212 if (!$this->checkPermissionBoolAndReturn(
"visible") && !$this->checkPermissionBoolAndReturn(
'read')) {
213 $this->tpl->setOnScreenMessage(
'failure', $DIC[
'lng']->txt(
"msg_no_perm_read"),
true);
214 $this->
ctrl->redirectByClass(
'ilDashboardGUI',
'');
216 $DIC->tabs()->activateTab(self::TAB_ID_INFO);
219 $info->enablePrivateNotes();
220 $info->addMetaDataSections($this->
object->getId(), 0, $this->
object->getType());
226 $this->
ctrl->forwardCommand($info);
235 $ilLocator = $DIC[
'ilLocator'];
236 if (is_object($this->
object)) {
245 public static function _goto(
string $a_target): void
249 $id = explode(
"_", $a_target);
250 $DIC->ctrl()->setTargetScript(
'ilias.php');
251 $DIC->ctrl()->setParameterByClass(ilObjBibliographicGUI::class,
"ref_id", (
int) (
$id[0] ?? 1));
253 if (isset(
$id[1]) &&
$id[1] !==
'') {
256 $DIC->ctrl()->redirectByClass(
258 ilRepositoryGUI::class,
259 ilObjBibliographicGUI::class,
261 self::CMD_SHOW_DETAILS
264 $DIC->ctrl()->redirectByClass(
266 ilRepositoryGUI::class,
267 ilObjBibliographicGUI::class,
281 $forms = parent::initCreationForms($a_new_type);
283 $in_file =
new ilFileInputGUI($DIC->language()->txt(
"bibliography_file"),
"bibliographic_file");
284 $in_file->
setSuffixes(array(
"ris",
"bib",
"bibtex"));
285 $in_file->setRequired(
true);
286 $forms[self::CFORM_NEW]->addItem($in_file);
287 $this->
ctrl->saveParameterByClass(
'ilobjrootfoldergui',
'new_type');
288 $forms[self::CFORM_NEW]->setFormAction($this->
ctrl->getFormActionByClass(
'ilobjrootfoldergui',
"save"));
298 if ($form[self::CFORM_NEW]->checkInput()) {
301 $form = $form[self::CFORM_NEW];
302 $form->setValuesByPost();
303 $DIC->ui()->mainTemplate()->setContent($form->getHtml());
310 $this->
ctrl->redirect($this, self::CMD_EDIT);
318 public function setTabs():
void 322 $ilHelp = $DIC[
'ilHelp'];
326 $ilHelp->setScreenIdComponent(
'bibl');
328 if ($DIC->access()->checkAccess(
'read',
"", $this->
object->getRefId())) {
329 $DIC->tabs()->addTab(
332 ->txt(self::TAB_CONTENT),
333 $this->
ctrl->getLinkTarget($this, self::CMD_SHOW_CONTENT)
337 if ($DIC->access()->checkAccess(
'visible',
"", $this->
object->getRefId())
338 || $DIC->access()->checkAccess(
'read',
"", $this->
object->getRefId())
340 $DIC->tabs()->addTab(
344 $this->
ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary")
348 if ($DIC->access()->checkAccess(
'write',
"", $this->
object->getRefId())) {
349 $DIC->tabs()->addTab(
350 self::SUBTAB_SETTINGS,
352 ->txt(self::SUBTAB_SETTINGS),
353 $this->
ctrl->getLinkTarget($this, self::CMD_EDIT_OBJECT)
357 if ($DIC->access()->checkAccess(
"write",
"", $this->
object->getRefId())) {
358 $DIC->tabs()->addTab(
361 ->txt(self::TAB_EXPORT),
362 $this->
ctrl->getLinkTargetByClass(
"ilexportgui",
"")
366 if ($DIC->access()->checkAccess(
'edit_permission',
"", $this->
object->getRefId())) {
367 $DIC->tabs()->addTab(
368 self::TAB_ID_PERMISSIONS,
370 ->txt(
"perm_settings"),
371 $this->
ctrl->getLinkTargetByClass(
"ilpermissiongui",
"perm")
379 $DIC->tabs()->addSubTab(
380 self::SUBTAB_SETTINGS,
382 ->txt(self::SUBTAB_SETTINGS),
383 $this->
ctrl->getLinkTarget($this, self::CMD_EDIT_OBJECT)
385 $DIC->tabs()->addSubTab(
386 self::SUB_TAB_FILTER,
388 ->txt(
"bibl_filter"),
404 $ilErr->raiseError($this->
lng->txt(
"msg_no_perm_write"),
$ilErr->MESSAGE);
407 $ilTabs->activateTab(
"settings");
411 if ($values !== []) {
412 $form->setValuesByArray($values,
true);
424 $form = parent::initEditForm();
428 ->txt(
"bibliography_file"),
431 $in_file->
setSuffixes(array(
"ris",
"bib",
"bibtex"));
432 $in_file->setRequired(
false);
435 ->txt(
"override_entries"),
440 $form->addItem($cb_override);
443 $section_appearance->setTitle($this->
lng->txt(
'cont_presentation'));
444 $form->addItem($section_appearance);
445 $DIC->object()->commonSettings()->legacyForm($form, $this->
object)->addTileImage();
447 $form->setFormAction($DIC->ctrl()->getFormAction($this,
"save"));
456 $DIC->tabs()->activateTab(self::SUBTAB_SETTINGS);
464 $values[
"is_online"] = $this->
object->getOnline();
480 $read_access = $DIC->access()->checkAccess(
'read',
"", $this->
object->getRefId());
481 $online = $this->
object->getOnline();
482 $write_access = $DIC->access()->checkAccess(
'write',
"", $this->
object->getRefId());
483 if (($read_access && $online) || $write_access) {
484 $DIC->tabs()->activateTab(self::TAB_CONTENT);
487 $b->setCaption(
'download_original_file');
488 $b->setUrl($DIC->ctrl()->getLinkTargetByClass(self::class, self::CMD_SEND_FILE));
489 $b->setPrimary(
true);
490 $DIC->toolbar()->addButtonInstance(
$b);
493 $html = $table->getHTML();
494 $DIC->ui()->mainTemplate()->setContent(
$html);
497 $DIC->ui()->mainTemplate()->setPermanentLink(
"bibl", $this->
object->getRefId());
500 $this->tpl->setOnScreenMessage(
'failure', sprintf(
502 ->txt(
"msg_no_perm_read_item"),
513 $table->writeFilterToSession();
514 $table->resetOffset();
515 $this->
ctrl->redirect($this, self::CMD_SHOW_CONTENT);
521 $table->resetFilter();
522 $table->resetOffset();
523 $this->
ctrl->redirect($this, self::CMD_SHOW_CONTENT);
533 if ($DIC[
'ilAccess']->checkAccess(
'read',
"", $this->
object->getRefId())) {
534 if (!$this->
object->isMigrated()) {
535 $file_path = $this->
object->getLegacyAbsolutePath();
537 if (is_file($file_path)) {
540 $this->
object->getFilename(),
541 'application/octet-stream' 544 $this->tpl->setOnScreenMessage(
'failure', $DIC[
'lng']->txt(
"file_not_found"));
549 $this->storage->consume()->download($this->
object->getResourceId())->run();
560 if ($DIC->access()->checkAccess(
'read',
"", $this->
object->getRefId())) {
561 $id = $DIC->http()->request()->getQueryParams()[self::P_ENTRY_ID];
562 $entry = $this->facade->entryFactory()
563 ->findByIdAndTypeString(
$id, $this->
object->getFileTypeAsString());
566 $DIC->ui()->mainTemplate()->setContent($bibGUI->getHTML());
584 if ($DIC->access()->checkAccess(
'write',
"", $this->
object->getRefId())) {
585 if ($this->
object->getOnline() != $a_form->
getInput(
"is_online")) {
586 $this->
object->setOnline($a_form->
getInput(
"is_online"));
589 if (!empty($_FILES[
'bibliographic_file'][
'name'])) {
593 $DIC->object()->commonSettings()->legacyForm($a_form, $this->
object)->saveTileImage();
602 $ntf = $DIC->http()->wrapper()->query()->retrieve(
604 $DIC->refinery()->to()->int()
627 $DIC->ctrl()->redirect($this,
"");
635 $ilNewsItem->setTitle($DIC->language()->txt(
'news_title_' . $change));
637 $ilNewsItem->setContext($obj_id, $this->
getType());
638 $ilNewsItem->setUserId($DIC->user()->getId());
640 $ilNewsItem->setContentTextIsLangVar(
false);
641 $ilNewsItem->create();
667 $a_new_object->parseFileToDatabase();
669 parent::afterImport($a_new_object);
676 $this->tpl->setOnScreenMessage(
'failure', $DIC->language()->txt(
"no_permission"),
true);
afterSave(ilObject $a_new_object)
Class ilObjBibliographicGUI.
append(ilInfoScreenGUI $info)
removeFromDesk()
Remove from desktop.
New implementation of ilObjectGUI.
GUI class for the workflow of copying objects.
ilBiblFieldFilterFactory $filter_factory
updateCustom(ilPropertyFormGUI $a_form)
updateSettings
executeCommand()
executeCommand
editObject()
edit object public
prepareOutput(bool $show_sub_objects=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilObjBibliographicStakeholder $stakeholder
sendFile()
provide file as a download
addToDesk()
Add desktop item.
ilBiblFactoryFacade $facade
Class ilResourceStorageInfoGUI.
addExternalEditFormCustom(ilPropertyFormGUI $form)
static _lookupObjId(int $ref_id)
const TYPE_DATA_COLLECTION
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilBiblTypeFactory $type_factory
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupTitle(int $obj_id)
setContent(string $a_html)
Sets content for standard template.
static setNotification(int $type, int $user_id, int $id, bool $status=true)
Set notification status for object and user.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static deliverFileAttached(string $path_to_file, ?string $download_file_name=null, ?string $mime_type=null, bool $delete_file=false)
Class ilObjBibliographicStakeholder.
const NEWS_NOTICE
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(int $id=0, int $id_type=self::REPOSITORY_NODE_ID, int $parent_node_id=0)
ilGlobalTemplateInterface $tpl
ilBiblFieldFactory $field_factory
afterImport(ilObject $new_object)
Post (successful) object import hook.
ilBiblTranslationFactory $translation_factory
removeFromDeskObject()
Remove from desktop public.
setTabs()
create tabs (repository/workspace switch)
initCreationForms(string $a_new_type)
A news item can be created by different sources.
addNews(int $obj_id, string $change='created')
initEditCustomForm(ilPropertyFormGUI $a_form)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
showContent()
shows the overview page with all entries in a table
addToDeskObject()
Add desktop item public.
getStandardCmd()
getStandardCmd
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static _goto(string $a_target)
_goto Deep link
Class ilObjBibliographic.
Class ilBiblEntryDetailPresentationGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addHeaderAction()
Add header action menu.
getEditFormCustomValues(array &$values)
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
infoScreen()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually...