<commit_before><%--

    Copyright (C) 2000 - 2012 Silverpeas

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as
    published by the Free Software Foundation, either version 3 of the
    License, or (at your option) any later version.

    As a special exception to the terms and conditions of version 3.0 of
    the GPL, you may redistribute this Program in connection with Free/Libre
    Open Source Software ("FLOSS") applications as described in Silverpeas's
    FLOSS exception.  You should have recieved a copy of the text describing
    the FLOSS exception, and it is also available here:
    "http://www.silverpeas.org/docs/core/legal/floss_exception.html"

    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 Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

--%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="check.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%
	browseBar.setPath(resource.getString("infoLetter.importEmailsCsv"));
	
	String result = (String) request.getParameter("Result");
	boolean importOk = false;
	if ("OK".equals(result))
	{
		importOk = true;
		%>
		<script language="javascript">
      window.opener.document.refreshEmails.submit();
		</script>
		<%
	}
%>

<% out.println(gef.getLookStyleSheet()); %>
<script type="text/javascript" src="<%=m_context%>/util/javaScript/checkForm.js"></script>
<script type="text/javascript">

function SubmitWithVerif(verifParams)
{
    var csvFilefld = stripInitialWhitespace(document.csvFileForm.file_upload.value);
    var errorMsg = "";

    if (verifParams)
    {
         if (isWhitespace(csvFilefld)) {
            errorMsg = "<% out.print(resource.getString("GML.thefield")+resource.getString("GML.csvFile")+resource.getString("CSV.isRequired")); %>";
         } else {
			var ext = csvFilefld.substring(csvFilefld.length - 4);
	        
    	    if (ext.toLowerCase() != ".csv") {
    			errorMsg = "<% out.print(resource.getString("GML.errorCsvFile")); %>";		
    		}
		}
    }
    if (errorMsg == "")
    {
        document.csvFileForm.submit();
    }
    else
    {
        window.alert(errorMsg);
    }
}

</script>
</head>
<body>

<%
out.println(window.printBefore());
out.println(frame.printBefore());
%>
<center>
<%
out.println(board.printBefore());
%>
<form name="csvFileForm" action="ImportEmailsCsv" method="post" enctype="multipart/form-data">
    <table cellpadding="5" cellspacing="0" border="0" width="100%">
			<% if (importOk) { %>
				<tr>
					<td colspan="2" align="center">
						<%=resource.getString("infoLetter.importEmailsCsvSucceed") %>
					</td>
				</tr>
			<% } else { %>
				<tr>
					<td colspan="2">
						<%=resource.getString("infoLetter.importEmailsCsvWarning") %>
					</td>
				</tr>
        <tr>			
            <td valign="baseline" class="txtlibform">
                <%=resource.getString("GML.csvFile") %> :
            </td>
            <td align="left" valign="baseline">
                <input type="file" name="file_upload" size="50" maxlength="50" value=""/>&nbsp;<img border="0" src="<%=m_context%>/util/icons/mandatoryField.gif" width="5" height="5"/> 
            </td>
        </tr>
        <tr> 
            <td colspan="2">(<img border="0" src="<%=m_context%>/util/icons/mandatoryField.gif" width="5" height="5"/> : <%=resource.getString("GML.requiredField")%>)</td>
        </tr>
		<% } %>
    </table>

<%
out.println(board.printAfter());
%>
</form>
<br/>
		<%
		  ButtonPane bouton = gef.getButtonPane();
			if (importOk)
			{
				  bouton.addButton(gef.getFormButton(resource.getString("GML.close"), "javascript:window.close()", false));
			}
			else
			{
				bouton.addButton(gef.getFormButton(resource.getString("GML.validate"), "javascript:SubmitWithVerif(true)", false));
		      	bouton.addButton(gef.getFormButton(resource.getString("GML.cancel"), "javascript:window.close()", false));
			}
		  out.println(bouton.print());
		%>
</center>
<%
out.println(frame.printAfter());
out.println(window.printAfter());
	%>
