Merge branch 'Dolibarr:develop' into develop

This commit is contained in:
mschamp 2021-12-27 09:53:08 +01:00 committed by GitHub
commit 77d1f83964
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 353 additions and 206 deletions

View File

@ -136,7 +136,11 @@ if ($object->id > 0) {
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'rowid', $linkback); $morehtmlref = '<a href="'.DOL_URL_ROOT.'/adherents/vcard.php?id='.$object->id.'" class="refid">';
$morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"');
$morehtmlref .= '</a>';
dol_banner_tab($object, 'rowid', $linkback, 1, 'rowid', 'ref', $morehtmlref);
print '<div class="fichecenter">'; print '<div class="fichecenter">';

View File

@ -918,12 +918,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// When used in standard mode // When used in standard mode
// ----------------------------------------- // -----------------------------------------
// Create mode
if ($action == 'create') { if ($action == 'create') {
/* ************************************************************************** */
/* */
/* Creation mode */
/* */
/* ************************************************************************** */
$object->canvas = $canvas; $object->canvas = $canvas;
$object->state_id = GETPOST('state_id', 'int'); $object->state_id = GETPOST('state_id', 'int');
@ -1145,13 +1141,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print "</form>\n"; print "</form>\n";
} }
// Edit mode
if ($action == 'edit') { if ($action == 'edit') {
/********************************************
*
* Edition mode
*
********************************************/
$res = $object->fetch($id); $res = $object->fetch($id);
if ($res < 0) { if ($res < 0) {
dol_print_error($db, $object->error); exit; dol_print_error($db, $object->error); exit;
@ -1412,13 +1403,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '</form>'; print '</form>';
} }
// View
if ($id > 0 && $action != 'edit') { if ($id > 0 && $action != 'edit') {
/* ************************************************************************** */
/* */
/* View mode */
/* */
/* ************************************************************************** */
$res = $object->fetch($id); $res = $object->fetch($id);
if ($res < 0) { if ($res < 0) {
dol_print_error($db, $object->error); exit; dol_print_error($db, $object->error); exit;
@ -1707,7 +1693,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'rowid', $linkback); $morehtmlref = '<a href="'.DOL_URL_ROOT.'/adherents/vcard.php?id='.$object->id.'" class="refid">';
$morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"');
$morehtmlref .= '</a>';
dol_banner_tab($object, 'rowid', $linkback, 1, 'rowid', 'ref', $morehtmlref);
print '<div class="fichecenter">'; print '<div class="fichecenter">';
print '<div class="fichehalfleft">'; print '<div class="fichehalfleft">';
@ -1862,13 +1853,16 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '</td></tr>'; print '</td></tr>';
// VCard // VCard
/*
print '<tr><td>'; print '<tr><td>';
print $langs->trans("VCard").'</td><td colspan="3">'; print $langs->trans("VCard").'</td><td colspan="3">';
print '<a href="'.DOL_URL_ROOT.'/adherents/vcard.php?id='.$object->id.'">'; print '<a href="'.DOL_URL_ROOT.'/adherents/vcard.php?id='.$object->id.'">';
print img_picto($langs->trans("Download"), 'vcard.png', 'class="paddingrightonly"'); print img_picto($langs->trans("Download").' vcard', 'vcard.png', 'class="paddingrightonly"');
print $langs->trans("Download"); print $langs->trans("Download");
print img_picto($langs->trans("Download").' vcard', 'download', 'class="paddingleft"');
print '</a>'; print '</a>';
print '</td></tr>'; print '</td></tr>';
*/
print "</table>\n"; print "</table>\n";

View File

@ -138,7 +138,11 @@ if ($id > 0) {
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'rowid', $linkback); $morehtmlref = '<a href="'.DOL_URL_ROOT.'/adherents/vcard.php?id='.$object->id.'" class="refid">';
$morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"');
$morehtmlref .= '</a>';
dol_banner_tab($object, 'rowid', $linkback, 1, 'rowid', 'ref', $morehtmlref);
print '<div class="fichecenter">'; print '<div class="fichecenter">';

View File

@ -107,7 +107,11 @@ if ($id) {
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'id', $linkback); $morehtmlref = '<a href="'.DOL_URL_ROOT.'/adherents/vcard.php?id='.$object->id.'" class="refid">';
$morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"');
$morehtmlref .= '</a>';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref);
print '<div class="fichecenter">'; print '<div class="fichecenter">';

View File

@ -485,7 +485,11 @@ if ($rowid > 0) {
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'rowid', $linkback); $morehtmlref = '<a href="'.DOL_URL_ROOT.'/adherents/vcard.php?id='.$object->id.'" class="refid">';
$morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"');
$morehtmlref .= '</a>';
dol_banner_tab($object, 'rowid', $linkback, 1, 'rowid', 'ref', $morehtmlref);
print '<div class="fichecenter">'; print '<div class="fichecenter">';
print '<div class="fichehalfleft">'; print '<div class="fichehalfleft">';

View File

@ -292,7 +292,7 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
$membertype->amount = $objp->amount; $membertype->amount = $objp->amount;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'; print '<td class="nowraponall">';
print $membertype->getNomUrl(1); print $membertype->getNomUrl(1);
//<a href="'.$_SERVER["PHP_SELF"].'?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowType"),'group').' '.$objp->rowid.'</a> //<a href="'.$_SERVER["PHP_SELF"].'?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowType"),'group').' '.$objp->rowid.'</a>
print '</td>'; print '</td>';
@ -340,12 +340,7 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
} }
} }
// Creation
/* ************************************************************************** */
/* */
/* Creation mode */
/* */
/* ************************************************************************** */
if ($action == 'create') { if ($action == 'create') {
$object = new AdherentType($db); $object = new AdherentType($db);
@ -416,11 +411,7 @@ if ($action == 'create') {
print "</form>\n"; print "</form>\n";
} }
/* ************************************************************************** */ // View
/* */
/* View mode */
/* */
/* ************************************************************************** */
if ($rowid > 0) { if ($rowid > 0) {
if ($action != 'edit') { if ($action != 'edit') {
$object = new AdherentType($db); $object = new AdherentType($db);
@ -455,8 +446,9 @@ if ($rowid > 0) {
print yn($object->subscription); print yn($object->subscription);
print '</tr>'; print '</tr>';
// Amount
print '<tr><td class="titlefield">'.$langs->trans("Amount").'</td><td>'; print '<tr><td class="titlefield">'.$langs->trans("Amount").'</td><td>';
print ((is_null($object->amount) || $object->amount === '') ? '' : price($object->amount)); print ((is_null($object->amount) || $object->amount === '') ? '' : '<span class="amount">'.price($object->amount).'</span>');
print '</tr>'; print '</tr>';
print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>'; print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';

View File

@ -204,6 +204,18 @@ if (!empty($conf->global->NOTIFICATION_EMAIL_FROM) && !isValidEmail($conf->globa
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
print '<tr class="oddeven"><td>';
print $langs->trans("NotificationDisableConfirmMessageContact").'</td>';
print '<td>';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_CONTACT');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_CONTACT", $arrval, $conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_CONTACT);
}
print '</td>';
print '</tr>';
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $langs->trans("NotificationDisableConfirmMessageUser").'</td>'; print $langs->trans("NotificationDisableConfirmMessageUser").'</td>';
print '<td>'; print '<td>';
@ -215,6 +227,7 @@ if ($conf->use_javascript_ajax) {
} }
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $langs->trans("NotificationDisableConfirmMessageFix").'</td>'; print $langs->trans("NotificationDisableConfirmMessageFix").'</td>';
print '<td>'; print '<td>';
@ -241,79 +254,68 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="settemplates">'; print '<input type="hidden" name="action" value="settemplates">';
// Notification per contacts // Notification per contacts
$title = $langs->trans("ListOfNotificationsPerUser"); $title = $langs->trans("TemplatesForNotifications");
if (!empty($conf->societe->enabled)) {
$title = $langs->trans("ListOfNotificationsPerUserOrContact"); print load_fiche_titre($title, '', 'email');
}
print load_fiche_titre($title, '', '');
// Load array of available notifications // Load array of available notifications
$notificationtrigger = new InterfaceNotification($db); $notificationtrigger = new InterfaceNotification($db);
$listofnotifiedevents = $notificationtrigger->getListOfManagedEvents(); $listofnotifiedevents = $notificationtrigger->getListOfManagedEvents();
// Editing global variables not related to a specific theme
$constantes = array();
foreach ($listofnotifiedevents as $notifiedevent) {
$label = $langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label'];
$elementLabel = $langs->trans(ucfirst($notifiedevent['elementtype']));
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if ($notifiedevent['elementtype'] == 'order_supplier') {
// Editing global variables not related to a specific theme $elementLabel = $langs->trans('SupplierOrder');
$constantes = array(); } elseif ($notifiedevent['elementtype'] == 'propal') {
foreach ($listofnotifiedevents as $notifiedevent) { $elementLabel = $langs->trans('Proposal');
$label = $langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label']; } elseif ($notifiedevent['elementtype'] == 'facture') {
$elementLabel = $langs->trans(ucfirst($notifiedevent['elementtype'])); $elementLabel = $langs->trans('Bill');
} elseif ($notifiedevent['elementtype'] == 'commande') {
if ($notifiedevent['elementtype'] == 'order_supplier') { $elementLabel = $langs->trans('Order');
$elementLabel = $langs->trans('SupplierOrder'); } elseif ($notifiedevent['elementtype'] == 'ficheinter') {
} elseif ($notifiedevent['elementtype'] == 'propal') { $elementLabel = $langs->trans('Intervention');
$elementLabel = $langs->trans('Proposal'); } elseif ($notifiedevent['elementtype'] == 'shipping') {
} elseif ($notifiedevent['elementtype'] == 'facture') { $elementLabel = $langs->trans('Shipping');
$elementLabel = $langs->trans('Bill'); } elseif ($notifiedevent['elementtype'] == 'expensereport' || $notifiedevent['elementtype'] == 'expense_report') {
} elseif ($notifiedevent['elementtype'] == 'commande') { $elementLabel = $langs->trans('ExpenseReport');
$elementLabel = $langs->trans('Order');
} elseif ($notifiedevent['elementtype'] == 'ficheinter') {
$elementLabel = $langs->trans('Intervention');
} elseif ($notifiedevent['elementtype'] == 'shipping') {
$elementLabel = $langs->trans('Shipping');
} elseif ($notifiedevent['elementtype'] == 'expensereport' || $notifiedevent['elementtype'] == 'expense_report') {
$elementLabel = $langs->trans('ExpenseReport');
}
if ($notifiedevent['elementtype'] == 'propal') {
$model = 'propal_send';
} elseif ($notifiedevent['elementtype'] == 'commande') {
$model = 'order_send';
} elseif ($notifiedevent['elementtype'] == 'facture') {
$model = 'facture_send';
} elseif ($notifiedevent['elementtype'] == 'shipping') {
$model = 'shipping_send';
} elseif ($notifiedevent['elementtype'] == 'ficheinter') {
$model = 'fichinter_send';
} elseif ($notifiedevent['elementtype'] == 'expensereport') {
$model = 'expensereport_send';
} elseif ($notifiedevent['elementtype'] == 'order_supplier') {
$model = 'order_supplier_send';
// } elseif ($notifiedevent['elementtype'] == 'invoice_supplier') $model = 'invoice_supplier_send';
} elseif ($notifiedevent['elementtype'] == 'member') {
$model = 'member';
}
$constantes[$notifiedevent['code'].'_TEMPLATE'] = array('type'=>'emailtemplate:'.$model, 'label'=>$label);
} }
$helptext = ''; if ($notifiedevent['elementtype'] == 'propal') {
form_constantes($constantes, 3, $helptext, 'EmailTemplate'); $model = 'propal_send';
} elseif ($notifiedevent['elementtype'] == 'commande') {
print '<div class="opacitymedium">'; $model = 'order_send';
print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>'; } elseif ($notifiedevent['elementtype'] == 'facture') {
if (!empty($conf->societe->enabled)) { $model = 'facture_send';
print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>'; } elseif ($notifiedevent['elementtype'] == 'shipping') {
$model = 'shipping_send';
} elseif ($notifiedevent['elementtype'] == 'ficheinter') {
$model = 'fichinter_send';
} elseif ($notifiedevent['elementtype'] == 'expensereport') {
$model = 'expensereport_send';
} elseif ($notifiedevent['elementtype'] == 'order_supplier') {
$model = 'order_supplier_send';
// } elseif ($notifiedevent['elementtype'] == 'invoice_supplier') $model = 'invoice_supplier_send';
} elseif ($notifiedevent['elementtype'] == 'member') {
$model = 'member';
} }
print '</div>';
print $form->buttonsSaveCancel("Save", ''); $constantes[$notifiedevent['code'].'_TEMPLATE'] = array('type'=>'emailtemplate:'.$model, 'label'=>$label);
}
$helptext = '';
form_constantes($constantes, 3, $helptext, 'EmailTemplate');
print $form->buttonsSaveCancel("Save", '');
/*
} else { } else {
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Label").'</td>'; print '<td>'.$langs->trans("Label").'</td>';
/*print '<td>'.$langs->trans("Code").'</td>';
print '<td>'.$langs->trans("Label").'</td>';*/
//print '<td class="right">'.$langs->trans("NbOfTargetedContacts").'</td>'; //print '<td class="right">'.$langs->trans("NbOfTargetedContacts").'</td>';
print "</tr>\n"; print "</tr>\n";
@ -359,6 +361,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
} }
print '</div>'; print '</div>';
} }
*/
print '</form>'; print '</form>';
@ -371,7 +374,15 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setfixednotif">'; print '<input type="hidden" name="action" value="setfixednotif">';
print '<input type="hidden" name="page_y" value="">'; print '<input type="hidden" name="page_y" value="">';
print load_fiche_titre($langs->trans("ListOfFixedNotifications"), '', ''); print load_fiche_titre($langs->trans("ListOfFixedNotifications"), '', 'email');
print '<div class="info">';
print $langs->trans("Note").':<br>';
print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>';
if (!empty($conf->societe->enabled)) {
print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>';
}
print '</div>';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
@ -488,8 +499,6 @@ foreach ($listofnotifiedevents as $notifiedevent) {
} }
print '</table>'; print '</table>';
print '<br>';
print $form->buttonsSaveCancel("Save", ''); print $form->buttonsSaveCancel("Save", '');
print '</form>'; print '</form>';

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com> * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
@ -817,7 +817,7 @@ if (empty($reshook)) {
} }
} }
} }
} elseif ($action == 'addline' && GETPOST('submitforalllines', 'alpha') && GETPOST('vatforalllines', 'alpha') !== '') { } elseif ($action == 'addline' && GETPOST('submitforalllines', 'alpha') && GETPOST('vatforalllines', 'alpha') !== '' && $usercancreate) {
// Define vat_rate // Define vat_rate
$vat_rate = (GETPOST('vatforalllines') ? GETPOST('vatforalllines') : 0); $vat_rate = (GETPOST('vatforalllines') ? GETPOST('vatforalllines') : 0);
$vat_rate = str_replace('*', '', $vat_rate); $vat_rate = str_replace('*', '', $vat_rate);
@ -835,7 +835,7 @@ if (empty($reshook)) {
$prod_entry_mode = GETPOST('prod_entry_mode'); $prod_entry_mode = GETPOST('prod_entry_mode');
if ($prod_entry_mode == 'free') { if ($prod_entry_mode == 'free') {
$idprod = 0; $idprod = 0;
$tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); $tva_tx = (GETPOST('tva_tx') ? price2num(GETPOST('tva_tx')) : 0);
} else { } else {
$idprod = GETPOST('idprod', 'int'); $idprod = GETPOST('idprod', 'int');
$tva_tx = ''; $tva_tx = '';
@ -2680,7 +2680,7 @@ if ($action == 'create') {
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem, $compatibleImportElementsList); $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem, $compatibleImportElementsList);
// Show online signature link // Show online signature link
$useonlinesignature = 1; // Replace this with 1 when feature to make online signature is ok $useonlinesignature = 1;
if ($object->statut != Propal::STATUS_DRAFT && $useonlinesignature) { if ($object->statut != Propal::STATUS_DRAFT && $useonlinesignature) {
print '<br><!-- Link to sign -->'; print '<br><!-- Link to sign -->';

View File

@ -51,11 +51,27 @@ if (!defined('NOBROWSERNOTIF')) {
include '../../main.inc.php'; include '../../main.inc.php';
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$signature = GETPOST('signaturebase64'); $signature = GETPOST('signaturebase64');
$ref = GETPOST('ref', 'aZ09'); $ref = GETPOST('ref', 'aZ09');
$mode = GETPOST('mode', 'aZ09'); $mode = GETPOST('mode', 'aZ09');
$SECUREKEY = GETPOST("securekey"); // Secure key
$error = 0; $error = 0;
$response = ""; $response = "";
// Check securitykey
$securekeyseed = $conf->global->PROPOSAL_ONLINE_SIGNATURE_SECURITY_TOKEN;
$type = $mode;
$calculatedsecuritykey = dol_hash($securekeyseed.$type.$ref, '0');
if ($calculatedsecuritykey != $SECUREKEY) {
http_response_code(403);
print 'Bad value for securitykey. Value provided '.dol_escape_htmltag($SECUREKEY).' does not match expected value for ref='.dol_escape_htmltag($ref);
exit(-1);
}
/* /*
* Actions * Actions
*/ */
@ -71,62 +87,76 @@ if ($action == "importSignature") {
if (!empty($signature) && $signature[0] == "image/png;base64") { if (!empty($signature) && $signature[0] == "image/png;base64") {
$signature = $signature[1]; $signature = $signature[1];
$data = base64_decode($signature); $data = base64_decode($signature);
$upload_dir = DOL_DATA_ROOT."/".$mode."/".$ref."/";
$date = dol_print_date(dol_now(), "%Y%m%d%H%M%S"); if ($mode == "propale" || $mode == 'proposal') {
$filename = "signatures/".$date."_signature.png"; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
if (!is_dir($upload_dir."signatures/")) { require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
if (!mkdir($upload_dir."signatures/")) { $object = new Propal($db);
$response ="error mkdir"; $object->fetch(0, $ref);
$error++;
$upload_dir = !empty($conf->propal->multidir_output[$object->entity])?$conf->propal->multidir_output[$object->entity]:$conf->propal->dir_output;
$upload_dir .= '/'.dol_sanitizeFileName($object->ref).'/';
$date = dol_print_date(dol_now(), "%Y%m%d%H%M%S");
$filename = "signatures/".$date."_signature.png";
if (!is_dir($upload_dir."signatures/")) {
if (!dol_mkdir($upload_dir."signatures/")) {
$response ="Error mkdir. Failed to create dir ".$upload_dir."signatures/";
$error++;
}
} }
}
if (!$error) {
$return = file_put_contents($upload_dir.$filename, $data);
if ($return == false) {
$response = 'error file_put_content';
} else {
if ($mode == "propale") {
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
$object = new Propal($db);
$object->fetch(0, $ref);
$pdf = pdf_getInstance(); if (!$error) {
$pdf->Open(); $return = file_put_contents($upload_dir.$filename, $data);
$pdf->AddPage(); if ($return == false) {
$pagecount = $pdf->setSourceFile($upload_dir.$ref.".pdf"); $error++;
$response = 'error file_put_content';
}
}
$tppl = $pdf->importPage(1); if (!$error) {
$pdf->useTemplate($tppl); $pdf = pdf_getInstance();
$pdf->Image($upload_dir.$filename, 129, 239.6, 60, 15); $pdf->Open();
$pdf->Close(); $pdf->AddPage();
$pdf->Output($upload_dir.$ref."_signed-".$date.".pdf", "F"); $pagecount = $pdf->setSourceFile($upload_dir.$ref.".pdf");
$sql = "UPDATE ".MAIN_DB_PREFIX."propal"; $tppl = $pdf->importPage(1);
$sql .= " SET fk_statut = ".((int) $object::STATUS_SIGNED).", note_private = '".$object->note_private."', date_signature='".$db->idate(dol_now())."'"; $pdf->useTemplate($tppl);
$sql .= " WHERE rowid = ".((int) $object->id); $pdf->Image($upload_dir.$filename, 129, 239.6, 60, 15);
$pdf->Close();
$pdf->Output($upload_dir.$ref."_signed-".$date.".pdf", "F");
dol_syslog(__METHOD__, LOG_DEBUG); $sql = "UPDATE ".MAIN_DB_PREFIX."propal";
$resql = $db->query($sql); $sql .= " SET fk_statut = ".((int) $object::STATUS_SIGNED).", note_private = '".$object->note_private."', date_signature='".$db->idate(dol_now())."'";
if (!$resql) { $sql .= " WHERE rowid = ".((int) $object->id);
$error++;
} else {
$num = $db->affected_rows($resql);
}
if (!$error) { dol_syslog(__METHOD__, LOG_DEBUG);
$db->commit(); $resql = $db->query($sql);
$response = "success"; if (!$resql) {
setEventMessage("PropalSigned"); $error++;
} else { } else {
$db->rollback(); $num = $db->affected_rows($resql);
$response = "error sql"; }
}
if (!$error) {
$db->commit();
$response = "success";
setEventMessages("PropalSigned", null, 'warnings');
} else {
$db->rollback();
$error++;
$response = "error sql";
} }
} }
} }
} else { } else {
$error++;
$response = 'error signature_not_found'; $response = 'error signature_not_found';
} }
} }
if ($error) {
http_response_code(501);
}
echo $response; echo $response;

View File

@ -761,7 +761,7 @@ class FormFile
$arraykeys = array_keys($modellist); $arraykeys = array_keys($modellist);
$modelselected = $arraykeys[0]; $modelselected = $arraykeys[0];
} }
$morecss = 'maxwidth200'; $morecss = 'minwidth75 maxwidth200';
if ($conf->browser->layout == 'phone') { if ($conf->browser->layout == 'phone') {
$morecss = 'maxwidth100'; $morecss = 'maxwidth100';
} }

View File

@ -108,7 +108,9 @@ class Notify
global $conf, $langs; global $conf, $langs;
$langs->load("mails"); $langs->load("mails");
// Get full list of all notifications subscribed for $action, $socid and $object
$listofnotiftodo = $this->getNotificationsArray($action, $socid, $object, 0); $listofnotiftodo = $this->getNotificationsArray($action, $socid, $object, 0);
if (!empty($conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_USER)) { if (!empty($conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_USER)) {
foreach ($listofnotiftodo as $val) { foreach ($listofnotiftodo as $val) {
if ($val['type'] == 'touser') { if ($val['type'] == 'touser') {
@ -117,6 +119,14 @@ class Notify
} }
} }
} }
if (!empty($conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_CONTACT)) {
foreach ($listofnotiftodo as $val) {
if ($val['type'] == 'tocontact') {
unset($listofnotiftodo[$val['email']]);
//$listofnotiftodo = array_merge($listofnotiftodo);
}
}
}
if (!empty($conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_FIX)) { if (!empty($conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_FIX)) {
foreach ($listofnotiftodo as $val) { foreach ($listofnotiftodo as $val) {
if ($val['type'] == 'tofixedemail') { if ($val['type'] == 'tofixedemail') {

View File

@ -18,7 +18,7 @@
*/ */
/** /**
* Return string with full Url * Return string with full online Url to accept and sign a quote
* *
* @param string $type Type of URL ('proposal', ...) * @param string $type Type of URL ('proposal', ...)
* @param string $ref Ref of object * @param string $ref Ref of object
@ -58,13 +58,27 @@ function showOnlineSignatureUrl($type, $ref)
*/ */
function getOnlineSignatureUrl($mode, $type, $ref = '') function getOnlineSignatureUrl($mode, $type, $ref = '')
{ {
global $conf, $db, $langs; global $conf, $db, $langs, $dolibarr_main_url_root;
$ref = str_replace(' ', '', $ref); $ref = str_replace(' ', '', $ref);
$out = ''; $out = '';
// Define $urlwithroot
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
$localorexternal = 1; // external
$urltouse = DOL_MAIN_URL_ROOT;
if ($localorexternal) {
$urltouse = $urlwithroot;
}
$securekeyseed = $conf->global->PROPOSAL_ONLINE_SIGNATURE_SECURITY_TOKEN;
if ($type == 'proposal') { if ($type == 'proposal') {
$out = DOL_MAIN_URL_ROOT.'/public/onlinesign/newonlinesign.php?source=proposal&ref='.($mode ? '<span style="color: #666666">' : ''); $out = $urltouse.'/public/onlinesign/newonlinesign.php?source=proposal&ref='.($mode ? '<span style="color: #666666">' : '');
if ($mode == 1) { if ($mode == 1) {
$out .= 'proposal_ref'; $out .= 'proposal_ref';
} }
@ -72,6 +86,12 @@ function getOnlineSignatureUrl($mode, $type, $ref = '')
$out .= urlencode($ref); $out .= urlencode($ref);
} }
$out .= ($mode ? '</span>' : ''); $out .= ($mode ? '</span>' : '');
if ($mode == 1) {
$out .= "hash('".$securekeyseed."' + '".$type."' + proposal_ref)";
} else {
$out .= '&securekey='.dol_hash($securekeyseed.$type.$ref, '0');
}
/*
if ($mode == 1) { if ($mode == 1) {
$out .= '&hashp=<span style="color: #666666">hash_of_file</span>'; $out .= '&hashp=<span style="color: #666666">hash_of_file</span>';
} else { } else {
@ -94,13 +114,15 @@ function getOnlineSignatureUrl($mode, $type, $ref = '')
} else { } else {
$out .= '&hashp='.$hashp; $out .= '&hashp='.$hashp;
} }
} }*/
} }
// For multicompany // For multicompany
/*
if (!empty($out)) { if (!empty($out)) {
$out .= "&entity=".$conf->entity; // Check the entity because He may be the same reference in several entities $out .= "&entity=".$conf->entity; // Check the entity because He may be the same reference in several entities
} }
*/
return $out; return $out;
} }

View File

@ -283,6 +283,8 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->expensereport->enabled && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)', __HANDLER__, 'left', 2420__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_expensereport', 2400__+MAX_llx_menu__, '/accountancy/expensereport/index.php?mainmenu=accountancy&amp;leftmenu=accountancy_dispatch_expensereport', 'ExpenseReportsVentilation', 1, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 5, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->expensereport->enabled && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)', __HANDLER__, 'left', 2420__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_expensereport', 2400__+MAX_llx_menu__, '/accountancy/expensereport/index.php?mainmenu=accountancy&amp;leftmenu=accountancy_dispatch_expensereport', 'ExpenseReportsVentilation', 1, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 5, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->expensereport->enabled && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS) && $leftmenu=="accountancy_dispatch_expensereport"', __HANDLER__, 'left', 2421__+MAX_llx_menu__, 'accountancy', '', 2420__+MAX_llx_menu__, '/accountancy/expensereport/list.php?mainmenu=accountancy', 'ToDispatch', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 6, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->expensereport->enabled && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS) && $leftmenu=="accountancy_dispatch_expensereport"', __HANDLER__, 'left', 2421__+MAX_llx_menu__, 'accountancy', '', 2420__+MAX_llx_menu__, '/accountancy/expensereport/list.php?mainmenu=accountancy', 'ToDispatch', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 6, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->expensereport->enabled && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS) && $leftmenu=="accountancy_dispatch_expensereport"', __HANDLER__, 'left', 2422__+MAX_llx_menu__, 'accountancy', '', 2420__+MAX_llx_menu__, '/accountancy/expensereport/lines.php?mainmenu=accountancy', 'Dispatched', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 7, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->expensereport->enabled && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS) && $leftmenu=="accountancy_dispatch_expensereport"', __HANDLER__, 'left', 2422__+MAX_llx_menu__, 'accountancy', '', 2420__+MAX_llx_menu__, '/accountancy/expensereport/lines.php?mainmenu=accountancy', 'Dispatched', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 7, __ENTITY__);
-- Export accounting documents
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2436__+MAX_llx_menu__, 'accountancy', 'accountancy_files', 2400__+MAX_llx_menu__, '/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files', 'AccountantFiles', 1, 'accountancy', '$user->rights->compta->resultat->lire || $user->rights->accounting->mouvements->lire', '', 0, 16, __ENTITY__);
-- Journals -- Journals
--insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2705__+MAX_llx_menu__, 'accountancy', '', 2400__+MAX_llx_menu__, '', 'Journalization', 1, 'main', '$user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); --insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2705__+MAX_llx_menu__, 'accountancy', '', 2400__+MAX_llx_menu__, '', 'Journalization', 1, 'main', '$user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__);
--insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2707__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/bankjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=3', 'BankJournal', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); --insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2707__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/bankjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=3', 'BankJournal', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__);
@ -295,8 +297,6 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2432__+MAX_llx_menu__, 'accountancy', 'bookkeeping', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/listbyaccount.php?mainmenu=accountancy&leftmenu=accountancy_bookeeping', 'Bookkeeping', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 12, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2432__+MAX_llx_menu__, 'accountancy', 'bookkeeping', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/listbyaccount.php?mainmenu=accountancy&leftmenu=accountancy_bookeeping', 'Bookkeeping', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 12, __ENTITY__);
-- Journals -- Journals
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2434__+MAX_llx_menu__, 'accountancy', 'bookkeeping', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_bookeeping', 'Journals', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 15, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2434__+MAX_llx_menu__, 'accountancy', 'bookkeeping', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_bookeeping', 'Journals', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 15, __ENTITY__);
-- Export accounting documents
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2436__+MAX_llx_menu__, 'accountancy', 'accountancy_files', 2400__+MAX_llx_menu__, '/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files', 'AccountantFiles', 1, 'accountancy', '$user->rights->compta->resultat->lire || $user->rights->accounting->mouvements->lire', '', 0, 16, __ENTITY__);
-- Closure -- Closure
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2437__+MAX_llx_menu__, 'accountancy', 'accountancy_closure', 2400__+MAX_llx_menu__, '/accountancy/closure/index.php?mainmenu=accountancy&leftmenu=accountancy_closure', 'MenuAccountancyClosure', 1, 'accountancy', '$user->rights->accounting->fiscalyear->write', '', 0, 17, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2437__+MAX_llx_menu__, 'accountancy', 'accountancy_closure', 2400__+MAX_llx_menu__, '/accountancy/closure/index.php?mainmenu=accountancy&leftmenu=accountancy_closure', 'MenuAccountancyClosure', 1, 'accountancy', '$user->rights->accounting->fiscalyear->write', '', 0, 17, __ENTITY__);
-- Reports -- Reports

