phpBMS

Ticket #386: errors.patch

File errors.patch, 16.4 KB (added by a.tangemann@…, 2 years ago)
  • modules/base/include/tabledefs_columns_include.php

     
    221221                tabledefid = '".$this->tabledefuuid."' 
    222222                AND displayorder > ".$therecord["displayorder"]; 
    223223 
    224         if($this->db->query($queryresult)){ 
     224        if($this->db->query($updatestatement)){ 
    225225 
    226226            $deletestatement = " 
    227227                DELETE FROM 
  • modules/bms/clientemailprojects_edit.php

     
    112112                <legend>e-mail</legend> 
    113113                <p> 
    114114                        <label for="from">from</label><br /> 
    115                         <?php if(is_numeric($therecord["emailfrom"])) $therecord["emailfrom"]=getEmailInfo($therecord["emailfrom"]);?> 
     115                        <?php if(is_numeric($therecord["emailfrom"])) $therecord["emailfrom"]=$thetable->getEmailInfo($therecord["emailfrom"]);?> 
    116116                        <input id="from" name="from" value="<?php echo htmlQuotes($therecord["emailfrom"])?>" readonly="readonly" class="uneditable" size="60" /> 
    117117                </p> 
    118118                <p> 
  • modules/bms/clients_email.php

     
    1 <?php  
     1<?php 
    22/* 
    33 $Rev$ | $LastChangedBy$ 
    44 $LastChangedDate$ 
     
    4040        include("include/fields.php"); 
    4141 
    4242        include("./include/clients_email_include.php"); 
    43          
    44          
     43 
     44 
    4545        $thecommand="showoptions"; 
    4646        if(isset($_POST["command"])) $thecommand=$_POST["command"]; 
    47          
     47 
    4848        switch($thecommand){ 
    4949                case "send email": 
    5050                         // first build the where clause 
     
    5353                                        $whereclause="WHERE "; 
    5454                                        foreach($_SESSION["emailids"] as $id) 
    5555                                                $whereclause.="clients.id=".$id." or "; 
    56                                         $whereclause=substr($whereclause,0,strlen($whereclause)-3);                                      
     56                                        $whereclause=substr($whereclause,0,strlen($whereclause)-3); 
    5757                                break; 
    5858                                case "savedsearch": 
    5959                                        $querystatement="SELECT sqlclause FROM usersearches WHERE id=".$_POST["savedsearches"]; 
     
    6363                                break; 
    6464                                case "all": 
    6565                                        $whereclause=""; 
    66                                 break;                                           
     66                                break; 
    6767                        }//end switch 
    6868                        //next the from: 
    69                         $_SESSION["massemail"]["from"]=str_replace("]",">",str_replace("[","<",$_POST["ds-email"]));                     
     69                        $_SESSION["massemail"]["from"]=str_replace("]",">",str_replace("[","<",$_POST["ds-email"])); 
    7070                        $_SESSION["massemail"]["whereclause"]=$whereclause; 
    7171                        $_SESSION["massemail"]["subject"]=$_POST["subject"]; 
    7272                        $_SESSION["massemail"]["body"]=$_POST["body"]; 
    7373                        $_SESSION["massemail"]["savedproject"]=$_POST["pid"]; 
    74                          
     74 
    7575                        $querystatement="SELECT id,email, if(clients.lastname!=\"\",concat(clients.lastname,\", \",clients.firstname,if(clients.company!=\"\",concat(\" (\",clients.company,\")\"),\"\")),clients.company) AS name FROM clients ".$whereclause; 
    7676                        $sendqueryresult=$db->query($querystatement); 
    7777                        if(!$sendqueryresult) $error = new appError(300,"Error with: ".$querystatement); 
    78                          
     78 
    7979                break; 
    8080                case "delete project": 
    8181                        deleteProject($db, $_POST["projectid"]); 
     
    9696                case "save project": 
    9797                        $id=saveProject($db,addSlashesToArray($_POST)); 
    9898                        $statusmessage="Project Saved"; 
    99                         $therecord=loadProject($id); 
     99                        $therecord=loadProject($db, $id); 
    100100                        $thecommand="showoptions"; 
    101101                break; 
    102                  
     102 
    103103                case "done": 
    104104                case "cancel": 
    105105                        goURL(APP_PATH."search.php?id=2"); 
    106                          
     106 
    107107                break; 
    108108        } 
    109          
    110          
     109 
     110 
    111111        $pageTitle="Client/Prospect E-Mail"; 
    112   
     112 
    113113        $phpbms->cssIncludes[] = "pages/clientemail.css"; 
    114114        $phpbms->jsIncludes[] = "modules/bms/javascript/clientemail.js"; 
    115115 
    116116                //Form Elements 
    117117                //============================================================== 
    118118                $theform = new phpbmsForm(); 
    119                  
     119 
    120120                if(is_numeric($therecord["emailfrom"])) 
    121121                        $theid=$therecord["emailfrom"]; 
    122122                else 
    123123                        $theid=0; 
    124                  
     124 
    125125                $theinput = new inputSmartSearch($db, "email", "Pick Active User Email", $theid, "from"); 
    126126                $theform->addField($theinput); 
    127                  
     127 
    128128                $theform->jsMerge(); 
    129129                //============================================================== 
    130130                //End Form Elements 
    131                  
     131 
    132132                if($therecord["emailto"]!="selected" AND $therecord["emailto"]!="all") 
    133133                        $phpbms->bottomJS[] ='thediv=getObjectFromID("showsavedsearches");thediv.style.display="block"'; 
    134134 
    135135                if(!is_numeric($therecord["emailfrom"])) 
    136136                        $phpbms->bottomJS[] ='thefield=getObjectFromID("ds-email");thefield.value="'.$therecord["emailfrom"].'"'; 
    137                  
     137 
    138138                if($thecommand=="send email"){ 
    139                  
    140                         $phpbms->topJS[]='               
    141                         ids=new Array();                         
     139 
     140                        $phpbms->topJS[]=' 
     141                        ids=new Array(); 
    142142                        emails=new Array(); 
    143143                        names= new Array();'; 
    144                          
     144 
    145145                        while($therecord = $db->fetchArray($sendqueryresult)){ 
    146146                                $phpbms->topJS[]="ids[ids.length]=".$therecord["id"].";"; 
    147147                                $phpbms->topJS[]="names[names.length]=\"".$therecord["name"]."\";"; 
    148148                                $phpbms->topJS[]="emails[emails.length]=\"".$therecord["email"]."\";"; 
    149                         }                        
     149                        } 
    150150                }//end if 
    151   
     151 
    152152        include("header.php") 
    153153 
    154154?> 
    155155 
    156156        <div class="bodyline" id="mainBG"> 
    157157                <h1 id="topTitle"><span><?php echo $pageTitle?></span></h1> 
    158                  
     158 
    159159                <form action="<?php echo $_SERVER["PHP_SELF"] ?>" method="post" name="theform" id="theform"> 
    160160        <?php if($thecommand=="showoptions") { ?> 
    161          
     161 
    162162                <input type="hidden" name="pid" id="pid" value="<?php echo $therecord["id"]?>" /> 
    163163                <div class="box"> 
    164                          
     164 
    165165                        <p id="toP"> 
    166                                 <label for="therecords">to</label><br />                         
     166                                <label for="therecords">to</label><br /> 
    167167                                <select id="therecords" name="therecords" onchange="showSavedSearches(this);"> 
    168168                                        <option value="selected" <?php if ($therecord["emailto"]=="selected") echo "selected=\"selected\""?>>e-mail addresses from selected records (<?php echo count($_SESSION["emailids"]) ?> record<?php if(count($_SESSION["emailids"])>1) echo "s"?>)</option> 
    169169                                        <option value="savedsearch" <?php if ($therecord["emailto"]!="selected" AND $therecord["emailto"]!="all") echo "selected=\"selected\""?>>e-mail addresses from saved search...</option> 
    170                                 </select>                                
     170                                </select> 
    171171                        </p> 
    172172                        <p id="showsavedsearches" > 
    173173                                <label for="savedsearches">load e-mail addresses from saved search...</label><br /> 
    174                                 <?php showSavedSearches($db,$therecord["emailto"]); ?>                   
     174                                <?php showSavedSearches($db,$therecord["emailto"]); ?> 
    175175                        </p> 
    176                          
     176 
    177177                        <div class="fauxP" id="fromDiv"><?php  $theform->showField("email")?></div> 
    178                          
     178 
    179179                        <p> 
    180180                                <label for="subject">subject</label><br /> 
    181                                 <input type="text" name="subject" id="subject" maxlength="128" value="<?php echo htmlQuotes($therecord["subject"])?>"/>                  
     181                                <input type="text" name="subject" id="subject" maxlength="128" value="<?php echo htmlQuotes($therecord["subject"])?>"/> 
    182182                        </p> 
    183183                </div> 
    184                  
     184 
    185185                <div class="box"> 
    186186                        <p> 
    187187                                <label for="addfield">add data field</label><br /> 
     
    193193                                <textarea class="mono" rows="15" name="body" id="body" cols="40" ><?php echo $therecord["body"]?></textarea> 
    194194                        </p> 
    195195                </div> 
    196                  
     196 
    197197                <div class="box"> 
    198198                        <div id="projectButtons"> 
    199199                                <input type="button" name="loademail"   id="loademil" value="load project..." class="Buttons" onclick="showSavedProjects();" /> 
     
    204204                        <div align="right"> 
    205205                                <input type="submit" name="command"     id="sendemail" value="send email" class="Buttons" /> 
    206206                                <input type="submit" name="command"     id="cancel" value="cancel" class="Buttons" /> 
    207                                 <input type="submit" name="command"     id="othercommand" value="" class="Buttons" />                            
     207                                <input type="submit" name="command"     id="othercommand" value="" class="Buttons" /> 
    208208                        </div> 
    209209                </div> 
    210                  
     210 
    211211                <div id="loadedprojects"> 
    212212                        <p><?php showSavedProjects($db)?></p> 
    213213                        <p align="right"> 
     
    217217                        </p> 
    218218                </div> 
    219219<?php } elseif($thecommand=="send email"){?> 
    220                  
     220 
    221221                <div id="processingWrap"> 
    222222                        <div class="box"> 
    223223                                <div class="fauxP"> 
  • modules/bms/install/tablecolumns.sql

     
    4444INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`, `roleid`) VALUES ('tbld:62fe599d-c18f-3674-9e54-b62c2d6b1883', 'payment', 'paymentmethods.name', 'left', '', '7', '', '0', '', NULL, ''); 
    4545INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`, `roleid`) VALUES ('tbld:6d290174-8b73-e199-fe6c-bcf3d4b61083', 'e-mail', 'clients.email', 'left', '', '3', '', '0', '', NULL, ''); 
    4646INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`, `roleid`) VALUES ('tbld:6d290174-8b73-e199-fe6c-bcf3d4b61083', 'has credit', 'clients.hascredit', 'center', '', '1', '', '0', '', 'boolean', 'role:c9439c3c-499b-7bcc-ee14-fec5bfcf5fc2'); 
    47 INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`, `roleid`) VALUES ('tbld:6d290174-8b73-e199-fe6c-bcf3d4b61083', 'name / location', 'CONCAT(\'[b]\',IF(clients.company != \'\', CONCAT(clients.company,IF(clients.lastname != \'\' OR clients.firstname != \'\', CONCAT(\' (\',if(clients.lastname != \'\', clients.lastname, \'{blank}\'),\', \',if(clients.firstname != \'\', clients.firstname, \'{blank}\'),\')\'), \'\')), IF(clients.lastname != \'\' OR clients.firstname != \'\', CONCAT(if(clients.lastname != \'\', clients.lastname, \'{blank}\'),\', \',if(clients.firstname != \'\', clients.firstname, \'{blank}\')), \'\')),\'[/b][br][space]\', IF(addresses.city != \'\' OR addresses.state !=\'\' OR addresses.postalcode != \'\', CONCAT(IF(addresses.city != \'\',addresses.city,\'\'),\', \',IF(addresses.state != \'\', addresses.state, \'\'),\' \',IF(addresses.postalcode != \'\', addresses.postalcode, \'\')),\'(no location)\'))', 'left', '', '2', 'concat(clients.company,cliennts.lastname,clients.firstname)', '0', '100%', 'bbcode', ''); 
     47INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`, `roleid`) VALUES ('tbld:6d290174-8b73-e199-fe6c-bcf3d4b61083', 'name / location', 'CONCAT(\'[b]\',IF(clients.company != \'\', CONCAT(clients.company,IF(clients.lastname != \'\' OR clients.firstname != \'\', CONCAT(\' (\',if(clients.lastname != \'\', clients.lastname, \'{blank}\'),\', \',if(clients.firstname != \'\', clients.firstname, \'{blank}\'),\')\'), \'\')), IF(clients.lastname != \'\' OR clients.firstname != \'\', CONCAT(if(clients.lastname != \'\', clients.lastname, \'{blank}\'),\', \',if(clients.firstname != \'\', clients.firstname, \'{blank}\')), \'\')),\'[/b][br][space]\', IF(addresses.city != \'\' OR addresses.state !=\'\' OR addresses.postalcode != \'\', CONCAT(IF(addresses.city != \'\',addresses.city,\'\'),\', \',IF(addresses.state != \'\', addresses.state, \'\'),\' \',IF(addresses.postalcode != \'\', addresses.postalcode, \'\')),\'(no location)\'))', 'left', '', '2', 'concat(clients.company,clients.lastname,clients.firstname)', '0', '100%', 'bbcode', ''); 
    4848INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`, `roleid`) VALUES ('tbld:6d290174-8b73-e199-fe6c-bcf3d4b61083', 'type', 'clients.type', 'left', '', '0', '', '0', '', NULL, ''); 
    4949INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`, `roleid`) VALUES ('tbld:6d290174-8b73-e199-fe6c-bcf3d4b61083', 'phone', 'IF(clients.workphone != \'\' OR clients.homephone != \'\' OR clients.mobilephone != \'\' OR clients.otherphone != \'\',IF(clients.workphone != \'\', concat(clients.workphone, \' (w)\'), IF(clients.homephone != \'\', concat(clients.homephone, \' (h)\'), IF(clients.mobilephone != \'\', concat(clients.mobilephone, \' (m)\'), IF(clients.otherphone != \'\', concat(clients.otherphone, \' (o)\'), \'\')))) ,\'\')', 'left', '', '4', 'concat(clients.workphone, clients.homephone, clients.mobilephone,clients.otherphone)', '0', '', NULL, ''); 
    5050INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`, `roleid`) VALUES ('tbld:7a9e87ed-d165-c4a4-d9b9-0a4adc3c5a34', 'part number', 'products.partnumber', 'left', '', '0', '', '0', '', NULL, ''); 
     
    8383INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`, `roleid`) VALUES ('tbld:f993cf23-ad4a-047b-e920-d45fee1dc08e', 'name', 'IF(clients.company != \'\', CONCAT(clients.company,IF(clients.lastname != \'\' OR clients.firstname != \'\', CONCAT(\' (\',if(clients.lastname != \'\', clients.lastname, \'{blank}\'),\', \',if(clients.firstname != \'\', clients.firstname, \'{blank}\'),\')\'), \'\')), IF(clients.lastname != \'\' OR clients.firstname != \'\', CONCAT(if(clients.lastname != \'\', clients.lastname, \'{blank}\'),\', \',if(clients.firstname != \'\', clients.firstname, \'{blank}\')), \'\'))', 'left', '', '2', 'concat(clients.company,clients.lastname,clients.firstname)', '1', '100%', NULL, ''); 
    8484INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`, `roleid`) VALUES ('tbld:fa8a0ddc-87d3-a9e9-60b0-1bab374b2993', 'name', 'shippingmethods.name', 'left', '', '1', '', '0', '99%', NULL, ''); 
    8585INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`, `roleid`) VALUES ('tbld:fa8a0ddc-87d3-a9e9-60b0-1bab374b2993', 'estimate', 'shippingmethods.canestimate', 'center', '', '2', '', '0', '', 'boolean', ''); 
    86 INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`, `roleid`) VALUES ('tbld:fa8a0ddc-87d3-a9e9-60b0-1bab374b2993', 'priority', 'shippingmethods.priority', 'right', '', '0', '', '0', '', NULL, ''); 
    87  No newline at end of file 
     86INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`, `roleid`) VALUES ('tbld:fa8a0ddc-87d3-a9e9-60b0-1bab374b2993', 'priority', 'shippingmethods.priority', 'right', '', '0', '', '0', '', NULL, ''); 
     87INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`, `roleid`) VALUES ('tbld:b3d23f9e-d363-0357-e383-10eb89f5daa3', 'id', 'contacts.id', 'left', '', 0, '', 0, '', NULL, ''); 
     88INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`, `roleid`) VALUES ('tbld:b3d23f9e-d363-0357-e383-10eb89f5daa3', 'phone', 'IF(contacts.workphone != '''' OR contacts.homephone != '''' OR contacts.mobilephone != '''' OR contacts.otherphone != '''',IF(contacts.workphone != '''', concat(contacts.workphone, '' (w)''), IF(contacts.homephone != '''', concat(contacts.homephone, '' (h)''), IF(contacts.mobilephone != '''', concat(contacts.mobilephone, '' (m)''), IF(contacts.otherphone != '''', concat(contacts.otherphone, '' (o)''), '''')))) ,'''')', 'left', '', 3, 'concat(clients.workphone, clients.homephone, clients.mobilephone,clients.otherphone)', 0, '', NULL, ''); 
     89INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`, `roleid`) VALUES ('tbld:b3d23f9e-d363-0357-e383-10eb89f5daa3', 'e-mail', 'contacts.email', 'left', '', 2, '', 0, '', NULL, ''); 
     90INSERT INTO `tablecolumns` (`tabledefid`, `name`, `column`, `align`, `footerquery`, `displayorder`, `sortorder`, `wrap`, `size`, `format`, `roleid`) VALUES ('tbld:b3d23f9e-d363-0357-e383-10eb89f5daa3', 'name', 'CONCAT(''[b]'',IF(contacts.lastname = '''', contacts.firstname, CONCAT(CONCAT(contacts.firstname, '', ''),contacts.lastname)),''[/b]'')', 'left', '', 1, 'concat(contacts.lastname,contacts.firstname)', 0, '100%', 'bbcode', ''); 
  • modules/bms/invoices_addresses_ajax.php

     
    106106 
    107107                        } else { 
    108108 
    109                                 ?><p><em>no records found</em></p><? 
     109                                ?><p><em>no records found</em></p><?php 
    110110 
    111111                        }//endif numrows 
    112112 
phpBMS vulnerability assesment provided by Orvant Inc. Copyright © 2010 Kreotek, LLC. All Rights reserved.