- case 'PAYOUT_REQUEST': // Payout requests
- if (EXT_IS_ACTIVE('payout')) {
- // Extension is installed so let him send a notification to the user
- $result_pay = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_user_payouts` WHERE userid=%s AND payout_timestamp=%s LIMIT 1",
- array(bigintval($uid), bigintval($created)), __FILE__, __LINE__);
- list($pid) = SQL_FETCHROW($result_pay);
- SQL_FREERESULT($result_pay);
-
- if ((!empty($pid)) && ($pid > 0)) {
- // Payout ID can be obtained
- $content = array(
- 'pid' => $pid,
- 'tid' => $tid,
- );
- $OUT .= LOAD_TEMPLATE('admin_payout_overview_form', true, $content);
- } else {
- // Problem obtaining payout ID
- $OUT .= "<div class=\"admin_failed medium\">{--PAYOUT_OBTAIN_ID_FAILED--}</div>\n";
- }
- } else {
- // Extension is not installed
- $OUT .= "<div class=\"admin_failed medium\">{--ADMIN_PAYOUT_NOT_INSTALLED--}</div>\n";
- }
- break;
-
- case 'WERNIS_REQUEST': // Wernis requests
- if (EXT_IS_ACTIVE('wernis')) {
- // Extension is installed so let him send a notification to the user
- $result_pay = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_user_wernis` WHERE userid=%s AND wernis_timestamp=%s LIMIT 1",
- array(bigintval($uid), bigintval($created)), __FILE__, __LINE__);
- list($pid) = SQL_FETCHROW($result_pay);
- SQL_FREERESULT($result_pay);
-
- if ((!empty($pid)) && ($pid > 0)) {
- // Payout ID can be obtained
- $content = array(
- 'pid' => $pid,
- 'tid' => $tid,
- );
- $OUT .= LOAD_TEMPLATE('admin_wernis_overview_form', true, $content);
- } else {
- // Problem obtaining wernis ID
- $OUT .= "<div class=\"admin_failed medium\">{--WERNIS_OBTAIN_ID_FAILED--}</div>\n";
- }
- } else {
- // Extension is not installed
- $OUT .= "<div class=\"admin_failed medium\">{--ADMIN_WERNIS_NOT_INSTALLED--}</div>\n";
- }
- break;
-
- case 'HOLIDAY_REQUEST': // Holiday requests
- $OUT .= LOAD_TEMPLATE('admin_task_holiday', true, $uid);
- break;
-
- case 'NL_UNSUBSCRIBE': // Newsletter unsubscriptions
- $result = SQL_QUERY_ESC("SELECT nl_timespan FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
- array(bigintval($uid)), __FILE__, __LINE__);
- list($span) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
-
- if ($span > 0) {
- // Undone unscubscribe request
- $content = array(
- 'uid' => $uid,
- 'id' => $tid
- );
- $OUT .= LOAD_TEMPLATE('admin_newsletter_tsk', true, $content);
- } else {
- // Already unsubscribed
- $OUT .= "<div class=\"admin_failed medium\">".ADMIN_NL_UNSUBSCRIBE_ALREADY."</div>\n";
- }
- break;
-
- default: // Unknown task type
- DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown task type %s detected.", $type));
- $OUT .= "<div class=\"admin_failed medium\">".sprintf(getMessage('ADMIN_UNKNOWN_TASK_TYPE'), $type, $id)."</div>\n";
- break;
+ case 'WERNIS_REQUEST': // Wernis requests
+ if (isExtensionActive('wernis')) {
+ // Extension is installed so let him send a notification to the user
+ $result_pay = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_wernis` WHERE `userid`=%s AND wernis_timestamp=%s LIMIT 1",
+ array(bigintval($taskData['userid']), bigintval($taskData['task_created'])), __FILE__, __LINE__);
+ list($pid) = SQL_FETCHROW($result_pay);
+ SQL_FREERESULT($result_pay);
+
+ if ((!empty($pid)) && ($pid > 0)) {
+ // Payout id can be obtained
+ $content = array(
+ 'pid' => $pid,
+ 'tid' => $taskData['id'],
+ );
+ $OUT .= loadTemplate('admin_wernis_overview_form', true, $content);
+ } else {
+ // Problem obtaining wernis id
+ $OUT .= '<div class="notice medium">{--WERNIS_OBTAIN_ID_FAILED--}</div>';
+ }
+ } else {
+ // Extension is not installed
+ $OUT .= '<div class="notice medium">{--ADMIN_WERNIS_NOT_INSTALLED--}</div>';
+ }
+ break;
+
+ case 'HOLIDAY_REQUEST': // Holiday requests
+ $OUT .= loadTemplate('admin_task_holiday', true, $taskData['userid']);
+ break;
+
+ case 'MEMBER_ORDER': // Member mail orders
+ $OUT .= loadTemplate('admin_task_order', true, $taskId);
+ break;
+
+ default: // Unknown task type
+ logDebugMessage(__FILE__, __LINE__, sprintf("Unknown task type %s detected.", $taskData['task_type']));
+ $OUT .= '<div class="notice medium">' . sprintf(getMessage('ADMIN_UNKNOWN_TASK_TYPE'), $taskData['task_type'], $taskId) . '</div>';
+ break;