Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into fieldlabel
Browse files Browse the repository at this point in the history
  • Loading branch information
frederic34 committed Nov 9, 2018
2 parents da3ee9a + 773e2da commit 09efde4
Show file tree
Hide file tree
Showing 208 changed files with 11,213 additions and 7,769 deletions.
86 changes: 84 additions & 2 deletions ChangeLog
Expand Up @@ -8,8 +8,9 @@ For Users:
NEW: Stable module: Website
NEW: Stable module: WebDAV
NEW: Stable module: Module Builder
NEW: Stable module "Skype" has been replaced with module "Social Networks" to support more tools.
NEW: Stable module "Skype" has been replaced with module "Social Networks" to support more services.
NEW: Experimental module "TakePos"
NEW: Experimental module "Ticket"
NEW: Dolibarr can provide information in page title when multicompany is enabled of not, making
Android application like DoliDroid able to provide native features for multicompany module.
NEW: Compatibility with PHP 7.3
Expand All @@ -22,11 +23,92 @@ For developers:
WARNING:

Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* If you use some links like viewimages.php?modulepart=mycompany&file=... in you external modules, you must
* If you use some links like viewimages.php?modulepart=mycompany&file=... in your external modules, you must
replace them with links like viewimages.php?modulepart=mycompany&file=logos/... (note that link change only for
modulepart=mycompany that now works like others).
* Hidden option MAIN_PDF_SHIPPING_DISPLAY_AMOUNT_HT has been renamed into SHIPPING_PDF_DISPLAY_AMOUNT_HT


***** ChangeLog for 8.0.3 compared to 8.0.2 *****
FIX: #9161
FIX: #9432
FIX: #9432 Assign yourself as a commercial when you don't have permission to see all thirds
FIX: #9510
FIX: #9567
FIX: According to french law, if seller is in France and buyer isn't in UE and isn't a company, TVA used = TVA product
FIX: Amount when using mutlicurrency on PDF
FIX: Backup of database without mysqladmin available from cron.
FIX: Bad label on delete button
FIX: bad link in notification
FIX: Bad position of hook formattachOptions call
FIX: Can't create shipping if have shipping line's extrafields
FIX: check !empty exclude select element
FIX: content lost when editing a label with "
FIX: correct migration of old postgresql unique key
FIX: credit note progression
FIX: default accounting accounts on loan creation #9643
FIX: Delete of draft invoice
FIX: deletion on draft is allowed if we are allwoed to create
FIX: Do not show check box if not applicable
FIX: exclude element of the select
FIX: extrafields of taks not visible in creation
FIX: filter on employee
FIX: invoice stats: situation invoices were not counted
FIX: keep external module element when adding resource
FIX: langs fr
FIX: Link template invoice to contract
FIX: Look and feel v8. Missing button "Create category"
FIX: Menu to show/edit Users categories was missing
FIX: missing name alias field in societe import/export #9091
FIX: missing symbol for indian rupies
FIX: Missing transaction around action
FIX: modify parenting before task deletion
FIX: nb of session in title
FIX: need to filter on current entity on replenish
FIX: number mailing for a contact with multicompany
FIX: Option for prof id mandatory not working with custom type of company
FIX: Option MAIN_DISABLE_NOTES_TAB #9611
FIX: Pagination stats
FIX: pdf typhon: order reference duplicate
FIX: position 0 for emails templates
FIX: previous situation invoice selection
FIX: Product marge tabs on product card
FIX: Product margin tab and credit note
FIX: propal pdf: missing parenthesis for customs code
FIX: properties on proposal must not be modified if error
FIX: qty not visible for a lot when making shipment on a dedicated stock
FIX: Quick hack to solve pb of bad definition of public holidays
FIX: remain to pay for credit note was wrong on invoice list
FIX: replenish wasn't caring about supplier price min quantity #9561
FIX: Required extrafield value numeric should accept '0'
FIX: ressource list with extrafields
FIX: restore last seach criteria
FIX: Selection of addmaindocfile is lost on error
FIX: Sending of reminder for expired subscriptions
FIX: shared link ko on proposals
FIX: showOptionals: column mismatches
FIX: situation invoice total with credit note
FIX: situation invoice prev percent
FIX: special code on create supplier invoice from supplier order
FIX: Symbol of currency in substitution variables
FIX: The max size for upload file was not corectly shown
FIX: the member e-mail on resign and validation.
FIX: thirdparty property of object not loaded when only one record
FIX: title
FIX: Title problem on admin RSS module
FIX: Tooltip on invoice widget
FIX: Total of timespent
FIX: trackid into email sent from member module.
FIX: translation in select unit form
FIX: use discount with multicurrency
FIX: Variable name
FIX: When we delete a product, llx_product_association rows are not deleted
FIX: when we're just admin and not super admin, if we create new user with transverse mode, we don't see it then we can't add him in usergroup
FIX: wrong function name
FIX: wrong occurence number of contract on contact card, we must only count externals
FIX: wrong value for module part and return access denied
FIX: Wrong variable name
FIX: XSS vulnerability reported by Mary Princy E

