phpBMS

Changeset 766

Show
Ignore:
Timestamp:
01/18/10 13:05:01 (2 years ago)
Author:
nate
Message:
  • Changed the delete_record for clients to also set canemail to 0.
  • When inactivating a client from the addedit, javascript will also make sure canemail is unchecked (although this can be manually reset).
Location:
trunk/phpbms/modules/bms
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/phpbms/modules/bms/include/clients.php

    r760 r766  
    686686        class clientsSearchFunctions extends searchFunctions{ 
    687687 
    688                 function consolidate_clients($useUuid = false){ 
    689  
    690                     $noOutput = true; 
    691                     include("modules/bms/clients_consolidate.php"); 
    692  
    693                     $consolidator = new clientConsolidator($this->db); 
    694  
    695                     $consolidator->showPicker($this->idsArray, $useUuid); 
    696                     exit(); 
    697  
    698  
    699                 }//end function consolidate_clients 
     688                function consolidate_clients($useUuid = false){ 
     689 
     690                        $noOutput = true; 
     691                        include("modules/bms/clients_consolidate.php"); 
     692 
     693                        $consolidator = new clientConsolidator($this->db); 
     694 
     695                        $consolidator->showPicker($this->idsArray, $useUuid); 
     696                        exit(); 
     697 
     698 
     699                }//end function consolidate_clients 
    700700 
    701701                function mark_asclient($useUuid = false){ 
     
    947947                        } 
    948948                } 
     949                 
     950                 
     951                /* 
     952                 * function delete_record 
     953                 * @param bool $useUUID Whether the identifiers passed to the constructor are integer ids or string uuids. 
     954                 */ 
     955                 
     956                function delete_record($useUUID = false) { 
     957                         
     958                        if(!$useUUID) 
     959                                $whereclause = $this->buildWhereClause(); 
     960                        else 
     961                                $whereclause = $this->buildWhereClause($this->maintable.".uuid"); 
     962 
     963                         
     964                        $querystatement = " 
     965                                UPDATE 
     966                                        `clients` 
     967                                SET 
     968                                        `clients`.`inactive` = '1', 
     969                                        `clients`.`canemail` = '0', 
     970                                        `modifiedby` = ".$_SESSION["userinfo"]["id"].", 
     971                                        `modifieddate` = NOW() 
     972                                WHERE 
     973                                        ".$whereclause; 
     974                                         
     975                        $endmessage =" marked inactive"; 
     976                         
     977                        $queryresult = $this->db->query($querystatement); 
     978                        $message = $this->buildStatusMessage().$endmessage; 
     979 
     980                        return $message; 
     981                         
     982                }//end function 
    949983 
    950984 
  • trunk/phpbms/modules/bms/javascript/client.js

    r702 r766  
    137137                        alert("No valid address given"); 
    138138 
     139        },//end method 
     140         
     141        inactivate: function(){ 
     142                 
     143                var inactive = getObjectFromID("inactive"); 
     144                var canemail = getObjectFromID("canemail"); 
     145                 
     146                if(inactive.checked === true) 
     147                        canemail.checked = false; 
     148                 
    139149        }//end method 
    140150 
     
    147157        var mapIt = getObjectFromID("buttonMap"); 
    148158        connect(mapIt, "onclick", client.mapIt); 
     159         
     160        var inactive = getObjectFromID("inactive"); 
     161        connect(inactive, "onchange", client.inactivate); 
    149162 
    150163        var company = getObjectFromID("company"); 
Scanned by Orvant Copyright © 2010 Kreotek, LLC. All Rights reserved.