Skip to content

Commit

Permalink
Added the sendmessage pages and events inside the Marketing plug in.
Browse files Browse the repository at this point in the history
Created a ContactMailing object that extend contacts and move the methods sendMessage and eventSendMessage to that new class
could not full test as local setup can't send emails with sendmail
Overal it seems to work.
  • Loading branch information
philfree committed Jan 8, 2012
1 parent 8976566 commit 8d0aeb9
Show file tree
Hide file tree
Showing 13 changed files with 293 additions and 102 deletions.
29 changes: 17 additions & 12 deletions plugin/Marketing.conf.inc.php
Expand Up @@ -24,17 +24,19 @@
);

// Classes
include_once("plugin/Marketing/AutoResponder.class.php");
include_once("plugin/Marketing/AutoResponderEmail.class.php");
include_once("plugin/Marketing/class/ContactMailing.class.php");
include_once("plugin/Marketing/class/AutoResponder.class.php");
include_once("plugin/Marketing/class/AutoResponderEmail.class.php");
//include_once("plugin/Marketing/WebForm.class.php");
include_once("plugin/Marketing/WebFormField.class.php");
include_once("plugin/Marketing/WebFormUserField.class.php");
include_once("plugin/Marketing/WebFormUser.class.php");
include_once("plugin/Marketing/class/WebFormField.class.php");
include_once("plugin/Marketing/class/WebFormUserField.class.php");
include_once("plugin/Marketing/class/WebFormUser.class.php");
// blocks
include_once("plugin/Marketing/BlockMarketing.class.php");
include_once("plugin/Marketing/BlockWebFormList.class.php");
include_once("plugin/Marketing/BlockEmailTemplateList.class.php");

include_once("plugin/Marketing/class/BlockMarketing.class.php");
include_once("plugin/Marketing/class/BlockWebFormList.class.php");
include_once("plugin/Marketing/class/BlockEmailTemplateList.class.php");

define('OFUZ_LOG_RUN_PLUGIN_MARKETING', true);

$cfg_plugin_mkt_path = "/Tab/Marketing/";

Expand All @@ -46,7 +48,7 @@
$GLOBALS['cfg_plugin_eventmultiple_placement']['contacts'][] =
Array('name'=> 'Send a Message ',
'confirm' => '',
'event' => 'do_Contacts->eventGetForMailMerge',
'event' => 'ContactMailing->eventGetForMailMerge',
'action' => '');


Expand All @@ -73,7 +75,9 @@
"AutoResponder",
"AutoResponderEmail",
"AutoResponderEmailEdit",
"settings_auto_responder_edit"
"settings_auto_responder_edit",
"SendMessage",
"SaveTemplate"
))
->setMenu($plugin_marketing_menu)
->setDefaultPage("MEmailTemplate");
Expand All @@ -86,6 +90,7 @@
// $GLOBALS['cfg_submenu_placement']['WebForm'] = $plugin_marketing_menu;
// $GLOBALS['cfg_submenu_placement']['WebFormURL'] = $plugin_marketing_menu;
// $GLOBALS['cfg_submenu_placement']['MEmailTemplate'] = $plugin_marketing_menu;

$GLOBALS['cfg_submenu_placement']['SendMessage'] = '';
$GLOBALS['cfg_submenu_placement']['SaveTemplate'] = '';

?>
11 changes: 1 addition & 10 deletions plugin/Marketing/MEmailTemplate.php
Expand Up @@ -42,15 +42,10 @@ function fnInsertMergeField(merge){
}
?>
<div class="banner50 pad020 text16 fuscia_text"><?php echo _('Email Templates'); ?></div>
<div class="contentfull">
<div class="messageshadow">
<div class="messages">
<?php
$msg = new Message();
//echo $msg->getMessage('web form creator instruction');
?>
</div>
</div><br />
<div align="right">
<form id="select_merge_field">
<select name="merge_fields" onchange="fnInsertMergeField(this)">
Expand Down Expand Up @@ -88,9 +83,5 @@ function fnInsertMergeField(merge){
echo '<div align="right">'.$do_user_email_teml->form->getFormFooter(_('Create')).'</div>';
}
?>
</div>

<div class="solidline"></div>
</td></tr></table>
<div class="spacerblock_40"></div>
<div class="layout_footer"></div>
</div>
@@ -1,26 +1,15 @@
<?php
/** Ofuz Open Source version is released under the GNU Affero General Public License, please read the full license at: http://www.gnu.org/licenses/agpl-3.0.html **/
// Copyright 2008 - 2010 all rights reserved, SQLFusion LLC, info@sqlfusion.com
// Copyright 2008 - 2012 all rights reserved, SQLFusion LLC, info@sqlfusion.com
/** Ofuz Open Source version is released under the GNU Affero General Public License, please read the full license at: http://www.gnu.org/licenses/agpl-3.0.html **/

/*
* contact_sendemail_save_tempatle.php
*
* Copyright 2009 SQLFusion LLC, Philippe Lewicki <philippe@sqlfusion.com>
* Copyright 2009-2012 SQLFusion LLC, Philippe Lewicki <philippe@sqlfusion.com>
*
*/


include_once('config.php');
$pageTitle = _('Ofuz :: Contacts Send Email Save Template');
$Author = 'SQLFusion LLC';
$Keywords = 'Keywords for search engine';
$Description = 'Description for search engine';
$background_color = 'white';

include_once('includes/ofuz_check_access.script.inc.php');
include_once('includes/header.inc.php');

