<commit_before><%-- 
 * UniTime 3.1 (University Timetabling Application)
 * Copyright (C) 2008, UniTime LLC
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 --%>
<%@ page language="java" autoFlush="true" errorPage="../error.jsp" %>
<%@ page import="org.unitime.commons.web.Web" %>
<%@ page import="org.unitime.timetable.model.Roles" %>
<%@ page import="org.unitime.timetable.model.Department" %>
<%@ page import="org.unitime.timetable.util.Constants" %>
<%@ page import="org.unitime.timetable.webutil.JavascriptFunctions" %>
<%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/tld/struts-tiles.tld" prefix="tiles"%>
<%@ taglib uri="/WEB-INF/tld/timetable.tld" prefix="tt" %>

<SCRIPT language="javascript">
	<!--
		<%= JavascriptFunctions.getJsConfirm(Web.getUser(session)) %>
		
		function confirmDelete() {
			if (jsConfirm!=null && !jsConfirm)
				return true;

			if(confirm('The manager and all associated settings will be deleted. Continue?')) {
				doDel('manager', '');
				return true;
			}
			return false;
		}

		function doDel(type, id) {
			var delType = document.mgrForm.deleteType;
			delType.value = type;
	
			var delId = document.mgrForm.deleteId;
			delId.value = id;
		}
		
	// -->
