From 80b4999f22e6c459fddd7b7b6b51e6770c62e527 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 9 Apr 2006 05:34:59 +0000 Subject: [PATCH] - fixed not shown last modified column - id, separate percen, last modified and times can now be enabled for the details view only - you can now specify the filter for home --- infolog/inc/class.uiinfolog.inc.php | 13 +- infolog/inc/hook_home.inc.php | 13 +- infolog/inc/hook_settings.inc.php | 71 ++++--- infolog/setup/etemplates.inc.php | 13 +- infolog/setup/phpgw_de.lang | 11 +- infolog/setup/phpgw_en.lang | 11 +- infolog/templates/default/customfields.xet | 232 +++++++++++---------- infolog/templates/default/index.xet | 4 +- 8 files changed, 194 insertions(+), 174 deletions(-) diff --git a/infolog/inc/class.uiinfolog.inc.php b/infolog/inc/class.uiinfolog.inc.php index 0b7a8d8520..cc15bd5edb 100644 --- a/infolog/inc/class.uiinfolog.inc.php +++ b/infolog/inc/class.uiinfolog.inc.php @@ -120,7 +120,7 @@ $GLOBALS['uiinfolog'] =& $this; // make ourself availible for ExecMethod of get_rows function } - function get_info($info,&$readonlys,$action='',$action_id='',$show_links=false) + function get_info($info,&$readonlys,$action='',$action_id='',$show_links=false,$details = 1) { if (!is_array($info)) { @@ -179,7 +179,7 @@ $info['info_type_label'] = $this->bo->enums['type'][$info['info_type']]; $info['info_status_label'] = $this->bo->status[$info['info_type']][$info['info_status']]; - if (!$this->prefs['show_percent']) + if (!$this->prefs['show_percent'] || $this->prefs['show_percent'] == 2 && !$details) { if ($info['info_status'] == 'ongoing' && $info['info_type'] != 'phone') { @@ -191,7 +191,7 @@ { $info['info_percent2'] = $info['info_percent']; } - if ($this->prefs['show_id']) + if ($this->prefs['show_id'] == 1 || $this->prefs['show_id'] == 2 && $details) { $info['info_number'] = $info['info_id']; } @@ -242,10 +242,11 @@ { $ids = array( ); } + $details = $query['filter2'] == 'all'; $readonlys = $rows = array(); foreach($ids as $id => $info) { - $info = $this->get_info($info,$readonlys,$query['action'],$query['action_id'],$query['filter2']); + $info = $this->get_info($info,$readonlys,$query['action'],$query['action_id'],$query['filter2'],$details); if (!$query['filter2'] && $this->prefs['show_links'] == 'no_describtion' || $query['filter2'] == 'no_describtion') { @@ -254,8 +255,8 @@ $rows[] = $info; } if ($query['no_actions']) $rows['no_actions'] = true; - $rows['no_details'] = $query['filter2'] == 'no_describtion'; - $rows['no_times'] = !$this->prefs['show_times']; + $rows['no_modified'] = !$this->prefs['show_modified'] || $this->prefs['show_modified'] == 2 && !$details; + $rows['no_times'] = !$this->prefs['show_times'] || $this->prefs['show_times'] == 2 && !$details; $rows['no_timesheet'] = !isset($GLOBALS['egw_info']['user']['apps']['timesheet']); $rows['duration_format'] = ','.$this->duration_format.',,1'; //echo "

