Changeset 710
- Timestamp:
- 01/04/10 13:22:31 (2 years ago)
- Location:
- trunk/phpbms
- Files:
-
- 2 modified
-
include/imports.php (modified) (4 diffs)
-
modules/bms/include/clients.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpbms/include/imports.php
r704 r710 108 108 //DO NOT CALL IN TRANSACTION 109 109 function _storeTempCSV($fileName){ 110 110 111 111 $querystatement = " 112 112 INSERT INTO 113 113 `files` 114 114 ( 115 `uuid`, 115 116 `name`, 116 117 `description`, … … 124 125 VALUES 125 126 ( 127 '".uuid(getUuidPrefix($this->table->db, "tbld:80b4f38d-b957-bced-c0a0-ed08a0db6475"))."', 126 128 'temporary', 127 129 'This is a temporary import file', 128 130 '".$this->_getFile($fileName)."', 129 131 'phpbms/temp', 130 ' -100',132 'Admin', 131 133 NOW(), 132 134 '".$_SESSION["userinfo"]["id"]."', … … 253 255 if($rowFieldNum == $fieldNum){ 254 256 $verify = $this->table->verifyVariables($trimmedRowData); 255 if(!count($verify)) 256 $theid = $this->table->insertRecord($trimmedRowData, NULL, true); 257 if(!count($verify)){ 258 $createdby = NULL; 259 $overrideID = true; 260 $replace = false; 261 if(!isset($trimmedRowData["uuid"])){ 262 $useUuid = true; 263 $thereturn = $this->table->insertRecord($trimmedRowData, $createdby, $overrideID, $replace, $useUuid); 264 $theid = $thereturn["id"]; 265 }else{ 266 $useUuid = false; 267 $thereturn = $this->table->insertRecord($trimmedRowData, $createdby, $overrideID, $replace, $useUuid); 268 $theid = $thereturn; 269 } 270 }//end if 257 271 }else 258 272 $this->error .= '<li> incorrect amount of fields for line number '.$rowNum.'.</li>'; … … 476 490 <input id="cancelButton<?php echo $ids?>" name="command" type="submit" value="cancel" class="Buttons" <?php if($ids==1) {?>accesskey="x" <?php }?> title="(access key+x)" /> 477 491 <?php }else{?> 478 <input type="submit" class="Buttons" value="import" name="command" id="import<?php echo $ids?>" title="commit" <?php echo ($numberOfRecords? '':'disabled="disabled"') ?>/>479 <input type="submit" class="Buttons" value="cancel" name="command" id="cancelButton<?php echo $ids?>" title="rollback"/>492 <input type="submit" class="Buttons" value="import" name="command" id="import<?php echo $ids?>" title="commit" <?php if($ids==1) {?>accesskey="i"<?php }?> <?php echo ($numberOfRecords? '':'disabled="disabled"') ?>/> 493 <input type="submit" class="Buttons" value="cancel" name="command" id="cancelButton<?php echo $ids?>" <?php if($ids==1) {?>accesskey="x"<?php }?> title="rollback"/> 480 494 <?php }//end if ?> 481 495 </div><?php -
trunk/phpbms/modules/bms/include/clients.php
r706 r710 1249 1249 if($rowFieldNum == $fieldNum){ 1250 1250 $verify = $this->table->verifyVariables($trimmedRowData); 1251 if(!count($verify)) 1252 $theid = $this->table->insertRecord($trimmedRowData, NULL, true); 1251 if(!count($verify)){ 1252 $createdby = NULL; 1253 $overrideID = true; 1254 $replace = false; 1255 if(!isset($trimmedRowData["uuid"])){ 1256 $useUuid = true; 1257 $thereturn = $this->table->insertRecord($trimmedRowData, $createdby, $overrideID, $replace, $useUuid); 1258 $theid = $thereturn["id"]; 1259 }else{ 1260 $useUuid = false; 1261 $thereturn = $this->table->insertRecord($trimmedRowData, $createdby, $overrideID, $replace, $useUuid); 1262 $theid = $thereturn; 1263 }//end if 1264 }//end if 1265 1253 1266 }else 1254 1267 $this->error .= '<li> incorrect amount of fields for line number '.$rowNum.'.</li>'; … … 1398 1411 `addresses`.`phone` 1399 1412 FROM 1400 ((clients INNER JOIN addresstorecord ON clients. id = addresstorecord.recordid AND addresstorecord.tabledefid=2 AND addresstorecord.primary=1) INNER JOIN addresses ON addresstorecord.addressid = addresses.id)1413 ((clients INNER JOIN addresstorecord ON clients.uuid = addresstorecord.recordid AND addresstorecord.tabledefid='tbld:6d290174-8b73-e199-fe6c-bcf3d4b61083' AND addresstorecord.primary='1') INNER JOIN addresses ON addresstorecord.addressid = addresses.uuid) 1401 1414 WHERE 1402 1415 `clients`.`id` IN (".$inStatement.") … … 1418 1431 1419 1432 function displayTransaction($recordsArray, $fieldsArray){ 1420 1433 1421 1434 if(count($recordsArray) && count($fieldsArray)){ 1422 1435