phpBMS

Changeset 686

Show
Ignore:
Timestamp:
12/21/09 16:58:44 (2 years ago)
Author:
nate
Message:
  • Removed unneeded setting from the MailChimp? module.
  • Added additional instructions to the MailChimp? adminsettings.php.
  • Update MailChimp? version information.
  • Fixed error reporting in scheduler_list_sync.php.
  • Fixed sql statement in cron.php and a variable reference in scheduler.php that would break without the installation of the api module.
  • Removed the redundant push_record_ajax.php.
Location:
trunk/phpbms/modules
Files:
1 removed
7 modified

Legend:

Unmodified
Added
Removed
  • trunk/phpbms/modules/base/cron.php

    r665 r686  
    3030                        `scheduler`.`pushrecordid`, 
    3131                        `scheduler`.startdatetime, 
    32                         `scheduler`.enddatetime, 
     32                        `scheduler`.enddatetime 
     33                        "; 
     34                 
     35        if(moduleExists("mod:b2d42220-443b-fe74-dbdb-ed2c0968c38c", $phpbms->modules)){ 
     36                $querystatement .= " 
     37                        , 
    3338                        `tabledefs`.`maintable`, 
    3439                        `modules`.`name` AS `modulename` 
    3540                FROM 
     41                "; 
     42                $querystatement .= " 
    3643                        (((scheduler LEFT JOIN `pushrecords` ON `scheduler`.`pushrecordid` = `pushrecords`.`uuid`) LEFT JOIN `tabledefs` ON `pushrecords`.`originuuid` = `tabledefs`.`uuid`) LEFT JOIN `modules` ON `tabledefs`.`moduleid` = `modules`.`uuid`) 
    37                 WHERE 
    38                         inactive = 0 
    39                         AND startdatetime < NOW() 
    40                         AND (enddatetime > NOW() OR enddatetime IS NULL) 
     44                "; 
     45        }else{ 
     46                $querystatement .= " 
     47                FROM 
     48                "; 
     49                $querystatement .= " 
     50                        `scheduler` 
     51                "; 
     52        }//end if 
     53         
     54        $querystatement .= " WHERE 
     55                        `scheduler`.inactive = '0' 
     56                        AND `scheduler`.startdatetime < NOW() 
     57                        AND (`scheduler`.enddatetime > NOW() OR `scheduler`.enddatetime IS NULL) 
    4158        "; 
    4259 
  • trunk/phpbms/modules/base/include/scheduler.php

    r663 r686  
    151151                                $variables["enddatetime"] = NULL; 
    152152 
     153                         
     154                        if(!isset($variables["scripttype"])) 
     155                                $variables["scripttype"] = "job"; 
     156                                 
    153157                        switch($variables["scripttype"]){ 
    154158                                 
  • trunk/phpbms/modules/mailchimp/adminsettings.php

    r685 r686  
    113113                                                        "field_type"=>"text" 
    114114                                                ); 
    115                                                 $api->listMergeVarAdd($variables["mailchimp_list_id"], "UUID", "phpbms unique user id", $req); 
     115                                                $api->listMergeVarAdd($variables["mailchimp_list_id"], "UUID", "phpBMS unique user id", $req); 
    116116                                                if($api->errorCode){ 
    117117                                                        unset($variables["mailchimp_list_id"]); 
     
    184184                        global $db; 
    185185 
    186                         $theinput = new inputField("mailchimp_apikey",$therecord["mailchimp_apikey"],"MailChimp Apikey", false, NULL, 48); 
    187                         $fields[] = $theinput; 
    188                          
    189                         $theinput = new inputCheckbox("mailchimp_secure", $therecord["mailchimp_secure"], "Use SSL Connection"); 
    190                         $fields[] = $theinput; 
    191                          
    192                         $theinput = new inputField("mailchimp_batch_limit", $therecord["mailchimp_batch_limit"], "Batch Limit"); 
    193                         $fields[] = $theinput; 
    194                          
    195                         $theinput = new inputField("mailchimp_list_id", $therecord["mailchimp_list_id"], "List Id"); 
    196                         $fields[] = $theinput; 
    197                          
    198                         $theinput = new inputField("mailchimp_last_sync_date", $therecord["mailchimp_last_sync_date"], "Last Sync Date"); 
     186                        $theinput = new inputField("mailchimp_apikey",$therecord["mailchimp_apikey"],"mailchimp apikey", false, NULL, 48); 
     187                        $fields[] = $theinput; 
     188                         
     189                        $theinput = new inputCheckbox("mailchimp_secure", $therecord["mailchimp_secure"], "use ssl connection"); 
     190                        $fields[] = $theinput; 
     191                         
     192                        $theinput = new inputField("mailchimp_list_id", $therecord["mailchimp_list_id"], "list id"); 
     193                        $fields[] = $theinput; 
     194                         
     195                        $theinput = new inputField("mailchimp_last_sync_date", $therecord["mailchimp_last_sync_date"], "last sync date"); 
    199196                        $theinput->setAttribute("class", "uneditable"); 
    200197                        $theinput->setAttribute("readonly", "readonly"); 
     
    212209         
    213210        <input type="hidden" id="apikey_changed" name="apikey_changed" value="0" /> 
     211         
     212        <p> 
     213                <span class="notes"> 
     214                        To use this module, you need to create an account with MailChimp 
     215                        (<a href="http://mailchimp.com">http://mailchimp.com</a>). 
     216                </span> 
     217        </p> 
     218         
    214219    <p> 
    215220                <?php echo $theform->showField("mailchimp_apikey");?> 
     
    234239        </p> 
    235240        <p><?php echo $theform->showField("mailchimp_secure");?></p> 
    236         <?php /*echo $theform->showField("mailchimp_batch_limit");*/?> 
    237241        <p><?php echo $theform->showField("mailchimp_last_sync_date");?></p> 
    238242 
  • trunk/phpbms/modules/mailchimp/install/settings.sql

    r677 r686  
    11INSERT INTO `settings` (`name`, `value`) VALUES ('mailchimp_apikey',''); 
    22INSERT INTO `settings` (`name`, `value`) VALUES ('mailchimp_secure','0'); 
    3 INSERT INTO `settings` (`name`, `value`) VALUES ('mailchimp_batch_limit','500'); 
    43INSERT INTO `settings` (`name`, `value`) VALUES ('mailchimp_list_id',''); 
    54INSERT INTO `settings` (`name`, `value`) VALUES ('mailchimp_last_sync_date',''); 
  • trunk/phpbms/modules/mailchimp/manual_list_sync_ajax.php

    r681 r686  
    1010                         MAILCHIMP_LIST_ID, 
    1111                         MAILCHIMP_LAST_SYNC_DATE, 
    12                          MAILCHIMP_BATCH_LIMIT, 
     12                         NULL, 
    1313                         MAILCHIMP_SECURE 
    1414                         ); 
  • trunk/phpbms/modules/mailchimp/scheduler_list_sync.php

    r684 r686  
    11<?php 
    22//uncomment if need debug 
    3 //if(!class_exists("appError")) 
    4 //      include_once("../../include/session.php"); 
     3if(!class_exists("appError")) 
     4        include_once("../../include/session.php"); 
     5         
    56include("include/MCAPI.class.php");//for MCAPI CLASS (listSync class uses it) 
    67include("include/list_sync.php");//for listSync class 
     
    1213                         MAILCHIMP_LIST_ID, 
    1314                         MAILCHIMP_LAST_SYNC_DATE, 
    14                          MAILCHIMP_BATCH_LIMIT, 
     15                         NULL, 
    1516                         MAILCHIMP_SECURE 
    1617                         ); 
     
    2021if(isset($response["type"])){ 
    2122     
    22     if($response["type"] == "error") 
     23    if($response["type"] != "success") 
    2324       foreach($response["details"] AS $errorArray){ 
    2425             
    25             $message = "MailChimp sync failure: ".$errorArray["message"]." (".$errorArray["code"].")"; 
     26            $message = "MailChimp sync ".$response["type"].": ".$errorArray["message"]." (".$errorArray["code"].")"; 
    2627            $log = new phpbmsLog($message, "SCHEDULER", NULL, $db); 
    2728             
  • trunk/phpbms/modules/mailchimp/version.php

    r679 r686  
    99         
    1010        $modules["mailchimp"]["requirements"] =  
    11         "phpBMS Core v0.98 or greater; BMS module v0.98 or greater."; 
     11        "phpBMS Core v0.98 or greater; BMS module v0.98 or greater; A MailChimp account (http://www.mailchimp.com/)."; 
    1212 
    1313?> 
Scanned by Orvant Copyright © 2010 Kreotek, LLC. All Rights reserved.