readonlys = "; _debug_array($readonlys); diff --git a/infolog/inc/hook_home.inc.php b/infolog/inc/hook_home.inc.php index d6e28aa91f..3dc067cccc 100644 --- a/infolog/inc/hook_home.inc.php +++ b/infolog/inc/hook_home.inc.php @@ -10,7 +10,7 @@ \**************************************************************************/ /* $Id$ */ - if (($showevents = (int) $GLOBALS['egw_info']['user']['preferences']['infolog']['homeShowEvents']) > 0) + if (($showevents = $GLOBALS['egw_info']['user']['preferences']['infolog']['homeShowEvents'])) { $save_app = $GLOBALS['egw_info']['flags']['currentapp']; $GLOBALS['egw_info']['flags']['currentapp'] = 'infolog'; @@ -23,15 +23,8 @@ $infolog =& CreateObject('infolog.uiinfolog'); $infolog->called_by = 'home'; - /*switch($showevents) - { - case 1:*/ - $html = $infolog->index(array('nm' => array('filter' => 'own-open-today')),'','',0,False,True); - /*break; - case 2: - $html = ExecMethod('calendar.uicalendar.get_todos', array('', false)); - break; - }*/ + if (in_array($showevents,array('1','2'))) $showevents = 'own-open-today'; + $html = $infolog->index(array('nm' => array('filter' => $showevents)),'','',0,False,True); $title = lang('InfoLog').' - '.lang($infolog->filters['own-open-today']); unset($infolog); diff --git a/infolog/inc/hook_settings.inc.php b/infolog/inc/hook_settings.inc.php index 62b99f5657..9df4140f5b 100644 --- a/infolog/inc/hook_settings.inc.php +++ b/infolog/inc/hook_settings.inc.php @@ -13,18 +13,21 @@ /* $Id$ */ /* Setup some values to fill the array of this app's settings below */ - $show_entries = array( - 0 => lang('No'), - 1 => lang('Yes'), - 2 => lang('Yes').' - '.lang('show list of upcoming entries'), - ); - $ui =& CreateObject('infolog.uiinfolog'); // need some labels from + $filters = $show_home = array(); + $show_home[] = lang("DON'T show InfoLog"); foreach($ui->filters as $key => $label) { - $filters[$key] = lang($label); + $show_home[$key] = $filters[$key] = lang($label); } unset($ui); + + // migrage old filter-pref 1,2 to the filter one 'own-open-today' + if (in_array($GLOBALS['egw']->preferences->{$GLOBALS['type']}['homeShowEvents'],array('1','2'))) + { + $GLOBALS['egw']->preferences->add('infolog','homeShowEvents','own-open-today',$GLOBALS['type']); + $GLOBALS['egw']->preferences->save_repository(); + } $show_links = array( 'all' => lang('all links and attachments'), 'links' => lang('only the links'), @@ -32,27 +35,13 @@ 'none' => lang('no links or attachments'), 'no_describtion' => lang('no describtion, links or attachments'), ); + $show_details = array( + 0 => lang('No'), + 1 => lang('Yes'), + 2 => lang('Only for details'), + ); /* Settings array for this app */ $GLOBALS['settings'] = array( - 'homeShowEvents' => array( - 'type' => 'select', - 'label' => 'Show open entries: Tasks/Calls/Notes on main screen', - 'name' => 'homeShowEvents', - 'values' => $show_entries, - 'help' => 'Should InfoLog display your open entries - not finished tasks, phonecalls or notes - on the main screen. Works only if you dont selected an application for the main screen (in your preferences).', - 'xmlrpc' => True, - 'admin' => False - ), - 'mainscreen_maxshow' => array( - 'type' => 'input', - 'label' => 'Max number of entries to display on the main screen', - 'name' => 'mainscreen_maxshow', - 'size' => 3, - 'maxsize' => 10, - 'help' => 'Only up to this number of entries are displayed on the main screen.', - 'xmlrpc' => True, - 'admin' => False - ), 'defaultFilter' => array( 'type' => 'select', 'label' => 'Default Filter for InfoLog', @@ -62,6 +51,15 @@ 'xmlrpc' => True, 'admin' => False ), + 'homeShowEvents' => array( + 'type' => 'select', + 'label' => 'InfoLog filter for the main screen', + 'name' => 'homeShowEvents', + 'values' => $show_home, + 'help' => 'Should InfoLog show up on the main screen and with which filter. Works only if you dont selected an application for the main screen (in your preferences).', + 'xmlrpc' => True, + 'admin' => False + ), 'listNoSubs' => array( 'type' => 'check', 'label' => 'List no Subs/Childs', @@ -88,29 +86,41 @@ 'admin' => False ), 'show_times' => array( - 'type' => 'check', + 'type' => 'select', 'label' => 'Show times', 'name' => 'show_times', + 'values' => $show_details, 'help' => 'Show a column for used and planned times in the list.', 'xmlrpc' => True, 'admin' => False ), 'show_percent' => array( - 'type' => 'check', + 'type' => 'select', 'label' => 'Show status and percent done separate', 'name' => 'show_percent', + 'values' => $show_details, 'help' => 'Should the Infolog list show the percent done only for status ongoing or two separate icons.', 'xmlrpc' => True, 'admin' => False ), 'show_id' => array( - 'type' => 'check', + 'type' => 'select', 'label' => 'Show ticket Id', 'name' => 'show_id', + 'values' => $show_details, 'help' => 'Should the Infolog list show a unique numerical Id, which can be used eg. as ticket Id.', 'xmlrpc' => True, 'admin' => False ), + 'show_modified' => array( + 'type' => 'select', + 'label' => 'Show last modified', + 'name' => 'show_modified', + 'values' => $show_details, + 'help' => 'Should the Infolog list show the column "last modified".', + 'xmlrpc' => True, + 'admin' => False + ), 'set_start' => array( 'type' => 'select', 'label' => 'Startdate for new entries', @@ -126,6 +136,7 @@ ), ); - unset($show_entries); + unset($show_home); + unset($show_details); unset($filters); unset($show_links); diff --git a/infolog/setup/etemplates.inc.php b/infolog/setup/etemplates.inc.php index 23e9bf5e8a..51354f03df 100644 --- a/infolog/setup/etemplates.inc.php +++ b/infolog/setup/etemplates.inc.php @@ -1,5 +1,5 @@ 'infolog%','template' => '','lang' => '','group' $templ_data[] = array('name' => 'infolog.customfields','template' => '','lang' => '','group' => '0','version' => '0.9.15.001','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:7:{i:0;a:3:{s:1:"F";s:3:"80%";s:2:"c2";s:6:"header";s:2:"c4";s:6:"header";}i:1;a:6:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:3:"Typ";}s:1:"B";a:4:{s:4:"type";s:6:"select";s:4:"name";s:3:"typ";s:8:"onchange";s:1:"1";s:4:"help";s:52:"select a typ to edit it\'s status-values or delete it";}s:1:"C";a:4:{s:4:"type";s:6:"button";s:5:"label";s:6:"Delete";s:4:"name";s:14:"button[delete]";s:4:"help";s:24:"deletes the selected typ";}s:1:"D";a:5:{s:4:"type";s:4:"text";s:4:"size";s:5:"10,10";s:4:"name";s:8:"new_name";s:4:"help";s:26:"name of new type to create";s:4:"blur";s:8:"new name";}s:1:"E";a:4:{s:4:"type";s:6:"button";s:5:"label";s:6:"Create";s:4:"name";s:14:"button[create]";s:4:"help";s:37:"creates a new typ with the given name";}s:1:"F";a:5:{s:4:"type";s:5:"label";s:4:"span";s:10:",error_msg";s:7:"no_lang";s:1:"1";s:5:"align";s:6:"center";s:4:"name";s:9:"error_msg";}}i:2;a:6:{s:1:"A";a:4:{s:4:"type";s:5:"label";s:4:"span";s:3:"all";s:5:"label";s:21:"Custom status for typ";s:4:"name";s:3:"typ";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}}i:3;a:6:{s:1:"A";a:4:{s:4:"type";s:8:"template";s:4:"size";s:6:"status";s:4:"span";s:3:"all";s:4:"name";s:6:"status";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}}i:4;a:6:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"span";s:3:"all";s:5:"label";s:13:"Custom fields";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}}i:5;a:6:{s:1:"A";a:4:{s:4:"type";s:8:"template";s:4:"size";s:6:"fields";s:4:"span";s:3:"all";s:4:"name";s:6:"fields";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}}i:6;a:6:{s:1:"A";a:6:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"3";s:4:"span";s:3:"all";i:1;a:4:{s:4:"type";s:6:"button";s:5:"label";s:4:"Save";s:4:"name";s:12:"button[save]";s:4:"help";s:33:"saves the changes made and leaves";}i:2;a:4:{s:4:"type";s:6:"button";s:5:"label";s:5:"Apply";s:4:"name";s:13:"button[apply]";s:4:"help";s:19:"applies the changes";}i:3;a:4:{s:4:"type";s:6:"button";s:5:"label";s:6:"Cancel";s:4:"name";s:14:"button[cancel]";s:4:"help";s:22:"leaves without saveing";}}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}}}s:4:"rows";i:6;s:4:"cols";i:6;}}','size' => '','style' => '.header { font-weight: bold; font-size: 120%; } .error_msg { color: red; font-style: italics; }','modified' => '1061729975',); +$templ_data[] = array('name' => 'infolog.customfields','template' => '','lang' => '','group' => '0','version' => '1.2.001','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:7:{i:0;a:3:{s:1:"F";s:3:"80%";s:2:"c2";s:6:"header";s:2:"c4";s:6:"header";}i:1;a:6:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:3:"Typ";}s:1:"B";a:4:{s:4:"type";s:6:"select";s:4:"name";s:3:"typ";s:8:"onchange";s:1:"1";s:4:"help";s:52:"select a typ to edit it\'s status-values or delete it";}s:1:"C";a:4:{s:4:"type";s:6:"button";s:5:"label";s:6:"Delete";s:4:"name";s:14:"button[delete]";s:4:"help";s:24:"deletes the selected typ";}s:1:"D";a:5:{s:4:"type";s:4:"text";s:4:"size";s:5:"10,40";s:4:"name";s:8:"new_name";s:4:"help";s:26:"name of new type to create";s:4:"blur";s:8:"new name";}s:1:"E";a:4:{s:4:"type";s:6:"button";s:5:"label";s:6:"Create";s:4:"name";s:14:"button[create]";s:4:"help";s:37:"creates a new typ with the given name";}s:1:"F";a:5:{s:4:"type";s:5:"label";s:4:"span";s:10:",error_msg";s:7:"no_lang";s:1:"1";s:5:"align";s:6:"center";s:4:"name";s:9:"error_msg";}}i:2;a:6:{s:1:"A";a:4:{s:4:"type";s:5:"label";s:4:"span";s:3:"all";s:5:"label";s:21:"Custom status for typ";s:4:"name";s:3:"typ";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}}i:3;a:6:{s:1:"A";a:4:{s:4:"type";s:8:"template";s:4:"size";s:6:"status";s:4:"span";s:3:"all";s:4:"name";s:6:"status";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}}i:4;a:6:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"span";s:3:"all";s:5:"label";s:13:"Custom fields";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}}i:5;a:6:{s:1:"A";a:4:{s:4:"type";s:8:"template";s:4:"size";s:6:"fields";s:4:"span";s:3:"all";s:4:"name";s:6:"fields";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}}i:6;a:6:{s:1:"A";a:6:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"3";s:4:"span";s:3:"all";i:1;a:4:{s:4:"type";s:6:"button";s:5:"label";s:4:"Save";s:4:"name";s:12:"button[save]";s:4:"help";s:33:"saves the changes made and leaves";}i:2;a:4:{s:4:"type";s:6:"button";s:5:"label";s:5:"Apply";s:4:"name";s:13:"button[apply]";s:4:"help";s:19:"applies the changes";}i:3;a:4:{s:4:"type";s:6:"button";s:5:"label";s:6:"Cancel";s:4:"name";s:14:"button[cancel]";s:4:"help";s:22:"leaves without saveing";}}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}}}s:4:"rows";i:6;s:4:"cols";i:6;}}','size' => '','style' => '.header { font-weight: bold; font-size: 120%; } +.error_msg { color: red; font-style: italics; }','modified' => '1061729975',); + $templ_data[] = array('name' => 'infolog.customfields.fields','template' => '','lang' => '','group' => '0','version' => '0.9.15.001','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:2:{s:2:"c1";s:2:"th";s:2:"c2";s:7:"row,top";}i:1;a:7:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:3:"Typ";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:5:"label";s:4:"Name";}s:1:"C";a:2:{s:4:"type";s:5:"label";s:5:"label";s:5:"Label";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:20:"Values for selectbox";}s:1:"E";a:2:{s:4:"type";s:5:"label";s:5:"label";s:14:"Length
Rows";}s:1:"F";a:2:{s:4:"type";s:5:"label";s:5:"label";s:5:"Order";}s:1:"G";a:4:{s:4:"type";s:5:"label";s:5:"label";s:6:"Action";s:5:"align";s:6:"center";s:4:"help";s:18:"deletes this field";}}i:2;a:7:{s:1:"A";a:4:{s:4:"type";s:6:"select";s:4:"size";s:3:"All";s:4:"name";s:11:"${row}[typ]";s:4:"help";s:41:"for which types should this field be used";}s:1:"B";a:4:{s:4:"type";s:4:"text";s:4:"size";s:5:"20,32";s:4:"name";s:12:"${row}[name]";s:4:"help";s:83:"the name used internaly (<= 20 chars), changeing it makes existing data unavailible";}s:1:"C";a:4:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"2";i:1;a:4:{s:4:"type";s:4:"text";s:4:"size";s:4:",255";s:4:"name";s:13:"${row}[label]";s:4:"help";s:30:"the text displayed to the user";}i:2;a:2:{s:4:"type";s:5:"label";s:4:"name";s:13:"${row}[label]";}}s:1:"D";a:4:{s:4:"type";s:8:"textarea";s:4:"size";s:4:"2,30";s:4:"name";s:14:"${row}[values]";s:4:"help";s:40:"each value is a line like [=