Skip to content

Commit

Permalink
add new attribute general:instshortname
Browse files Browse the repository at this point in the history
if set, it is already used to construct the filename of installers with
(presence of this attribute trumps general:instname, even if instname 
has an exact language match and shortname only an other-language match)
almost done with #217, the only part missing is for @twoln to add the
list of acronyms to the DiscoJuice keyword list so searching will find
institution by shortname as well
  • Loading branch information
restena-sw committed Apr 2, 2021
1 parent df098d4 commit afd87cb
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/DeviceConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,11 @@ private function getInstallerBasename() {
}
// Okay, no custom suffix.
// Use the configured inst name and apply shortening heuristics
// if an instshortname is set, base on that, otherwise, the normal instname
$attribToUse = (isset($this->attributes['general:instshortname']) ? 'general:instshortname' : 'general:instname');
$lang_pointer = CONFIG['LANGUAGES'][$this->languageInstance->getLang()]['latin_based'] == TRUE ? 0 : 1;
$this->loggerInstance->debug(5, "getInstallerBasename1:" . $this->attributes['general:instname'][$lang_pointer] . "\n");
$inst = $this->customTranslit($this->attributes['general:instname'][$lang_pointer]);
$this->loggerInstance->debug(5, "getInstallerBasename1:" . $this->attributes[$attribToUse][$lang_pointer] . "\n");
$inst = $this->customTranslit($this->attributes[$attribToUse][$lang_pointer]);
$this->loggerInstance->debug(4, "getInstallerBasename2:$inst\n");
$Inst_a = explode('_', $inst);
if (count($Inst_a) > 2) {
Expand Down
26 changes: 26 additions & 0 deletions schema/2_0_4-2_0_5.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* *****************************************************************************
* Contributions to this work were made on behalf of the GÉANT project, a
* project that has received funding from the European Union’s Framework
* Programme 7 under Grant Agreements No. 238875 (GN3) and No. 605243 (GN3plus),
* Horizon 2020 research and innovation programme under Grant Agreements No.
* 691567 (GN4-1) and No. 731122 (GN4-2).
* On behalf of the aforementioned projects, GEANT Association is the sole owner
* of the copyright in all material which was developed by a member of the GÉANT
* project. GÉANT Vereniging (Association) is registered with the Chamber of
* Commerce in Amsterdam with registration number 40535155 and operates in the
* UK as a branch of GÉANT Vereniging.
*
* Registered office: Hoekenrode 3, 1102BR Amsterdam, The Netherlands.
* UK branch address: City House, 126-130 Hills Road, Cambridge CB2 1PQ, UK
*
* License: see the web/copyright.inc.php file in the file structure or
* <base_url>/copyright.php after deploying the software
*/

/**
* Author: swinter
* Created: 02.04.2021
*/

INSERT INTO profile_option_dict (name, description, type, flag) VALUES('general:instshortname','short name of the institution (acronym etc) in multiple languages','string','ML');
1 change: 1 addition & 0 deletions schema/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ INSERT INTO `profile_option_dict` VALUES
('eap:server_name','name of authorized RADIUS server','string',NULL),
('general:geo_coordinates','geographical coordinates of the institution or a campus','coordinates',NULL),
('general:instname','name of the institution in multiple languages','string','ML'),
('general:instshortname','short name of the institution (acronym etc) in multiple languages','string','ML'),
('general:logo_file','file data containing institution logo','file',NULL),
('media:SSID','additional SSID to configure, WPA2/AES only','string',NULL),
('media:SSID_with_legacy','additional SSID to configure, WPA2/AES and WPA/TKIP','string',NULL),
Expand Down
1 change: 1 addition & 0 deletions web/lib/admin/UIElements.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public function displayName($input) {
_("Support: Phone") => "support:phone",
_("Support: E-Mail") => "support:email",
sprintf(_("%s Name"), $this->nomenclatureInst) => "general:instname",
sprintf(_("%s Acronym"), $this->nomenclatureParticipant) => "general:instshortname",
_("Location") => "general:geo_coordinates",
_("Logo URL") => "general:logo_url",
_("Logo image") => "general:logo_file",
Expand Down

0 comments on commit afd87cb

Please sign in to comment.