]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/forced_functions.php
Heacy rewrite/cleanup:
[mailer.git] / inc / libs / forced_functions.php
index 1705959c9353480cd4ec253f261aa63ca961bd2c..761e5bd73c72168afb6936305dc9fbc027a11282 100644 (file)
@@ -358,7 +358,6 @@ function changeForcedCampaignStatus ($campaignId, $prevStatus, $newStatus, $data
                'prev_status' => $prevStatus,
                'new_status'  => $newStatus,
                'data'        => $data,
                'prev_status' => $prevStatus,
                'new_status'  => $newStatus,
                'data'        => $data,
-               'abort'       => NULL
        );
 
        // Run pre filter chain
        );
 
        // Run pre filter chain
@@ -401,12 +400,16 @@ function changeForcedCampaignStatus ($campaignId, $prevStatus, $newStatus, $data
 // Notify admin(s) with a selected message and content
 function doForcedNotifyAdmin ($messageType, $content) {
        // Prepare template name
 // Notify admin(s) with a selected message and content
 function doForcedNotifyAdmin ($messageType, $content) {
        // Prepare template name
-       $templateName = sprintf("admin_forced_%s", $messageType);
+       $templateName = sprintf('admin_forced_%s', $messageType);
+
+       // Is the user id valid?
+       if (!isValidId($content['forced_campaign_userid'])) {
+               // No, then use admin-only template
+               $templateName = sprintf('admin_only_forced_%s', $messageType);
+       } // END - if
 
        // Prepare subject
 
        // Prepare subject
-       $subject = sprintf("{--ADMIN_FORCED_NOTIFY_%s_SUBJECT--}",
-               strtoupper($messageType)
-       );
+       $subject = sprintf('{--ADMIN_FORCED_NOTIFY_%s_SUBJECT--}', strtoupper($messageType));
 
        // Is the subject line there?
        if ((substr($subject, 0, 1) == '!') && (substr($subject, -1, 1) == '!')) {
 
        // Is the subject line there?
        if ((substr($subject, 0, 1) == '!') && (substr($subject, -1, 1) == '!')) {
@@ -430,12 +433,10 @@ function doForcedNotifyMember ($messageType, $content) {
        } // END - if
 
        // Prepare template name
        } // END - if
 
        // Prepare template name
-       $templateName = sprintf("member_forced_%s", $messageType);
+       $templateName = sprintf('member_forced_%s', $messageType);
 
        // Prepare subject
 
        // Prepare subject
-       $subject = sprintf("{--MEMBER_FORCED_NOTIFY_%s_SUBJECT--}",
-               strtoupper($messageType)
-       );
+       $subject = sprintf('{--MEMBER_FORCED_NOTIFY_%s_SUBJECT--}', strtoupper($messageType));
 
        // Is the subject line there?
        if ((substr($subject, 0, 1) == '!') && (substr($subject, -1, 1) == '!')) {
 
        // Is the subject line there?
        if ((substr($subject, 0, 1) == '!') && (substr($subject, -1, 1) == '!')) {
@@ -502,7 +503,7 @@ function doTemplateForcedAdSelectionBox ($templateName, $clear, $default = NULL)
        $forcedAds = getArrayFromForcedAdsByType();
 
        // Handle it over to generateSelectionBoxFromArray()
        $forcedAds = getArrayFromForcedAdsByType();
 
        // Handle it over to generateSelectionBoxFromArray()
-       $content = generateSelectionBoxFromArray($forcedAds, 'forced_ads_id', 'forced_ads_id', '', '', '', $default, 'forced_ads_type', FALSE, TRUE);
+       $content = generateSelectionBoxFromArray($forcedAds, 'forced_ads_id', 'forced_ads_id', '', '', '', $default, 'forced_ads_type');
 
        // Return prepared content
        return $content;
 
        // Return prepared content
        return $content;
@@ -514,7 +515,7 @@ function doTemplateForcedCostsSelectionBox ($templateName, $clear, $default = NU
        $forcedCosts = getArrayFromForcedCostsByVisibility();
 
        // Handle it over to generateSelectionBoxFromArray()
        $forcedCosts = getArrayFromForcedCostsByVisibility();
 
        // Handle it over to generateSelectionBoxFromArray()
-       $content = generateSelectionBoxFromArray($forcedCosts, 'forced_costs_id', 'forced_costs_id', '', '', '', $default, '', TRUE, TRUE);
+       $content = generateSelectionBoxFromArray($forcedCosts, 'forced_costs_id', 'forced_costs_id', '', '', '', $default, '', TRUE);
 
        // Return prepared content
        return $content;
 
        // Return prepared content
        return $content;
@@ -523,7 +524,7 @@ function doTemplateForcedCostsSelectionBox ($templateName, $clear, $default = NU
 // Template helper function to create selection box for foreced campaign userid
 function doTemplateForcedCampaignUseridSelectionBox ($templateName, $clear, $default = NULL) {
        // Generate the selection box without all
 // Template helper function to create selection box for foreced campaign userid
 function doTemplateForcedCampaignUseridSelectionBox ($templateName, $clear, $default = NULL) {
        // Generate the selection box without all
-       $content = addMemberSelectionBox($default, FALSE, TRUE, TRUE, 'forced_campaign_userid[]');
+       $content = addMemberSelectionBox($default, FALSE, TRUE, TRUE, 'forced_campaign_userid');
 
        // Return prepared content
        return $content;
 
        // Return prepared content
        return $content;