- Hide buyable & prize fields from import|export

- Hide customfields column if no customfields defined
- Fix export all breaks list view
This commit is contained in:
Nathan Gray 2013-01-02 17:32:30 +00:00
parent c09a9aa61c
commit 5564217b0c
6 changed files with 21 additions and 7 deletions

View File

@ -85,8 +85,11 @@ class resources_bo
* Cornelius Weiss <egw@von-und-zu-weiss.de>
*/
function get_rows($query,&$rows,&$readonlys)
{
if(!$query['csv_export'])
{
$GLOBALS['egw']->session->appsession('session_data','resources_index_nm',$query);
}
if ($query['store_state']) // request to store state in session and filter in prefs?
{
egw_cache::setSession('resources',$query['store_state'],$query);
@ -245,6 +248,11 @@ class resources_bo
}
$rows[$num]['admin'] = $this->acl->get_cat_admin($resource['cat_id']);
}
if(!config::get_customfields('resources'))
{
$rows['no_customfields'] = true;
}
return $nr;
}

View File

@ -40,6 +40,7 @@ class resources_export_csv implements importexport_iface_export_plugin {
'filter2' => -3, // Accessories & resources
'csv_export' => true, // so get_rows method _can_ produce different content or not store state in the session
); // all
unset($query['store_state']);
$bo->get_rows($query,$selection,$readonlys);
} else {
$selection = explode(',',$options['selection']);

View File

@ -18,6 +18,10 @@ class resources_wizard_export_csv extends importexport_wizard_basic_export_csv
// Field mapping
$this->export_fields = resources_bo::$field2label;
// Fields deprecated, but still in DB
unset($this->export_fields['buyable']);
unset($this->export_fields['prize']);
// Custom fields
$custom = config::get_customfields('resources', true);
foreach($custom as $name => $data) {

View File

@ -36,8 +36,9 @@ class resources_wizard_import_csv extends importexport_wizard_basic_import_csv
'location' => lang('Location'),
'storage_info' => lang('Storage'),
'bookable' => lang('Bookable'),
'buyable' => lang('Buyable'),
'prize' => lang('Prize'),
// Deprecated, but still in DB
//'buyable' => lang('Buyable'),
//'prize' => lang('Prize'),
'long_description' => lang('Long description'),
'inventory_number' => lang('inventory number'),
'accessory_of' => lang('Accessory of')

File diff suppressed because one or more lines are too long

View File

@ -22,7 +22,7 @@
<column/>
<column/>
<column/>
<column/>
<column disabled="@no_customfields"/>
<column width="5%"/>
</columns>
<rows>
@ -54,7 +54,7 @@
</hbox>
</row>
<row class="nmr $row_cont[class]" valign="top">
<button align="center" id="${row}[picture_thumb]" onclick="window.open(egw::link('/index.php','menuaction=resources.resources_ui.show&amp;res_id=$row_cont[res_id]'),'','dependent=yes,width=800,height=600,location=no,menubar=no,toolbar=no,scrollbars=yes,status=yes');return false;" image="$row_cont[picture_thumb]"/>
<button align="center" id="${row}[picture_thumb]" onclick="window.open(egw::link('/index.php','menuaction=resources.resources_ui.show&amp;res_id=$row_cont[res_id]'),'','dependent=yes,width=800,height=600,location=no,menubar=no,toolbar=no,scrollbars=yes,status=yes');return false;" image="$row_cont[picture_thumb]" class="thumb"/>
<vbox>
<description id="${row}[name]" no_lang="1"/>
<description id="${row}[short_description]" no_lang="1"/>