***** ChangeLog for 8.0.2 compared to 8.0.1 *****
FIX: #8452
Expand Down
14 changes: 7 additions & 7 deletions build/makepack-dolibarr.pl
Expand Up @@ -522,10 +522,17 @@
$ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot12.png`;

# Security to avoid to package data files
print "Remove documents dir\n";
$ret=`rm -fr $BUILDROOT/$PROJECT/document`;
$ret=`rm -fr $BUILDROOT/$PROJECT/documents`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/document`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/documents`;

print "Remove subdir of custom dir\n";
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\;\n";
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs but not files
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\;\n";
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs, even symbolic links, but not files

# Removed known external modules to avoid any error when packaging from env where external modules are tested
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/allscreens*`;
Expand Down Expand Up @@ -591,13 +598,6 @@
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/LICENSE.TXT`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/theme/common/octicons/LICENSE`;


print "Remove subdir of custom dir\n";
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\;\n";
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs but not files
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\;\n";
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs, even symbolic links, but not files
}

# Build package for each target
Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/admin/accountmodel.php
Expand Up @@ -44,7 +44,7 @@
// Load translation files required by the page
$langs->loadLangs(array("errors","admin","companies","resource","holiday","compta","accountancy","hrm"));

$action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view';
$action=GETPOST('action','aZ09')?GETPOST('action','aZ09'):'view';
$confirm=GETPOST('confirm','alpha');
$id=31;
$rowid=GETPOST('rowid','alpha');
Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/admin/categories_list.php
Expand Up @@ -34,7 +34,7 @@
// Load translation files required by the page
$langs->loadLangs(array("errors","admin","companies","resource","holiday","accountancy","hrm"));

$action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view';
$action=GETPOST('action','aZ09')?GETPOST('action','aZ09'):'view';
$confirm=GETPOST('confirm','alpha');
$id=32;
$rowid=GETPOST('rowid','alpha');
Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/admin/defaultaccounts.php
Expand Up @@ -43,7 +43,7 @@
accessforbidden();
}

$action = GETPOST('action', 'alpha');
$action = GETPOST('action', 'aZ09');


$list_account_main = array (
Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/admin/export.php
Expand Up @@ -41,7 +41,7 @@
accessforbidden();
}

$action = GETPOST('action', 'alpha');
$action = GETPOST('action', 'aZ09');

// Parameters ACCOUNTING_EXPORT_*
$main_option = array (
Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/admin/fiscalyear_card.php
Expand Up @@ -38,7 +38,7 @@

$error = 0;

$action = GETPOST('action', 'alpha');
$action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
$id = GETPOST('id', 'int');

Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/admin/index.php
Expand Up @@ -41,7 +41,7 @@
accessforbidden();
}

$action = GETPOST('action', 'alpha');
$action = GETPOST('action', 'aZ09');

