forked from Wavyzz/dolibarr
Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
@@ -38,24 +38,31 @@ $action = GETPOST('action','aZ09');
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
* Action
|
||||
*/
|
||||
|
||||
// Action activation d'un sous module du module adherent
|
||||
if ($action == 'set')
|
||||
if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg))
|
||||
{
|
||||
$result=dolibarr_set_const($db, $_GET["name"], $_GET["value"], '', 0, '', $conf->entity);
|
||||
if ($result < 0)
|
||||
$code=$reg[1];
|
||||
if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0)
|
||||
{
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
// Action desactivation d'un sous module du module adherent
|
||||
if ($action == 'unset')
|
||||
if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg))
|
||||
{
|
||||
$result=dolibarr_del_const($db, $_GET["name"], $conf->entity);
|
||||
if ($result < 0)
|
||||
$code=$reg[1];
|
||||
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
|
||||
{
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
@@ -94,21 +101,13 @@ $arrayofsocialnetworks=array('jabber'=>'Jabber', 'skype'=>'Skype', 'twitter'=>'T
|
||||
foreach($arrayofsocialnetworks as $snkey => $snlabel)
|
||||
{
|
||||
$consttocheck = 'SOCIALNETWORKS_'.strtoupper($snkey);
|
||||
if (! empty($conf->global->$consttocheck))
|
||||
{
|
||||
//$link=img_picto($langs->trans("Active"),'tick').' ';
|
||||
$link='<a href="'.$_SERVER["PHP_SELF"].'?action=unset&value=0&name='.$consttocheck.'">';
|
||||
//$link.=$langs->trans("Disable");
|
||||
$link.=img_picto($langs->trans("Activated"),'switch_on');
|
||||
$link.='</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$link='<a href="'.$_SERVER["PHP_SELF"].'?action=set&value=1&name='.$consttocheck.'">';
|
||||
//$link.=img_$langs->trans("Activate")
|
||||
$link.=img_picto($langs->trans("Disabled"),'switch_off');
|
||||
$link.='</a>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
$link = ajax_constantonoff($consttocheck);
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
$link = $form->selectarray($consttocheck, $arrval, $conf->global->$consttocheck);
|
||||
}
|
||||
|
||||
print $langs->trans('EnableFeatureFor', $snlabel).' '.$link.'<br><br>';
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2019 Josep Lluís Amador <joseplluis@lliuretic.cat>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -378,12 +379,6 @@ if (empty($reshook))
|
||||
|
||||
if ($result > 0) {
|
||||
// Categories association
|
||||
// First we delete all categories association
|
||||
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . 'categorie_contact';
|
||||
$sql .= ' WHERE fk_socpeople = ' . $object->id;
|
||||
$db->query($sql);
|
||||
|
||||
// Then we add the associated categories
|
||||
$categories = GETPOST('contcats', 'array');
|
||||
$object->setCategories($categories);
|
||||
|
||||
|
||||
@@ -40,9 +40,38 @@ if (!$user->admin) accessforbidden();
|
||||
|
||||
$langs->loadLangs(array("admin", "cashdesk"));
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
* Action
|
||||
*/
|
||||
if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg))
|
||||
{
|
||||
$code=$reg[1];
|
||||
if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0)
|
||||
{
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg))
|
||||
{
|
||||
$code=$reg[1];
|
||||
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
|
||||
{
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
if (GETPOST('action','alpha') == 'set')
|
||||
{
|
||||
$db->begin();
|
||||
@@ -92,32 +121,38 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
|
||||
print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)',$linkback,'title_setup');
|
||||
print '<br>';
|
||||
|
||||
|
||||
// Mode
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="set">';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td>';
|
||||
print '<td>'.$langs->trans("Parameters").'</td>'."\n";
|
||||
print '<td align="center">'.$langs->trans("Status").'</td>'."\n";
|
||||
print "</tr>\n";
|
||||
|
||||
if (! empty($conf->service->enabled))
|
||||
{
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("CashdeskShowServices");
|
||||
print '<td colspan="2">';
|
||||
print $form->selectyesno("CASHDESK_SERVICES",$conf->global->CASHDESK_SERVICES,1);
|
||||
print '<td align="center">';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('CASHDESK_SERVICES');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("CASHDESK_SERVICES", $arrval, $conf->global->CASHDESK_SERVICES);
|
||||
}
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
|
||||
// Use Takepos printing
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("DolibarrReceiptPrinter").' (<a href="http://en.takepos.com/connector">'.$langs->trans("TakeposConnectorNecesary").'</a>)';
|
||||
print '<td colspan="2">';
|
||||
print $form->selectyesno("TAKEPOSCONNECTOR",$conf->global->TAKEPOSCONNECTOR,1);
|
||||
print '<td align="center">';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('TAKEPOSCONNECTOR');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("TAKEPOSCONNECTOR", $arrval, $conf->global->TAKEPOSCONNECTOR);
|
||||
}
|
||||
print "</td></tr>\n";
|
||||
|
||||
if ($conf->global->TAKEPOSCONNECTOR){
|
||||
@@ -131,15 +166,25 @@ if ($conf->global->TAKEPOSCONNECTOR){
|
||||
// Bar Restaurant mode
|
||||
print '<tr class="oddeven"><td>';
|
||||
print 'Bar Restaurant';
|
||||
print '<td colspan="2">';
|
||||
print $form->selectyesno("TAKEPOS_BAR_RESTAURANT",$conf->global->TAKEPOS_BAR_RESTAURANT,1);
|
||||
print '<td align="center">';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('TAKEPOS_BAR_RESTAURANT');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("TAKEPOS_BAR_RESTAURANT", $arrval, $conf->global->TAKEPOS_BAR_RESTAURANT);
|
||||
}
|
||||
|
||||
print "</td></tr>\n";
|
||||
|
||||
if ($conf->global->TAKEPOS_BAR_RESTAURANT && $conf->global->TAKEPOSCONNECTOR){
|
||||
print '<tr class="oddeven value"><td>';
|
||||
print $langs->trans("OrderPrinters").' (<a href="orderprinters.php?leftmenu=setup">'.$langs->trans("Setup").'</a>)';
|
||||
print '<td colspan="2">';
|
||||
print $form->selectyesno("TAKEPOS_ORDER_PRINTERS",$conf->global->TAKEPOS_ORDER_PRINTERS,1);
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('TAKEPOS_ORDER_PRINTERS');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("TAKEPOS_ORDER_PRINTERS", $arrval, $conf->global->TAKEPOS_ORDER_PRINTERS);
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@@ -185,6 +230,9 @@ print '</table>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="set">';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
Reference in New Issue
Block a user