29if (!defined(
'NOTOKENRENEWAL')) {
30 define(
'NOTOKENRENEWAL',
'1');
32if (!defined(
'NOREQUIREMENU')) {
33 define(
'NOREQUIREMENU',
'1');
35if (!defined(
'NOREQUIREHTML')) {
36 define(
'NOREQUIREHTML',
'1');
38if (!defined(
'NOREQUIREAJAX')) {
39 define(
'NOREQUIREAJAX',
'1');
43require
'../main.inc.php';
44require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
45require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
48$action =
GETPOST(
'action',
'aZ09');
49$email =
GETPOST(
'email',
'alpha');
51if (!$user->hasRight(
'takepos',
'run')) {
55$langs->loadLangs(array(
"main",
"bills",
"cashdesk"));
58$invoice->fetch($facid);
60$customer->fetch($invoice->socid);
67if ($action ==
"send" && $user->hasRight(
'takepos',
'run')) {
68 include_once DOL_DOCUMENT_ROOT.
'/core/class/CMailFile.class.php';
69 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
73 $arraydefaultmessage = $formmail->getEMailTemplate($db,
'facture_send', $user, $outputlangs, $model_id);
74 $subject = $arraydefaultmessage->topic;
77 include DOL_DOCUMENT_ROOT.
'/takepos/receipt.php';
78 $receipt = ob_get_contents();
81 $msg =
"<html>".$arraydefaultmessage->content.
"<br>".$receipt.
"</html>";
83 $from = $mysoc->email;
84 $mail =
new CMailFile($subject, $sendto, $from, $msg, array(), array(), array(),
'',
'', 0, 1,
'',
'',
'',
'',
'',
'', DOL_DOCUMENT_ROOT.
'/documents/takepos/temp');
85 if ($mail->error || !empty($mail->errors)) {
88 $result = $mail->sendfile();
98$arrayofcss = array(
'/takepos/css/pos.css.php');
109 data: { token:
'<?php echo currentToken(); ?>' },
110 url:
"<?php print DOL_URL_ROOT.'/takepos/send.php?action=send&token='.newToken().'&facid='.$facid.'&email='; ?>" + $(
"#email"). val(),
112 parent.$.colorbox.close();
120<input
type=
"email" id=
"email" name=
"email" style=
"width:60%;font-size: 200%;" value=
"<?php echo $customer->email; ?>"></center>
126<
button type=
"button" class=
"calcbutton" onclick=
"SendMail()"><?php print $langs->trans(
"SendTicket"); ?></
button>
Class to send emails (with attachments or not) Usage: $mailfile = new CMailFile($subject,...
Class to manage invoices.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage translations.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
ui state ui widget content ui state ui widget header ui state a ui button
0 = Do not include form tag and submit button -1 = Do not include form tag but include submit button
top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs=array(), $arrayofcss=array(), $disableforlogin=0, $disablenofollow=0, $disablenoindex=0)
Output html header of a page.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
$conf db name
Only used if Module[ID]Name translation string is not found.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.