28require
'../../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
30require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
33require_once DOL_DOCUMENT_ROOT.
"/core/lib/takepos.lib.php";
48$langs->loadLangs(array(
"admin",
"cashdesk",
"printing"));
58if (
GETPOST(
'action',
'alpha') ==
'set') {
63 $suplement_category =
GETPOST(
'TAKEPOS_SUPPLEMENTS_CATEGORY',
'alpha');
64 if ($suplement_category < 0) {
65 $suplement_category = 0;
68 $res =
dolibarr_set_const($db,
"TAKEPOS_SUPPLEMENTS_CATEGORY", $suplement_category,
'chaine', 0,
'',
$conf->entity);
84 $extrafields->addExtraField(
'order_notes',
'Order notes',
'varchar', 0, 255,
'facturedet', 0, 0,
'',
'', 0,
'', 0, 1);
95$arrayofcss = array(
"/takepos/css/colorbox.css");
97llxHeader(
'', $langs->trans(
"CashDeskSetup"),
'',
'', 0, 0, $arrayofjs, $arrayofcss,
'',
'mod-takepos page-admin_bar');
99$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php">'.$langs->trans(
"BackToModuleList").
'</a>';
100print
load_fiche_titre($langs->trans(
"CashDeskSetup").
' (TakePOS)', $linkback,
'title_setup');
106print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
107print
'<input type="hidden" name="token" value="'.newToken().
'">';
108print
'<input type="hidden" name="action" value="set">';
111<script
type=
"text/javascript" src=
"<?php echo DOL_URL_ROOT ?>/takepos/js/jquery.colorbox-min.js"></script> <!-- TODO It seems we don
't need this -->
112<script type="text/javascript">
114 console.log("Open box to select floor");
115 $.colorbox({href:"<?php echo DOL_URL_ROOT ?>/takepos/floors.php?mode=edit&place=0", width:"90%", height:"90%", transition:"none", iframe:"true", title:"<?php echo $langs->trans("Floors"); ?>"});
122print $langs->trans("EnableBarOrRestaurantFeatures");
123print ajax_constantonoff("TAKEPOS_BAR_RESTAURANT", array(), $conf->entity, 0, 0, 1, 0);
128if (getDolGlobalInt('TAKEPOS_BAR_RESTAURANT
')) {
130 print '<a href=
"" onclick=
"Floors(); return false;"><span
class=
"fa fa-glass-cheers"></span>
'.$langs->trans("DefineTablePlan").'</a><br>
';
133 print '<div
class=
"div-table-responsive-no-min">
';
134 print '<
table class=
"noborder centpercent">
';
135 print '<tr
class=
"liste_titre">
';
136 print '<td>
'.$langs->trans("Parameters").'</td><td
class=
""></td>
';
139 print '<tr
class=
"oddeven value"><td>
';
140 print $langs->trans("OrderPrinters");
142 print '<td
class=
"">
';
143 print ajax_constantonoff("TAKEPOS_ORDER_PRINTERS", array(), $conf->entity, 0, 0, 1, 0);
144 if (getDolGlobalString('TAKEPOS_ORDER_PRINTERS
')) {
145 print' <a href=
"'.DOL_URL_ROOT.'/takepos/admin/orderprinters.php?leftmenu=setup">
'.$langs->trans("Setup").'</a>
';
149 if (getDolGlobalString('TAKEPOS_ORDER_PRINTERS
')) {
150 print '<tr
class=
"oddeven value"><td>
';
151 print $langs->trans("OrderNotes");
153 print '<td
class=
"">
';
154 print ajax_constantonoff("TAKEPOS_ORDER_NOTES", array(), $conf->entity, 0, 0, 1, 0);
158 print '<tr
class=
"oddeven value"><td>
';
159 print $langs->trans("OrderPrinters");
161 print '<td
class=
"">
';
162 print '<span
class=
"opacitymedium">
'.$langs->trans("NotAvailableWithBrowserPrinter").'</span>
';
165 print '<tr
class=
"oddeven value"><td>
';
166 print $langs->trans("OrderNotes");
168 print '<td
class=
"">
';
169 print '<span
class=
"opacitymedium">
'.$langs->trans("NotAvailableWithBrowserPrinter").'</span>
';
173 print '<tr
class=
"oddeven value"><td>
';
174 print $langs->trans("ProductSupplements");
176 print '<td
class=
"">
';
177 //print $form->selectyesno("TAKEPOS_SUPPLEMENTS", $conf->global->TAKEPOS_SUPPLEMENTS, 1);
178 print ajax_constantonoff("TAKEPOS_SUPPLEMENTS", array(), $conf->entity, 0, 0, 1, 0);
181 if (getDolGlobalInt('TAKEPOS_SUPPLEMENTS
')) {
182 print '<tr
class=
"oddeven"><td>
';
183 print $langs->trans("SupplementCategory");
185 print '<td
class=
"nowrap">
';
186 print img_picto('', 'category
', 'class=
"pictofixedwidth"');
187 print $form->select_all_categories(Categorie::TYPE_PRODUCT, getDolGlobalString('TAKEPOS_SUPPLEMENTS_CATEGORY
'), 'TAKEPOS_SUPPLEMENTS_CATEGORY
', 64, 0, 0, 0, 'minwidth 200 maxwidth500 widthcentpercentminusx
');
188 print ajax_combobox('TAKEPOS_SUPPLEMENTS_CATEGORY
');
189 print "</td></tr>\n";
192 print '<tr
class=
"oddeven value"><td>
';
193 print 'QR -
'.$langs->trans("CustomerMenu");
195 print '<td
class=
"">
';
196 print ajax_constantonoff("TAKEPOS_QR_MENU", array(), $conf->entity, 0, 0, 1, 0);
199 print '<tr
class=
"oddeven value"><td>
';
200 print 'QR -
'.$langs->trans("AutoOrder");
202 print '<td
class=
"">
';
203 print ajax_constantonoff("TAKEPOS_AUTO_ORDER", array(), $conf->entity, 0, 0, 1, 0);
206 // Experimental minimal interface
207 print '<tr
class=
"oddeven value"><td>
';
208 print $langs->trans("BasicPhoneLayout");
209 print ' - <span
class=
"warning">
'.$langs->trans("Experimental").'</span>
';
211 print '<td
class=
"">
';
212 //print $form->selectyesno("TAKEPOS_PHONE_BASIC_LAYOUT", $conf->global->TAKEPOS_PHONE_BASIC_LAYOUT, 1);
213 print ajax_constantonoff("TAKEPOS_PHONE_BASIC_LAYOUT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_warning
');
221 print $form->buttonsSaveCancel("Save", '');
224if (getDolGlobalInt('TAKEPOS_BAR_RESTAURANT
')) {
225 if (getDolGlobalInt('TAKEPOS_QR_MENU
')) {
226 $urlwithouturlroot = preg_replace('/
'.preg_quote(DOL_URL_ROOT, '/
').'$/i
', '', trim($dolibarr_main_url_root));
227 $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
229 print '<div
class=
"div-table-responsive-no-min">
';
230 print '<
table class=
"noborder centpercent">
';
231 print '<tr
class=
"liste_titre">
';
232 print '<td>
'.$langs->trans("URL").' -
'.$langs->trans("CustomerMenu").'</td><td
class=
"right">
'.$langs->trans("QR").'</td>
';
234 print '<tr
class=
"oddeven value"><td>
';
235 print '<a target=
"_blank" rel=
"noopener noreferrer" href=
"'.$urlwithroot.'/takepos/public/menu.php">
'.$urlwithroot.'/takepos/
public/menu.php</a>
';
237 print '<td
class=
"right">
';
238 print '<a target=
"_blank" rel=
"noopener noreferrer" href=
"printqr.php"><img src=
"'.DOL_URL_ROOT.'/takepos/genimg/qr.php" height=
"42" width=
"42"></a>
';
244 if (getDolGlobalInt('TAKEPOS_AUTO_ORDER
')) {
246 print '<div
class=
"div-table-responsive-no-min">
';
247 print '<
table class=
"noborder centpercent">
';
248 print '<tr
class=
"liste_titre">
';
249 print '<td>
'.$langs->trans("Table").'</td><td>
'.$langs->trans("URL").' -
'.$langs->trans("AutoOrder").'</td><td
class=
"right">
'.$langs->trans("QR").'</td>
';
252 //global $dolibarr_main_url_root;
253 $urlwithouturlroot = preg_replace('/
'.preg_quote(DOL_URL_ROOT, '/
').'$/i
', '', trim($dolibarr_main_url_root));
254 $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
255 $sql = "SELECT rowid, entity, label, leftpos, toppos, floor FROM ".MAIN_DB_PREFIX."takepos_floor_tables WHERE entity IN (".getEntity('takepos
').")";
256 $resql = $db->query($sql);
258 while ($row = $db->fetch_array($resql)) {
259 print '<tr
class=
"oddeven value"><td>
';
260 print $langs->trans("Table")." ".$row['label
'];
263 print '<a target=
"_blank" rel=
"noopener noreferrer" href=
"'.$urlwithroot."/takepos/
public/auto_order.php?key=
".dol_encode($row['rowid']).'">
'.$urlwithroot."/takepos/public/auto_order.php?key=".dol_encode($row['rowid
']).'</a>
';
265 print '<td
class=
"right">
';
266 print '<a target=
"_blank" rel=
"noopener noreferrer" href=
"printqr.php?id='.$row['rowid'].'"><img src=
"'.DOL_URL_ROOT.'/takepos/genimg/qr.php?key='.dol_encode($row['rowid']).'" height=
"42" width=
"42"></a>
';
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
treeview li table
No Email.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
takepos_admin_prepare_head()
Prepare array with list of tabs.