Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into N…
Browse files Browse the repository at this point in the history
…EW_Show_Region_in_company_info_&_Global_option_to_show_state_code_MAIN_SHOW_STATE_CODE
  • Loading branch information
ruistrecht-alt committed Sep 26, 2017
2 parents 9f7ef74 + 7178bf0 commit 3ebb18a
Show file tree
Hide file tree
Showing 161 changed files with 6,301 additions and 3,336 deletions.
42 changes: 41 additions & 1 deletion ChangeLog
Expand Up @@ -17,8 +17,48 @@ Following changes may create regressions for some external modules, but were nec
__PROPALREF__, ...)


***** ChangeLog for 6.0.1 compared to 6.0.* *****
FIX: #7000 Dashboard link for late pending payment supplier invoices do not work
FIX: #7325 Default VAT rate when editing template invoices is 0%
FIX: #7330
FIX: #7359
FIX: #7367
FIX: #7368
FIX: #7391
FIX: #7420
FIX: Add some missing attributes in Adherent:makeSubstitution (type, phone…
FIX: Bad const name
FIX: Bad link to unpayed suppliers invoices
FIX: Better protection to no send email when we change limit
FIX: Calculation in the activity box
FIX: Clean bad parameters when inserting line of template invoice
FIX: dateSelector was not taken into account
FIX: hidden option MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN
FIX: journalization for bank journal should not rely on a label.
FIX: menu enty when url is external link
FIX: missing supplier qty and supplier discount in available fields for product export.
FIX: multicompany better accuracy in rounding and with revenue stamp.
FIX: Must use pdf format page as default for merging PDF.
FIX: PDF output was sharing 2 different currencies in same total
FIX: Position of signature on strato template
FIX: Protection to avoid to apply credit note discount > remain to pay
FIX: Remove warning when using log into syslog
FIX: Responsive
FIX: Security fixes (filter onload js, less verbose error message in
FIX: SEPA recording payment must save one payment in bank per customer
FIX: Several problem with the last event box on project/tasks
FIX: Sign of amount in origin currency on credit note created from lines
FIX: Some page of admin were not responsive
FIX: SQL injection
FIX: time.php crashed without project id in param
FIX: transfer of line extrafields from order to invoice
FIX: Upgrade missing on field
FIX: View of timespent for another user
FIX: ODT generation
FIX: CVE-2017-9840, CVE-2017-14238, CVE-2017-14239, CVE-2017-14240, CVE-2017-14241,
CVE-2017-14242

***** ChangeLog for 6.0.0 compared to 5.0.* *****

NEW: Add experimental BlockeLog module (to log business events in a non reversible log file).
NEW: Add a payment module for Stripe.
NEW: Add module "Product variant" (like red, blue for the product shoes)
Expand Down
184 changes: 116 additions & 68 deletions htdocs/adherents/card.php
Expand Up @@ -2,7 +2,7 @@
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012-2016 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
Expand Down Expand Up @@ -121,14 +121,22 @@
* Actions
*/

if ($cancel) $action='';

$parameters=array('id'=>$id, 'rowid'=>$id, 'objcanvas'=>$objcanvas);
$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');

if (empty($reshook))
{
if ($cancel)
{
if (! empty($backtopage))
{
header("Location: ".$backtopage);
exit;
}
$action='';
}

if ($action == 'setuserid' && ($user->rights->user->self->creer || $user->rights->user->user->creer))
{
$error=0;
Expand Down Expand Up @@ -230,6 +238,7 @@
}
}

/*
if ($action == 'confirm_sendinfo' && $confirm == 'yes')
{
if ($object->email)
Expand All @@ -242,7 +251,7 @@
$langs->load("mails");
setEventMessages($langs->trans("MailSuccessfulySent", $from, $object->email), null, 'mesgs');
}
}
}*/

if ($action == 'update' && ! $cancel && $user->rights->adherent->creer)
{
Expand Down Expand Up @@ -715,10 +724,21 @@
}
}

// Actions when printing a doc from card
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';

// Actions to build doc
$upload_dir = $conf->adherent->dir_output;
$permissioncreate=$user->rights->adherent->creer;
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';

// Actions to send emails
$trigger_name='MEMBER_SENTBYMAIL';
$paramname='id';
$mode='emailfrommember';
$trackid='mem'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';

}


Expand Down Expand Up @@ -813,6 +833,7 @@ function initfieldrequired()
print '<form name="formsoc" action="'.$_SERVER["PHP_SELF"].'" method="post" enctype="multipart/form-data">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add">';
if ($backtopage) print '<input type="hidden" name="backtopage" value="'.($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"]).'">';

dol_fiche_head('');

Expand Down Expand Up @@ -954,11 +975,18 @@ function initfieldrequired()

dol_fiche_end();

print '<div class="center">';
print '<input type="submit" name="button" class="button" value="'.$langs->trans("AddMember").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'" onclick="history.go(-1)" />';
print '</div>';
print '<div class="center">';
print '<input type="submit" name="button" class="button" value="'.$langs->trans("AddMember").'">';
print '&nbsp;&nbsp;';
if (! empty($backtopage))
{
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans('Cancel').'">';
}
else
{
print '<input type="button" class="button" value="' . $langs->trans("Cancel") . '" onClick="javascript:history.go(-1)">';
}
print '</div>';

print "</form>\n";
}
Expand Down Expand Up @@ -1225,7 +1253,7 @@ function initfieldrequired()
print '<div class="center">';
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'" onclick="history.go(-1)" />';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>';

print '</form>';
Expand Down Expand Up @@ -1344,10 +1372,10 @@ function initfieldrequired()
}

