phpBMS

Changeset 743 for trunk/phpbms

Show
Ignore:
Timestamp:
01/09/10 17:58:06 (2 years ago)
Author:
brieb
Message:
  • Fixed gnereation of uuid errors with attachments and notes related to records
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/phpbms/install/generateuuids.php

    r727 r743  
    115115            $this->createUUIDs("tbld:c595dbe7-6c77-1e02-5e81-c2e215736e9c"); //aritems 
    116116            $this->createUUIDs("tbld:43678406-be25-909b-c715-7e2afc7db601"); //receipts 
    117             $this->createUUIDs("tbld:157b7707-5503-4161-4dcf-6811f8b0322f"); //client email projects 
    118117 
    119118            $this->aritemList = $this->generateUUIDList("aritems"); 
     
    122121            $this->addressList = $this->generateUUIDList("addresses"); 
    123122            $this->productcatList = $this->generateUUIDList("productcategories"); 
     123            $this->productList = $this->generateUUIDList("products"); 
    124124            $this->clientList = $this->generateUUIDList("clients"); 
    125125            $this->statusList = $this->generateUUIDList("invoicestatuses"); 
     
    170170 
    171171        $this->updateFields("files", array("roleid"=>$this->roleList)); 
    172         $this->updateFields("attachments", array("fileid"=>$this->fileList)); 
     172        $this->updateFields("attachments", array("fileid"=>$this->fileList, "tabledefid"=>$this->tabledefList)); 
    173173        $this->updateFields("menu", array("parentid"=>$menuList, "roleid"=>$this->roleList)); 
    174174        $this->updateFields("smartsearches", array("tabledefid"=>$this->tabledefList, "moduleid"=>$this->moduleList)); 
    175175        $this->updateFields("tabs", array("roleid"=>$this->roleList)); 
    176         $this->updateFields("notes", array("assignedtoid"=>$this->userList, "assignedbyid"=>$this->userList, "attachedtabledefid", "parentid"=>$notesList)); 
     176        $this->updateFields("notes", array("assignedtoid"=>$this->userList, "assignedbyid"=>$this->userList, "attachedtabledefid"=>$this->tabledefList, "parentid"=>$notesList)); 
    177177        $this->updateFields("log", array("userid"=>$this->userList)); 
    178178 
     
    213213            $this->updateFields("aritems", array("clientid"=>$this->clientList)); 
    214214            $this->updateFields("prerequisites", array("parentid"=>$this->productList, "childid"=>$this->productList)); 
    215             $this->updateFields("clientemailprojects", array("userid"=>$this->userList)); 
    216215 
    217216            //we would have to run this if their were addresses associated with other records 
     
    321320 
    322321            foreach($fields as $key=>$value) 
    323                 if(strpos($therecord[$key],":") === false) 
    324                     $updateClause .= ", `".$key."` = '".$value[$therecord[$key]]."'"; 
     322                if(strpos($therecord[$key],":") === false && ((int) $therecord[$key])) 
     323                    if(isset($value[$therecord[$key]]) && $therecord[$key] != 0) 
     324                        $updateClause .= ", `".$key."` = '".$value[$therecord[$key]]."'"; 
     325                    else 
     326                        $updateClause .= ", `".$key."` = ''"; 
    325327 
    326328            if($updateClause){ 
     
    509511                * 
    510512            FROM 
    511                 `setings` 
     513                `settings` 
    512514            WHERE 
    513515                `name` = 'default_payment' 
     
    616618                    `id` = ".$therecord["id"]; 
    617619 
     620            $this->db->query($updatestatement); 
     621 
    618622        }//endwhile 
    619623 
phpBMS vulnerability assesment provided by Orvant Inc. Copyright © 2010 Kreotek, LLC. All Rights reserved.