CC-1616, CC-406. If an audio file is 1 hour+ in length the time is now displayed properly in the UI. Active playlists can now be searched/browsed for. (editing:) in the creator field next too the creator of the playlist shows which user is currently modifying the playlist.

This commit is contained in:
naomiaro 2010-09-02 10:12:31 -07:00
parent a674aee3b9
commit aca88f8c48
3 changed files with 25 additions and 8 deletions

View File

@ -31,12 +31,22 @@
{$i.title|truncate:30:"...":true}
{/if}
</td>
<td {include file=$action_handler} style="cursor: pointer">{$i.creator}</td>
<td {include file=$action_handler} style="cursor: pointer">
{$i.creator}
{if $PL->isAvailable($i.id) == false}
(editing: {$PL->isUsedBy($i.id)})
{/if}
</td>
<td {include file=$action_handler} style="cursor: pointer">{$i.source}</td>
<td {include file=$action_handler} style="cursor: pointer" align="center">{$i.track_num}</td>
<td {include file=$action_handler} style="text-align: right; cursor: pointer">{assign var="_duration" value=$i.duration}{niceTime in=$_duration}</td>
<td {include file=$action_handler} style="border: 0; text-align: center; cursor: pointer">
<img src="img/{$i.type|lower}.png" border="0" alt="{$i.type|lower|capitalize}" {* include file="sub/alttext.tpl" *} />
{if $PL->isAvailable($i.id) == false}
<div align="left"><img src="img/ico_lock.png">
<img src="img/{$i.type|lower}.png" border="0" alt="{$i.type|lower|capitalize}" {* include file="sub/alttext.tpl" *} /></div>
{else}
<img src="img/{$i.type|lower}.png" border="0" alt="{$i.type|lower|capitalize}" {* include file="sub/alttext.tpl" *} />
{/if}
</td>
</tr>
<!-- end item -->

View File

@ -130,8 +130,15 @@ function S_niceTime($param)
require_once("../../../storageServer/var/Playlist.php");
$sec = round(Playlist::playlistTimeToSeconds($param['in']));
$formatted = isset($param['all']) && $sec >= 3600 ? strftime('%H:%M:%S', $sec) : strftime('&nbsp;&nbsp;&nbsp;%M:%S', $sec);
$hours = $sec / 3600;
$mins = ($sec % 3600) / 60;
$secs = (($sec % 3600) % 60);
if(intval($hours))
return sprintf("%02d:%02d:%02d", $hours, $mins, $secs);
else
return sprintf("%02d:%02d", $mins, $secs);
return $formatted;
} // fn S_niceTime
?>

View File

@ -433,7 +433,7 @@ class DataEngine {
$fldsPart = "DISTINCT f.gunid, f.ftype, f.id ";
}
$fileCond = "f.state='ready'";
$fileCond = "(f.state='ready' OR f.state='edited')";
if (!is_null($filetype)) {
$fileCond .= " AND f.ftype='$filetype'";
}
@ -442,7 +442,7 @@ class DataEngine {
} else {
$sql = $this->_makeOrSql($fldsPart, $whereArr, $fileCond, false);
}
// the actual values to fetch
if ($orderby) {
$tmpSql = "SELECT to_hex(sq2.gunid)as gunid, sq2.ftype, sq2.id";
@ -466,7 +466,7 @@ class DataEngine {
"ORDER BY ".join(",", $orderBySql)."\n";
$sql = $tmpSql;
}
// Get the number of results
$cnt = $this->_getNumRows($sql);
if (PEAR::isError($cnt)) {
@ -586,7 +586,7 @@ class DataEngine {
$whereArr = $this->_makeWhereArr($conditions);
$fldsPart = "DISTINCT br.object as txt";
$fileCond = "f.state='ready'";
$fileCond = "(f.state='ready' OR f.state='edited')";
if (!is_null($filetype)) {
$fileCond .= " AND f.ftype='$filetype'";
}