phpBMS

Changeset 713 for trunk

Show
Ignore:
Timestamp:
01/05/10 11:43:59 (2 years ago)
Author:
nate
Message:
  • Updated SugarCRM import to work with new uuid system and to be compatible with v5.5.0 of SugerCRM.
Location:
trunk/phpbms/modules/bms
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/phpbms/modules/bms/clients_import.php

    r702 r713  
    128128                // the forms list. 
    129129 
    130                 $list = array("phpBMS csv file" => 0, "Sugar CRM (v5.0)" => 1); 
     130                $list = array("phpBMS csv file" => 0, "Sugar CRM (v5.5.0)" => 1); 
    131131                $default = 0; 
    132132                if(isset($_POST["importType"])) 
  • trunk/phpbms/modules/bms/include/clients.php

    r710 r713  
    11891189                                                case "employees": 
    11901190                                                case "ticker_symbol": 
     1191                                                case "id": 
    11911192                                                        if($data) 
    11921193                                                                $addComments .= "\n".str_replace("_"," ",$name).": ".trim($data); 
     
    12761277                                                                $this->revertID = $theid; 
    12771278 
     1279                                                        $theuuid = getUuid($this->table->db, "tbld:6d290174-8b73-e199-fe6c-bcf3d4b61083", (int) $theid); 
     1280                                                         
    12781281                                                        //If it is a sugarcrm import, insert the shipping address as well 
    12791282                                                        $addressVerify = array(); 
     
    12991302                                                                                        `addresstorecord`.`defaultshipto` = '0' 
    13001303                                                                                WHERE 
    1301                                                                                         `addresstorecord`.`recordid` = '".((int) $theid)."' 
     1304                                                                                        `addresstorecord`.`recordid` = '".mysql_real_escape_string($theuuid)."' 
    13021305                                                                                        AND 
    1303                                                                                         `addresstorecord`.`tabledefid` = '2'; 
     1306                                                                                        `addresstorecord`.`tabledefid` = 'tbld:6d290174-8b73-e199-fe6c-bcf3d4b61083'; 
    13041307                                                                                "; 
    13051308 
     
    13071310 
    13081311                                                                        $variables["title"] = "Main Shipping Address"; 
    1309                                                                         $variables["tabledefid"] = 2; 
    1310                                                                         $variables["recordid"] = $theid; 
     1312                                                                        $variables["tabledefid"] = "tbld:6d290174-8b73-e199-fe6c-bcf3d4b61083"; 
     1313                                                                        $variables["recordid"] = $theuuid; 
    13111314                                                                        $variables["defaultshipto"] = 1; 
    13121315                                                                        $variables["primary"] = 0; 
    13131316                                                                        $variables["existingaddressid"] = false; 
     1317                                                                        $variables["uuid"] = uuid($this->table->address->prefix); 
    13141318 
    13151319                                                                        $addressVerify = $this->table->address->verifyVariables($variables);//verify address 
     
    13911395                                                        `addresses2`.`custom8` AS `shipcustom8` 
    13921396                                                FROM 
    1393                                                         ((((clients INNER JOIN addresstorecord AS `addresstorecord1` ON clients.id = addresstorecord1.recordid AND addresstorecord1.tabledefid=2 AND addresstorecord1.primary=1) INNER JOIN addresses AS addresses1 ON  addresstorecord1.addressid = addresses1.id)LEFT JOIN addresstorecord AS `addresstorecord2` on clients.id = addresstorecord2.recordid AND addresstorecord2.tabledefid=2 AND addresstorecord2.primary=0 AND addresstorecord2.defaultshipto=1) LEFT JOIN addresses AS addresses2 ON  addresstorecord2.addressid = addresses2.id) 
     1397                                                        ((((clients INNER JOIN addresstorecord AS `addresstorecord1` ON clients.uuid = addresstorecord1.recordid AND addresstorecord1.tabledefid='tbld:6d290174-8b73-e199-fe6c-bcf3d4b61083' AND addresstorecord1.primary=1) INNER JOIN addresses AS addresses1 ON  addresstorecord1.addressid = addresses1.uuid)LEFT JOIN addresstorecord AS `addresstorecord2` on clients.uuid = addresstorecord2.recordid AND addresstorecord2.tabledefid='tbld:6d290174-8b73-e199-fe6c-bcf3d4b61083' AND addresstorecord2.primary=0 AND addresstorecord2.defaultshipto=1) LEFT JOIN addresses AS addresses2 ON  addresstorecord2.addressid = addresses2.uuid) 
    13941398                                                WHERE 
    13951399                                                        `clients`.`id` IN (".$inStatement.") 
     
    14371441 
    14381442                                //list of values that should not be displayed 
    1439                                 $removalArray = array("id", "modifiedby", "modifieddate", "createdby", "creationdate", "notes", "title", "shiptoname"); 
     1443                                $removalArray = array("id", "modifiedby", "modifieddate", "createdby", "creationdate", "notes", "title", "shiptoname", "uuid"); 
    14401444                                //gets the address table's columnnames/information (fields) 
    14411445                                $addressArray = $this->table->address->fields; 
phpBMS vulnerability assesment provided by Orvant Inc. Copyright © 2010 Kreotek, LLC. All Rights reserved.