diff --git a/build.xml b/build.xml
deleted file mode 100644
index c6995ce95f3..00000000000
--- a/build.xml
+++ /dev/null
@@ -1,102 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php
index 7eae1eb6536..ae36f0f7fa6 100644
--- a/htdocs/accountancy/admin/index.php
+++ b/htdocs/accountancy/admin/index.php
@@ -37,8 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$langs->loadLangs(array("compta", "bills", "admin", "accountancy", "other"));
// Security access
-if (empty($user->rights->accounting->chartofaccount))
-{
+if (empty($user->rights->accounting->chartofaccount)) {
accessforbidden();
}
@@ -48,9 +47,9 @@ $action = GETPOST('action', 'aZ09');
$list = array(
'ACCOUNTING_LENGTH_GACCOUNT',
'ACCOUNTING_LENGTH_AACCOUNT',
-// 'ACCOUNTING_LIMIT_LIST_VENTILATION' // there is already a global parameter to define the nb of records in lists, we must use it in priority. Having one parameter for nb of record for each page is deprecated.
-// 'ACCOUNTING_LENGTH_DESCRIPTION', // adjust size displayed for lines description for dol_trunc
-// 'ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT', // adjust size displayed for select account description for dol_trunc
+// 'ACCOUNTING_LIMIT_LIST_VENTILATION' // there is already a global parameter to define the nb of records in lists, we must use it in priority. Having one parameter for nb of record for each page is deprecated.
+// 'ACCOUNTING_LENGTH_DESCRIPTION', // adjust size displayed for lines description for dol_trunc
+// 'ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT', // adjust size displayed for select account description for dol_trunc
);
$list_binding = array(
@@ -65,10 +64,8 @@ $list_binding = array(
if ($action == 'update') {
$error = 0;
- if (!$error)
- {
- foreach ($list as $constname)
- {
+ if (!$error) {
+ foreach ($list as $constname) {
$constvalue = GETPOST($constname, 'alpha');
if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
@@ -79,8 +76,7 @@ if ($action == 'update') {
setEventMessages($langs->trans("Error"), null, 'errors');
}
- foreach ($list_binding as $constname)
- {
+ foreach ($list_binding as $constname) {
$constvalue = GETPOST($constname, 'alpha');
if ($constname == 'ACCOUNTING_DATE_START_BINDING') {
@@ -104,8 +100,9 @@ if ($action == 'update') {
if ($action == 'setlistsorttodo') {
$setlistsorttodo = GETPOST('value', 'int');
$res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_TODO", $setlistsorttodo, 'yesno', 0, '', $conf->entity);
- if (!$res > 0)
+ if (!$res > 0) {
$error++;
+ }
if (!$error) {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
@@ -117,8 +114,9 @@ if ($action == 'setlistsorttodo') {
if ($action == 'setlistsortdone') {
$setlistsortdone = GETPOST('value', 'int');
$res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_DONE", $setlistsortdone, 'yesno', 0, '', $conf->entity);
- if (!$res > 0)
+ if (!$res > 0) {
$error++;
+ }
if (!$error) {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
@@ -129,8 +127,9 @@ if ($action == 'setlistsortdone') {
if ($action == 'setmanagezero') {
$setmanagezero = GETPOST('value', 'int');
$res = dolibarr_set_const($db, "ACCOUNTING_MANAGE_ZERO", $setmanagezero, 'yesno', 0, '', $conf->entity);
- if (!$res > 0)
+ if (!$res > 0) {
$error++;
+ }
if (!$error) {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
@@ -141,8 +140,9 @@ if ($action == 'setmanagezero') {
if ($action == 'setdisabledirectinput') {
$setdisabledirectinput = GETPOST('value', 'int');
$res = dolibarr_set_const($db, "BANK_DISABLE_DIRECT_INPUT", $setdisabledirectinput, 'yesno', 0, '', $conf->entity);
- if (!$res > 0)
+ if (!$res > 0) {
$error++;
+ }
if (!$error) {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
@@ -153,8 +153,9 @@ if ($action == 'setdisabledirectinput') {
if ($action == 'setenabledraftexport') {
$setenabledraftexport = GETPOST('value', 'int');
$res = dolibarr_set_const($db, "ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL", $setenabledraftexport, 'yesno', 0, '', $conf->entity);
- if (!$res > 0)
+ if (!$res > 0) {
$error++;
+ }
if (!$error) {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
@@ -165,8 +166,9 @@ if ($action == 'setenabledraftexport') {
if ($action == 'setenablesubsidiarylist') {
$setenablesubsidiarylist = GETPOST('value', 'int');
$res = dolibarr_set_const($db, "ACCOUNTANCY_COMBO_FOR_AUX", $setenablesubsidiarylist, 'yesno', 0, '', $conf->entity);
- if (!$res > 0)
+ if (!$res > 0) {
$error++;
+ }
if (!$error) {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
@@ -177,8 +179,9 @@ if ($action == 'setenablesubsidiarylist') {
if ($action == 'setdisablebindingonsales') {
$setdisablebindingonsales = GETPOST('value', 'int');
$res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_SALES", $setdisablebindingonsales, 'yesno', 0, '', $conf->entity);
- if (!$res > 0)
+ if (!$res > 0) {
$error++;
+ }
if (!$error) {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
@@ -189,8 +192,9 @@ if ($action == 'setdisablebindingonsales') {
if ($action == 'setdisablebindingonpurchases') {
$setdisablebindingonpurchases = GETPOST('value', 'int');
$res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_PURCHASES", $setdisablebindingonpurchases, 'yesno', 0, '', $conf->entity);
- if (!$res > 0)
+ if (!$res > 0) {
$error++;
+ }
if (!$error) {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
@@ -201,8 +205,9 @@ if ($action == 'setdisablebindingonpurchases') {
if ($action == 'setdisablebindingonexpensereports') {
$setdisablebindingonexpensereports = GETPOST('value', 'int');
$res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS", $setdisablebindingonexpensereports, 'yesno', 0, '', $conf->entity);
- if (!$res > 0)
+ if (!$res > 0) {
$error++;
+ }
if (!$error) {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
@@ -289,11 +294,12 @@ if (!empty($conf->global->ACCOUNTING_MANAGE_ZERO)) {
print '';
// Param a user $user->rights->accounting->chartofaccount can access
-foreach ($list as $key)
-{
+foreach ($list as $key) {
print '
';
echo '| ';
- if ($action == 'edit' && $object->id == $rule->id)
- {
+ if ($action == 'edit' && $object->id == $rule->id) {
$selected = ($object->is_for_all > 0) ? 'A' : ($object->fk_usergroup > 0 ? 'G' : 'U');
echo ' '.$form->selectarray('apply_to', $tab_apply, $selected, 0).' ';
echo ''.$form->select_dolusers($object->fk_user, 'fk_user').' ';
echo ''.$form->select_dolgroups($object->fk_usergroup, 'fk_usergroup').' ';
} else {
- if ($rule->is_for_all > 0) echo $tab_apply['A'];
- elseif ($rule->fk_usergroup > 0) echo $tab_apply['G'].' ('.$rule->getGroupLabel().')';
- elseif ($rule->fk_user > 0) echo $tab_apply['U'].' ('.$rule->getUserName().')';
- }
- echo ' | ';
-
-
- echo '';
- if ($action == 'edit' && $object->id == $rule->id)
- {
- echo $form->selectExpense($object->fk_c_type_fees, 'fk_c_type_fees', 0, 1, 1);
- } else {
- if ($rule->fk_c_type_fees == -1) echo $langs->trans('AllExpenseReport');
- else {
- $key = getDictvalue(MAIN_DB_PREFIX.'c_type_fees', 'code', $rule->fk_c_type_fees, false, 'id');
- if ($key != $langs->trans($key)) echo $langs->trans($key);
- else echo $langs->trans(getDictvalue(MAIN_DB_PREFIX.'c_type_fees', 'label', $rule->fk_c_type_fees, false, 'id')); // TODO check to return trans of 'code'
+ if ($rule->is_for_all > 0) {
+ echo $tab_apply['A'];
+ } elseif ($rule->fk_usergroup > 0) {
+ echo $tab_apply['G'].' ('.$rule->getGroupLabel().')';
+ } elseif ($rule->fk_user > 0) {
+ echo $tab_apply['U'].' ('.$rule->getUserName().')';
}
}
echo ' | ';
echo '';
- if ($action == 'edit' && $object->id == $rule->id)
- {
+ if ($action == 'edit' && $object->id == $rule->id) {
+ echo $form->selectExpense($object->fk_c_type_fees, 'fk_c_type_fees', 0, 1, 1);
+ } else {
+ if ($rule->fk_c_type_fees == -1) {
+ echo $langs->trans('AllExpenseReport');
+ } else {
+ $key = getDictvalue(MAIN_DB_PREFIX.'c_type_fees', 'code', $rule->fk_c_type_fees, false, 'id');
+ if ($key != $langs->trans($key)) {
+ echo $langs->trans($key);
+ } else {
+ echo $langs->trans(getDictvalue(MAIN_DB_PREFIX.'c_type_fees', 'label', $rule->fk_c_type_fees, false, 'id')); // TODO check to return trans of 'code'
+ }
+ }
+ }
+ echo ' | ';
+
+
+ echo '';
+ if ($action == 'edit' && $object->id == $rule->id) {
echo $form->selectarray('code_expense_rules_type', $tab_rules_type, $object->code_expense_rules_type, 0);
} else {
echo $tab_rules_type[$rule->code_expense_rules_type];
@@ -263,8 +279,7 @@ foreach ($rules as $rule)
echo ' | ';
- if ($action == 'edit' && $object->id == $rule->id)
- {
+ if ($action == 'edit' && $object->id == $rule->id) {
print $form->selectDate(strtotime(date('Y-m-d', $object->dates)), 'start', '', '', 0, '', 1, 0);
} else {
echo dol_print_date($rule->dates, 'day');
@@ -273,8 +288,7 @@ foreach ($rules as $rule)
echo ' | ';
- if ($action == 'edit' && $object->id == $rule->id)
- {
+ if ($action == 'edit' && $object->id == $rule->id) {
print $form->selectDate(strtotime(date('Y-m-d', $object->datee)), 'end', '', '', 0, '', 1, 0);
} else {
echo dol_print_date($rule->datee, 'day');
@@ -283,8 +297,7 @@ foreach ($rules as $rule)
echo ' | ';
- if ($action == 'edit' && $object->id == $rule->id)
- {
+ if ($action == 'edit' && $object->id == $rule->id) {
echo ''.$conf->currency;
} else {
echo price($rule->amount, 0, $langs, 1, -1, -1, $conf->currency);
@@ -293,8 +306,7 @@ foreach ($rules as $rule)
echo ' | ';
- if ($action == 'edit' && $object->id == $rule->id)
- {
+ if ($action == 'edit' && $object->id == $rule->id) {
echo $form->selectyesno('restrictive', $object->restrictive, 1);
} else {
echo yn($rule->restrictive, 1, 1);
@@ -303,8 +315,7 @@ foreach ($rules as $rule)
echo ' | ';
- if ($object->id != $rule->id)
- {
+ if ($object->id != $rule->id) {
echo ''.img_edit().' ';
echo ''.img_delete().'';
} else {
diff --git a/htdocs/admin/paymentbybanktransfer.php b/htdocs/admin/paymentbybanktransfer.php
index cd0db2a1def..a21b2aa6e1d 100644
--- a/htdocs/admin/paymentbybanktransfer.php
+++ b/htdocs/admin/paymentbybanktransfer.php
@@ -71,10 +71,10 @@ if ($action == "set")
if (! $res > 0) $error++;
*/
} else $error++;
-
+ /* Moved to account
$res = dolibarr_set_const($db, "PAYMENTBYBANKTRANSFER_ICS", GETPOST("PAYMENTBYBANKTRANSFER_ICS"), 'chaine', 0, '', $conf->entity);
if (!$res > 0) $error++;
-
+ */
if (GETPOST("PAYMENTBYBANKTRANSFER_USER") > 0)
{
$res = dolibarr_set_const($db, "PAYMENTBYBANKTRANSFER_USER", GETPOST("PAYMENTBYBANKTRANSFER_USER"), 'chaine', 0, '', $conf->entity);
@@ -156,11 +156,13 @@ print ' | ';
$form->select_comptes($conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT, 'PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT', 0, "courant=1", 1);
print ' |
';
+/* Moved to bank account data
// ICS
print '| '.$langs->trans("BankAccountDomiciliation").' | ';
print ' | ';
}
}
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index 63e0fea2b36..d0314fb9c45 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -5504,38 +5504,9 @@ class Product extends CommonObject
*/
public function setCategories($categories)
{
- // Handle single category
- if (!is_array($categories)) {
- $categories = array($categories);
- }
- // Get current categories
- include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
- $c = new Categorie($this->db);
- $existing = $c->containing($this->id, Categorie::TYPE_PRODUCT, 'id');
-
- // Diff
- if (is_array($existing)) {
- $to_del = array_diff($existing, $categories);
- $to_add = array_diff($categories, $existing);
- } else {
- $to_del = array(); // Nothing to delete
- $to_add = $categories;
- }
-
- // Process
- foreach ($to_del as $del) {
- if ($c->fetch($del) > 0) {
- $c->del_type($this, Categorie::TYPE_PRODUCT);
- }
- }
- foreach ($to_add as $add) {
- if ($c->fetch($add) > 0) {
- $c->add_type($this, Categorie::TYPE_PRODUCT);
- }
- }
-
- return;
+ require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
+ return parent::setCategoriesCommon($categories, Categorie::TYPE_PRODUCT);
}
/**
diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php
index cf5e4fa5b53..2aadd4b3813 100644
--- a/htdocs/product/fournisseurs.php
+++ b/htdocs/product/fournisseurs.php
@@ -490,9 +490,9 @@ if ($id > 0 || $ref)
if ($rowid)
{
print '';
- print '';
+ print '';
} else {
- print '';
+ print '';
}
print '';
print '
';
diff --git a/htdocs/product/list.php b/htdocs/product/list.php
index a624daf8afb..21705e74663 100644
--- a/htdocs/product/list.php
+++ b/htdocs/product/list.php
@@ -304,6 +304,7 @@ if (empty($reshook))
$permissiontoread = $user->rights->{$rightskey}->lire;
$permissiontodelete = $user->rights->{$rightskey}->supprimer;
+ $permissiontoadd = $user->rights->{$rightskey}->creer;
$uploaddir = $conf->product->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}
@@ -533,8 +534,10 @@ if ($resql)
//'builddoc'=>$langs->trans("PDFMerge"),
//'presend'=>$langs->trans("SendByMail"),
);
+
if ($user->rights->{$rightskey}->supprimer) $arrayofmassactions['predelete'] = "