mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
Modernized resource selection
- optional extra columns: description, location, storage info - using column selection and nm sort-headers - give selectbox more space 20% now
This commit is contained in:
parent
8b01210dd7
commit
84519f0575
@ -49,7 +49,6 @@ class bo_resources
|
||||
function get_rows($query,&$rows,&$readonlys)
|
||||
{
|
||||
if ($this->debug) _debug_array($query);
|
||||
$query['search'] = $query['search'] ? $query['search'] : '*';
|
||||
$criteria = array('name' => $query['search'], 'short_description' => $query['search'], 'inventory_number' => $query['search']);
|
||||
$read_onlys = 'res_id,name,short_description,quantity,useable,bookable,buyable,cat_id,location,storage_info';
|
||||
|
||||
|
@ -331,10 +331,6 @@ class ui_resources
|
||||
*/
|
||||
function select($content='')
|
||||
{
|
||||
if (!is_object($GLOBALS['phpgw']->js))
|
||||
{
|
||||
$GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript');
|
||||
}
|
||||
$GLOBALS['phpgw']->js->set_onload("copyOptions('exec[resources][selectbox]');");
|
||||
|
||||
$GLOBALS['egw_info']['flags']['java_script'] .= "<script LANGUAGE=\"JavaScript\">
|
||||
@ -438,20 +434,23 @@ class ui_resources
|
||||
window.close();
|
||||
}</script>";
|
||||
|
||||
$content['nm']['header_left'] = 'resources.resource_select.header';
|
||||
$content['nm']['show_bookable'] = true;
|
||||
$content['nm']['get_rows'] = 'resources.bo_resources.get_rows';
|
||||
$content['nm']['no_filter'] = False;
|
||||
$content['nm']['filter_label'] = 'Category';
|
||||
$content['nm']['filter_help'] = lang('Select a category'); // is this used???
|
||||
$content['nm']['options-filter']= array(''=>lang('all categories'))+(array)$this->bo->acl->get_cats(EGW_ACL_READ);
|
||||
$content['nm']['no_filter2'] = true;
|
||||
$content['nm']['filter_no_lang'] = true;
|
||||
$content['nm']['no_cat'] = true;
|
||||
$content['nm']['rows']['js_id'] = 1;
|
||||
$content['nm']['no_columnselection'] = true;
|
||||
$content['nm']['csv_fields'] = false;
|
||||
|
||||
if (!is_array($content))
|
||||
{
|
||||
$content['nm'] = array(
|
||||
'header_left' => 'resources.resource_select.header',
|
||||
'show_bookable' => true,
|
||||
'get_rows' => 'resources.bo_resources.get_rows',
|
||||
'filter_label' => 'Category',
|
||||
'filter_help' => lang('Select a category'),
|
||||
'options-filter'=> array(''=>lang('all categories'))+(array)$this->bo->acl->get_cats(EGW_ACL_READ),
|
||||
'no_filter2' => true,
|
||||
'filter_no_lang'=> true,
|
||||
'no_cat' => true,
|
||||
'rows' => array('js_id' => 1),
|
||||
'csv_fields' => false,
|
||||
'default_cols' => 'name,cat_id,quantity', // I columns to use if there's no user or default pref
|
||||
);
|
||||
}
|
||||
$sel_options = array();
|
||||
$no_button = array();
|
||||
$this->tmpl->read('resources.resource_select');
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,4 +1,6 @@
|
||||
.buttonbox {vertical-align: top;}
|
||||
.tdAppbox {width: 100%;}
|
||||
.big {font-weight: bold;}
|
||||
.sel select {width: 100%;}
|
||||
.sel select {width: 100%;}
|
||||
.selTable { float: left; width: 80%; }
|
||||
.selSelection { float: right; width: 20%; }
|
62
resources/templates/default/resource_select.xet
Normal file
62
resources/templates/default/resource_select.xet
Normal file
@ -0,0 +1,62 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- $Id$ -->
|
||||
<overlay>
|
||||
<template id="resources.resource_select.row" template="" lang="" group="0" version="1.7.002">
|
||||
<grid width="100%" class="selTable">
|
||||
<columns>
|
||||
<column/>
|
||||
<column/>
|
||||
<column/>
|
||||
<column/>
|
||||
<column/>
|
||||
<column/>
|
||||
<column width="3%"/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row class="th">
|
||||
<nextmatch-sortheader label="Name" id="name"/>
|
||||
<nextmatch-sortheader label="Category" id="cat_id"/>
|
||||
<nextmatch-sortheader label="Description" id="short_description"/>
|
||||
<nextmatch-sortheader label="Location" id="location"/>
|
||||
<nextmatch-sortheader label="Storage information" id="storage_info"/>
|
||||
<nextmatch-header label="Quantity" id="quantity"/>
|
||||
<description/>
|
||||
</row>
|
||||
<row class="row">
|
||||
<description id="${row}[name]" no_lang="1"/>
|
||||
<menulist>
|
||||
<menupopup type="select-cat" id="${row}[cat_id]" readonly="true"/>
|
||||
</menulist>
|
||||
<description id="${row}[short_description]"/>
|
||||
<description id="${row}[location]"/>
|
||||
<description id="${row}[storage_info]"/>
|
||||
<hbox no_lang="1" rows="1" cols="3" options="0,0">
|
||||
<int options="1,,2" id="${row}[default_qty]"/>
|
||||
<int label="of" class="leftPad5" id="${row}[useable]" readonly="true"/>
|
||||
</hbox>
|
||||
<button image="select" onclick="addOption('$row_cont[name]',$row_cont[res_id],this.id,$row_cont[useable]); return false;" needed="1" label="select resource" id="${row}"/>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
<vbox rows="3" cols="1" align="right" class="selSelection">
|
||||
<hbox align="center" rows="1" cols="1" class="th">
|
||||
<description value="Selection" class="big"/>
|
||||
<button image="delete" label="clear selection" onclick="removeSelectedOptions(); return false;" needed="1" align="right"/>
|
||||
</hbox>
|
||||
<listbox rows="13+" id="selectbox" span="0" class="sel" no_lang="1"/>
|
||||
<button label="Close" align="center" onclick="oneLineSubmit();window.close();"/>
|
||||
</vbox>
|
||||
</template>
|
||||
<template id="resources.resource_select" template="" lang="" group="0" version="1.7.001">
|
||||
<grid width="100%">
|
||||
<columns>
|
||||
<column/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<nextmatch options="resources.resource_select.row" id="nm"/>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
</template>
|
||||
</overlay>
|
Loading…
Reference in New Issue
Block a user