$do_message = new EmailTemplateUser("blank");

if ($_GET['idtemplate']) {
Expand All @@ -29,29 +18,18 @@

?>


<table class="layout_columns"><tr><td class="layout_lmargin"></td><td>
<div class="layout_content">


<?php $thistab = 'Contacts'; include_once('includes/ofuz_navtabs.php');

$do_breadcrumb = new Breadcrumb(); $do_breadcrumb->getBreadcrumbs(); ?>
<div class="grayline1"></div>
<div class="spacerblock_20"></div>
<div class="mainheader">
<div class="pad20">
<span class="headline11"><?php echo _('Save Template');?></span>
</div>
</div>
<div class="contentfull">
<div class="messageshadow">
<div class="messages">
<?php
$msg = new Message();
echo $msg->getMessage('save as template');
echo "<br>".$_SESSION['in_page_message'] ;
$_SESSION['in_page_message'] = '';
$message = new Message();
$message->getMessage("save as template");
$message->displayMessage();
if (!empty($_SESSION['in_page_message'])) {
$in_page_message = new Message();
$in_page_message->setContent($_SESSION['in_page_message'] );
$in_page_message->displayMessage();
$_SESSION['in_page_message'] = '';
}
?>
</div>
</div>
Expand Down Expand Up @@ -96,11 +74,3 @@

}
?>



</div>
<div class="spacerblock_40"></div>
<div class="layout_footer"></div>
</div>
</td><td class="layout_rmargin"></td></tr></table>
44 changes: 5 additions & 39 deletions contact_sendemail.php → plugin/Marketing/SendMessage.php
@@ -1,16 +1,6 @@
<?php
/** Ofuz Open Source version is released under the GNU Affero General Public License, please read the full license at: http://www.gnu.org/licenses/agpl-3.0.html **/
// Copyright 2008 - 2010 all rights reserved, SQLFusion LLC, info@sqlfusion.com
/** Ofuz Open Source version is released under the GNU Affero General Public License, please read the full license at: http://www.gnu.org/licenses/agpl-3.0.html **/

$pageTitle = 'Ofuz :: Contacts Send Email';
$Author = 'SQLFusion LLC';
$Keywords = 'Keywords for search engine';
$Description = 'Description for search engine';
$background_color = 'white';
include_once('config.php');
include_once('includes/ofuz_check_access.script.inc.php');
include_once('includes/header.inc.php');
// Copyright 2008 - 2012 all rights reserved, SQLFusion LLC, info@sqlfusion.com

$do_message = new EmailTemplateUser("blank");
$do_message->sessionPersistent("do_message", "contacts.php", OFUZ_TTL);
Expand All @@ -20,6 +10,7 @@
$do_note_draft->sessionPersistent("do_message_draft","index.php",OFUZ_TTL);
}
?>

<script type="text/javascript">
//<![CDATA[
function fnInsertMergeField(merge){
Expand Down Expand Up @@ -108,23 +99,7 @@ function discardDraft(id){
});
//]]>
</script>
<table class="layout_columns"><tr><td class="layout_lmargin"></td><td>
<div class="layout_content">


<?php $thistab = 'Contacts'; include_once('includes/ofuz_navtabs.php');

$do_breadcrumb = new Breadcrumb(); $do_breadcrumb->getBreadcrumbs(); ?>
<div class="grayline1"></div>
<div class="spacerblock_20"></div>
<div class="mainheader">
<div class="pad20">
<span class="headline11"><?php echo _('Send Message'); ?></span>
</div>
</div>
<div class="contentfull">
<div align="right">
<?php echo _('Select an email template');
<?php echo _('Select an email template');
echo '<form id="select_email_template"><select name="idtemplate" onchange=\'$("#select_email_template").submit();\'><option value="0"></option><option value="0">'._('New Template').'</option>';
$template_list = new EmailTemplateUser();
$template_list->query('SELECT * FROM '.$template_list->getTable().' WHERE iduser='.$_SESSION['do_User']->iduser.' AND name <> \'\'');
Expand Down Expand Up @@ -190,9 +165,9 @@ function discardDraft(id){
$do_message->form->setLevel(920);
$do_message->form->addEventAction('do_message_draft->eventDeleteSavedDraft', 900);//added to delete the draft
//$do_message->form->addEventAction('do_message->eventPrepareSaving', 920);
$do_message->form->addEventAction('do_Contacts->eventSendMessage', 2340);
$do_message->form->addEventAction('do_ContactMailing->eventSendMessage', 2340);
$do_message->form->addEventAction('mydb.gotoPage', 2430);
$do_message->form->goto = 'contact_sendemail_save_template.php';
$do_message->form->goto = $GLOBALS['cfg_plugin_mkt_path'].'SaveTemplate';
$do_message->form->type = 'contact_email';//Message Draft Type
$do_message->iduser = $_SESSION['do_User']->iduser;
$do_message->setFields("emailtemplate_user");
Expand Down Expand Up @@ -234,12 +209,3 @@ function discardDraft(id){
// echo '<br/><div align="right">'._('Or').' '.$do_message->name.' '.$do_message->form->getFormFooter(_('Save as template')).'</div>';
// }
?>
</div>
<div class="spacerblock_40"></div>
<div class="layout_footer"></div>
</div>
</td><td class="layout_rmargin"></td></tr></table>

</body>
</html>

File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 8d0aeb9

Please sign in to comment.