[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[2287] trunk



Revision: 2287
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2287&view=rev
Author:   einhverfr
Date:     2008-08-20 21:06:06 +0000 (Wed, 20 Aug 2008)

Log Message:
-----------
Correcting issues with editing contact info

Modified Paths:
--------------
    trunk/UI/Contact/contact.html
    trunk/sql/modules/Company.sql

Modified: trunk/UI/Contact/contact.html
===================================================================
--- trunk/UI/Contact/contact.html	2008-08-20 18:27:39 UTC (rev 2286)
+++ trunk/UI/Contact/contact.html	2008-08-20 21:06:06 UTC (rev 2287)
@@ -619,6 +619,16 @@
 	} ?>
 	<?lsmb PROCESS input element_data = {
 		type="hidden" 
+		name="old_contact_class" 
+		value=contact_class
+	} ?>
+	<?lsmb PROCESS input element_data = {
+		type="hidden" 
+		name="old_contact" 
+		value=contact
+	} ?>
+	<?lsmb PROCESS input element_data = {
+		type="hidden" 
 		name="contact_id" 
 		value=contact_id
 	} ?>

Modified: trunk/sql/modules/Company.sql
===================================================================
--- trunk/sql/modules/Company.sql	2008-08-20 18:27:39 UTC (rev 2286)
+++ trunk/sql/modules/Company.sql	2008-08-20 21:06:06 UTC (rev 2287)
@@ -713,11 +713,17 @@
 $$ language plpgsql;
 
 CREATE OR REPLACE FUNCTION eca__save_contact
-(in_credit_id int, in_contact_class int, in_description text, in_contact text)
+(in_credit_id int, in_contact_class int, in_description text, in_contact text,
+in_old_contact text, in_old_contact_class int)
 RETURNS INT AS
 $$
 DECLARE out_id int;
 BEGIN
+	DELETE FROM eca_to_contact 
+	WHERE credit_id = in_credit_id
+		AND contact = in_old_contact
+		AND contact_class_id = in_old_contact_class;
+		
 	INSERT INTO eca_to_contact(credit_id, contact_class_id, 
 		description, contact)
 	VALUES (in_credit_id, in_contact_class, in_description, in_contact);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.