diff --git a/admin/donors.php b/admin/donors.php index 6670d22..3e1bb0b 100644 --- a/admin/donors.php +++ b/admin/donors.php @@ -178,7 +178,7 @@ switch($_GET['action']) { echo "
\n"; echo "

".i18n("Add New Donation/Sponsorship")."

\n"; - echo "
"; + echo ""; echo ""; echo "
"; echo i18n("Appeal").":"; @@ -989,6 +989,10 @@ function donortypechange() { $("#organizationinfo_save_button").attr('disabled',''); } +function adddonation() { + var id=sponsor_id; + $("#debug").load("?action=donation_add", $("#donationaddform").serializeArray(),function() { update_contactsinfo(); }); +} "Initial Communication", + "followup"=>"Follow-Up Communication"); + + foreach($communications as $key=>$name) { + echo "

".i18n($name)."

\n"; + //check if they have one in the emails database + $q=mysql_query("SELECT * FROM emails WHERE fundraising_campaigns_id='$campaign_id' AND val='$key'"); + if($email=mysql_fetch_object($q)) { + echo "
"; + echo "id)\">"; + echo "  "; + echo "id);\" href=\"\">"; + echo "
"; + + + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
".i18n("Subject")."$email->subject
".i18n("From")."$email->from
".$email->bodyhtml."
"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
"; + if($email->lastsent) { + list($date,$time)=split(" ",$email->lastsent); + echo i18n("Sent %1 at %2",array(format_date($date), $time)); + } else { + echo ""; + } + echo "
\n"; + echo "
\n"; + + } + else { + echo "\n"; + } + echo "
"; + } exit; break; @@ -430,6 +474,22 @@ switch($_GET['action']){ exit; break; + case "communication_remove": + $emails_id=$_POST['id']; + //check if its been sent, if so, it cannot be deleted, sorry! + $q=mysql_query("SELECT * FROM emails WHERE id='$emails_id'"); + $e=mysql_fetch_object($q); + if($e->lastsent) { + error_("Cannot remove an email that has already been sent"); + } + else { + mysql_query("DELETE FROM emails WHERE id='$emails_id'"); + happy_("Communicaton removed"); + } + + + break; + } function save_campaign_info(){ @@ -601,6 +661,43 @@ function prospect_removeall() { return false; } +//key is initial or followup +//start is either 'new' to start with a blank, or 'existing' to load an existing email to start from +function opencommunicationeditor(key,id) { + if(id) { + $("#dialog").load("communication.php?action=dialog_edit&id="+id,null,function() { + }); + } else { + $("#dialog").load("communication.php?action=dialog_edit&key="+key,null,function() { + }); + } +} + +function opencommunicationchooser() { + $("#dialog").load("communication.php?action=dialog_choose&type=fundraising",null,function() { + }); +} + +function removecommunication(id) { + $("#debug").load("fundraising_campaigns.php?action=communication_remove",{id:id},function() { + update_tab_communications(); + }); + return false; +} + +function comm_dialog_choose_select(id) { + alert('im back with email id: '+id); + //get rid of hte html + $("#dialog").html(""); + + $("#dialog").load("communication.php?action=dialog_edit&cloneid="+id,null,function() { + }); +} + +function comm_dialog_choose_cancel() { + alert('im cancelled'); +} + Appeal Management

- + +