Index: openacs-4/packages/acs-events/sql/postgresql/acs-events-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-events/sql/postgresql/acs-events-create.sql,v
diff -u -r1.27 -r1.28
--- openacs-4/packages/acs-events/sql/postgresql/acs-events-create.sql	12 Jul 2018 11:50:16 -0000	1.27
+++ openacs-4/packages/acs-events/sql/postgresql/acs-events-create.sql	3 Sep 2024 15:37:33 -0000	1.28
@@ -1148,6 +1148,8 @@
      --
      -- @return  event_id of new event created.
 
+select define_function_args('acs_event__new_instance','event_id,date_offset');
+
 CREATE OR REPLACE FUNCTION acs_event__new_instance(
    new_instance__event_id integer,
    new_instance__date_offset interval
@@ -1444,9 +1446,6 @@
 
 
 
--- added
-select define_function_args('acs_event__shift','event_id;null,start_offset;0,end_offset;0');
-
 --
 -- procedure acs_event__shift/3
 --
@@ -1455,28 +1454,28 @@
      -- @author W. Scott Meeks
      --
      -- @param event_id      Event to shift.
-     -- @param start_offset  Adds this date interval to the
+     -- @param start_offset_interval  Adds this date interval to the
      --                      start_dates of the timespan of the event.
      --                      No effect on any null start_date.
-     -- @param end_offset    Adds this date interval to the
+     -- @param end_offset_interval    Adds this date interval to the
      --                      end_dates of the timespan of the event.
      --                      No effect on any null end_date.
      --
      -- @return 0 (procedure dummy)
 
 CREATE OR REPLACE FUNCTION acs_event__shift(
    shift__event_id integer,      -- default null
-   shift__start_offset interval, -- default 0
-   shift__end_offset interval    -- default 0
+   shift__start_offset_interval interval, -- default 0
+   shift__end_offset_interval interval    -- default 0
 
 ) RETURNS integer AS $$
 DECLARE
        rec_events	    record;
 BEGIN
 
 --       update acs_events_dates
---       set    start_date = start_date + shift__start_offset,
---             end_date   = end_date + shift__end_offset
+--       set    start_date = start_date + shift__start_offset_interval,
+--             end_date   = end_date + shift__end_offset_interval
 --       where  event_id   = shift__event_id;
 
 	  -- Can not update view, so we do it the hard way
@@ -1489,8 +1488,8 @@
 	      and   s.interval_id = t.interval_id
           loop
 	       update time_intervals
-	       set    start_date = start_date + shift__start_offset,
-		      end_date   = end_date + shift__end_offset
+	       set    start_date = start_date + shift__start_offset_interval,
+		      end_date   = end_date + shift__end_offset_interval
 	       where  interval_id = rec_events.interval_id;
 	  end loop;
 
@@ -1507,10 +1506,8 @@
 --
      -- Shifts the timespan of an event by the given offsets.
      --
-     -- JS: Overloaded function to make above compatible with Oracle behavior
-      -- JS: when an integer (for number of days) is supplied as a parameter.
+     -- Overloaded function to make above compatible with Oracle behavior
      --
-     --
      -- @param event_id      Event to shift.
      -- @param start_offset  Adds this number of days to the
      --                      start_dates of the timespan of the event.
@@ -1521,6 +1518,8 @@
      --
      -- @return 0 (procedure dummy)
 
+select define_function_args('acs_event__shift','event_id;null,start_offset;0,end_offset;0');
+
 CREATE OR REPLACE FUNCTION acs_event__shift(
    shift__event_id integer,     -- default null
    shift__start_offset integer, -- default 0
@@ -1540,11 +1539,6 @@
 $$ LANGUAGE plpgsql;
 
 
-
-
--- added
-select define_function_args('acs_event__shift_all','event_id;null,start_offset;0,end_offset;0');
-
 --
 -- procedure acs_event__shift_all/3
 --
@@ -1555,19 +1549,19 @@
      --
      -- @param event_id      All events with the same
      --                      recurrence_id as this one will be shifted.
-     -- @param start_offset  Adds this date interval to the
+     -- @param start_offset_inverval  Adds this date interval to the
      --                      start_dates of the timespan of the event
      --                      instances.  No effect on any null start_date.
-     -- @param end_offset    Adds this date interval to the
+     -- @param end_offset_inverval    Adds this date interval to the
      --                      end_dates of the timespan of the event
      --                      instances.  No effect on any null end_date.
      --
      -- @return 0 (procedure dummy)
 
 CREATE OR REPLACE FUNCTION acs_event__shift_all(
    shift_all__event_id integer,      -- default null
-   shift_all__start_offset interval, -- default 0
-   shift_all__end_offset interval    -- default 0
+   shift_all__start_offset_inverval interval, -- default 0
+   shift_all__end_offset_inverval interval    -- default 0
 
 ) RETURNS integer AS $$
 DECLARE
@@ -1576,8 +1570,8 @@
 
 
 --        update acs_events_dates
---        set    start_date    = start_date + shift_all__start_offset,
---              end_date      = end_date + shift_all__end_offset
+--        set    start_date    = start_date + shift_all__start_offset_inverval,
+--              end_date      = end_date + shift_all__end_offset_inverval
 --        where recurrence_id  = (select recurrence_id
 --                                from   acs_events
 --                                where  event_id = shift_all__event_id);
@@ -1593,16 +1587,15 @@
 
 	    PERFORM acs_event__shift(
 			rec_events.event_id,
-			shift_all__start_offset,
-			shift_all__end_offset
+			shift_all__start_offset_inverval,
+			shift_all__end_offset_inverval
 			);
 	end loop;
 
 	return 0;
 
 END;
 $$ LANGUAGE plpgsql;
---    end shift_all;
 
 
 
@@ -1614,7 +1607,6 @@
      -- by the given offsets.
      --
      -- JS: Overloaded function to make above compatible with Oracle behavior
-     -- JS: when an integer (for number of days) is supplied as a parameter.
      --
      --
      -- @param event_id      All events with the same
@@ -1628,6 +1620,8 @@
      --
      -- @return 0 (procedure dummy)
 
+select define_function_args('acs_event__shift_all','event_id;null,start_offset;0,end_offset;0');
+
 CREATE OR REPLACE FUNCTION acs_event__shift_all(
    shift_all__event_id integer,     -- default null
    shift_all__start_offset integer, -- default 0
