Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 2 commits
  • 27 files changed
  • 0 commit comments
  • 1 contributor
Commits on Jan 08, 2012
@philfree Added the sendmessage pages and events inside the Marketing plug in.
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.
8d0aeb9
@philfree Add menu hooks for the index / Dashboard, tasks page and plugin setti…
…ngs addon

add the Add on to the default setting page
add a yellow background to sub menus in timesheet and daily notes
Created the menu in x_ofuz_hooks_plugin.conf.inc.php

now need to write some documentation
f98233b
Showing with 561 additions and 443 deletions.
  1. +1 −220 class/Contact.class.php
  2. +2 −2 contacts.php
  3. +14 −11 daily_notes.php
  4. +15 −2 enable_plugin.php
  5. +1 −1  includes/ofuz.conf.inc.php
  6. +8 −1 includes/ofuz_theme_default.css
  7. +49 −19 includes/x_ofuz_hooks_plugin.conf.inc.php
  8. +12 −8 index.php
  9. +17 −12 plugin/Marketing.conf.inc.php
  10. +1 −10 plugin/Marketing/MEmailTemplate.php
  11. +11 −41 contact_sendemail_save_template.php → plugin/Marketing/SaveTemplate.php
  12. +5 −39 contact_sendemail.php → plugin/Marketing/SendMessage.php
  13. 0  plugin/Marketing/{ → class}/AutoResponder.class.php
  14. 0  plugin/Marketing/{ → class}/AutoResponderEmail.class.php
  15. 0  plugin/Marketing/{ → class}/BlockEmailTemplateList.class.php
  16. 0  plugin/Marketing/{ → class}/BlockMarketing.class.php
  17. 0  plugin/Marketing/{ → class}/BlockWebFormList.class.php
  18. +259 −0 plugin/Marketing/class/ContactMailing.class.php
  19. 0  plugin/Marketing/{ → class}/WebFormField.class.php
  20. 0  plugin/Marketing/{ → class}/WebFormUser.class.php
  21. 0  plugin/Marketing/{ → class}/WebFormUserField.class.php
  22. +3 −14 settings_info.php
  23. +15 −3 settings_plugin.php
  24. +5 −39 tasks.php
  25. +119 −0 tasks_by_project.php
  26. +8 −5 tasks_completed.php
  27. +16 −16 timesheet.php
