OK i found an answer. I wrote simple zimlet:
Code:
/**
* SIMLE USAGE
* open zimbra page with URL: "http://your_zimbra_domain.com/zimbra/?Search=example_query"
*/
function com_zimbra_search_msg_HandlerObject() {
}
com_zimbra_search_msg_HandlerObject.prototype = new ZmZimletBase();
com_zimbra_search_msg_HandlerObject.prototype.constructor = com_zimbra_search_msg_HandlerObject;
com_zimbra_search_msg_HandlerObject.prototype.init = function() {
this._simpleAppName = this.createApp("Search mail", "zimbraIcon", "Search mail");
};
var old_createApp = com_zimbra_search_msg_HandlerObject.prototype.createApp;
com_zimbra_search_msg_HandlerObject.prototype.createApp = function(label, image, tooltip) {
//old_createApp(label, image, tooltip);
// looking in GET string 'Search' if founded search messages
if(window.location.href.indexOf('Search') > -1) {
this.findMessages(getFromGET('Search'));
}
};
com_zimbra_search_msg_HandlerObject.prototype.findMessages = function(query) {
var _types = new AjxVector();
_types.add("CONV");
var search_messages_callback = new AjxCallback(this, this._search_messages_handler);
appCtxt.getSearchController().search({
query: query,
userText: false,
limit: 9999,
types: _types,
noRender: true,
callback: search_messages_callback
});
};
com_zimbra_search_msg_HandlerObject.prototype._search_messages_handler = function(result) {
var searchResult = result.getResponse();
var items = searchResult.getResults(ZmItem.CONV);
var controller = appCtxt.getCurrentController();
controller.show(searchResult);
return 1;
};
function getFromGET(name) {
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null )
return "";
else
return results[1];
}