mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 04:29:28 +01:00
Add print item in infolog context menu and onload print functionality
This commit is contained in:
parent
f4f6fba2c4
commit
d322ee7ec4
@ -1117,6 +1117,12 @@ class infolog_ui
|
||||
'allowOnMultiple' => false,
|
||||
'disableClass' => 'rowNoCloseAll',
|
||||
),
|
||||
'print' => array(
|
||||
'caption' => 'Print',
|
||||
'icon' => 'print',
|
||||
'group' => $group,
|
||||
'onExecute' => 'javaScript:app.infolog.infolog_menu_print'
|
||||
)
|
||||
);
|
||||
++$group; // integration with other apps
|
||||
if ($GLOBALS['egw_info']['user']['apps']['filemanager'])
|
||||
|
@ -64,7 +64,13 @@ app.classes.infolog = AppJS.extend(
|
||||
case 'infolog.index':
|
||||
this.filter_change();
|
||||
break;
|
||||
case 'infolog.edit.print':
|
||||
// Trigger print command if the infolog oppend for printing porpuse
|
||||
var that = this;
|
||||
jQuery('#infolog-edit-print').bind('load',function(){that.infolog_print_preview();});
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
@ -314,7 +320,31 @@ app.classes.infolog = AppJS.extend(
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Open infolog entry for printing
|
||||
*
|
||||
* @param {aciton object} _action
|
||||
* @param {object} _selected
|
||||
*/
|
||||
infolog_menu_print: function(_action, _selected)
|
||||
{
|
||||
var id = _selected[0].id.replace(/^infolog::/g,'');
|
||||
egw_open(id,'infolog','edit',{print:1});
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Trigger print() function to print the current window
|
||||
*
|
||||
*
|
||||
*/
|
||||
infolog_print_preview: function ()
|
||||
{
|
||||
this.egw.message('Printing....');
|
||||
this.egw.window.print();
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user