diff --git a/ChangeLog b/ChangeLog
index f61d3a4820d..e4fbf63e758 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
@@ -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
diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl
index 01e282aa492..179f5dcd447 100755
--- a/build/makepack-dolibarr.pl
+++ b/build/makepack-dolibarr.pl
@@ -522,10 +522,17 @@ if ($nboftargetok) {
$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*`;
@@ -591,13 +598,6 @@ if ($nboftargetok) {
$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
diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php
index db21cd62192..e8f6b8e43b7 100644
--- a/htdocs/accountancy/admin/accountmodel.php
+++ b/htdocs/accountancy/admin/accountmodel.php
@@ -44,7 +44,7 @@ if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/core
// 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');
diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php
index 9f6b0bf14fe..1f10403f798 100644
--- a/htdocs/accountancy/admin/categories_list.php
+++ b/htdocs/accountancy/admin/categories_list.php
@@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
// 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');
diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php
index 31fc04fa745..6de48b58cd5 100644
--- a/htdocs/accountancy/admin/defaultaccounts.php
+++ b/htdocs/accountancy/admin/defaultaccounts.php
@@ -43,7 +43,7 @@ if (empty($user->rights->accounting->chartofaccount))
accessforbidden();
}
-$action = GETPOST('action', 'alpha');
+$action = GETPOST('action', 'aZ09');
$list_account_main = array (
diff --git a/htdocs/accountancy/admin/export.php b/htdocs/accountancy/admin/export.php
index eccb9b0c06f..03538b759e7 100644
--- a/htdocs/accountancy/admin/export.php
+++ b/htdocs/accountancy/admin/export.php
@@ -41,7 +41,7 @@ if (empty($user->rights->accounting->chartofaccount))
accessforbidden();
}
-$action = GETPOST('action', 'alpha');
+$action = GETPOST('action', 'aZ09');
// Parameters ACCOUNTING_EXPORT_*
$main_option = array (
diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php
index 05c7a3fd174..297a3026b02 100644
--- a/htdocs/accountancy/admin/fiscalyear_card.php
+++ b/htdocs/accountancy/admin/fiscalyear_card.php
@@ -38,7 +38,7 @@ if (empty($user->rights->accounting->fiscalyear))
$error = 0;
-$action = GETPOST('action', 'alpha');
+$action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
$id = GETPOST('id', 'int');
diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php
index a17ee45ae4d..60a81df9a56 100644
--- a/htdocs/accountancy/admin/index.php
+++ b/htdocs/accountancy/admin/index.php
@@ -41,7 +41,7 @@ if (empty($user->rights->accounting->chartofaccount))
accessforbidden();
}
-$action = GETPOST('action', 'alpha');
+$action = GETPOST('action', 'aZ09');
// Parameters ACCOUNTING_* and others
$list = array (
diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php
index 3511ae431ec..49745676eb3 100644
--- a/htdocs/accountancy/admin/journals_list.php
+++ b/htdocs/accountancy/admin/journals_list.php
@@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
// 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');
diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php
index a84e2f6fcab..246d3752f56 100644
--- a/htdocs/accountancy/admin/productaccount.php
+++ b/htdocs/accountancy/admin/productaccount.php
@@ -45,7 +45,7 @@ if (! $user->rights->accounting->bind->write)
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');
diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php
index 9feb2a7c234..e807d1acced 100644
--- a/htdocs/accountancy/bookkeeping/balance.php
+++ b/htdocs/accountancy/bookkeeping/balance.php
@@ -41,7 +41,7 @@ $langs->loadLangs(array("accountancy"));
$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
@@ -151,6 +151,7 @@ if ($action == 'export_csv')
$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);
diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php
index 46575c21143..5613e42b4c4 100644
--- a/htdocs/accountancy/bookkeeping/list.php
+++ b/htdocs/accountancy/bookkeeping/list.php
@@ -36,10 +36,10 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
// 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'));
diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php
index 7b832976e89..5d76a7155d6 100644
--- a/htdocs/accountancy/class/accountancyexport.class.php
+++ b/htdocs/accountancy/class/accountancyexport.class.php
@@ -218,6 +218,7 @@ class AccountancyExport
// 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';
diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php
index 4b8c4ce3c22..4c0bf9a55fa 100644
--- a/htdocs/accountancy/journal/bankjournal.php
+++ b/htdocs/accountancy/journal/bankjournal.php
@@ -750,6 +750,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
$filename = 'journal';
+ $type_export = 'journal';
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
// CSV header line
diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php
index 197d18f2380..a767d469120 100644
--- a/htdocs/accountancy/journal/expensereportsjournal.php
+++ b/htdocs/accountancy/journal/expensereportsjournal.php
@@ -429,6 +429,7 @@ $userstatic = new User($db);
$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
diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php
index 7984443d906..1b71b288c6b 100644
--- a/htdocs/accountancy/journal/purchasesjournal.php
+++ b/htdocs/accountancy/journal/purchasesjournal.php
@@ -586,6 +586,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
$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);
diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php
index f3a3246c1ea..21736195073 100644
--- a/htdocs/accountancy/journal/sellsjournal.php
+++ b/htdocs/accountancy/journal/sellsjournal.php
@@ -547,6 +547,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
$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);
diff --git a/htdocs/accountancy/tpl/export_journal.tpl.php b/htdocs/accountancy/tpl/export_journal.tpl.php
index d0d902770c0..ca3c9c49ea0 100644
--- a/htdocs/accountancy/tpl/export_journal.tpl.php
+++ b/htdocs/accountancy/tpl/export_journal.tpl.php
@@ -35,9 +35,8 @@ $endaccountingperiod = dol_print_date(dol_now(), '%Y%m%d');
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))
{
diff --git a/htdocs/adherents/admin/adherent_emails.php b/htdocs/adherents/admin/adherent_emails.php
index feeb48eb1c3..9ee06cd3fa7 100644
--- a/htdocs/adherents/admin/adherent_emails.php
+++ b/htdocs/adherents/admin/adherent_emails.php
@@ -147,8 +147,9 @@ $constantes=array(
'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").'
';
diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php
index 51f7db4cd67..347c29fc30d 100644
--- a/htdocs/adherents/card.php
+++ b/htdocs/adherents/card.php
@@ -907,7 +907,7 @@ else
// Login
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
{
- print '
| '.$langs->trans("Label").' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Label").' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("SubscriptionRequired").' | ';
print $form->selectyesno("subscription",1,1);
diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index c572b8abe8b..1b03101a2ae 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -618,7 +618,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
if ($value == 'formula' && empty($_POST['formula'])) continue;
if ($value == 'sortorder') continue; // For a column name 'sortorder', we use the field name 'position'
if ((! isset($_POST[$value]) || $_POST[$value]=='')
- && (! in_array($listfield[$f], array('decalage','module','accountancy_code','accountancy_code_sell','accountancy_code_buy')) // Fields that are not mandatory
+ && (! in_array($listfield[$f], array('decalage','module','accountancy_code','accountancy_code_sell','accountancy_code_buy','tracking')) // Fields that are not mandatory
&& (! ($id == 10 && $listfield[$f] == 'code')) // Code is mandatory fir table 10
)
)
diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php
new file mode 100644
index 00000000000..3280492701e
--- /dev/null
+++ b/htdocs/admin/emailcollector_card.php
@@ -0,0 +1,559 @@
+
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see ';
+ /*
+ // Ref bis
+ $morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->emailcollector->creer, 'string', '', 0, 1);
+ $morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->emailcollector->creer, 'string', '', null, null, '', 1);
+ // Thirdparty
+ $morehtmlref.=' ';
+
+ dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
+
+ print ''.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); + // Project + if (! empty($conf->projet->enabled)) + { + $langs->load("projects"); + $morehtmlref.=' '.$langs->trans('Project') . ' '; + if ($user->rights->emailcollector->creer) + { + if ($action != 'classify') + { + $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref.=''; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } + } else { + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref.=''; + $morehtmlref.=$proj->ref; + $morehtmlref.=''; + } else { + $morehtmlref.=''; + } + } + } + */ + $morehtmlref .= ' ';
+ print ' ';
+
+
+ print '';
+ print '';
+ print ' ';
+ print ''; + + dol_fiche_end(); + + // Buttons for actions + if ($action != 'presend' && $action != 'editline') { + print ' ' . "\n";
+ $parameters = array();
+ $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
+ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
+
+ if (empty($reshook))
+ {
+ print 'id . '&action=edit">' . $langs->trans("Edit") . '' . "\n";
+
+ print 'id . '&action=collect">' . $langs->trans("CollectNow") . '' . "\n";
+
+ print 'id . '&action=delete">' . $langs->trans('Delete') . '' . "\n";
+ }
+ print ' ' . "\n";
+ }
+
+ // Select mail models is same action as presend
+ if (GETPOST('modelselected')) {
+ $action = 'presend';
+ }
+
+ /*
+ if ($action != 'presend') {
+ print '';
+ print ''; // ancre
+ */
+ // Documents
+ /*$objref = dol_sanitizeFileName($object->ref);
+ $relativepath = $comref . '/' . $comref . '.pdf';
+ $filedir = $conf->emailcollector->dir_output . '/' . $objref;
+ $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
+ $genallowed = $user->rights->emailcollector->read; // If you can read, you can build the PDF to read content
+ $delallowed = $user->rights->emailcollector->create; // If you can create/edit, you can remove a file on card
+ print $formfile->showdocuments('emailcollector', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
+ */
+ /*
+ // Show links to link elements
+ $linktoelem = $form->showLinkToObjectBlock($object, null, array('emailcollector'));
+ $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
+
+ print ' ';
+
+ $MAXEVENT = 10;
+
+ $morehtmlright = '';
+ $morehtmlright .= $langs->trans("SeeAll");
+ $morehtmlright .= '';
+
+ // List of actions on element
+ include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
+ $formactions = new FormActions($db);
+ $somethingshown = $formactions->showactions($object, 'emailcollector_emailcollector', $socid, 1, '', $MAXEVENT, '', $morehtmlright);
+
+ print ' '; - $nextval=$module->getNextValue($mysoc,$contract); + $nextval=$module->getNextValue($mysoc,$holiday); if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval $htmltooltip.=''.$langs->trans("NextValue").': '; if ($nextval) { diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 4914152f680..280025b3b35 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -61,7 +61,7 @@ $diroutputmassaction=$conf->admin->dir_output . '/temp/massgeneration/'.$user->i $hookmanager->initHooks(array('emailsenderprofilelist')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('emailsenderprofile'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // Default sort order (if not yet defined by previous GETPOST) if (! $sortfield) $sortfield="t.".key($object->fields); // Set here default search field. By default 1st field in definition. diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index f4c3e5b0923..2376cc58988 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -41,6 +41,7 @@ $langs->loadLangs(array("errors","admin","modulebuilder")); $mode=GETPOST('mode', 'alpha'); if (empty($mode)) $mode='common'; $action=GETPOST('action','alpha'); +//var_dump($_POST);exit; $value=GETPOST('value', 'alpha'); $page_y=GETPOST('page_y','int'); $search_keyword=GETPOST('search_keyword','alpha'); @@ -1010,8 +1011,39 @@ if ($mode == 'deploy') print ''; print ' '; diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index 66c293f2cb0..8db471855d6 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -103,7 +103,7 @@ class Documents extends DolibarrApi } $file_content=file_get_contents($original_file_osencoded); - return array('filename'=>$filename, 'content'=>base64_encode($file_content), 'encoding'=>'MIME base64 (base64_encode php function, http://php.net/manual/en/function.base64-encode.php)' ); + return array('filename'=>$filename, 'content-type' => dol_mimetype($filename), 'filesize'=>filesize($original_file), 'content'=>base64_encode($file_content), 'encoding'=>'base64' ); } @@ -224,10 +224,9 @@ class Documents extends DolibarrApi } $file_content=file_get_contents($original_file_osencoded); - return array('filename'=>$filename, 'content'=>base64_encode($file_content), 'langcode'=>$outputlangs->defaultlang, 'template'=>$templateused, 'encoding'=>'MIME base64 (base64_encode php function, http://php.net/manual/en/function.base64-encode.php)' ); + return array('filename'=>$filename, 'content-type' => dol_mimetype($filename), 'filesize'=>filesize($original_file), 'content'=>base64_encode($file_content), 'langcode'=>$outputlangs->defaultlang, 'template'=>$templateused, 'encoding'=>'base64' ); } - /** * Return the list of documents of a dedicated element (from its ID or Ref) * diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php index 4f7061aed20..40b2a9365db 100644 --- a/htdocs/asset/card.php +++ b/htdocs/asset/card.php @@ -45,7 +45,7 @@ $diroutputmassaction=$conf->asset->dir_output . '/temp/massgeneration/'.$user->i $hookmanager->initHooks(array('assetcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('asset'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // Initialize array of search criterias $search_all=trim(GETPOST("search_all",'alpha')); diff --git a/htdocs/asset/class/asset_type.class.php b/htdocs/asset/class/asset_type.class.php index 8eb915f95eb..51d76d75155 100644 --- a/htdocs/asset/class/asset_type.class.php +++ b/htdocs/asset/class/asset_type.class.php @@ -42,7 +42,7 @@ class AssetType extends CommonObject /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ - public $picto = 'group'; + public $picto = 'invoice'; /** * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe @@ -51,9 +51,9 @@ class AssetType extends CommonObject public $ismultientitymanaged = 1; /** - * @var string Asset type label - */ - public $label; + * @var string Asset type label + */ + public $label; /** @var string Accountancy code asset */ public $accountancy_code_asset; @@ -107,12 +107,14 @@ class AssetType extends CommonObject $sql.= ", accountancy_code_asset"; $sql.= ", accountancy_code_depreciation_asset"; $sql.= ", accountancy_code_depreciation_expense"; + $sql.= ", note"; $sql.= ", entity"; $sql.= ") VALUES ("; $sql.= "'".$this->db->escape($this->label)."'"; $sql.= ", '".$this->db->escape($this->accountancy_code_asset)."'"; $sql.= ", '".$this->db->escape($this->accountancy_code_depreciation_asset)."'"; $sql.= ", '".$this->db->escape($this->accountancy_code_depreciation_expense)."'"; + $sql.= ", '".$this->db->escape($this->note)."'"; $sql.= ", ".$conf->entity; $sql.= ")"; @@ -179,7 +181,8 @@ class AssetType extends CommonObject $sql.= "label = '".$this->db->escape($this->label) ."',"; $sql.= "accountancy_code_asset = '".$this->db->escape($this->accountancy_code_asset)."',"; $sql.= "accountancy_code_depreciation_asset = '".$this->db->escape($this->accountancy_code_depreciation_asset)."',"; - $sql.= "accountancy_code_depreciation_expense = '".$this->db->escape($this->accountancy_code_depreciation_expense)."'"; + $sql.= "accountancy_code_depreciation_expense = '".$this->db->escape($this->accountancy_code_depreciation_expense)."',"; + $sql.= "note = '".$this->db->escape($this->note) ."'"; $sql.= " WHERE rowid =".$this->id; $result = $this->db->query($sql); diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index fa965aade5b..431276b67a8 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -62,7 +62,7 @@ $diroutputmassaction=$conf->asset->dir_output . '/temp/massgeneration/'.$user->i $hookmanager->initHooks(array('assetlist')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('asset'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // Default sort order (if not yet defined by previous GETPOST) if (! $sortfield) $sortfield="t.".key($object->fields); // Set here default search field. By default 1st field in definition. diff --git a/htdocs/asset/type.php b/htdocs/asset/type.php index 9e06c4a765d..b8a282430cc 100644 --- a/htdocs/asset/type.php +++ b/htdocs/asset/type.php @@ -49,10 +49,13 @@ $offset = $limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; if (! $sortorder) { $sortorder="DESC"; } -if (! $sortfield) { $sortfield="d.lastname"; } +if (! $sortfield) { $sortfield="a.label"; } $label=GETPOST("label","alpha"); -$comment=GETPOST("comment"); +$accountancy_code_asset=GETPOST('accountancy_code_asset','string'); +$accountancy_code_depreciation_asset=GETPOST('accountancy_code_depreciation_asset','string'); +$accountancy_code_depreciation_expense=GETPOST('accountancy_code_depreciation_expense','string'); +$comment=GETPOST('comment','string'); // Security check $result=restrictedArea($user,'asset',$rowid,'asset_type'); @@ -259,39 +262,39 @@ if (! $rowid && $action != 'create' && $action != 'edit') print ' | ';
print ''.dol_escape_htmltag($objp->label).' | '; - print ''; + print ' | '; if (! empty($conf->accounting->enabled)) { $accountingaccount = new AccountingAccount($db); - $accountingaccount->fetch('',$object->accountancy_code_asset,1); + $accountingaccount->fetch('',$objp->accountancy_code_asset,1); - print $accountingaccount->getNomUrl(0,1,1,'',1); + print $accountingaccount->getNomUrl(0,0,0,'',0); } else { - print $object->accountancy_code_asset; + print $objp->accountancy_code_asset; } print ' | '; - print ''; + print ' | '; if (! empty($conf->accounting->enabled)) { $accountingaccount2 = new AccountingAccount($db); - $accountingaccount2->fetch('',$object->accountancy_code_depreciation_asset,1); + $accountingaccount2->fetch('',$objp->accountancy_code_depreciation_asset,1); - print $accountingaccount2->getNomUrl(0,1,1,'',1); + print $accountingaccount2->getNomUrl(0,0,0,'',0); } else { - print $object->accountancy_code_depreciation_asset; + print $objp->accountancy_code_depreciation_asset; } print ' | '; - print ''; + print ' | '; if (! empty($conf->accounting->enabled)) { $accountingaccount3 = new AccountingAccount($db); - $accountingaccount3->fetch('',$object->accountancy_code_depreciation_expense,1); + $accountingaccount3->fetch('',$objp->accountancy_code_depreciation_expense,1); - print $accountingaccount3->getNomUrl(0,1,1,'',1); + print $accountingaccount3->getNomUrl(0,0,0,'',0); } else { - print $object->accountancy_code_depreciation_expense; + print $objp->accountancy_code_depreciation_expense; } print ' | '; @@ -418,7 +421,7 @@ if ($rowid > 0) */ if ($action == 'delete') { - print $form->formconfirm($_SERVER['PHP_SELF']."?rowid=".$object->id,$langs->trans("DeleteAMemberType"),$langs->trans("ConfirmDeleteMemberType",$object->label),"confirm_delete", '',0,1); + print $form->formconfirm($_SERVER['PHP_SELF']."?rowid=".$object->id,$langs->trans("DeleteAnAssetType"),$langs->trans("ConfirmDeleteAssetType",$object->label),"confirm_delete", '',0,1); } $head = asset_type_prepare_head($object); @@ -427,14 +430,23 @@ if ($rowid > 0) $linkback = ''.$langs->trans("BackToList").''; - dol_banner_tab($object, 'rowid', $linkback); + $morehtmlref='||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '; + print $langs->trans("AccountancyCodeAsset"); + print ' | '; if (! empty($conf->accounting->enabled)) { $accountingaccount = new AccountingAccount($db); @@ -445,8 +457,12 @@ if ($rowid > 0) print $object->accountancy_code_asset; } print ' | '; + print ''; + print ' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '; + print $langs->trans("AccountancyCodeDepreciationAsset"); + print ' | '; if (! empty($conf->accounting->enabled)) { $accountingaccount2 = new AccountingAccount($db); @@ -457,8 +473,12 @@ if ($rowid > 0) print $object->accountancy_code_depreciation_asset; } print ' | '; + print ''; + print ' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '; + print $langs->trans("AccountancyCodeDepreciationExpense"); + print ' | '; if (! empty($conf->accounting->enabled)) { $accountingaccount3 = new AccountingAccount($db); @@ -468,6 +488,7 @@ if ($rowid > 0) } else { print $object->accountancy_code_depreciation_expense; } + print ' | '; print '||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Description").' | '; @@ -493,9 +514,6 @@ if ($rowid > 0) print ''; } - // Add - print ''; - // Delete if ($user->rights->asset->write) { @@ -503,234 +521,6 @@ if ($rowid > 0) } print ""; - - - // Show list of assets (nearly same code than in page list.php) - $assettypestatic=new AssetType($db); - - $now=dol_now(); - - $sql = "SELECT a.rowid, d.login, d.firstname, d.lastname, d.societe, "; - $sql.= " d.datefin,"; - $sql.= " a.fk_asset_type as type_id,"; - $sql.= " t.label as type"; - $sql.= " FROM ".MAIN_DB_PREFIX."asset as a, ".MAIN_DB_PREFIX."asset_type as t"; - $sql.= " WHERE a.fk_asset_type = t.rowid"; - $sql.= " AND a.entity IN (".getEntity('asset').")"; - $sql.= " AND t.rowid = ".$object->id; - if ($sall) - { - $sql.=natural_search(array("f.firstname","d.lastname","d.societe","d.email","d.login","d.address","d.town","d.note_public","d.note_private"), $sall); - } - if ($status != '') - { - $sql.= natural_search('d.statut', $status, 2); - } - if ($action == 'search') - { - if (GETPOST('search','alpha')) - { - $sql.= natural_search(array("d.firstname","d.lastname"), GETPOST('search','alpha')); - } - } - if (! empty($search_lastname)) - { - $sql.= natural_search(array("d.firstname","d.lastname"), $search_lastname); - } - if (! empty($search_login)) - { - $sql.= natural_search("d.login", $search_login); - } - if (! empty($search_email)) - { - $sql.= natural_search("d.email", $search_email); - } - if ($filter == 'uptodate') - { - $sql.=" AND datefin >= '".$db->idate($now)."'"; - } - if ($filter == 'outofdate') - { - $sql.=" AND datefin < '".$db->idate($now)."'"; - } - - $sql.= " ".$db->order($sortfield,$sortorder); - - // Count total nb of records - $nbtotalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) - { - $resql = $db->query($sql); - if ($resql) $nbtotalofrecords = $db->num_rows($result); - else dol_print_error($db); - if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 - { - $page = 0; - $offset = 0; - } - } - - $sql.= " ".$db->plimit($conf->liste_limit+1, $offset); - - $resql = $db->query($sql); - if ($resql) - { - $num = $db->num_rows($resql); - $i = 0; - - $titre=$langs->trans("AssetsList"); - if ($status != '') - { - if ($status == '-1,1') { $titre=$langs->trans("MembersListQualified"); } - else if ($status == '-1') { $titre=$langs->trans("MembersListToValid"); } - else if ($status == '1' && ! $filter) { $titre=$langs->trans("MembersListValid"); } - else if ($status == '1' && $filter=='uptodate') { $titre=$langs->trans("MembersListUpToDate"); } - else if ($status == '1' && $filter=='outofdate') { $titre=$langs->trans("MembersListNotUpToDate"); } - else if ($status == '0') { $titre=$langs->trans("MembersListResiliated"); } - } - elseif ($action == 'search') - { - $titre=$langs->trans("MembersListQualified"); - } - - if ($type > 0) - { - $assettype=new AssetType($db); - $result=$assettype->fetch($type); - $titre.=" (".$assettype->label.")"; - } - - $param="&rowid=".$object->id; - if (! empty($status)) $param.="&status=".$status; - if (! empty($search_lastname)) $param.="&search_lastname=".$search_lastname; - if (! empty($search_firstname)) $param.="&search_firstname=".$search_firstname; - if (! empty($search_login)) $param.="&search_login=".$search_login; - if (! empty($search_email)) $param.="&search_email=".$search_email; - if (! empty($filter)) $param.="&filter=".$filter; - - if ($sall) - { - print $langs->trans("Filter")." (".$langs->trans("Lastname").", ".$langs->trans("Firstname").", ".$langs->trans("EMail").", ".$langs->trans("Address")." ".$langs->trans("or")." ".$langs->trans("Town")."): ".$sall; - } - - print ' | '; - - print '||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '; - print ' | '; - - print ''; - print ' | '; - - print ''; - - print ' | '; - print ' | '; - - print ''; - - print ' | '; - print ''; - print ' '; - print ''; - print ' | '; - - print "||
| '.img_object($langs->trans("ShowMember"),"user").' '.$adh->getFullName($langs,0,-1,20).' / '.dol_trunc($objp->societe,12).' | '."\n"; - } - else - { - print ''.img_object($langs->trans("ShowMember"),"user").' '.$adh->getFullName($langs,0,-1,32).' | '."\n"; - } - - // Login - print "".$objp->login." | \n"; - - // Type - /*print ''; - $assettypestatic->id=$objp->type_id; - $assettypestatic->label=$objp->type; - print $assettypestatic->getNomUrl(1,12); - print ' | '; - */ - - // Moral/Physique - print "".$adh->getmorphylib($objp->morphy)." | \n"; - - // EMail - print "".dol_print_email($objp->email,0,0,1)." | \n"; - - // Statut - print ''; - print $adh->LibStatut($objp->statut,$objp->subscription,$datefin,2); - print " | "; - - // Actions - print ''; - if ($user->rights->asset->creer) - { - print 'id).'">'.img_edit().''; - } - print ' '; - if ($user->rights->asset->supprimer) - { - print ''.img_picto($langs->trans("Resiliate"),'disable.png').''; - } - print " | "; - - print "
| '.$langs->trans("MailTitle").' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("MailTitle").' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("MailFrom").' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("MailErrorsTo").' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("CustomerAbsoluteDiscountAllUsers").' | '; print ''.$remise_all.' '.$langs->trans("Currency".$conf->currency).' '.$langs->trans("HT").' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("CustomerAbsoluteDiscountMy").' | '; @@ -322,10 +322,10 @@ if ($socid > 0) { dol_print_error($db); } - + print '|||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("SupplierAbsoluteDiscountAllUsers").' | '; print ''.$remise_all.' '.$langs->trans("Currency".$conf->currency).' '.$langs->trans("HT").' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("SupplierAbsoluteDiscountMy").' | '; @@ -344,11 +344,11 @@ if ($socid > 0) print load_fiche_titre($langs->trans("NewGlobalDiscount"),'',''); print ''; - + if($isCustomer && ! $isSupplier) { print ''; } - + if(! $isCustomer && $isSupplier) { print ''; } @@ -356,8 +356,8 @@ if ($socid > 0) print '|||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans('DiscountType').' | '; - print ''; - print ' '; + print ' | '; + print ' '; print ' | |||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("AmountHT").' | '; @@ -401,7 +401,7 @@ if ($socid > 0) /* * Liste remises fixes client restant en cours (= liees a aucune facture ni ligne de facture) */ - + print load_fiche_titre($langs->trans("DiscountStillRemaining")); if($isCustomer) { @@ -424,10 +424,11 @@ if ($socid > 0) $sql.= " AND rc.discount_type = 0"; // Eliminate supplier discounts $sql.= " AND (rc.fk_facture_line IS NULL AND rc.fk_facture IS NULL)"; $sql.= " ORDER BY rc.datec DESC"; - + $resql=$db->query($sql); if ($resql) { + print '|||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Date").' | '; // Need 120+ for format with AM/PM @@ -439,9 +440,9 @@ if ($socid > 0) print ''.$langs->trans("DiscountOfferedBy").' | '; print ''; print ' |
| '.dol_print_date($db->jdate($obj->dc),'dayhour').' | '; if (preg_match('/\(CREDIT_NOTE\)/',$obj->description)) @@ -502,7 +503,7 @@ if ($socid > 0) } else print ''; print ' |
| '.$langs->trans("Date").' | '; // Need 120+ for format with AM/PM @@ -576,9 +579,9 @@ if ($socid > 0) print ''.$langs->trans("DiscountOfferedBy").' | '; print ''; print ' |
| '.dol_print_date($db->jdate($obj->dc),'dayhour').' | '; if (preg_match('/\(CREDIT_NOTE\)/',$obj->description)) @@ -639,7 +642,7 @@ if ($socid > 0) } else print ''; print ' |
| '.$langs->trans("Date").' | '; // Need 120+ for format with AM/PM @@ -747,7 +752,7 @@ if ($socid > 0) print ''.$langs->trans("Author").' | '; print ''; print ' | |||||
| '.$langs->trans("None").' | |||||||
| '.$langs->trans("Date").' | '; // Need 120+ for format with AM/PM @@ -899,7 +906,7 @@ if ($socid > 0) print ''.$langs->trans("Author").' | '; print ''; print ' | |||||
| '.$langs->trans("None").' | |||||||
| '.$langs->trans("ContributionsToPay").($num?' '.$num.'':'').' | '; + print ''.$langs->trans("ContributionsToPay").($num?' '.$num.'':'').' | '; print ''.$langs->trans("DateDue").' | '; print ''.$langs->trans("AmountTTC").' | '; print ''.$langs->trans("Paid").' | '; diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index e5ecf562c1d..e08ebb17ed1 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -773,7 +773,7 @@ else print '|||||
|---|---|---|---|---|---|---|---|---|---|
| '; - print " | ".$langs->trans("Salary")." fk_user."\">".$obj->firstname." ".$obj->lastname." | \n"; + print "".$langs->trans("Salary")." fk_user."\">".$obj->firstname." ".$obj->lastname." | \n"; if ($modecompta == 'CREANCES-DETTES') print ''.price(-$obj->amount).' | '; print ''.price(-$obj->amount).' | '; diff --git a/htdocs/compta/salaries/card.php b/htdocs/compta/salaries/card.php index f50d940a51a..76ab712bffd 100644 --- a/htdocs/compta/salaries/card.php +++ b/htdocs/compta/salaries/card.php @@ -174,7 +174,7 @@ if ($action == 'delete') if ($result >= 0) { $db->commit(); - header("Location: ".DOL_URL_ROOT.'/compta/salaries/index.php'); + header("Location: ".DOL_URL_ROOT.'/compta/salaries/list.php'); exit; } else @@ -365,7 +365,7 @@ if ($id) dol_fiche_head($head, 'card', $langs->trans("SalaryPayment"), -1, 'payment'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref='".$salstatic->getNomUrl(1)." | \n"; // Employee diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index a6c41d8c431..6a0d53d6987 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -481,7 +481,7 @@ if ($id > 0) } $morehtmlref.=''; // Type print ' | '; - $formsocialcontrib->select_type_socialcontrib($typeid,'typeid',1,0,0,'maxwidth100onsmartphone'); + $formsocialcontrib->select_type_socialcontrib($search_typeid,'search_typeid',1,0,0,'maxwidth100onsmartphone'); print ' | '; // Period end date print ''; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 4a101416886..637e1879d20 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -133,7 +133,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('contact'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( @@ -321,6 +321,7 @@ if (strlen($search_twitter)) $sql.= natural_search('p.twitter', $search_t if (strlen($search_facebook)) $sql.= natural_search('p.facebook', $search_facebook); if (strlen($search_email)) $sql.= natural_search('p.email', $search_email); if (strlen($search_zip)) $sql.= natural_search("p.zip",$search_zip); +if (strlen($search_town)) $sql.= natural_search("p.town",$search_town); if ($search_status != '' && $search_status >= 0) $sql.= " AND p.statut = ".$db->escape($search_status); if ($search_import_key) $sql.= natural_search("p.import_key",$search_import_key); if ($type == "o") // filtre sur type diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 589cf7174e6..16e343aaba8 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -2581,7 +2581,7 @@ class ContratLigne extends CommonObjectLine /** * @var float * @deprecated Use $price_ht instead - * @see price_ht + * @see $price_ht */ public $price; diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 3719e3618e6..056362bb2d2 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -100,7 +100,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('contrat'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( 'c.ref'=>'Ref', diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index a57bfd0f175..806bff48605 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -84,7 +84,7 @@ $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('contratdet'); -$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); // Security check $contratid = GETPOST('id','int'); diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 0715a78495e..61c4b636758 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -439,6 +439,10 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $object->sendtouserid = $sendtouserid; } + // TODO Set object->email_xxx properties + $object->email_msgid = $mailfile->msgid; + //... + // Call of triggers if (! empty($trigger_name)) { diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index aaacee51b50..a52a759f841 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1941,24 +1941,36 @@ class ExtraFields /** * return array_options array of data of extrafields value of object sent by a search form * - * @param array $extralabels $array of extrafields (@deprecated) - * @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names) - * @param string $keysuffix Suffix string to add into name and id of field (can be used to avoid duplicate names) - * @return array|int array_options set or 0 if no value + * @param array|string $extrafieldsobjectkey array of extrafields (old usage) or value of object->table_element (new usage) + * @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names) + * @param string $keysuffix Suffix string to add into name and id of field (can be used to avoid duplicate names) + * @return array|int array_options set or 0 if no value */ - function getOptionalsFromPost($extralabels,$keyprefix='',$keysuffix='') + function getOptionalsFromPost($extrafieldsobjectkey, $keyprefix='', $keysuffix='') { global $_POST; - if (is_array($this->attributes[$object->table_element]['label'])) $extralabels=$this->attributes[$object->table_element]['label']; + if (is_string($extrafieldsobjectkey) && is_array($this->attributes[$extrafieldsobjectkey]['label'])) + { + $extralabels = $this->attributes[$extrafieldsobjectkey]['label']; + } + else + { + $extralabels = $extrafieldsobjectkey; + } - $array_options = array(); if (is_array($extralabels)) { + $array_options = array(); + // Get extra fields foreach ($extralabels as $key => $value) { - $key_type = $this->attributes[$object->table_element]['type'][$key]; + $key_type = ''; + if (is_string($extrafieldsobjectkey)) + { + $key_type = $this->attributes[$extrafieldsobjectkey]['type'][$key]; + } if (in_array($key_type,array('date','datetime'))) { @@ -1987,8 +1999,7 @@ class ExtraFields return $array_options; } - else { - return 0; - } + + return 0; } } diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 63f4c2df804..09298fe1bff 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -132,6 +132,7 @@ class FormFile if ($maxmin > 0) { + // MAX_FILE_SIZE doit précéder le champ input de type file $out .= ''; } @@ -1017,7 +1018,7 @@ class FormFile global $form; $disablecrop=1; - if (in_array($modulepart, array('societe','product','produit','service','expensereport','holiday','member','project','ticket','user'))) $disablecrop=0; + if (in_array($modulepart, array('expensereport','holiday','member','project','product','produit','service','societe','tax','ticket','user'))) $disablecrop=0; // Define relative path used to store the file if (empty($relativepath)) @@ -1218,9 +1219,13 @@ class FormFile if (! dol_is_file($file['path'].'/'.$minifile)) $minifile=getImageFileNameForSize($file['name'], '_mini', '.png'); // For backward compatibility of old thumbs that were created with filename in lower case and with .png extension //print $file['path'].'/'.$minifile.' | '.$langs->trans("Action").' | '; print "
| '; - if ($obj->opp_status_code) print $langs->trans("OppStatusShort".$obj->opp_status_code); + if ($obj->opp_status_code) print $langs->trans("OppStatus".$obj->opp_status_code); print ' | '; // Opp percent print '';
@@ -908,7 +910,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
{
if (GETPOST('search_'.$key,'alpha')) $search[$key]=GETPOST('search_'.$key,'alpha');
}
- $search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
+ $search_array_options=$extrafields->getOptionalsFromPost($contactstatic->table_element,'','search_');
// Purge search criteria
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index b911462a0c9..5ec9e40518f 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -668,7 +668,7 @@ function dol_include_once($relpath, $classname='')
/**
- * Return path of url or filesystem. Return alternate root if exists.
+ * Return path of url or filesystem. Can check into alternate dir or alternate dir + main dir depending on value of $returnemptyifnotfound.
*
* @param string $path Relative path to file (if mode=0) or relative url (if mode=1). Ie: mydir/myfile, ../myfile
* @param int $type 0=Used for a Filesystem path, 1=Used for an URL path (output relative), 2=Used for an URL path (output full path using same host that current url), 3=Used for an URL path (output full path using host defined into $dolibarr_main_url_root of conf file)
@@ -688,7 +688,10 @@ function dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
$res = DOL_DOCUMENT_ROOT.'/'.$path; // Standard default path
foreach ($conf->file->dol_document_root as $key => $dirroot) // ex: array(["main"]=>"/home/main/htdocs", ["alt0"]=>"/home/dirmod/htdocs", ...)
{
- if ($key == 'main') continue;
+ if ($key == 'main')
+ {
+ continue;
+ }
if (file_exists($dirroot.'/'.$path))
{
$res=$dirroot.'/'.$path;
@@ -1035,6 +1038,8 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename='
}
if ($level > $conf->global->SYSLOG_LEVEL) return;
+ $message = preg_replace('/password=\'[^\']*\'/', 'password=\'hidden\'', $message); // protection to avoid to have value of password in log
+
// If adding log inside HTML page is required
if (! empty($_REQUEST['logtohtml']) && (! empty($conf->global->MAIN_ENABLE_LOG_TO_HTML) || ! empty($conf->global->MAIN_LOGTOHTML))) // MAIN_LOGTOHTML kept for backward compatibility
{
@@ -1042,7 +1047,7 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename='
}
//TODO: Remove this. MAIN_ENABLE_LOG_INLINE_HTML should be deprecated and use a log handler dedicated to HTML output
- // If enable html log tag enabled and url parameter log defined, we show output log on HTML comments
+ // If html log tag enabled and url parameter log defined, we show output log on HTML comments
if (! empty($conf->global->MAIN_ENABLE_LOG_INLINE_HTML) && ! empty($_GET["log"]))
{
print "\n\n'."\n";
@@ -448,7 +469,7 @@ if (! empty($conf->use_javascript_ajax))
-
+
diff --git a/htdocs/core/tpl/commonfields_add.tpl.php b/htdocs/core/tpl/commonfields_add.tpl.php index 4c81e50c65c..23a60d7f675 100644 --- a/htdocs/core/tpl/commonfields_add.tpl.php +++ b/htdocs/core/tpl/commonfields_add.tpl.php @@ -19,6 +19,7 @@ * $action * $conf * $langs + * $form */ // Protection to avoid direct call of template @@ -39,7 +40,7 @@ foreach($object->fields as $key => $val) // Discard if extrafield is a hidden field on form if (abs($val['visible']) != 1) continue; - if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled']) continue; // We don't want this field + if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! verifCond($val['enabled'])) continue; // We don't want this field print ' |
| fields as $key => $val) print '"'; print '>'; print $langs->trans($val['label']); + if(!empty($val['help'])){ + print $form->textwithpicto('',$langs->trans($val['help'])); + } print ' | '; print ''; if (in_array($val['type'], array('int', 'integer'))) $value = GETPOST($key, 'int'); @@ -60,4 +64,4 @@ foreach($object->fields as $key => $val) } ?> - \ No newline at end of file + diff --git a/htdocs/core/tpl/commonfields_edit.tpl.php b/htdocs/core/tpl/commonfields_edit.tpl.php index 427e9f6b894..ce41cff24d0 100644 --- a/htdocs/core/tpl/commonfields_edit.tpl.php +++ b/htdocs/core/tpl/commonfields_edit.tpl.php @@ -40,7 +40,7 @@ foreach($object->fields as $key => $val) // Discard if extrafield is a hidden field on form if (abs($val['visible']) != 1) continue; - if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled']) continue; // We don't want this field + if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! verifCond($val['enabled'])) continue; // We don't want this field print ' |