mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-03-10 13:08:21 +01:00
* Resources: new setting what to show in title beside name: short description (default), location or inventory number
This commit is contained in:
parent
687440cc9a
commit
678997c397
@ -889,7 +889,7 @@ class resources_bo
|
||||
}
|
||||
|
||||
/**
|
||||
* get title for an infolog entry identified by $res_id
|
||||
* Get title for a resource entry identified by $res_id
|
||||
*
|
||||
* @author Cornelius Weiss <egw@von-und-zu-weiss.de>
|
||||
* @param int|array $resource
|
||||
@ -905,17 +905,18 @@ class resources_bo
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return $resource['name']. ($resource['short_description'] ? ', ['.$resource['short_description'].']':'');
|
||||
$show = $resource[$GLOBALS['egw_info']['user']['preferences']['title_show'] ?? 'short_description'];
|
||||
return $resource['name'].(!empty($show) ? ' ('.$show.')' : '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Columns displayed in title (or required for ACL)
|
||||
*
|
||||
*/
|
||||
const TITLE_COLS = 'res_id,name,short_description,cat_id';
|
||||
const TITLE_COLS = ['res_id', 'name', 'cat_id'];
|
||||
|
||||
/**
|
||||
* get title for multiple contacts identified by $ids
|
||||
* Get title for multiple resources identified by $ids
|
||||
*
|
||||
* Is called as hook to participate in the linking.
|
||||
*
|
||||
@ -925,7 +926,8 @@ class resources_bo
|
||||
function link_titles(array $ids)
|
||||
{
|
||||
$titles = array();
|
||||
if (($resources =& $this->so->search(array('res_id' => $ids),self::TITLE_COLS)))
|
||||
if (($resources =& $this->so->search(array('res_id' => $ids),
|
||||
array_merge(self::TITLE_COLS, [$GLOBALS['egw_info']['user']['preferences']['title_show'] ?? 'short_description']))))
|
||||
{
|
||||
foreach($resources as $resource)
|
||||
{
|
||||
@ -1066,4 +1068,4 @@ class resources_bo
|
||||
$dir->close();
|
||||
return $icons;
|
||||
}
|
||||
}
|
||||
}
|
@ -200,9 +200,23 @@ class resources_hooks
|
||||
*/
|
||||
static function settings()
|
||||
{
|
||||
$settings[] = array(
|
||||
$settings = [[
|
||||
'type' => 'section',
|
||||
'title' => lang('Data exchange settings'),
|
||||
'title' => lang('General settings'),
|
||||
'no_lang' => true,
|
||||
'xmlrpc' => False,
|
||||
'admin' => False
|
||||
]];
|
||||
$settings[] = array(
|
||||
'type' => 'select',
|
||||
'name' => 'title_show',
|
||||
'label' => lang('Show in title (beside name)'),
|
||||
'default' => 'short_description',
|
||||
'values' => [
|
||||
'short_description' => lang('short description'),
|
||||
'location' => lang('location'),
|
||||
'inventory_number' => lang('inventory number'),
|
||||
],
|
||||
'no_lang' => true,
|
||||
'xmlrpc' => False,
|
||||
'admin' => False
|
||||
@ -211,9 +225,16 @@ class resources_hooks
|
||||
// Merge print
|
||||
if($GLOBALS['egw_info']['user']['apps']['filemanager'])
|
||||
{
|
||||
$settings[] = array(
|
||||
'type' => 'section',
|
||||
'title' => lang('Data exchange settings'),
|
||||
'no_lang' => true,
|
||||
'xmlrpc' => False,
|
||||
'admin' => False
|
||||
);
|
||||
$merge = new resources_merge();
|
||||
$settings += $merge->merge_preferences();
|
||||
}
|
||||
return $settings;
|
||||
}
|
||||
}
|
||||
}
|
@ -35,6 +35,7 @@ create new accessory for this resource resources de Neues Zubehör zu dieser Res
|
||||
create new links resources de Neue Verknüpfung erstellen
|
||||
custom etemplate for the contactform resources de Benutzerdefiniertes eTemlate für das Kontaktformular
|
||||
custom fields resources de Benutzerdefinierte Felder
|
||||
data exchange settings common de Einstellungen für den Datenaustausch
|
||||
days resources de Tage
|
||||
delete accessories of selected resources too? resources de Auch Zubehör der ausgewählten Ressourcen löschen?
|
||||
delete selected resources resources de Ausgewählte Ressourcen löschen
|
||||
@ -134,6 +135,7 @@ select/deselect all resources de Alle auswählen / Auswahl aufheben
|
||||
short description resources de Kurzbeschreibung
|
||||
short description of resource resources de Kurzbeschreibung der Ressource
|
||||
show calendar of resource resources de Kalender der Ressource anzeigen
|
||||
show in title (beside name) resources de Im Titel anzeigen (neben dem Namen)
|
||||
simple reservation of a single item resources de Einfache Reservierung eines einzelnen Elements
|
||||
something went wrong by deleting resource resources de Beim Löschen der Ressource gab es ein Problem!
|
||||
something went wrong by saving resource resources de Beim Speichern der Ressource gab es ein Problem!
|
||||
|
@ -35,6 +35,7 @@ create new accessory for this resource resources en Create new accessory for thi
|
||||
create new links resources en Create new links
|
||||
custom etemplate for the contactform resources en Custom eTemplate for the contactform
|
||||
custom fields resources en Custom Fields
|
||||
data exchange settings common en Data exchange settings
|
||||
days resources en Days
|
||||
delete accessories of selected resources too? resources en Delete accessories of selected resources too?
|
||||
delete selected resources resources en Delete selected resources
|
||||
@ -135,6 +136,7 @@ select/deselect all resources en Select/deselect all
|
||||
short description resources en Short description
|
||||
short description of resource resources en Short description of resource
|
||||
show calendar of resource resources en Show calendar of resource
|
||||
show in title (beside name) resources en Show in title (beside name)
|
||||
simple reservation of a single item resources en Simple reservation of a single item
|
||||
something went wrong by deleting resource resources en Error deleting resource!
|
||||
something went wrong by saving resource resources en Error saving resource!
|
||||
|
Loading…
Reference in New Issue
Block a user