Commit b9cfa607833a3dba8079a0148c89344089820190
1 parent
045978ac
added emaillink
currently a link on the west payload...but can be taken out of dmsdefaults git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@578 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
91 additions
and
0 deletions
presentation/lookAndFeel/knowledgeTree/documentmanagement/emailLink.php
0 → 100644
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +require_once("../../../../config/dmsDefaults.php"); | ||
| 4 | + | ||
| 5 | +global $default; | ||
| 6 | +require_once("$default->owl_fs_root/lib/email/Email.inc"); | ||
| 7 | + | ||
| 8 | + | ||
| 9 | +if(checkSession()) | ||
| 10 | +{ | ||
| 11 | + | ||
| 12 | + | ||
| 13 | +// include the page template (with navbar) | ||
| 14 | +require_once("$default->owl_fs_root/presentation/webPageTemplate.inc"); | ||
| 15 | + // when email button sent..send email | ||
| 16 | +if ($submit) | ||
| 17 | +{ | ||
| 18 | + //set up body and link | ||
| 19 | + | ||
| 20 | + $body = "<b> Here's a interesting link: </b>"; | ||
| 21 | + $docID = $fDocumentID; | ||
| 22 | + //link has to be changed to respective server where everything is stored. | ||
| 23 | + $link = $default->owl_url . "control.php?action=viewDocument&fDocumentID=" . $docID; | ||
| 24 | + | ||
| 25 | + $hyperlink = "<a href = ". $link .">" . $link. "</a>"; | ||
| 26 | + | ||
| 27 | + //create email object | ||
| 28 | + $emailLink= new Email(); | ||
| 29 | + //send email | ||
| 30 | + $success = $emailLink->sendHyperLink($fromEmail,$fromName,$toEmail,$subject,$body, $hyperlink); | ||
| 31 | + | ||
| 32 | + //if successful ..rerender the page | ||
| 33 | + if($success == True) | ||
| 34 | + { | ||
| 35 | + $Center = "<br>Email Successfully Sent</br>"; | ||
| 36 | + $oPatternCustom = & new PatternCustom(); | ||
| 37 | + $oPatternCustom->setHtml($Center); | ||
| 38 | + $main->setCentralPayload($oPatternCustom); | ||
| 39 | + $main->render(); | ||
| 40 | + } | ||
| 41 | + Else | ||
| 42 | + { | ||
| 43 | + $Center = "<br>Email Unsuccessful</br>"; | ||
| 44 | + $oPatternCustom = & new PatternCustom(); | ||
| 45 | + $oPatternCustom->setHtml($Center); | ||
| 46 | + $main->setCentralPayload($oPatternCustom); | ||
| 47 | + $main->render(); | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + | ||
| 51 | + | ||
| 52 | +} | ||
| 53 | +//create the necessary HTML for the emailing | ||
| 54 | +$Center = " | ||
| 55 | + <br> | ||
| 56 | + </br> | ||
| 57 | + <TABLE BORDER=\"0\" CELLSPACING=\"2\" CELLPADDING=\"2\"> | ||
| 58 | + <tr> | ||
| 59 | + <td>To Email: <TD WIDTH=\"100%\"><INPUT type=\"Text\" name=\"toEmail\" size=\"30\"></td></td> | ||
| 60 | + </tr> | ||
| 61 | + <tr> | ||
| 62 | + <td>Your Name: <TD WIDTH=\"80%\"><INPUT type=\"Text\" name=\"fromName\" size=\"30\"></td></td> | ||
| 63 | + </tr> | ||
| 64 | + <tr> | ||
| 65 | + <td>Your Email: <TD WIDTH=\"80%\"><INPUT type=\"Text\" name=\"fromEmail\" size=\"30\"></td></td> | ||
| 66 | + </tr> | ||
| 67 | + <tr> | ||
| 68 | + <td>Subject: <TD WIDTH=\"80%\"><INPUT type=\"Text\" name=\"subject\" size=\"30\"></td></td> | ||
| 69 | + </tr> | ||
| 70 | + <tr> | ||
| 71 | + <td> | ||
| 72 | + </td> | ||
| 73 | + </tr> | ||
| 74 | + <tr> | ||
| 75 | + <td><center><TD WIDTH=\"80%\"><INPUT type=\"Submit\" name=\"submit\" value=\"Send Email\"></center></td></td> | ||
| 76 | + </tr> | ||
| 77 | + </table> | ||
| 78 | + "; | ||
| 79 | + | ||
| 80 | +$oPatternCustom = & new PatternCustom(); | ||
| 81 | +$oPatternCustom->setHtml($Center); | ||
| 82 | +$main->setCentralPayload($oPatternCustom); | ||
| 83 | +$main->setFormAction($_SERVER["PHP_SELF"]); | ||
| 84 | +$main->render(); | ||
| 85 | + | ||
| 86 | + | ||
| 87 | + | ||
| 88 | + | ||
| 89 | +} | ||
| 90 | + | ||
| 91 | +?> | ||
| 0 | \ No newline at end of file | 92 | \ No newline at end of file |