[Vtigercrm-commits] [vtiger-commits] r7555 - in /vtigercrm/trunk: Smarty/templates/ComposeEmail.tpl include/fckeditor/fckeditor.js modules/Emails/EditView.php modules/Users/TemplateMerge.php modules/Users/lookupemailtemplates.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Tue Jun 27 04:14:30 EDT 2006
Author: richie
Date: Tue Jun 27 02:14:22 2006
New Revision: 7555
Log:
Template Merge Integrated
Modified:
vtigercrm/trunk/Smarty/templates/ComposeEmail.tpl
vtigercrm/trunk/include/fckeditor/fckeditor.js
vtigercrm/trunk/modules/Emails/EditView.php
vtigercrm/trunk/modules/Users/TemplateMerge.php
vtigercrm/trunk/modules/Users/lookupemailtemplates.php
Modified: vtigercrm/trunk/Smarty/templates/ComposeEmail.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/ComposeEmail.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/ComposeEmail.tpl Tue Jun 27 02:14:22 2006
@@ -20,6 +20,7 @@
<link REL="SHORTCUT ICON" HREF="include/images/vtigercrm_icon.ico">
<style type="text/css">@import url("themes/{$THEME}/style.css");</style>
<script language="javascript" type="text/javascript" src="include/scriptaculous/prototype.js"></script>
+<script type="text/javascript" src="include/fckeditor/fckeditor.js"></script>
</head>
<body marginheight="0" marginwidth="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<form name="EditView" method="POST" ENCTYPE="multipart/form-data" action="index.php">
@@ -107,12 +108,11 @@
</tr>
{elseif $elements.2.0 eq 'description'}
<tr>
- <td colspan="3" align="center" height="320">
- <input id="description___Config" value="" style="display: none;" type="hidden"><iframe id="description___Frame" src="include/fckeditor/editor/fckeditor.html?InstanceName=description&Toolbar=Default" frameborder="no" height="370" scrolling="no" width="100%"></iframe>
+ <td colspan="3" align="center" valign="top" height="320">
{if $WEBMAIL eq 'true'}
<textarea style="display: none;" class="detailedViewTextBox" name="description" cols="90" rows="8">{$DESCRIPTION}</textarea>
{else}
- <textarea style="display: none;" class="detailedViewTextBox" name="description" cols="90" rows="8">{$elements.3.0}</textarea> {/if}
+ <textarea style="display: none;" class="detailedViewTextBox" id="description" name="description" cols="90" rows="16">{$elements.3.0}</textarea> {/if}
</td>
</tr>
{/if}
@@ -182,6 +182,13 @@
}
);
}
+
+</script>
+<script type="text/javascript" defer="1">
+var oFCKeditor = null;
+oFCKeditor = new FCKeditor( "description" ,"100%","370") ;
+oFCKeditor.BasePath = "include/fckeditor/" ;
+oFCKeditor.ReplaceTextarea();
</script>
{/literal}
</html>
Modified: vtigercrm/trunk/include/fckeditor/fckeditor.js
==============================================================================
--- vtigercrm/trunk/include/fckeditor/fckeditor.js (original)
+++ vtigercrm/trunk/include/fckeditor/fckeditor.js Tue Jun 27 02:14:22 2006
@@ -27,7 +27,7 @@
// Properties
this.InstanceName = instanceName ;
this.Width = width || '100%' ;
- this.Height = height || '200' ;
+ this.Height = height || '370' ;
this.ToolbarSet = toolbarSet || 'Default' ;
this.Value = value || '' ;
this.BasePath = '/fckeditor/' ;
@@ -71,6 +71,11 @@
FCKeditor.prototype.ReplaceTextarea = function()
{
+ if(document.getElementById('description___Config') != null)
+ {
+ document.getElementById('description___Config').parentNode.removeChild(document.getElementById('description___Config'));
+ document.getElementById('description___Frame').parentNode.removeChild(document.getElementById('description___Frame'));
+ }
if ( !this.CheckBrowser || this._IsCompatibleBrowser() )
{
// We must check the elements firstly using the Id and then the name.
@@ -189,4 +194,4 @@
text = text.replace(/'/g, "'") ;
return text ;
-}
+}
Modified: vtigercrm/trunk/modules/Emails/EditView.php
==============================================================================
--- vtigercrm/trunk/modules/Emails/EditView.php (original)
+++ vtigercrm/trunk/modules/Emails/EditView.php Tue Jun 27 02:14:22 2006
@@ -153,17 +153,9 @@
$disp_view = getView($focus->mode);
$details = getBlocks($currentModule,$disp_view,$mode,$focus->column_fields);
-if(isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !='')
-{
- $templatedetails = getTemplateDetails($_REQUEST['templateid']);
- $details['Email Information'][2][0][3][0] = $templatedetails[2]; //Subject
- $details['Email Information'][3][0][3][0] = nl2br($templatedetails[1]); //Body
-}
$smarty->assign("BLOCKS",$details['Email Information']);
$smarty->assign("MODULE",$currentModule);
$smarty->assign("SINGLE_MOD",$app_strings['Email']);
-//Display the FCKEditor or not? -- configure $FCKEDITOR_DISPLAY in config.php
-$smarty->assign("FCKEDITOR_DISPLAY",$FCKEDITOR_DISPLAY);
//needed when creating a new email with default values passed in
@@ -248,24 +240,9 @@
$smarty->assign("FILENAME", $focus->filename);
}
-if(isset($focus->parent_type) && $focus->parent_type != "")
-{
- $change_parent_button = "<input title='".$app_strings['LBL_CHANGE_BUTTON_TITLE']."' tabindex='2' accessKey='".$app_strings['LBL_CHANGE_BUTTON_KEY']."' type='button' class='button' value='".$app_strings['LBL_CHANGE_BUTTON_LABEL']."' name='button' LANGUAGE=javascript onclick='return window.open(\"index.php?module=\"+ document.EditView.parent_type.value + \"&action=Popup&html=Popup_picker&form=TasksEditView\",\"test\",\"width=600,height=400,resizable=1,scrollbars=1\");'>";
- $smarty->assign("CHANGE_PARENT_BUTTON", $change_parent_button);
-}
-
$check_button = Button_Check($module);
$smarty->assign("CHECK", $check_button);
$smarty->display("ComposeEmail.tpl");
?>
-<script type="text/javascript" defer="1">
-addOnloadEvent(function () {
- var oFCKeditor = null;
- oFCKeditor = new FCKeditor("description") ;
- oFCKeditor.BasePath = "include/fckeditor/" ;
- oFCKeditor.Height = 500;
- oFCKeditor.Width = "100%";
- oFCKeditor.ReplaceTextarea();
-});
-</script>
+
Modified: vtigercrm/trunk/modules/Users/TemplateMerge.php
==============================================================================
--- vtigercrm/trunk/modules/Users/TemplateMerge.php (original)
+++ vtigercrm/trunk/modules/Users/TemplateMerge.php Tue Jun 27 02:14:22 2006
@@ -8,18 +8,23 @@
* All Rights Reserved.
*
********************************************************************************/
-require_once('include/utils/UserInfoUtil.php');
-require_once('modules/Emails/templates/testemailtemplateusage.php');
-$replacedString = substituteTokens("".$_REQUEST["templatename"],$globals);
+require_once('include/utils/CommonUtils.php');
+if(isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !='')
+{
+ $templatedetails = getTemplateDetails($_REQUEST['templateid']);
+ //$details['Email Information'][2][0][3][0] = $templatedetails[2]; //Subject
+ //$details['Email Information'][3][0][3][0] = nl2br($templatedetails[1]); //Body
+}
?>
<form name="frmrepstr">
+<input type="hidden" name="subject" value="<?echo $templatedetails[2];?>"></input>
<textarea name="repstr" style="visibility:hidden">
-<?php echo chop($replacedString); ?>
+<?php echo nl2br($templatedetails[1]); ?>
</textarea>
</form>
<script language="javascript">
-opener.document.EditView.description.value=document.frmrepstr.repstr.value
-//opener.oFCKeditor.ReplaceTextarea() ;
-window.close()
+window.opener.document.getElementById('subject').value = window.document.frmrepstr.subject.value
+window.opener.document.getElementById('description').value = window.document.frmrepstr.repstr.value
+opener.oFCKeditor.ReplaceTextarea();
+window.close();
</script>
-
Modified: vtigercrm/trunk/modules/Users/lookupemailtemplates.php
==============================================================================
--- vtigercrm/trunk/modules/Users/lookupemailtemplates.php (original)
+++ vtigercrm/trunk/modules/Users/lookupemailtemplates.php Tue Jun 27 02:14:22 2006
@@ -56,8 +56,7 @@
<script>
function submittemplate(templateid)
{
- window.opener.location.href = window.opener.location.href +'&templateid='+templateid;
- self.close();
+ window.document.location.href = 'index.php?module=Users&action=UsersAjax&file=TemplateMerge&templateid='+templateid;
}
</script>
</html>
More information about the vtigercrm-commits
mailing list