Ticket #5255: vtiger-504-import-records.patch

File vtiger-504-import-records.patch, 1.7 kB (added by prasad, 1 year ago)

vtiger-504-import-records.patch

  • modules/Import/ImportStep3.php

    old new  
    178178 
    179179$ret_value = 0; 
    180180 
     181// Save the file for name for next round of import 
     182// http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/5255 
     183if(isset($_REQUEST['tmp_file'])) { 
     184        $_SESSION['tmp_file'] = $_REQUEST['tmp_file']; 
     185} else { 
     186        $_REQUEST['tmp_file'] = $_SESSION['tmp_file']; 
     187} 
     188// End 
     189 
    181190if ($_REQUEST['source'] == 'act') 
    182191{ 
    183192        $ret_value = parse_import_act($_REQUEST['tmp_file'],$delimiter,$max_lines,$has_header); 
     
    187196        $ret_value = parse_import($_REQUEST['tmp_file'],$delimiter,$max_lines,$has_header); 
    188197} 
    189198 
     199// We should delete the data file only in the last step of import 
     200/* http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/5255 
    190201if (file_exists($_REQUEST['tmp_file'])) 
    191202{ 
    192203        unlink($_REQUEST['tmp_file']); 
    193204} 
     205*/ 
    194206 
    195207$datarows = $ret_value['rows']; 
    196208 
  • modules/Import/ImportSteplast.php

    old new  
    5656        $_REQUEST['return_action'] = ''; 
    5757} 
    5858 
     59// Delete data file used for import 
     60// http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/5255 
     61if(isset($_REQUEST['tmp_file'])) { 
     62        $tmp_file = $_REQUEST['tmp_file']; 
     63} else if(isset($_SESSION['tmp_file'])) { 
     64        $tmp_file = $_SESSION['tmp_file']; 
     65} 
     66if(isset($tmp_file) && file_exists($tmp_file)) unlink($tmp_file); 
     67// End 
     68 
     69 
    5970global $theme; 
    6071$theme_path="themes/".$theme."/"; 
    6172$image_path=$theme_path."images/";