Notication list reworked
authorRoland Häder <roland@mxchange.org>
Tue, 7 Oct 2008 00:30:07 +0000 (00:30 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 7 Oct 2008 00:30:07 +0000 (00:30 +0000)
.gitattributes
inc/databases.php
inc/language/bonus_de.php
inc/modules/admin/what-del_email.php
inc/modules/admin/what-list_notifications.php
templates/de/html/admin/admin_del_email_notify.tpl [new file with mode: 0644]
templates/de/html/admin/admin_list_bonus_emails_row.tpl
templates/de/html/admin/admin_list_emails_row.tpl
templates/de/html/admin/admin_list_notify_emails_row.tpl [new file with mode: 0644]

index 4fb6304..f90ab7b 100644 (file)
@@ -866,6 +866,7 @@ templates/de/html/admin/admin_del_cats.tpl -text
 templates/de/html/admin/admin_del_cats_row.tpl -text
 templates/de/html/admin/admin_del_email_bonus.tpl -text
 templates/de/html/admin/admin_del_email_normal.tpl -text
+templates/de/html/admin/admin_del_email_notify.tpl -text
 templates/de/html/admin/admin_del_payments.tpl -text
 templates/de/html/admin/admin_del_payments_row.tpl -text
 templates/de/html/admin/admin_del_sponsor.tpl -text
@@ -950,6 +951,7 @@ templates/de/html/admin/admin_list_links.tpl -text
 templates/de/html/admin/admin_list_links_problem.tpl -text
 templates/de/html/admin/admin_list_links_row.tpl -text
 templates/de/html/admin/admin_list_notify_emails.tpl -text
+templates/de/html/admin/admin_list_notify_emails_row.tpl -text
 templates/de/html/admin/admin_list_payments.tpl -text
 templates/de/html/admin/admin_list_payouts.tpl -text
 templates/de/html/admin/admin_list_payouts_banner.tpl -text
index 05ed13c..ef7c4bc 100644 (file)
@@ -113,7 +113,7 @@ define('USAGE_BASE', "usage");
 define('SERVER_URL', "http://www.mxchange.org");
 
 // This current patch level
-define('CURR_SVN_REVISION', "472");
+define('CURR_SVN_REVISION', "473");
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
index 3089af5..7f950a1 100644 (file)
@@ -123,6 +123,9 @@ define('ADMIN_BONUS_RALLYE_NEW_MEMBER_NOTIFY', "Sollen neue Mitglieder mit selbe
 define('ADMIN_BONUS_RALLYE_NOTIFY_WAIT', "Wie lange soll die Wartezeit der Bonus-Mail sein?");
 define('ADMIN_BONUS_INCLUDE_OWN', "Soll Ihre Mitglieder-ID an der Aktiv-Rallye dran teilnehmen?");
 define('ADMIN_NOTIFCATION_TITLE', "Ausgesendete Benachrichtigungen");
+define('ADMIN_DELETE_NOTIFY_MAIL', "Obrige Benachrichtigung entfernen");
+define('ADMIN_NOTIFY_MAIL_ALREADY_DELETED', "Benachrichtigung bereits entfernt.");
+define('ADMIN_NOTIFICATION_DELETED_TITLE', "Benachrichtigung entfernt");
 
 // Switches
 define('ADMIN_BONUS_RALLYE_IS_ACTIVE'    , "Ist die Aktiv-Rallye aktiv?");
index bcc1fcc..08b23b7 100644 (file)
@@ -184,6 +184,35 @@ WHERE s.pool_id=%s LIMIT 1",
                // Mail already deleted!
                LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_BONUS_MAIL_ALREADY_DELETED);
        }
