public static function get_new_iid($type) {
        global $USER;

        $filename = make_temp_directory('csvimport/'.$type.'/'.$USER->id);

        // use current (non-conflicting) time stamp
        $iiid = time();
        while (file_exists($filename.'/'.$iiid)) {
            $iiid--;
        }

        return $iiid;
    }
public static function get_new_iid($type) {
        global $USER;

        $filename = make_temp_directory('csvimport/'.$type.'/'.$USER->id);

        // use current (non-conflicting) time stamp
        $iiid = time();
        while (file_exists($filename.'/'.$iiid)) {
            $iiid--;
        }

        return $iiid;
    }
public static function get_new_iid ( $ type ) { global $ USER ; $ filename = make_temp_directory ( 'csvimport/' . $ type . '/' . $ USER -> id ) ; // use current (non-conflicting) time stamp $ iiid = time ( ) ; while ( file_exists ( $ filename . '/' . $ iiid ) ) { $ iiid -- ; } return $ iiid ; }
Create new import id

@global object
@param string who imports?
@return int iid
Create new import id