View File

@ -1348,6 +1348,12 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$db->free($resql); $db->free($resql);
} }
// Files
if (empty($conf->global->ACCOUNTANCY_HIDE_EXPORT_FILES_MENU)) {
$newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&amp;leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 1, $user->rights->accounting->mouvements->lire);
}
// Accounting // Accounting
$newmenu->add("/accountancy/index.php?leftmenu=accountancy_accountancy", $langs->trans("MenuAccountancy"), 0, $user->rights->accounting->mouvements->lire || $user->rights->accounting->comptarapport->lire, '', $mainmenu, 'accountancy', 1, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"')); $newmenu->add("/accountancy/index.php?leftmenu=accountancy_accountancy", $langs->trans("MenuAccountancy"), 0, $user->rights->accounting->mouvements->lire || $user->rights->accounting->comptarapport->lire, '', $mainmenu, 'accountancy', 1, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"'));
@ -1360,11 +1366,6 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
// Account Balance // Account Balance
$newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&amp;leftmenu=accountancy_accountancy", $langs->trans("AccountBalance"), 1, $user->rights->accounting->mouvements->lire); $newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&amp;leftmenu=accountancy_accountancy", $langs->trans("AccountBalance"), 1, $user->rights->accounting->mouvements->lire);
// Files
if (empty($conf->global->ACCOUNTANCY_HIDE_EXPORT_FILES_MENU)) {
$newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&amp;leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 1, $user->rights->accounting->mouvements->lire);
}
// Closure // Closure
$newmenu->add("/accountancy/closure/index.php?mainmenu=accountancy&amp;leftmenu=accountancy_closure", $langs->trans("MenuAccountancyClosure"), 1, $user->rights->accounting->fiscalyear->write, '', $mainmenu, 'closure'); $newmenu->add("/accountancy/closure/index.php?mainmenu=accountancy&amp;leftmenu=accountancy_closure", $langs->trans("MenuAccountancyClosure"), 1, $user->rights->accounting->fiscalyear->write, '', $mainmenu, 'closure');

