Merge pull request #14 from Dolibarr/develop

pull from develop
This commit is contained in:
Tobias Sekan 2020-04-12 13:02:34 +02:00 committed by GitHub
commit 3934902b9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 289 additions and 89 deletions

View File

@ -222,6 +222,9 @@
<rule ref="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceBeforeClose" />
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration" />
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration.SpaceAfterFunction">
<severity>0</severity>
</rule>
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
<properties>
<property name="equalsSpacing" value="1"/>

View File

@ -168,7 +168,7 @@ class Lettering extends BookKeeping
if ($object->code_compta_fournisseur != "") {
$sql .= " bk.subledger_account = '".$object->code_compta_fournisseur."' ";
}
$sql .= " ) ";
$sql .= " )";
$resql2 = $this->db->query($sql);
if ($resql2) {
@ -217,7 +217,7 @@ class Lettering extends BookKeeping
}
if ($error) {
foreach ($this->errors as $errmsg) {
dol_syslog(get_class($this)."::".__METHOD__.$errmsg, LOG_ERR);
dol_syslog(__METHOD__.' '.$errmsg, LOG_ERR);
$this->error .= ($this->error ? ', '.$errmsg : $errmsg);
}
return -1 * $error;
@ -237,8 +237,6 @@ class Lettering extends BookKeeping
$error = 0;
$lettre = 'AAA';
dol_syslog(get_class($this)."::".__METHOD__, LOG_DEBUG);
$sql = "SELECT DISTINCT lettering_code FROM ".MAIN_DB_PREFIX."accounting_bookkeeping WHERE ";
$sql .= " lettering_code != '' ORDER BY lettering_code DESC limit 1; ";

View File

@ -108,7 +108,7 @@ $fieldstosearchall = array(
'd.town'=>'Town',
'd.phone'=>"Phone",
'd.phone_perso'=>"PhonePerso",
'd.phone_mobile'=>"PhoneMobile"?
'd.phone_mobile'=>"PhoneMobile",
'd.note_public'=>'NotePublic',
'd.note_private'=>'NotePrivate',
);

View File

@ -241,9 +241,9 @@ print '<input type="hidden" name="action" value="update">';
clearstatcache();
print '<br>';
print '<table summary="edit" class="noborder centpercent">';
print '<tr class="liste_titre"><td>'.$langs->trans("Language").'</td><td></td>';
print '<td width="20">&nbsp;</td>';
print '<table summary="edit" class="noborder centpercent editmode">';
print '<tr class="liste_titre"><th>'.$langs->trans("Language").'</th><th></th>';
print '<th width="20">&nbsp;</td>';
print '</tr>';
// Default language
@ -268,9 +268,9 @@ showSkins(null, 1);
print '<br>';
// Other
print '<table summary="otherparameters" class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Miscellaneous").'</td><td></td>';
print '<td width="20">&nbsp;</td>';
print '<table summary="otherparameters" class="noborder centpercent editmode">';
print '<tr class="liste_titre"><th>'.$langs->trans("Miscellaneous").'</th><th></th>';
print '<th width="20">&nbsp;</tg>';
print '</tr>';
// Disable javascript and ajax
@ -385,9 +385,9 @@ print '<br>';
// Other
print '<div class="div-table-responsive-no-min">';
print '<table summary="edit" class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("LoginPage").'</td><td></td>';
print '<td width="20">&nbsp;</td>';
print '<table summary="edit" class="noborder centpercent editmode">';
print '<tr class="liste_titre"><th class="titlefield">'.$langs->trans("LoginPage").'</th><th></th>';
print '<th width="20">&nbsp;</th>';
print '</tr>';
// Message on login page

View File

@ -231,7 +231,7 @@ if ($error)
print load_fiche_titre($langs->trans("MenuBankInternalTransfer"), '', 'bank_account');
print $langs->trans("TransferDesc");
print '<span class="opacitymedium">'.$langs->trans("TransferDesc").'</span>';
print "<br><br>";
print '<form name="add" method="post" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -49,8 +49,7 @@
* <dol_print_object_tax> Print object total tax
* <dol_print_object_local_tax> Print object local tax
* <dol_print_object_total> Print object total
* <dol_print_order_lines_printer1> Print order lines for Printer1
* <dol_print_order_lines_printer2> Print order lines for Printer2
* <dol_print_order_lines> Print order lines for Printer
* <dol_print_payment> Print payment method
*
* Code which can be placed everywhere
@ -134,6 +133,12 @@ class dolReceiptPrinter extends Printer
public $printer;
public $template;
/**
* Number of order printer
* @var int
*/
public $orderprinter;
/**
* @var string Error code (or message)
*/
@ -191,8 +196,7 @@ class dolReceiptPrinter extends Printer
'dol_print_object_local_tax',
'dol_print_object_total',
'dol_print_object_number',
'dol_print_order_lines_printer1',
'dol_print_order_lines_printer2',
'dol_print_order_lines',
'dol_value_customer_firstname',
'dol_value_customer_lastname',
'dol_value_customer_mail',
@ -726,20 +730,9 @@ class dolReceiptPrinter extends Printer
case 'DOL_BEEP':
$this->printer->getPrintConnector() -> write("\x1e");
break;
case 'DOL_PRINT_ORDER_LINES_PRINTER1':
case 'DOL_PRINT_ORDER_LINES':
foreach ($object->lines as $line) {
if ($line->special_code == 1)
{
$spacestoadd = $nbcharactbyline - strlen($line->ref) - strlen($line->qty) - 10 - 1;
$spaces = str_repeat(' ', $spacestoadd);
$this->printer->text($line->ref.$spaces.$line->qty.' '.str_pad(price($line->total_ttc), 10, ' ', STR_PAD_LEFT)."\n");
$this->printer->text(strip_tags(htmlspecialchars_decode($line->desc))."\n");
}
}
break;
case 'DOL_PRINT_ORDER_LINES_PRINTER2':
foreach ($object->lines as $line) {
if ($line->special_code == 2)
if ($line->special_code==$this->orderprinter)
{
$spacestoadd = $nbcharactbyline - strlen($line->ref) - strlen($line->qty) - 10 - 1;
$spaces = str_repeat(' ', $spacestoadd);

View File

@ -722,6 +722,7 @@ class Form
else
{
jQuery(".massaction").hide();
jQuery(".massactionother").hide();
}
}
@ -743,10 +744,12 @@ class Form
if ($(this).val() != \'0\')
{
jQuery(".massactionconfirmed").prop(\'disabled\', false);
jQuery(".massactionother").show();
}
else
{
jQuery(".massactionconfirmed").prop(\'disabled\', true);
jQuery(".massactionother").hide();
}
});
});

View File

@ -1282,7 +1282,7 @@ class FormFile
$sizetoshow = dol_print_size($file['size'], 1, 1);
$sizetoshowbytes = dol_print_size($file['size'], 0, 1);
print '<td class="right" style="width: 80px">';
print '<td class="right nowraponall">';
if ($sizetoshow == $sizetoshowbytes) print $sizetoshow;
else {
print $form->textwithpicto($sizetoshow, $sizetoshowbytes, -1);
@ -1317,7 +1317,7 @@ class FormFile
} else {
print '<a href="'.$urlforhref['url'].'" class="'.$urlforhref['css'].'" target="'.$urlforhref['target'].'" mime="'.$urlforhref['mime'].'">';
}
print '<img class="photo" height="'.(($useinecm == 4 || $useinecm == 5 || $useinecm == 6) ? '12' : $maxheightmini).'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(!empty($object->entity) ? $object->entity : $conf->entity).'&file='.urlencode($relativepath.$smallfile).'" title="">';
print '<img class="photo maxwidth200" height="'.(($useinecm == 4 || $useinecm == 5 || $useinecm == 6) ? '12' : $maxheightmini).'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(!empty($object->entity) ? $object->entity : $conf->entity).'&file='.urlencode($relativepath.$smallfile).'" title="">';
print '</a>';
}
else print '&nbsp;';

