phpBMS

Changeset 682 for trunk/phpbms/modules

Show
Ignore:
Timestamp:
12/16/09 14:18:55 (2 years ago)
Author:
nate
Message:
  • Removed extraneous code from clients_addedit.php
  • Modified massEmail function in clients.php to support new MailChimp? module
  • Changed the tableoption record relating to massEmail to be installed from the MailChimp? module and not the BMS.
  • Fixed another possible looping bug in list_sync.php
  • Moved some image files from the main install directory to the common/image/ directory.
  • Modified a file name to be spelled correctly.
  • Expanded the feedback in list_sync.php: It will distinguish between non-fatal errors (warnings) and those that stop the script.
  • manual_list_sync.php and manual_list_sync.js have been modified to handle this.
  • Removed unneeded commented information from push_records_addedit.php
Location:
trunk/phpbms/modules
Files:
2 added
7 modified

Legend:

Unmodified
Added
Removed
  • trunk/phpbms/modules/api/push_records_addedit.php

    r651 r682  
    3838*/ 
    3939 
    40 //CREATE TABLE `pushrecords`( 
    41 //  `id` int(11) NOT NULL auto_increment, 
    42 //  `uuid` varchar(64) NOT NULL, 
    43 //  `originuuid` varchar(64) NOT NULL default '', 
    44 //  `destuuid` varchar(64) NOT NULL default '', 
    45 //  `command` varchar(128) NOT NULL default 'insert', 
    46 //  `whereclause` varchar(256) NOT NULL default '', 
    47 //  `name` varchar(128) NOT NULL default '', 
    48 //  `server` varchar(256) NOT NULL DEFAULT '' 
    49 //  `destscript` varchar(256) NOT NULL default '', 
    50 //  `port` int(11) DEFAULT NULL, 
    51 //  `apiusername` varchar(128) NOT NULL default '', 
    52 //  `apipassword` varchar(128) NOT NULL default '', 
    53 //  `ssl` tinyint(4) NOT NULL DEFAULT '0', 
    54 //  `httpformat` varchar(64) NOT NULL default 'POST', 
    55 //  `dataformat` varchar(64) NOT NULL default 'json', 
    56 //  createdby int(11) NOT NULL default '0', 
    57 //  creationdate datetime NOT NULL default '0000-00-00 00:00:00', 
    58 //  modifiedby int(11) default '0', 
    59 //  modifieddate timestamp NOT NULL, 
    60 //  PRIMARY KEY  (id), 
    61 //  UNIQUE KEY (`uuid`) 
    62 //) ENGINE=INNODB; 
    6340        include("../../include/session.php"); 
    6441        include("include/fields.php"); 
  • trunk/phpbms/modules/bms/include/clients.php

    r657 r682  
    686686                        if(DEMO_ENABLED != "true"){ 
    687687                                $_SESSION["emailids"]= $this->idsArray; 
    688                                 goURL("modules/bms/clients_email.php"); 
     688                                goURL("modules/mailchimp/manual_list_sync.php"); 
    689689                        } else { 
    690690                                return "mass e-mail feature disabled in demo"; 
  • trunk/phpbms/modules/bms/install/tableoptions.sql

    r628 r682  
    5252INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `needselect`, `othercommand`, `roleid`, `displayorder`) VALUES ('tbld:6d290174-8b73-e199-fe6c-bcf3d4b61083', 'edit', '1', '1', '0', '', '0'); 
    5353INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `needselect`, `othercommand`, `roleid`, `displayorder`) VALUES ('tbld:6d290174-8b73-e199-fe6c-bcf3d4b61083', 'select', '1', '1', '0', '', '0'); 
    54 INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `needselect`, `othercommand`, `roleid`, `displayorder`) VALUES ('tbld:6d290174-8b73-e199-fe6c-bcf3d4b61083', 'massEmail', 'send mass e-mail', '0', '1', '', '100'); 
    5554INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `needselect`, `othercommand`, `roleid`, `displayorder`) VALUES ('tbld:6d290174-8b73-e199-fe6c-bcf3d4b61083', 'mark_asclient', 'convert to client', '1', '1', '', '50'); 
    5655INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `needselect`, `othercommand`, `roleid`, `displayorder`) VALUES ('tbld:6d290174-8b73-e199-fe6c-bcf3d4b61083', 'stamp_infosent', 'info packet sent', '1', '1', '', '0'); 
  • trunk/phpbms/modules/bms/install/updatev0.98.sql

    r677 r682  
    599599UPDATE `tablegroupings` SET `name` = 'concat(invoices.type ,\"s\",IF(`invoices`.`iscreditmemo`, \" - Credit Memo\", \"\"))' WHERE `name` = 'concat(invoices.type,"s")'; 
    600600--end tablegroupings UPDATE-- 
     601--tableoptions DELETE-- 
     602DELETE FROM `tableoptions WHERE `name`='massEmail'; 
     603--end tableoptions DELETe 
    601604--tableoptions INSERT-- 
    602605INSERT INTO `tableoptions` (`tabledefid`, `name`, `option`, `needselect`, `othercommand`, `roleid`, `displayorder`) VALUES ('tbld:157b7707-5503-4161-4dcf-6811f8b0322f', 'import', '0', '0', '0', 'Admin', '0'); 
  • trunk/phpbms/modules/mailchimp/include/list_sync.php

    r681 r682  
    109109      *   @param string $message Text of error message 
    110110      *   @param int $errorCode Error number 
    111       *   @param bool $stopScript Whether or not to stop the process function 
    112       */ 
    113      
    114     function _addError($message, $errorCode = NULL, $stopScript = false){ 
     111      *   @param bool $fatal Whether or not the error is fatal, and if the process 
     112      *   function needs to be stopped. 
     113      */ 
     114     
     115    function _addError($message, $errorCode = NULL, $fatal = false){ 
    115116         
    116117        $tempArray["message"] = $message; 
    117118        $tempArray["code"] = $errorCode; 
    118119         
     120        if($stopScript){ 
     121            $this->stopScript = true; 
     122            $tempArray["errorType"] = "error"; 
     123        }else{ 
     124            $tempArray["errorType"] = "warning"; 
     125        }//end if 
     126         
    119127        $this->errors[] = $tempArray; 
    120          
    121         if($stopScript) 
    122             $this->stopScript = true; 
    123128         
    124129    }//end function 
     
    142147        if(count($this->errors)){ 
    143148             
    144             $return["type"] = "error"; 
     149            if($this->stopScript) 
     150                $return["type"] = "error"; 
     151            else 
     152                $return["type"] = "warning"; 
     153             
    145154            $return["details"] = $this->errors; 
    146155             
     
    171180          */ 
    172181        $unsubscribed = array(); 
     182        $start = 0; 
    173183        do{ 
    174184             
    175             $members = $this->api->listMembers($this->listId, 'unsubscribed', $this->lastSyncDate, 0, $this->batchLimit); 
     185            $members = $this->api->listMembers($this->listId, 'unsubscribed', $this->lastSyncDate, $start, $this->batchLimit); 
    176186            if($this->api->errorCode){ 
    177187                $this->_addError("Unable to load listMembers(): ".$this->api->errorMessage, $this->api->errorCode, true); 
     
    191201            }//end foreach 
    192202             
     203            $start++; 
    193204        }while(count($members) == $this->batchLimit); 
    194205         
     
    196207          *  pull all the cleaned  
    197208          */ 
     209        $start = 0; 
    198210        do{ 
    199211             
    200             $members = $this->api->listMembers($this->listId, 'cleaned', $this->lastSyncDate, 0, $this->batchLimit); 
     212            $members = $this->api->listMembers($this->listId, 'cleaned', $this->lastSyncDate, $start, $this->batchLimit); 
    201213            if($this->api->errorCode){ 
    202214                $this->_addError("Unable to load listMembers(): ".$this->api->errorMessage, $this->api->errorCode, true); 
     
    215227            }//end foreach 
    216228             
     229            $start++; 
    217230        }while(count($members) == $this->batchLimit); 
    218231         
  • trunk/phpbms/modules/mailchimp/install/install.php

    r679 r682  
    4141                        "modules", 
    4242                        "settings", 
     43            "tableoptions" 
    4344                        ); 
  • trunk/phpbms/modules/mailchimp/javascript/manual_list_sync.js

    r681 r682  
    1818            resultPic.className = "success"; 
    1919            resultPic.innerHTML = "Success"; 
     20        }else if(JSONresponse.type == "warning"){ 
     21            resultPic.className = "warning"; 
     22            resultPic.innerHTML = "Minor Errors (see results)"; 
    2023        }else{ 
    21             resultPic.className = "error"; 
    22             resultPic.innerHTML = "Error (see debug)"; 
    23         }//end if 
     24                        resultPic.className = "fail"; 
     25            resultPic.innerHTML = "Fatal Error"; 
     26                }//endif 
    2427         
    2528        list.reportResult(JSONresponse); 
     
    3033         
    3134        var resultText = getObjectFromID("resultText"); 
    32 console.log(response); 
     35 
    3336        if(response.type && response.details){ 
    3437             
     
    3639                resultText.innerHTML = "Success"; 
    3740            }else{ 
    38                 resultText.innerHTML = "Errror:"; 
     41                resultText.innerHTML = "The following errors were found:"; 
    3942                for(var error in response.details){ 
    4043                     
    4144                    result.innerHTML += "\n"; 
    42                     result.innerHTML += error.message+"( "+error.code+" )" 
     45                    result.innerHTML += capitalize(error.type)+": "+error.message+"( "+error.code+" )" 
    4346                     
    4447                }//end for 
     
    5255        }//end if 
    5356         
    54     }//end function 
     57    },//end function 
     58     
     59    loadOptionAccordion:function(){ 
     60                 
     61                var optionsDivs = new Array(); 
     62                optionsDivs[optionsDivs.length]=getObjectFromID("resultDiv"); 
     63         
     64                var optionsLinks = new Array(); 
     65                optionsLinks[optionsLinks.length]=getObjectFromID("showResults"); 
     66         
     67                var optionsAccordion = new fx.Accordion(optionsLinks, optionsDivs, {opacity: true, duration:250, onComplete:function(){list.expandResultText()}}); 
     68                 
     69        },//end function 
     70     
     71    expandResultText:function(){ 
     72         
     73        var switchButton=getObjectFromID("showResults"); 
     74         
     75                if(switchButton.className=="graphicButtons buttonDown"){ 
     76                        switchButton.className="graphicButtons buttonUp" 
     77                        switchButton.firstChild.innerHTML="hide results"; 
     78                } else { 
     79                        switchButton.className="graphicButtons buttonDown" 
     80                        switchButton.firstChild.innerHTML="show results"; 
     81                }//end if 
     82         
     83    },//end function 
     84         
     85        goToSearchPage:function(){ 
     86                document.location = "../../search.php?id=tbld%3A6d290174-8b73-e199-fe6c-bcf3d4b61083" 
     87        }//end function 
    5588     
    5689} 
     90function capitalize(string){ 
     91         
     92        var theReturn = string.substring(0,1).toUpperCase(); 
     93        theReturn += string.substring(1, string.length); 
     94        return theReturn; 
     95         
     96}//end function 
    5797 
    5898connect(window, "onload", function(){ 
    5999    
    60    var sync = getObjectFromID("sync") 
     100   list.loadOptionAccordion(); 
     101    
     102   var sync = getObjectFromID("sync"); 
    61103   connect(sync, "onclick", list.sync); 
    62104    
     105   var cancelButton = getObjectFromID("cancelButton"); 
     106   connect(cancelButton, "onclick", list.goToSearchPage); 
    63107     
    64108}); 
phpBMS vulnerability assesment provided by Orvant Inc. Copyright © 2010 Kreotek, LLC. All Rights reserved.