View File

@ -40,6 +40,10 @@
display: inline-block; display: inline-block;
} }
.no-bottom {
padding-bottom: 0;
}
.small { .small {
font-size: 0.9em; font-size: 0.9em;
} }

View File

@ -48,7 +48,7 @@ CountriesNotInEEC=Countries not in EEC
CountriesInEECExceptMe=Countries in EEC except %s CountriesInEECExceptMe=Countries in EEC except %s
CountriesExceptMe=All countries except %s CountriesExceptMe=All countries except %s
AccountantFiles=Export source documents AccountantFiles=Export source documents
ExportAccountingSourceDocHelp=With this tool, you can export the source events (list in CSV and PDFs) that were used to generate your accountancy. ExportAccountingSourceDocHelp=With this tool, you can export the source events (list in CSV and PDFs) that are used to generate your accountancy.
ExportAccountingSourceDocHelp2=To export your journals, use the menu entry %s - %s. ExportAccountingSourceDocHelp2=To export your journals, use the menu entry %s - %s.
VueByAccountAccounting=View by accounting account VueByAccountAccounting=View by accounting account
VueBySubAccountAccounting=View by accounting subaccount VueBySubAccountAccounting=View by accounting subaccount

View File

@ -1712,8 +1712,9 @@ MailingDelay=Seconds to wait after sending next message
NotificationSetup=Email Notification module setup NotificationSetup=Email Notification module setup
NotificationEMailFrom=Sender email (From) for emails sent by the Notifications module NotificationEMailFrom=Sender email (From) for emails sent by the Notifications module
FixedEmailTarget=Recipient FixedEmailTarget=Recipient
NotificationDisableConfirmMessageFix=Disable the information about targets into the confirmation message before sending the notifications to the global emails NotificationDisableConfirmMessageContact=Hide the list of recipients (subscribed as contact) of notifications into the confirmation message
NotificationDisableConfirmMessageUser=Disable the information about targets into the confirmation message before sending the notifications to the user emails NotificationDisableConfirmMessageUser=Hide the list of recipients (subscribed as user) of notifications into the confirmation message
NotificationDisableConfirmMessageFix=Hide the list of recipients (subscribed as global email) of notifications into the confirmation message
##### Sendings ##### ##### Sendings #####
SendingsSetup=Shipping module setup SendingsSetup=Shipping module setup
SendingsReceiptModel=Sending receipt model SendingsReceiptModel=Sending receipt model
@ -1905,6 +1906,7 @@ ExpenseReportsRulesSetup=Setup of module Expense Reports - Rules
ExpenseReportNumberingModules=Expense reports numbering module ExpenseReportNumberingModules=Expense reports numbering module
NoModueToManageStockIncrease=No module able to manage automatic stock increase has been activated. Stock increase will be done on manual input only. NoModueToManageStockIncrease=No module able to manage automatic stock increase has been activated. Stock increase will be done on manual input only.
YouMayFindNotificationsFeaturesIntoModuleNotification=You may find options for email notifications by enabling and configuring the module "Notification". YouMayFindNotificationsFeaturesIntoModuleNotification=You may find options for email notifications by enabling and configuring the module "Notification".
TemplatesForNotifications=Templates for notifications
ListOfNotificationsPerUser=List of automatic notifications per user* ListOfNotificationsPerUser=List of automatic notifications per user*
ListOfNotificationsPerUserOrContact=List of possible automatic notifications (on business event) available per user* or per contact** ListOfNotificationsPerUserOrContact=List of possible automatic notifications (on business event) available per user* or per contact**
ListOfFixedNotifications=List of automatic fixed notifications ListOfFixedNotifications=List of automatic fixed notifications