View File

@ -3234,7 +3234,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'hrm'=>'bg-infoxbox-adherent', 'group'=>'bg-infoxbox-adherent',
'members'=>'bg-infoxbox-adherent', 'member'=>'bg-infoxbox-adherent', 'user'=>'bg-infoxbox-adherent', 'users'=>'bg-infoxbox-adherent',
'error'=>'pictoerror', 'warning'=>'pictowarning', 'switch_on'=>'font-status4',
'holiday'=>'bg-infoxbox-holiday', 'resource'=>'bg-infoxbox-action', 'title_hrm'=>'bg-infoxbox-holiday', 'trip'=>'bg-infoxbox-expensereport',
'holiday'=>'bg-infoxbox-holiday', 'project'=>'bg-infoxbox-project', 'resource'=>'bg-infoxbox-action', 'title_hrm'=>'bg-infoxbox-holiday', 'trip'=>'bg-infoxbox-expensereport',
'title_agenda'=>'bg-infoxbox-action',
'list-alt'=>'imgforviewmode', 'calendar'=>'imgforviewmode', 'calendarweek'=>'imgforviewmode', 'calendarmonth'=>'imgforviewmode', 'calendarday'=>'imgforviewmode', 'calendarperuser'=>'imgforviewmode'
);
@ -4247,7 +4247,7 @@ function load_fiche_titre($titre, $morehtmlright = '', $picto = 'generic', $pict
$return .= "\n";
$return .= '<table '.($id ? 'id="'.$id.'" ' : '').'class="centpercent notopnoleftnoright table-fiche-title'.($morecssontable ? ' '.$morecssontable : '').'">'; // maring bottom must be same than into print_barre_list
$return .= '<tr class="titre">';
if ($picto) $return .= '<td class="nobordernopadding widthpictotitle opacityhigh valignmiddle col-picto">'.img_picto('', $picto, 'class="valignmiddle widthpictotitle pictotitle"', $pictoisfullpath).'</td>';
if ($picto) $return .= '<td class="nobordernopadding widthpictotitle valignmiddle col-picto">'.img_picto('', $picto, 'class="valignmiddle widthpictotitle pictotitle"', $pictoisfullpath).'</td>';
$return .= '<td class="nobordernopadding valignmiddle col-title">';
$return .= '<div class="titre inline-block">'.$titre.'</div>';
$return .= '</td>';
@ -4313,7 +4313,7 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '',
// Left
if ($picto && $titre) print '<td class="nobordernopadding widthpictotitle opacityhigh valignmiddle col-picto">'.img_picto('', $picto, 'class="valignmiddle pictotitle widthpictotitle"', $pictoisfullpath).'</td>';
if ($picto && $titre) print '<td class="nobordernopadding widthpictotitle valignmiddle col-picto">'.img_picto('', $picto, 'class="valignmiddle pictotitle widthpictotitle"', $pictoisfullpath).'</td>';
print '<td class="nobordernopadding valignmiddle col-title">';
print '<div class="titre inline-block">'.$titre;
if (!empty($titre) && $savtotalnboflines >= 0 && (string) $savtotalnboflines != '') print '<span class="opacitymedium colorblack paddingleft">('.$totalnboflines.')</span>';

View File

@ -331,7 +331,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
if ($foruserprofile) $colspan = 4;
$thumbsbyrow = 6;
print '<table class="noborder centpercent">';
print '<table class="noborder centpercent'.($edit ? ' editmode' : '').'">';
// Title
if ($foruserprofile)

View File

@ -793,7 +793,7 @@ function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25, $so
{
$tmpwebsitepage = new WebsitePage($db);
$tmpwebsitepage->fetch($obj->rowid);
if ($tmpwebsitepage->id > 0) $arrayresult['list'][] = $tmpwebsitepage;
if ($tmpwebsitepage->id > 0) $arrayresult['list'][$obj->rowid] = $tmpwebsitepage;
$found++;
}
$i++;

View File

@ -72,6 +72,9 @@ function dolSavePageAlias($filealias, $object, $objectpage)
$aliascontent .= 'else require $dolibarr_main_data_root.\'/website/\'.$website->ref.\'/page'.$objectpage->id.'.tpl.php\';'."\n";
$aliascontent .= '?>'."\n";
$result = file_put_contents($filealias, $aliascontent);
if ($result === false) {
dol_syslog("Failed to write file ".$filealias, LOG_WARNING);
}
if (!empty($conf->global->MAIN_UMASK)) {
@chmod($filealias, octdec($conf->global->MAIN_UMASK));
}
@ -89,6 +92,9 @@ function dolSavePageAlias($filealias, $object, $objectpage)
$aliascontent .= 'else require $dolibarr_main_data_root.\'/website/\'.$website->ref.\'/page'.$objectpage->id.'.tpl.php\';'."\n";
$aliascontent .= '?>'."\n";
$result = file_put_contents($filealias, $aliascontent);
if ($result === false) {
dol_syslog("Failed to write file ".$filealias, LOG_WARNING);
}
if (!empty($conf->global->MAIN_UMASK)) {
@chmod($filealias, octdec($conf->global->MAIN_UMASK));
}

View File

@ -53,7 +53,7 @@ class modReceiptPrinter extends DolibarrModules
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
$this->description = "ReceiptPrinterDesc";
// Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version
$this->version = 'development';
$this->version = 'experimental';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'

View File

@ -73,6 +73,14 @@ ALTER TABLE llx_holiday_users ADD UNIQUE INDEX uk_holiday_users(fk_user, fk_type
ALTER TABLE llx_ticket ADD COLUMN import_key varchar(14);
ALTER TABLE llx_ticket ADD UNIQUE uk_ticket_ref (ref, entity);
ALTER TABLE llx_ticket ADD INDEX idx_ticket_entity (entity);
ALTER TABLE llx_ticket ADD INDEX idx_ticket_fk_soc (fk_soc);
ALTER TABLE llx_ticket ADD INDEX idx_ticket_fk_user_assign (fk_user_assign);
ALTER TABLE llx_ticket ADD INDEX idx_ticket_fk_project (fk_project);
ALTER TABLE llx_ticket ADD INDEX idx_ticket_fk_statut (fk_statut);
--ALTER TABLE llx_facturerec DROP COLUMN vat_src_code;

View File

@ -26,5 +26,14 @@ ALTER TABLE llx_societe ADD UNIQUE INDEX uk_societe_barcode (barcode, fk_barcode
ALTER TABLE llx_societe ADD INDEX idx_societe_user_creat(fk_user_creat);
ALTER TABLE llx_societe ADD INDEX idx_societe_user_modif(fk_user_modif);
ALTER TABLE llx_societe ADD INDEX idx_societe_stcomm(fk_stcomm);
ALTER TABLE llx_societe ADD INDEX idx_societe_pays(fk_pays);
ALTER TABLE llx_societe ADD INDEX idx_societe_account(fk_account);
ALTER TABLE llx_societe ADD INDEX idx_societe_prospectlevel(fk_prospectlevel);
ALTER TABLE llx_societe ADD INDEX idx_societe_typent(fk_typent);
ALTER TABLE llx_societe ADD INDEX idx_societe_forme_juridique(fk_forme_juridique);
ALTER TABLE llx_societe ADD INDEX idx_societe_shipping_method(fk_shipping_method);
ALTER TABLE llx_societe ADD INDEX idx_societe_entrepot(fk_entrepot);
-- ALTER TABLE llx_societe ADD FOREIGN KEY fk_prospectlevel llx_c_prospectlevel(code);

View File

@ -15,3 +15,9 @@
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
ALTER TABLE llx_ticket ADD UNIQUE uk_ticket_track_id (track_id);
ALTER TABLE llx_ticket ADD UNIQUE uk_ticket_ref (ref, entity);
ALTER TABLE llx_ticket ADD INDEX idx_ticket_entity (entity);
ALTER TABLE llx_ticket ADD INDEX idx_ticket_fk_soc (fk_soc);
ALTER TABLE llx_ticket ADD INDEX idx_ticket_fk_user_assign (fk_user_assign);
ALTER TABLE llx_ticket ADD INDEX idx_ticket_fk_project (fk_project);
ALTER TABLE llx_ticket ADD INDEX idx_ticket_fk_statut (fk_statut);

View File

@ -167,7 +167,7 @@ SuppliersPrices=Vendor prices
SuppliersPricesOfProductsOrServices=Vendor prices (of products or services)
CustomCode=Customs / Commodity / HS code
CountryOrigin=Origin country
Nature=Nature of produt (material/finished)
Nature=Nature of product (material/finished)
ShortLabel=Short label
Unit=Unit
p=u.

View File

@ -126,4 +126,5 @@ MainLanguage=Main language
OtherLanguages=Other languages
UseManifest=Provide a manifest.json file
PublicAuthorAlias=Public author alias
AvailableLanguagesAreDefinedIntoWebsiteProperties=Available languages are defined into website properties
AvailableLanguagesAreDefinedIntoWebsiteProperties=Available languages are defined into website properties
ReplacementDoneInXPages=Replacement done in %s pages or containers

View File

@ -260,8 +260,8 @@ $companystatic = new Societe($db); // We need a clean new object for next loop b
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print_liste_field_titre("OpenedProjectsByThirdparties", $_SERVER["PHP_SELF"], "s.nom", "", "", '', $sortfield, $sortorder);
print_liste_field_titre("NbOfProjects", "", "", "", "", '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("OpenedProjectsByThirdparties", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder);
print_liste_field_titre("NbOfProjects", $_SERVER["PHP_SELF"], "nb", "", "", '', $sortfield, $sortorder, 'right ');
print "</tr>\n";
$sql = "SELECT COUNT(p.rowid) as nb, SUM(p.opp_amount)";

View File

@ -41,7 +41,7 @@ if (!empty($_REQUEST['CASHDESK_ID_THIRDPARTY'.$terminal.'_id']))
// Security check
if (!$user->admin) accessforbidden();
$langs->loadLangs(array("admin", "cashdesk"));
$langs->loadLangs(array("admin", "cashdesk", "printing"));
global $db;
@ -85,6 +85,8 @@ if (GETPOST('action', 'alpha') == 'set')
$res = dolibarr_set_const($db, "CASHDESK_ID_WAREHOUSE".$terminaltouse, (GETPOST('CASHDESK_ID_WAREHOUSE'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_WAREHOUSE'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "CASHDESK_NO_DECREASE_STOCK".$terminaltouse, GETPOST('CASHDESK_NO_DECREASE_STOCK'.$terminaltouse, 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_PRINTER_TO_USE".$terminaltouse, GETPOST('TAKEPOS_PRINTER_TO_USE'.$terminaltouse, 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_ORDER_PRINTER1_TO_USE".$terminaltouse, GETPOST('TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminaltouse, 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_ORDER_PRINTER2_TO_USE".$terminaltouse, GETPOST('TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminaltouse, 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES".$terminaltouse, GETPOST('TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$terminaltouse, 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS".$terminaltouse, GETPOST('TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$terminaltouse, 'alpha'), 'chaine', 0, '', $conf->entity);
@ -234,9 +236,13 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") {
print $form->selectarray('TAKEPOS_PRINTER_TO_USE'.$terminal, $printers, (empty($conf->global->{'TAKEPOS_PRINTER_TO_USE'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_PRINTER_TO_USE'.$terminal}), 1);
print '</td></tr>';
if ($conf->global->TAKEPOS_ORDER_PRINTERS) {
print '<tr class="oddeven"><td>'.$langs->trans("OrderPrinterToUse").'</td>';
print '<tr class="oddeven"><td>'.$langs->trans("OrderPrinterToUse").' - '.$langs->trans("Printer").' 1</td>';
print '<td>';
print $form->selectarray('TAKEPOS_ORDER_PRINTER_TO_USE'.$terminal, $printers, (empty($conf->global->{'TAKEPOS_ORDER_PRINTER_TO_USE'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_ORDER_PRINTER_TO_USE'.$terminal}), 1);
print $form->selectarray('TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminal, $printers, (empty($conf->global->{'TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminal}), 1);
print '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("OrderPrinterToUse").' - '.$langs->trans("Printer").' 2</td>';
print '<td>';
print $form->selectarray('TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminal, $printers, (empty($conf->global->{'TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminal}) ? '0' : $conf->global->{'TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminal}), 1);
print '</td></tr>';
}
$printer->listPrintersTemplates();

View File

@ -526,6 +526,7 @@ if ($action == "order" and $placeid != 0)
$result = array_intersect($catsprinter1, $existing);
$count = count($result);
if ($count > 0) {
$linestoprint++;
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set special_code='1' where rowid=".$line->id; //Set to print on printer 1
$db->query($sql);
$order_receipt_printer1 .= '<tr>'.$line->product_label.'<td class="right">'.$line->qty;
@ -533,17 +534,18 @@ if ($action == "order" and $placeid != 0)
$order_receipt_printer1 .= '</td></tr>';
}
}
if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter" && $count > 0) {
if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter" && $linestoprint > 0) {
$invoice->fetch($placeid); //Reload object before send to printer
$ret = $printer->sendToPrinter($invoice, $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$_SESSION["takeposterminal"]}, $conf->global->{'TAKEPOS_PRINTER_TO_USE'.$_SESSION["takeposterminal"]}); // PRINT TO PRINTER 1
$printer->orderprinter=1;
$ret = $printer->sendToPrinter($invoice, $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$_SESSION["takeposterminal"]}, $conf->global->{'TAKEPOS_ORDER_PRINTER1_TO_USE'.$_SESSION["takeposterminal"]}); // PRINT TO PRINTER 1
}
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set special_code='4' where special_code='1' and fk_facture=".$invoice->id; // Set as printed
$db->query($sql);
$invoice->fetch($placeid); //Reload object after set lines as printed
$linestoprint=0;
foreach ($invoice->lines as $line)
{
$count=0;
if ($line->special_code == "4") {
continue;
}
@ -552,6 +554,7 @@ if ($action == "order" and $placeid != 0)
$result = array_intersect($catsprinter2, $existing);
$count = count($result);
if ($count > 0) {
$linestoprint++;
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set special_code='2' where rowid=".$line->id; //Set to print on printer 2
$db->query($sql);
$order_receipt_printer2 .= '<tr>'.$line->product_label.'<td class="right">'.$line->qty;
@ -559,9 +562,10 @@ if ($action == "order" and $placeid != 0)
$order_receipt_printer2 .= '</td></tr>';
}
}
if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter" && $count > 0) {
if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter" && $linestoprint > 0) {
$invoice->fetch($placeid); //Reload object before send to printer
$ret = $printer->sendToPrinter($invoice, $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$_SESSION["takeposterminal"]}, $conf->global->{'TAKEPOS_PRINTER_TO_USE'.$_SESSION["takeposterminal"]}); // PRINT TO PRINTER 2
$printer->orderprinter=2;
$ret = $printer->sendToPrinter($invoice, $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$_SESSION["takeposterminal"]}, $conf->global->{'TAKEPOS_ORDER_PRINTER2_TO_USE'.$_SESSION["takeposterminal"]}); // PRINT TO PRINTER 2
}
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set special_code='4' where special_code='2' and fk_facture=".$invoice->id; // Set as printed
$db->query($sql);

View File

@ -24,7 +24,7 @@
--colortextlink: rgb(<?php print $colortextlink; ?>);
--colortextbackhmenu: #<?php echo $colortextbackhmenu; ?>;
--colortextbackvmenu: #<?php print $colortextbackvmenu; ?>;
--listetotal: #551188;
--listetotal: #888888;
--inputbackgroundcolor: #FFF;
--inputbordercolor: rgba(0,0,0,.2);
--tooltipbgcolor: <?php print $toolTipBgColor; ?>;
@ -1455,6 +1455,9 @@ body.onlinepaymentbody div.fiche { /* For online payment page */
div.fiche>table:first-child {
margin-bottom: 15px !important;
}
div.fiche>table.table-fiche-title {
margin-bottom: 7px !important;
}
div.fichecenter {
width: 100%;
clear: both; /* This is to have div fichecenter that are true rectangles */
@ -1568,9 +1571,9 @@ div.nopadding {
margin : 0px auto;
}
td.nobordernopadding.widthpictotitle.opacityhigh.valignmiddle.col-picto {
td.nobordernopadding.widthpictotitle.col-picto {
color: var(--colortexttitlenotab);
opacity: 0.6;
opacity: 0.7;
}
.pictotitle {
margin-<?php echo $right; ?>: 8px;
@ -1724,7 +1727,7 @@ div#id-top {
display:none;
<?php } else { ?>
background: var(--colorbackhmenu1);
background-image: linear-gradient(-45deg, <?php echo colorAdjustBrightness(colorArrayToHex(colorStringToArray($colorbackhmenu1)), '5'); ?>, var(--colorbackhmenu1));
/* background-image: linear-gradient(-45deg, <?php echo colorAdjustBrightness(colorArrayToHex(colorStringToArray($colorbackhmenu1)), '5'); ?>, var(--colorbackhmenu1)); */
/* box-shadow: 0px 0px 5px #eee; */
<?php } ?>
}
@ -2606,7 +2609,7 @@ div.tabBar {
div.tabBar tr.titre td {
padding-top: 20px;
}
div.fiche tr.titre td {
div.fiche table:not(.table-fiche-title) tr.titre td {
padding-top: 10px;
}

View File

@ -229,6 +229,42 @@ print '*/'."\n";
/* Default styles */
/* ============================================================================== */
:root {
--colorbackhmenu1: rgb(<?php print $colorbackhmenu1; ?>);
--colorbackvmenu1: rgb(<?php print $colorbackvmenu1; ?>);
--colorbacktitle1: rgb(<?php print $colorbacktitle1; ?>);
--colorbacktabcard1: rgb(<?php print $colorbacktabcard1; ?>);
--colorbacktabactive: rgb(<?php print $colorbacktabactive; ?>);
--colorbacklineimpair1: rgb(<?php print $colorbacklineimpair1; ?>);
--colorbacklineimpair2: rgb(<?php print $colorbacklineimpair2; ?>);
--colorbacklinepair1: rgb(<?php print $colorbacklinepair1; ?>);
--colorbacklinepair2: rgb(<?php print $colorbacklinepair2; ?>);
--colorbacklinepairhover: rgb(<?php print $colorbacklinepairhover; ?>);
--colorbacklinepairchecked: rgb(<?php print $colorbacklinepairchecked; ?>);
--colorbackbody: rgb(<?php print $colorbackbody; ?>);
--colortexttitlenotab: rgb(<?php print $colortexttitlenotab; ?>);
--colortexttitle: rgb(<?php print $colortexttitle; ?>);
--colortext: rgb(<?php print $colortext; ?>);
--colortextlink: rgb(<?php print $colortextlink; ?>);
--colortextbackhmenu: #<?php echo $colortextbackhmenu; ?>;
--colortextbackvmenu: #<?php print $colortextbackvmenu; ?>;
--listetotal: #551188;
--inputbackgroundcolor: #FFF;
--inputbordercolor: rgba(0,0,0,.2);
--tooltipbgcolor: <?php print $toolTipBgColor; ?>;
--tooltipfontcolor : <?php print $toolTipFontColor; ?>;
--oddevencolor: #202020;
--colorboxstatsborder: #ddd;
--dolgraphbg: rgba(255,255,255,0);
--fieldrequiredcolor: #000055;
--colortextbacktab: #<?php print $colortextbacktab; ?>;
--colorboxiconbg: #eee;
--refidnocolor:#444;
--tableforfieldcolor:#666;
--amountremaintopaycolor:#880000;
--amountpaymentcomplete:#008800;
--amountremaintopaybackcolor:none;
}
body {
<?php if (GETPOST('optioncss', 'aZ09') == 'print') { ?>
@ -3846,7 +3882,7 @@ div.titre {
}
div.titre, .secondary {
font-family: <?php print $fontlist ?>;
color: rgb(<?php print $colortexttitlenotab; ?>);
color: var(--colortexttitlenotab);
}
table.centpercent.notopnoleftnoright.table-fiche-title {

View File

@ -63,7 +63,7 @@ $colorbacklinepairhover = '230,237,244'; // line hover
$colorbacklinepairchecked = '230,237,244'; // line checked
$colorbacklinebreak = '214,218,220';
$colorbackbody = '248,248,248';
$colortexttitlenotab = '90,90,90';
$colortexttitlenotab = '80,71,5';
$colortexttitle = '20,20,20';
$colortext = '0,0,0';
$colortextlink = '0,0,120';

View File

@ -52,9 +52,12 @@ $websitekey = GETPOST('website', 'alpha');
$page = GETPOST('page', 'alpha');
$pageid = GETPOST('pageid', 'int');
$pageref = GETPOST('pageref', 'alphanohtml');
$action = GETPOST('action', 'aZ09');
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
$confirm = GETPOST('confirm', 'alpha');
$cancel = GETPOST('cancel', 'alpha');
$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'bomlist'; // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
@ -260,6 +263,23 @@ $manifestjsoncontentdefault .= '{
}]
}';
$listofpages = array();
$algo = '';
if (GETPOST('optionmeta')) $algo .= 'meta';
if (GETPOST('optioncontent')) $algo .= 'content';
if (GETPOST('optionsitefiles')) $algo .= 'sitefiles';
if (empty($sortfield)) {
$sortfield = 'pageurl'; $sortorder = 'ASC';
}
$searchkey = GETPOST('searchstring', 'none');
if ($action == 'replacesiteconfirm') {
$listofpages = getPagesFromSearchCriterias('', $algo, $searchkey, 1000, $sortfield, $sortorder);
}
/*
@ -340,11 +360,70 @@ if ($action == 'unsetshowsubcontainers')
exit;
}
if (($action == 'replacesite' || $action == 'replacesiteconfirm') && empty(GETPOST('searchstring')))
if (($action == 'replacesite' || $action == 'replacesiteconfirm') && ! $searchkey)
{
$action = 'replacesite';
}
// Replacement of string into pages
if ($massaction == 'replace')
{
$replacestring = GETPOST('replacestring', 'alphanohtml');
if (! $replacestring) {
setEventMessages("ErrorReplaceStringEmpty", null, 'errors');
}
else {
$nbreplacement = 0;
foreach($toselect as $keyselected) {
$objectpage = $listofpages['list'][$keyselected];
if ($objectpage->pageurl) {
dol_syslog("Replace string into page ".$objectpage->pageurl);
if (GETPOST('optioncontent', 'aZ09')) {
$objectpage->content = str_replace($searchkey, $replacestring, $objectpage->content);
}
if (GETPOST('optionmeta', 'aZ09')) {
$objectpage->title = str_replace($searchkey, $replacestring, $objectpage->title);
$objectpage->description = str_replace($searchkey, $replacestring, $objectpage->description);
$objectpage->keywords = str_replace($searchkey, $replacestring, $objectpage->keywords);
}
$filealias = $pathofwebsite.'/'.$objectpage->pageurl.'.php';
$filetpl = $pathofwebsite.'/page'.$objectpage->id.'.tpl.php';
// Save page alias
$result = dolSavePageAlias($filealias, $object, $objectpage);
if (!$result)
{
setEventMessages('Failed to write file '.basename($filealias), null, 'errors');
}
// Save page of content
$result = dolSavePageContent($filetpl, $object, $objectpage);
if ($result)
{
$nbreplacement++;
//var_dump($objectpage->content);exit;
$objectpage->update($user);
} else {
$error++;
setEventMessages('Failed to write file '.$filetpl, null, 'errors');
$action = 'createcontainer';
break;
}
}
}
if ($nbreplacement > 0) {
setEventMessages($langs->trans("ReplacementDoneInXPages", $nbreplacement), null, 'mesgs');
}
// Now we reload list
$listofpages = getPagesFromSearchCriterias('', $algo, $searchkey, 1000, $sortfield, $sortorder);
}
}
// Add directory
/*
@ -1765,7 +1844,7 @@ if (($action == 'updatesource' || $action == 'updatecontent' || $action == 'conf
// Now generate the master.inc.php page
$result = dolSaveMasterFile($filemaster);
if (!$result) setEventMessages('Failed to write file '.$filemaster, null, 'errors');
if (!$result) setEventMessages('Failed to write the master file file '.$filemaster, null, 'errors');
// Now generate the alias.php page
@ -1777,7 +1856,7 @@ if (($action == 'updatesource' || $action == 'updatecontent' || $action == 'conf
// Save page alias
$result = dolSavePageAlias($filealias, $object, $objectpage);
if (!$result) setEventMessages('Failed to write file '.basename($filealias), null, 'errors');
if (!$result) setEventMessages('Failed to write the alias file '.basename($filealias), null, 'errors');
// Save page content
$result = dolSavePageContent($filetpl, $object, $objectpage);
@ -3397,10 +3476,8 @@ print "</div>\n";
print "</form>\n";
if ($action == 'replacesite' || $action == 'replacesiteconfirm')
if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction == 'replace')
{
$searchkey = GETPOST('searchstring', 'none');
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="replacesiteconfirm">';
@ -3410,7 +3487,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm')
print '<!-- Replace string -->'."\n";
print '<div class="fiche"><br>';
print load_fiche_titre($langs->trans("ReplaceWebsiteContent"));
print load_fiche_titre($langs->trans("ReplaceWebsiteContent"), '', 'search');
print '<div class="tagtable">';
@ -3431,33 +3508,53 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm')
print '</div>';
print '<div class="tagtd">';
print '<input type="text" name="searchstring" value="'.dol_escape_htmltag($searchkey).'" autofocus>';
print '</div>';
print '</div>';
print '</div>';
print '<br>';
print '<input type="submit" class="button" name="buttonreplacesitesearch" value="'.$langs->trans("Search").'">';
print '</div>';
print '</div>';
print '</div>';
if ($action == 'replacesiteconfirm')
{
$algo = '';
if (GETPOST('optionmeta')) $algo .= 'meta';
if (GETPOST('optioncontent')) $algo .= 'content';
if (GETPOST('optionsitefiles')) $algo .= 'sitefiles';
$listofpages = getPagesFromSearchCriterias('', $algo, $searchkey, 1000);
print '<br>';
print '<br>';
if ($listofpages['code'] == 'OK')
{
$arrayofselected = is_array($toselect) ? $toselect : array();
$param = '';
$nbtotalofrecords = count($listofpages['list']);
$num = $nbtotalofrecords = $limit;
$permissiontodelete = 0;
// List of mass actions available
$arrayofmassactions = array(
//'validate'=>$langs->trans("Validate"),
//'generate_doc'=>$langs->trans("ReGeneratePDF"),
//'builddoc'=>$langs->trans("PDFMerge"),
'replace'=>$langs->trans("Replace"),
);
if ($permissiontodelete) $arrayofmassactions['predelete'] = '<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array();
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$massactionbutton .= '<div class="massactionother hidden">';
$massactionbutton .= $langs->trans("ReplaceString");
$massactionbutton .= '<input type="text" name="replacestring" value="'.dol_escape_htmltag(GETPOST('replacestring', 'none')).'">';
$massactionbutton .='</div>';
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
//$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
$selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit, 1, 1, 1);
print '<!-- List of search result -->'."\n";
print '<div class="rowsearchresult">';
if ($action == 'replacesiteconfirm' && $conf->global->MAIN_FEATURES_LEVEL >= 2)
/*if ($action == 'replacesiteconfirm')
{
print '<div class="tagtr">';
print '<div class="tagtd paddingrightonly">';
@ -3465,19 +3562,26 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm')
print '</div>';
print '<div class="tagtd">';
print '<input type="text" name="replacestring" value="'.dol_escape_htmltag(GETPOST('replacestring', 'none')).'">';
print '<input type="submit" disabled class="button" name="buttonreplacesitesearch" value="'.$langs->trans("Replace").'">';
print '<input type="submit" class="button" name="buttonreplacesitereplace" value="'.$langs->trans("Replace").'">';
print '</div>';
print '</div>';
print '<br>';
}
}*/
$param = 'action=replacesiteconfirm&website='.urlencode($website->ref);
$param .= '&searchstring='.urlencode($searchkey);
if (GETPOST('optioncontent')) $param .= '&optioncontent=content';
if (GETPOST('optionmeta')) $param .= '&optionmeta=meta';
if (GETPOST('optionsitefiles')) $param .= '&optionsitefiles=optionsitefiles';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<th>'.$langs->trans("Type").'</th>';
print '<th>'.$langs->trans("Link").'</th>';
print '<th>'.$langs->trans("Description").'</th>';
print '<th></th>';
print getTitleFieldOfList("Type", 0, $_SERVER['PHP_SELF'], 'type_container', '', $param, '', $sortfield, $sortorder, '')."\n";
print getTitleFieldOfList("Page", 0, $_SERVER['PHP_SELF'], 'pageurl', '', $param, '', $sortfield, $sortorder, '')."\n";
//print getTitleFieldOfList("Description", 0, $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, '')."\n";
print getTitleFieldOfList("", 0 , $_SERVER['PHP_SELF']);
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
print '</tr>';
foreach ($listofpages['list'] as $answerrecord)
@ -3485,14 +3589,17 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm')
if (get_class($answerrecord) == 'WebsitePage')
{
print '<tr>';
print '<td>'.$langs->trans("Container").' - ';
print '<td class="nowraponall">'.$langs->trans("Container").' - ';
print $langs->trans($answerrecord->type_container); // TODO Use label of container
print '</td>';
print '<td>';
print $answerrecord->getNomUrl(1);
print ' <span class="opacitymedium">('.($answerrecord->title ? $answerrecord->title : $langs->trans("NoTitle")).')</span>';
//print '</td>';
//print '<td class="tdoverflow100">';
print '<br>';
print '<span class="opacitymedium">'.$answerrecord->description.'</span>';
print '</td>';
print '<td class="tdoverflow100">'.$answerrecord->description.'</td>';
print '<td>';
$param = '?action=replacesiteconfirm';
$param .= '&websiteid='.$website->id;
@ -3506,8 +3613,19 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm')
$disabled = ' disabled';
$urltoedithtmlsource = '';
}
print '<a class="'.$disabled.'" href="'.$urltoedithtmlsource.'" title="'.$langs->trans("EditHTMLSource").'">'.img_picto($langs->trans("EditHTMLSource"), 'edit').'</a>';
print '<a class="editfielda '.$disabled.'" href="'.$urltoedithtmlsource.'" title="'.$langs->trans("EditHTMLSource").'">'.img_picto($langs->trans("EditHTMLSource"), 'edit').'</a>';
print '</td>';
// Action column
print '<td class="nowrap center">';
if ($massactionbutton || $massaction)
{
$selected = 0;
if (in_array($answerrecord->id, $arrayofselected)) $selected = 1;
print '<input id="'.$answerrecord->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$answerrecord->id.'"'.($selected ? ' checked="checked"' : '').'>';
}
print '</td>';
print '</tr>';
}
else
@ -3537,11 +3655,17 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm')
print '<td class="tdoverflow100">';
print '</td>';
print '<td></td>';
// Action column
print '<td class="nowrap center">';
print '</td>';
print '</tr>';
}
}
print '</table>';
print '</div></div>';
print '<br>';
}
else
{