[wellwell-devel] [SCM] Interchange wellwell catalog branch, master, updated. 5afbf38a042d84507d8549b715257a5fe7b5cd82

Stefan Hornburg racke at rt.icdevgroup.org
Sun Mar 22 15:56:10 UTC 2009


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Interchange wellwell catalog".

The branch, master has been updated
       via  5afbf38a042d84507d8549b715257a5fe7b5cd82 (commit)
       via  72ffbe63f6056355aeebdbf49495429876693ee0 (commit)
      from  2cd04850f78ff056652d19055a2d56a687f2af31 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 5afbf38a042d84507d8549b715257a5fe7b5cd82
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date:   Sun Mar 22 16:55:46 2009 +0100

    remove deprecated save/load fields

commit 72ffbe63f6056355aeebdbf49495429876693ee0
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date:   Sun Mar 22 16:54:27 2009 +0100

    implement backward jumps by name
    removed legacy code for save/load from database fields

-----------------------------------------------------------------------

Summary of changes and diff:
 code/form.tag                  |   39 +++++++++++++++++++++------------------
 database/mysql/form_series.sql |    2 --
 database/pgsql/form_series.sql |    2 --
 3 files changed, 21 insertions(+), 22 deletions(-)

diff --git a/code/form.tag b/code/form.tag
index 6ab37ae..e1cec14 100644
--- a/code/form.tag
+++ b/code/form.tag
@@ -22,7 +22,24 @@ sub {
 			$Session->{form_series} = {};
 		}
 
-		if ($CGI->{series} eq $name) {
+		if ($CGI->{form_series_jump}) {
+			my @line = grep {$_->{part} eq $CGI->{form_series_jump}} @$set;
+
+			if (@line) {
+				if ($line[0]->{position} < $Session->{form_series}->{$name}) {
+					# backward jumps are fine
+					$back = $Session->{form_series}->{$name} - $line[0]->{position};
+				}
+				else {
+					# ignore invalid jump
+					Log ("Invalid jump to $CGI->{form_series}->{$name} detected.");
+				}
+			}
+			else {
+				# ignore invalid jump
+				Log ("Invalid jump to $CGI->{form_series}->{$name} detected.");
+			}
+		} elsif ($CGI->{series} eq $name) {
 			if ($Session->{form_series}->{$name} <= $pos_max) {
 				$Session->{form_series}->{$name} += 1;
 			}
@@ -76,21 +93,15 @@ sub {
 
 					if ($hookret->{page}) {
 						$CGI->{mv_nextpage} = $hookret->{page};
+						if ($hookret->{jump}) {
+							$CGI->{form_series_jump} = $hookret->{jump};
+						}
 						return;
 					}
 				}
 				else {
 					Log("Hook $hook not found.");
 				}
-
-				# this is legacy code, will be removed in favor of hooks
-				if ($_->{save}) {
-					my (@save, $tag, $ret);
-
-					@save = split(/,/, $_->{save});
-					$tag = shift(@save);
-					$ret = $Tag->$tag(@save);
-				}
 			} 
 			elsif ($_->{position} == $pos) {
 				# check for appropriate hook for loading
@@ -106,14 +117,6 @@ sub {
 					Log("Hook $hook not found.");
 				}
 
-				# this is legacy code, will be removed in favor of hooks
-				if ($_->{load}) {
-					my (@load, $tag, $ret);
-
-					@load = split(/,/, $_->{load});
-					$tag = shift(@load);
-					$ret = $Tag->$tag(@load);
-				}
 				$Tag->tmp('series_part', $_->{part});
 				return $Tag->form({series => $name, label => $_->{label},
 					part => $_->{part},
diff --git a/database/mysql/form_series.sql b/database/mysql/form_series.sql
index b9fed3c..48fd4fa 100644
--- a/database/mysql/form_series.sql
+++ b/database/mysql/form_series.sql
@@ -6,8 +6,6 @@ CREATE TABLE form_series (
   template varchar(255) NOT NULL DEFAULT '',
   profile varchar(255) NOT NULL DEFAULT '',
   position int unsigned NOT NULL DEFAULT 0,
-  `load` varchar(255) NOT NULL DEFAULT '',
-  save varchar(255) NOT NULL DEFAULT '',
   apply varchar(255) NOT NULL DEFAULT '', 
   key(name)
 );
diff --git a/database/pgsql/form_series.sql b/database/pgsql/form_series.sql
index f872b9f..f84e580 100644
--- a/database/pgsql/form_series.sql
+++ b/database/pgsql/form_series.sql
@@ -6,8 +6,6 @@ CREATE TABLE "form_series" (
   template varchar(255) NOT NULL DEFAULT '',
   profile varchar(255) NOT NULL DEFAULT '',
   position integer NOT NULL DEFAULT 0,
-  load varchar(255) NOT NULL DEFAULT '',
-  save varchar(255) NOT NULL DEFAULT '',
   apply varchar(255) NOT NULL DEFAULT ''
 );
 CREATE INDEX form_series_name ON form_series(name);


hooks/post-receive
-- 
Interchange wellwell catalog



More information about the wellwell-devel mailing list