$package("itsm.change")
/**  
 * @fileOverview 变更统计主函数
 * @author tan
 * @version 1.0  
 */  
 /**  
 * @author tan  
 * @constructor 变更统计主函数
 * @description 变更统计主函数
 * @date 2011-05-13
 * @since version 1.0 
 */

itsm.change.changeStats=function(){
	return {
		/**
		 * @description 变更统计
		 */
		countChange:function(){
			var url = 'change!countChange.action';
			$.post(url,'queryDTO.creator='+userName,function(res){
				$("#countAllChanges").text("[ "+res.countAllChanges+" ]");
				$("#myNotResolveChange").text("[ "+res.myNotResolveChange+" ]");
				$("#myNotPassChange").text("[ "+res.myNotPassChange+" ]");
				$("#myPassChange").text("[ "+res.myPassChange+" ]");
				$("#myCloseChange").text("[ "+res.myCloseChange+" ]");
				$("#notResolveChange").text("[ "+res.notResolveChange+" ]");
				$("#closeChange").text("[ "+res.closeChange+" ]");
				$("#notAssigneeChange").text("[ "+res.notAssigneeChange+" ]");
				$("#myTask_change").text("["+res.myTask+"]");
				$("#myGroupTask_change").text("["+res.myGroupTask+"]");
			});
		},
		/**
		 * @description 变更统计搜索
		 */
		changeCountSearch:function(type,creator){
			if ($('#itsmMainTab').tabs('exists',i18n['title_changeManage']))
			{
				$('#itsmMainTab').tabs('select',i18n['title_changeManage'])
				var _url = 'change!findPagerChange.action?queryDTO.countQuery='+type+'&queryDTO.creator='+creator;	
				$('#changeGrid').jqGrid('setGridParam',{page:1,url:_url}).trigger('reloadGrid');
				
			}else{
				itsm.common.utility.tabUtility.reOpenTab('../pages/change/change.jsp?queryDTO.countQuery='+type+'&queryDTO.creator='+creator+'&random='+Math.random()*10+1,i18n['title_changeManage']);
			}
		}
	}
	
}();