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

SF.net SVN: ledger-smb:[3532] trunk/sql/modules



Revision: 3532
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3532&view=rev
Author:   einhverfr
Date:     2011-07-16 00:57:57 +0000 (Sat, 16 Jul 2011)

Log Message:
-----------
Docstrings on Person.sql, dropping one unused function

Modified Paths:
--------------
    trunk/sql/modules/Defaults.sql
    trunk/sql/modules/Person.sql
    trunk/sql/modules/Settings.sql

Added Paths:
-----------
    trunk/sql/modules/3532-drop-used-function.sql

Added: trunk/sql/modules/3532-drop-used-function.sql
===================================================================
--- trunk/sql/modules/3532-drop-used-function.sql	                        (rev 0)
+++ trunk/sql/modules/3532-drop-used-function.sql	2011-07-16 00:57:57 UTC (rev 3532)
@@ -0,0 +1,3 @@
+DROP FUNCTION person__all_locations (
+    in_entity_id int
+);

Modified: trunk/sql/modules/Defaults.sql
===================================================================
--- trunk/sql/modules/Defaults.sql	2011-07-16 00:37:09 UTC (rev 3531)
+++ trunk/sql/modules/Defaults.sql	2011-07-16 00:57:57 UTC (rev 3532)
@@ -1,3 +1,9 @@
+
+-- Copyright (C) 2011 LedgerSMB Core Team.  Licensed under the GNU General 
+-- Public License v 2 or at your option any later version.
+
+-- Docstrings already added to this file.
+
 -- Probably want to move this to the Settings module -CT
 
 CREATE OR REPLACE FUNCTION defaults_get_defaultcurrency() 

Modified: trunk/sql/modules/Person.sql
===================================================================
--- trunk/sql/modules/Person.sql	2011-07-16 00:37:09 UTC (rev 3531)
+++ trunk/sql/modules/Person.sql	2011-07-16 00:57:57 UTC (rev 3532)
@@ -1,3 +1,9 @@
+
+-- Copyright (C) 2011 LedgerSMB Core Team.  Licensed under the GNU General 
+-- Public License v 2 or at your option any later version.
+
+-- Docstrings already added to this file.
+
 CREATE OR REPLACE FUNCTION person__get_my_entity_id() RETURNS INT AS
 $$
 	SELECT entity_id from users where username = SESSION_USER;
@@ -3,4 +9,7 @@
 $$ LANGUAGE SQL;
 