View File

@ -88,7 +88,7 @@ FileWasNotUploaded=A file is selected for attachment but was not yet uploaded. C
NbOfEntries=No. of entries NbOfEntries=No. of entries
GoToWikiHelpPage=Read online help (Internet access needed) GoToWikiHelpPage=Read online help (Internet access needed)
GoToHelpPage=Read help GoToHelpPage=Read help
DedicatedPageAvailable=There is a dedicated help page related to your current screen DedicatedPageAvailable=Dedicated help page related to your current screen
HomePage=Home Page HomePage=Home Page
RecordSaved=Record saved RecordSaved=Record saved
RecordDeleted=Record deleted RecordDeleted=Record deleted

View File

@ -1932,9 +1932,9 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
// Link to help pages // Link to help pages
if ($helpbaseurl && $helppage) { if ($helpbaseurl && $helppage) {
$text = ''; $text = '';
$title = $langs->trans($mode == 'wiki' ? 'GoToWikiHelpPage' : 'GoToHelpPage').'...'; $title = $langs->trans($mode == 'wiki' ? 'GoToWikiHelpPage' : 'GoToHelpPage').', ';
if ($mode == 'wiki') { if ($mode == 'wiki') {
$title .= '<br>'.$langs->trans("PageWiki").' '.dol_escape_htmltag('"'.strtr($helppage, '_', ' ').'"'); $title .= '<br>'.img_picto('', 'globe', 'class="pictofixedwidth"').$langs->trans("PageWiki").' '.dol_escape_htmltag('"'.strtr($helppage, '_', ' ').'"');
if ($helppresent) { if ($helppresent) {
$title .= ' <span class="opacitymedium">('.$langs->trans("DedicatedPageAvailable").')</span>'; $title .= ' <span class="opacitymedium">('.$langs->trans("DedicatedPageAvailable").')</span>';
} else { } else {
@ -1949,7 +1949,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
} }
$text .= '">'; $text .= '">';
$text .= '<span class="fa fa-question-circle atoplogin valignmiddle'.($helppresent ? ' '.$helppresent : '').'"></span>'; $text .= '<span class="fa fa-question-circle atoplogin valignmiddle'.($helppresent ? ' '.$helppresent : '').'"></span>';
$text .= '<span class="fa fa-circle helppresentcircle'.($helppresent ? '' : ' unvisible').'"></span>'; $text .= '<span class="fa fa-long-arrow-alt-up helppresentcircle'.($helppresent ? '' : ' unvisible').'"></span>';
$text .= '</a>'; $text .= '</a>';
$toprightmenu .= $form->textwithtooltip('', $title, 2, 1, $text, 'login_block_elem', 2); $toprightmenu .= $form->textwithtooltip('', $title, 2, 1, $text, 'login_block_elem', 2);
} }

View File

@ -122,6 +122,17 @@ $creditor = $mysoc->name;
$object = new Propal($db); $object = new Propal($db);
$object->fetch(0, $ref); $object->fetch(0, $ref);
// Check securitykey
$securekeyseed = $conf->global->PROPOSAL_ONLINE_SIGNATURE_SECURITY_TOKEN;
$type = $source;
$calculatedsecuritykey = dol_hash($securekeyseed.$type.$ref, '0');
if ($calculatedsecuritykey != $SECUREKEY) {
http_response_code(403);
print 'Bad value for securitykey. Value provided '.dol_escape_htmltag($SECUREKEY).' does not match expected value for ref='.dol_escape_htmltag($ref);
exit(-1);
}
/* /*
* Actions * Actions
@ -144,7 +155,7 @@ if ($action == 'confirm_refusepropal') {
$db->commit(); $db->commit();
$message = 'refused'; $message = 'refused';
setEventMessages("PropalRefused", null, 'warning'); setEventMessages("PropalRefused", null, 'warnings');
} else { } else {
$db->rollback(); $db->rollback();
} }
@ -170,7 +181,7 @@ $replacemainarea = (empty($conf->dol_hide_leftmenu) ? '<div>' : '').'<div>';
llxHeader($head, $langs->trans("OnlineSignature"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea, 1); llxHeader($head, $langs->trans("OnlineSignature"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea, 1);
if ($action == 'refusepropal') { if ($action == 'refusepropal') {
print $form->formconfirm($_SERVER["PHP_SELF"].'?ref='.$ref, $langs->trans('RefusePropal'), $langs->trans('ConfirmRefusePropal', $object->ref), 'confirm_refusepropal', '', '', 1); print $form->formconfirm($_SERVER["PHP_SELF"].'?ref='.urlencode($ref).'&securekey='.urlencode($SECUREKEY), $langs->trans('RefusePropal'), $langs->trans('ConfirmRefusePropal', $object->ref), 'confirm_refusepropal', '', '', 1);
} }
// Check link validity for param 'source' // Check link validity for param 'source'
@ -195,7 +206,7 @@ print '<input type="hidden" name="entity" value="'.$entity.'" />';
print "\n"; print "\n";
print '<!-- Form to sign -->'."\n"; print '<!-- Form to sign -->'."\n";
print '<table id="dolpaymenttable" summary="Payment form" class="center">'."\n"; print '<table id="dolpublictable" summary="Payment form" class="center">'."\n";
// Show logo (search order: logo defined by ONLINE_SIGN_LOGO_suffix, then ONLINE_SIGN_LOGO_, then small company logo, large company logo, theme logo, common logo) // Show logo (search order: logo defined by ONLINE_SIGN_LOGO_suffix, then ONLINE_SIGN_LOGO_, then small company logo, large company logo, theme logo, common logo)
// Define logo and logosmall // Define logo and logosmall
@ -295,6 +306,13 @@ if ($source == 'proposal') {
print '<b>'.$proposal->thirdparty->name.'</b>'; print '<b>'.$proposal->thirdparty->name.'</b>';
print '</td></tr>'."\n"; print '</td></tr>'."\n";
// Amount
print '<tr class="CTableRow2"><td class="CTableRow2">'.$langs->trans("Amount");
print '</td><td class="CTableRow2">';
print '<b>'.price($proposal->total_ttc, 0, $langs, 1, -1, -1, $conf->currency).'</b>';
print '</td></tr>'."\n";
// Object // Object
$text = '<b>'.$langs->trans("SignatureProposalRef", $proposal->ref).'</b>'; $text = '<b>'.$langs->trans("SignatureProposalRef", $proposal->ref).'</b>';
@ -308,7 +326,7 @@ if ($source == 'proposal') {
print $langs->trans("DownloadDocument").'</a>'; print $langs->trans("DownloadDocument").'</a>';
} }
} else { } else {
/* TODO If proposal signed newer than proposal ref, get link of proposal signed /* TODO If the file of proposal signed is newer than the default proposal file, get link of proposal signed
*/ */
} }
@ -358,7 +376,7 @@ if ($action == "dosign" && empty($cancel)) {
print '<script language="JavaScript" type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jSignature/jSignature.js"></script> print '<script language="JavaScript" type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jSignature/jSignature.js"></script>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
$("#signature").jSignature({ color:"#000", lineWidth:4, height: 180}); $("#signature").jSignature({ color:"#000", lineWidth:4, '.(empty($conf->dol_optimize_smallscreen) ? '' : 'width: 280, ' ).'height: 180});
$("#signature").on("change",function(){ $("#signature").on("change",function(){
$("#clearsignature").css("display",""); $("#clearsignature").css("display","");
@ -373,13 +391,14 @@ if ($action == "dosign" && empty($cancel)) {
data: { data: {
"action" : "importSignature", "action" : "importSignature",
"signaturebase64" : signature, "signaturebase64" : signature,
"ref" : "'.dol_escape_js($REF).'", "ref" : \''.dol_escape_js($REF).'\',
"mode" : "propale", "securekey" : \''.dol_escape_js($SECUREKEY).'\',
"mode" : \''.dol_escape_htmltag($source).'\',
}, },
success: function(response) { success: function(response) {
if(response == "success"){ if(response == "success"){
console.log("Success on saving signature"); console.log("Success on saving signature");
window.location.replace("'.$_SERVER["SELF"].'?ref='.urlencode($ref).'&message=signed"); window.location.replace("'.$_SERVER["PHP_SELF"].'?ref='.urlencode($ref).'&message=signed&securekey='.urlencode($SECUREKEY).'");
}else{ }else{
console.error(response); console.error(response);
} }

View File

@ -926,7 +926,8 @@ print '<!-- urlok = '.$urlok.' -->'."\n";
print '<!-- urlko = '.$urlko.' -->'."\n"; print '<!-- urlko = '.$urlko.' -->'."\n";
print "\n"; print "\n";
print '<table id="dolpaymenttable" summary="Payment form" class="center">'."\n"; // Section with payment informationsummary
print '<table id="dolpublictable" summary="Payment form" class="center">'."\n";
// Output introduction text // Output introduction text
$text = ''; $text = '';
@ -1524,10 +1525,13 @@ if ($source == 'member' || $source == 'membersubscription') {
// Debitor // Debitor
print '<tr class="CTableRow2"><td class="CTableRow2">'.$langs->trans("Member"); print '<tr class="CTableRow2"><td class="CTableRow2">'.$langs->trans("Member");
print '</td><td class="CTableRow2"><b>'; print '</td><td class="CTableRow2">';
if ($member->morphy == 'mor' && !empty($member->societe)) { print '<b>';
print $member->societe; if ($member->morphy == 'mor' && !empty($member->company)) {
print img_picto('', 'company', 'class="pictofixedwidth"');
print $member->company;
} else { } else {
print img_picto('', 'member', 'class="pictofixedwidth"');
print $member->getFullName($langs); print $member->getFullName($langs);
} }
print '</b>'; print '</b>';

View File

@ -49,9 +49,24 @@ This is a form to test if a CSRF exists into a Dolibarr page.<br>
print 'urltosendrequest = '.$urltosendrequest.'<br><br>'; print 'urltosendrequest = '.$urltosendrequest.'<br><br>';
?> ?>
Test post
<form method="POST" action="<?php echo $urltosendrequest; ?>" target="_blank"> <form method="POST" action="<?php echo $urltosendrequest; ?>" target="_blank">
<!-- <input type="hidden" name="token" value="123456789"> --> <!-- <input type="hidden" name="token" value="123456789"> -->
<input type="text" name="action" value="add"> <input type="text" name="action" value="add">
<input type="text" name="nom" value="New group test"> <input type="text" name="nom" value="New group test">
<input type="submit" name="submit" value="Submit"> <input type="submit" name="submit" value="Submit">
</form> </form>
Test logout
<html>
<body>
<script>history.pushState('', '', '/')</script>
<form action="http://localhostgit/dolibarr_dev/htdocs/user/logout.php">
<input type="submit" value="Submit request" />
</form>
<script>
document.forms[0].submit();
</script>
</body>
</html>

View File

@ -359,7 +359,7 @@ a.top-menu-dropdown-link {
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
text-align:center; text-align:center;
text-decoration:none; text-decoration:none;
margin-right: 5px; margin-<?php echo $right; ?>: 5px;
display: inline-block; display: inline-block;
content: "\f0da"; content: "\f0da";
/* color: rgba(0,0,0,0.3); */ /* color: rgba(0,0,0,0.3); */

View File

@ -2932,14 +2932,17 @@ a.help:link, a.help:visited, a.help:hover, a.help:active, span.help {
/* color: #f3e4ac !important; */ /* color: #f3e4ac !important; */
} }
.helppresentcircle { .helppresentcircle {
/*
color: var(--colorbackhmenu1); color: var(--colorbackhmenu1);
filter: invert(0.8); filter: invert(0.5);
margin-<?php echo $left ?>: -7px; */
color: var(--colortextbackhmenu);
margin-<?php echo $left ?>: -4px;
display: inline-block; display: inline-block;
margin-top: -10px;
font-size: x-small; font-size: x-small;
vertical-align: super; vertical-align: super;
opacity: 0.95; opacity: 0.95;
transform: rotate(<?php echo ($left == 'left' ? '55deg' : '305deg'); ?>);
} }
.vmenu div.blockvmenufirst, .vmenu div.blockvmenulogo, .vmenu div.blockvmenusearchphone, .vmenu div.blockvmenubookmarks .vmenu div.blockvmenufirst, .vmenu div.blockvmenulogo, .vmenu div.blockvmenusearchphone, .vmenu div.blockvmenubookmarks
@ -3627,16 +3630,19 @@ div.refidpadding {
} }
div.refid { div.refid {
font-weight: bold; font-weight: bold;
color: var(--colortexttitlenotab); color: var(--colortexttitlenotab);
font-size: 1.2em; font-size: 1.2em;
word-break: break-word; word-break: break-word;
}
a.refid {
color: var(--colortexttitlenotab) !important;
} }
div.refidno { div.refidno {
padding-top: 3px; padding-top: 3px;
font-weight: normal; font-weight: normal;
color: var(--refidnocolor); color: var(--refidnocolor);
font-size: <?php print is_numeric($fontsize) ? $fontsize.'px' : $fontsize ?>; font-size: <?php print is_numeric($fontsize) ? $fontsize.'px' : $fontsize ?>;
line-height: 1.4em; line-height: 1.4em;
} }
div.refidno form { div.refidno form {
display: inline-block; display: inline-block;
@ -4576,7 +4582,15 @@ div.backgreypublicpayment { background-color: #f0f0f0; padding: 20px; border-bot
color: #222; color: #222;
opacity: 0.3; opacity: 0.3;
} }
#dolpaymenttable { min-width: 320px; font-size: 16px; } /* Width must have min to make stripe input area visible. Lower than 320 makes input area crazy for credit card that need zip code */
#dolpublictable {
min-width: 300px; font-size: 16px;
padding: 6px;
}
#dolpaymenttable {
min-width: 320px; font-size: 16px;
} /* Width must have min to make stripe input area visible. Lower than 320 makes input area crazy for credit card that need zip code */
#tablepublicpayment { #tablepublicpayment {
border: 1px solid #CCCCCC !important; border: 1px solid #CCCCCC !important;
width: 100%; width: 100%;

View File

@ -365,7 +365,7 @@ a.top-menu-dropdown-link {
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
text-align:center; text-align:center;
text-decoration:none; text-decoration:none;
margin-right: 5px; margin-<?php echo $right; ?>: 5px;
display: inline-block; display: inline-block;
content: "\f0da"; content: "\f0da";
color: rgba(0,0,0,0.3); color: rgba(0,0,0,0.3);

View File

@ -1834,7 +1834,7 @@ td.showDragHandle {
width: 100%; width: 100%;
padding-bottom: 20px; padding-bottom: 20px;
<?php if (GETPOST('optioncss', 'aZ09') != 'print') { ?> <?php if (GETPOST('optioncss', 'aZ09') != 'print') { ?>
padding-left: 229px; padding-<?php print $left; ?>: 229px;
padding-top: 16px; padding-top: 16px;
<?php } ?> <?php } ?>
} }
@ -1860,13 +1860,13 @@ td.showDragHandle {
display: none; display: none;
<?php } else { ?> <?php } else { ?>
background: var(--colorbackvmenu1); background: var(--colorbackvmenu1);
border-right: 1px solid rgba(0,0,0,0.2); border-<?php echo $right; ?>: 1px solid rgba(0,0,0,0.2);
box-shadow: 3px 0 6px -2px #eee; box-shadow: 3px 0 6px -2px #eee;
bottom: 0; bottom: 0;
color: #333; color: #333;
display: block; display: block;
font-family: "RobotoDraft","Roboto",sans-serif; font-family: "RobotoDraft","Roboto",sans-serif;
left: 0; <?php echo $left; ?>: 0;
<?php <?php
if (in_array($conf->browser->layout, array('phone', 'tablet')) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { if (in_array($conf->browser->layout, array('phone', 'tablet')) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
} else { ?> } else { ?>
@ -1920,12 +1920,13 @@ td.showDragHandle {
} }
body.sidebar-collapse .side-nav-vert, body.sidebar-collapse #id-right { body.sidebar-collapse .side-nav-vert, body.sidebar-collapse #id-right {
margin-left: 0;padding-left:0 margin-left: 0;
padding-left:0
} }
.side-nav-vert { .side-nav-vert {
margin-left: 228px; margin-<?php echo $left; ?>: 228px;
} }
/* body.sidebar-collapse .side-nav, body.sidebar-collapse .login_block_other, body.sidebar-collapse #topmenu-login-dropdown */ /* body.sidebar-collapse .side-nav, body.sidebar-collapse .login_block_other, body.sidebar-collapse #topmenu-login-dropdown */
@ -1991,7 +1992,7 @@ div.backgroundsemitransparent {
#id-right { #id-right {
padding-left: 0 ! important; padding-<?php print $left; ?>: 0 ! important;
} }
#id-left { #id-left {
z-index: 91; z-index: 91;
@ -2941,7 +2942,7 @@ form[name="addtime"] img.userphoto {
div.vmenu, td.vmenu { div.vmenu, td.vmenu {
margin-<?php print $right; ?>: 2px; margin-<?php print $right; ?>: 2px;
position: relative; position: relative;
float: left; float: <?php print $left; ?>;
padding: 0px; padding: 0px;
padding-bottom: 0px; padding-bottom: 0px;
padding-top: 0px; padding-top: 0px;
@ -2949,7 +2950,7 @@ div.vmenu, td.vmenu {
} }
.vmenu { .vmenu {
margin-left: 4px; margin-<?php print $left; ?>: 4px;
<?php if (GETPOST('optioncss', 'aZ09') == 'print') { ?> <?php if (GETPOST('optioncss', 'aZ09') == 'print') { ?>
display: none; display: none;
<?php } ?> <?php } ?>
@ -2993,14 +2994,17 @@ a.help:link, a.help:visited, a.help:hover, a.help:active, span.help {
} }
.helppresentcircle { .helppresentcircle {
/*
color: var(--colorbackhmenu1); color: var(--colorbackhmenu1);
filter: invert(0.5); filter: invert(0.5);
margin-left: -7px; */
color: var(--colortextbackhmenu);
margin-left: -4px;
display: inline-block; display: inline-block;
margin-top: -10px;
font-size: x-small; font-size: x-small;
vertical-align: super; vertical-align: super;
opacity: 0.95; opacity: 0.95;
transform: rotate(<?php echo ($left == 'left' ? '55deg' : '305deg'); ?>);
} }
div.blockvmenulogo div.blockvmenulogo
@ -3658,14 +3662,17 @@ div.refidpadding {
div.refid { div.refid {
font-weight: bold; font-weight: bold;
color: rgb(--colortexttitlenotab); color: rgb(--colortexttitlenotab);
font-size: 160%; font-size: 160%;
}
a.refid {
color: var(--colortexttitlenotab) !important;
} }
div.refidno { div.refidno {
padding-top: 8px; padding-top: 8px;
font-weight: normal; font-weight: normal;
color: #444; color: #444;
font-size: <?php print $fontsize ?>px; font-size: <?php print $fontsize ?>px;
line-height: 21px; line-height: 21px;
} }
div.refidno form { div.refidno form {
display: inline-block; display: inline-block;
@ -4527,7 +4534,15 @@ div.backgreypublicpayment { background-color: #f0f0f0; padding: 20px; border-bot
span.buttonpaymentsmall { span.buttonpaymentsmall {
text-shadow: none; text-shadow: none;
} }
#dolpaymenttable { min-width: 320px; font-size: 16px; } /* Width must have min to make stripe input area visible. Lower than 320 makes input area crazy for credit card that need zip code */
#dolpublictable {
min-width: 300px; font-size: 16px;
padding: 6px;
}
#dolpaymenttable {
min-width: 320px; font-size: 16px;
} /* Width must have min to make stripe input area visible. Lower than 320 makes input area crazy for credit card that need zip code */
#tablepublicpayment { border: 1px solid #CCCCCC !important; width: 100%; padding: 20px; } #tablepublicpayment { border: 1px solid #CCCCCC !important; width: 100%; padding: 20px; }
#tablepublicpayment .CTableRow1 { background-color: #F0F0F0 !important; } #tablepublicpayment .CTableRow1 { background-color: #F0F0F0 !important; }
#tablepublicpayment tr.liste_total { border-bottom: 1px solid #CCCCCC !important; } #tablepublicpayment tr.liste_total { border-bottom: 1px solid #CCCCCC !important; }