* InfoLog: status filter in index shows now cumulated list of all status translations, if no type is selected (as context menu does too)

This commit is contained in:
Ralf Becker 2012-05-22 17:42:30 +00:00
parent 49ae4f261a
commit 541d7539b9
5 changed files with 47 additions and 39 deletions

View File

@ -24,6 +24,9 @@
.inputFullWidth input {
width: 100%;
}
.selectboxFullWidth select {
width: 100%;
}
/*
* mark input as required

View File

@ -1642,6 +1642,42 @@ class infolog_bo
return $status;
}
/**
* Get status of a single or all types
*
* As status value can have different translations depending on type, we list all translations
*
* @param string $type=null
* @param array &$icons=null on return name of icons
* @return array value => (commaseparated) translations
*/
function get_status($type=null, array &$icons=null)
{
// if filtered by type, show only the stati of the filtered type
if ($type && isset($this->status[$type]))
{
$statis = $icons = $this->status[$type];
}
else // show all stati
{
$statis = $icons = array();
foreach($this->status as $t => $stati)
{
if ($t === 'defaults') continue;
foreach($stati as $val => $label)
{
$statis[$val][$label] = lang($label);
if (!isset($icons[$val])) $icons[$val] = $label;
}
}
foreach($statis as $val => &$labels)
{
$labels = implode(', ', $labels);
}
}
return $statis;
}
/**
* Activates an InfoLog entry (setting it's status from template or inactive depending on the completed percentage)
*

View File

@ -436,18 +436,8 @@ class infolog_ui
//echo "rows=<pre>".print_r($rows,True)."</pre>\n";
// if filtered by type, show only the stati of the filtered type
if ($query['col_filter']['info_type'] && isset($this->bo->status[$query['col_filter']['info_type']]))
{
$rows['sel_options']['info_status'] = $this->bo->status[$query['col_filter']['info_type']];
}
else // show all stati
{
$rows['sel_options']['info_status'] = array();
foreach($this->bo->status as $typ => $stati)
{
if ($typ != 'defaults' && !empty($stati)) $rows['sel_options']['info_status'] += $stati;
}
}
$rows['sel_options']['info_status'] = $this->bo->get_status($query['col_filter']['info_type']);
if ($this->bo->history)
{
$rows['sel_options']['info_status']['deleted'] = 'deleted';
@ -912,28 +902,7 @@ class infolog_ui
);
}
// if filtered by type, show only the stati of the filtered type
if ($query['col_filter']['info_type'] && isset($this->bo->status[$query['col_filter']['info_type']]))
{
$statis = $icons = $this->bo->status[$query['col_filter']['info_type']];
}
else // show all stati
{
$statis = $icons = array();
foreach($this->bo->status as $type => $stati)
{
if ($type == 'defaults') continue;
foreach($stati as $val => $label)
{
$statis[$val][$label] = lang($label);
if (!isset($icons[$val])) $icons[$val] = $label;
}
}
foreach($statis as $val => &$labels)
{
$labels = implode(', ', $labels);
}
}
$statis = $this->bo->get_status($query['col_filter']['info_type'], $icons);
foreach($statis as $type => &$data)
{
$data = array(

File diff suppressed because one or more lines are too long

View File

@ -32,7 +32,7 @@
<row class="th">
<vbox options="0,0">
<nextmatch-filterheader id="info_type" no_lang="1" options="Type"/>
<nextmatch-filterheader align="center" id="info_status" options="Status"/>
<nextmatch-filterheader align="center" id="info_status" options="Status" class="selectboxFullWidth"/>
<nextmatch-sortheader align="right" label="Completed" id="info_percent"/>
</vbox>
<grid width="100%" spacing="0" padding="0">
@ -93,7 +93,7 @@
<description align="right" id="{$row}[info_number]" no_lang="1" class="infoId"/>
</hbox>
<box class="infoDes">
<description id="${row}[info_des]" no_lang="1" activate_links="1"/>
<description id="${row}[info_des]" no_lang="1" options=",,1"/>
</box>
<link-string id="${row}[filelinks]"/>
</vbox>
@ -161,7 +161,7 @@
</hbox>
<hbox options="0,0" class="image16" orient="0">
<button label="Insert in document" id="document[$row_cont[info_id]]" image="etemplate/merge"/>
<image label="Filemanager" src="filemanager/navbar" href="/index.php?menuaction=filemanager.filemanager_ui.index&amp;path=/apps/infolog/$row_cont[info_id]" class="image16"/>
<image label="Filemanager" src="filemanager/navbar" options="/index.php?menuaction=filemanager.filemanager_ui.index&amp;path=/apps/infolog/$row_cont[info_id]" class="image16"/>
</hbox>
</vbox>
</row>