+COMMENT ON FUNCTION person__get_my_entity_id() IS
+$$ Returns the entity_id of the current, logged in user.$$;
+
 CREATE OR REPLACE FUNCTION person__save
 (in_entity_id integer, in_salutation_id int, 
@@ -50,6 +59,14 @@
 END;
 $$ language plpgsql;
 
+COMMENT ON FUNCTION person__save
+(in_entity_id integer, in_salutation_id int, 
+in_first_name text, in_middle_name text, in_last_name text,
+in_country_id integer
+) IS
+$$ Saves the person with the information specified.  Returns the entity_id
+of the record saved.$$;
+
 CREATE OR REPLACE FUNCTION person__list_locations(in_entity_id int)
 RETURNS SETOF location_result AS
 $$
@@ -71,6 +88,9 @@
 END;
 $$ LANGUAGE PLPGSQL;
 
+COMMENT ON FUNCTION person__list_locations(in_entity_id int) IS
+$$ Returns a list of locations specified attached to the person.$$;
+
 CREATE OR REPLACE FUNCTION person__list_contacts(in_entity_id int)
 RETURNS SETOF contact_list AS 
 $$
@@ -88,6 +108,8 @@
 END;
 $$ LANGUAGE plpgsql;
 
+COMMENT ON FUNCTION person__list_contacts(in_entity_id int) IS
+$$ Returns a list of contacts attached to the function.$$;
 --
 
 CREATE OR REPLACE FUNCTION person__delete_contact
@@ -104,6 +126,11 @@
 
 $$ language plpgsql;
 
+COMMENT ON FUNCTION person__delete_contact
+(in_person_id int, in_contact_class_id int, in_contact text) IS
+$$ Deletes a contact record specified for the person.  Returns true if a record
+was found and deleted, false if not.$$;
+
 CREATE OR REPLACE FUNCTION person__save_contact
 (in_entity_id int, in_contact_class int, in_contact_orig text, in_contact_new TEXT)
 RETURNS INT AS
@@ -144,6 +171,11 @@
 END;
 $$ LANGUAGE PLPGSQL;
 
+COMMENT ON FUNCTION person__save_contact
+(in_entity_id int, in_contact_class int, in_contact_orig text, in_contact_new TEXT) IS
+$$ Saves saves contact info.  Returns 1 if a row was inserted, 0 if it was 
+updated. $$;
+
 CREATE OR REPLACE FUNCTION person__list_bank_account(in_entity_id int)
 RETURNS SETOF entity_bank_account AS
 $$
@@ -157,6 +189,8 @@
 END;
 $$ LANGUAGE PLPGSQL;
 
+COMMENT ON FUNCTION person__list_bank_account(in_entity_id int) IS
+$$ Lists bank accounts for a person$$;
 
 CREATE OR REPLACE FUNCTION person__list_notes(in_entity_id int) 
 RETURNS SETOF entity_note AS 
@@ -174,6 +208,8 @@
 END;
 $$ LANGUAGE PLPGSQL;
 		
+COMMENT ON FUNCTION person__list_notes(in_entity_id int) IS
+$$ Returns a list of notes attached to a person.$$;
 --
 CREATE OR REPLACE FUNCTION person__delete_location
 (in_person_id int, in_location_id int, in_location_class int)
@@ -190,8 +226,12 @@
 END;
 $$ language plpgsql;
 
+COMMENT ON FUNCTION person__delete_location
+(in_person_id int, in_location_id int, in_location_class int) IS
+$$Deletes a location mapping to a person.  Returns true if found, false if no
+data deleted.$$;
 
-create or replace function person__save_location(
+CREATE OR REPLACE FUNCTION person__save_location(
     in_entity_id int, 
     in_location_id int,
     in_location_class int,
@@ -251,13 +291,19 @@
     END;
 $$ language 'plpgsql';
 
-CREATE OR REPLACE FUNCTION person__all_locations (
-    in_entity_id int
-) returns setof location AS $$
+COMMENT ON FUNCTION person__save_location(
+    in_entity_id int,
+    in_location_id int,
+    in_location_class int,
+    in_line_one text,
+    in_line_two text,
+    in_line_three text,
+    in_city TEXT,
+    in_state TEXT,
+    in_mail_code text,
+    in_country_code int,
+    in_old_location_class int
+) IS
+$$ Saves a location mapped to the person with the specified information.
+Returns the location id saved.$$;
 
-    SELECT l.* FROM location l
-    JOIN person_to_location ptl ON ptl.location_id = l.id
-    JOIN person p on ptl.person_id = p.id
-    WHERE p.id = $1;
-
-$$ language sql;

Modified: trunk/sql/modules/Settings.sql
===================================================================
--- trunk/sql/modules/Settings.sql	2011-07-16 00:37:09 UTC (rev 3531)
+++ trunk/sql/modules/Settings.sql	2011-07-16 00:57:57 UTC (rev 3532)
@@ -1,5 +1,11 @@
 -- VERSION 1.3.0
 
+-- Copyright (C) 2011 LedgerSMB Core Team.  Licensed under the GNU General 
+-- Public License v 2 or at your option any later version.
+
+-- Docstrings already added to this file.
+
+
 CREATE OR REPLACE FUNCTION setting_set (in_key varchar, in_value varchar) 
 RETURNS BOOL AS
 $$


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