do not show an edit link in the Asset Manager unless the asset is editable

This commit is contained in:
Colin Kuskie 2008-11-15 03:38:09 +00:00
parent 4e1df1ba0e
commit 38add7ccbe
3 changed files with 12 additions and 7 deletions

View file

@ -10,6 +10,7 @@
from Add/Edit Field dialogs (SDH Consulting Group).
- fixed #4214: Missing i18n in asset manager
- fixed #8849: More missing i18n
- fixed #4182: Edit links show in asset manager for locked assets
7.6.3
- improved performance of file uploads

View file

@ -288,7 +288,7 @@ sub www_ajaxGetManagerPage {
childCount => $asset->getChildCount,
assetSize => $asset->get( 'assetSize' ),
lockedBy => $asset->get( 'isLockedBy' ),
canEditIfLocked => $asset->canEditIfLocked,
actions => $asset->canEdit && $asset->canEditIfLocked,
);
$fields{ className } = {};

View file

@ -61,10 +61,16 @@ WebGUI.AssetManager.findRow
Format the Edit and More links for the row
*/
WebGUI.AssetManager.formatActions = function ( elCell, oRecord, oColumn, orderNumber ) {
elCell.innerHTML
= '<a href="' + WebGUI.AssetManager.appendToUrl(oRecord.getData( 'url' ), 'func=edit;proceed=manageAssets') + '">' + WebGUI.AssetManager.i18n.get('Asset', 'edit') + '</a>'
+ ' | '
;
if ( oRecord.getData( 'actions' ) ) {
elCell.innerHTML
= '<a href="' + WebGUI.AssetManager.appendToUrl(oRecord.getData( 'url' ), 'func=edit;proceed=manageAssets') + '">'
+ WebGUI.AssetManager.i18n.get('Asset', 'edit') + '</a>'
+ ' | '
;
}
else {
elCell.innerHTML = "";
}
var more = document.createElement( 'a' );
elCell.appendChild( more );
more.appendChild( document.createTextNode( WebGUI.AssetManager.i18n.get('Asset','More' ) ) );
@ -239,8 +245,6 @@ WebGUI.AssetManager.initDataTable = function (o) {
rowsPerPage : 100,
previousPageLinkLabel : WebGUI.AssetManager.i18n.get('WebGUI', '< prev'),
nextPageLinkLabel : WebGUI.AssetManager.i18n.get('WebGUI', 'next >'),
// previousPageLinkLabel : 'fred',
// nextPageLinkLabel : 'barney',
template : "<strong>{CurrentPageReport}</strong> {PreviousPageLink} {PageLinks} {NextPageLink}"
});