</SCRIPT>
<tiles:importAttribute />

	<html:form method="post" action="timetableManagerEdit.do">
	<html:hidden name="mgrForm" property="uniqueId" />
	<html:hidden name="mgrForm" property="op1" />
	<html:hidden name="mgrForm" property="isExternalManager" />
	<INPUT type="hidden" name="deleteType" id="deleteType" value="">
	<INPUT type="hidden" name="deleteId" id="deleteId" value="">
	
	<TABLE width="93%" border="0" cellspacing="0" cellpadding="3">
		<TR>
			<TD valign="middle" colspan='2'>
				<tt:section-header>
					<tt:section-title>
						<bean:write name="mgrForm" property="firstName"/>
						<bean:write name="mgrForm" property="middleName"/>
						<bean:write name="mgrForm" property="lastName"/>
					</tt:section-title>
					
					<logic:equal name="mgrForm" property="op1" value="1">
						<html:submit property="op" 
							styleClass="btn" accesskey="S" titleKey="title.insertTimetableManager">
							<bean:message key="button.insertTimetableManager" />
						</html:submit>
					</logic:equal>
					
					<logic:equal name="mgrForm" property="op1" value="2">
						<html:submit property="op" 
							styleClass="btn" accesskey="U" titleKey="title.updateTimetableManager">
							<bean:message key="button.updateTimetableManager" />
						</html:submit>
						<html:submit property="op" 
							styleClass="btn" accesskey="D" titleKey="title.deleteTimetableManager"
							onclick="return (confirmDelete());" >
							<bean:message key="button.deleteTimetableManager" />
						</html:submit>
					</logic:equal>
					
					<html:submit property="op" 
						styleClass="btn" accesskey="B" titleKey="title.backToManagerList">
						<bean:message key="button.backToManagerList" />
					</html:submit>
				</tt:section-header>
			</TD>
		</TR>


		<logic:messagesPresent>
		<TR>
			<TD colspan="2" align="left" class="errorCell">
					<B><U>ERRORS</U></B><BR>
				<BLOCKQUOTE>
				<UL>
				    <html:messages id="error">
				      <LI>
						${error}
				      </LI>
				    </html:messages>
			    </UL>
			    </BLOCKQUOTE>
			</TD>
		</TR>
		</logic:messagesPresent>

		<TR>
			<TD>Academic Session: </TD>
			<TD><%= Web.getUser(session).getAttribute(Constants.ACAD_YRTERM_LABEL_ATTR_NAME) %></TD>
		</TR>
		
		<logic:equal name="mgrForm" property="lookupEnabled" value="false">
			<TR>
				<TD>First Name:</TD>
				<TD>
					<html:text name="mgrForm" property="firstName" size="20" maxlength="20"></html:text>
				</TD>
			</TR>
			<TR>
				<TD>Middle Name:</TD>
				<TD>
					<html:text name="mgrForm" property="middleName" size="20" maxlength="20"></html:text>
				</TD>
			</TR>
			<TR>
				<TD>Last Name:</TD>
				<TD>
					<html:text name="mgrForm" property="lastName" size="30" maxlength="30"></html:text>
				</TD>
			</TR>
		</logic:equal>

		<TR>
			<TD>External ID: </TD>
			<TD>
				<html:text name="mgrForm" property="externalId" size="12" maxlength="12"/>
				&nbsp; <bean:write name="mgrForm" property="lookupResult"/>
				&nbsp;
				<html:hidden name="mgrForm" property="lookupEnabled"/>
				<logic:equal name="mgrForm" property="lookupEnabled" value="true">
					<html:submit property="op" 
						styleClass="btn" accesskey="L" titleKey="title.lookupManager">
						<bean:message key="button.lookupManager" />
					</html:submit>
				</logic:equal>
			</TD>
		</TR>

		<TR>
			<TD>Email Address: </TD>
			<TD>
				<html:text name="mgrForm" property="email" size="30" maxlength="100"/>
			</TD>
		</TR>

		<%--<commit_msg>Timetable Managers 	Add/Edit Timetable Manager: added ability to lookup person using the new People Lookup dialog 		- the previous lookup (expecting the knowledge of manager's external id) disabled<commit_after><%-- 
 * UniTime 3.1 (University Timetabling Application)
 * Copyright (C) 2008, UniTime LLC
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 --%>
<%@ page language="java" autoFlush="true" errorPage="../error.jsp" %>
<%@ page import="org.unitime.commons.web.Web" %>
<%@ page import="org.unitime.timetable.model.Roles" %>
<%@ page import="org.unitime.timetable.model.Department" %>
<%@ page import="org.unitime.timetable.util.Constants" %>
<%@ page import="org.unitime.timetable.webutil.JavascriptFunctions" %>
<%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/tld/struts-tiles.tld" prefix="tiles"%>
<%@ taglib uri="/WEB-INF/tld/timetable.tld" prefix="tt" %>

<SCRIPT language="javascript">
	<!--
		<%= JavascriptFunctions.getJsConfirm(Web.getUser(session)) %>
		
		function confirmDelete() {
			if (jsConfirm!=null && !jsConfirm)
				return true;

			if(confirm('The manager and all associated settings will be deleted. Continue?')) {
				doDel('manager', '');
				return true;
			}
			return false;
		}

		function doDel(type, id) {
			var delType = document.mgrForm.deleteType;
			delType.value = type;
	
			var delId = document.mgrForm.deleteId;
			delId.value = id;
		}
		
	// -->
</SCRIPT>
<tiles:importAttribute />

	<html:form method="post" action="timetableManagerEdit.do">
	<html:hidden name="mgrForm" property="uniqueId" />
	<html:hidden name="mgrForm" property="op1" />
	<html:hidden name="mgrForm" property="isExternalManager" />
	<INPUT type="hidden" name="deleteType" id="deleteType" value="">
	<INPUT type="hidden" name="deleteId" id="deleteId" value="">
	
	<TABLE width="93%" border="0" cellspacing="0" cellpadding="3">
		<TR>
			<TD valign="middle" colspan='2'>
				<tt:section-header>
					<tt:section-title>
						<bean:write name="mgrForm" property="firstName"/>
						<bean:write name="mgrForm" property="middleName"/>
						<bean:write name="mgrForm" property="lastName"/>
					</tt:section-title>
					
					<logic:equal name="mgrForm" property="op1" value="1">
						<html:submit property="op" 
							styleClass="btn" accesskey="S" titleKey="title.insertTimetableManager">
							<bean:message key="button.insertTimetableManager" />
						</html:submit>
					</logic:equal>
					
					<logic:equal name="mgrForm" property="op1" value="2">
						<html:submit property="op" 
							styleClass="btn" accesskey="U" titleKey="title.updateTimetableManager">
							<bean:message key="button.updateTimetableManager" />
						</html:submit>
						<html:submit property="op" 
							styleClass="btn" accesskey="D" titleKey="title.deleteTimetableManager"
							onclick="return (confirmDelete());" >
							<bean:message key="button.deleteTimetableManager" />
						</html:submit>
					</logic:equal>
					
					<html:submit property="op" 
						styleClass="btn" accesskey="B" titleKey="title.backToManagerList">
						<bean:message key="button.backToManagerList" />
					</html:submit>
				</tt:section-header>
			</TD>
		</TR>


		<logic:messagesPresent>
		<TR>
			<TD colspan="2" align="left" class="errorCell">
					<B><U>ERRORS</U></B><BR>
				<BLOCKQUOTE>
				<UL>
				    <html:messages id="error">
				      <LI>
						${error}
				      </LI>
				    </html:messages>
			    </UL>
			    </BLOCKQUOTE>
			</TD>
		</TR>
		</logic:messagesPresent>

		<TR>
			<TD>Academic Session: </TD>
			<TD><%= Web.getUser(session).getAttribute(Constants.ACAD_YRTERM_LABEL_ATTR_NAME) %></TD>
		</TR>
		
		<%-- <logic:equal name="mgrForm" property="lookupEnabled" value="false"> --%>
			<TR>
				<TD>First Name:</TD>
				<TD>
					<html:text name="mgrForm" property="firstName" size="20" maxlength="20" styleId="fname"></html:text>
					<input type='button' value='Lookup' onclick="window.open('user/peopleLookup.jsp?query='+firstName.value+' '+lastName.value,'peopleLookup','width=800,height=600,resizable=no,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no').focus();" style="btn">
				</TD>
			</TR>
			<TR>
				<TD>Middle Name:</TD>
				<TD>
					<html:text name="mgrForm" property="middleName" size="20" maxlength="20" styleId="mname"></html:text>
				</TD>
			</TR>
			<TR>
				<TD>Last Name:</TD>
				<TD>
					<html:text name="mgrForm" property="lastName" size="30" maxlength="30" styleId="lname"></html:text>
				</TD>
			</TR>
		<%-- </logic:equal> --%>

		<TR>
			<TD>External ID: </TD>
			<TD>
				<html:text name="mgrForm" property="externalId" size="12" maxlength="12" styleId="uid"/>
				<%--
				&nbsp; <bean:write name="mgrForm" property="lookupResult"/>
				&nbsp;
				<html:hidden name="mgrForm" property="lookupEnabled"/>
				<logic:equal name="mgrForm" property="lookupEnabled" value="true">
					<html:submit property="op" 
						styleClass="btn" accesskey="L" titleKey="title.lookupManager">
						<bean:message key="button.lookupManager" />
					</html:submit>
				</logic:equal>
				--%>
			</TD>
		</TR>

		<TR>
			<TD>Email Address: </TD>
			<TD>
				<html:text name="mgrForm" property="email" size="30" maxlength="100" styleId="email"/>
			</TD>
		</TR>

		<%--
{'fraction_non_alphanumeric': 0.17288428324697755, 'fraction_numerical': 0.00932642487046632, 'mean_word_length': 3.839531968240702, 'pattern_counts': {'":': 0, '<': 257, '<?xml version=': 0, '>': 255, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6332515', 'n_tokens_mistral': 4737, 'n_tokens_neox': 3829, 'n_words': 825}