// Parameters ACCOUNTING_* and others
$list = array (
Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/admin/journals_list.php
Expand Up @@ -34,7 +34,7 @@
// Load translation files required by the page
$langs->loadLangs(array("admin","compta","accountancy"));

$action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view';
$action=GETPOST('action','aZ09')?GETPOST('action','aZ09'):'view';
$confirm=GETPOST('confirm','alpha');
$id=35;
$rowid=GETPOST('rowid','alpha');
Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/admin/productaccount.php
Expand Up @@ -45,7 +45,7 @@
accessforbidden();

// search & action GETPOST
$action = GETPOST('action', 'alpha');
$action = GETPOST('action', 'aZ09');
$codeventil_buy = GETPOST('codeventil_buy', 'array');
$codeventil_sell = GETPOST('codeventil_sell', 'array');
$chk_prod = GETPOST('chk_prod', 'array');
Expand Down
3 changes: 2 additions & 1 deletion htdocs/accountancy/bookkeeping/balance.php
Expand Up @@ -41,7 +41,7 @@
$page = GETPOST("page");
$sortorder = GETPOST("sortorder", 'alpha');
$sortfield = GETPOST("sortfield", 'alpha');
$action = GETPOST('action', 'alpha');
$action = GETPOST('action', 'aZ09');
if (GETPOST("exportcsv",'alpha')) $action = 'export_csv';

// Load variable for pagination
Expand Down Expand Up @@ -151,6 +151,7 @@
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;

$filename = 'balance';
$type_export = 'balance';
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';

$result = $object->fetchAllBalance($sortorder, $sortfield, 0, 0, $filter);
Expand Down
6 changes: 3 additions & 3 deletions htdocs/accountancy/bookkeeping/list.php
Expand Up @@ -36,10 +36,10 @@
// Load translation files required by the page
$langs->loadLangs(array("accountancy"));

$action = GETPOST('action', 'alpha');
$action = GETPOST('action', 'aZ09');
$search_mvt_num = GETPOST('search_mvt_num', 'int');
$search_doc_type = GETPOST("search_doc_type");
$search_doc_ref = GETPOST("search_doc_ref");
$search_doc_type = GETPOST("search_doc_type", 'alpha');
$search_doc_ref = GETPOST("search_doc_ref", 'alpha');
$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
$search_date_end = dol_mktime(0, 0, 0, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
$search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int'));
Expand Down
1 change: 1 addition & 0 deletions htdocs/accountancy/class/accountancyexport.class.php
Expand Up @@ -218,6 +218,7 @@ public function export(&$TData)

// Define name of file to save
$filename = 'general_ledger-'.$this->getFormatCode($conf->global->ACCOUNTING_EXPORT_MODELCSV);
$type_export = 'general_ledger';

include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';

Expand Down
1 change: 1 addition & 0 deletions htdocs/accountancy/journal/bankjournal.php
Expand Up @@ -750,6 +750,7 @@
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;

$filename = 'journal';
$type_export = 'journal';
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';

// CSV header line
Expand Down
1 change: 1 addition & 0 deletions htdocs/accountancy/journal/expensereportsjournal.php
Expand Up @@ -429,6 +429,7 @@
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
$filename = 'journal';
$type_export = 'journal';
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
// Model Cegid Expert Export
Expand Down
1 change: 1 addition & 0 deletions htdocs/accountancy/journal/purchasesjournal.php
Expand Up @@ -586,6 +586,7 @@
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;

$filename = 'journal';
$type_export = 'journal';
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';

$companystatic = new Fournisseur($db);
Expand Down
1 change: 1 addition & 0 deletions htdocs/accountancy/journal/sellsjournal.php
Expand Up @@ -547,6 +547,7 @@
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;

$filename = 'journal';
$type_export = 'journal';
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';

$companystatic = new Client($db);
Expand Down
3 changes: 1 addition & 2 deletions htdocs/accountancy/tpl/export_journal.tpl.php
Expand Up @@ -35,9 +35,8 @@
header('Content-Type: text/csv');


if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == "11") // Specific filename for FEC model export
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == "11" && $type_export == "general_ledger") // Specific filename for FEC model export into the general ledger
{

// FEC format is defined here: https://www.legifrance.gouv.fr/affichCodeArticle.do?idArticle=LEGIARTI000027804775&cidTexte=LEGITEXT000006069583&dateTexte=20130802&oldAction=rechCodeArticle
if (empty($search_date_end))
{
Expand Down
3 changes: 2 additions & 1 deletion htdocs/adherents/admin/adherent_emails.php
Expand Up @@ -147,8 +147,9 @@
'ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER' =>'emailtemplate:member', /* old was ADHERENT_AUTOREGISTER_MAIL */
'ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_VALID */
'ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_COTIS */
'ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION' =>'emailtemplate:member',
'ADHERENT_EMAIL_TEMPLATE_CANCELATION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_RESIL */
'MEMBER_REMINDER_EMAIL'=>array('type'=>'yesno', 'label'=>$langs->trans('MEMBER_REMINDER_EMAIL', $langs->transnoentities("Module2300Name"))),
'ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION' =>'emailtemplate:member',
);

$helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/adherents/card.php
Expand Up @@ -907,7 +907,7 @@ function initfieldrequired()
// Login
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
{
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").' / '.$langs->trans("Id").'</span></td><td><input type="text" name="member_login" class="minwidth300" maxlength="50" value="'.(isset($_POST["member_login"])?GETPOST("member_login", 'alpha', 2):$object->login).'"></td></tr>';
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").' / '.$langs->trans("Id").'</span></td><td><input type="text" name="member_login" class="minwidth300" maxlength="50" value="'.(isset($_POST["member_login"])?GETPOST("member_login", 'alpha', 2):$object->login).'" autofocus="autofocus"></td></tr>';
}

// Password
Expand Down
65 changes: 61 additions & 4 deletions htdocs/adherents/class/adherent.class.php
Expand Up @@ -2644,13 +2644,19 @@ public function sendReminderForExpiredSubscription($daysbeforeendlist='10')

$blockingerrormsg = '';

/*if (empty($conf->global->MEMBER_REMINDER_EMAIL))
if (empty($conf->adherent->enabled)) // Should not happen. If module disabled, cron job should not be visible.
{
$langs->load("agenda");
$this->output = $langs->trans('ModuleNotEnabled', $langs->transnoentitiesnoconv("Adherent"));
return 0;
}
if (empty($conf->global->MEMBER_REMINDER_EMAIL))
{
$langs->load("agenda");
$this->output = $langs->trans('EventRemindersByEmailNotEnabled', $langs->transnoentitiesnoconv("Adherent"));
return 0;
}*/

}
$now = dol_now();
$nbok = 0;
$nbko = 0;
Expand Down Expand Up @@ -2736,7 +2742,58 @@ public function sendReminderForExpiredSubscription($daysbeforeendlist='10')
{
$nbok++;

// TODO Add event email sent for member
$message = $msg;
$sendto = $to;
$sendtocc = '';
$sendtobcc = '';
$actioncode='EMAIL';
$extraparams='';

$actionmsg='';
$actionmsg2=$langs->transnoentities('MailSentBy').' '.CMailFile::getValidAddress($from,4,0,1).' '.$langs->transnoentities('To').' '.CMailFile::getValidAddress($sendto,4,0,1);
if ($message)
{
$actionmsg=$langs->transnoentities('MailFrom').': '.dol_escape_htmltag($from);
$actionmsg=dol_concatdesc($actionmsg, $langs->transnoentities('MailTo').': '.dol_escape_htmltag($sendto));
if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . dol_escape_htmltag($sendtocc));
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
$actionmsg = dol_concatdesc($actionmsg, $message);
}

