general update?!

git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@2891 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
PriestJ
2007-11-27 11:52:30 +00:00
parent 2920f4d016
commit 4ab118215c
3 changed files with 92 additions and 3 deletions

67
Modules/mip_email.pck Normal file
View File

@@ -0,0 +1,67 @@
create or replace package mip_email is
-- Author : MULLENMD
-- Created : 02/11/2007 13:46:43
-- Purpose : Allow the system to send emails.
-- Public type declarations
PROCEDURE send_email(p_recipient IN VARCHAR2,
p_body IN VARCHAR2,
p_subject IN VARCHAR2);
PROCEDURE send_email(p_recipient IN VARCHAR2,
p_body IN VARCHAR2,
p_body_html IN VARCHAR2,
p_subject IN VARCHAR2);
PROCEDURE send_email(p_recipient IN VARCHAR2,
p_body IN CLOB,
p_body_html IN CLOB,
p_subject IN VARCHAR2);
end mip_email;
/
create or replace package body mip_email is
PROCEDURE send_email(p_recipient IN VARCHAR2,
p_body IN VARCHAR2,
p_subject IN VARCHAR2) IS
l_from VARCHAR2(50) := 'Mike.Hock@AdvanticaGroup.com';
BEGIN
apex_mail.send(p_to => p_RECIPIENT,
p_from => l_from,
p_body => p_body,
p_subj => p_subject);
END;
PROCEDURE send_email(p_recipient IN VARCHAR2,
p_body IN VARCHAR2,
p_body_html IN VARCHAR2,
p_subject IN VARCHAR2) IS
l_from VARCHAR2(50) := 'Mike.Hock@AdvanticaGroup.com';
BEGIN
apex_mail.send(p_to => p_recipient,
p_from => l_from,
p_body => p_body,
p_body_html => p_body_html,
p_subj => p_subject);
END;
PROCEDURE send_email(p_recipient IN VARCHAR2,
p_body IN CLOB,
p_body_html IN CLOB,
p_subject IN VARCHAR2) IS
l_from VARCHAR2(50) := 'Mike.Hock@AdvanticaGroup.com';
BEGIN
apex_mail.send(p_to => p_recipient,
p_from => l_from,
p_body => p_body,
p_body_html => p_body_html,
p_subj => p_subject);
END;
end mip_email;
/

View File

@@ -12,6 +12,7 @@ CREATE OR REPLACE PACKAGE mip_parties AS
RETURN NUMBER;
FUNCTION get_user_role(p_username IN VARCHAR2)
return varchar2;
FUNCTION has_supplier(p_username IN VARCHAR2, p_supplierid IN VARCHAR) return boolean;
PROCEDURE add_address(p_address addresses%ROWTYPE);
PROCEDURE add_partyaddress(p_addr_code IN VARCHAR2, p_prty_id IN INTEGER);
PROCEDURE add_partyrole(p_role_code IN VARCHAR2, p_prty_id IN NUMBER);
@@ -321,7 +322,29 @@ CREATE OR REPLACE PACKAGE BODY mip_parties AS
--
--
/*
FUNCTION has_supplier
- Returns true if a supplier is found for a supplied username. Searches the parties
- table for a matching username, if the name is found the users id is returned.
- That id is used to search the party_roles table to get the role keycode.
%param p_username - the name of the user you want to find the supplier for.
%param p_supplierid - the id of the supplier you want to check the user against.
*/
FUNCTION has_supplier(p_username IN VARCHAR2, p_supplierid IN VARCHAR) return boolean as
cursor c_userrole is select ID
from PARTIES p, PARTY_RELATIONSHIPS pr
where p.ID = pr.TO_PARL_PRTY_ID
and pr.FROM_PARL_PRTY_ID = get_user_id(p_username)
and pr.TO_PARL_RT_CODE = 'SUPP'
and pr.FROM_PARL_RT_CODE = 'AGENT';
begin
for userrole_rec in c_userrole loop
if p_supplierid = userrole_rec.id then
return true;
end if;
end loop;
return false;
end has_supplier;
END mip_parties;
/

View File

@@ -29,7 +29,6 @@ CREATE OR REPLACE PACKAGE BODY mip_regions IS
{*} ANAbNAA e.g. W1A 1HP
{*} AANAbNAA e.g. EC1A 1BB
*/
FUNCTION reformat_postcode_string(p_string IN VARCHAR2) RETURN VARCHAR2 IS
l_return VARCHAR2(8);
BEGIN