diff --git a/app/controllers/institute/basicdata.php b/app/controllers/institute/basicdata.php index 2f13d9b15acaa6fcd0299e6cbcd25d4942615e0b..030749fbb69616f07e3314d3d88e2aa723cb69c2 100644 --- a/app/controllers/institute/basicdata.php +++ b/app/controllers/institute/basicdata.php @@ -184,7 +184,7 @@ class Institute_BasicdataController extends AuthenticatedController $institute->strasse = Request::get('strasse', $institute->strasse); // Beware: Despite the name, this contains both zip code AND city name $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->email = Request::get('email', $institute->email); $institute->fax = Request::get('fax', $institute->fax); diff --git a/app/views/institute/basicdata/index.php b/app/views/institute/basicdata/index.php index 8e697c1e01143bbeec67e9f6273c702a3a2e7020..5d29572085a1c1a1a55ac8484c0da98988daa6d1 100644 --- a/app/views/institute/basicdata/index.php +++ b/app/views/institute/basicdata/index.php @@ -1,3 +1,16 @@ +<?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 ?? '' ?> <form method="post" name="edit" action="<?= $controller->url_for('institute/basicdata/store/' . $i_view) ?>" class="default"> <?= CSRFProtection::tokenTag() ?> @@ -7,7 +20,7 @@ <label class="col-6"> <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 class="col-3"> @@ -89,8 +102,7 @@ <label class="col-3"> <?= _('Homepage') ?> - <input type="text" <?= LockRules::Check($institute->id, 'url') ? 'readonly disabled' : '' ?> id="home" name="home" - value="<?= htmlReady(Request::get('home', $institute->url)) ?>"> + <?= I18N::input('url', $institute->url, LockRules::Check($institute->id, 'url') ? ['readonly' => true, 'disabled' => true] : ['required' => true]); ?> </label> <? if ($GLOBALS['perm']->have_perm('root')): // Select lockrule to apply ?> diff --git a/lib/classes/JsonApi/Schemas/Institute.php b/lib/classes/JsonApi/Schemas/Institute.php index 13e061a2d1136628502e9f3e70a95e10be877a1b..0084ca6baa0915f6798e340862a59693787932d1 100644 --- a/lib/classes/JsonApi/Schemas/Institute.php +++ b/lib/classes/JsonApi/Schemas/Institute.php @@ -36,7 +36,7 @@ class Institute extends SchemaProvider 'street' => $institute->strasse, 'phone' => $institute->telefon, 'fax' => $institute->fax, - 'url' => $institute->url, + 'url' => (string) $institute->url, 'is-faculty' => $institute->is_fak, 'mkdate' => date('c', $institute->mkdate), 'chdate' => date('c', $institute->chdate), diff --git a/lib/models/Institute.class.php b/lib/models/Institute.class.php index 5a5a1d0b3c763f67044b36e1e5207319bd20a70c..ece1e13ec8b23858904df1b63d0c54fedeecaf1f 100644 --- a/lib/models/Institute.class.php +++ b/lib/models/Institute.class.php @@ -19,7 +19,7 @@ * @property string $fakultaets_id database column * @property string $strasse database column * @property string $plz database column - * @property string $url database column + * @property I18NString $url database column * @property string $telefon database column * @property string $email database column * @property string $fax database column @@ -133,7 +133,7 @@ class Institute extends SimpleORMap implements Range return Statusgruppen::findAllByRangeId($institute->id, true); }; - $config['i18n_fields']['name'] = true; + $config['i18n_fields'] = ['name', 'url']; $config['registered_callbacks']['after_create'][] = 'setDefaultTools'; parent::configure($config);