diff --git a/src/modules/htmlUI/var/templates/library/results.tpl b/src/modules/htmlUI/var/templates/library/results.tpl index 6bcaeb58d..26fe0345a 100644 --- a/src/modules/htmlUI/var/templates/library/results.tpl +++ b/src/modules/htmlUI/var/templates/library/results.tpl @@ -31,12 +31,22 @@ {$i.title|truncate:30:"...":true} {/if} - {$i.creator} + + {$i.creator} + {if $PL->isAvailable($i.id) == false} + (editing: {$PL->isUsedBy($i.id)}) + {/if} + {$i.source} {$i.track_num} {assign var="_duration" value=$i.duration}{niceTime in=$_duration} - {$i.type|lower|capitalize} + {if $PL->isAvailable($i.id) == false} +
+ {$i.type|lower|capitalize}
+ {else} + {$i.type|lower|capitalize} + {/if} diff --git a/src/modules/htmlUI/var/ui_smartyExtensions.inc.php b/src/modules/htmlUI/var/ui_smartyExtensions.inc.php index 72f1cf14a..c835bc0ac 100644 --- a/src/modules/htmlUI/var/ui_smartyExtensions.inc.php +++ b/src/modules/htmlUI/var/ui_smartyExtensions.inc.php @@ -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('   %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 ?> \ No newline at end of file diff --git a/src/modules/storageServer/var/DataEngine.php b/src/modules/storageServer/var/DataEngine.php index a91653b29..8619af751 100644 --- a/src/modules/storageServer/var/DataEngine.php +++ b/src/modules/storageServer/var/DataEngine.php @@ -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'"; }