--- ./dashboard.php.orig	2014-08-02 20:03:06.000000000 +0200
+++ ./dashboard.php	2014-08-02 20:44:28.000000000 +0200
@@ -58,6 +58,7 @@
 $dashconf['severity'] = null;
 $dashconf['extAck'] = 0;
 $dashconf['filterEnable'] = CProfile::get('web.dashconf.filter.enable', 0);
+$dashconf['limit'] = CProfile::get('web.dashboard.widget.lastiss.count', DEFAULT_LATEST_ISSUES_CNT);
 if ($dashconf['filterEnable'] == 1) {
 	// groups
 	$dashconf['grpswitch'] = CProfile::get('web.dashconf.groups.grpswitch', 0);
@@ -180,6 +181,29 @@
 			$submenu = array();
 			make_refresh_menu('mainpage', $_REQUEST['favref'], $_REQUEST['favcnt'], null, $menu, $submenu);
 
+			if (str_in_array($_REQUEST['favref'], array('hat_lastiss'))) {
+				$_REQUEST['favcnt'] = CProfile::get('web.dashboard.widget.'.$widgetName.'.count', DEFAULT_LATEST_ISSUES_CNT);
+				make_lastiss_cnt_menu('mainpage', $_REQUEST['favref'], $_REQUEST['favcnt'], null, $menu, $submenu);
+			}
+
+			echo 'page_menu["menu_'.$_REQUEST['favref'].'"] = '.zbx_jsvalue($menu['menu_'.$_REQUEST['favref']]).';';
+		}
+	}
+
+	if ($_REQUEST['favobj'] == 'set_limit') {
+		if (str_in_array($_REQUEST['favref'], array('hat_lastiss'))) {
+			$widgetName = substr($_REQUEST['favref'], 4);
+			CProfile::update('web.dashboard.widget.'.$widgetName.'.count', $_REQUEST['favcnt'], PROFILE_TYPE_INT);
+
+			$menu = array();
+			$submenu = array();
+
+			$_REQUEST['favcnt'] = CProfile::get('web.dashboard.widget.'.$widgetName.'.rf_rate', 60);
+			make_refresh_menu('mainpage', $_REQUEST['favref'], $_REQUEST['favcnt'], null, $menu, $submenu);
+
+			$_REQUEST['favcnt'] = CProfile::get('web.dashboard.widget.'.$widgetName.'.count', DEFAULT_LATEST_ISSUES_CNT);
+			make_lastiss_cnt_menu('mainpage', $_REQUEST['favref'], $_REQUEST['favcnt'], null, $menu, $submenu);
+
 			echo 'page_menu["menu_'.$_REQUEST['favref'].'"] = '.zbx_jsvalue($menu['menu_'.$_REQUEST['favref']]).';';
 		}
 	}
@@ -286,6 +310,7 @@
 make_refresh_menu('mainpage', 'hat_hoststat', CProfile::get('web.dashboard.widget.hoststat.rf_rate', 60), null, $menu, $submenu);
 make_refresh_menu('mainpage', 'hat_stszbx', CProfile::get('web.dashboard.widget.stszbx.rf_rate', 60), null, $menu, $submenu);
 make_refresh_menu('mainpage', 'hat_lastiss', CProfile::get('web.dashboard.widget.lastiss.rf_rate', 60), null, $menu, $submenu);
+make_lastiss_cnt_menu('mainpage', 'hat_lastiss', $dashconf['limit'], null, $menu, $submenu);
 make_refresh_menu('mainpage', 'hat_webovr', CProfile::get('web.dashboard.widget.webovr.rf_rate', 60), null, $menu, $submenu);
 make_refresh_menu('mainpage', 'hat_dscvry', CProfile::get('web.dashboard.widget.dscvry.rf_rate', 60), null, $menu, $submenu);
 
@@ -394,7 +419,7 @@
 // last issues
 $refresh_menu = get_icon('menu', array('menu' => 'hat_lastiss'));
 $lastiss = new CUIWidget('hat_lastiss', new CSpan(_('Loading...'), 'textcolorstyles'), CProfile::get('web.dashboard.widget.lastiss.state', 1));
-$lastiss->setHeader(_n('Last %1$d issue', 'Last %1$d issues', DEFAULT_LATEST_ISSUES_CNT), array($refresh_menu));
+$lastiss->setHeader(new CDiv(_n('Last %1$d issue', 'Last %1$d issues', $dashconf['limit']), null, 'hat_lastiss_header'), array($refresh_menu));
 $lastiss->setFooter(new CDiv(SPACE, 'textwhite', 'hat_lastiss_footer'));
 $col = CProfile::get('web.dashboard.widget.lastiss.col', '1');
 $row = CProfile::get('web.dashboard.widget.lastiss.row', '3');
--- ./include/func.inc.php.orig	2014-08-02 20:12:48.000000000 +0200
+++ ./include/func.inc.php	2014-08-02 20:45:38.000000000 +0200
@@ -1969,6 +1969,24 @@
 	$submenu['menu_'.$dollid][] = array();
 }
 
+function make_lastiss_cnt_menu($pmid, $dollid, $cur_limit, $params = null, &$menu, &$submenu) {
+	$limits = array('10' => 10, '20' => 20, '50' => 50, '100' => 100);
+	$title = _('Number of issues');
+
+	$menu['menu_'.$dollid][] = array($title, null, null, array('outer' => array('pum_oheader'), 'inner' => array('pum_iheader')));
+
+	foreach ($limits as $key => $value) {
+		$menu['menu_'.$dollid][] = array(
+			$key,
+			'javascript: setLimit('.zbx_jsvalue($pmid).', '.zbx_jsvalue($dollid).', '.$value.', '.zbx_jsvalue($params).');'.
+			'void(0);',
+			null,
+			array('outer' => ($value == $cur_limit) ? 'pum_b_submenu' : 'pum_o_submenu', 'inner' => array('pum_i_submenu')
+		));
+	}
+	$submenu['menu_'.$dollid][] = array();
+}
+
 /************* MATH *************/
 function bcfloor($number) {
 	if (strpos($number, '.') !== false) {
--- ./js/main.js.orig	2014-08-02 20:29:58.000000000 +0200
+++ ./js/main.js	2014-08-02 20:46:33.000000000 +0200
@@ -1119,6 +1119,22 @@
 	send_params(params);
 }
 
+function setLimit(pmasterid, dollid, limit, params) {
+	if (typeof(Ajax) == 'undefined') {
+		throw('Prototype.js lib is required!');
+	}
+
+	if (typeof(params) == 'undefined' || is_null(params)) {
+		params = {};
+	}
+	params['pmasterid'] = pmasterid;
+	params['favobj'] = 'set_limit';
+	params['favref'] = dollid;
+	params['favcnt'] = limit;
+
+	send_params(params);
+}
+
 function switch_mute(icon) {
 	deselectAll();
 	var sound_state = switchElementsClass(icon, 'iconmute', 'iconsound');
