mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 09:05:53 +00:00
ENHANCEMENT Current search and current page of asset section are persistent. Fixes the open source ticket #4470 and also a part of #4256 (from r84091)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@89820 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
31e996a56b
commit
9cd09d53f8
@ -334,7 +334,7 @@ HTML;
|
|||||||
$message = sprintf(_t('AssetAdmin.MOVEDX','Moved %s files'),$numFiles);
|
$message = sprintf(_t('AssetAdmin.MOVEDX','Moved %s files'),$numFiles);
|
||||||
|
|
||||||
FormResponse::status_message($message, "good");
|
FormResponse::status_message($message, "good");
|
||||||
FormResponse::add("$('Form_EditForm').getPageFromServer($('Form_EditForm_ID').value)");
|
FormResponse::add("$('Form_EditForm_Files').refresh();");
|
||||||
|
|
||||||
return FormResponse::respond();
|
return FormResponse::respond();
|
||||||
}
|
}
|
||||||
|
@ -48,6 +48,26 @@ class AssetTableField extends ComplexTableField {
|
|||||||
$this->Markable = true;
|
$this->Markable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates the link to this form, including the search pattern
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function CurrentLink() {
|
||||||
|
$link = parent::CurrentLink();
|
||||||
|
|
||||||
|
if(isset($_REQUEST['FileSearch']) ) {
|
||||||
|
if ( strpos($link, '?')!==false )
|
||||||
|
$link .= "&";
|
||||||
|
else
|
||||||
|
$link .= "/?";
|
||||||
|
|
||||||
|
$link .= "FileSearch=".urlencode($_REQUEST['FileSearch']);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $link;
|
||||||
|
}
|
||||||
|
|
||||||
function FieldHolder() {
|
function FieldHolder() {
|
||||||
$ret = parent::FieldHolder();
|
$ret = parent::FieldHolder();
|
||||||
|
|
||||||
|
@ -74,25 +74,20 @@ FileFilterButton.prototype = {
|
|||||||
try {
|
try {
|
||||||
var form = Event.findElement(e, 'form');
|
var form = Event.findElement(e, 'form');
|
||||||
var fieldName = $('FileFieldName').value;
|
var fieldName = $('FileFieldName').value;
|
||||||
var fieldID = form.id + '_' + fieldName;
|
|
||||||
|
|
||||||
var updateURL = form.action + '/field/' + fieldName + '?ajax=1';
|
// build url
|
||||||
|
var updateURL = form.action + '/field/' + fieldName + '?';
|
||||||
for(var index = 0; index < this.inputFields.length; index++) {
|
for(var index = 0; index < this.inputFields.length; index++) {
|
||||||
if(this.inputFields[index].tagName) {
|
if(this.inputFields[index].tagName) {
|
||||||
updateURL += '&' + this.inputFields[index].name + '=' + encodeURIComponent(this.inputFields[index].value);
|
updateURL += '&' + this.inputFields[index].name + '=' + encodeURIComponent(this.inputFields[index].value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updateURL += ($('SecurityID') ? '&SecurityID=' + $('SecurityID').value : '');
|
updateURL += ($('SecurityID') ? '&SecurityID=' + $('SecurityID').value : '');
|
||||||
|
|
||||||
new Ajax.Updater(fieldID, updateURL, {
|
// update the field
|
||||||
onComplete: function() {
|
var field = form.getElementsByClassName('AssetTableField')[0];
|
||||||
Behaviour.apply($(fieldID), true);
|
field.setAttribute('href', updateURL);
|
||||||
},
|
field.refresh();
|
||||||
onFailure: function(response) {
|
|
||||||
errorMessage('Could not filter results: ' + response.responseText );
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} catch(er) {
|
} catch(er) {
|
||||||
errorMessage('Error searching');
|
errorMessage('Error searching');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user