From c522cd7a0b75f16aca99b2cf6460aacc708ba166 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 4 Mar 2008 12:50:16 +0000 Subject: [PATCH] Patch from Stefan Becker to implement a default category for new infolog entries --- infolog/inc/class.uiinfolog.inc.php | 4 ++++ infolog/inc/hook_settings.inc.php | 35 ++++++++++++++++++++++++++++- infolog/setup/egw_de.lang | 8 +++++++ infolog/setup/egw_en.lang | 8 +++++++ 4 files changed, 54 insertions(+), 1 deletion(-) diff --git a/infolog/inc/class.uiinfolog.inc.php b/infolog/inc/class.uiinfolog.inc.php index 9cae3412b8..296bec5f2d 100644 --- a/infolog/inc/class.uiinfolog.inc.php +++ b/infolog/inc/class.uiinfolog.inc.php @@ -919,6 +919,10 @@ class uiinfolog { $content['info_cat'] = (int) $_REQUEST['cat_id']; } + if (!$content) + { + $content['info_cat'] = $this->prefs['cat_add_default']; + } switch($this->prefs['set_start']) { case 'date': default: $set_startdate = mktime(0,0,0,date('m',$this->bo->user_time_now),date('d',$this->bo->user_time_now),date('Y',$this->bo->user_time_now)); break; diff --git a/infolog/inc/hook_settings.inc.php b/infolog/inc/hook_settings.inc.php index 56d51618ed..a9de416849 100644 --- a/infolog/inc/hook_settings.inc.php +++ b/infolog/inc/hook_settings.inc.php @@ -36,6 +36,28 @@ $show_details = array( 1 => lang('Yes'), 2 => lang('Only for details'), ); +/** + * Return InoLog Categories (used for setting ) + * + * @return array + */ +function all_cats() +{ + $categories = new categories('','infolog'); + + foreach((array)$categories->return_sorted_array(0,False,'','','',true) as $cat) + { + $s = str_repeat(' ',$cat['level']) . stripslashes($cat['name']); + + if ($cat['app_name'] == 'phpgw' || $cat['owner'] == '-1') + { + $s .= ' ♦'; + } + $sel_options[$cat['id']] = $s; // 0.9.14 only + } + return $sel_options; +} + /* Settings array for this app */ $GLOBALS['settings'] = array( 'defaultFilter' => array( @@ -121,6 +143,16 @@ $GLOBALS['settings'] = array( 'xmlrpc' => True, 'admin' => False ), + 'cat_add_default' => array( + 'type' => 'select', + 'label' => 'Default categorie for new Infolog entries', + 'name' => 'cat_add_default', + 'values' => all_cats(), + 'help' => 'You can choose a categorie to be preselected, when you create a new Infolog entry', + 'xmlrpc' => True, + 'admin' => False + ), + ); unset($ui); unset($show_home); @@ -195,4 +227,5 @@ $GLOBALS['settings']['notify_start_responsible'] = array( 'values' => $options, 'xmlrpc' => True, 'admin' => False, -); \ No newline at end of file +); + diff --git a/infolog/setup/egw_de.lang b/infolog/setup/egw_de.lang index 0985debddd..a2e2c939c1 100644 --- a/infolog/setup/egw_de.lang +++ b/infolog/setup/egw_de.lang @@ -82,6 +82,7 @@ custom contact-address, leave empty to use information from most recent link inf custom contact-information, leave emtpy to use information from most recent link infolog de benutzerdefinierte Kontaktinformationen, leer lassen um die Daten der Verknüpfung zu verwenden custom fields infolog de Benutzerdefinierte Felder custom fields, typ and status common de Benutzerdefinierte Felder, Typen und Status +custom from infolog de Benutzerdefinierter Kontakt custom regarding infolog de Benutzerdefinierter Bezug custom status for typ infolog de Benutzerdefinierter Status für Typ customfields infolog de Benutzerdefinierte Felder @@ -90,6 +91,7 @@ date completed (leave it empty to have it automatic set if status is done or bil datecreated infolog de Erstellt am dates, status, access infolog de Daten, Status, Zugriff days infolog de Tage +default categorie for new infolog entries infolog de Vorgabe Kategorie für neue InfoLog Einträge default filter for infolog infolog de Standard-Filter für InfoLog default status for a new log entry infolog de Vorgabe für den Status eines neuen Eintrags delegated infolog de delegiert @@ -140,6 +142,7 @@ error: saving the entry infolog de Fehler: beim Speichern des Eintrags error: the entry has been updated since you opened it for editing! infolog de Fehler: der Eintrag wurde geändert seit Sie ihn zum Bearbeiten geöffnet haben! existing links infolog de Bestehende Verknüpfungen fax infolog de Fax +field must not be empty !!! infolog de Feld darf nicht leer sein !!! fieldseparator infolog de Feldbegrenzer finish infolog de wenn erledigt for which types should this field be used infolog de für welche Typen soll dieses Feld benutzt werden @@ -223,6 +226,7 @@ own infolog de eigene own open infolog de eigene offen own overdue infolog de eigene überfällig own upcoming infolog de eigene zukünftig +parent infolog de Elterneintrag path on (web-)serverside
eg. /var/samba/share infolog de Pfad auf (Web-)Server
zB. /var/samba/Share path to user and group files has to be outside of the webservers document-root!!! infolog de Pfad zu Benutzer- und Gruppen-Dateien MUSS AUSSERHALB des Wurzelverzeichnisses des Webservers (document-root) liegen!!! pattern for search in addressbook infolog de Muster für Suche im Adressbuch @@ -235,6 +239,8 @@ phonecall infolog de Telefonanruf planned infolog de geplant planned time infolog de geplante Zeit price infolog de Preis +pricelist infolog de Preisliste +primary link infolog de Primäre Verknüpfung priority infolog de Priorität private infolog de Privat project infolog de Projekt @@ -304,6 +310,7 @@ status ... infolog de Status ... sub infolog de Unter-
einträge sub-entries become subs of the parent or main entries, if there's no parent infolog de Untereinträge gehören dann zum übergeordneten Eintrag oder werden Haupteinträge wenn es keinen übergeordneten gibt. subject infolog de Titel +sum infolog de Summe task infolog de Aufgabe template infolog de Vorlage test import (show importable records only in browser) infolog de Test Import (zeige importierbare Datensätze nur im Browser) @@ -351,6 +358,7 @@ yes, noone can purge deleted items infolog de Ja, niemand darf gelöschte Eintr yes, only admins can purge deleted items infolog de Ja, nur Admins dürfen gelöschte Einträge bereinigen yes, with larger fontsize infolog de Ja, mit einer größeren Schrift yes, with purging of deleted items possible infolog de Ja, jeder darf gelöschte Einträge bereinigen +you can choose a categorie to be preselected, when you create a new infolog entry infolog de Sie können eine Kategorie festlegen die vorausgewählt wird, wenn Sie neue InfoLog Einträge anlegen. you can't delete one of the stock types !!! infolog de Sie können keinen der Standardtypen löschen!!! you have entered an invalid ending date infolog de Sie haben ein ungültiges Fälligkeitsdatum eingegeben you have entered an invalid starting date infolog de Sie haben ein ungültiges Startdatum eingegeben diff --git a/infolog/setup/egw_en.lang b/infolog/setup/egw_en.lang index 9b108652a9..7a210ad5d6 100644 --- a/infolog/setup/egw_en.lang +++ b/infolog/setup/egw_en.lang @@ -82,6 +82,7 @@ custom contact-address, leave empty to use information from most recent link inf custom contact-information, leave emtpy to use information from most recent link infolog en Custom contact-information, leave emtpy to use information from most recent link custom fields infolog en Custom Fields custom fields, typ and status common en Custom fields, type and status +custom from infolog en Custom from custom regarding infolog en Custom regarding custom status for typ infolog en Custom status for type customfields infolog en Customfields @@ -90,6 +91,7 @@ date completed (leave it empty to have it automatic set if status is done or bil datecreated infolog en date created dates, status, access infolog en Dates, Status, Access days infolog en days +default categorie for new infolog entries infolog en Default categorie for new Infolog entries default filter for infolog infolog en Default Filter for InfoLog default status for a new log entry infolog en default status for a new log entry delegated infolog en delegated @@ -140,6 +142,7 @@ error: saving the entry infolog en Error: saving the entry error: the entry has been updated since you opened it for editing! infolog en Error: the entry has been updated since you opened it for editing! existing links infolog en Existing links fax infolog en Fax +field must not be empty !!! infolog en Field must not be empty !!! fieldseparator infolog en Fieldseparator finish infolog en finish for which types should this field be used infolog en for which types should this field be used @@ -223,6 +226,7 @@ own infolog en own own open infolog en own open own overdue infolog en own overdue own upcoming infolog en own upcoming +parent infolog en Parent path on (web-)serverside
eg. /var/samba/share infolog en path on (web-)serverside
eg. /var/samba/Share path to user and group files has to be outside of the webservers document-root!!! infolog en Path to user and group files HAS TO BE OUTSIDE of the webservers document-root!!! pattern for search in addressbook infolog en pattern for search in Addressbook @@ -235,6 +239,8 @@ phonecall infolog en Phone Call planned infolog en planned planned time infolog en planned time price infolog en Price +pricelist infolog en Pricelist +primary link infolog en primary link priority infolog en Priority private infolog en Private project infolog en Project @@ -303,6 +309,7 @@ status ... infolog en Status ... sub infolog en Sub sub-entries become subs of the parent or main entries, if there's no parent infolog en Sub-entries become subs of the parent or main entries, if there's no parent subject infolog en Subject +sum infolog en Sum task infolog en ToDo template infolog en Template test import (show importable records only in browser) infolog en Test Import (show importable records only in browser) @@ -349,6 +356,7 @@ yes, noone can purge deleted items infolog en Yes, noone can purge deleted items yes, only admins can purge deleted items infolog en Yes, only admins can purge deleted items yes, with larger fontsize infolog en Yes, with larger fontsize yes, with purging of deleted items possible infolog en Yes, with purging of deleted items possible +you can choose a categorie to be preselected, when you create a new infolog entry infolog en You can choose a categorie to be preselected, when you create a new Infolog entry you can't delete one of the stock types !!! infolog en You can't delete one of the stock types !!! you have entered an invalid ending date infolog en You have entered an invalid due date you have entered an invalid starting date infolog en You have entered an invalid starting date