Skip to content
Snippets Groups Projects
Commit 792057b4 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

fixes #3474

Closes #3474

Merge request studip/studip!2370
parent b08ed9cd
No related branches found
No related tags found
No related merge requests found
...@@ -184,7 +184,7 @@ class Institute_BasicdataController extends AuthenticatedController ...@@ -184,7 +184,7 @@ class Institute_BasicdataController extends AuthenticatedController
$institute->strasse = Request::get('strasse', $institute->strasse); $institute->strasse = Request::get('strasse', $institute->strasse);
// Beware: Despite the name, this contains both zip code AND city name // Beware: Despite the name, this contains both zip code AND city name
$institute->plz = Request::get('plz', $institute->plz); $institute->plz = Request::get('plz', $institute->plz);
$institute->url = Request::get('home', $institute->url); $institute->url = Request::i18n('url', $institute->url)->trim();
$institute->telefon = Request::get('telefon', $institute->telefon); $institute->telefon = Request::get('telefon', $institute->telefon);
$institute->email = Request::get('email', $institute->email); $institute->email = Request::get('email', $institute->email);
$institute->fax = Request::get('fax', $institute->fax); $institute->fax = Request::get('fax', $institute->fax);
......
<?php
/**
* @var Institute_BasicdataController $controller
* @var string $i_view
* @var string|null $question
* @var Institute $institute
* @var bool $may_edit_faculty
* @var bool $may_delete
* @var Institute[] $faculties
* @var array $datafields
* @var string $reason_txt
*/
?>
<?= $question ?? '' ?> <?= $question ?? '' ?>
<form method="post" name="edit" action="<?= $controller->url_for('institute/basicdata/store/' . $i_view) ?>" class="default"> <form method="post" name="edit" action="<?= $controller->url_for('institute/basicdata/store/' . $i_view) ?>" class="default">
<?= CSRFProtection::tokenTag() ?> <?= CSRFProtection::tokenTag() ?>
...@@ -7,7 +20,7 @@ ...@@ -7,7 +20,7 @@
<label class="col-6"> <label class="col-6">
<span class="required"><?= _('Name') ?></span> <span class="required"><?= _('Name') ?></span>
<?= I18N::input('Name', $institute->Name, LockRules::Check($institute->id, 'name') ? ['readonly' => true, 'disabled' => true] : ['required' => true]); ?> <?= I18N::input('Name', $institute->name, LockRules::Check($institute->id, 'name') ? ['readonly' => true, 'disabled' => true] : ['required' => true]); ?>
</label> </label>
<label class="col-3"> <label class="col-3">
...@@ -89,8 +102,7 @@ ...@@ -89,8 +102,7 @@
<label class="col-3"> <label class="col-3">
<?= _('Homepage') ?> <?= _('Homepage') ?>
<input type="text" <?= LockRules::Check($institute->id, 'url') ? 'readonly disabled' : '' ?> id="home" name="home" <?= I18N::input('url', $institute->url, LockRules::Check($institute->id, 'url') ? ['readonly' => true, 'disabled' => true] : ['required' => true]); ?>
value="<?= htmlReady(Request::get('home', $institute->url)) ?>">
</label> </label>
<? if ($GLOBALS['perm']->have_perm('root')): // Select lockrule to apply ?> <? if ($GLOBALS['perm']->have_perm('root')): // Select lockrule to apply ?>
......
...@@ -36,7 +36,7 @@ class Institute extends SchemaProvider ...@@ -36,7 +36,7 @@ class Institute extends SchemaProvider
'street' => $institute->strasse, 'street' => $institute->strasse,
'phone' => $institute->telefon, 'phone' => $institute->telefon,
'fax' => $institute->fax, 'fax' => $institute->fax,
'url' => $institute->url, 'url' => (string) $institute->url,
'is-faculty' => $institute->is_fak, 'is-faculty' => $institute->is_fak,
'mkdate' => date('c', $institute->mkdate), 'mkdate' => date('c', $institute->mkdate),
'chdate' => date('c', $institute->chdate), 'chdate' => date('c', $institute->chdate),
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
* @property string $fakultaets_id database column * @property string $fakultaets_id database column
* @property string $strasse database column * @property string $strasse database column
* @property string $plz database column * @property string $plz database column
* @property string $url database column * @property I18NString $url database column
* @property string $telefon database column * @property string $telefon database column
* @property string $email database column * @property string $email database column
* @property string $fax database column * @property string $fax database column
...@@ -133,7 +133,7 @@ class Institute extends SimpleORMap implements Range ...@@ -133,7 +133,7 @@ class Institute extends SimpleORMap implements Range
return Statusgruppen::findAllByRangeId($institute->id, true); return Statusgruppen::findAllByRangeId($institute->id, true);
}; };
$config['i18n_fields']['name'] = true; $config['i18n_fields'] = ['name', 'url'];
$config['registered_callbacks']['after_create'][] = 'setDefaultTools'; $config['registered_callbacks']['after_create'][] = 'setDefaultTools';
parent::configure($config); parent::configure($config);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment