29 if (!defined(
'NOCSRFCHECK')) define(
'NOCSRFCHECK',
'1');
30 if (!defined(
'NOTOKENRENEWAL')) define(
'NOTOKENRENEWAL',
'1');
31 if (!defined(
'NOREQUIREMENU')) define(
'NOREQUIREMENU',
'1');
32 if (!defined(
'NOREQUIREHTML')) define(
'NOREQUIREHTML',
'1');
33 if (!defined(
'NOREQUIREAJAX')) define(
'NOREQUIREAJAX',
'1');
35 require
'../main.inc.php';
36 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
37 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
39 $facid =
GETPOST(
'facid',
'int');
40 $action =
GETPOST(
'action',
'aZ09');
41 $email =
GETPOST(
'email',
'alpha');
43 if (empty($user->rights->takepos->run)) {
47 $langs->loadLangs(array(
"main",
"bills",
"cashdesk"));
50 $invoice->fetch($facid);
52 $customer->fetch($invoice->socid);
54 if ($action ==
"send")
56 include_once DOL_DOCUMENT_ROOT.
'/core/class/CMailFile.class.php';
57 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
60 $model_id = $conf->global->TAKEPOS_EMAIL_TEMPLATE_INVOICE;
61 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'facture_send', $user, $outputlangs, $model_id);
62 $subject = $arraydefaultmessage->topic;
65 include
'receipt.php';
66 $receipt = ob_get_contents();
69 $msg =
"<html>".$arraydefaultmessage->content.
"<br>".$receipt.
"</html>";
71 $from = $mysoc->email;
72 $mail =
new CMailFile($subject, $sendto, $from, $msg, array(), array(), array(),
'',
'', 0, 1);
73 if ($mail->error || $mail->errors) {
76 $result = $mail->sendfile();
80 $arrayofcss = array(
'/takepos/css/pos.css.php');
82 top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
91 url:
"<?php print dol_buildpath('/takepos/send.php', 1).'?action=send&facid='.$facid.'&email='; ?>" + $(
"#email"). val(),
93 parent.$.colorbox.close();
101 <input
type=
"email" id=
"email" name=
"email" style=
"width:60%;font-size: 200%;" value=
"<?php echo $customer->email; ?>"></center>
107 <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.
top_htmlhead($head, $title= '', $disablejs=0, $disablehead=0, $arrayofjs= '', $arrayofcss= '', $disablejmobile=0, $disablenofollow=0)
Ouput html header of a page.
$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.
print
Draft customers invoices.
Class to manage invoices.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type