29 if (!defined(
'NOCSRFCHECK')) {
30 define(
'NOCSRFCHECK',
'1');
32 if (!defined(
'NOTOKENRENEWAL')) {
33 define(
'NOTOKENRENEWAL',
'1');
35 if (!defined(
'NOREQUIREMENU')) {
36 define(
'NOREQUIREMENU',
'1');
38 if (!defined(
'NOREQUIREHTML')) {
39 define(
'NOREQUIREHTML',
'1');
41 if (!defined(
'NOREQUIREAJAX')) {
42 define(
'NOREQUIREAJAX',
'1');
45 require
'../main.inc.php';
46 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
47 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
49 $facid =
GETPOST(
'facid',
'int');
50 $action =
GETPOST(
'action',
'aZ09');
51 $email =
GETPOST(
'email',
'alpha');
53 if (empty($user->rights->takepos->run)) {
57 $langs->loadLangs(array(
"main",
"bills",
"cashdesk"));
60 $invoice->fetch($facid);
62 $customer->fetch($invoice->socid);
64 if ($action ==
"send") {
65 include_once DOL_DOCUMENT_ROOT.
'/core/class/CMailFile.class.php';
66 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
69 $model_id = $conf->global->TAKEPOS_EMAIL_TEMPLATE_INVOICE;
70 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'facture_send', $user, $outputlangs, $model_id);
71 $subject = $arraydefaultmessage->topic;
74 include
'receipt.php';
75 $receipt = ob_get_contents();
78 $msg =
"<html>".$arraydefaultmessage->content.
"<br>".$receipt.
"</html>";
80 $from = $mysoc->email;
81 $mail =
new CMailFile($subject, $sendto, $from, $msg, array(), array(), array(),
'',
'', 0, 1);
82 if ($mail->error || $mail->errors) {
85 $result = $mail->sendfile();
89 $arrayofcss = array(
'/takepos/css/pos.css.php');
91 top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
100 data: { token:
'<?php echo currentToken(); ?>' },
101 url:
"<?php print DOL_URL_ROOT.'/takepos/send.php?action=send&facid='.$facid.'&email='; ?>" + $(
"#email"). val(),
103 parent.$.colorbox.close();
111 <input
type=
"email" id=
"email" name=
"email" style=
"width:60%;font-size: 200%;" value=
"<?php echo $customer->email; ?>"></center>
117 <button type=
"button" class=
"calcbutton" onclick=
"SendMail()"><?php print $langs->trans(
"SendTicket"); ?></button>
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
$conf db name
Only used if Module[ID]Name translation string is not found.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to send emails (with attachments or not) Usage: $mailfile = new CMailFile($subject,$sendto,$replyto,$message,$filepath,$mimetype,$filename,$cc,$ccc,$deliveryreceipt,$msgishtml,$errors_to,$css,$trackid,$moreinheader,$sendcontext,$replyto); $mailfile->sendfile();.
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Class to manage translations.
top_htmlhead($head, $title= '', $disablejs=0, $disablehead=0, $arrayofjs= '', $arrayofcss= '', $disableforlogin=0, $disablenofollow=0, $disablenoindex=0)
Ouput html header of a page.
Class to manage invoices.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type