// Confirm send card by mail
if ($action == 'sendinfo')
/*if ($action == 'sendinfo')
{
print $form->formconfirm("card.php?rowid=".$id,$langs->trans("SendCardByMail"),$langs->trans("ConfirmSendCardByMail",$object->email),"confirm_sendinfo",'',0,1);
}
}*/

// Confirm terminate
if ($action == 'resign')
Expand Down Expand Up @@ -1590,6 +1618,31 @@ function initfieldrequired()
if (empty($reshook)) {
if ($action != 'valid' && $action != 'editlogin' && $action != 'editthirdparty')
{
// Send
if ($object->statut == 1) {
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendByMail') . '</a></div>';
}

// Send card by email
// TODO Remove this to replace with a template
/*
if ($user->rights->adherent->creer)
{
if ($object->statut >= 1)
{
if ($object->email) print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$object->id.'&action=sendinfo">'.$langs->trans("SendCardByMail")."</a></div>\n";
else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NoEMail")).'">'.$langs->trans("SendCardByMail")."</a></div>\n";
}
else
{
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("SendCardByMail")."</font></div>";
}
}
else
{
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("SendCardByMail")."</font></div>";
}*/

// Modify
if ($user->rights->adherent->creer)
{
Expand Down Expand Up @@ -1626,24 +1679,6 @@ function initfieldrequired()
}
}

// Send card by email
if ($user->rights->adherent->creer)
{
if ($object->statut >= 1)
{
if ($object->email) print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$object->id.'&action=sendinfo">'.$langs->trans("SendCardByMail")."</a></div>\n";
else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NoEMail")).'">'.$langs->trans("SendCardByMail")."</a></div>\n";
}
else
{
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("SendCardByMail")."</font></div>";
}
}
else
{
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("SendCardByMail")."</font></div>";
}

// Terminate
if ($object->statut >= 1)
{
Expand Down Expand Up @@ -1720,52 +1755,65 @@ function initfieldrequired()
}


// Select mail models is same action as presend
if (GETPOST('modelselected')) {
$action = 'presend';
}

print '<div class="fichecenter"><div class="fichehalfleft">';
print '<a name="builddoc"></a>'; // ancre

// Documents generes
$filename = dol_sanitizeFileName($object->ref);
//$filename = 'tmp_cards.php';
//$filedir = $conf->adherent->dir_output . '/' . get_exdir($object->id, 2, 0, 0, $object, 'member') . dol_sanitizeFileName($object->ref);
$filedir = $conf->adherent->dir_output . '/' . get_exdir(0, 0, 0, 0, $object, 'member');
$urlsource = $_SERVER['PHP_SELF'] . '?id=' . $object->id;
$genallowed = $user->rights->adherent->creer;
$delallowed = $user->rights->adherent->supprimer;

print $formfile->showdocuments('member', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $object->default_lang, '', $object);
$somethingshown = $formfile->numoffiles;

// Show links to link elements
//$linktoelem = $form->showLinkToObjectBlock($object, null, array('subscription'));
//$somethingshown = $form->showLinkedObjectBlock($object, '');
if ($action != 'presend')
{
print '<div class="fichecenter"><div class="fichehalfleft">';
print '<a name="builddoc"></a>'; // ancre

// Documents generes
$filename = dol_sanitizeFileName($object->ref);
//$filename = 'tmp_cards.php';
//$filedir = $conf->adherent->dir_output . '/' . get_exdir($object->id, 2, 0, 0, $object, 'member') . dol_sanitizeFileName($object->ref);
$filedir = $conf->adherent->dir_output . '/' . get_exdir(0, 0, 0, 0, $object, 'member');
$urlsource = $_SERVER['PHP_SELF'] . '?id=' . $object->id;
$genallowed = $user->rights->adherent->creer;
$delallowed = $user->rights->adherent->supprimer;

print $formfile->showdocuments('member', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $object->default_lang, '', $object);
$somethingshown = $formfile->numoffiles;

// Show links to link elements
//$linktoelem = $form->showLinkToObjectBlock($object, null, array('subscription'));
//$somethingshown = $form->showLinkedObjectBlock($object, '');

// Show links to link elements
/*$linktoelem = $form->showLinkToObjectBlock($object,array('order'));
if ($linktoelem) print ($somethingshown?'':'<br>').$linktoelem;
*/

// Shon online payment link
$useonlinepayment = (! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled) || ! empty($conf->paybox->enabled));

if ($useonlinepayment)
{
print '<br>';

// Show links to link elements
/*$linktoelem = $form->showLinkToObjectBlock($object,array('order'));
if ($linktoelem) print ($somethingshown?'':'<br>').$linktoelem;
*/
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
print showOnlinePaymentUrl('membersubscription', $object->ref);
}

// Shon online payment link
$useonlinepayment = (! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled) || ! empty($conf->paybox->enabled));
print '</div><div class="fichehalfright"><div class="ficheaddleft">';

if ($useonlinepayment)
{
print '<br>';
// List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'member', $socid, 1, 'listactions', 10);

require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
print showOnlinePaymentUrl('membersubscription', $object->ref);
print '</div></div></div>';
}

print '</div><div class="fichehalfright"><div class="ficheaddleft">';

// List of actions on element
/* Already in tab Agenda/Events
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'member', $socid, 1);
*/
print '</div></div></div>';
// Presend form
$modelmail='member';
$defaulttopic='SendMemberRef';
$diroutput = $conf->adherent->dir_output;
$trackid = 'mem'.$object->id;

include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
}
}

Expand Down

0 comments on commit 3ebb18a

Please sign in to comment.