diff --git a/ChangeLog b/ChangeLog
index 9e0b301edde..62f28b9bd6e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,16 +13,17 @@ WARNING:
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* Properties ->contactid has been renamed into ->contact_id
-* Property $paiementid in API api_supplier_invoices has been renamed into into $payment_mode_id (english)
+* Property $paiementid in API 'api_supplier_invoices.php' has been renamed into into $payment_mode_id (english)
* The deprecated subsitution key __SIGNATURE__ has been removed. Replace with __USER_SIGNATURE__ if you used the old syntax in
your email templates.
* The hidden option HOLIDAY_MORE_PUBLIC_HOLIDAYS has been removed. Use instead the dictionary table if you need to define custom
days of holiday.
-* Property num_paiement has been renamed num_payment everywhere for better code consistency.
-* If you build a class that implement CommonObject to use the incoterm properties or method (->fk_incoterm, ->label_incoterm, ->location_incoterm),
- you must now also include declaration of the Trait CommonIncoterm in your class. All incoterm functions were moved into this Trait.
-* The GETPOST(..., 'alpha') has now the same behaviour than GETPOST(..., 'alphanohtml');
-
+* Property 'num_paiement' has been renamed 'num_payment' everywhere for better code consistency.
+* If you build a class that implement CommonObject to use the incoterm properties or methods (->fk_incoterm, ->label_incoterm, ->location_incoterm),
+ you must now also include declaration of the Trait 'CommonIncoterm' in your class. All incoterm functions were moved into this Trait.
+* The GETPOST(..., 'alpha') has now the same behaviour than GETPOST(..., 'alphanohtml') so no html will be allowed. Use GETPOST(..., 'restricthtml') to accept HTML.
+* If you have links in your code with '&action=delete' as a parameter, you must also add '&token='.newToken() as another parameter to avoid CSRF protection errors.
+
***** ChangeLog for 12.0.3 compared to 12.0.2 *****
FIX: 10.0 - when the mime file name is different from the filesystem name, the attachment name should be the mime filename
diff --git a/README.md b/README.md
index 19a767c8232..648d5ef003d 100644
--- a/README.md
+++ b/README.md
@@ -29,8 +29,8 @@ Other licenses apply for some included dependencies. See [COPYRIGHT](https://git
If you have low technical skills and you're looking to install Dolibarr ERP/CRM in just a few clicks, you can use one of the packaged versions:
-- [DoliWamp for Windows](https://wiki.dolibarr.org/index.php/Dolibarr_for_Windows_(DoliWamp)
-- [DoliDeb for Debian](https://wiki.dolibarr.org/index.php/Dolibarr_for_Ubuntu_or_Debian
+- [DoliWamp for Windows](https://wiki.dolibarr.org/index.php/Dolibarr_for_Windows_DoliWamp)
+- [DoliDeb for Debian](https://wiki.dolibarr.org/index.php/Dolibarr_for_Ubuntu_or_Debian)
- DoliRpm for Redhat, Fedora, OpenSuse, Mandriva or Mageia
Releases can be downloaded from [official website](https://www.dolibarr.org/).
@@ -77,8 +77,8 @@ If you don't have time to install it yourself, you can try some commercial 'read
## UPGRADING
Dolibarr supports upgrading usually wihtout the need for any (commercial) support (depending on if you use any commercial extensions) and supports upgrading all the way from any version after 2.8 without breakage. This is unique in the ERP ecosystem and a benefit our users highly appreciate!
-
-- At first make a backup of your Dolibarr files & than see https://wiki.dolibarr.org/index.php/Installation_-_Upgrade#Upgrade_Dolibarr
+
+- At first make a backup of your Dolibarr files & than [see](https://wiki.dolibarr.org/index.php/Installation_-_Upgrade#Upgrade_Dolibarr)
- Check that your installed PHP version is supported by the new version [see PHP support](./doc/phpmatrix.md).
- Overwrite all old files from 'dolibarr' directory with files provided into the new version's package.
- At first next access, Dolibarr will redirect you to the "install/" page to follow the upgrade process.
diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php
index de8fd9a8cd6..0ac79bcc3aa 100644
--- a/htdocs/accountancy/admin/account.php
+++ b/htdocs/accountancy/admin/account.php
@@ -481,11 +481,11 @@ if ($resql)
// Action
print '
';
- if ($user->admin) print ''.img_delete().'';
+ if ($user->admin) print ''.img_delete().'';
//else print ''.img_delete().''; // Some dictionary can be edited by other profile than admin
print '
';
} else print '
';
diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php
index 5ae9c3d4742..813dbd4a37f 100644
--- a/htdocs/accountancy/bookkeeping/list.php
+++ b/htdocs/accountancy/bookkeeping/list.php
@@ -630,9 +630,9 @@ else $buttonLabel = $langs->trans("ExportList");
// Button re-export
if (!empty($conf->global->ACCOUNTING_REEXPORT)) {
- $newcardbutton = ''.img_picto($langs->trans("Activated"), 'switch_on').' ';
+ $newcardbutton = ''.img_picto($langs->trans("Activated"), 'switch_on').' ';
} else {
- $newcardbutton = ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ $newcardbutton = ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
}
$newcardbutton .= ''.$langs->trans("IncludeDocsAlreadyExported").'';
diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php
index 4dd5df83152..7062c25b108 100644
--- a/htdocs/accountancy/journal/bankjournal.php
+++ b/htdocs/accountancy/journal/bankjournal.php
@@ -180,10 +180,10 @@ if ($result) {
$account_supplier = (($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER != "") ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : 'NotDefined'); // NotDefined is a reserved word
$account_customer = (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER != "") ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : 'NotDefined'); // NotDefined is a reserved word
$account_employee = (!empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) ? $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT : 'NotDefined'); // NotDefined is a reserved word
- $account_pay_vat = (!empty($conf->global->ACCOUNTING_VAT_PAY_ACCOUNT) ? $conf->global->ACCOUNTING_VAT_PAY_ACCOUNT : 'NotDefined'); // NotDefined is a reserved word
- $account_pay_donation = (!empty($conf->global->DONATION_ACCOUNTINGACCOUNT) ? $conf->global->DONATION_ACCOUNTINGACCOUNT : 'NotDefined'); // NotDefined is a reserved word
- $account_pay_subscription = (!empty($conf->global->ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT) ? $conf->global->ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT : 'NotDefined'); // NotDefined is a reserved word
- $account_transfer = (!empty($conf->global->ACCOUNTING_ACCOUNT_TRANSFER_CASH) ? $conf->global->ACCOUNTING_ACCOUNT_TRANSFER_CASH : 'NotDefined'); // NotDefined is a reserved word
+ $account_pay_vat = (!empty($conf->global->ACCOUNTING_VAT_PAY_ACCOUNT) ? $conf->global->ACCOUNTING_VAT_PAY_ACCOUNT : 'NotDefined'); // NotDefined is a reserved word
+ $account_pay_donation = (!empty($conf->global->DONATION_ACCOUNTINGACCOUNT) ? $conf->global->DONATION_ACCOUNTINGACCOUNT : 'NotDefined'); // NotDefined is a reserved word
+ $account_pay_subscription = (!empty($conf->global->ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT) ? $conf->global->ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT : 'NotDefined'); // NotDefined is a reserved word
+ $account_transfer = (!empty($conf->global->ACCOUNTING_ACCOUNT_TRANSFER_CASH) ? $conf->global->ACCOUNTING_ACCOUNT_TRANSFER_CASH : 'NotDefined'); // NotDefined is a reserved word
$tabcompany = array();
$tabuser = array();
@@ -237,7 +237,7 @@ if ($result) {
);
// Set accountancy code for user
- $compta_user = (!empty($obj->accountancy_code) ? $obj->accountancy_code : $account_employee);
+ $compta_user = (!empty($obj->accountancy_code) ? $obj->accountancy_code : '');
$tabuser[$obj->rowid] = array(
'id' => $obj->userid,
diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php
index 64f16f8ef57..d030c73f530 100644
--- a/htdocs/adherents/admin/website.php
+++ b/htdocs/adherents/admin/website.php
@@ -137,12 +137,12 @@ print ''.$langs->trans("BlankSubscriptionFormDesc").
$enabledisablehtml = $langs->trans("EnablePublicSubscriptionForm").' ';
if (empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
// Button off, click to enable
- $enabledisablehtml .= '';
+ $enabledisablehtml .= '';
$enabledisablehtml .= img_picto($langs->trans("Disabled"), 'switch_off');
$enabledisablehtml .= '';
} else {
// Button on, click to disable
- $enabledisablehtml .= '';
+ $enabledisablehtml .= '';
$enabledisablehtml .= img_picto($langs->trans("Activated"), 'switch_on');
$enabledisablehtml .= '';
}
diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php
index 0a32398f307..d0a67153209 100644
--- a/htdocs/adherents/card.php
+++ b/htdocs/adherents/card.php
@@ -1694,7 +1694,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Delete
if ($user->rights->adherent->supprimer) {
- print '
';
- if ($user->admin) print ''.img_delete().'';
+ if ($user->admin) print ''.img_delete().'';
//else print ''.img_delete().''; // Some dictionary can be edited by other profile than admin
print '
';
diff --git a/htdocs/admin/ecm_directories_extrafields.php b/htdocs/admin/ecm_directories_extrafields.php
new file mode 100644
index 00000000000..71029c0fc67
--- /dev/null
+++ b/htdocs/admin/ecm_directories_extrafields.php
@@ -0,0 +1,123 @@
+
+ * Copyright (C) 2003 Jean-Louis Bergamo
+ * Copyright (C) 2004-2013 Laurent Destailleur
+ * Copyright (C) 2012 Regis Houssin
+ * Copyright (C) 2012 Florian Henry
+ * Copyright (C) 2013 Philippe Grand
+ * Copyright (C) 2015 Claudio Aschieri
+ * Copyright (C) 2020 Frédéric France
+ *
+ * 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 .
+ */
+
+/**
+ * \file htdocs/admin/ecm_directories_extrafields.php
+ * \ingroup ecm
+ * \brief Page to setup extra fields of ecm
+ */
+
+require '../main.inc.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/ecm.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
+
+
+if (!$user->admin)
+ accessforbidden();
+
+// Load translation files required by the page
+$langs->loadLangs(array('admin', 'other', 'ecm'));
+
+
+$extrafields = new ExtraFields($db);
+$form = new Form($db);
+
+// List of supported format
+$tmptype2label = ExtraFields::$type2label;
+$type2label = array('');
+foreach ($tmptype2label as $key => $val) {
+ $type2label[$key] = $langs->transnoentitiesnoconv($val);
+}
+
+$action = GETPOST('action', 'aZ09');
+$attrname = GETPOST('attrname', 'alpha');
+$elementtype = 'ecm_directories'; //Must be the $table_element of the class that manage extrafield
+
+if (!$user->admin) {
+ accessforbidden();
+}
+
+
+/*
+ * Actions
+ */
+
+require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
+
+
+/*
+ * View
+ */
+
+$textobject = $langs->transnoentitiesnoconv("ECM");
+
+llxHeader('', $langs->trans("ECMSetup"));
+
+$linkback = ''.$langs->trans("BackToModuleList").'';
+print load_fiche_titre($langs->trans("ECMSetup"), $linkback, 'title_setup');
+print " \n";
+
+$head = ecm_admin_prepare_head();
+
+dol_fiche_head($head, 'attributes_ecm_directories', $langs->trans("ECM"), -1, 'ecm');
+
+require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
+
+dol_fiche_end();
+
+
+// Buttons
+if ($action != 'create' && $action != 'edit') {
+ print '
";
+}
+
+
+/* ************************************************************************** */
+/* */
+/* Creation of an optional field */
+/* */
+/* ************************************************************************** */
+
+if ($action == 'create') {
+ print ' ';
+ print load_fiche_titre($langs->trans('NewAttribute'));
+ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
+}
+
+/* ************************************************************************** */
+/* */
+/* Edition of an optional field */
+/* */
+/* ************************************************************************** */
+if ($action == 'edit' && !empty($attrname)) {
+ print " ";
+ print load_fiche_titre($langs->trans("FieldEdition", $attrname));
+ require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
+}
+
+// End of page
+llxFooter();
+$db->close();
diff --git a/htdocs/admin/ecm_files_extrafields.php b/htdocs/admin/ecm_files_extrafields.php
new file mode 100644
index 00000000000..9d747d4f684
--- /dev/null
+++ b/htdocs/admin/ecm_files_extrafields.php
@@ -0,0 +1,123 @@
+
+ * Copyright (C) 2003 Jean-Louis Bergamo
+ * Copyright (C) 2004-2013 Laurent Destailleur
+ * Copyright (C) 2012 Regis Houssin
+ * Copyright (C) 2012 Florian Henry
+ * Copyright (C) 2013 Philippe Grand
+ * Copyright (C) 2015 Claudio Aschieri
+ * Copyright (C) 2020 Frédéric France
+ *
+ * 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 .
+ */
+
+/**
+ * \file htdocs/admin/ecm_files_extrafields.php
+ * \ingroup ecm
+ * \brief Page to setup extra fields of ecm
+ */
+
+require '../main.inc.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/ecm.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
+
+
+if (!$user->admin)
+ accessforbidden();
+
+// Load translation files required by the page
+$langs->loadLangs(array('admin', 'other', 'ecm'));
+
+
+$extrafields = new ExtraFields($db);
+$form = new Form($db);
+
+// List of supported format
+$tmptype2label = ExtraFields::$type2label;
+$type2label = array('');
+foreach ($tmptype2label as $key => $val) {
+ $type2label[$key] = $langs->transnoentitiesnoconv($val);
+}
+
+$action = GETPOST('action', 'aZ09');
+$attrname = GETPOST('attrname', 'alpha');
+$elementtype = 'ecm_files'; //Must be the $table_element of the class that manage extrafield
+
+if (!$user->admin) {
+ accessforbidden();
+}
+
+
+/*
+ * Actions
+ */
+
+require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
+
+
+/*
+ * View
+ */
+
+$textobject = $langs->transnoentitiesnoconv("ECM");
+
+llxHeader('', $langs->trans("ECMSetup"));
+
+$linkback = ''.$langs->trans("BackToModuleList").'';
+print load_fiche_titre($langs->trans("ECMSetup"), $linkback, 'title_setup');
+print " \n";
+
+$head = ecm_admin_prepare_head();
+
+dol_fiche_head($head, 'attributes_ecm_files', $langs->trans("ECM"), -1, 'ecm');
+
+require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
+
+dol_fiche_end();
+
+
+// Buttons
+if ($action != 'create' && $action != 'edit') {
+ print '
';
}
diff --git a/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php b/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php
index bd0808aa8b5..43fd48e3ef0 100644
--- a/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php
+++ b/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php
@@ -144,7 +144,7 @@ if (empty($user->socid)) {
}
if ($user->rights->societe->contact->supprimer) {
- print 'control->tpl['id'].'&action=delete&canvas='.$canvas.'">'.$langs->trans('Delete').'';
+ print 'control->tpl['id'].'&action=delete&token='.newToken().'&canvas='.$canvas.'">'.$langs->trans('Delete').'';
}
print ' ';
diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php
index 8428b257fac..e4e7ecaf5fb 100644
--- a/htdocs/contact/card.php
+++ b/htdocs/contact/card.php
@@ -1392,7 +1392,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
foreach ($object->cacheprospectstatus as $key => $val) {
$titlealt = 'default';
if (!empty($val['code']) && !in_array($val['code'], array('ST_NO', 'ST_NEVER', 'ST_TODO', 'ST_PEND', 'ST_DONE'))) $titlealt = $val['label'];
- if ($object->stcomm_id != $val['id']) print 'id.'&stcomm='.$val['code'].'&action=setstcomm">'.img_action($titlealt, $val['code'], $val['picto']).'';
+ if ($object->stcomm_id != $val['id']) print 'id.'&stcomm='.$val['code'].'&action=setstcomm&token='.newToken().'">'.img_action($titlealt, $val['code'], $val['picto']).'';
}
print '';
@@ -1526,7 +1526,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
// Delete
if ($user->rights->societe->contact->supprimer)
{
- print ''.$langs->trans('Delete').'';
+ print ''.$langs->trans('Delete').'';
}
}
diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php
index 0c2c3bf56ce..8ea6ebea0d4 100644
--- a/htdocs/contact/class/contact.class.php
+++ b/htdocs/contact/class/contact.class.php
@@ -60,6 +60,29 @@ class Contact extends CommonObject
*/
public $picto = 'contact';
+ /**
+ * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
+ * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
+ * 'label' the translation key.
+ * 'enabled' is a condition when the field must be managed.
+ * 'position' is the sort order of field.
+ * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
+ * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
+ * 'noteditable' says if field is not editable (1 or 0)
+ * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created.
+ * 'index' if we want an index in database.
+ * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...).
+ * 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
+ * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8).
+ * 'css' is the CSS style to use on field. For example: 'maxwidth200'
+ * 'help' is a string visible as a tooltip on field
+ * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record
+ * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code.
+ * 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel")
+ * 'comment' is not used. You can store here any text of your choice. It is not used by application.
+ *
+ * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor.
+ */
// BEGIN MODULEBUILDER PROPERTIES
/**
@@ -69,38 +92,38 @@ class Contact extends CommonObject
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10),
'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>15),
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>20),
- 'fk_soc' =>array('type'=>'integer', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'position'=>25),
- 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>30, 'index'=>1),
- 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>0, 'position'=>35),
- 'civility' =>array('type'=>'varchar(6)', 'label'=>'Civility', 'enabled'=>1, 'visible'=>-1, 'position'=>40),
- 'lastname' =>array('type'=>'varchar(50)', 'label'=>'Lastname', 'enabled'=>1, 'visible'=>-1, 'position'=>45, 'showoncombobox'=>1),
- 'firstname' =>array('type'=>'varchar(50)', 'label'=>'Firstname', 'enabled'=>1, 'visible'=>-1, 'position'=>50, 'showoncombobox'=>1),
+ 'fk_soc' =>array('type'=>'integer', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>1, 'position'=>25, 'searchall'=>1),
+ 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>3, 'notnull'=>1, 'position'=>30, 'index'=>1),
+ 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>3, 'position'=>35),
+ 'civility' =>array('type'=>'varchar(6)', 'label'=>'Civility', 'enabled'=>1, 'visible'=>3, 'position'=>40),
+ 'lastname' =>array('type'=>'varchar(50)', 'label'=>'Lastname', 'enabled'=>1, 'visible'=>1, 'position'=>45, 'showoncombobox'=>1, 'searchall'=>1),
+ 'firstname' =>array('type'=>'varchar(50)', 'label'=>'Firstname', 'enabled'=>1, 'visible'=>1, 'position'=>50, 'showoncombobox'=>1, 'searchall'=>1),
'address' =>array('type'=>'varchar(255)', 'label'=>'Address', 'enabled'=>1, 'visible'=>-1, 'position'=>55),
- 'zip' =>array('type'=>'varchar(25)', 'label'=>'Zip', 'enabled'=>1, 'visible'=>-1, 'position'=>60),
- 'town' =>array('type'=>'text', 'label'=>'Town', 'enabled'=>1, 'visible'=>-1, 'position'=>65),
- 'fk_departement' =>array('type'=>'integer', 'label'=>'Fk departement', 'enabled'=>1, 'visible'=>-1, 'position'=>70),
- 'fk_pays' =>array('type'=>'integer', 'label'=>'Fk pays', 'enabled'=>1, 'visible'=>-1, 'position'=>75),
- 'birthday' =>array('type'=>'date', 'label'=>'Birthday', 'enabled'=>1, 'visible'=>-1, 'position'=>80),
+ 'zip' =>array('type'=>'varchar(25)', 'label'=>'Zip', 'enabled'=>1, 'visible'=>1, 'position'=>60),
+ 'town' =>array('type'=>'text', 'label'=>'Town', 'enabled'=>1, 'visible'=>1, 'position'=>65),
+ 'fk_departement' =>array('type'=>'integer', 'label'=>'Fk departement', 'enabled'=>1, 'visible'=>3, 'position'=>70),
+ 'fk_pays' =>array('type'=>'integer', 'label'=>'Fk pays', 'enabled'=>1, 'visible'=>3, 'position'=>75),
+ 'birthday' =>array('type'=>'date', 'label'=>'Birthday', 'enabled'=>1, 'visible'=>3, 'position'=>80),
'poste' =>array('type'=>'varchar(80)', 'label'=>'PostOrFunction', 'enabled'=>1, 'visible'=>-1, 'position'=>85),
- 'phone' =>array('type'=>'varchar(30)', 'label'=>'Phone', 'enabled'=>1, 'visible'=>-1, 'position'=>90),
- 'phone_perso' =>array('type'=>'varchar(30)', 'label'=>'Phone perso', 'enabled'=>1, 'visible'=>-1, 'position'=>95),
- 'phone_mobile' =>array('type'=>'varchar(30)', 'label'=>'Phone mobile', 'enabled'=>1, 'visible'=>-1, 'position'=>100),
- 'fax' =>array('type'=>'varchar(30)', 'label'=>'Fax', 'enabled'=>1, 'visible'=>-1, 'position'=>105),
- 'email' =>array('type'=>'varchar(255)', 'label'=>'Email', 'enabled'=>1, 'visible'=>-1, 'position'=>110),
- 'socialnetworks' =>array('type'=>'text', 'label'=>'SocialNetworks', 'enabled'=>1, 'visible'=>-1, 'position'=>115),
- 'photo' =>array('type'=>'varchar(255)', 'label'=>'Photo', 'enabled'=>1, 'visible'=>-1, 'position'=>170),
- 'priv' =>array('type'=>'smallint(6)', 'label'=>'Private', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>175),
- 'fk_stcomm' =>array('type'=>'integer', 'label'=>'Fk stcommcontact', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>220),
+ 'phone' =>array('type'=>'varchar(30)', 'label'=>'Phone', 'enabled'=>1, 'visible'=>1, 'position'=>90, 'searchall'=>1),
+ 'phone_perso' =>array('type'=>'varchar(30)', 'label'=>'PhonePerso', 'enabled'=>1, 'visible'=>1, 'position'=>95, 'searchall'=>1),
+ 'phone_mobile' =>array('type'=>'varchar(30)', 'label'=>'PhoneMobile', 'enabled'=>1, 'visible'=>1, 'position'=>100, 'searchall'=>1),
+ 'fax' =>array('type'=>'varchar(30)', 'label'=>'Fax', 'enabled'=>1, 'visible'=>1, 'position'=>105, 'searchall'=>1),
+ 'email' =>array('type'=>'varchar(255)', 'label'=>'Email', 'enabled'=>1, 'visible'=>1, 'position'=>110, 'searchall'=>1),
+ 'socialnetworks' =>array('type'=>'text', 'label'=>'SocialNetworks', 'enabled'=>1, 'visible'=>3, 'position'=>115),
+ 'photo' =>array('type'=>'varchar(255)', 'label'=>'Photo', 'enabled'=>1, 'visible'=>3, 'position'=>170),
+ 'priv' =>array('type'=>'smallint(6)', 'label'=>'ContactVisibility', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>175),
+ 'fk_stcommcontact' =>array('type'=>'integer', 'label'=>'Fk stcommcontact', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>220),
'fk_prospectlevel' =>array('type'=>'varchar(12)', 'label'=>'ProspectLevel', 'enabled'=>1, 'visible'=>-1, 'position'=>255),
- 'no_email' =>array('type'=>'smallint(6)', 'label'=>'No email', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>180),
- 'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'position'=>185),
- 'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-1, 'position'=>190),
- 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>195),
- 'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>200),
- 'default_lang' =>array('type'=>'varchar(6)', 'label'=>'Default lang', 'enabled'=>1, 'visible'=>-1, 'position'=>205),
- 'canvas' =>array('type'=>'varchar(32)', 'label'=>'Canvas', 'enabled'=>1, 'visible'=>-1, 'position'=>210),
- 'statut' =>array('type'=>'tinyint(4)', 'label'=>'Statut', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500),
- 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000),
+ 'no_email' =>array('type'=>'smallint(6)', 'label'=>'No_Email', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>180),
+ 'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>3, 'position'=>185),
+ 'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>3, 'position'=>190),
+ 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>3, 'position'=>195, 'searchall'=>1),
+ 'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>3, 'position'=>200, 'searchall'=>1),
+ 'default_lang' =>array('type'=>'varchar(6)', 'label'=>'Default lang', 'enabled'=>1, 'visible'=>3, 'position'=>205),
+ 'canvas' =>array('type'=>'varchar(32)', 'label'=>'Canvas', 'enabled'=>1, 'visible'=>3, 'position'=>210),
+ 'statut' =>array('type'=>'tinyint(4)', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>500),
+ 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-1, 'position'=>1000),
);
public $civility_id; // In fact we store civility_code
@@ -228,16 +251,22 @@ class Contact extends CommonObject
global $conf, $langs;
$this->db = $db;
-
- if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0;
- if (empty($conf->mailing->enabled)) $this->fields['no_email']['enabled'] = 0;
- if (!empty($conf->global->SOCIETE_DISABLE_CONTACTS)) $this->fields['thirdparty']['enabled'] = 0;
- if (empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)) { // Default behaviour
- $this->field['fk_stcomm']['enabled'] = 0;
- $this->field['fk_prospectlevel']['enabled'] = 0;
- }
$this->statut = 1; // By default, status is enabled
+ if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) $this->fields['rowid']['visible'] = 0;
+ if (empty($conf->mailing->enabled)) $this->fields['no_email']['enabled'] = 0;
+
+ // typical ['s.nom'] is used for third-parties
+ if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) {
+ $this->fields['fk_soc']['enabled'] = 0;
+ $this->fields['fk_soc']['searchall'] = 0;
+ }
+
+ if (empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)) { // Default behaviour
+ $this->field['fk_stcommcontact']['enabled'] = 0;
+ $this->field['fk_prospectcontactlevel']['enabled'] = 0;
+ }
+
// Unset fields that are disabled
foreach ($this->fields as $key => $val)
{
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index 0f4f01a0916..531fb885f63 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -149,44 +149,45 @@ $extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
// List of fields to search into when doing a "search in all"
-$fieldstosearchall = array(
- 'p.lastname'=>'Lastname',
- 'p.firstname'=>'Firstname',
- 'p.email'=>'EMail',
- 's.nom'=>"ThirdParty",
- 'p.phone'=>"Phone",
- 'p.phone_perso'=>"PhonePerso",
- 'p.phone_mobile'=>"PhoneMobile",
- 'p.fax'=>"Fax",
- 'p.note_public'=>"NotePublic",
- 'p.note_private'=>"NotePrivate",
-);
+$fieldstosearchall = array();
+foreach ($object->fields as $key => $val)
+{
+ // don't allow search in private notes for external users when doing "search in all"
+ if (!empty($user->socid) && $key == "note_private") {
+ continue;
+ }
+
+ if (empty($val['searchall'])) {
+ continue;
+ }
+
+ $fieldstosearchall['p.'.$key] = $val['label'];
+}
+
+// Add none object fields for "search in all"
+if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) {
+ $fieldstosearchall['s.nom'] = "ThirdParty";
+}
// Definition of fields for list
-$arrayfields = array(
- 'p.rowid'=>array('label'=>"TechnicalID", 'position'=>1, 'checked'=>($conf->global->MAIN_SHOW_TECHNICAL_ID ? 1 : 0), 'enabled'=>($conf->global->MAIN_SHOW_TECHNICAL_ID ? 1 : 0)),
- 'p.lastname'=>array('label'=>"Lastname", 'position'=>2, 'checked'=>1),
- 'p.firstname'=>array('label'=>"Firstname", 'position'=>3, 'checked'=>1),
- 'p.poste'=>array('label'=>"PostOrFunction", 'position'=>10, 'checked'=>1),
- 'p.town'=>array('label'=>"Town", 'position'=>20, 'checked'=>0),
- 'p.zip'=>array('label'=>"Zip", 'position'=>21, 'checked'=>0),
- 'country.code_iso'=>array('label'=>"Country", 'position'=>22, 'checked'=>0),
- 'p.phone'=>array('label'=>"Phone", 'position'=>30, 'checked'=>1),
- 'p.phone_perso'=>array('label'=>"PhonePerso", 'position'=>31, 'checked'=>0),
- 'p.phone_mobile'=>array('label'=>"PhoneMobile", 'position'=>32, 'checked'=>1),
- 'p.fax'=>array('label'=>"Fax", 'position'=>33, 'checked'=>0),
- 'p.email'=>array('label'=>"EMail", 'position'=>40, 'checked'=>1),
- 'p.no_email'=>array('label'=>"No_Email", 'position'=>41, 'checked'=>0, 'enabled'=>(!empty($conf->mailing->enabled))),
- 'p.thirdparty'=>array('label'=>"ThirdParty", 'position'=>50, 'checked'=>1, 'enabled'=>empty($conf->global->SOCIETE_DISABLE_CONTACTS)),
- 'p.priv'=>array('label'=>"ContactVisibility", 'checked'=>1, 'position'=>200),
- 'p.datec'=>array('label'=>"DateCreationShort", 'checked'=>0, 'position'=>500),
- 'p.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
- 'p.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
- 'p.import_key'=>array('label'=>"ImportId", 'checked'=>0, 'position'=>1100),
-);
-if (!empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)) {
- $arrayfields['p.fk_prospectcontactlevel'] = array('label'=>"ProspectLevelShort", 'checked'=>1, 'position'=>210);
- $arrayfields['p.fk_stcommcontact'] = array('label'=>"StatusProsp", 'checked'=>1, 'position'=>215);
+$arrayfields = array();
+foreach ($object->fields as $key => $val) {
+ // If $val['visible']==0, then we never show the field
+ if (empty($val['visible'])) {
+ continue;
+ }
+
+ $arrayfields['p.'.$key] = array(
+ 'label'=>$val['label'],
+ 'checked'=>(($val['visible'] < 0) ? 0 : 1),
+ 'enabled'=>($val['enabled'] && ($val['visible'] != 3)),
+ 'position'=>$val['position']);
+}
+
+// Add none object fields to fields for list
+$arrayfields['country.code_iso'] = array('label'=>"Country", 'position'=>22, 'checked'=>0);
+if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) {
+ $arrayfields['s.nom'] = array('label'=>"ThirdParty", 'position'=>25, 'checked'=>1);
}
if (!empty($conf->socialnetworks->enabled)) {
@@ -200,6 +201,7 @@ if (!empty($conf->socialnetworks->enabled)) {
}
}
}
+
// Extra fields
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0)
{
@@ -395,10 +397,10 @@ if (strlen($search_phone)) $sql .= natural_search(array('p.phone', 'p.p
if (strlen($search_cti)) $sql .= natural_search(array('p.phone', 'p.phone_perso', 'p.phone_mobile'), $search_cti);
if (strlen($search_firstlast_only)) $sql .= natural_search(array('p.lastname', 'p.firstname'), $search_firstlast_only);
-if ($search_id > 0) $sql .= natural_search("p.rowid", $search_id, 1);
+if ($search_id > 0) $sql .= natural_search('p.rowid', $search_id, 1);
if ($search_lastname) $sql .= natural_search('p.lastname', $search_lastname);
if ($search_firstname) $sql .= natural_search('p.firstname', $search_firstname);
-if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
+if ($search_societe) $sql .= natural_search(empty($conf->global->SOCIETE_DISABLE_CONTACTS) ? 's.nom' : 'p.fk_soc', $search_societe);
if ($search_country) $sql .= " AND p.fk_pays IN (".$search_country.')';
if (strlen($search_poste)) $sql .= natural_search('p.poste', $search_poste);
if (strlen($search_phone_perso)) $sql .= natural_search('p.phone_perso', $search_phone_perso);
@@ -721,7 +723,7 @@ if (!empty($conf->socialnetworks->enabled)) {
}
}
}
-if (!empty($arrayfields['p.thirdparty']['checked']))
+if (!empty($arrayfields['p.fk_soc']['checked']) || !empty($arrayfields['s.nom']['checked']))
{
print '
';
}
diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php
index 98e936a2d7a..c2f0a314445 100644
--- a/htdocs/core/actions_massactions.inc.php
+++ b/htdocs/core/actions_massactions.inc.php
@@ -3,7 +3,7 @@
* Copyright (C) 2018 Nicolas ZABOURI
* Copyright (C) 2018 Juanjo Menent
* Copyright (C) 2019 Ferran Marcet
- * Copyright (C) 2019 Frédéric France
+ * Copyright (C) 2019 Frédéric France
*
* 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
@@ -615,7 +615,7 @@ if ($massaction == 'confirm_createbills') // Create bills from orders
$cmd->fetch_optionals();
$objecttmp->socid = $cmd->socid;
- $objecttmp->type = Facture::TYPE_STANDARD;
+ $objecttmp->type = $objecttmp::TYPE_STANDARD;
$objecttmp->cond_reglement_id = $cmd->cond_reglement_id;
$objecttmp->mode_reglement_id = $cmd->mode_reglement_id;
$objecttmp->fk_project = $cmd->fk_project;
@@ -742,7 +742,7 @@ if ($massaction == 'confirm_createbills') // Create bills from orders
'HT',
0,
$product_type,
- $ii,
+ $lines[$i]->rang,
$lines[$i]->special_code,
$objecttmp->origin,
$lines[$i]->rowid,
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 46567edf369..3ea4bba4a7f 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -7152,7 +7152,7 @@ abstract class CommonObject
$return .= ''.img_picto($langs->trans("Resize"), 'resize', '').' ';
// Link to delete
- $return .= 'id.'&action=delete&file='.urlencode($pdir.$viewfilename).'">';
+ $return .= 'id.'&action=delete&token='.newToken().'&file='.urlencode($pdir.$viewfilename).'">';
$return .= img_delete().'';
}
}
@@ -7178,7 +7178,7 @@ abstract class CommonObject
$return .= ''.img_picto($langs->trans("Resize"), 'resize', '').' ';
// Link to delete
- $return .= 'id.'&action=delete&file='.urlencode($pdir.$viewfilename).'">';
+ $return .= 'id.'&action=delete&token='.newToken().'&file='.urlencode($pdir.$viewfilename).'">';
$return .= img_delete().'';
}
}
diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php
index c1d11c9290b..934c8d424a4 100644
--- a/htdocs/core/class/hookmanager.class.php
+++ b/htdocs/core/class/hookmanager.class.php
@@ -137,7 +137,7 @@ class HookManager
* @param array $parameters Array of parameters
* @param Object $object Object to use hooks on
* @param string $action Action code on calling page ('create', 'edit', 'view', 'add', 'update', 'delete'...)
- * @return mixed For 'addreplace' hooks (doActions,formObjectOptions,pdf_xxx,...): Return 0 if we want to keep standard actions, >0 if we want to stop/replace standard actions, <0 if KO. Things to print are returned into ->resprints and set into ->resPrint. Things to return are returned into ->results by hook and set into ->resArray for caller.
+ * @return mixed For 'addreplace' hooks (doActions, formConfirm, formObjectOptions, pdf_xxx,...): Return 0 if we want to keep standard actions, >0 if we want to stop/replace standard actions, <0 if KO. Things to print are returned into ->resprints and set into ->resPrint. Things to return are returned into ->results by hook and set into ->resArray for caller.
* For 'output' hooks (printLeftBlock, formAddObjectLine, formBuilddocOptions, ...): Return 0, <0 if KO. Things to print are returned into ->resprints and set into ->resPrint. Things to return are returned into ->results by hook and set into ->resArray for caller.
* All types can also return some values into an array ->results that will be finaly merged into this->resArray for caller.
* $this->error or this->errors are also defined by class called by this function if error.
@@ -149,7 +149,8 @@ class HookManager
$parameters['context'] = join(':', $this->contextarray);
//dol_syslog(get_class($this).'::executeHooks method='.$method." action=".$action." context=".$parameters['context']);
- // Define type of hook ('output' or 'addreplace'). Type 'returnvalue' is deprecated because a 'addreplace' hook can also return resPrint and resArray).
+ // Define type of hook ('output' or 'addreplace').
+ // TODO Remove hooks with type 'output'. All hooks must be converted into 'addreplace' hooks.
$hooktype = 'output';
if (in_array(
$method,
@@ -171,6 +172,7 @@ class HookManager
'formattachOptions',
'formBuilddocLineOptions',
'formatNotificationMessage',
+ 'formConfirm',
'getAccessForbiddenMessage',
'getDirList',
'getFormMail',
@@ -215,11 +217,6 @@ class HookManager
)
)) $hooktype = 'addreplace';
- if ($method == 'insertExtraFields') {
- $hooktype = 'returnvalue'; // @deprecated. TODO Remove all code with "executeHooks('insertExtraFields'" as soon as there is a trigger available.
- dol_syslog("Warning: The hook 'insertExtraFields' is deprecated and must not be used. Use instead trigger on CRUD event (ask it to dev team if not implemented)", LOG_WARNING);
- }
-
// Init return properties
$this->resPrint = ''; $this->resArray = array(); $this->resNbOfHooks = 0;
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index e00d544ed22..84960b21832 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -647,7 +647,7 @@ class Form
$disabled = 0;
$ret = '
';
- $ret .= '
\n";
-}
-
-// Mode liste
-if (($action != 'create' && $action != 'add') && !$error) {
- llxHeader();
- ?>
-
- rights->societe->client->voir && !$socid)
- $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
- $sql .= ' WHERE c.entity = '.$conf->entity;
- $sql .= ' AND c.fk_soc = s.rowid';
-
- // Show orders we can bill
- if (empty($conf->global->SUPPLIER_ORDER_TO_INVOICE_STATUS))
- {
- $sql .= " AND c.fk_statut IN (".$db->sanitize($db->escape(CommandeFournisseur::STATUS_RECEIVED_COMPLETELY)).")"; // Must match filter in htdocs/fourn/card.php
- } else {
- // CommandeFournisseur::STATUS_ORDERSENT.", ".CommandeFournisseur::STATUS_RECEIVED_PARTIALLY.", ".CommandeFournisseur::STATUS_RECEIVED_COMPLETELY
- $sql .= " AND c.fk_statut IN (".$db->sanitize($db->escape($conf->global->SUPPLIER_ORDER_TO_INVOICE_STATUS)).")";
- }
-
- $sql .= " AND c.billed = 0";
-
- // Find order that are not already invoiced
- //No need due to the billed status
- //$sql .= " AND c.rowid NOT IN (SELECT fk_source FROM " . MAIN_DB_PREFIX . "element_element WHERE targettype='invoice_supplier')";
-
- if ($socid)
- $sql .= ' AND s.rowid = '.$socid;
- if (!$user->rights->societe->client->voir && !$socid)
- $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
- if ($sref) {
- $sql .= natural_search("c.ref", $sref);
- }
- if ($sall) {
- $sql .= natural_search(array("c.ref", "c.note"), $sall);
- }
-
- // Date filter
- //$sql.= dolSqlDateFilter("c.date_commande", GETPOST("date_startday", 'int'), GETPOST("date_startmonth", 'int'), GETPOST("date_startyear", 'int'));
- //$sql.= dolSqlDateFilter("c.date_livraison", $search_deliveryday, $search_deliverymonth, $search_deliveryyear);
- if ($date_start)
- $sql .= " AND c.date_commande >= '".$db->idate($date_start)."'";
- if ($date_end)
- $sql .= " AND c.date_commande <= '".$db->idate($date_end)."'";
- if ($date_starty)
- $sql .= " AND c.date_livraison >= '".$db->idate($date_starty)."'";
- if ($date_endy)
- $sql .= " AND c.date_livraison <= '".$db->idate($date_endy)."'";
-
- if (!empty($sref_client)) {
- $sql .= natural_search('c.ref_supplier', $sref_client);
- }
- $sql .= ' ORDER BY '.$sortfield.' '.$sortorder;
- dol_syslog('fourn/commande/ordertoinvoice.php sql='.$sql);
- $resql = $db->query($sql);
-
- if ($resql) {
- if ($socid) {
- $soc = new Societe($db);
- $soc->fetch($socid);
- }
- $title = $langs->trans('ListOfSupplierOrders');
- $title .= ' - '.$langs->trans('StatusOrderReceivedAllShort');
- $title .= ' - '.$soc->getNomUrl(1, 'supplier');
-
- $num = $db->num_rows($resql);
-
- print load_fiche_titre($title);
-
- $i = 0;
- $period = $html->selectDate($date_start, 'date_start', 0, 0, 1, '', 1, 0).' - '.$html->selectDate($date_end, 'date_end', 0, 0, 1, '', 1, 0);
- $periodely = $html->selectDate($date_starty, 'date_start_dely', 0, 0, 1, '', 1, 0).' - '.$html->selectDate($date_endy, 'date_end_dely', 0, 0, 1, '', 1, 0);
-
- print '';
-
- $db->free($resql);
- } else {
- dol_print_error($db);
- }
-}
-
-dol_htmloutput_mesg($mesg, $mesgs);
-
-// End of page
-llxFooter();
-$db->close();
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index 9470e408b70..b0f178c6fc4 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -2345,7 +2345,7 @@ if ($action == 'create')
{
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteBill'), $langs->trans('ConfirmDeleteBill'), 'confirm_delete', '', 0, 1);
}
- if ($action == 'deletepaiement')
+ if ($action == 'deletepayment')
{
$payment_id = GETPOST('paiement_id');
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&paiement_id='.$payment_id, $langs->trans('DeletePayment'), $langs->trans('ConfirmDeletePayment'), 'confirm_delete_paiement', '', 0, 1);
@@ -2789,7 +2789,7 @@ if ($action == 'create')
print '
';
}
diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php
index bcae66ca5bf..88141debfad 100644
--- a/htdocs/hrm/index.php
+++ b/htdocs/hrm/index.php
@@ -3,7 +3,7 @@
* Copyright (C) 2013-2015 Laurent Destailleur
* Copyright (C) 2012-2014 Regis Houssin
* Copyright (C) 2015-2016 Alexandre Spangaro
- * Copyright (C) 2019 Nicolas ZABOURI
+ * Copyright (C) 2019 Nicolas ZABOURI
*
* 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
@@ -35,6 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
if ($conf->deplacement->enabled) require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php';
if ($conf->expensereport->enabled) require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
+require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentcandidature.class.php';
require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
$hookmanager = new HookManager($db);
@@ -52,6 +53,7 @@ if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INF
$holiday = new Holiday($db);
$holidaystatic = new Holiday($db);
+$staticrecruitmentcandidature = new RecruitmentCandidature($db);
$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
@@ -173,7 +175,8 @@ print '
';
// Latest leave requests
if (!empty($conf->holiday->enabled) && $user->rights->holiday->read)
{
- $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.photo, u.statut, x.rowid, x.rowid as ref, x.fk_type, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.tms as dm, x.statut as status";
+ $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.photo, u.statut as user_status,";
+ $sql .= " x.rowid, x.rowid as ref, x.fk_type, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.tms as dm, x.statut as status";
$sql .= " FROM ".MAIN_DB_PREFIX."holiday as x, ".MAIN_DB_PREFIX."user as u";
$sql .= " WHERE u.rowid = x.fk_user";
$sql .= " AND x.entity = ".$conf->entity;
@@ -203,8 +206,7 @@ if (!empty($conf->holiday->enabled) && $user->rights->holiday->read)
print '
';
@@ -1213,10 +1213,10 @@ if ($step == 5 && $datatoimport)
$nboflines = $obj->import_get_nb_of_lines($conf->import->dir_temp.'/'.$filetoimport);
- $param = '&leftmenu=import&format='.$format.'&datatoimport='.$datatoimport.'&filetoimport='.urlencode($filetoimport).'&nboflines='.$nboflines.'&separator='.urlencode($separator).'&enclosure='.urlencode($enclosure);
+ $param = '&leftmenu=import&format='.urlencode($format).'&datatoimport='.urlencode($datatoimport).'&filetoimport='.urlencode($filetoimport).'&nboflines='.urlencode($nboflines).'&separator='.urlencode($separator).'&enclosure='.urlencode($enclosure);
$param2 = $param; // $param2 = $param without excludefirstline and endatlinenb
- if ($excludefirstline) $param .= '&excludefirstline='.$excludefirstline;
- if ($endatlinenb) $param .= '&endatlinenb='.$endatlinenb;
+ if ($excludefirstline) $param .= '&excludefirstline='.urlencode($excludefirstline);
+ if ($endatlinenb) $param .= '&endatlinenb='.urlencode($endatlinenb);
if (!empty($updatekeys)) $param .= '&updatekeys[]='.implode('&updatekeys[]=', $updatekeys);
llxHeader('', $langs->trans("NewImport"), 'EN:Module_Imports_En|FR:Module_Imports|ES:Módulo_Importaciones');
@@ -1642,9 +1642,9 @@ if ($step == 6 && $datatoimport)
$nboflines = (!empty($_GET["nboflines"]) ? $_GET["nboflines"] : dol_count_nb_of_line($conf->import->dir_temp.'/'.$filetoimport));
- $param = '&format='.$format.'&datatoimport='.$datatoimport.'&filetoimport='.urlencode($filetoimport).'&nboflines='.$nboflines;
- if ($excludefirstline) $param .= '&excludefirstline='.$excludefirstline;
- if ($endatlinenb) $param .= '&endatlinenb='.$endatlinenb;
+ $param = '&format='.$format.'&datatoimport='.urlencode($datatoimport).'&filetoimport='.urlencode($filetoimport).'&nboflines='.urlencode($nboflines);
+ if ($excludefirstline) $param .= '&excludefirstline='.urlencode($excludefirstline);
+ if ($endatlinenb) $param .= '&endatlinenb='.urlencode($endatlinenb);
if ($separator) $param .= '&separator='.urlencode($separator);
if ($enclosure) $param .= '&enclosure='.urlencode($enclosure);
diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql
index e76948808bb..ffce6b110dc 100644
--- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql
+++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql
@@ -105,28 +105,28 @@ ALTER TABLE llx_c_incoterms ADD COLUMN label varchar(100) NULL;
CREATE TABLE llx_recruitment_recruitmentjobposition(
- rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
- ref varchar(128) DEFAULT '(PROV)' NOT NULL,
- entity INTEGER DEFAULT 1 NOT NULL,
- label varchar(255) NOT NULL,
- qty integer DEFAULT 1 NOT NULL,
- fk_soc integer,
- fk_project integer,
- fk_user_recruiter integer,
- fk_user_supervisor integer,
- fk_establishment integer,
- date_planned date,
- remuneration_suggested varchar(255),
- description text,
- note_public text,
- note_private text,
- date_creation datetime NOT NULL,
- tms timestamp,
- fk_user_creat integer NOT NULL,
- fk_user_modif integer,
- last_main_doc varchar(255),
- import_key varchar(14),
- model_pdf varchar(255),
+ rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
+ ref varchar(128) DEFAULT '(PROV)' NOT NULL,
+ entity INTEGER DEFAULT 1 NOT NULL,
+ label varchar(255) NOT NULL,
+ qty integer DEFAULT 1 NOT NULL,
+ fk_soc integer,
+ fk_project integer,
+ fk_user_recruiter integer,
+ fk_user_supervisor integer,
+ fk_establishment integer,
+ date_planned date,
+ remuneration_suggested varchar(255),
+ description text,
+ note_public text,
+ note_private text,
+ date_creation datetime NOT NULL,
+ tms timestamp,
+ fk_user_creat integer NOT NULL,
+ fk_user_modif integer,
+ last_main_doc varchar(255),
+ import_key varchar(14),
+ model_pdf varchar(255),
status smallint NOT NULL
) ENGINE=innodb;
@@ -160,24 +160,24 @@ CREATE TABLE llx_recruitment_recruitmentcandidature(
-- BEGIN MODULEBUILDER FIELDS
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
entity integer NOT NULL DEFAULT 1,
- fk_recruitmentjobposition INTEGER NULL,
- ref varchar(128) DEFAULT '(PROV)' NOT NULL,
- description text,
- note_public text,
- note_private text,
- date_creation datetime NOT NULL,
- tms timestamp,
- fk_user_creat integer NOT NULL,
- fk_user_modif integer,
- import_key varchar(14),
- model_pdf varchar(255),
- status smallint NOT NULL,
- firstname varchar(128),
+ fk_recruitmentjobposition INTEGER NULL,
+ ref varchar(128) DEFAULT '(PROV)' NOT NULL,
+ description text,
+ note_public text,
+ note_private text,
+ date_creation datetime NOT NULL,
+ tms timestamp,
+ fk_user_creat integer NOT NULL,
+ fk_user_modif integer,
+ import_key varchar(14),
+ model_pdf varchar(255),
+ status smallint NOT NULL,
+ firstname varchar(128),
lastname varchar(128),
email varchar(255),
phone varchar(64),
date_birth date,
- remuneration_requested integer,
+ remuneration_requested integer,
remuneration_proposed integer,
email_msgid varchar(255),
fk_recruitment_origin INTEGER NULL
@@ -272,8 +272,8 @@ ALTER TABLE llx_recruitment_recruitmentcandidature ADD UNIQUE INDEX uk_recruitme
ALTER TABLE llx_product MODIFY COLUMN seuil_stock_alerte float;
ALTER TABLE llx_product MODIFY COLUMN desiredstock float;
-ALTER TABLE llx_product_warehouse_properties MODIFY COLUMN seuil_stock_alerte float;
-ALTER TABLE llx_product_warehouse_properties MODIFY COLUMN desiredstock float;
+ALTER TABLE llx_product_warehouse_properties MODIFY COLUMN seuil_stock_alerte float;
+ALTER TABLE llx_product_warehouse_properties MODIFY COLUMN desiredstock float;
ALTER TABLE llx_product ADD COLUMN fk_state integer DEFAULT NULL;
@@ -330,3 +330,25 @@ ALTER TABLE llx_bank ADD COLUMN origin_type varchar(64) NULL;
ALTER TABLE llx_bank ADD COLUMN import_key varchar(14);
ALTER TABLE llx_menu MODIFY COLUMN enabled text;
+
+CREATE TABLE llx_ecm_files_extrafields
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ tms timestamp,
+ fk_object integer NOT NULL,
+ import_key varchar(14) -- import key
+) ENGINE=innodb;
+
+ALTER TABLE llx_ecm_files_extrafields ADD INDEX idx_ecm_files_extrafields (fk_object);
+
+CREATE TABLE llx_ecm_directories_extrafields
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ tms timestamp,
+ fk_object integer NOT NULL,
+ import_key varchar(14) -- import key
+) ENGINE=innodb;
+
+ALTER TABLE llx_ecm_directories_extrafields ADD INDEX idx_ecm_directories_extrafields (fk_object);
+ALTER TABLE llx_website_page ADD COLUMN object_type varchar(255);
+ALTER TABLE llx_website_page ADD COLUMN fk_object varchar(255);
diff --git a/htdocs/install/mysql/tables/llx_ecm_directories_extrafields.key.sql b/htdocs/install/mysql/tables/llx_ecm_directories_extrafields.key.sql
new file mode 100644
index 00000000000..a84fa2c845c
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_ecm_directories_extrafields.key.sql
@@ -0,0 +1,20 @@
+-- ===================================================================
+-- Copyright (C) 2020 Frédéric France
+--
+-- 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 .
+--
+-- ===================================================================
+
+
+ALTER TABLE llx_ecm_directories_extrafields ADD INDEX idx_ecm_directories_extrafields (fk_object);
diff --git a/htdocs/install/mysql/tables/llx_ecm_directories_extrafileds.sql b/htdocs/install/mysql/tables/llx_ecm_directories_extrafileds.sql
new file mode 100644
index 00000000000..e2e496267ba
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_ecm_directories_extrafileds.sql
@@ -0,0 +1,26 @@
+-- ========================================================================
+-- Copyright (C) 2020 Frédéric France
+--
+-- 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 .
+--
+-- ========================================================================
+
+CREATE TABLE llx_ecm_directories_extrafields
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ tms timestamp,
+ fk_object integer NOT NULL,
+ import_key varchar(14) -- import key
+) ENGINE=innodb;
+
diff --git a/htdocs/install/mysql/tables/llx_ecm_files_extrafields.key.sql b/htdocs/install/mysql/tables/llx_ecm_files_extrafields.key.sql
new file mode 100644
index 00000000000..3ebd3712184
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_ecm_files_extrafields.key.sql
@@ -0,0 +1,20 @@
+-- ===================================================================
+-- Copyright (C) 2020 Frédéric France
+--
+-- 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 .
+--
+-- ===================================================================
+
+
+ALTER TABLE llx_ecm_files_extrafields ADD INDEX idx_ecm_files_extrafields (fk_object);
diff --git a/htdocs/install/mysql/tables/llx_ecm_files_extrafields.sql b/htdocs/install/mysql/tables/llx_ecm_files_extrafields.sql
new file mode 100644
index 00000000000..0cf0de6d375
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_ecm_files_extrafields.sql
@@ -0,0 +1,26 @@
+-- ========================================================================
+-- Copyright (C) 2020 Frédéric France
+--
+-- 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 .
+--
+-- ========================================================================
+
+CREATE TABLE llx_ecm_files_extrafields
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ tms timestamp,
+ fk_object integer NOT NULL,
+ import_key varchar(14) -- import key
+) ENGINE=innodb;
+
diff --git a/htdocs/install/mysql/tables/llx_website_page.sql b/htdocs/install/mysql/tables/llx_website_page.sql
index bacbc8e802b..e2bec4a8a24 100644
--- a/htdocs/install/mysql/tables/llx_website_page.sql
+++ b/htdocs/install/mysql/tables/llx_website_page.sql
@@ -39,5 +39,7 @@ CREATE TABLE llx_website_page
author_alias varchar(64),
date_creation datetime,
tms timestamp,
- import_key varchar(14) -- import key
+ import_key varchar(14), -- import key
+ object_type varchar(255),
+ fk_object varchar(255)
) ENGINE=innodb;
diff --git a/htdocs/langs/am_ET/propal.lang b/htdocs/langs/am_ET/propal.lang
index 273996ab1b1..95085002f66 100644
--- a/htdocs/langs/am_ET/propal.lang
+++ b/htdocs/langs/am_ET/propal.lang
@@ -85,3 +85,7 @@ ProposalCustomerSignature=Written acceptance, company stamp, date and signature
ProposalsStatisticsSuppliers=Vendor proposals statistics
CaseFollowedBy=Case followed by
SignedOnly=Signed only
+IdProposal=Proposal ID
+IdProduct=Product ID
+PrParentLine=Proposal Parent Line
+LineBuyPriceHT=Buy Price Amount net of tax for line
diff --git a/htdocs/langs/de_DE/propal.lang b/htdocs/langs/de_DE/propal.lang
index 78e3e09a746..0956cf4900f 100644
--- a/htdocs/langs/de_DE/propal.lang
+++ b/htdocs/langs/de_DE/propal.lang
@@ -85,3 +85,7 @@ ProposalCustomerSignature=Bei Beauftragung: Name in Klarschrift, Ort, Datum, Unt
ProposalsStatisticsSuppliers=Statistik Lieferantenanfragen
CaseFollowedBy=Fall gefolgt von
SignedOnly=nur signiert
+IdProposal=Angebots-ID
+IdProduct=Produkt ID
+PrParentLine=Übergeordnete Zeile des Vorschlags
+LineBuyPriceHT=Kaufpreis Betrag abzüglich Steuern für Linie
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 241848a594a..1e64a5bfd04 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -71,7 +71,7 @@ DisableJavascriptNote=Note: For test or debug purpose. For optimization for blin
UseSearchToSelectCompanyTooltip=Also if you have a large number of third parties (> 100 000), you can increase speed by setting constant COMPANY_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string.
UseSearchToSelectContactTooltip=Also if you have a large number of third parties (> 100 000), you can increase speed by setting constant CONTACT_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string.
DelaiedFullListToSelectCompany=Wait until a key is pressed before loading content of Third Parties combo list. This may increase performance if you have a large number of third parties, but it is less convenient.
-DelaiedFullListToSelectContact=Wait until a key is pressed before loading content of Contact combo list. This may increase performance if you have a large number of contacts, but it is less convenient)
+DelaiedFullListToSelectContact=Wait until a key is pressed before loading content of Contact combo list. This may increase performance if you have a large number of contacts, but it is less convenient.
NumberOfKeyToSearch=Number of characters to trigger search: %s
NumberOfBytes=Number of Bytes
SearchString=Search string
@@ -555,8 +555,6 @@ Module57Name=Payments by Direct Debit
Module57Desc=Management of Direct Debit orders. It includes generation of SEPA file for European countries.
Module58Name=ClickToDial
Module58Desc=Integration of a ClickToDial system (Asterisk, ...)
-Module59Name=Bookmark4u
-Module59Desc=Add function to generate Bookmark4u account from a Dolibarr account
Module60Name=Stickers
Module60Desc=Management of stickers
Module70Name=Interventions
diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang
index aff922c4c23..4ab87aa8420 100644
--- a/htdocs/langs/en_US/agenda.lang
+++ b/htdocs/langs/en_US/agenda.lang
@@ -14,7 +14,7 @@ EventsNb=Number of events
ListOfActions=List of events
EventReports=Event reports
Location=Location
-ToUserOfGroup=Event assigned to any user in group
+ToUserOfGroup=Event assigned to any user in the group
EventOnFullDay=Event on all day(s)
MenuToDoActions=All incomplete events
MenuDoneActions=All terminated events
diff --git a/htdocs/langs/en_US/ecm.lang b/htdocs/langs/en_US/ecm.lang
index 369ac6dfdfa..aaf81b0f346 100644
--- a/htdocs/langs/en_US/ecm.lang
+++ b/htdocs/langs/en_US/ecm.lang
@@ -50,3 +50,6 @@ ReSyncListOfDir=Resync list of directories
HashOfFileContent=Hash of file content
NoDirectoriesFound=No directories found
FileNotYetIndexedInDatabase=File not yet indexed into database (try to re-upload it)
+ExtraFieldsEcmFiles=Extrafields Ecm Files
+ExtraFieldsEcmDirectories=Extrafields Ecm Directories
+ECMSetup=ECM Setup
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index 0289b381b23..427a5a80d45 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -371,6 +371,7 @@ MulticurrencyPaymentAmount=Payment amount, original currency
MulticurrencyAmountHT=Amount (excl. tax), original currency
MulticurrencyAmountTTC=Amount (inc. of tax), original currency
MulticurrencyAmountVAT=Amount tax, original currency
+MulticurrencySubPrice=Amount sub price multi currency
AmountLT1=Amount tax 2
AmountLT2=Amount tax 3
AmountLT1ES=Amount RE
@@ -1094,4 +1095,4 @@ PublicVendorName=Public name of vendor
DateOfBirth=Date of birth
SecurityTokenHasExpiredSoActionHasBeenCanceledPleaseRetry=Security token has expired, so action has been canceled. Please try again.
UpToDate=Up-to-date
-OutOfDate=Out-of-date
\ No newline at end of file
+OutOfDate=Out-of-date
diff --git a/htdocs/langs/en_US/propal.lang b/htdocs/langs/en_US/propal.lang
index c68574d9ae2..557df2f840f 100644
--- a/htdocs/langs/en_US/propal.lang
+++ b/htdocs/langs/en_US/propal.lang
@@ -84,3 +84,8 @@ ProposalCustomerSignature=Written acceptance, company stamp, date and signature
ProposalsStatisticsSuppliers=Vendor proposals statistics
CaseFollowedBy=Case followed by
SignedOnly=Signed only
+IdProposal=Proposal ID
+IdProduct=Product ID
+PrParentLine=Proposal Parent Line
+LineBuyPriceHT=Buy Price Amount net of tax for line
+
diff --git a/htdocs/langs/en_US/receiptprinter.lang b/htdocs/langs/en_US/receiptprinter.lang
index 83a003f388d..284c4fa61fa 100644
--- a/htdocs/langs/en_US/receiptprinter.lang
+++ b/htdocs/langs/en_US/receiptprinter.lang
@@ -54,7 +54,7 @@ DOL_DOUBLE_WIDTH=Double width size
DOL_DEFAULT_HEIGHT_WIDTH=Default height and width size
DOL_UNDERLINE=Enable underline
DOL_UNDERLINE_DISABLED=Disable underline
-DOL_BEEP=Beed sound
+DOL_BEEP=Beep sound
DOL_PRINT_TEXT=Print text
DateInvoiceWithTime=Invoice date and time
YearInvoice=Invoice year
diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang
index e6f9e612a59..cf370fbdca0 100644
--- a/htdocs/langs/en_US/ticket.lang
+++ b/htdocs/langs/en_US/ticket.lang
@@ -31,10 +31,8 @@ TicketDictType=Ticket - Types
TicketDictCategory=Ticket - Groupes
TicketDictSeverity=Ticket - Severities
TicketDictResolution=Ticket - Resolution
-TicketTypeShortBUGSOFT=Dysfonctionnement logiciel
-TicketTypeShortBUGHARD=Dysfonctionnement matériel
-TicketTypeShortCOM=Commercial question
+TicketTypeShortCOM=Commercial question
TicketTypeShortHELP=Request for functionnal help
TicketTypeShortISSUE=Issue, bug or problem
TicketTypeShortREQUEST=Change or enhancement request
diff --git a/htdocs/langs/fr_FR/propal.lang b/htdocs/langs/fr_FR/propal.lang
index 03981e2b17d..64199c5248d 100644
--- a/htdocs/langs/fr_FR/propal.lang
+++ b/htdocs/langs/fr_FR/propal.lang
@@ -98,3 +98,7 @@ ConfirmMassValidationQuestion = Voulez-vous confirmer la validation des devis br
ConfirmMassSignatureQuestion = Voulez-vous confirmer la signature des devis ouvert selectionnés ?
PropNoProductOrService = devis ne contient pas de produits ni de services
PropsNoProductOrService = devis ne contiennent pas de produits ni de services
+IdProposal=ID de proposition
+IdProduct=ID produit
+PrParentLine=Ligne parent de proposition
+LineBuyPriceHT=Prix d'achat Montant net de taxe pour la ligne
diff --git a/htdocs/langs/ja_JP/propal.lang b/htdocs/langs/ja_JP/propal.lang
index d2065e007a3..373ac4a2ce2 100644
--- a/htdocs/langs/ja_JP/propal.lang
+++ b/htdocs/langs/ja_JP/propal.lang
@@ -85,3 +85,7 @@ ProposalCustomerSignature=承諾書、会社印、日付、署名
ProposalsStatisticsSuppliers=Vendor proposals statistics
CaseFollowedBy=Case followed by
SignedOnly=Signed only
+IdProposal=提案番号
+IdProduct=製品番号
+PrParentLine=提案親ライン
+LineBuyPriceHT=購入価格ラインの税控除後の金額
diff --git a/htdocs/langs/ko_KR/propal.lang b/htdocs/langs/ko_KR/propal.lang
index 93708eb0955..26a86464f91 100644
--- a/htdocs/langs/ko_KR/propal.lang
+++ b/htdocs/langs/ko_KR/propal.lang
@@ -85,3 +85,7 @@ ProposalCustomerSignature=Written acceptance, company stamp, date and signature
ProposalsStatisticsSuppliers=Vendor proposals statistics
CaseFollowedBy=Case followed by
SignedOnly=Signed only
+IdProposal=Proposal ID
+IdProduct=Product ID
+PrParentLine=Proposal Parent Line
+LineBuyPriceHT=Buy Price Amount net of tax for line
diff --git a/htdocs/langs/vi_VN/propal.lang b/htdocs/langs/vi_VN/propal.lang
index 2a99f2a5577..a9e808d9f5a 100644
--- a/htdocs/langs/vi_VN/propal.lang
+++ b/htdocs/langs/vi_VN/propal.lang
@@ -85,3 +85,7 @@ ProposalCustomerSignature=Văn bản chấp nhận, dấu công ty, ngày và ch
ProposalsStatisticsSuppliers=Thống kê đề xuất nhà cung cấp
CaseFollowedBy=Theo bởi trường hợp
SignedOnly=Signed only
+IdProposal=ID đề xuất
+IdProduct=ID sản phẩm
+PrParentLine=Dòng mẹ đề xuất
+LineBuyPriceHT=Giá mua Số lượng ròng của thuế cho dòng
diff --git a/htdocs/langs/zh_CN/propal.lang b/htdocs/langs/zh_CN/propal.lang
index 2c782854e14..79d10f5e2ba 100644
--- a/htdocs/langs/zh_CN/propal.lang
+++ b/htdocs/langs/zh_CN/propal.lang
@@ -85,3 +85,7 @@ ProposalCustomerSignature=书面接受,公司盖章,日期和签名
ProposalsStatisticsSuppliers=Vendor proposals statistics
CaseFollowedBy=Case followed by
SignedOnly=Signed only
+IdProposal=提案编号
+IdProduct=产品编号
+PrParentLine=提案父行
+LineBuyPriceHT=购买价格扣除税额
diff --git a/htdocs/livraison/card.php b/htdocs/livraison/card.php
index 80594338ba1..2a1646a5d80 100644
--- a/htdocs/livraison/card.php
+++ b/htdocs/livraison/card.php
@@ -658,9 +658,9 @@ if ($action == 'create') // Create. Seems to no be used
{
if ($conf->expedition_bon->enabled)
{
- print ''.$langs->trans("Delete").'';
+ print ''.$langs->trans("Delete").'';
} else {
- print ''.$langs->trans("Delete").'';
+ print ''.$langs->trans("Delete").'';
}
}
diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php
index 157bdbd53b8..1c4116b34c2 100644
--- a/htdocs/loan/card.php
+++ b/htdocs/loan/card.php
@@ -752,13 +752,13 @@ if ($id > 0)
// Classify 'paid'
if (($object->paid == 0 || $object->paid == 2) && round($staytopay) <= 0 && $user->rights->loan->write)
{
- print '
";
}
@@ -750,7 +750,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS))
{
print img_picto($langs->trans("Default"), 'on');
} else {
- print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'';
+ print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'';
}
print '';
diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php
index c1c59bcd3b7..db38e3c02d7 100644
--- a/htdocs/projet/card.php
+++ b/htdocs/projet/card.php
@@ -1324,7 +1324,7 @@ if ($action == 'create' && $user->rights->projet->creer)
{
if ($userDelete > 0 || ($object->statut == 0 && $user->rights->projet->creer))
{
- print ''.$langs->trans("Delete").'';
+ print ''.$langs->trans("Delete").'';
} else {
print ''.$langs->trans('Delete').'';
}
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index 30a2a0c242b..cc7e57a89df 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -150,6 +150,66 @@ class Project extends CommonObject
*/
public $lines;
+ /**
+ * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
+ * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
+ * 'label' the translation key.
+ * 'enabled' is a condition when the field must be managed.
+ * 'position' is the sort order of field.
+ * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
+ * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
+ * 'noteditable' says if field is not editable (1 or 0)
+ * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created.
+ * 'index' if we want an index in database.
+ * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...).
+ * 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
+ * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8).
+ * 'css' is the CSS style to use on field. For example: 'maxwidth200'
+ * 'help' is a string visible as a tooltip on field
+ * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record
+ * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code.
+ * 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel")
+ * 'comment' is not used. You can store here any text of your choice. It is not used by application.
+ *
+ * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor.
+ */
+
+ // BEGIN MODULEBUILDER PROPERTIES
+ /**
+ * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
+ */
+ public $fields=array(
+ 'rowid' =>array('type'=>'integer', 'label'=>'ID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10),
+ 'fk_soc' =>array('type'=>'integer', 'label'=>'Fk soc', 'enabled'=>1, 'visible'=>3, 'position'=>15),
+ 'datec' =>array('type'=>'datetime', 'label'=>'DateCreationShort', 'enabled'=>1, 'visible'=>1, 'position'=>20),
+ 'tms' =>array('type'=>'timestamp', 'label'=>'DateModificationShort', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>25),
+ 'dateo' =>array('type'=>'date', 'label'=>'DateStart', 'enabled'=>1, 'visible'=>1, 'position'=>30),
+ 'datee' =>array('type'=>'date', 'label'=>'DateEnd', 'enabled'=>1, 'visible'=>1, 'position'=>35),
+ 'ref' =>array('type'=>'varchar(50)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'showoncombobox'=>1, 'position'=>40, 'searchall'=>1),
+ 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>3, 'notnull'=>1, 'position'=>45),
+ 'title' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>50, 'showoncombobox'=>1, 'searchall'=>1),
+ 'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>3, 'position'=>55, 'searchall'=>1),
+ 'fk_user_creat' =>array('type'=>'integer', 'label'=>'Fk user creat', 'enabled'=>1, 'visible'=>3, 'notnull'=>1, 'position'=>60),
+ 'public' =>array('type'=>'integer', 'label'=>'Visibility', 'enabled'=>1, 'visible'=>1, 'position'=>65),
+ 'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>500),
+ 'fk_opp_status' =>array('type'=>'integer', 'label'=>'OpportunityStatusShort', 'enabled'=>1, 'visible'=>1, 'position'=>75),
+ 'opp_percent' =>array('type'=>'double(5,2)', 'label'=>'OpportunityProbabilityShort', 'enabled'=>1, 'visible'=>1, 'position'=>80),
+ 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>3, 'position'=>85, 'searchall'=>1),
+ 'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>3, 'position'=>90, 'searchall'=>1),
+ 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>3, 'position'=>95),
+ 'budget_amount' =>array('type'=>'double(24,8)', 'label'=>'Budget', 'enabled'=>1, 'visible'=>1, 'position'=>100),
+ 'date_close' =>array('type'=>'datetime', 'label'=>'Date close', 'enabled'=>1, 'visible'=>3, 'position'=>105),
+ 'fk_user_close' =>array('type'=>'integer', 'label'=>'Fk user close', 'enabled'=>1, 'visible'=>3, 'position'=>110),
+ 'opp_amount' =>array('type'=>'double(24,8)', 'label'=>'OpportunityAmountShort', 'enabled'=>1, 'visible'=>1, 'position'=>115),
+ 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>3, 'position'=>120),
+ 'fk_user_modif' =>array('type'=>'integer', 'label'=>'Fk user modif', 'enabled'=>1, 'visible'=>3, 'position'=>125),
+ 'usage_bill_time' =>array('type'=>'integer', 'label'=>'UsageBillTimeShort', 'enabled'=>1, 'visible'=>1, 'position'=>130),
+ 'usage_opportunity' =>array('type'=>'integer', 'label'=>'UsageOpportunity', 'enabled'=>1, 'visible'=>1, 'position'=>135),
+ 'usage_task' =>array('type'=>'integer', 'label'=>'UsageTasks', 'enabled'=>1, 'visible'=>1, 'position'=>140),
+ 'usage_organize_event' =>array('type'=>'integer', 'label'=>'Usage organize event', 'enabled'=>1, 'visible'=>3, 'position'=>145),
+ );
+ // END MODULEBUILDER PROPERTIES
+
/**
* Draft status
*/
@@ -165,40 +225,6 @@ class Project extends CommonObject
*/
const STATUS_CLOSED = 2;
-
- public $fields = array(
- 'rowid' =>array('type'=>'integer', 'label'=>'ID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10),
- 'fk_soc' =>array('type'=>'integer', 'label'=>'Fk soc', 'enabled'=>1, 'visible'=>-1, 'position'=>15),
- 'datec' =>array('type'=>'datetime', 'label'=>'Datec', 'enabled'=>1, 'visible'=>-1, 'position'=>20),
- 'tms' =>array('type'=>'timestamp', 'label'=>'Tms', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>25),
- 'dateo' =>array('type'=>'date', 'label'=>'Dateo', 'enabled'=>1, 'visible'=>-1, 'position'=>30),
- 'datee' =>array('type'=>'date', 'label'=>'Datee', 'enabled'=>1, 'visible'=>-1, 'position'=>35),
- 'ref' =>array('type'=>'varchar(50)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'showoncombobox'=>1, 'position'=>40),
- 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>45),
- 'title' =>array('type'=>'varchar(255)', 'label'=>'Title', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>50, 'showoncombobox'=>1),
- 'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>55),
- 'fk_user_creat' =>array('type'=>'integer', 'label'=>'Fk user creat', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>60),
- 'public' =>array('type'=>'integer', 'label'=>'Public', 'enabled'=>1, 'visible'=>-1, 'position'=>65),
- 'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Fk statut', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500),
- 'fk_opp_status' =>array('type'=>'integer', 'label'=>'Fk opp status', 'enabled'=>1, 'visible'=>-1, 'position'=>75),
- 'opp_percent' =>array('type'=>'double(5,2)', 'label'=>'Opp percent', 'enabled'=>1, 'visible'=>-1, 'position'=>80),
- 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>85),
- 'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>90),
- 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>95),
- 'budget_amount' =>array('type'=>'double(24,8)', 'label'=>'Budget amount', 'enabled'=>1, 'visible'=>-1, 'position'=>100),
- 'date_close' =>array('type'=>'datetime', 'label'=>'Date close', 'enabled'=>1, 'visible'=>-1, 'position'=>105),
- 'fk_user_close' =>array('type'=>'integer', 'label'=>'Fk user close', 'enabled'=>1, 'visible'=>-1, 'position'=>110),
- 'opp_amount' =>array('type'=>'double(24,8)', 'label'=>'Opp amount', 'enabled'=>1, 'visible'=>-1, 'position'=>115),
- 'email_msgid' => array('type'=>'varchar(255)', 'label'=>'EmailMsgID', 'visible'=>-2, 'enabled'=>1, 'position'=>540, 'notnull'=>-1, 'help'=>'EmailMsgIDDesc'),
- 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-1, 'position'=>120),
- 'fk_user_modif' =>array('type'=>'integer', 'label'=>'Fk user modif', 'enabled'=>1, 'visible'=>-1, 'position'=>125),
- 'usage_bill_time' =>array('type'=>'integer', 'label'=>'Usage bill time', 'enabled'=>1, 'visible'=>-1, 'position'=>130),
- 'usage_opportunity' =>array('type'=>'integer', 'label'=>'Usage opportunity', 'enabled'=>1, 'visible'=>-1, 'position'=>135),
- 'usage_task' =>array('type'=>'integer', 'label'=>'Usage task', 'enabled'=>1, 'visible'=>-1, 'position'=>140),
- 'usage_organize_event' =>array('type'=>'integer', 'label'=>'Usage organize event', 'enabled'=>1, 'visible'=>-1, 'position'=>145),
- );
-
-
/**
* Constructor
*
@@ -210,6 +236,22 @@ class Project extends CommonObject
$this->statuts_short = array(0 => 'Draft', 1 => 'Opened', 2 => 'Closed');
$this->statuts_long = array(0 => 'Draft', 1 => 'Opened', 2 => 'Closed');
+
+ global $conf;
+
+ if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) $this->fields['rowid']['visible'] = 0;
+
+ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
+ $this->fields['fk_opp_status']['enabled'] = 0;
+ $this->fields['opp_percent']['enabled'] = 0;
+ $this->fields['opp_amount']['enabled'] = 0;
+ $this->fields['usage_opportunity']['enabled'] = 0;
+ }
+
+ if (empty($conf->global->PROJECT_HIDE_TASKS)) {
+ $this->fields['usage_bill_time']['visible'] = 0;
+ $this->fields['usage_task']['visible'] = 0;
+ }
}
/**
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index c73a68b98ee..a2eb2d1938c 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -123,34 +123,43 @@ $extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
// List of fields to search into when doing a "search in all"
-$fieldstosearchall = array(
- 'p.ref'=>"Ref",
- 'p.title'=>"Label",
- 's.nom'=>"ThirdPartyName",
- "p.note_public"=>"NotePublic"
-);
-if (empty($user->socid)) $fieldstosearchall["p.note_private"] = "NotePrivate";
+$fieldstosearchall = array();
+foreach ($object->fields as $key => $val) {
+ if (empty($val['searchall'])) {
+ continue;
+ }
+
+ // Don't allow search in private notes for external users when doing "search in all"
+ if (!empty($user->socid) && $key == "note_private") {
+ continue;
+ }
+
+ $fieldstosearchall['p.'.$key] = $val['label'];
+}
+
+// Add none object fields to "search in all"
+$fieldstosearchall['s.nom'] = "ThirdPartyName";
+
+// Definition of fields for list
+$arrayfields = array();
+foreach ($object->fields as $key => $val) {
+ // If $val['visible']==0, then we never show the field
+ if (empty($val['visible'])) {
+ continue;
+ }
+
+ $arrayfields['p.'.$key] = array(
+ 'label'=>$val['label'],
+ 'checked'=>(($val['visible'] < 0) ? 0 : 1),
+ 'enabled'=>($val['enabled'] && ($val['visible'] != 3)),
+ 'position'=>$val['position']);
+}
+
+// Add none object fields to fields for list
+$arrayfields['s.nom'] = array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'enabled'=>(empty($conf->societe->enabled) ? 0 : 1));
+$arrayfields['commercial'] = array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>0);
+$arrayfields['opp_weighted_amount'] = array('label'=>$langs->trans('OpportunityWeightedAmountShort'), 'checked'=>0, 'enabled'=>(empty($conf->global->PROJECT_USE_OPPORTUNITIES) ? 0 : 1), 'position'=>106);
-$arrayfields = array(
- 'p.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1, 'position'=>10),
- 'p.title'=>array('label'=>$langs->trans("Label"), 'checked'=>1, 'position'=>11),
- 's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'enabled'=>(empty($conf->societe->enabled) ? 0 : 1), 'position'=>20),
- 'commercial'=>array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>0, 'css'=>'tdoverflowmax100', 'position'=>21),
- 'p.dateo'=>array('label'=>$langs->trans("DateStart"), 'checked'=>1, 'position'=>100),
- 'p.datee'=>array('label'=>$langs->trans("DateEnd"), 'checked'=>1, 'position'=>101),
- 'p.public'=>array('label'=>$langs->trans("Visibility"), 'checked'=>1, 'position'=>102),
- 'p.opp_amount'=>array('label'=>$langs->trans("OpportunityAmountShort"), 'checked'=>1, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES ? 1 : 0), 'position'=>103),
- 'p.fk_opp_status'=>array('label'=>$langs->trans("OpportunityStatusShort"), 'checked'=>1, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES ? 1 : 0), 'position'=>104),
- 'p.opp_percent'=>array('label'=>$langs->trans("OpportunityProbabilityShort"), 'checked'=>1, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES ? 1 : 0), 'position'=>105),
- 'opp_weighted_amount'=>array('label'=>$langs->trans('OpportunityWeightedAmountShort'), 'checked'=>0, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES ? 1 : 0), 'position'=>106),
- 'p.budget_amount'=>array('label'=>$langs->trans("Budget"), 'checked'=>0, 'position'=>110),
- 'p.usage_opportunity'=>array('label'=>$langs->trans("UsageOpportunity"), 'checked'=>0, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES ? 1 : 0), 'position'=>115),
- 'p.usage_task'=>array('label'=>$langs->trans("UsageTasks"), 'checked'=>0, 'enabled'=>($conf->global->PROJECT_HIDE_TASKS ? 0 : 1), 'position'=>116),
- 'p.usage_bill_time'=>array('label'=>$langs->trans("UsageBillTimeShort"), 'checked'=>0, 'enabled'=>($conf->global->PROJECT_HIDE_TASKS ? 0 : 1), 'position'=>117),
- 'p.datec'=>array('label'=>$langs->trans("DateCreationShort"), 'checked'=>0, 'position'=>500),
- 'p.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
- 'p.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
-);
// Extra fields
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0)
{
@@ -160,7 +169,7 @@ if (is_array($extrafields->attributes[$object->table_element]['label']) && count
$arrayfields["ef.".$key] = array('label'=>$extrafields->attributes[$object->table_element]['label'][$key], 'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1), 'position'=>$extrafields->attributes[$object->table_element]['pos'][$key], 'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key]));
}
}
-$object->fields = dol_sort_array($object->fields, 'position');
+
$arrayfields = dol_sort_array($arrayfields, 'position');
diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php
index 72e3a1bae32..313fec73721 100644
--- a/htdocs/projet/tasks/contact.php
+++ b/htdocs/projet/tasks/contact.php
@@ -518,7 +518,7 @@ if ($id > 0 || !empty($ref))
if ($user->rights->projet->creer)
{
print ' ';
- print 'id.'&action=deleteline&lineid='.$tab[$i]['rowid'].($withproject ? '&withproject=1' : '').'">';
+ print 'id.'&action=deleteline&token='.newToken().'&lineid='.$tab[$i]['rowid'].($withproject ? '&withproject=1' : '').'">';
print img_picto($langs->trans('Unlink'), 'unlink');
print '';
}
diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php
index 49e1a3e6866..096eb62d0d0 100644
--- a/htdocs/projet/tasks/task.php
+++ b/htdocs/projet/tasks/task.php
@@ -604,7 +604,7 @@ if ($id > 0 || !empty($ref))
{
if (!$object->hasChildren() && !$object->hasTimeSpent())
{
- print ''.$langs->trans('Delete').'';
+ print ''.$langs->trans('Delete').'';
} else {
print ''.$langs->trans('Delete').'';
}
diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php
index 4ded7e9d197..dfeb73bb3cc 100644
--- a/htdocs/projet/tasks/time.php
+++ b/htdocs/projet/tasks/time.php
@@ -1462,7 +1462,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
print '';
print ' ';
- print 'fk_task.'&action=deleteline&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
+ print 'fk_task.'&action=deletelin&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">';
print img_delete('default', 'class="pictodelete paddingleft"');
print '';
diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php
index d3a9521bf25..cc4d07b0a4b 100644
--- a/htdocs/public/stripe/ipn.php
+++ b/htdocs/public/stripe/ipn.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2018 Frédéric France
+/* Copyright (C) 2018-2020 Thibault FOUCART
+ * Copyright (C) 2018 Frédéric France
*
* 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
@@ -109,7 +109,7 @@ if (!empty($conf->multicompany->enabled) && !empty($conf->stripeconnect->enabled
{
$sql = "SELECT entity";
$sql .= " FROM ".MAIN_DB_PREFIX."oauth_token";
- $sql .= " WHERE service = '".$db->escape($service)."' and tokenstring = '%".$db->escape($event->account)."%'";
+ $sql .= " WHERE service = '".$db->escape($service)."' and tokenstring LIKE '%".$db->escape($event->account)."%'";
dol_syslog(get_class($db)."::fetch", LOG_DEBUG);
$result = $db->query($sql);
@@ -126,8 +126,6 @@ if (!empty($conf->multicompany->enabled) && !empty($conf->stripeconnect->enabled
$key = 1;
}
$ret = $mc->switchEntity($key);
- if (!$res && file_exists("../../main.inc.php")) $res = @include "../../main.inc.php";
- if (!$res) die("Include of main fails");
}
// list of action
diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php
index 0758e1456ce..d41ce8e6bf4 100644
--- a/htdocs/reception/card.php
+++ b/htdocs/reception/card.php
@@ -1909,10 +1909,10 @@ if ($action == 'create')
{
// edit-delete buttons
print '
initHooks(array('usercard', 'globalcard'));
/**
* Actions
*/
+
$parameters = array('id' => $id, 'socid' => $socid, 'group' => $group, 'caneditgroup' => $caneditgroup);
$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');
@@ -1898,7 +1899,7 @@ if ($action == 'create' || $action == 'adduserldap')
{
if ($user->admin || !$object->admin) // If user edited is admin, delete is possible on for an admin
{
- print '
';
if ($productCombinations || $massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
diff --git a/htdocs/variants/list.php b/htdocs/variants/list.php
index 971533bdd25..7973553f6d0 100644
--- a/htdocs/variants/list.php
+++ b/htdocs/variants/list.php
@@ -126,7 +126,7 @@ foreach ($variants as $key => $attribute) {
print '