View
221 class/Contact.class.php
@@ -1077,226 +1077,7 @@ function eventAddTagMultiple(EventControler $event_controler) {
$_SESSION['tag_refresh_now'] = true;
}
- /**
- * eventGetForMailMerge
- * Get the list of contact for mailmerge
- * load in the current contact object the list of
- * selected contacts from the contacts.php
- * Then redirect to the contact_sendemail.php.
- */
- function eventGetForMailMerge(EventControler $event_controler) {
-
- $idcontacts = $event_controler->getParam("ck");
- $sql_in = "(";
- foreach($idcontacts as $idcontact) {
- $sql_in .= $idcontact.",";
- }
- $sql_in = substr($sql_in, 0, -1);
- $sql_in .= ")";
- $tag_search = $this->getSearchTags();
- if(is_array($tag_search) && count($tag_search > 0)){
- $_SESSION['searched_tags'] = $tag_search ;
- }
-
- $this->clearSearch();
- $this->setSqlQuery("SELECT * FROM contact WHERE idcontact in ".$sql_in);
- $event_controler->goto = "contact_sendemail.php";
- $event_controler->setDisplayNext(new Display("contact_sendemail.php"));
- }
-
- /**
- * eventSendMessage
- * This will send a message to one or multiple users.
- * @todo Problem with the getBodyText(true) it returns some bad encoding and no newline, could also be the problem in the template it self...
- */
-
- function eventSendMessage(EventControler $event_controler) {
- $this->setLog("\n eventSendMessage (".date("Y/m/d H:i:s").")");
- if ($event_controler->send == _('Send Mailing')) {
- $email_template = $_SESSION['do_message'];
- $email_template->setApplyFieldFormating(false);
- $this->setLog("\n EmailTemplate id: ".$email_template->getPrimarykeyValue());
- $this->setLog("\n SQL:".$this->getSqlQuery());
- $this->query();
- $this->setLog("\n ".$this->getNumRows()." contacts to send the message");
-
- while ($this->next()) {
- set_time_limit(500);
- if($event_controler->unsubtag == 'on'){ // set unsubscribe auto-responder list
- $values_contact = $this->getValues();
- $tag_values = array("flag"=>"unsubscribe_autoresponder","idtag"=>$event_controler->idtag);
- $values = array_merge($values_contact,$tag_values);
- $message = $this->sendMessage($email_template, $values);
- }else{
- $message = $this->sendMessage($email_template, $this->getValues());
- }
- if ($this->last_message_sent) {
- //$do_contact_notes->iduser = $_SESSION['do_User']->iduser;
- $do_contact_notes = new ContactNotes();
- $do_contact_notes->iduser = $_SESSION['do_User']->iduser;
- //$do_contact_notes->note = '<b>'.$message->getSubject().'</b><br/>'.$message->getBodyText(true);
- //->getTemplateBodyHtml();
- $note_text = preg_replace('/^(.*?)<hr>.*$/','$1',str_replace("\n",'',$message->getBodyHtml(true)));
- $do_contact_notes->note = '<b>'.$message->getSubject().'</b><br/>'.$note_text;
- $do_contact_notes->date_added = date("Y-m-d");
- $do_contact_notes->idcontact = $this->getPrimaryKeyValue();
- $do_contact_notes->add();
-
-
- /*
- * Recording the messages sent by User
- */
- $msg_con = new sqlQuery($this->getDbCon());
- $sql_msg_check = "SELECT * FROM `message_usage` WHERE `iduser` = ".$_SESSION['do_User']->iduser." AND `date_sent` = '".date("Y-m-d")."'";
- $msg_con->query($sql_msg_check);
- if($msg_con->getNumRows()) {
- $msg_con->fetch();
- $sql_con_update = new sqlQuery($this->getDbCon());
- $sql_msg_update = "UPDATE `message_usage` SET `num_msg_sent` = num_msg_sent+1 WHERE `idmessage_usage` = ".$msg_con->getData("idmessage_usage");
- $sql_con_update->query($sql_msg_update);
- } else {
- $sql_con_ins = new sqlQuery($this->getDbCon());
- $sql_msg_ins = "INSERT INTO `message_usage`(iduser,date_sent,num_msg_sent) VALUES(".$_SESSION['do_User']->iduser.",'".date("Y-m-d")."',1)";
- $sql_con_ins->query($sql_msg_ins);
- }
-
-
-
- }
- }
- } else { $event_controler->goto = "contacts.php"; }
- $this->clearSearch();
- $this->free();
- }
-
- /**
- * eventSendNote
- * This event is triggered when adding a note in a contact
- * It will send a copy of the note the contact.
- */
-
- function eventSendNote(EventControler $event_controler) {
- $send_note = $event_controler->fields['send_email'];
- $this->setLog("eventSendNote starting (".date("Y/m/d H:i:s").")");
- $this->setLog("do we send a message:".$send_note);
- if ($send_note == "y") {
- $template = new EmailTemplate();
- $template->setSubject("{Ofuz} Message: ".substr($event_controler->fields['note'], 0, 70)."...")
- ->setMessage($event_controler->fields['note']);
- $this->sendMessage($template);
- }
- }
-
- /**
- * sendMessage
- * This abstract the message sending so we use a general function
- * that will send email or facebook or twitter based on the user
- * preferences and settings.
- * its possible to generate an EmailTemplate on the fly with no records in the DB
- * Here is an exemple:
- * <code php>
- * $do_template = new EmailTemplate();
- * $do_template->senderemail = "philippe@sqlfusion.com";
- * $do_template->sendername = "Philippe Lewicki";
- * $do_template->subject = "This is an example";
- * $do_template->bodytext = "This is the content of the sample message";
- * $do_template->bodyhtml = nl2br($do_template->bodytext);
- * </code>
- *
- * An other example more OO / stylish
- * <code php>
- * $do_template = new EmailTemplate();
- * $do_template->setFrom("phil@sqlfusion.com", "Philippe Lewicki")
- * ->setSubject("This is an example")
- * ->setMessage("This is the content of the sample message");
- * </code>
- * setFrom() is optional, if not provided it takes the do_User data
- *
- * Then send the message with: $contact->sendMessage($do_template);
- *
- * If you used a saved EmailTemplate like
- * $do_template = new EmailTemplate("my template in email template table");
- * and want the sender to be the currently signed in user, make sure the senderemail field
- * is empty.
- *
- * @param $message an EmailTemplate object.
- * @param $values an array with values to merge, optional.
- *
- */
- function sendMessage($template, $values=Array()) {
- if (!is_object($template)) { return false; }
- if (empty($values)) { $values = $this->getValues(); }
- $this->last_message_sent = false;
- $do_contact_email = $this->getChildContactEmail();
- $email_to = $do_contact_email->getDefaultEmail();
- $this->setLog("\n Sending message to:".$email_to);
- $contact_link = '<a href="/Contact/'.$this->idcontact.'">'.$this->firstname.' '.$this->lastname.'</a>';
- if (strlen($email_to) > 4) {
- if ($this->email_optout != 'y') {
- $emailer = new Ofuz_Emailer('UTF-8');
- if (strlen($template->senderemail) == 0) {
- $template->setFrom($_SESSION['do_User']->email, $_SESSION['do_User']->getFullName());
- }
- $emailer->setEmailTemplate($template);
- $emailer->mergeArrayWithFooter($values);
- $emailer->addTo($email_to);
- $this->last_message_sent = true;
- return $emailer->send();
- } else {
- $_SESSION['in_page_message'] .= _("<br>".$contact_link." has opt-out and will not receive this email");
- }
- } elseif (strlen($this->tw_user_id) > 0) {
- // send direct message using twitter api.
- try{
- $do_twitter = new OfuzTwitter();
- $tw_config = $do_twitter->getTwitterConfig();
- $serialized_token = $do_twitter->getAccessToken();
- $token = unserialize($serialized_token);
- $ofuz_twitter = new Ofuz_Service_Twitter($token->getParam('user_id'), $tw_config, $token);
- $followers = $ofuz_twitter->userFollowers(false);
- if (is_object($followers) && count($followers->user) > 0) {
- foreach ($followers->user as $follower) {
- if ($follower->id == $this->tw_user_id) {
- $merge = new MergeString();
- $message = $merge->withArray($template->bodytext, $values);
- $ofuz_twitter->directMessageNew($this->tw_user_id, $message);
- $do_contact_notes = new ContactNotes();
- $do_contact_notes->iduser = $_SESSION['do_User']->iduser;
- $do_contact_notes->note = $message;
- $do_contact_notes->date_added = date('Y-m-d');
- $do_contact_notes->idcontact = $this->idcontact;
- $do_contact_notes->add();
- return true;
- }
- }
- }
- $_SESSION['in_page_message'] .= _("<br>Notification can not be sent to ".$contact_link);
- }catch(Exception $e){
- $_SESSION['in_page_message'] .= _("<br>Notification can not be sent to ".$contact_link);
- }
- } elseif ($this->fb_userid && $_SESSION["do_User"]->global_fb_connected) {
- // send message using facebook api.
- include_once 'facebook_client/facebook.php';
- include_once 'class/OfuzFacebook.class.php';
- $facebook = new Facebook(FACEBOOK_API_KEY, FACEBOOK_APP_SECRET);
- try{
- $msg = _(' has sent the following message using ofuz').'<br />';
- $msg .= '<b>'.$template->subject.'</b><br/>'.$template->bodyhtml;
- $facebook->api_client->notifications_send($this->fb_userid, $msg, 'user_to_user');
- //$this->last_message_sent = true;
- }catch(Exception $e){
- $_SESSION['in_page_message'] .= _("<br>Notification can not be sent to ".$contact_link);
- }
- } else {
- $_SESSION['in_page_message'] .= _("<br>".$contact_link." doesn't have a valid email address, facebook account, or twitter id.");
- }
-
- if ($this->last_message_sent) {
- return true;
- } else {
- return false;
- }
- }
+
function eventdelContactTagById(EventControler $event_controler){
$do_tag =new Tag();
View
4 contacts.php
@@ -335,14 +335,14 @@ function loadContacts() {
<?php
foreach ($GLOBALS['cfg_plugin_eventmultiple_placement']['contacts'] as $event_multiple_plugin) {
if (strlen($event_multiple_plugin['event'])>0) {
- echo "\n<br>"._('or ').'<span class="redlink"><a href="#" onclick="eventActionMultiple(\''.$event_multiple_plugin['event'].'\',\''._($event_multiple_plugin['confirm']).'\');return false;">'._($event_multiple_plugin['name']).'</a></span> ';
+ echo "\n<br>"._('or ').'<span class="redlink"><a href="#" onclick="eventActionMultiple(\''.$event_multiple_plugin['event'].'\',\''.$event_multiple_plugin['confirm'].'\');return false;">'._($event_multiple_plugin['name']).'</a></span> ';
} elseif (strlen($event_multiple_plugin['action'])>0) {
echo "\n<br>"._('or ').
'<span class="redlink">
<a href="#" onclick="actionMultiple(\''.
$event_multiple_plugin['action'].
'\',\''.
- _($event_multiple_plugin['confirm']).
+ $event_multiple_plugin['confirm'].
'\');return false;">'._($event_multiple_plugin['name']).'</a></span> ';
}
View
25 daily_notes.php
@@ -33,14 +33,17 @@
$msg->getMessageFromContext("daily notes");
echo $msg->displayMessage();
?>
- <table class="mainheader pad20" width="100%">
- <tr>
- <td><span class="headline14"><?php echo _('Daily Notes & Discussion');?></span></td>
- <td align="right">&nbsp;&nbsp;&nbsp;&nbsp;<a href="index.php"><?php echo _('Work Feed'); ?></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="daily_notes.php"><?php echo _('Notes & Discussion'); ?></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="timesheet.php"><?php echo _('Timesheet'); ?></a></td>
- </tr>
- </table>
-
-
+ <div class="mainheader">
+ <div class="pad20">
+ <span class="headline14"><?php echo _('Daily Notes & Discussion');?></span>
+ <?php
+ if (is_object($GLOBALS['cfg_submenu_placement']['daily_notes'] ) ) {
+ echo $GLOBALS['cfg_submenu_placement']['daily_notes']->getMenu();
+ }
+ ?>
+ </div>
+ </div>
+ <div class="sub_action_menu">
<?php
if(!is_object($_SESSION['adm_project'])){
@@ -93,7 +96,7 @@
$e_user_search_false->addParam('goto',$_SERVER['PHP_SELF']);
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".$e_user_search_false->getLink(_("All Users"));
}
- echo '<div class="dottedline"></div>
+ echo '</div><div class="dottedline"></div>
<div class="headline_fuscia">'._('Projects').'</div>
';
while($_SESSION['adm_project']->next()){
@@ -139,7 +142,7 @@
}
}
}
-
+/** lets hide this for now we will move it to its own page.
$do_adm_contacts = new ContactNotes();
$do_adm_contact_notes = new ContactNotes();
$do_contact = new Contact();
@@ -164,7 +167,7 @@
}
}
}
-
+ **/
?>
<div class="dottedline"></div>
View
17 enable_plugin.php
@@ -29,8 +29,21 @@
<div class="settingsbottom"></div></div>
</td><td class="layout_rcolumn">
<div class="banner60 pad020 text32"><?php echo _('Add-On'); ?></div>
- <div class="banner50 pad020 text16 fuscia_text"><?php echo _('Add-On Settings'); ?></div>
+ <div class="mainheader">
+ <div class="pad20">
+ <span class="headline14"><?php
+ echo _('Enable Add-On');
+ ?></span>
+ <?php
+ if (is_object($GLOBALS['cfg_submenu_placement']['settings_plugin'] ) ) {
+ echo $GLOBALS['cfg_submenu_placement']['settings_plugin']->getMenu();
+ }
+ ?>
+ </div>
+ </div>
+
<div class="contentfull">
+ <div class="spacerblock_20"></div>
<?php
if($_SESSION['in_page_message'] != ''){
echo '<div style="margin-left:0px;">';
@@ -54,7 +67,7 @@
}*/
- echo '<b>'._('Add-On').':</b><br/><br/>';
+ // echo '<b>'._('Add-On').':</b><br/><br/>';
$do_plugin_enable = new PluginEnable();
$do_dynamic_button = new DynamicButton();
View
2  includes/ofuz.conf.inc.php
@@ -160,7 +160,7 @@
include_once("class/OfuzBeanstalkd.class.php");
- define('RADRIA_LOG_RUN_OFUZ', false);
+ define('RADRIA_LOG_RUN_OFUZ', true);
define('OFUZ_LOG_RUN_TAG', false);
define('OFUZ_LOG_RUN_CONTACT', false);
define('OFUZ_LOG_RUN_WEBFORM', false);
View
9 includes/ofuz_theme_default.css
@@ -182,7 +182,7 @@ h2.headline { padding: 20px 0; position: relative; padding: 20px 0; font-size:
.left_text { text-align: left; }
.right_text { text-align: right; }
-.message { position: relative; margin: 2px 5px 5px 0; padding: 20px 20px 12px 20px; background-color: #fff6c1; background-image: url("/images/welcomebannerbg.png"); background-repeat: repeat-x; border-top: solid 1px #ededed; border-bottom: solid 2px #ededed; }
+.message { position: relative; margin: 2px 20px 5px 0; padding: 20px 20px 12px 20px; background-color: #fff6c1; background-image: url("/images/welcomebannerbg.png"); background-repeat: repeat-x; border-top: solid 1px #ededed; border-bottom: solid 2px #ededed; }
.messageshadow { margin: 2px 0; background-color: #ffffcc; border-right: solid 2px #b28c6e; border-bottom: solid 2px #b28c6e; margin-right: 20px; }
.messageshadow_95 { width: 95%; margin: 2px 0; background-color: #ffffcc; border-right: solid 2px #b28c6e; border-bottom: solid 2px #b28c6e; }
@@ -253,6 +253,13 @@ background-color: #135e91;
font-size: 12px;
}
+.sub_action_menu {
+ padding: 6px 20px;
+ margin: 0px 20px 0px 0px;
+ background-color: #ffffcc;
+ border-top: solid 1px #ffa500;
+}
+
.text_black { color: #000000; }
.text_fuscia { color: #c52687; }
.text_gray { color: #666666; }
View
68 includes/x_ofuz_hooks_plugin.conf.inc.php
@@ -9,8 +9,8 @@
* @author SQLFusion's Dream Team <info@sqlfusion.com>
* @package OfuzCore
* @license GNU Affero General Public License
- * @version 0.6
- * @date 2010-09-03
+ * @version 1.0
+ * @date 2012-01-07
* @since 0.6
*/
@@ -72,6 +72,26 @@
'action' => 'merge_automated.php')
)
);
+
+ $GLOBALS['cfg_submenu_placement']['index'] = new SubMenu();
+ $GLOBALS['cfg_submenu_placement']['index']->addMenuItem(_('Work Feed'), "index.php")
+ ->addMenuItem(_('Notes & Discussion'), "daily_notes.php")
+ ->addMenuItem(_('Timesheet'), "timesheet.php");
+ $GLOBALS['cfg_submenu_placement']['daily_notes'] = new SubMenu();
+ $GLOBALS['cfg_submenu_placement']['daily_notes']->addMenuItem(_('Work Feed'), "index.php")
+ ->addMenuItem(_('Notes & Discussion'), "daily_notes.php")
+ ->addMenuItem(_('Timesheet'), "timesheet.php");
+ $GLOBALS['cfg_submenu_placement']['timesheet'] = new SubMenu();
+ $GLOBALS['cfg_submenu_placement']['timesheet']->addMenuItem(_('Work Feed'), "index.php")
+ ->addMenuItem(_('Notes & Discussion'), "daily_notes.php")
+ ->addMenuItem(_('Timesheet'), "timesheet.php");
+ $GLOBALS['cfg_submenu_placement']['tasks'] = new SubMenu();
+ $GLOBALS['cfg_submenu_placement']['tasks']->addMenuItem(_('Task By Projects'), "tasks_by_project.php")
+ ->addMenuItem(_('Task By Date'), "tasks.php")
+ ->addMenuItem(_('Completed'), "tasks_completed.php") ;
+ $GLOBALS['cfg_submenu_placement']['settings_plugin'] = new SubMenu();
+ $GLOBALS['cfg_submenu_placement']['settings_plugin']->addMenuItem(_('Add-On'), "enable_plugin.php")
+ ->addMenuItem(_('Detail List'), "settings_plugin.php");
// Core plugin names
$GLOBALS['core_plugin_names'] = Array(
'ContactAddTaskBlock',
@@ -167,18 +187,15 @@
'Invoices'
);
-
+ // Is this still in use ?
$GLOBALS['core_setting_tab_name'] = Array(
'My Information',
'My Profile',
- 'Web Forms',
- 'Email Templates',
- 'Auto Responder',
'Sync Contacts',
'API Key',
- 'Email Stream',
- 'Discussion Email Alert',
+ 'Email Stream',
'Invoice Settings',
+ 'Add On',
'Cancel Account',
'Export',
'My Account Backup'
@@ -201,7 +218,7 @@
->setTabName(_("My Profile"))
->setPages(Array ("settings_myinfo"))
->setDefaultPage("settings_myinfo");
-
+ /** moving those to the marketing plugin
//Web Forms
$GLOBALS['cfg_setting_tab_placement']->append(new TabSetting(""));
$GLOBALS['cfg_setting_tab_placement']->next();
@@ -225,7 +242,7 @@
->setTabName(_("Auto Responder"))
->setPages(Array ("settings_auto_responder"))
->setDefaultPage("settings_auto_responder");
-
+**/
//Sync
$GLOBALS['cfg_setting_tab_placement']->append(new TabSetting(""));
$GLOBALS['cfg_setting_tab_placement']->next();
@@ -243,13 +260,6 @@
->setPages(Array ("settings_twitter"))
->setDefaultPage("settings_twitter");
**/
- //API Key
- $GLOBALS['cfg_setting_tab_placement']->append(new TabSetting(""));
- $GLOBALS['cfg_setting_tab_placement']->next();
- $GLOBALS['cfg_setting_tab_placement']->current()
- ->setTabName(_("API Key"))
- ->setPages(Array ("api_key"))
- ->setDefaultPage("api_key");
//Email Stream
$GLOBALS['cfg_setting_tab_placement']->append(new TabSetting(""));
@@ -259,6 +269,8 @@
->setPages(Array ("email_stream"))
->setDefaultPage("email_stream");
+ /** temporary suspending this one as its a confusing setting
+ * This only releate to project so should be better integrated within projects.
//Task Discussion Email Alert
$GLOBALS['cfg_setting_tab_placement']->append(new TabSetting(""));
$GLOBALS['cfg_setting_tab_placement']->next();
@@ -266,7 +278,7 @@
->setTabName(_("Discussion Email Alert"))
->setPages(Array ("settings_discussion_alert"))
->setDefaultPage("settings_discussion_alert");
-
+ */
//Google Gears
/** Started to move this into a plug-in
$GLOBALS['cfg_setting_tab_placement']->append(new TabSetting(""));
@@ -284,7 +296,24 @@
->setTabName(_("Invoice Settings"))
->setPages(Array ("settings_invoice"))
->setDefaultPage("settings_invoice");
-
+
+
+ //Enable Add-on
+ $GLOBALS['cfg_setting_tab_placement']->append(new TabSetting(""));
+ $GLOBALS['cfg_setting_tab_placement']->next();
+ $GLOBALS['cfg_setting_tab_placement']->current()
+ ->setTabName(_("Add On"))
+ ->setPages(Array ("enable_plugin", "settings_plugin"))
+ ->setDefaultPage("enable_plugin");
+
+
+ //API Key
+ $GLOBALS['cfg_setting_tab_placement']->append(new TabSetting(""));
+ $GLOBALS['cfg_setting_tab_placement']->next();
+ $GLOBALS['cfg_setting_tab_placement']->current()
+ ->setTabName(_("API Key"))
+ ->setPages(Array ("api_key"))
+ ->setDefaultPage("api_key");
//Cancel Account
$GLOBALS['cfg_setting_tab_placement']->append(new TabSetting(""));
$GLOBALS['cfg_setting_tab_placement']->next();
@@ -338,6 +367,7 @@
}
}
+ // Include plug-in Configuration files
$d3 = dir($cfg_project_directory."plugin/");
while($entry = $d3->read()) {
if (preg_match("/\.conf\.inc\.php$/i", $entry) && !preg_match("/^\./", $entry)) {
View
20 index.php
@@ -174,17 +174,21 @@ function fnTaskComplete(task) {
}
?>
- <table class="mainheader pad20" width="100%">
- <tr>
- <td><span class="headline14">
- <?php
+ <div class="mainheader">
+ <div class="pad20">
+ <span class="headline14"><?php
$do_workfeed = new WorkFeed();
printf(_("%s 's Work Feed:"),$_SESSION['do_User']->firstname) . "\n";
?></span>
- </td>
- <td align="right">&nbsp;&nbsp;&nbsp;&nbsp;<a href="index.php"><?php echo _('Work Feed'); ?></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="daily_notes.php"><?php echo _('Notes & Discussion'); ?></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="timesheet.php"><?php echo _('Timesheet'); ?></a></td>
- </tr>
- </table>
+ <?php
+ if (is_object($GLOBALS['cfg_submenu_placement']['index'] ) ) {
+ echo $GLOBALS['cfg_submenu_placement']['index']->getMenu();
+ }
+ ?>
+ </div>
+ </div>
+
+
<script type="text/javascript">
function autoLoadWorkfeed() {
$('div#last_feed_loader').html('<img src="/images/loader1.gif">');
View
29 plugin/Marketing.conf.inc.php
@@ -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/";
@@ -46,7 +48,7 @@
$GLOBALS['cfg_plugin_eventmultiple_placement']['contacts'][] =
Array('name'=> 'Send a Message ',
'confirm' => '',
- 'event' => 'do_Contacts->eventGetForMailMerge',
+ 'event' => 'ContactMailing->eventGetForMailMerge',
'action' => '');
@@ -73,7 +75,9 @@
"AutoResponder",
"AutoResponderEmail",
"AutoResponderEmailEdit",
- "settings_auto_responder_edit"
+ "settings_auto_responder_edit",
+ "SendMessage",
+ "SaveTemplate"
))
->setMenu($plugin_marketing_menu)
->setDefaultPage("MEmailTemplate");
@@ -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'] = '';
?>
View
11 plugin/Marketing/MEmailTemplate.php
@@ -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)">
@@ -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>
View
52 contact_sendemail_save_template.php → plugin/Marketing/SaveTemplate.php
@@ -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']) {
@@ -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>
@@ -96,11 +74,3 @@
}
?>
-
-
-
- </div>
- <div class="spacerblock_40"></div>
- <div class="layout_footer"></div>
-</div>
-</td><td class="layout_rmargin"></td></tr></table>
View
44 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);
@@ -20,6 +10,7 @@
$do_note_draft->sessionPersistent("do_message_draft","index.php",OFUZ_TTL);
}
?>
+
<script type="text/javascript">
//<![CDATA[
function fnInsertMergeField(merge){
@@ -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 <> \'\'');
@@ -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");
@@ -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>
-
View
0  plugin/Marketing/AutoResponder.class.php → plugin/Marketing/class/AutoResponder.class.php
File renamed without changes
View
0  plugin/Marketing/AutoResponderEmail.class.php → plugin/Marketing/class/AutoResponderEmail.class.php
File renamed without changes
View
0  plugin/Marketing/BlockEmailTemplateList.class.php → .../Marketing/class/BlockEmailTemplateList.class.php
File renamed without changes
View
0  plugin/Marketing/BlockMarketing.class.php → plugin/Marketing/class/BlockMarketing.class.php
File renamed without changes
View
0  plugin/Marketing/BlockWebFormList.class.php → plugin/Marketing/class/BlockWebFormList.class.php
File renamed without changes
View
259 plugin/Marketing/class/ContactMailing.class.php
@@ -0,0 +1,259 @@
+<?php
+// 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
+ **/
+
+
+ /**
+ * ContactMailing class
+ * Using the Contact and DataObject
+ *
+ * Method to reuse:
+ * sendMessage() its a very simple and easy way to send messages to contacts.
+ *
+ *
+ * @author SQLFusion's Dream Team 2 <info@sqlfusion.com>
+ * @package Marketing
+ * @license GNU Affero General Public License
+ * @version 0.6
+ * @date 2010-09-03
+ * @since 0.1
+ */
+
+class ContactMailing extends Contact {
+
+ function __construct(sqlConnect $conx=NULL, $table_name="") {
+ parent::__construct($conx, $table_name);
+ if (RADRIA_LOG_RUN_OFUZ) {
+ $this->setLogRun(OFUZ_LOG_RUN_PLUGIN_MARKETING);
+ }
+
+ $this->setLog("\n ContactMailing Object instantiated");
+ }
+
+ /**
+ * eventGetForMailMerge
+ * Get the list of contact for mailmerge
+ * load in the current contact object the list of
+ * selected contacts from the contacts.php
+ * Then redirect to the contact_sendemail.php.
+ */
+ function eventGetForMailMerge(EventControler $event_controler) {
+
+ $idcontacts = $event_controler->getParam("ck");
+ $sql_in = "(";
+ foreach($idcontacts as $idcontact) {
+ $sql_in .= $idcontact.",";
+ }
+ $sql_in = substr($sql_in, 0, -1);
+ $sql_in .= ")";
+ $tag_search = $this->getSearchTags();
+ if(is_array($tag_search) && count($tag_search > 0)){
+ $_SESSION['searched_tags'] = $tag_search ;
+ }
+
+ $this->clearSearch();
+ $this->setSqlQuery("SELECT * FROM contact WHERE idcontact in ".$sql_in);
+ $this->sessionPersistent("do_ContactMailing", "contacts.php", 36000);
+ $event_controler->goto = $GLOBALS['cfg_plugin_mkt_path']."SendMessage";
+ //$event_controler->setDisplayNext(new Display($GLOBALS['cfg_plugin_mkt_path']."SendMessage/"));
+ }
+
+ /**
+ * eventSendMessage
+ * This will send a message to one or multiple users.
+ * @todo Problem with the getBodyText(true) it returns some bad encoding and no newline, could also be the problem in the template it self...
+ */
+
+ function eventSendMessage(EventControler $event_controler) {
+ $this->setLog("\n eventSendMessage (".date("Y/m/d H:i:s").")");
+ if ($event_controler->send == _('Send Mailing')) {
+ $email_template = $_SESSION['do_message'];
+ $email_template->setApplyFieldFormating(false);
+ $this->setLog("\n EmailTemplate id: ".$email_template->getPrimarykeyValue());
+ //$this->setLogObject($email_template);
+ $this->setLog("\n SQL:".$this->getSqlQuery());
+ $this->query();
+ $this->setLog("\n ".$this->getNumRows()." contacts to send the message");
+
+ while ($this->next()) {
+ set_time_limit(500);
+ if($event_controler->unsubtag == 'on'){ // set unsubscribe auto-responder list
+ $values_contact = $this->getValues();
+ $tag_values = array("flag"=>"unsubscribe_autoresponder","idtag"=>$event_controler->idtag);
+ $values = array_merge($values_contact,$tag_values);
+ $message = $this->sendMessage($email_template, $values);
+ }else{
+ $message = $this->sendMessage($email_template, $this->getValues());
+ }
+ if ($this->last_message_sent) {
+ //$do_contact_notes->iduser = $_SESSION['do_User']->iduser;
+ $do_contact_notes = new ContactNotes();
+ $do_contact_notes->iduser = $_SESSION['do_User']->iduser;
+ //$do_contact_notes->note = '<b>'.$message->getSubject().'</b><br/>'.$message->getBodyText(true);
+ //->getTemplateBodyHtml();
+ $note_text = preg_replace('/^(.*?)<hr>.*$/','$1',str_replace("\n",'',$message->getBodyHtml(true)));
+ $do_contact_notes->note = '<b>'.$message->getSubject().'</b><br/>'.$note_text;
+ $do_contact_notes->date_added = date("Y-m-d");
+ $do_contact_notes->idcontact = $this->getPrimaryKeyValue();
+ $do_contact_notes->add();
+
+
+ /*
+ * Recording the messages sent by User
+ */
+ $msg_con = new sqlQuery($this->getDbCon());
+ $sql_msg_check = "SELECT * FROM `message_usage` WHERE `iduser` = ".$_SESSION['do_User']->iduser." AND `date_sent` = '".date("Y-m-d")."'";
+ $msg_con->query($sql_msg_check);
+ if($msg_con->getNumRows()) {
+ $msg_con->fetch();
+ $sql_con_update = new sqlQuery($this->getDbCon());
+ $sql_msg_update = "UPDATE `message_usage` SET `num_msg_sent` = num_msg_sent+1 WHERE `idmessage_usage` = ".$msg_con->getData("idmessage_usage");
+ $sql_con_update->query($sql_msg_update);
+ } else {
+ $sql_con_ins = new sqlQuery($this->getDbCon());
+ $sql_msg_ins = "INSERT INTO `message_usage`(iduser,date_sent,num_msg_sent) VALUES(".$_SESSION['do_User']->iduser.",'".date("Y-m-d")."',1)";
+ $sql_con_ins->query($sql_msg_ins);
+ }
+
+
+
+ }
+ }
+ } else { $event_controler->goto = "contacts.php"; }
+ $this->clearSearch();
+ $this->free();
+ }
+
+ /**
+ * eventSendNote
+ * This event is triggered when adding a note in a contact
+ * It will send a copy of the note the contact.
+ */
+
+ function eventSendNote(EventControler $event_controler) {
+ $send_note = $event_controler->fields['send_email'];
+ $this->setLog("eventSendNote starting (".date("Y/m/d H:i:s").")");
+ $this->setLog("do we send a message:".$send_note);
+ if ($send_note == "y") {
+ $template = new EmailTemplate();
+ $template->setSubject("{Ofuz} Message: ".substr($event_controler->fields['note'], 0, 70)."...")
+ ->setMessage($event_controler->fields['note']);
+ $this->sendMessage($template);
+ }
+ }
+
+ /**
+ * sendMessage
+ * This abstract the message sending so we use a general function
+ * that will send email or facebook or twitter based on the user
+ * preferences and settings.
+ * its possible to generate an EmailTemplate on the fly with no records in the DB
+ * Here is an exemple:
+ * <code php>
+ * $do_template = new EmailTemplate();
+ * $do_template->senderemail = "philippe@sqlfusion.com";
+ * $do_template->sendername = "Philippe Lewicki";
+ * $do_template->subject = "This is an example";
+ * $do_template->bodytext = "This is the content of the sample message";
+ * $do_template->bodyhtml = nl2br($do_template->bodytext);
+ * </code>
+ *
+ * An other example more OO / stylish
+ * <code php>
+ * $do_template = new EmailTemplate();
+ * $do_template->setFrom("phil@sqlfusion.com", "Philippe Lewicki")
+ * ->setSubject("This is an example")
+ * ->setMessage("This is the content of the sample message");
+ * </code>
+ * setFrom() is optional, if not provided it takes the do_User data
+ *
+ * Then send the message with: $contact->sendMessage($do_template);
+ *
+ * If you used a saved EmailTemplate like
+ * $do_template = new EmailTemplate("my template in email template table");
+ * and want the sender to be the currently signed in user, make sure the senderemail field
+ * is empty.
+ *
+ * @param $message an EmailTemplate object.
+ * @param $values an array with values to merge, optional.
+ *
+ */
+ function sendMessage($template, $values=Array()) {
+ if (!is_object($template)) { return false; }
+ if (empty($values)) { $values = $this->getValues(); }
+ $this->last_message_sent = false;
+ $do_contact_email = $this->getChildContactEmail();
+ $email_to = $do_contact_email->getDefaultEmail();
+ $this->setLog("\n Sending message to:".$email_to);
+ $contact_link = '<a href="/Contact/'.$this->idcontact.'">'.$this->firstname.' '.$this->lastname.'</a>';
+ if (strlen($email_to) > 4) {
+ if ($this->email_optout != 'y') {
+ $emailer = new Ofuz_Emailer('UTF-8');
+ if (strlen($template->senderemail) == 0) {
+ $template->setFrom($_SESSION['do_User']->email, $_SESSION['do_User']->getFullName());
+ }
+ $emailer->setEmailTemplate($template);
+ $emailer->mergeArrayWithFooter($values);
+ $emailer->addTo($email_to);
+ $this->last_message_sent = true;
+ return $emailer->send();
+ } else {
+ $_SESSION['in_page_message'] .= _("<br>".$contact_link." has opt-out and will not receive this email");
+ }
+ } elseif (strlen($this->tw_user_id) > 0) {
+ // send direct message using twitter api.
+ try{
+ $do_twitter = new OfuzTwitter();
+ $tw_config = $do_twitter->getTwitterConfig();
+ $serialized_token = $do_twitter->getAccessToken();
+ $token = unserialize($serialized_token);
+ $ofuz_twitter = new Ofuz_Service_Twitter($token->getParam('user_id'), $tw_config, $token);
+ $followers = $ofuz_twitter->userFollowers(false);
+ if (is_object($followers) && count($followers->user) > 0) {
+ foreach ($followers->user as $follower) {
+ if ($follower->id == $this->tw_user_id) {
+ $merge = new MergeString();
+ $message = $merge->withArray($template->bodytext, $values);
+ $ofuz_twitter->directMessageNew($this->tw_user_id, $message);
+ $do_contact_notes = new ContactNotes();
+ $do_contact_notes->iduser = $_SESSION['do_User']->iduser;
+ $do_contact_notes->note = $message;
+ $do_contact_notes->date_added = date('Y-m-d');
+ $do_contact_notes->idcontact = $this->idcontact;
+ $do_contact_notes->add();
+ return true;
+ }
+ }
+ }
+ $_SESSION['in_page_message'] .= _("<br>Notification can not be sent to ".$contact_link);
+ }catch(Exception $e){
+ $_SESSION['in_page_message'] .= _("<br>Notification can not be sent to ".$contact_link);
+ }
+ } elseif ($this->fb_userid && $_SESSION["do_User"]->global_fb_connected) {
+ // send message using facebook api.
+ include_once 'facebook_client/facebook.php';
+ include_once 'class/OfuzFacebook.class.php';
+ $facebook = new Facebook(FACEBOOK_API_KEY, FACEBOOK_APP_SECRET);
+ try{
+ $msg = _(' has sent the following message using ofuz').'<br />';
+ $msg .= '<b>'.$template->subject.'</b><br/>'.$template->bodyhtml;
+ $facebook->api_client->notifications_send($this->fb_userid, $msg, 'user_to_user');
+ //$this->last_message_sent = true;
+ }catch(Exception $e){
+ $_SESSION['in_page_message'] .= _("<br>Notification can not be sent to ".$contact_link);
+ }
+ } else {
+ $_SESSION['in_page_message'] .= _("<br>".$contact_link." doesn't have a valid email address, facebook account, or twitter id.");
+ }
+
+ if ($this->last_message_sent) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+
+
+}
View
0  plugin/Marketing/WebFormField.class.php → plugin/Marketing/class/WebFormField.class.php
File renamed without changes
View
0  plugin/Marketing/WebFormUser.class.php → plugin/Marketing/class/WebFormUser.class.php
File renamed without changes
View
0  plugin/Marketing/WebFormUserField.class.php → plugin/Marketing/class/WebFormUserField.class.php
File renamed without changes
View
17 settings_info.php
@@ -37,19 +37,8 @@
</td>
<td class="layout_rcolumn">
- <table class="mainheader pad20" width="100%">
- <tr>
- <td>
- <span class="headline14">Plugin Settings</span>
- </td>
- <td align="right">
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="enable_plugin.php"><?php echo _('Enable Add-On'); ?></a>
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="settings_plugin.php"><?php echo _('Detail List'); ?></a>
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="download.php"><?php echo _('Downloads'); ?></a>
- </td>
- </tr>
- </table>
- <div class="banner60 pad020 text32"><?php echo _('Settings'); ?></div>
+
+ <div class="banner60 pad020 text32"><?php echo _('Settings'); ?></div>
<div class="banner50 pad020 text16 fuscia_text"><?php echo _('My Information'); ?></div>
<div class="contentfull">
@@ -87,4 +76,4 @@
<?php include_once('includes/ofuz_facebook.php'); ?>
<?php include_once('includes/ofuz_analytics.inc.php'); ?>
</body>
-</html>
+</html>
View
18 settings_plugin.php
@@ -28,9 +28,21 @@
?>
<div class="settingsbottom"></div></div>
</td><td class="layout_rcolumn">
- <div class="banner60 pad020 text32"><?php echo _('Settings'); ?></div>
- <div class="banner50 pad020 text16 fuscia_text"><?php echo _('Plugin Settings'); ?></div>
- <div class="contentfull">
+ <div class="banner60 pad020 text32"><?php echo _('Add-On'); ?></div>
+
+ <div class="mainheader">
+ <div class="pad20">
+ <span class="headline14"><?php
+ echo _('Full plugin list');
+ ?></span>
+ <?php
+ if (is_object($GLOBALS['cfg_submenu_placement']['settings_plugin'] ) ) {
+ echo $GLOBALS['cfg_submenu_placement']['settings_plugin']->getMenu();
+ }
+ ?>
+ </div>
+ </div>
+ <div class="contentfull"> <div class="spacerblock_20"></div>
<?php
if($_SESSION['in_page_message'] != ''){
echo '<div style="margin-left:0px;">';
View
44 tasks.php
@@ -517,17 +517,12 @@ function showAllTasksOverdue(){
<!--<div class="tasktop">-->
<div class="mainheader pad20">
- <span class="headline14">Your tasks</span><!--<div id="info">testing message place</div>-->
+ <span class="headline14">Your tasks</span>
<?php
- if($_GET['t'] == 't'){$_SESSION['remember_task_on'] = '';}
- if($_GET['t']=='p' || $_SESSION['remember_task_on']== 'Project'){
- $link_html = '<a href=/tasks.php?t=t>'._('Tasks By Date').'</a><span class="headerlinksI">|</span>';
- }else{
- $link_html = '<a href=/tasks.php?t=p>'._('Task By Projects').'</a><span class="headerlinksI">|</span>';
- }
- ?>
- <span class="headerlinks"><?php echo $link_html;?><?php echo _('Upcoming');?><span class="headerlinksI">|</span><a href="tasks_completed.php"><?php echo _('Completed');?></a></span>
- <!--<span class="headerlinksI">|</span><a href="ofuz_demo_tasks3.php">Assigned</a></span>//-->
+ if (is_object($GLOBALS['cfg_submenu_placement']['tasks'] ) ) {
+ echo $GLOBALS['cfg_submenu_placement']['tasks']->getMenu();
+ }
+ ?>
</div>
@@ -567,34 +562,6 @@ function showAllTasksOverdue(){
-
- <div class="contentfull">
- <?php
- if($_GET['t']=='p' || $_SESSION['remember_task_on']== 'Project'){ // Starts the first if
- $_SESSION['remember_task_on'] = 'Project';
- $do_task->getAllTaskProjectRelated();
- $last_project = 0;
- echo '<div class="tasks">';
- while($do_task->next()){
- if($last_project != $do_task->idproject ){
- echo '<div ><br /><b><a href="/Project/'.$do_task->idproject.'">'.$do_task->name.'</a></b></div>';
- }
- $last_project = $do_task->idproject;
- echo '<br /><span class="task_item">&nbsp;&nbsp;';
- if ($do_task->task_category != '') {
- echo '<span class="task_category">'.$do_task->task_category.'</span>&nbsp;';
- }
- echo '<span class="task_desc"><a href="/Task/'.$do_task->idproject_task.'">'.$do_task->task_description.'</a>';
- echo '</span></span>';
- //echo '<div></div>';
- //echo '<span></span>';
- }
- echo '</div>';
- }else{
- $_SESSION['remember_task_on'] = '';
- ?>
- </div>
-
<!--Over Due Tasks-->
<?php
@@ -743,7 +710,6 @@ function showAllTasksOverdue(){
<div id="tasks_options"><a href="#" onclick="showAllTasksLater(); return false;"><?php echo _('More...');?></a></div>
<?php } ?>
<?php }
-}// Ends the else condition
?>
<div class="dottedline"></div>
View
119 tasks_by_project.php
@@ -0,0 +1,119 @@
+<?php
+// Copyrights 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 **/
+
+
+ /**
+ * tasks.php
+ * Display the tasks of a user group by time.
+ * It uses the object: Task
+ * Copyright 2001 - 2010 All rights reserved SQLFusion LLC, info@sqlfusion.com
+ * Authors: Philippe Lewicki, Abhik Chakraborty, Jay Link, Ravi Rokkam
+ */
+
+ $pageTitle = 'Ofuz :: Tasks';
+ $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');
+
+ $do_task = new Task($GLOBALS['conx']);
+ $do_task_category = new TaskCategory();
+ $do_contact_task = new Contact();
+
+
+ /* $do_list_project_task = new ProjectTask();
+ $do_list_project_task->viewProjectTasks();*/
+
+
+ if(!is_object($_SESSION['do_list_project_task'])){
+ $do_project_task = new ProjectTask();
+ $do_project_task->sessionPersistent("do_list_project_task", "projects.php", OFUZ_TTL);
+ }
+
+
+
+?>
+<script type="text/javascript">
+ //<![CDATA[
+<?php include_once('includes/ofuz_js.inc.php'); ?>
+ //]]>
+</script>
+
+<?php $do_feedback = new Feedback(); $do_feedback->createFeedbackBox(); ?>
+
+ <table class="layout_columns">
+ <tr><td class="layout_lmargin"></td>
+ <td>
+ <div class="layout_content">
+ <?php $thistab = _('Tasks'); include_once('includes/ofuz_navtabs.php'); ?>
+ <?php $do_breadcrumb = new Breadcrumb(); $do_breadcrumb->getBreadcrumbs(); ?>
+ <div class="grayline1"></div>
+ <div class="spacerblock_20"></div>
+ <table class="layout_columns">
+ <tr>
+ <td class="layout_lcolumn">
+ <?php $page_name='tasks'; include_once('plugin_block.php');?>
+ </td>
+ <td class="layout_rcolumn">
+ <?php
+ $msg = new Message();
+ if ($msg->getMessageFromContext("tasks")) {
+ echo $msg->displayMessage();
+ }
+ ?>
+ <!--<div class="tasktop">-->
+
+ <div class="mainheader pad20">
+ <span class="headline14">Your tasks</span>
+ <?php
+ if (is_object($GLOBALS['cfg_submenu_placement']['tasks'] ) ) {
+ echo $GLOBALS['cfg_submenu_placement']['tasks']->getMenu();
+ }
+ ?>
+ </div>
+
+ <div class="contentfull">
+ <?php
+
+ $_SESSION['remember_task_on'] = 'Project';
+ $do_task->getAllTaskProjectRelated();
+ $last_project = 0;
+ echo '<div class="tasks">';
+ while($do_task->next()){
+ if($last_project != $do_task->idproject ){
+ echo '<div ><br /><b><a href="/Project/'.$do_task->idproject.'">'.$do_task->name.'</a></b></div>';
+ }
+ $last_project = $do_task->idproject;
+ echo '<br /><span class="task_item">&nbsp;&nbsp;';
+ if ($do_task->task_category != '') {
+ echo '<span class="task_category">'.$do_task->task_category.'</span>&nbsp;';
+ }
+ echo '<span class="task_desc"><a href="/Task/'.$do_task->idproject_task.'">'.$do_task->task_description.'</a>';
+ echo '</span></span>';
+ //echo '<div></div>';
+ //echo '<span></span>';
+ }
+ echo '</div>';
+
+ ?>
+ </div>
+
+ <div class="dottedline"></div>
+ <?php $footer_note = 'dropboxtask'; include_once('includes/footer_notes.php'); ?>
+ </div>
+ </div>
+ </div>
+ </td></tr></table>
+ <div class="spacerblock_20"></div>
+ <div class="layout_footer"></div>
+</div>
+</td><td class="layout_rmargin"></td></tr></table>
+<?php include_once('includes/ofuz_facebook.php'); ?>
+</body>
+</html>
+
+
View
13 tasks_completed.php
@@ -97,11 +97,14 @@ function hideDateOpt(){
</div>
<div class="left_menu_footer"></div>
</td><td class="layout_rcolumn">
- <div class="tasktop">
- <span class="headline11"><?php echo _('Your completed tasks');?></span>
- <span class="headerlinks"><a href="tasks.php"><?php echo _('Upcoming');?></a><span class="headerlinksI">|</span><?php echo _('Completed');?></span>
- <!--<span class="headerlinksI">|</span><a href="ofuz_demo_tasks3.php">Assigned</a></span>//-->
- </div>
+ <div class="mainheader pad20">
+ <span class="headline14"><?php echo _('Your completed tasks');?></span>
+ <?php
+ if (is_object($GLOBALS['cfg_submenu_placement']['tasks'] ) ) {
+ echo $GLOBALS['cfg_submenu_placement']['tasks']->getMenu();
+ }
+ ?>
+ </div>
<div class="contentfull">
<?php
$do_task->getDistinctCompletedTaskDates();
View
32 timesheet.php
@@ -41,26 +41,24 @@
<td class="layout_lcolumn">
<?php include_once('plugin_block.php'); ?>
</td>
- <td class="layout_rcolumn"><div class="min660">
+ <td class="layout_rcolumn">
+ <div class="min660">
<?php $msg = new Message();
$msg->getMessageFromContext("timesheet");
echo $msg->displayMessage();
?>
- <table class="mainheader pad20" width="100%">
-
- <tr>
- <td><span class="headline14"><?php echo _('Timesheet'); ?></span></td>
- <td align="right">&nbsp;&nbsp;&nbsp;&nbsp;<a href="index.php"><?php echo _('Work Feed'); ?></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="daily_notes.php"><?php echo _('Notes & Discussion'); ?></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="timesheet.php"><?php echo _('Timesheet'); ?></a></td>
- </tr>
- <tr>
- <td colspan="2">
+ <div class="mainheader">
+ <div class="pad20">
+ <span class="headline14"><?php echo _('Timesheet'); ?></span>
+ <?php
+ if (is_object($GLOBALS['cfg_submenu_placement']['timesheet'] ) ) {
+ echo $GLOBALS['cfg_submenu_placement']['timesheet']->getMenu();
+ }
+ ?>
+ </div>
+ </div>
+ <div class="sub_action_menu">
- </td>
- </tr>
- </table>
- <div class="dottedline"></div>
- <div class="section20">
-
<?php
$e_filter = new Event("adm_project_report_discuss->eventSetMonth");
@@ -75,7 +73,9 @@
echo '&nbsp;&nbsp;';
echo $_SESSION['adm_project_report_discuss']->getWeekDropDowns();
?>
- </form><br/><div class="dottedline"></div>
+ </form>
+ </div>
+ <br/><div class="dottedline"></div>
<div class="headline_fuscia"><?php echo _('Projects'); ?></div>
<?php
$do_prj_discuss = new ProjectDiscuss();

No commit comments for this range

Something went wrong with that request. Please try again.