require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';

// Insert record of emails sent
$actioncomm = new ActionComm($this->db);

$actioncomm->type_code = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
$actioncomm->code = 'AC_'.$actioncode;
$actioncomm->label = $actionmsg2;
$actioncomm->note = $actionmsg;
$actioncomm->fk_project = 0;
$actioncomm->datep = $now;
$actioncomm->datef = $now;
$actioncomm->percentage = -1; // Not applicable
$actioncomm->socid = $adherent->thirdparty->id;
$actioncomm->contactid = 0;
$actioncomm->authorid = $user->id; // User saving action
$actioncomm->userownerid = $user->id; // Owner of action
// Fields when action is en email (content should be added into note)
$actioncomm->email_msgid = $cmail->msgid;
$actioncomm->email_from = $from;
$actioncomm->email_sender= '';
$actioncomm->email_to = $to;
$actioncomm->email_tocc = $sendtocc;
$actioncomm->email_tobcc = $sendtobcc;
$actioncomm->email_subject = $subject;
$actioncomm->errors_to = '';

$actioncomm->fk_element = $adherent->id;
$actioncomm->elementtype = $adherent->element;

$actioncomm->extraparams = $extraparams;

$actioncomm->create($user);
}
}
else
Expand Down

0 comments on commit 09efde4

Please sign in to comment.