Function SET177B

LANSA

Function SET177B

********** COMMENT(=======================================================);
********** COMMENT(Process ........: SET_177);
********** COMMENT(Function .......: SET177B);
********** COMMENT(Created on .....: 07/06/00 at 10:34:40);
********** COMMENT(Description ....: Request a Time sheet for an Employee);
********** COMMENT(Version.........: 1);
********** COMMENT();
********** COMMENT(Full Description: This function displays an Employee);
********** COMMENT(browselist where a request is submitted for a selected);
********** COMMENT(Employee to fill out a time sheet. This functions acts);
********** COMMENT(only as a substitute to what normally would be a);
********** COMMENT(scheduled job that would run at the end of each month.);
********** COMMENT();
********** COMMENT(Disclaimer: The following material is supplied as);
********** COMMENT(sample material only. No warranty concerning the);
********** COMMENT(material or its use in any way whatsoever is);
********** COMMENT(expressed or implied.);
********** COMMENT();
********** COMMENT(Minimum Release of LANSA: 8.0);
********** COMMENT();
********** COMMENT(=======================================================);
********** COMMENT(Function control options);
FUNCTION OPTIONS(*DIRECT *WEBEVENT);
********** COMMENT();
********** COMMENT(Group and field definitions);
DEF_LIST NAME(#S_177EMPL) FIELDS((#S_177CBOX *INPUT)(#FULLNAME *OUTPUT)(#S_177EMAI *INPUT)(#S_177MNTH *HIDDEN)(#S_177EMPN *HIDDEN)(#STDRENTRY *HIDDEN)(#S_177NAME *HIDDEN)(#S_177SURN *HIDDEN));
GROUP_BY NAME(#PANELDATA) FIELDS((#STDRENTRY *HIDDEN));
********** COMMENT();
********** COMMENT(Mainline);
********** COMMENT();
IF COND('#stdrentry *ne Y');
CLR_LIST NAMED(#S_177EMPL);
CHANGE FIELD(#STDRENTRY) TO(Y);
SELECT FIELDS(#S_177EMPL) FROM_FILE(SETEMP);
USE BUILTIN(BCONCAT) WITH_ARGS(#S_177NAME #S_177SURN) TO_GET(#FULLNAME);
ADD_ENTRY TO_LIST(#S_177EMPL);
ENDSELECT;
GOTO LABEL(REQ);
ENDIF;
********** COMMENT();
SELECTLIST NAMED(#S_177EMPL) GET_ENTRYS(*ALTERED);
CONTINUE IF('(#s_177emai *eq *blanks) or (#s_177cbox *eq *blanks)');
EXECUTE SUBROUTINE(SEND_EMAIL);
UPDATE FIELDS(#S_177EMAI) IN_FILE(SETEMP) WITH_KEY(#S_177EMPN) VAL_ERROR(*NEXT);
CHANGE FIELD(#S_177CBOX) TO(*BLANK);
UPD_ENTRY IN_LIST(#S_177EMPL);
ENDSELECT;
********** COMMENT();
REQ: REQUEST FIELDS(#PANELDATA) BROWSELIST(#S_177EMPL) EXIT_KEY(*NO) MENU_KEY(*NO) PROMPT_KEY(*NO);
********** COMMENT();
SUBROUTINE NAME(SEND_EMAIL);
********** COMMENT();
USE BUILTIN(MAIL_START);
********** COMMENT();
DEFINE FIELD(#COMMONURL) TYPE(*CHAR) LENGTH(255);
CHANGE FIELD(#S_EMORG) TO('[email protected]');
USE BUILTIN(MAIL_ADD_ORIGINATOR) WITH_ARGS(#S_EMORG #S_EMORG);
********** COMMENT();
USE BUILTIN(MAIL_ADD_RECIPIENT) WITH_ARGS(TO #S_177EMAI #S_177EMAI);
********** COMMENT();
CHANGE FIELD(#S_EMSBJ) TO(TIME SHEET);
USE BUILTIN(MAIL_SET_SUBJECT) WITH_ARGS(#S_EMSBJ);
********** COMMENT();
EXECUTE SUBROUTINE(ADD_TEXT);
********** COMMENT();
USE BUILTIN(MAIL_SET_OPTION) WITH_ARGS(IMPORTANCE HIGH);
********** COMMENT();
USE BUILTIN(MAIL_SEND);
********** COMMENT();
ENDROUTINE;
********** COMMENT();
SUBROUTINE NAME(ADD_TEXT);
********** COMMENT();
DEFINE FIELD(#EMPDETURL) REFFLD(#COMMONURL);
DEFINE FIELD(#S_EMPLIN) REFFLD(#S_EMLINE);
DEFINE FIELD(#PARM_1) TYPE(*CHAR) LENGTH(100);
USE BUILTIN(BCONCAT) WITH_ARGS('Hi' #S_177NAME ',') TO_GET(#S_EMLINE);
EXECUTE SUBROUTINE(ADD_LINES);
USE BUILTIN(BCONCAT) WITH_ARGS('I need your time sheet details for JUNE.' 'Click here to input them:') TO_GET(#S_EMLINE);
USE BUILTIN(MAIL_ADD_TEXT) WITH_ARGS(#S_EMLINE);
USE BUILTIN(TCONCAT) WITH_ARGS(*S_URLPORT *S_FIXEDURLPART 'SET_177+SET177C+' *PARTITION) TO_GET(#COMMONURL);
USE BUILTIN(TCONCAT) WITH_ARGS(*S_URLPORT *S_FIXEDURLPART 'SET_177+SET177D+' *PARTITION) TO_GET(#EMPDETURL);
USE BUILTIN(TCONCAT) WITH_ARGS('+funcparms+s_177empn%28A0050%29:' #S_177EMPN) TO_GET(#PARM_1);
EXECUTE SUBROUTINE(COMPLE_URL) WITH_PARMS(JUNE);
EXECUTE SUBROUTINE(ADD_LINES);
USE BUILTIN(BCONCAT) WITH_ARGS('If you need to revise or complete earlier' 'Time sheets:') TO_GET(#S_EMLINE);
EXECUTE SUBROUTINE(ADD_LINES);
********** COMMENT();
********** COMMENT(Add the language code in the url if partition is);
********** COMMENT(multilingual);
IF COND('*language *ne *blank');
USE BUILTIN(TCONCAT) WITH_ARGS(#COMMONURL '+' *LANGUAGE) TO_GET(#COMMONURL);
USE BUILTIN(TCONCAT) WITH_ARGS(#EMPDETURL '+' *LANGUAGE) TO_GET(#EMPDETURL);
ENDIF;
********** COMMENT();
CHANGE FIELD(#S_EMLINE) TO('''Click here for March:''');
EXECUTE SUBROUTINE(ADD_LINES);
EXECUTE SUBROUTINE(COMPLE_URL) WITH_PARMS(MARCH);
EXECUTE SUBROUTINE(ADD_LINES);
********** COMMENT();
CHANGE FIELD(#S_EMLINE) TO('''Click here for April:''');
EXECUTE SUBROUTINE(ADD_LINES);
EXECUTE SUBROUTINE(COMPLE_URL) WITH_PARMS(APRIL);
EXECUTE SUBROUTINE(ADD_LINES);
********** COMMENT();
CHANGE FIELD(#S_EMLINE) TO('''Click here for May:''');
EXECUTE SUBROUTINE(ADD_LINES);
EXECUTE SUBROUTINE(COMPLE_URL) WITH_PARMS(MAY);
EXECUTE SUBROUTINE(ADD_LINES);
********** COMMENT();
USE BUILTIN(BCONCAT) WITH_ARGS('If you have changed your personal details,' 'click here to update them:') TO_GET(#S_EMLINE);
EXECUTE SUBROUTINE(ADD_LINES);
CHANGE FIELD(#FUNC_PARM) TO(#PARM_1);
EXECUTE SUBROUTINE(PUT_REST);
USE BUILTIN(MAIL_ADD_TEXT) WITH_ARGS(#S_EMPLIN);
********** COMMENT();
ENDROUTINE;
********** COMMENT();
SUBROUTINE NAME(COMPLE_URL) PARMS((#S_177MNTH *RECEIVED));
********** COMMENT();
DEFINE FIELD(#FUNC_PARM) TYPE(*CHAR) LENGTH(100);
USE BUILTIN(TCONCAT) WITH_ARGS(#PARM_1 '+s_177mnth%28A0100%29:' #S_177MNTH) TO_GET(#FUNC_PARM);
EXECUTE SUBROUTINE(PUT_REST);
********** COMMENT();
ENDROUTINE;
********** COMMENT();
SUBROUTINE NAME(PUT_REST);
********** COMMENT();
USE BUILTIN(TCONCAT) WITH_ARGS(#COMMONURL #FUNC_PARM) TO_GET(#S_EMLINE);
USE BUILTIN(TCONCAT) WITH_ARGS(#EMPDETURL #FUNC_PARM) TO_GET(#S_EMPLIN);
ENDROUTINE;
********** COMMENT();
SUBROUTINE NAME(ADD_LINES);
********** COMMENT();
USE BUILTIN(MAIL_ADD_TEXT) WITH_ARGS(#S_EMLINE);
USE BUILTIN(MAIL_ADD_TEXT) WITH_ARGS(*BLANK);
********** COMMENT();
ENDROUTINE;