11 use \ILIAS\Modules\OrgUnit\ARHelper\DIC;
44 $nextClass = $this->ctrl()->getNextClass();
47 case strtolower(ilBiblTranslationGUI::class):
48 $this->tabs()->clearTargets();
49 $target = $this->ctrl()->getLinkTarget($this);
50 $this->tabs()->setBackTarget($this->lng()->txt(
'back'),
$target);
52 $field_id = $this->
http()->request()->getQueryParams()[self::FIELD_IDENTIFIER];
56 $this->ctrl()->saveParameter($this, self::FIELD_IDENTIFIER);
57 $field = $this->facade->fieldFactory()->findById($field_id);
60 $this->ctrl()->forwardCommand($gui);
71 $this->checkPermissionAndFail(
'write');
73 $bib_default_sorting = [
78 foreach ($bib->getStandardFieldIdentifiers() as
$i => $identifier) {
79 $field = $ff_bib->findOrCreateFieldByTypeAndIdentifier($bib->getId(), $identifier);
80 $field->setPosition($i + 1);
82 $array_search = array_search($identifier, $bib_default_sorting);
83 if ($array_search !==
false) {
84 $field->setPosition((
int) $array_search + 1);
85 $ff_bib->forcePosition($field);
88 $ris_default_sorting = [
93 foreach (
$ris->getStandardFieldIdentifiers() as $i => $identifier) {
94 $field = $ff_ris->findOrCreateFieldByTypeAndIdentifier(
$ris->getId(), $identifier);
95 $field->setPosition($i + 1);
97 $array_search = array_search($identifier, $ris_default_sorting);
98 if ($array_search !==
false) {
99 $field->setPosition((
int) $array_search + 1);
100 $ff_bib->forcePosition($field);
103 $this->ctrl()->redirect($this, self::CMD_STANDARD);
109 $this->checkPermissionAndFail(
'write');
111 $ilDB = $DIC->database();
114 if (
$ilDB->tableExists(
'il_bibl_overview_model')) {
115 $type =
function ($filetype_string) {
116 if (strtolower($filetype_string) ==
"bib" 117 || strtolower($filetype_string) ==
"bibtex" 125 if (!
$ilDB->tableColumnExists(
'il_bibl_overview_model',
'file_type_id')) {
126 $ilDB->addTableColumn(
'il_bibl_overview_model',
'file_type_id', array(
"type" =>
"integer",
'length' => 4));
129 $res =
$ilDB->query(
"SELECT * FROM il_bibl_overview_model");
131 $type_id = (int)
$type(
$d->filetype);
133 "il_bibl_overview_model",
135 "file_type_id" => [
"integer", $type_id],
137 [
"ovm_id" => [
"integer",
$d->ovm_id]]
143 $this->ctrl()->redirect($this, self::CMD_STANDARD);
149 $cmd = $this->ctrl()->getCmd(self::CMD_STANDARD);
151 case self::CMD_STANDARD:
153 case self::CMD_UPDATE:
155 case self::CMD_APPLY_FILTER:
156 case self::CMD_RESET_FILTER:
157 case self::CMD_INIT_OVERVIEW_MODELS:
158 case self::CMD_INIT_DEFAULT_FIELDS_AND_SORTING:
159 if ($this->access()->checkAccess(
'write',
"", $this->facade->iliasRefId())) {
186 $this->tpl()->setContent($ilBiblAdminFieldTableGUI->getHTML());
192 $this->tabs()->addSubTab(
194 $this->lng()->txt(
'ris'),
195 $this->ctrl()->getLinkTargetByClass(
197 ilObjBibliographicAdminGUI::class, ilBiblAdminRisFieldGUI::class,
202 $this->tabs()->activateSubTab(self::SUBTAB_RIS);
204 $this->tabs()->addSubTab(
206 $this->lng()->txt(
'bibtex'),
207 $this->ctrl()->getLinkTargetByClass(
209 ilObjBibliographicAdminGUI::class, ilBiblAdminBibtexFieldGUI::class,
214 switch ($this->facade->type()->getId()) {
216 $this->tabs()->activateSubTab(self::SUBTAB_BIBTEX);
219 $this->tabs()->activateSubTab(self::SUBTAB_RIS);
227 foreach (
$_POST[
'position'] as $set) {
228 $field_id = (int) key($set);
229 $position = (int) current($set);
231 $ilBiblField = $this->facade->fieldFactory()->findById((
int) $field_id);
232 $ilBiblField->setPosition((
int) $position);
233 $ilBiblField->store();
236 ilUtil::sendSuccess($this->lng()->txt(
"changes_successfully_saved"));
237 $this->ctrl()->redirect($this, self::CMD_STANDARD);
244 $ilBiblAdminFieldTableGUI->writeFilterToSession();
245 $this->ctrl()->redirect($this, self::CMD_STANDARD);
252 $ilBiblAdminFieldTableGUI->resetFilter();
253 $ilBiblAdminFieldTableGUI->resetOffset();
254 $this->ctrl()->redirect($this, self::CMD_STANDARD);
Interface ilBiblFactoryFacadeInterface.
Class ilBiblTranslationGUI.
const CMD_INIT_DEFAULT_FIELDS_AND_SORTING
Class ilBiblAdminFieldGUI.
static http()
Fetches the global http state from ILIAS.
foreach($_POST as $key=> $value) $res
initDefaultFieldsAndSorting()
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Class ilBiblAdminFieldTableGUI.
const CMD_INIT_OVERVIEW_MODELS
__construct(ilBiblAdminFactoryFacadeInterface $facade)
ilBiblAdminFieldGUI constructor.
Class ilBiblFieldFactory.
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d