Commit 3c5697b1 authored by Frank Bergmann's avatar Frank Bergmann

- Fixed creation scripts for OpenACS Installer

parent 686d868c
......@@ -194,57 +194,6 @@ create table im_fs_actions (
);
---------------------------------------------------------
-- Normalize Company Pathes
--
create or replace function im_company_normalize_path (varchar)
returns varchar as '
DECLARE
v_path alias for $1;
path varchar;
i integer;
pos integer;
char varchar;
latin_char varchar;
pathlen integer;
spacing integer;
asc integer;
BEGIN
path = '''';
pathlen = char_length(v_path);
spacing = 0;
FOR i IN 1 .. pathlen LOOP
char = substring(v_path, i, 1);
-- char = convert(char, ''UNICODE'', ''LATIN1'');
asc = ascii(char);
pos = position(char in ''abcdefghijklmnopqrstuvwxyz'' ||
''ABCDEFGHIJKLMNOPQRSTUVWXYZ'' ||
''0123456789_'');
-- IF char = ''ö'' THEN pos=1; char = ''oe'' END IF;
IF asc > 127 THEN
RAISE NOTICE ''path=%, i=%, char=%, pos=%, asc=%'',
v_path, i, char, pos, asc;
END IF;
IF pos < 1 THEN
-- Add new char only if it is not another underscore
IF 0 = spacing THEN
path = path || ''_'';
spacing = 1;
END IF;
ELSE
path = path || char;
spacing = 0;
END IF;
END LOOP;
path = lower(path);
path = trim(both ''_'' from path);
return path;
end;' language 'plpgsql';
select im_company_normalize_path ('Profilex +newtec GmbH/');
---------------------------------------------------------
-- Register the component in the core TCL pages
--
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment