Skip to content

Commit

Permalink
Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into develop
Browse files Browse the repository at this point in the history
Conflicts:
	htdocs/langs/en_US/admin.lang
  • Loading branch information
eldy committed Jul 22, 2019
2 parents 4833c2b + 9f95b10 commit bef3423
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 67 deletions.
10 changes: 8 additions & 2 deletions htdocs/admin/mails.php
Expand Up @@ -526,11 +526,17 @@ function initfields()
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';

// Disable
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_DISABLE_ALL_MAILS").'</td><td>'.yn($conf->global->MAIN_DISABLE_ALL_MAILS).'</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_DISABLE_ALL_MAILS").'</td><td>'.yn($conf->global->MAIN_DISABLE_ALL_MAILS);
if (! empty($conf->global->MAIN_DISABLE_ALL_MAILS)) print img_warning($langs->trans("Disabled"));
print '</td></tr>';

// Force e-mail recipient
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_FORCE_SENDTO").'</td><td>'.$conf->global->MAIN_MAIL_FORCE_SENDTO;
if (! empty($conf->global->MAIN_MAIL_FORCE_SENDTO) && ! isValidEmail($conf->global->MAIN_MAIL_FORCE_SENDTO)) print img_warning($langs->trans("ErrorBadEMail"));
if (! empty($conf->global->MAIN_MAIL_FORCE_SENDTO))
{
if (! isValidEmail($conf->global->MAIN_MAIL_FORCE_SENDTO)) print img_warning($langs->trans("ErrorBadEMail"));
else print img_warning($langs->trans("RecipientEmailsWillBeReplacedWithThisValue"));
}
print '</td></tr>';

//Add user to select destinaries list
Expand Down
2 changes: 1 addition & 1 deletion htdocs/comm/action/list.php
Expand Up @@ -43,7 +43,7 @@
$contextpage=GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'actioncommlist'; // To manage different context of search
$resourceid=GETPOST("search_resourceid", "int")?GETPOST("search_resourceid", "int"):GETPOST("resourceid", "int");
$pid=GETPOST("search_projectid", 'int', 3)?GETPOST("search_projectid", 'int', 3):GETPOST("projectid", 'int', 3);
$status=GETPOST("search_status", 'alpha')?GETPOST("search_status", 'alpha'):GETPOST("status", 'alpha');
$status=(GETPOST("search_status", 'alpha') != '')?GETPOST("search_status", 'alpha'):GETPOST("status", 'alpha');
$type=GETPOST('search_type', 'alphanohtml')?GETPOST('search_type', 'alphanohtml'):GETPOST('type', 'alphanohtml');
$optioncss = GETPOST('optioncss', 'alpha');
$year=GETPOST("year", 'int');
Expand Down
132 changes: 70 additions & 62 deletions htdocs/compta/prelevement/card.php
Expand Up @@ -63,78 +63,86 @@
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals

$hookmanager->initHooks(array('directdebitprevcard','globalcard'));

/*
* Actions
*/

if ( $action == 'confirm_delete' )
{
$res=$object->delete($user);
if ($res > 0)
{
header("Location: index.php");
exit;
}
}
$parameters = array('socid' => $socid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');

// Seems to no be used and replaced with $action == 'infocredit
if ( $action == 'confirm_credite' && GETPOST('confirm', 'alpha') == 'yes')
if (empty($reshook))
{
$res=$object->set_credite();
if ($res >= 0)
if ( $action == 'confirm_delete' )
{
$res=$object->delete($user);
if ($res > 0)
{
header("Location: index.php");
exit;
}
}

// Seems to no be used and replaced with $action == 'infocredit'
if ( $action == 'confirm_credite' && GETPOST('confirm','alpha') == 'yes')
{
$res=$object->set_credite();
if ($res >= 0)
{
header("Location: card.php?id=".$id);
exit;
}
}

if ($action == 'infotrans' && $user->rights->prelevement->bons->send)
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';

$dt = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));

/*
if ($_FILES['userfile']['name'] && basename($_FILES['userfile']['name'],".ps") == $object->ref)
{
$dir = $conf->prelevement->dir_output.'/receipts';
if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $dir . "/" . dol_unescapefile($_FILES['userfile']['name']),1) > 0)
{
$object->set_infotrans($user, $dt, GETPOST('methode','alpha'));
}
header("Location: card.php?id=".$id);
exit;
}
else
{
dol_syslog("Fichier invalide",LOG_WARNING);
$mesg='BadFile';
}*/

$error = $object->set_infotrans($user, $dt, GETPOST('methode', 'alpha'));

if ($error)
{
header("Location: card.php?id=".$id."&error=$error");
exit;
}
}

// Set direct debit order to credited, create payment and close invoices
if ($action == 'infocredit' && $user->rights->prelevement->bons->credit)
{
header("Location: card.php?id=".$id);
exit;
}
}

if ($action == 'infotrans' && $user->rights->prelevement->bons->send)
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$dt = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));

$dt = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
$error = $object->set_infocredit($user, $dt);

/*
if ($_FILES['userfile']['name'] && basename($_FILES['userfile']['name'],".ps") == $object->ref)
{
$dir = $conf->prelevement->dir_output.'/receipts';
if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $dir . "/" . dol_unescapefile($_FILES['userfile']['name']),1) > 0)
{
$object->set_infotrans($user, $dt, GETPOST('methode','alpha'));
}
header("Location: card.php?id=".$id);
exit;
}
else
{
dol_syslog("Fichier invalide",LOG_WARNING);
$mesg='BadFile';
}*/

$error = $object->set_infotrans($user, $dt, GETPOST('methode', 'alpha'));

if ($error)
{
header("Location: card.php?id=".$id."&error=$error");
exit;
}
}

// Set direct debit order to credited, create payment and close invoices
if ($action == 'infocredit' && $user->rights->prelevement->bons->credit)
{
$dt = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));

$error = $object->set_infocredit($user, $dt);

if ($error)
{
header("Location: card.php?id=".$id."&error=$error");
exit;
}
if ($error)
{
header("Location: card.php?id=".$id."&error=$error");
exit;
}
}
}


Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/sociales/card.php
Expand Up @@ -655,7 +655,7 @@
else
{

print '<tr class="oddeven"><td class="opacitymedium">'.$langs->trans("None").'</td>';
print '<tr class="oddeven"><td><span class="opacitymedium">'.$langs->trans("None").'</span></td>';
print '<td></td><td></td><td></td><td></td>';
print '</tr>';
}
Expand Down
Expand Up @@ -414,7 +414,11 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails
}
}
// Make substitutions into odt of thirdparty
$tmparray=$this->get_substitutionarray_thirdparty($socobject, $outputlangs);
if ($socobject->element == 'contact') {
$tmparray = $this->get_substitutionarray_contact($socobject, $outputlangs);
} else {
$tmparray = $this->get_substitutionarray_thirdparty($socobject, $outputlangs);
}
foreach($tmparray as $key=>$value)
{
try {
Expand Down
1 change: 1 addition & 0 deletions htdocs/langs/en_US/admin.lang
Expand Up @@ -1930,3 +1930,4 @@ YouWillFindItOnYourIFTTTAccount=You will find it on your IFTTT account
EndPointFor=End point for %s : %s
DeleteEmailCollector=Delete email collector
ConfirmDeleteEmailCollector=Are you sure you want to delete this email collector?
RecipientEmailsWillBeReplacedWithThisValue=Recipient emails will be always replaced with this value

0 comments on commit bef3423

Please sign in to comment.