You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

267 lines
10 KiB

<!--*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*
********************************************************************************/
-->
<!-- BEGIN: main -->
<body onload="init()">
<form action="index.php" method="post" name="templatecreate" onsubmit="return check4null(templatecreate);">
<input type="hidden" name="action">
<input type="hidden" name="mode" value="{MODE}">
<input type="hidden" name="module" value="Users">
<input type="hidden" name="templateid" value="{TEMPLATEID}">
<TABLE WIDTH="100%" CELLPADDING=0 CELLSPACING=0 BORDER=0>
<TR>
<TD ALIGN=LEFT CLASS="moduleTitle hline" NOWRAP> {MOD.LBL_EMAIL_TEMPLATE}{MOD.LBL_COLON}{MOD.LBL_NEW_TEMPLATE}</TD>
</TR>
</TABLE>
<br>
<TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR VALIGN="TOP">
<TD>{MOD.LBL_USE_MERGE_FIELDS_TO_EMAIL_CONTENT}</TD>
</TR>
</TABLE>
<br>
<SCRIPT>
var allOptions = null;
function setAllOptions(inputOptions) {
allOptions = inputOptions;
}
function modifyMergeFieldSelect(cause, effect) {
var selected = cause.options[cause.selectedIndex].value;
var s = allOptions[cause.selectedIndex];
effect.length = s;
for (var i = 0; i < s; i++) {
effect.options[i] = s[i];
}
document.getElementById('mergeFieldValue').value = '';
}
function init() {
var blankOption = new Option('', '');
var allOpts = new Object(0);
var options = null;
options = new Object(11);
options[0] = blankOption;
options[1] = new Option('Contact: First Name', '$contacts_firstname');
options[2] = new Option('Contact: Last Name', '$contacts_lastname');
options[3] = new Option('Contact: Salutation', '$contacts_salutationtype');
options[4] = new Option('Contact: Title', '$contacts_title');
options[5] = new Option('Contact: Email', '$contacts_email');
options[6] = new Option('Contact: Department', '$contacts_department');
options[7] = new Option('Contact: Other Email','$contacts_otheremail');
options[8] = new Option('Contact: Phone', '$contacts_phone');
options[9] = new Option('Contact: Mobile', '$contacts_mobile');
options[10] = new Option('Contact: Currency', '$contacts_currency');
allOpts[1] = options;
options = new Object(19);
options[0] = blankOption;
options[1] = new Option('Lead: First Name', '$leads_firstname');
options[2] = new Option('Lead: Last Name', '$leads_lastname');
options[3] = new Option('Lead: Lead Source', '$leads_leadsource');
options[4] = new Option('Lead: Status', '$leads_leadstatus');
options[5] = new Option('Lead: Rating', '$leads_rating');
options[6] = new Option('Lead: Industry', '$leads_industry');
options[7] = new Option('Lead: Yahoo ID', '$leads_yahooid');
options[8] = new Option('Lead: Email', '$leads_email');
options[9] = new Option('Lead: Annual Revenue', '$leads_annualrevenue');
options[10] = new Option('Lead: Title', '$leads_designation');
options[11] = new Option('Lead: Salutation', '$leads_salutation');
allOpts[2] = options;
options = new Object(19);
options[0] = blankOption;
options[1] = new Option('User: First Name', '$users_first_name');
options[2] = new Option('User: Last Name', '$users_last_name');
options[3] = new Option('User: Title', '$users_title');
options[4] = new Option('User: Department', '$users_department');
options[5] = new Option('User: HomePhone', '$users_phone_home');
options[6] = new Option('User: Mobile', '$users_phone_mobile');
options[7] = new Option('User: Signature', '$users_signature');
options[8] = new Option('User: Email', '$users_email');
options[9] = new Option('User: Street', '$users_address_street');
options[10] = new Option('User: City', '$users_address_city');
options[11] = new Option('User: State', '$users_address_state');
options[11] = new Option('User: Country', '$users_address_country');
options[11] = new Option('User: PostalCode', '$users_address_postalcode');
allOpts[3] = options;
setAllOptions(allOpts);
}
function cancelForm(frm)
{
frm.action.value='listemailtemplates'
frm.submit()
}
</SCRIPT>
<TABLE WIDTH="90%" BORDER=0 CELLSPACING=0 CELLPADDING=5 class="formOuterBorder">
<TR>
<TD class="formSecHeader">
{MOD.LBL_AVAILABLE_MERGE_FIELDS}
</TD>
</TR>
<TR>
<TD>
<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=1>
<TR>
<TD style="font-family:arial;font-size=8pt;">{MOD.LBL_SELECT_FIELD_TYPE}:</TD>
<TD style="font-family:arial;font-size=8pt;">{MOD.LBL_SELECT_FIELD}:</TD>
<TD style="font-family:arial;font-size=8pt;">{MOD.LBL_MERGE_FIELD_VALUE}:</TD>
<tr>
<TD>
<SELECT id="entityType" ONCHANGE="modifyMergeFieldSelect(this, document.getElementById('mergeFieldSelect'));">
<OPTION VALUE="0" selected>
<OPTION VALUE="1">{MOD.LBL_CONTACT_FIELDS}
<OPTION VALUE="2" >{MOD.LBL_LEAD_FIELDS}
<OPTION VALUE="3" >{MOD.LBL_USER_FIELDS}
</SELECT>
</TD>
<TD>
<SELECT id="mergeFieldSelect" onchange="document.getElementById('mergeFieldValue').value=this.options[this.selectedIndex].value;"></SELECT>
</TD>
<TD>
<INPUT TYPE=TEXT id="mergeFieldValue" style="width:140"; VALUE="" SIZE=40>
</TD>
</TR>
<TR>
<TD colspan=3>{MOD.LBL_COPY_AND_PASTE_MERGE_FIELD}</TD>
</TR>
</TABLE>
<SCRIPT>
modifyMergeFieldSelect(document.getElementById('mergeTypeSelect'), document.getElementById('mergeFieldSelect'));
</SCRIPT>
</TD></TR>
</TABLE>
<br>
<div style="width:90%"><font class='required'>{APP.LBL_REQUIRED_SYMBOL}</font>{MOD.LBL_INDICATES_REQUIRED_FIELD}</div>
<table width="90%" border=0 cellspacing=1 cellpadding=5 class="formOuterBorder">
<td class="formSecHeader" colspan=5 nowrap>{MOD.LBL_EMAIL_TEMPLATE_INFORMATION}</td>
<tr><td nowrap class="dataLabel"><font class="required">{APP.LBL_REQUIRED_SYMBOL}</font>{MOD.LBL_FOLDER}
</td><td colspan=4><select name="foldername" tabindex="1" value="{FOLDERNAME}"><option value="Personal">{MOD.LBL_PERSONAL}</option>
<option value="Public" selected>{MOD.LBL_PUBLIC}</option>
</select></td></tr>
<tr ><td nowrap class="dataLabel"><font class="required">{APP.LBL_REQUIRED_SYMBOL}</font>{MOD.LBL_TEMPLATE_NAME}
</td><td colspan=4><input name="templatename" type="text" size=20 maxlength=80 tabindex="3" value="{TEMPLATENAME}"></td></tr>
<tr ><td nowrap class="dataLabel">{MOD.LBL_DESCRIPTION}{MOD.LBL_COLON}
</td><td colspan=4><input name="description" "p8" type="text" size=65 maxlength=255 tabindex="5" value="{DESCRIPTION}"></td></tr>
<tr ><td nowrap class="dataLabel"><font class="required">{APP.LBL_REQUIRED_SYMBOL}</font>{MOD.LBL_SUBJECT}{MOD.LBL_COLON}
</td><td colspan=4><input name="subject" type="text" size=65 maxlength=100 tabindex="6" value="{SUBJECT}"></td></tr>
<tr ><td nowrap valign=top class="dataLabel">{MOD.LBL_BODY}{MOD.LBL_COLON}
</td><td valign=top colspan=4><TEXTAREA wrap="SOFT" NAME="body" ROWS="10" COLS="70" tabindex="7">{BODY}</TEXTAREA></td></tr>
</table>
<br>
<TABLE WIDTH="90%" CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TD NOWRAP><div align="center">
<input type="submit" name="save" value="{APP.LBL_SAVE_BUTTON_LABEL}" class="button" onclick="this.form.action.value='saveemailtemplate'">
<input type="button" name="cancel" value="{APP.LBL_CANCEL_BUTTON_LABEL}" class="button" onclick="cancelForm(this.form)">
</div></TD>
</TR>
</TABLE>
</form>
</body>
</html>
<script>
function trim(s)
{
while (s.substring(0,1) == " ") {
s = s.substring(1, s.length);
}
while (s.substring(s.length-1, s.length) == ' ') {
s = s.substring(0,s.length-1);
}
return s;
}
function check4null(form)
{
var isError = false;
var errorMessage = "";
// Here we decide whether to submit the form.
if (trim(form.templatename.value) =='') {
isError = true;
errorMessage += "\n template name";
form.templatename.focus();
}
if (trim(form.foldername.value) =='') {
isError = true;
errorMessage += "\n folder name";
form.foldername.focus();
}
if (trim(form.subject.value) =='') {
isError = true;
errorMessage += "\n subject";
form.subject.focus();
}
// Here we decide whether to submit the form.
if (isError == true) {
alert("Missing required fields: " + errorMessage);
return false;
}
return true;
}
</script>
<!-- END: main -->