templates/de/emails/admin/admin_order_normal.tpl svneol=native#text/plain
templates/de/emails/admin/admin_payout_request.tpl svneol=native#text/plain
templates/de/emails/admin/admin_payout_request_banner.tpl svneol=native#text/plain
+templates/de/emails/admin/admin_purge_task.tpl svneol=native#text/plain
+templates/de/emails/admin/admin_purge_task_row.tpl svneol=native#text/plain
templates/de/emails/admin/admin_purge_user_server_name_log.tpl svneol=native#text/plain
templates/de/emails/admin/admin_purge_user_subid_log.tpl svneol=native#text/plain
templates/de/emails/admin/admin_rallye_expired.tpl svneol=native#text/plain
return translateGeneric('ADMIN_TASK_TYPE', $taskType);
}
-//-----------------------------------------------------------------------------
-// Automatically re-created functions, all taken from user comments on www.php.net
-//-----------------------------------------------------------------------------
+// "Translates" task status to a human-readable version
+function translateTaskStatus ($taskStatus) {
+ // Return it
+ return translateGeneric('ADMIN_TASK_STATUS', $taskStatus);
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ * Automatically re-created functions, all taken from user comments on
+ * www.php.net
+ *-----------------------------------------------------------------------------
+ */
if (!function_exists('html_entity_decode')) {
// Taken from documentation on www.php.net
function html_entity_decode ($string) {
'ADMIN_ENTER_REDIRECT_URL' => "URL eingeben, wenn abgelehnt werden soll",
'MEMBER_REFERRAL_BANNER_404' => "Es sind noch keine Werbebanner eingerichtet worden. Bitte verwenden Sie solange Ihren Referral-Link.",
'ADMIN_ID_404' => "ID <span class=\"data\">%s</span> nicht gefunden.",
+
+ // Columns for listing tasks
'ADMIN_ASSIGNED_ADMIN' => "Zugewiesener Admin",
+ 'ADMIN_ASSIGNED_ADMIN_EMAIL' => "Admin",
'ADMIN_MEMBER_USERID' => "ID des Mitgliedes",
+ 'ADMIN_MEMBER_USERID_EMAIL' => "Mitglied-Id",
'ADMIN_TASK_TYPE' => "Aufgabenbereich",
+ 'ADMIN_TASK_TYPE_EMAIL' => "Aufgabenbereich",
'ADMIN_TASK_CREATED' => "Aufgabe erstellt",
+ 'ADMIN_TASK_CREATED_EMAIL' => "Erstellt",
+
'ADMIN_NO_ADMIN_ASSIGNED' => "Kein Admin-Login zugewiesen.",
'ADMIN_UNKNOWN_TASK_TYPE' => "Unbekannter Aufgabentyp <span class=\"data\">%s</span> für Aufgabe <span class=\"data\">%s</span> erkannt.",
'ADMIN_TASK_SYSTEM_WELCOME' => "Task-Management Ihres {?mt_word2?}",
'ADMIN_TASK_LIST_ACCOUNT_NO_REFERRAL_TITLE' => "Es wurden Accounts ohne Werber-Id (refid=0) gefunden.",
'ADMIN_TASK_LIST_NOTIFICATIONS' => "Alle Benachrichtigungen",
'ADMIN_TASK_LIST_NOTIFICATIONS_TITLE' => "Es sind ausgesandte,vergütete Benachrichtigungen vorhanden.",
+
+ // Task status
+ 'ADMIN_TASK_STATUS_NEW' => "Neu",
+ 'ADMIN_TASK_STATUS_OPEN' => "Offen",
+ 'ADMIN_TASK_STATUS_SOLVED' => "Erledigt",
+ 'ADMIN_TASK_STATUS_CLOSED' => "Geschlossen",
+ 'ADMIN_TASK_STATUS_DELETED' => "Gelöscht",
+ 'ADMIN_TASK_STATUS_NULL' => "Null (!)",
+ 'ADMIN_TASK_STATUS_EMPTY' => "Leer (!)",
+ 'ADMIN_TASK_STATUS_UNKNOWN' => "Unbekannt (%s)",
));
// [EOF]
} // END - if
// Abort if autopurge is not active or disabled by admin
-if ((!isExtensionActive('autopurge')) || (!isAutoPurgingActive())) {
+if ((!isExtensionActive('autopurge')) || (!isAutoPurgingActive()) || (getConfig('ap_tasks_notify') == 'N')) {
// Abort here
return FALSE;
} // END - if
// Check version (must be >= 0.1.9)
if ((isExtensionInstalledAndNewer('task', '0.1.9')) && (getConfig('autopurge_tasks') == 'Y')) {
- // Purge deleted tasks (no notification to admin)
- SQL_QUERY("DELETE LOW_PRIORITY
+ // Select all tasks that needs purging
+ $result = SQL_QUERY("SELECT
+ `id`,
+ `assigned_admin`,
+ `userid`,
+ `status`,
+ `task_type`,
+ `subject`,
+ `task_created`
FROM
`{?_MYSQL_PREFIX?}_task_system`
WHERE
`status`='DELETED' AND
(UNIX_TIMESTAMP() - `task_created`) >= {?ap_tasks_time?}", __FILE__, __LINE__);
- // Get deleted rows
- $deletedTasks = SQL_AFFECTEDROWS();
-
// Send out a notification?
- if (($deletedTasks > 0) && (getConfig('ap_tasks_notify') == 'Y')) {
+ if (!SQL_HASZERONUMS($result)) {
+ // Init output and load all rows
+ $output = ''; $ids = array();
+ while ($row = SQL_FETCHARRAY($result)) {
+ // "Translate" creation timestamp
+ $row['task_created'] = generateDateTime($row['task_created'], '1');
+
+ // Load row template
+ $output .= loadEmailTemplate('admin_purge_task_row', $row);
+
+ // Remember id number for deletion
+ array_push($ids, $row['id']);
+ } // END - while
+
+ // Init content array
+ $content = array(
+ 'count' => SQL_NUMROWS($result),
+ 'rows' => $output
+ );
+
+ // Delete all tasks
+ SQL_QUERY('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `id` IN (' . implode(', ', $ids) . ')');
+
// Send out email to admin
- sendAdminNotification('{--ADMIN_AUTOPURGE_TASKS_SUBJECT--}', 'admin_autopurge_tsks', $deletedTasks);
+ sendAdminNotification('{--ADMIN_AUTOPURGE_TASKS_SUBJECT--}', 'admin_purge_task', $content);
} // END - if
+
+ // Free result
+ SQL_FREERESULT($result);
} // END - if
//
`assigned_admin` BIGINT(20) UNSIGNED NULL DEFAULT NULL,
`userid` BIGINT(20) UNSIGNED NULL DEFAULT NULL,
`status` ENUM('NEW','OPEN','SOLVED','CLOSED','DELETED') NOT NULL DEFAULT 'NEW',
- `task_type` VARCHAR(255) NOT NULL DEFAULT 'FIRST_USER',
+ `task_type` VARCHAR(255) NOT NULL DEFAULT 'UNKNOWN',
`subject` VARCHAR(255) NOT NULL DEFAULT '',
`text` LONGTEXT NOT NULL,
`task_created` VARCHAR(10) NOT NULL DEFAULT 0,
-Hallo Administrator,
-
-In Ihrem {?mt_word?} wurden $content Aufgaben gelöscht.
-
-Mit freundlichen Grüßen,
- Ihr {?MAIN_TITLE?} Script
-
-{?URL?}/admin.php
+@DEPRECATED
--- /dev/null
+Hallo Administrator,
+
+In Ihrem {?mt_word?} wurden $content[count] Aufgaben gelöscht.
+
+--------------------------------------------------------------------------
+ {--ID_SELECT--} | {--ADMIN_ASSIGNED_ADMIN_EMAIL--} | {--ADMIN_MEMBER_USERID_EMAIL--} | {--ADMIN_TASK_INFOS_EMAIL--} | {--ADMIN_TASK_TYPE_EMAIL--} | {--ADMIN_TASK_CREATED_EMAIL--}
+--------------------------------------------------------------------------
+$content[rows]
+--------------------------------------------------------------------------
+
+Mit freundlichen Grüßen,
+ Ihr {?MAIN_TITLE?} Script
+
+{?URL?}/admin.php
--- /dev/null
+$content[id] | {%pipe,convertZeroToNull=$content[assigned_admin]%} | {%pipe,convertZeroToNull=$content[userid]%} | {%pipe,translateTaskStatus=$content[task_type]%} | {%pipe,translateTaskType=$content[task_status]%} | $content[task_created]
href="http://forum.mxchange.org/topic-462.html" rel="external">in diesem
Forum</a>. Es wird dann bald im Mailer-Projekt eingebunden.
</div>
+
+<div class="para">
+ <strong>Vorraussetzungen:</strong> Diese Erweiterunge benötigt iconv,
+ damit die von den Werbenetzwerken verwendeten Zeichensätze nach UTF-8
+ konvertiert werden können.
+</div>