From d51c83402df04cd88c4101cafe8a2600c99ce052 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 12 Jan 2015 19:59:25 +0000 Subject: [PATCH] Set default columns --- addressbook/inc/class.addressbook_favorite_portlet.inc.php | 4 ++-- calendar/inc/class.calendar_favorite_portlet.inc.php | 3 ++- home/inc/class.home_favorite_portlet.inc.php | 6 +++--- infolog/inc/class.infolog_favorite_portlet.inc.php | 1 + resources/inc/class.resources_favorite_portlet.inc.php | 2 +- timesheet/inc/class.timesheet_favorite_portlet.inc.php | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/addressbook/inc/class.addressbook_favorite_portlet.inc.php b/addressbook/inc/class.addressbook_favorite_portlet.inc.php index 0ab8c444f7..a0d237fc2b 100644 --- a/addressbook/inc/class.addressbook_favorite_portlet.inc.php +++ b/addressbook/inc/class.addressbook_favorite_portlet.inc.php @@ -40,8 +40,8 @@ class addressbook_favorite_portlet extends home_favorite_portlet 'get_rows' => 'addressbook_favorite_portlet::get_rows', // Use a different template so it can be accessed from client side 'template' => 'addressbook.index.rows', - 'default_cols' => 'type,n_fileas_n_given_n_family_n_family_n_given_org_name_n_family_n_given_n_fileas,'. - 'business_adr_one_countrycode_adr_one_postalcode,tel_work_tel_cell_tel_home,url_email_email_home', + 'default_cols' => 'n_fileas_n_given_n_family_n_family_n_given_org_name_n_family_n_given_n_fileas,'. + 'tel_work_tel_cell_tel_home,url_email_email_home', ); } diff --git a/calendar/inc/class.calendar_favorite_portlet.inc.php b/calendar/inc/class.calendar_favorite_portlet.inc.php index f194fc33d6..3d91a6674b 100644 --- a/calendar/inc/class.calendar_favorite_portlet.inc.php +++ b/calendar/inc/class.calendar_favorite_portlet.inc.php @@ -45,7 +45,7 @@ class calendar_favorite_portlet extends home_favorite_portlet // Use a different template so it can be accessed from client side 'template' => 'calendar.list.rows', // Default to fewer columns - 'default_cols' => 'cal_start_cal_end,cal_title,cal_owner_cal_location' + 'default_cols' => 'cal_start_cal_end,cal_title' ); } $need_reload = true; @@ -143,6 +143,7 @@ class calendar_favorite_portlet extends home_favorite_portlet $total = $ui->get_rows($query, $rows, $readonlys); $ui->owner = $old_owner; unset($GLOBALS['egw_info']['flags']['app_header']); + unset($query['selectcols']); return $total; } diff --git a/home/inc/class.home_favorite_portlet.inc.php b/home/inc/class.home_favorite_portlet.inc.php index 7b077faeab..6a9c6ffedc 100644 --- a/home/inc/class.home_favorite_portlet.inc.php +++ b/home/inc/class.home_favorite_portlet.inc.php @@ -74,8 +74,8 @@ class home_favorite_portlet extends home_portlet if(!$context['favorite']) { // Set initial size to 6x3, default is way too small - $context['width'] = 6; - $context['height'] = 3; + $context['width'] = max($context['width'], 6); + $context['height'] = max($context['height'], 3); $need_reload = true; } @@ -93,12 +93,12 @@ class home_favorite_portlet extends home_portlet if($this->favorite) { $this->nm_settings['favorite'] = $this->context['favorite']; - $this->nm_settings['columnselection_pref'] = "nextmatch-home.{$this->context['id']}"; if(is_array($this->favorite['state'])) { $this->nm_settings += $this->favorite['state']; } } + $this->nm_settings['columnselection_pref'] = "nextmatch-home.{$this->context['id']}"; } public function exec($id = null, etemplate_new &$etemplate = null) { diff --git a/infolog/inc/class.infolog_favorite_portlet.inc.php b/infolog/inc/class.infolog_favorite_portlet.inc.php index 420b6639d6..b207a4a76d 100644 --- a/infolog/inc/class.infolog_favorite_portlet.inc.php +++ b/infolog/inc/class.infolog_favorite_portlet.inc.php @@ -40,6 +40,7 @@ class infolog_favorite_portlet extends home_favorite_portlet 'get_rows' => 'infolog_favorite_portlet::get_rows', // Use a different template so it can be accessed from client side 'template' => 'infolog.home', + 'default_cols' => 'info_type_info_status_info_percent,linked_info_priority_info_subject_info_id_info_des_info_datemodified,info_startdate_info_enddate_info_datecompleted', // Don't overwrite infolog 'session_for' => 'home', 'no_filter2' => true, diff --git a/resources/inc/class.resources_favorite_portlet.inc.php b/resources/inc/class.resources_favorite_portlet.inc.php index 70687fc47a..933311bbe6 100644 --- a/resources/inc/class.resources_favorite_portlet.inc.php +++ b/resources/inc/class.resources_favorite_portlet.inc.php @@ -38,7 +38,7 @@ class resources_favorite_portlet extends home_favorite_portlet // Don't store in session, there's no point 'store_state' => false, // Use a reduced column set for home, user can change if needed - 'default_cols' => 'image,name_short_description', + 'default_cols' => 'image,name_short_description,useable_quantity', 'row_id' => 'res_id', 'row_modified' => 'ts_modified', diff --git a/timesheet/inc/class.timesheet_favorite_portlet.inc.php b/timesheet/inc/class.timesheet_favorite_portlet.inc.php index 4d7b69388a..212f1816c7 100644 --- a/timesheet/inc/class.timesheet_favorite_portlet.inc.php +++ b/timesheet/inc/class.timesheet_favorite_portlet.inc.php @@ -36,7 +36,7 @@ class timesheet_favorite_portlet extends home_favorite_portlet // Use a different template so it can be accessed from client side 'template' => 'timesheet.index.rows', // Use a reduced column set for home, user can change if needed - 'default_cols' => 'ts_id,ts_start,ts_project_pm_id_linked_ts_title,ts_duration_duration', + 'default_cols' => 'ts_start,ts_project_pm_id_linked_ts_title,ts_duration_duration', 'row_id' => 'ts_id', 'row_modified' => 'ts_modified', );