jeffd
committed
on 11 Dec 03
merge of changes on oacs-5-0 branch to oacs-5-0-0b4 tag
openacs-4/.../postgresql/content-folder.sql (+3 -3)
16 16 returns integer as '
17 17 declare
18 18   new__name                   alias for $1
19 19   new__label                  alias for $2
20 20   new__description            alias for $3-- default null 
21 21   new__parent_id              alias for $4-- default null
22 22 begin
23 23         return content_folder__new(new__name,
24 24                                    new__label,
25 25                                    new__description,
26 26                                    new__parent_id,
27 27                                    null,
28 28                                    null,
29 29                                    now(),
30 30                                    null,
31 31                                    null
32 32                );
33 33
34 34 end;' language 'plpgsql';
35 35 -- function new
36   create function content_folder__new (varchar,varchar,varchar,integer,integer,integer,timestamp,integer,varchar)
  36 create function content_folder__new (varchar,varchar,varchar,integer,integer,integer,timestamp with time zone,integer,varchar)
37 37 returns integer as '
38 38 declare
39 39   new__name                   alias for $1
40 40   new__label                  alias for $2
41 41   new__description            alias for $3-- default null
42 42   new__parent_id              alias for $4-- default null
43 43   new__context_id             alias for $5-- default null
44 44   new__folder_id              alias for $6-- default null
45 45   new__creation_date          alias for $7-- default now()
46 46   new__creation_user          alias for $8-- default null
47 47   new__creation_ip            alias for $9-- default null
48 48   v_folder_id                 cr_folders.folder_id%TYPE;
49 49   v_context_id                acs_objects.context_id%TYPE;
50 50 begin
51 51
52 52   -- set the context_id
53 53   if new__context_id is null then
54 54     v_context_id := new__parent_id;
55 55   else
56 56     v_context_id := new__context_id;
 
98 98           v_folder_id as folder_id, content_type
99 99         from
100 100           cr_folder_type_map
101 101         where
102 102           folder_id = new__parent_id;
103 103     end if;
104 104
105 105     -- update the child flag on the parent
106 106     update cr_folders set has_child_folders = ''t''
107 107       where folder_id = new__parent_id;
108 108
109 109     return v_folder_id;
110 110
111 111   end if;
112 112
113 113   return null;
114 114 end;' language 'plpgsql';
115 115
116 116 -- function new -- accepts security_inherit_p DaveB
117 117
118   create function content_folder__new (varchar,varchar,varchar,integer,integer,integer,timestamp,integer,varchar, boolean)
  118 create function content_folder__new (varchar,varchar,varchar,integer,integer,integer,timestamp with time zone,integer,varchar, boolean)
119 119 returns integer as '
120 120 declare
121 121   new__name                   alias for $1
122 122   new__label                  alias for $2
123 123   new__description            alias for $3-- default null
124 124   new__parent_id              alias for $4-- default null
125 125   new__context_id             alias for $5-- default null
126 126   new__folder_id              alias for $6-- default null
127 127   new__creation_date          alias for $7-- default now()
128 128   new__creation_user          alias for $8-- default null
129 129   new__creation_ip            alias for $9-- default null
130 130   new__security_inherit_p     alias for $10-- default true   
131 131   v_folder_id                 cr_folders.folder_id%TYPE;
132 132   v_context_id                acs_objects.context_id%TYPE;
133 133 begin
134 134
135 135   -- set the context_id
136 136   if new__context_id is null then
137 137     v_context_id := new__parent_id;
138 138   else