+} elseif ((!empty($_GET['nid'])) && (GET_EXT_VERSION("bonus") >= "0.8.7")) {
+       // Load data from bonus mail
+       $result = SQL_QUERY_ESC("SELECT id, subject, url, timestamp FROM "._MYSQL_PREFIX."_bonus WHERE id=%s",
+        array(bigintval($_GET['nid'])), __FILE__, __LINE__);
+
+       // Delete mail only once
+       if (SQL_NUMROWS($result) == 1) {
+               // Load data
+               list ($id, $subject, $url, $timestamp) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+
+               // Delete bonus mail entirely from database
+               $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_bonus WHERE id=%s LIMIT 1",
+                array(bigintval($_GET['nid'])), __FILE__, __LINE__);
+               $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_links WHERE bonus_id=%s",
+                array(bigintval($_GET['nid'])), __FILE__, __LINE__);
+
+               // Prepare data for the template
+               define('__ID'     , $id);
+               define('__SUBJECT', $subject);
+               define('__URL'    , DEREFERER($url));
+               define('__ORDERED', MAKE_DATETIME($timestamp, "0"));
+
+               // Load template
+               LOAD_TEMPLATE("admin_del_email_notify");
+       } else {
+               // Mail already deleted!
+               LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NOTIFY_MAIL_ALREADY_DELETED);
+       }
 } else {
        // No mail orders fond
        LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_WRONG_CALL);
index 61a085d..70abbbd 100644 (file)
@@ -99,7 +99,7 @@ if ((EXT_IS_ACTIVE("bonus")) && (SQL_NUMROWS($result_max) > 0) && (!empty($SQL2)
                        $content['timestamp']   = MAKE_DATETIME($content['timestamp'], "0");
 
                        // Load row template
-                       $OUT .= LOAD_TEMPLATE("admin_list_bonus_emails_row", true, $content);
+                       $OUT .= LOAD_TEMPLATE("admin_list_notify_emails_row", true, $content);
                }
 
                // Add navigation (without change box but with colspan=3)
diff --git a/templates/de/html/admin/admin_del_email_notify.tpl b/templates/de/html/admin/admin_del_email_notify.tpl
new file mode 100644 (file)
index 0000000..f43a274
--- /dev/null
@@ -0,0 +1,19 @@
+<TABLE border="0" cellspacing="0" cellpadding="0" class="admin_table dashed" width="99%">
+       <TR>
+               <TD class="admin_header" colspan="8" align="center" height="35">
+               <STRONG class="admin_misc">{--ADMIN_NOTIFICATION_DELETED_TITLE--}</STRONG></TD>
+       </TR>
+       <TR>
+               <TD class="top2 right2" align="center"><STRONG>{--ID_SELECT--}</STRONG></TD>
+               <TD class="top2 right2" align="center"><STRONG>{--EMAIL_SUBJECT--}</STRONG></TD>
+               <TD class="top2 right2" align="center"><STRONG>{--EMAIL_URL--}</STRONG></TD>
+               <TD class="top2 right2" align="center"><STRONG>{--EMAIL_TIMESTAMP--}</STRONG></TD>
+       </TR>
+       <TR>
+               <TD class="top2 right2 admin_misc" align="center">{!__ID!}</TD>
+               <TD class="top2 right2 admin_misc" align="center">{!__SUBJECT!}</TD>
+               <TD class="top2 right2 admin_misc" align="center"><A
+                       href="{!__URL!}" target="_blank">{--ADMIN_TEST_URL--}</A></TD>
+               <TD class="top2 right2 admin_misc" align="center">{!__ORDERED!}</TD>
+       </TR>
+</TABLE>
index c890128..1ad3c3f 100644 (file)
@@ -67,6 +67,6 @@
 </tr>
 <tr>
   <td align="center" class="top2 admin_del_link" colspan="3">
-    <a href="{--URL--}/modules.php?module=admin&amp;what=del_email&amp;bid=$content[id]">{--ADMIN_DELETE_BONUS_MAIL--}</a>
+    <a href="{!URL!}/modules.php?module=admin&amp;what=del_email&amp;bid=$content[id]">{--ADMIN_DELETE_BONUS_MAIL--}</a>
   </td>
 </tr>
index 68ab750..e9c8521 100644 (file)
@@ -56,6 +56,6 @@
 </TR>
 <TR>
   <TD align="center" class="top2 admin_del_link" colspan="3">
-    <A href="{--URL--}/modules.php?module=admin&amp;what=del_email&amp;mid=$content[id]">{--ADMIN_DELETE_NORMAL_MAIL--}</A>
+    <A href="{!URL!}/modules.php?module=admin&amp;what=del_email&amp;mid=$content[id]">{--ADMIN_DELETE_NORMAL_MAIL--}</A>
   </TD>
 </TR>
diff --git a/templates/de/html/admin/admin_list_notify_emails_row.tpl b/templates/de/html/admin/admin_list_notify_emails_row.tpl
new file mode 100644 (file)
index 0000000..ba6f9e8
--- /dev/null
@@ -0,0 +1,72 @@
+<tr>
+  <td class="bottom top2 right" colspan="2" width="46%" align="center">
+    {--EMAIL_SUBJECT--}:<br />
+    <strong class="admin_misc">$content[subject]</strong>
+  </td>
+  <td class="bottom top2" width="54%" align="center">
+    {--EMAIL_TEXT--}:<br />
+    <strong class="admin_misc">$content[text]</strong>
+  </td>
+</tr>
+<tr><td height="5" colspan="3" class="seperator">&nbsp;</td></tr>
+<tr>
+  <td align="center" class="top bottom right" width="23%">
+    {--EMAIL_POINTS--}:<br />
+    <strong class="admin_misc">$content[points] {!POINTS!}</strong>
+  </td>
+  <td align="center" class="top bottom right" width="23%">
+    {--EMAIL_SECONDS--}:<br />
+    <strong class="admin_misc">$content[time]</strong>
+  </td>
+  <td align="center" class="top bottom">
+    {--EMAIL_CATEGORY--}:<br />
+    <strong class="admin_misc">$content[category]</strong>
+  </td>
+</tr>
+<tr><td height="5" colspan="3" class="seperator">&nbsp;</td></tr>
+<tr>
+  <td align="center" class="top bottom right">
+    {--EMAIL_RECEIVERS--}:<br />
+    <strong class="admin_misc">$content[mails_sent]</strong>
+    ({--EMAIL_RUIDS--}: <strong class="admin_misc">$content[receivers]</strong>)
+  </td>
+  <td align="center" class="top bottom right">
+    {--USERS_LINKS--}:<br />
+    <strong class="admin_misc">$content[unconfirmed]</strong>
+  </td>
+  <td align="center" class="top bottom">
+    {--EMAIL_POOL_TYPE--}:<br />
+    <strong class="admin_misc">$content[type]</strong>
+  </td>
+</tr>
+<tr><td height="5" colspan="3" class="seperator">&nbsp;</td></tr>
+<tr>
+  <td align="center" class="top bottom right">
+    {--EMAIL_TSEND--}:<br />
+    <strong class="admin_misc">$content[target_send]</strong>
+  </td>
+  <td align="center" class="top bottom right">
+    {--EMAIL_URL--}:<br />
+    <strong class="admin_misc"><a href="$content[frametester]" target="_blank">{--ADMIN_TEST_URL--}</a></strong>
+  </td>
+  <td align="center" class="top bottom">
+    {--EMAIL_TIMESTAMP--}:<br />
+    <strong class="admin_misc">$content[timestamp]</strong>
+  </td>
+</tr>
+<tr><td height="5" colspan="3" class="seperator">&nbsp;</td></tr>
+<tr>
+  <td align="center" class="top right" colspan="2">
+    <div>{--EMAIL_URL--}:</div>
+    <div><strong class="admin_misc">$content[url]</strong></div>
+  </td>
+  <td align="center" class="top">
+    {--__UNUSED--}:<br />
+    <strong class="admin_misc">---</strong>
+  </td>
+</tr>
+<tr>
+  <td align="center" class="top2 admin_del_link" colspan="3">
+    <a href="{!URL!}/modules.php?module=admin&amp;what=del_email&amp;nid=$content[id]">{--ADMIN_DELETE_NOTIFY_MAIL--}</a>
+  </td>
+</tr>