</body>
</html><commit_msg>integrating feature #2841 enhancing jsp/importEmailsCsv.jsp<commit_after><%--

    Copyright (C) 2000 - 2012 Silverpeas

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as
    published by the Free Software Foundation, either version 3 of the
    License, or (at your option) any later version.

    As a special exception to the terms and conditions of version 3.0 of
    the GPL, you may redistribute this Program in connection with Free/Libre
    Open Source Software ("FLOSS") applications as described in Silverpeas's
    FLOSS exception.  You should have recieved a copy of the text describing
    the FLOSS exception, and it is also available here:
    "http://www.silverpeas.org/docs/core/legal/floss_exception.html"

    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 Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

--%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.silverpeas.com/tld/viewGenerator" prefix="view"%>
<%@ include file="check.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%
	browseBar.setPath(resource.getString("infoLetter.importEmailsCsv"));
	
	String result = request.getParameter("Result");
	boolean importOk = false;
	if ("OK".equals(result)) {
		importOk = true;
		%>
		<script language="javascript">
      window.opener.document.refreshEmails.submit();
		</script>
		<%
	}
%>

<view:looknfeel/>
<script type="text/javascript" src="<%=m_context%>/util/javaScript/checkForm.js"></script>
<script type="text/javascript">
function SubmitWithVerif(verifParams) {
    var csvFilefld = stripInitialWhitespace(document.csvFileForm.file_upload.value);
    var errorMsg = "";

    if (verifParams) {
         if (isWhitespace(csvFilefld)) {
            errorMsg = "<% out.print(resource.getString("GML.thefield")+resource.getString("GML.csvFile")+resource.getString("CSV.isRequired")); %>";
         } else {
			var ext = csvFilefld.substring(csvFilefld.length - 4);
    	    if (ext.toLowerCase() != ".csv") {
    			errorMsg = "<% out.print(resource.getString("GML.errorCsvFile")); %>";		
    		}
		}
    }
    if (errorMsg == "") {
        document.csvFileForm.submit();
    } else {
        window.alert(errorMsg);
    }
}
</script>
</head>
<body>
<%
out.println(window.printBefore());
%>
<view:frame>
<view:board>
<form name="csvFileForm" action="ImportEmailsCsv" method="post" enctype="multipart/form-data">
    
			<% if (importOk) { %>
			<div class="inlineMessage-ok">
				<%=resource.getString("infoLetter.importEmailsCsvSucceed") %>
			</div>
			<% } else { %>
				<div class="inlineMessage">
						<%=resource.getString("infoLetter.importEmailsCsvWarning") %>
				</div>
	<table cellpadding="5" cellspacing="0" border="0" width="100%">
        <tr>			
            <td class="txtlibform"><%=resource.getString("GML.csvFile") %> :</td>
            <td>
                <input type="file" name="file_upload" size="50" maxlength="50" value=""/>&nbsp;<img border="0" src="<%=m_context%>/util/icons/mandatoryField.gif" width="5" height="5"/> 
            </td>
        </tr>
        <tr> 
            <td colspan="2"><img border="0" src="<%=m_context%>/util/icons/mandatoryField.gif" width="5" height="5"/> : <%=resource.getString("GML.requiredField")%></td>
        </tr>
		<% } %>
    </table>
</form>
</view:board>
		<%
		  ButtonPane bouton = gef.getButtonPane();
			if (importOk) {
				bouton.addButton(gef.getFormButton(resource.getString("GML.close"), "javascript:window.close()", false));
			} else {
				bouton.addButton(gef.getFormButton(resource.getString("GML.validate"), "javascript:SubmitWithVerif(true)", false));
		      	bouton.addButton(gef.getFormButton(resource.getString("GML.cancel"), "javascript:window.close()", false));
			}
		  out.println(bouton.print());
		%>
</view:frame>
<%
out.println(window.printAfter());
%>
</body>
</html>
{'fraction_non_alphanumeric': 0.16052425226839923, 'fraction_numerical': 0.010081774392293043, 'mean_word_length': 3.5551020408163265, 'pattern_counts': {'":': 0, '<': 129, '<?xml version=': 0, '>': 129, 'https://': 0, 'lorem ipsum': 0, 'www.': 9, 'xml': 2}, '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': '2018030', 'n_tokens_mistral': 3151, 'n_tokens_neox': 2837, 'n_words': 629}