diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php
index 2a6557be0b9..6f36d04d7b9 100644
--- a/htdocs/accountancy/admin/account.php
+++ b/htdocs/accountancy/admin/account.php
@@ -39,7 +39,7 @@ $id = GETPOST('id', 'int');
$rowid = GETPOST('rowid', 'int');
$massaction = GETPOST('massaction', 'aZ09');
$optioncss = GETPOST('optioncss', 'alpha');
-$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'accountingaccountlist'; // To manage different context of search
+$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'accountingaccountlist'; // To manage different context of search
$mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...)
$search_account = GETPOST('search_account', 'alpha');
@@ -49,7 +49,7 @@ $search_accountparent = GETPOST('search_accountparent', 'alpha');
$search_pcgtype = GETPOST('search_pcgtype', 'alpha');
$search_import_key = GETPOST('search_import_key', 'alpha');
$toselect = GETPOST('toselect', 'array');
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$confirm = GETPOST('confirm', 'alpha');
$chartofaccounts = GETPOST('chartofaccounts', 'int');
@@ -66,7 +66,7 @@ if (!$user->hasRight('accounting', 'chartofaccount')) {
}
// Load variable for pagination
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
@@ -111,7 +111,8 @@ $hookmanager->initHooks(array('accountancyadminaccount'));
*/
if (GETPOST('cancel', 'alpha')) {
- $action = 'list'; $massaction = '';
+ $action = 'list';
+ $massaction = '';
}
if (!GETPOST('confirmmassaction', 'alpha')) {
$massaction = '';
diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php
index f88d48961a5..29cb1300f4c 100644
--- a/htdocs/accountancy/admin/accountmodel.php
+++ b/htdocs/accountancy/admin/accountmodel.php
@@ -47,7 +47,7 @@ if (isModEnabled('accounting')) {
// Load translation files required by the page
$langs->loadLangs(array('accountancy', 'admin', 'companies', 'compta', 'errors', 'holiday', 'hrm', 'resource'));
-$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view';
+$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view';
$confirm = GETPOST('confirm', 'alpha');
$id = 31;
$rowid = GETPOST('rowid', 'alpha');
@@ -59,7 +59,7 @@ $actl[0] = img_picto($langs->trans("Disabled"), 'switch_off', 'class="size15x"')
$actl[1] = img_picto($langs->trans("Activated"), 'switch_on', 'class="size15x"');
$listoffset = GETPOST('listoffset', 'alpha');
-$listlimit = GETPOST('listlimit', 'int') > 0 ?GETPOST('listlimit', 'int') : 1000;
+$listlimit = GETPOST('listlimit', 'int') > 0 ? GETPOST('listlimit', 'int') : 1000;
$active = 1;
$sortfield = GETPOST("sortfield", 'aZ09comma');
@@ -472,7 +472,8 @@ if ($id) {
}
if ($fieldlist[$field] == 'country') {
if (in_array('region_id', $fieldlist)) {
- print '
| '; continue;
+ print ' | ';
+ continue;
} // For region page, we do not show the country input
$valuetoshow = $langs->trans("Country");
}
@@ -519,7 +520,8 @@ if ($id) {
$tmpaction = 'create';
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
$reshook = $hookmanager->executeHooks('createDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
- $error = $hookmanager->error; $errors = $hookmanager->errors;
+ $error = $hookmanager->error;
+ $errors = $hookmanager->errors;
if (empty($reshook)) {
fieldListAccountModel($fieldlist, $obj, $tabname[$id], 'add');
@@ -616,7 +618,8 @@ if ($id) {
$tmpaction = 'edit';
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
$reshook = $hookmanager->executeHooks('editDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
- $error = $hookmanager->error; $errors = $hookmanager->errors;
+ $error = $hookmanager->error;
+ $errors = $hookmanager->errors;
if (empty($reshook)) {
fieldListAccountModel($fieldlist, $obj, $tabname[$id], 'edit');
@@ -629,7 +632,8 @@ if ($id) {
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
$reshook = $hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
- $error = $hookmanager->error; $errors = $hookmanager->errors;
+ $error = $hookmanager->error;
+ $errors = $hookmanager->errors;
if (empty($reshook)) {
foreach ($fieldlist as $field => $value) {
@@ -669,9 +673,11 @@ if ($id) {
}
// Can an entry be erased or disabled ?
- $iserasable = 1; $canbedisabled = 1; $canbemodified = 1; // true by default
+ $iserasable = 1;
+ $canbedisabled = 1;
+ $canbemodified = 1; // true by default
- $url = $_SERVER["PHP_SELF"].'?token='.newToken().($page ? '&page='.$page : '').'&sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')).'&code='.(!empty($obj->code) ?urlencode($obj->code) : '');
+ $url = $_SERVER["PHP_SELF"].'?token='.newToken().($page ? '&page='.$page : '').'&sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')).'&code='.(!empty($obj->code) ? urlencode($obj->code) : '');
if ($param) {
$url .= '&'.$param;
}
@@ -769,16 +775,17 @@ function fieldListAccountModel($fieldlist, $obj = '', $tabname = '', $context =
print '';
}
if ($fieldlist[$field] == 'type_cdr') {
- print $form->selectarray($fieldlist[$field], array(0=>$langs->trans('None'), 1=>$langs->trans('AtEndOfMonth'), 2=>$langs->trans('CurrentNext')), (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:''));
+ print $form->selectarray($fieldlist[$field], array(0=>$langs->trans('None'), 1=>$langs->trans('AtEndOfMonth'), 2=>$langs->trans('CurrentNext')), (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : ''));
} else {
- print $form->selectyesno($fieldlist[$field], (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:''), 1);
+ print $form->selectyesno($fieldlist[$field], (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : ''), 1);
}
print ' | ';
} elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist[$field]})) {
- print ' | ';
+ print ' | ';
} else {
print '';
- $size = ''; $class = '';
+ $size = '';
+ $class = '';
if ($fieldlist[$field] == 'code') {
$size = 'size="8" ';
}
@@ -791,7 +798,7 @@ function fieldListAccountModel($fieldlist, $obj = '', $tabname = '', $context =
if ($fieldlist[$field] == 'sortorder' || $fieldlist[$field] == 'sens' || $fieldlist[$field] == 'category_type') {
$size = 'size="2" ';
}
- print '';
+ print '';
print ' | ';
}
}
diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php
index 59d9f219ee4..95714b0ce87 100644
--- a/htdocs/accountancy/admin/categories_list.php
+++ b/htdocs/accountancy/admin/categories_list.php
@@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php
// Load translation files required by the page
$langs->loadLangs(array("errors", "admin", "companies", "resource", "holiday", "accountancy", "hrm"));
-$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view';
+$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view';
$confirm = GETPOST('confirm', 'alpha');
$id = 32;
$rowid = GETPOST('rowid', 'alpha');
@@ -53,7 +53,7 @@ $actl[0] = img_picto($langs->trans("Disabled"), 'switch_off', 'class="size15x"')
$actl[1] = img_picto($langs->trans("Activated"), 'switch_on', 'class="size15x"');
$listoffset = GETPOST('listoffset', 'alpha');
-$listlimit = GETPOST('listlimit', 'int') > 0 ?GETPOST('listlimit', 'int') : 1000;
+$listlimit = GETPOST('listlimit', 'int') > 0 ? GETPOST('listlimit', 'int') : 1000;
$sortfield = GETPOST("sortfield", 'aZ09comma');
$sortorder = GETPOST("sortorder", 'aZ09comma');
@@ -581,7 +581,8 @@ if ($tabname[$id]) {
$tmpaction = 'create';
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
$reshook = $hookmanager->executeHooks('createDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
- $error = $hookmanager->error; $errors = $hookmanager->errors;
+ $error = $hookmanager->error;
+ $errors = $hookmanager->errors;
if (empty($reshook)) {
fieldListAccountingCategories($fieldlist, $obj, $tabname[$id], 'add');
@@ -784,7 +785,8 @@ if ($resql) {
$tmpaction = 'edit';
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
$reshook = $hookmanager->executeHooks('editDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
- $error = $hookmanager->error; $errors = $hookmanager->errors;
+ $error = $hookmanager->error;
+ $errors = $hookmanager->errors;
// Actions
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
@@ -810,13 +812,16 @@ if ($resql) {
}
} else {
// Can an entry be erased or disabled ?
- $iserasable = 1; $canbedisabled = 1; $canbemodified = 1; // true by default
+ $iserasable = 1;
+ $canbedisabled = 1;
+ $canbemodified = 1; // true by default
if (isset($obj->code)) {
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i', $obj->code))) {
- $iserasable = 0; $canbedisabled = 0;
+ $iserasable = 0;
+ $canbedisabled = 0;
}
}
- $url = $_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')).'&code='.(!empty($obj->code) ?urlencode($obj->code) : '');
+ $url = $_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')).'&code='.(!empty($obj->code) ? urlencode($obj->code) : '');
if ($param) {
$url .= '&'.$param;
}
@@ -828,7 +833,8 @@ if ($resql) {
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
$reshook = $hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
- $error = $hookmanager->error; $errors = $hookmanager->errors;
+ $error = $hookmanager->error;
+ $errors = $hookmanager->errors;
// Actions
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
@@ -872,7 +878,7 @@ if ($resql) {
// Show value for field
if ($showfield) {
- print ''.dol_escape_htmltag($valuetoshow).' | ';
+ print ''.dol_escape_htmltag($valuetoshow).' | ';
}
}
}
@@ -981,10 +987,10 @@ function fieldListAccountingCategories($fieldlist, $obj = '', $tabname = '', $co
}
} elseif ($fieldlist[$field] == 'category_type') {
print '';
- print $form->selectyesno($fieldlist[$field], (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:''), 1);
+ print $form->selectyesno($fieldlist[$field], (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : ''), 1);
print ' | ';
} elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist[$field]})) {
- print ' | ';
+ print ' | ';
} else {
print '';
$class = '';
@@ -994,7 +1000,7 @@ function fieldListAccountingCategories($fieldlist, $obj = '', $tabname = '', $co
if ($fieldlist[$field] == 'position') {
$class = 'maxwidth50';
}
- print '';
+ print '';
print ' | ';
}
}
diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php
index d9b26c9b3ac..4cbb6045d74 100644
--- a/htdocs/accountancy/admin/fiscalyear.php
+++ b/htdocs/accountancy/admin/fiscalyear.php
@@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php';
$action = GETPOST('action', 'aZ09');
// Load variable for pagination
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php
index ef8a0f2767f..02158f7536a 100644
--- a/htdocs/accountancy/admin/journals_list.php
+++ b/htdocs/accountancy/admin/journals_list.php
@@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
// Load translation files required by the page
$langs->loadLangs(array("admin", "compta", "accountancy"));
-$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view';
+$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view';
$confirm = GETPOST('confirm', 'alpha');
$id = 35;
$rowid = GETPOST('rowid', 'alpha');
@@ -56,7 +56,7 @@ $actl[0] = img_picto($langs->trans("Disabled"), 'switch_off', 'class="size15x"')
$actl[1] = img_picto($langs->trans("Activated"), 'switch_on', 'class="size15x"');
$listoffset = GETPOST('listoffset', 'alpha');
-$listlimit = GETPOST('listlimit', 'int') > 0 ?GETPOST('listlimit', 'int') : 1000;
+$listlimit = GETPOST('listlimit', 'int') > 0 ? GETPOST('listlimit', 'int') : 1000;
$active = 1;
$sortfield = GETPOST('sortfield', 'aZ09comma');
@@ -452,7 +452,8 @@ if ($id) {
$tmpaction = 'create';
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
$reshook = $hookmanager->executeHooks('createDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
- $error = $hookmanager->error; $errors = $hookmanager->errors;
+ $error = $hookmanager->error;
+ $errors = $hookmanager->errors;
if (empty($reshook)) {
fieldListJournal($fieldlist, $obj, $tabname[$id], 'add');
@@ -561,7 +562,8 @@ if ($id) {
$tmpaction = 'edit';
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
$reshook = $hookmanager->executeHooks('editDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
- $error = $hookmanager->error; $errors = $hookmanager->errors;
+ $error = $hookmanager->error;
+ $errors = $hookmanager->errors;
// Show fields
if (empty($reshook)) {
@@ -580,7 +582,8 @@ if ($id) {
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
$reshook = $hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
- $error = $hookmanager->error; $errors = $hookmanager->errors;
+ $error = $hookmanager->error;
+ $errors = $hookmanager->errors;
if (empty($reshook)) {
$langs->load("accountancy");
@@ -607,7 +610,9 @@ if ($id) {
}
// Can an entry be erased or disabled ?
- $iserasable = 1; $canbedisabled = 1; $canbemodified = 1; // true by default
+ $iserasable = 1;
+ $canbedisabled = 1;
+ $canbemodified = 1; // true by default
if (isset($obj->code) && $id != 10) {
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i', $obj->code))) {
$iserasable = 0;
@@ -617,7 +622,7 @@ if ($id) {
$canbemodified = $iserasable;
- $url = $_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')).'&code='.(!empty($obj->code) ?urlencode($obj->code) : '');
+ $url = $_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')).'&code='.(!empty($obj->code) ? urlencode($obj->code) : '');
if ($param) {
$url .= '&'.$param;
}
@@ -700,13 +705,14 @@ function fieldListJournal($fieldlist, $obj = '', $tabname = '', $context = '')
foreach ($fieldlist as $field => $value) {
if ($fieldlist[$field] == 'nature') {
print '';
- print $form->selectarray('nature', $sourceList, (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:''));
+ print $form->selectarray('nature', $sourceList, (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : ''));
print ' | ';
} elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist[$field]})) {
- print ' | ';
+ print ' | ';
} else {
print '';
- $size = ''; $class = '';
+ $size = '';
+ $class = '';
if ($fieldlist[$field] == 'code') {
$class = 'maxwidth100';
}
@@ -716,7 +722,7 @@ function fieldListJournal($fieldlist, $obj = '', $tabname = '', $context = '')
if ($fieldlist[$field] == 'sortorder' || $fieldlist[$field] == 'sens' || $fieldlist[$field] == 'category_type') {
$size = 'size="2" ';
}
- print '';
+ print '';
print ' | ';
}
}
diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php
index b6923b36022..ca5516547ec 100644
--- a/htdocs/accountancy/admin/productaccount.php
+++ b/htdocs/accountancy/admin/productaccount.php
@@ -85,7 +85,7 @@ if (empty($accounting_product_mode)) {
$accounting_product_mode = 'ACCOUNTANCY_SELL';
}
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : getDolGlobalInt('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit);
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalInt('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit);
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
@@ -136,7 +136,8 @@ if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
*/
if (GETPOST('cancel', 'alpha')) {
- $action = 'list'; $massaction = '';
+ $action = 'list';
+ $massaction = '';
}
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
$massaction = '';
@@ -184,7 +185,9 @@ if ($action == 'update') {
//$msg .= '' . count($chk_prod) . ' ' . $langs->trans("SelectedLines") . '
';
$arrayofdifferentselectedvalues = array();
- $cpt = 0; $ok = 0; $ko = 0;
+ $cpt = 0;
+ $ok = 0;
+ $ko = 0;
foreach ($chk_prod as $productid) {
$accounting_account_id = GETPOST('codeventil_'.$productid);
diff --git a/htdocs/accountancy/admin/subaccount.php b/htdocs/accountancy/admin/subaccount.php
index 8c660feb769..69c2f458786 100644
--- a/htdocs/accountancy/admin/subaccount.php
+++ b/htdocs/accountancy/admin/subaccount.php
@@ -40,7 +40,7 @@ $rowid = GETPOST('rowid', 'int');
$massaction = GETPOST('massaction', 'aZ09');
$optioncss = GETPOST('optioncss', 'alpha');
$mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...)
-$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'accountingsubaccountlist'; // To manage different context of search
+$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'accountingsubaccountlist'; // To manage different context of search
$search_subaccount = GETPOST('search_subaccount', 'alpha');
$search_label = GETPOST('search_label', 'alpha');
@@ -55,7 +55,7 @@ if (!$user->hasRight('accounting', 'chartofaccount')) {
}
// Load variable for pagination
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
@@ -89,7 +89,8 @@ if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
*/
if (GETPOST('cancel', 'alpha')) {
- $action = 'list'; $massaction = '';
+ $action = 'list';
+ $massaction = '';
}
if (!GETPOST('confirmmassaction', 'alpha')) {
$massaction = '';
diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php
index 6b5f09693ce..a1881cf212d 100644
--- a/htdocs/accountancy/bookkeeping/balance.php
+++ b/htdocs/accountancy/bookkeeping/balance.php
@@ -64,7 +64,7 @@ if ($search_accountancy_code_end == - 1) {
$search_not_reconciled = GETPOST('search_not_reconciled', 'alpha');
// Load variable for pagination
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
diff --git a/htdocs/accountancy/bookkeeping/export.php b/htdocs/accountancy/bookkeeping/export.php
index 105a86c6b69..5323c3c9cce 100644
--- a/htdocs/accountancy/bookkeeping/export.php
+++ b/htdocs/accountancy/bookkeeping/export.php
@@ -134,7 +134,7 @@ $search_lettering_code = GETPOST('search_lettering_code', 'alpha');
$search_not_reconciled = GETPOST('search_not_reconciled', 'alpha');
// Load variable for pagination
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$optioncss = GETPOST('optioncss', 'alpha');
@@ -237,7 +237,8 @@ if (!$user->hasRight('accounting', 'mouvements', 'lire')) {
$param = '';
if (GETPOST('cancel', 'alpha')) {
- $action = 'list'; $massaction = '';
+ $action = 'list';
+ $massaction = '';
}
if (!GETPOST('confirmmassaction', 'alpha')) {
$massaction = '';
@@ -1028,7 +1029,8 @@ print "\n";
print '';
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
- print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch actioncolumn ');}
+ print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch actioncolumn ');
+}
if (!empty($arrayfields['t.piece_num']['checked'])) {
print_liste_field_titre($arrayfields['t.piece_num']['label'], $_SERVER['PHP_SELF'], "t.piece_num", "", $param, "", $sortfield, $sortorder);
}
@@ -1093,7 +1095,7 @@ $totalarray = array();
$totalarray['nbfield'] = 0;
$total_debit = 0;
$total_credit = 0;
-$totalarray['val'] = array ();
+$totalarray['val'] = array();
$totalarray['val']['totaldebit'] = 0;
$totalarray['val']['totalcredit'] = 0;
diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php
index 98fb46ff9c2..f722e32df08 100644
--- a/htdocs/accountancy/bookkeeping/list.php
+++ b/htdocs/accountancy/bookkeeping/list.php
@@ -129,7 +129,7 @@ $search_lettering_code = GETPOST('search_lettering_code', 'alpha');
$search_not_reconciled = GETPOST('search_not_reconciled', 'alpha');
// Load variable for pagination
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$optioncss = GETPOST('optioncss', 'alpha');
@@ -225,7 +225,8 @@ if (!$user->hasRight('accounting', 'mouvements', 'lire')) {
$param = '';
if (GETPOST('cancel', 'alpha')) {
- $action = 'list'; $massaction = '';
+ $action = 'list';
+ $massaction = '';
}
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'preunletteringauto' && $massaction != 'preunletteringmanual' && $massaction != 'predeletebookkeepingwriting') {
$massaction = '';
@@ -979,7 +980,8 @@ print "
\n";
print '';
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
- print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch actioncolumn ');}
+ print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch actioncolumn ');
+}
if (!empty($arrayfields['t.piece_num']['checked'])) {
print_liste_field_titre($arrayfields['t.piece_num']['label'], $_SERVER['PHP_SELF'], "t.piece_num", "", $param, "", $sortfield, $sortorder);
}
@@ -1044,7 +1046,7 @@ $totalarray = array();
$totalarray['nbfield'] = 0;
$total_debit = 0;
$total_credit = 0;
-$totalarray['val'] = array ();
+$totalarray['val'] = array();
$totalarray['val']['totaldebit'] = 0;
$totalarray['val']['totalcredit'] = 0;
diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php
index ab2e186b927..864508e99d8 100644
--- a/htdocs/accountancy/bookkeeping/listbyaccount.php
+++ b/htdocs/accountancy/bookkeeping/listbyaccount.php
@@ -966,7 +966,7 @@ $displayed_account_number = null; // Start with undefined to be able to distingu
$i = 0;
$totalarray = array();
-$totalarray['val'] = array ();
+$totalarray['val'] = array();
$totalarray['nbfield'] = 0;
$total_debit = 0;
$total_credit = 0;
@@ -993,18 +993,40 @@ while ($i < min($num, $limit)) {
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
$colspan++;
}
- if (!empty($arrayfields['t.piece_num']['checked'])) { $colspan++; }
- if (!empty($arrayfields['t.code_journal']['checked'])) { $colspan++; }
- if (!empty($arrayfields['t.doc_date']['checked'])) { $colspan++; }
- if (!empty($arrayfields['t.doc_ref']['checked'])) { $colspan++; }
- if (!empty($arrayfields['t.label_operation']['checked'])) { $colspan++; }
- if (!empty($arrayfields['t.lettering_code']['checked'])) { $colspan++; }
+ if (!empty($arrayfields['t.piece_num']['checked'])) {
+ $colspan++;
+ }
+ if (!empty($arrayfields['t.code_journal']['checked'])) {
+ $colspan++;
+ }
+ if (!empty($arrayfields['t.doc_date']['checked'])) {
+ $colspan++;
+ }
+ if (!empty($arrayfields['t.doc_ref']['checked'])) {
+ $colspan++;
+ }
+ if (!empty($arrayfields['t.label_operation']['checked'])) {
+ $colspan++;
+ }
+ if (!empty($arrayfields['t.lettering_code']['checked'])) {
+ $colspan++;
+ }
- if (!empty($arrayfields['t.balance']['checked'])) { $colspanend++; }
- if (!empty($arrayfields['t.date_export']['checked'])) { $colspanend++; }
- if (!empty($arrayfields['t.date_validated']['checked'])) { $colspanend++; }
- if (!empty($arrayfields['t.lettering_code']['checked'])) { $colspanend++; }
- if (!empty($arrayfields['t.import_key']['checked'])) { $colspanend++; }
+ if (!empty($arrayfields['t.balance']['checked'])) {
+ $colspanend++;
+ }
+ if (!empty($arrayfields['t.date_export']['checked'])) {
+ $colspanend++;
+ }
+ if (!empty($arrayfields['t.date_validated']['checked'])) {
+ $colspanend++;
+ }
+ if (!empty($arrayfields['t.lettering_code']['checked'])) {
+ $colspanend++;
+ }
+ if (!empty($arrayfields['t.import_key']['checked'])) {
+ $colspanend++;
+ }
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
$colspan++;
$colspanend--;
@@ -1022,7 +1044,9 @@ while ($i < min($num, $limit)) {
}
print '| '.price(price2num($sous_total_debit, 'MT')).' | ';
print ''.price(price2num($sous_total_credit, 'MT')).' | ';
- if ($colspanend > 0) print ' | ';
+ if ($colspanend > 0) {
+ print ' | ';
+ }
print '
';
// Show balance of last shown account
$balance = $sous_total_debit - $sous_total_credit;
@@ -1039,7 +1063,9 @@ while ($i < min($num, $limit)) {
print price(price2num($sous_total_credit - $sous_total_debit, 'MT'));
print '';
}
- if ($colspanend > 0) print ' | ';
+ if ($colspanend > 0) {
+ print ' | ';
+ }
print '';
}
@@ -1310,7 +1336,9 @@ if ($num > 0 && $colspan > 0) {
print ''.$langs->trans("TotalForAccount").' '.$accountg.': | ';
print ''.price(price2num($sous_total_debit, 'MT')).' | ';
print ''.price(price2num($sous_total_credit, 'MT')).' | ';
- if ($colspanend > 0) print ' | ';
+ if ($colspanend > 0) {
+ print ' | ';
+ }
print '';
// Show balance of last shown account
$balance = $sous_total_debit - $sous_total_credit;
@@ -1327,7 +1355,9 @@ if ($num > 0 && $colspan > 0) {
print price(price2num($sous_total_credit - $sous_total_debit, 'MT'));
print '';
}
- if ($colspanend > 0) print ' | ';
+ if ($colspanend > 0) {
+ print ' | ';
+ }
print '';
}
diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php
index 208888cdf7d..40354b297b2 100644
--- a/htdocs/accountancy/class/accountancycategory.class.php
+++ b/htdocs/accountancy/class/accountancycategory.class.php
@@ -228,7 +228,8 @@ class AccountancyCategory // extends CommonObject
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
// Commit or rollback
@@ -369,7 +370,8 @@ class AccountancyCategory // extends CommonObject
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
// Commit or rollback
@@ -407,7 +409,8 @@ class AccountancyCategory // extends CommonObject
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
// Commit or rollback
diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php
index 5252f548b27..1b08cc85ed6 100644
--- a/htdocs/accountancy/class/accountancyexport.class.php
+++ b/htdocs/accountancy/class/accountancyexport.class.php
@@ -489,7 +489,7 @@ class AccountancyExport
case self::$EXPORT_TYPE_FEC2:
$archiveFileList = $this->exportFEC2($TData, $exportFile, $archiveFileList, $withAttachment);
break;
- case self::$EXPORT_TYPE_ISUITEEXPERT :
+ case self::$EXPORT_TYPE_ISUITEEXPERT:
$this->exportiSuiteExpert($TData, $exportFile);
break;
default:
@@ -1003,7 +1003,9 @@ class AccountancyExport
// skip native invoice pdfs (canelle)
// We want to retrieve an attachment representative of the supplier invoice, not a fake document generated by Dolibarr.
if ($line->doc_type == 'supplier_invoice') {
- if ($fileFound['name'] === $objectFileName.'.pdf') continue;
+ if ($fileFound['name'] === $objectFileName.'.pdf') {
+ continue;
+ }
} elseif ($fileFound['name'] !== $objectFileName.'.pdf') {
continue;
}
@@ -1141,7 +1143,6 @@ class AccountancyExport
*/
public function exportEbp($objectLines, $exportFile = null)
{
-
$separator = ',';
$end_line = "\n";
@@ -1472,7 +1473,9 @@ class AccountancyExport
// skip native invoice pdfs (canelle)
// We want to retrieve an attachment representative of the supplier invoice, not a fake document generated by Dolibarr.
if ($line->doc_type == 'supplier_invoice') {
- if ($fileFound['name'] === $objectFileName.'.pdf') continue;
+ if ($fileFound['name'] === $objectFileName.'.pdf') {
+ continue;
+ }
} elseif ($fileFound['name'] !== $objectFileName.'.pdf') {
continue;
}
@@ -1681,7 +1684,9 @@ class AccountancyExport
// skip native invoice pdfs (canelle)
// We want to retrieve an attachment representative of the supplier invoice, not a fake document generated by Dolibarr.
if ($line->doc_type == 'supplier_invoice') {
- if ($fileFound['name'] === $objectFileName.'.pdf') continue;
+ if ($fileFound['name'] === $objectFileName.'.pdf') {
+ continue;
+ }
} elseif ($fileFound['name'] !== $objectFileName.'.pdf') {
continue;
}
@@ -1883,7 +1888,6 @@ class AccountancyExport
*/
public function exportLDCompta($objectLines, $exportFile = null)
{
-
$separator = ';';
$end_line = "\r\n";
@@ -2490,7 +2494,6 @@ class AccountancyExport
*/
public function exportGestimumV5($objectLines, $exportFile = null)
{
-
$separator = ',';
$end_line = "\r\n";
diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php
index 74cdb100516..797b9e909f7 100644
--- a/htdocs/accountancy/class/accountingjournal.class.php
+++ b/htdocs/accountancy/class/accountingjournal.class.php
@@ -84,12 +84,12 @@ class AccountingJournal extends CommonObject
/**
* @var array Accounting account cached
*/
- static public $accounting_account_cached = array();
+ public static $accounting_account_cached = array();
/**
* @var array Nature mapping
*/
- static public $nature_maps = array(
+ public static $nature_maps = array(
1 => 'variousoperations',
2 => 'sells',
3 => 'purchases',
@@ -386,8 +386,12 @@ class AccountingJournal extends CommonObject
global $hookmanager;
// Clean parameters
- if (empty($type)) $type = 'view';
- if (empty($in_bookkeeping)) $in_bookkeeping = 'notyet';
+ if (empty($type)) {
+ $type = 'view';
+ }
+ if (empty($in_bookkeeping)) {
+ $in_bookkeeping = 'notyet';
+ }
$data = array();
@@ -659,9 +663,11 @@ class AccountingJournal extends CommonObject
$lines[0][$accountancy_code_depreciation_asset] = -$last_cumulative_amount_ht;
$lines[0][$accountancy_code_asset] = $element_static->acquisition_value_ht;
- $disposal_amount_vat = $disposal_subject_to_vat ? (double) price2num($disposal_amount * $disposal_vat / 100, 'MT') : 0;
+ $disposal_amount_vat = $disposal_subject_to_vat ? (float) price2num($disposal_amount * $disposal_vat / 100, 'MT') : 0;
$lines[1][$accountancy_code_receivable_on_assignment] = -($disposal_amount + $disposal_amount_vat);
- if ($disposal_subject_to_vat) $lines[1][$accountancy_code_vat_collected] = $disposal_amount_vat;
+ if ($disposal_subject_to_vat) {
+ $lines[1][$accountancy_code_vat_collected] = $disposal_amount_vat;
+ }
$lines[1][$accountancy_code_proceeds_from_sales] = $disposal_amount;
foreach ($lines as $lines_block) {
@@ -925,7 +931,9 @@ class AccountingJournal extends CommonObject
{
global $conf, $langs, $hookmanager;
- if (empty($sep)) $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
+ if (empty($sep)) {
+ $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
+ }
$out = '';
// Hook
@@ -976,7 +984,9 @@ class AccountingJournal extends CommonObject
);
}
- if (!empty($header)) $out .= '"' . implode('"' . $sep . '"', $header) . '"' . "\n";
+ if (!empty($header)) {
+ $out .= '"' . implode('"' . $sep . '"', $header) . '"' . "\n";
+ }
foreach ($journal_data as $element_id => $element) {
foreach ($element['blocks'] as $lines) {
foreach ($lines as $line) {
diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php
index b0e2cea6c76..b9bd1b75780 100644
--- a/htdocs/accountancy/class/bookkeeping.class.php
+++ b/htdocs/accountancy/class/bookkeeping.class.php
@@ -2474,7 +2474,9 @@ class BookKeeping extends CommonObject
$sql = "SELECT rowid, label, date_start, date_end, statut";
$sql .= " FROM " . $this->db->prefix() . "accounting_fiscalyear";
$sql .= " WHERE entity = " . ((int) $conf->entity);
- if (!empty($filter)) $sql .= " AND (" . $filter . ')';
+ if (!empty($filter)) {
+ $sql .= " AND (" . $filter . ')';
+ }
$sql .= $this->db->order('date_start', 'ASC');
$resql = $this->db->query($sql);
diff --git a/htdocs/accountancy/class/lettering.class.php b/htdocs/accountancy/class/lettering.class.php
index 5cda6cad5b4..e31b6e803e7 100644
--- a/htdocs/accountancy/class/lettering.class.php
+++ b/htdocs/accountancy/class/lettering.class.php
@@ -469,9 +469,15 @@ class Lettering extends BookKeeping
$group_error++;
break;
}
- if (!isset($lettering_code)) $lettering_code = (string) $line_infos['lettering_code'];
- if (!empty($line_infos['lettering_code'])) $do_it = true;
- } elseif (!empty($line_infos['lettering_code'])) $do_it = false;
+ if (!isset($lettering_code)) {
+ $lettering_code = (string) $line_infos['lettering_code'];
+ }
+ if (!empty($line_infos['lettering_code'])) {
+ $do_it = true;
+ }
+ } elseif (!empty($line_infos['lettering_code'])) {
+ $do_it = false;
+ }
}
// Check balance amount
@@ -482,8 +488,11 @@ class Lettering extends BookKeeping
// Lettering/Unlettering the group of bookkeeping lines
if (!$group_error && $do_it) {
- if ($unlettering) $result = $this->deleteLettering($bookkeeping_lines);
- else $result = $this->updateLettering($bookkeeping_lines);
+ if ($unlettering) {
+ $result = $this->deleteLettering($bookkeeping_lines);
+ } else {
+ $result = $this->updateLettering($bookkeeping_lines);
+ }
if ($result < 0) {
$group_error++;
} elseif ($result > 0) {
@@ -534,7 +543,9 @@ class Lettering extends BookKeeping
$sql .= " AND pn.piece_num = ab.piece_num";
$sql .= " )";
}
- if ($only_has_subledger_account) $sql .= " AND ab.subledger_account != ''";
+ if ($only_has_subledger_account) {
+ $sql .= " AND ab.subledger_account != ''";
+ }
dol_syslog(__METHOD__ . " - Get all bookkeeping lines", LOG_DEBUG);
$resql = $this->db->query($sql);
@@ -608,7 +619,9 @@ class Lettering extends BookKeeping
$sql .= " AND dpn.piece_num = ab.piece_num";
$sql .= " )";
$sql .= ")";
- if ($only_has_subledger_account) $sql .= " AND ab.subledger_account != ''";
+ if ($only_has_subledger_account) {
+ $sql .= " AND ab.subledger_account != ''";
+ }
dol_syslog(__METHOD__ . " - Get all bookkeeping lines linked", LOG_DEBUG);
$resql = $this->db->query($sql);
@@ -629,7 +642,9 @@ class Lettering extends BookKeeping
}
$this->db->free($resql);
- if (!empty($group)) $grouped_lines[] = $group;
+ if (!empty($group)) {
+ $grouped_lines[] = $group;
+ }
}
}
@@ -831,7 +846,9 @@ class Lettering extends BookKeeping
foreach ($element_ids as $element_id) {
// Continue if element id in not found
- if (!isset($link_by_element[$element_id])) continue;
+ if (!isset($link_by_element[$element_id])) {
+ continue;
+ }
// Set the element in the current group
$current_group[$element_id] = $element_id;
diff --git a/htdocs/accountancy/closure/index.php b/htdocs/accountancy/closure/index.php
index 37592abb2d2..3920cd1ef54 100644
--- a/htdocs/accountancy/closure/index.php
+++ b/htdocs/accountancy/closure/index.php
@@ -184,9 +184,16 @@ if (isset($current_fiscal_period)) {
'value' => $current_fiscal_period['date_end']
);
- $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?fiscal_period_id=' . $current_fiscal_period['id'],
- $langs->trans('ValidateMovements'), $langs->trans('DescValidateMovements', $langs->transnoentitiesnoconv("RegistrationInAccounting")),
- 'confirm_step_1', $form_question, '', 1, 300);
+ $formconfirm = $form->formconfirm(
+ $_SERVER["PHP_SELF"] . '?fiscal_period_id=' . $current_fiscal_period['id'],
+ $langs->trans('ValidateMovements'),
+ $langs->trans('DescValidateMovements', $langs->transnoentitiesnoconv("RegistrationInAccounting")),
+ 'confirm_step_1',
+ $form_question,
+ '',
+ 1,
+ 300
+ );
} elseif ($action == 'step_2') {
$form_question = array();
@@ -214,9 +221,16 @@ if (isset($current_fiscal_period)) {
'value' => 0
);
- $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?fiscal_period_id=' . $current_fiscal_period['id'],
- $langs->trans('AccountancyClosureClose'), $langs->trans('AccountancyClosureConfirmClose'),
- 'confirm_step_2', $form_question, '', 1, 300);
+ $formconfirm = $form->formconfirm(
+ $_SERVER["PHP_SELF"] . '?fiscal_period_id=' . $current_fiscal_period['id'],
+ $langs->trans('AccountancyClosureClose'),
+ $langs->trans('AccountancyClosureConfirmClose'),
+ 'confirm_step_2',
+ $form_question,
+ '',
+ 1,
+ 300
+ );
} elseif ($action == 'step_3') {
$form_question = array();
@@ -249,9 +263,15 @@ if (isset($current_fiscal_period)) {
'label' => $langs->trans('DateEnd'),
'value' => $current_fiscal_period['date_end']
);
- $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?fiscal_period_id=' . $current_fiscal_period['id'],
- $langs->trans('AccountancyClosureAccountingReversal'), $langs->trans('AccountancyClosureConfirmAccountingReversal'),
- 'confirm_step_3', $form_question, '', 1, 300
+ $formconfirm = $form->formconfirm(
+ $_SERVER["PHP_SELF"] . '?fiscal_period_id=' . $current_fiscal_period['id'],
+ $langs->trans('AccountancyClosureAccountingReversal'),
+ $langs->trans('AccountancyClosureConfirmAccountingReversal'),
+ 'confirm_step_3',
+ $form_question,
+ '',
+ 1,
+ 300
);
}
}
@@ -309,7 +329,9 @@ if (isset($current_fiscal_period)) {
print '';
$nb_years = is_array($count_by_month['list']) ? count($count_by_month['list']) : 0;
- if ($nb_years > 1) print '| ' . $langs->trans("Year") . ' | ';
+ if ($nb_years > 1) {
+ print '' . $langs->trans("Year") . ' | ';
+ }
for ($i = 1; $i <= 12; $i++) {
print '' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . ' | ';
}
@@ -319,7 +341,9 @@ if (isset($current_fiscal_period)) {
if (is_array($count_by_month['list'])) {
foreach ($count_by_month['list'] as $info) {
print '
';
- if ($nb_years > 1) print '| ' . $info['year'] . ' | ';
+ if ($nb_years > 1) {
+ print '' . $info['year'] . ' | ';
+ }
for ($i = 1; $i <= 12; $i++) {
print '' . ((int) $info['count'][$i]) . ' | ';
}
diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php
index 61c945450e9..14e69593c02 100644
--- a/htdocs/accountancy/customer/index.php
+++ b/htdocs/accountancy/customer/index.php
@@ -288,7 +288,7 @@ if ($action == 'validatehistory') {
$db->rollback();
} else {
$db->commit();
- setEventMessages($langs->trans('AutomaticBindingDone', $nbbinddone, $notpossible), null, ($notpossible ? 'warnings' : 'mesgs'));
+ setEventMessages($langs->trans('AutomaticBindingDone', $nbbinddone, $notpossible), null, ($notpossible ? 'warnings' : 'mesgs'));
if ($nbbindfailed) {
setEventMessages($langs->trans('DoManualBindingForFailedRecord', $nbbindfailed), null, 'warnings');
}
@@ -666,15 +666,21 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
if ($j > 12) {
$j -= 12;
}
- $sql .= " SUM(".$db->ifsql("MONTH(f.datef)=".$j,
- " (".$db->ifsql("fd.total_ht < 0",
+ $sql .= " SUM(".$db->ifsql(
+ "MONTH(f.datef)=".$j,
+ " (".$db->ifsql(
+ "fd.total_ht < 0",
" (-1 * (abs(fd.total_ht) - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100))))", // TODO This is bugged, we must use the percent for the invoice and fd.situation_percent is cumulated percent !
- " (fd.total_ht - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100)))").")",
- 0).") AS month".str_pad($j, 2, '0', STR_PAD_LEFT).",";
+ " (fd.total_ht - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100)))"
+ ).")",
+ 0
+ ).") AS month".str_pad($j, 2, '0', STR_PAD_LEFT).",";
}
- $sql .= " SUM(".$db->ifsql("fd.total_ht < 0",
+ $sql .= " SUM(".$db->ifsql(
+ "fd.total_ht < 0",
" (-1 * (abs(fd.total_ht) - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100))))", // TODO This is bugged, we must use the percent for the invoice and fd.situation_percent is cumulated percent !
- " (fd.total_ht - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100)))").") as total";
+ " (fd.total_ht - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100)))"
+ ).") as total";
} else {
$sql = "SELECT '".$db->escape($langs->trans("Vide"))."' AS marge,";
for ($i = 1; $i <= 12; $i++) {
@@ -682,15 +688,21 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
if ($j > 12) {
$j -= 12;
}
- $sql .= " SUM(".$db->ifsql("MONTH(f.datef)=".$j,
- " (".$db->ifsql("fd.total_ht < 0",
+ $sql .= " SUM(".$db->ifsql(
+ "MONTH(f.datef)=".$j,
+ " (".$db->ifsql(
+ "fd.total_ht < 0",
" (-1 * (abs(fd.total_ht) - (fd.buy_price_ht * fd.qty)))",
- " (fd.total_ht - (fd.buy_price_ht * fd.qty))").")",
- 0).") AS month".str_pad($j, 2, '0', STR_PAD_LEFT).",";
+ " (fd.total_ht - (fd.buy_price_ht * fd.qty))"
+ ).")",
+ 0
+ ).") AS month".str_pad($j, 2, '0', STR_PAD_LEFT).",";
}
- $sql .= " SUM(".$db->ifsql("fd.total_ht < 0",
+ $sql .= " SUM(".$db->ifsql(
+ "fd.total_ht < 0",
" (-1 * (abs(fd.total_ht) - (fd.buy_price_ht * fd.qty)))",
- " (fd.total_ht - (fd.buy_price_ht * fd.qty))").") as total";
+ " (fd.total_ht - (fd.buy_price_ht * fd.qty))"
+ ).") as total";
}
$sql .= " FROM ".MAIN_DB_PREFIX."facturedet as fd";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = fd.fk_facture";
diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php
index ded4fc84db6..3e312a220ef 100644
--- a/htdocs/accountancy/customer/list.php
+++ b/htdocs/accountancy/customer/list.php
@@ -80,7 +80,7 @@ if (empty($search_date_start) && getDolGlobalString('ACCOUNTING_DATE_START_BINDI
}
// Load variable for pagination
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
@@ -126,7 +126,8 @@ if (!$user->hasRight('accounting', 'mouvements', 'lire')) {
*/
if (GETPOST('cancel', 'alpha')) {
- $action = 'list'; $massaction = '';
+ $action = 'list';
+ $massaction = '';
}
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
$massaction = '';
@@ -694,7 +695,7 @@ if ($result) {
if ($product_static->tva_tx !== $facture_static_det->tva_tx && price2num($product_static->tva_tx) && price2num($facture_static_det->tva_tx)) { // Note: having a vat rate of 0 is often the normal case when sells is intra b2b or to export
$code_vat_differ = 'warning bold';
}
- print '';
+ print ' | ';
print vatrate($facture_static_det->tva_tx.($facture_static_det->vat_src_code ? ' ('.$facture_static_det->vat_src_code.')' : ''));
print ' | ';
@@ -714,7 +715,8 @@ if ($result) {
print '';
// First show default account for any products
$s = '1. '.(($facture_static_det->product_type == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': ';
- $shelp = ''; $ttype = 'help';
+ $shelp = '';
+ $ttype = 'help';
if ($suggestedaccountingaccountbydefaultfor == 'eec') {
$shelp .= $langs->trans("SaleEEC");
} elseif ($suggestedaccountingaccountbydefaultfor == 'eecwithvat') {
@@ -731,7 +733,8 @@ if ($result) {
if ($product_static->id > 0) {
print ' ';
$s = '2. '.(($facture_static_det->product_type == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': ';
- $shelp = ''; $ttype = 'help';
+ $shelp = '';
+ $ttype = 'help';
if ($suggestedaccountingaccountfor == 'eec') {
$shelp = $langs->trans("SaleEEC");
} elseif ($suggestedaccountingaccountfor == 'eecwithvat') {
diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php
index db31387b78e..0f0b5ec146c 100644
--- a/htdocs/accountancy/expensereport/index.php
+++ b/htdocs/accountancy/expensereport/index.php
@@ -166,7 +166,7 @@ if ($action == 'validatehistory') {
$db->rollback();
} else {
$db->commit();
- setEventMessages($langs->trans('AutomaticBindingDone', $nbbinddone, $notpossible), null, ($notpossible ? 'warnings' : 'mesgs'));
+ setEventMessages($langs->trans('AutomaticBindingDone', $nbbinddone, $notpossible), null, ($notpossible ? 'warnings' : 'mesgs'));
if ($nbbindfailed) {
setEventMessages($langs->trans('DoManualBindingForFailedRecord', $nbbindfailed), null, 'warnings');
}
diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php
index f862cc5f226..2f9c4e70e8e 100644
--- a/htdocs/accountancy/expensereport/lines.php
+++ b/htdocs/accountancy/expensereport/lines.php
@@ -59,7 +59,7 @@ $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_s
$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
// Load variable for pagination
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php
index 21d58356c3e..a1d405f5725 100644
--- a/htdocs/accountancy/expensereport/list.php
+++ b/htdocs/accountancy/expensereport/list.php
@@ -73,7 +73,7 @@ if (empty($search_date_start) && getDolGlobalString('ACCOUNTING_DATE_START_BINDI
}
// Load variable for pagination
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
@@ -119,7 +119,8 @@ if (!$user->hasRight('accounting', 'mouvements', 'lire')) {
*/
if (GETPOST('cancel', 'alpha')) {
- $action = 'list'; $massaction = '';
+ $action = 'list';
+ $massaction = '';
}
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
$massaction = '';
@@ -482,7 +483,7 @@ if ($result) {
// Fees label
print ' | ';
- print ($langs->trans($objp->type_fees_code) == $objp->type_fees_code ? $objp->type_fees_label : $langs->trans(($objp->type_fees_code)));
+ print($langs->trans($objp->type_fees_code) == $objp->type_fees_code ? $objp->type_fees_label : $langs->trans(($objp->type_fees_code)));
print ' | ';
// Fees description -- Can be null
diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php
index eeeb28d5179..e9cb8de0705 100644
--- a/htdocs/accountancy/journal/bankjournal.php
+++ b/htdocs/accountancy/journal/bankjournal.php
@@ -315,7 +315,9 @@ if ($result) {
}
// Now loop on each link of record in bank (code similar to bankentries_list.php)
foreach ($links as $key => $val) {
- if ($links[$key]['type'] == 'user' && !$is_sc) continue;
+ if ($links[$key]['type'] == 'user' && !$is_sc) {
+ continue;
+ }
if (in_array($links[$key]['type'], array('sc', 'payment_sc', 'payment', 'payment_supplier', 'payment_vat', 'payment_expensereport', 'banktransfert', 'payment_donation', 'member', 'payment_loan', 'payment_salary', 'payment_various'))) {
// So we excluded 'company' and 'user' here. We want only payment lines
@@ -1105,7 +1107,7 @@ if (empty($action) || $action == 'view') {
if (getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER') == "" || getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER') == '-1'
|| getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER') == "" || getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER') == '-1'
|| getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT') == "" || getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT') == '-1') {
- print ($desc ? '' : '
').''.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
+ print($desc ? '' : '
').'
'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
$desc = ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '{link}');
$desc = str_replace('{link}', ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'', $desc);
print $desc;
diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php
index 214b548949b..ed03d708b79 100644
--- a/htdocs/accountancy/journal/purchasesjournal.php
+++ b/htdocs/accountancy/journal/purchasesjournal.php
@@ -216,7 +216,7 @@ if ($result) {
$vatdata = $vatdata_cache[$tax_id];
} else {
$vatdata = getTaxesFromId($tax_id, $mysoc, $mysoc, 0);
- $vatdata_cache[$tax_id] = $vatdata;
+ $vatdata_cache[$tax_id] = $vatdata;
}
$compta_tva = (!empty($vatdata['accountancy_code_buy']) ? $vatdata['accountancy_code_buy'] : $cpttva);
$compta_localtax1 = (!empty($vatdata['accountancy_code_buy']) ? $vatdata['accountancy_code_buy'] : $cpttva);
@@ -293,9 +293,9 @@ if ($result) {
$tabrclocaltax2[$obj->rowid][$rcd_compta_localtax2] = 0;
}
- $rcvat = (double) price2num($obj->total_ttc * $obj->product_buy_vat / 100, 'MT');
- $rclocalvat1 = (double) price2num($obj->total_ttc * $obj->product_buy_localvat1 / 100, 'MT');
- $rclocalvat2 = (double) price2num($obj->total_ttc * $obj->product_buy_localvat2 / 100, 'MT');
+ $rcvat = (float) price2num($obj->total_ttc * $obj->product_buy_vat / 100, 'MT');
+ $rclocalvat1 = (float) price2num($obj->total_ttc * $obj->product_buy_localvat1 / 100, 'MT');
+ $rclocalvat2 = (float) price2num($obj->total_ttc * $obj->product_buy_localvat2 / 100, 'MT');
$tabrctva[$obj->rowid][$rcd_compta_tva] += $rcvat;
$tabrctva[$obj->rowid][$rcc_compta_tva] -= $rcvat;
@@ -799,19 +799,19 @@ if ($action == 'exportcsv' && !$error) { // ISO and not UTF8 !
// Third party
foreach ($tabttc[$key] as $k => $mt) {
//if ($mt) {
- print '"'.$key.'"'.$sep;
- print '"'.$date.'"'.$sep;
- print '"'.$val["refsologest"].'"'.$sep;
- print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
- print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
- print '"'.length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER')).'"'.$sep;
- print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
- print '"'.$langs->trans("Thirdparty").'"'.$sep;
- print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$val["refsuppliersologest"].' - '.$langs->trans("Thirdparty").'"'.$sep;
- print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
- print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep;
- print '"'.$journal.'"';
- print "\n";
+ print '"'.$key.'"'.$sep;
+ print '"'.$date.'"'.$sep;
+ print '"'.$val["refsologest"].'"'.$sep;
+ print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
+ print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
+ print '"'.length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER')).'"'.$sep;
+ print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
+ print '"'.$langs->trans("Thirdparty").'"'.$sep;
+ print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$val["refsuppliersologest"].' - '.$langs->trans("Thirdparty").'"'.$sep;
+ print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
+ print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep;
+ print '"'.$journal.'"';
+ print "\n";
//}
}
@@ -820,19 +820,19 @@ if ($action == 'exportcsv' && !$error) { // ISO and not UTF8 !
$accountingaccount = new AccountingAccount($db);
$accountingaccount->fetch(null, $k, true);
//if ($mt) {
- print '"'.$key.'"'.$sep;
- print '"'.$date.'"'.$sep;
- print '"'.$val["refsologest"].'"'.$sep;
- print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
- print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
- print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
- print '""'.$sep;
- print '"'.utf8_decode(dol_trunc($accountingaccount->label, 32)).'"'.$sep;
- print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$val["refsuppliersologest"].' - '.dol_trunc($accountingaccount->label, 32).'"'.$sep;
- print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep;
- print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
- print '"'.$journal.'"';
- print "\n";
+ print '"'.$key.'"'.$sep;
+ print '"'.$date.'"'.$sep;
+ print '"'.$val["refsologest"].'"'.$sep;
+ print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
+ print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
+ print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
+ print '""'.$sep;
+ print '"'.utf8_decode(dol_trunc($accountingaccount->label, 32)).'"'.$sep;
+ print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$val["refsuppliersologest"].' - '.dol_trunc($accountingaccount->label, 32).'"'.$sep;
+ print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep;
+ print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
+ print '"'.$journal.'"';
+ print "\n";
//}
}
diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php
index 9a4e5561f46..5ca5c164007 100644
--- a/htdocs/accountancy/journal/sellsjournal.php
+++ b/htdocs/accountancy/journal/sellsjournal.php
@@ -219,7 +219,7 @@ if ($result) {
$vatdata = $vatdata_cache[$tax_id];
} else {
$vatdata = getTaxesFromId($tax_id, $mysoc, $mysoc, 0);
- $vatdata_cache[$tax_id] = $vatdata;
+ $vatdata_cache[$tax_id] = $vatdata;
}
$compta_tva = (!empty($vatdata['accountancy_code_sell']) ? $vatdata['accountancy_code_sell'] : $cpttva);
$compta_localtax1 = (!empty($vatdata['accountancy_code_sell']) ? $vatdata['accountancy_code_sell'] : $cpttva);
@@ -249,7 +249,7 @@ if ($result) {
}
}
- $revenuestamp = (double) price2num($obj->revenuestamp, 'MT');
+ $revenuestamp = (float) price2num($obj->revenuestamp, 'MT');
// Invoice lines
$tabfac[$obj->rowid]["date"] = $db->jdate($obj->df);
@@ -291,7 +291,7 @@ if ($result) {
// Move a part of the retained warrenty into the account of warranty
if (getDolGlobalString('INVOICE_USE_RETAINED_WARRANTY') && $obj->retained_warranty > 0) {
- $retained_warranty = (double) price2num($total_ttc * $obj->retained_warranty / 100, 'MT'); // Calculate the amount of warrenty for this line (using the percent value)
+ $retained_warranty = (float) price2num($total_ttc * $obj->retained_warranty / 100, 'MT'); // Calculate the amount of warrenty for this line (using the percent value)
$tabwarranty[$obj->rowid][$compta_soc] += $retained_warranty;
$total_ttc -= $retained_warranty;
}
@@ -309,7 +309,7 @@ if ($result) {
if (!empty($revenuestamp)) {
$sqlrevenuestamp = "SELECT accountancy_code_sell FROM ".MAIN_DB_PREFIX."c_revenuestamp";
$sqlrevenuestamp .= " WHERE fk_pays = ".((int) $mysoc->country_id);
- $sqlrevenuestamp .= " AND taux = ".((double) $revenuestamp);
+ $sqlrevenuestamp .= " AND taux = ".((float) $revenuestamp);
$sqlrevenuestamp .= " AND active = 1";
$resqlrevenuestamp = $db->query($sqlrevenuestamp);
@@ -879,19 +879,19 @@ if ($action == 'exportcsv' && !$error) { // ISO and not UTF8 !
// Third party
foreach ($tabttc[$key] as $k => $mt) {
//if ($mt) {
- print '"'.$key.'"'.$sep;
- print '"'.$date.'"'.$sep;
- print '"'.$val["ref"].'"'.$sep;
- print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
- print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
- print '"'.length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER')).'"'.$sep;
- print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
- print '"'.$langs->trans("Thirdparty").'"'.$sep;
- print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$invoicestatic->ref.' - '.$langs->trans("Thirdparty").'"'.$sep;
- print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep;
- print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
- print '"'.$journal.'"';
- print "\n";
+ print '"'.$key.'"'.$sep;
+ print '"'.$date.'"'.$sep;
+ print '"'.$val["ref"].'"'.$sep;
+ print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
+ print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
+ print '"'.length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER')).'"'.$sep;
+ print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
+ print '"'.$langs->trans("Thirdparty").'"'.$sep;
+ print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$invoicestatic->ref.' - '.$langs->trans("Thirdparty").'"'.$sep;
+ print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep;
+ print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
+ print '"'.$journal.'"';
+ print "\n";
//}
}
@@ -900,19 +900,19 @@ if ($action == 'exportcsv' && !$error) { // ISO and not UTF8 !
$accountingaccount = new AccountingAccount($db);
$accountingaccount->fetch(null, $k, true);
//if ($mt) {
- print '"'.$key.'"'.$sep;
- print '"'.$date.'"'.$sep;
- print '"'.$val["ref"].'"'.$sep;
- print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
- print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
- print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
- print '""'.$sep;
- print '"'.utf8_decode(dol_trunc($accountingaccount->label, 32)).'"'.$sep;
- print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.dol_trunc($accountingaccount->label, 32).'"'.$sep;
- print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
- print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep;
- print '"'.$journal.'"';
- print "\n";
+ print '"'.$key.'"'.$sep;
+ print '"'.$date.'"'.$sep;
+ print '"'.$val["ref"].'"'.$sep;
+ print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
+ print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
+ print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
+ print '""'.$sep;
+ print '"'.utf8_decode(dol_trunc($accountingaccount->label, 32)).'"'.$sep;
+ print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.dol_trunc($accountingaccount->label, 32).'"'.$sep;
+ print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
+ print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep;
+ print '"'.$journal.'"';
+ print "\n";
//}
}
@@ -1280,7 +1280,7 @@ if (empty($action) || $action == 'view') {
//var_dump($arrayofvat[$key]); var_dump($key); var_dump($k);
$tmpvatrate = (empty($def_tva[$key][$k]) ? (empty($arrayofvat[$key][$k]) ? '' : $arrayofvat[$key][$k]) : join(', ', $def_tva[$key][$k]));
print ' - '.$langs->trans("Taxes").' '.$tmpvatrate.' %';
- print ($numtax ? ' - Localtax '.$numtax : '');
+ print($numtax ? ' - Localtax '.$numtax : '');
print "";
print '
'.($mt < 0 ? price(-$mt) : '')." | ";
print ''.($mt >= 0 ? price($mt) : '')." | ";
diff --git a/htdocs/accountancy/journal/variousjournal.php b/htdocs/accountancy/journal/variousjournal.php
index f7d1831ee87..7d496cee5a0 100644
--- a/htdocs/accountancy/journal/variousjournal.php
+++ b/htdocs/accountancy/journal/variousjournal.php
@@ -76,8 +76,12 @@ if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end))
}
$data_type = 'view';
-if ($action == 'writebookkeeping') $data_type = 'bookkeeping';
-if ($action == 'exportcsv') $data_type = 'csv';
+if ($action == 'writebookkeeping') {
+ $data_type = 'bookkeeping';
+}
+if ($action == 'exportcsv') {
+ $data_type = 'csv';
+}
$journal_data = $object->getData($user, $data_type, $date_start, $date_end, $in_bookkeeping);
if (!is_array($journal_data)) {
setEventMessages($object->error, $object->errors, 'errors');
@@ -247,7 +251,9 @@ if ($object->nature == 4) { // Bank journal
print '
' . img_warning() . ' ' . $langs->trans("TheJournalCodeIsNotDefinedOnSomeBankAccount");
print ' : ' . $langs->trans("AccountancyAreaDescBank", 9, '' . $langs->transnoentitiesnoconv("MenuAccountancy") . '-' . $langs->transnoentitiesnoconv("Setup") . "-" . $langs->transnoentitiesnoconv("BankAccounts") . '');
}
- } else dol_print_error($db);
+ } else {
+ dol_print_error($db);
+ }
}
// Button to write into Ledger
@@ -288,8 +294,12 @@ print '
';
$object_label = $langs->trans("ObjectsRef");
-if ($object->nature == 2 || $object->nature == 3) $object_label = $langs->trans("InvoiceRef");
-if ($object->nature == 5) $object_label = $langs->trans("ExpenseReportRef");
+if ($object->nature == 2 || $object->nature == 3) {
+ $object_label = $langs->trans("InvoiceRef");
+}
+if ($object->nature == 5) {
+ $object_label = $langs->trans("ExpenseReportRef");
+}
// Show result array
@@ -305,7 +315,9 @@ print '' . $langs->trans("Piece") . ' (' . $object_label . ') | ';
print '' . $langs->trans("AccountAccounting") . ' | ';
print '' . $langs->trans("SubledgerAccount") . ' | ';
print '' . $langs->trans("LabelOperation") . ' | ';
-if ($object->nature == 4) print '' . $langs->trans("PaymentMode") . ' | '; // bank
+if ($object->nature == 4) {
+ print '' . $langs->trans("PaymentMode") . ' | ';
+} // bank
print '' . $langs->trans("AccountingDebit") . ' | ';
print '' . $langs->trans("AccountingCredit") . ' | ';
print "
\n";
@@ -320,7 +332,9 @@ if (is_array($journal_data) && !empty($journal_data)) {
print '' . $line['account_accounting'] . ' | ';
print '' . $line['subledger_account'] . ' | ';
print '' . $line['label_operation'] . ' | ';
- if ($object->nature == 4) print '' . $line['payment_mode'] . ' | ';
+ if ($object->nature == 4) {
+ print '' . $line['payment_mode'] . ' | ';
+ }
print '' . $line['debit'] . ' | ';
print '' . $line['credit'] . ' | ';
print '';
diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php
index 5dbfa51a470..fd07ac82704 100644
--- a/htdocs/accountancy/supplier/index.php
+++ b/htdocs/accountancy/supplier/index.php
@@ -286,7 +286,7 @@ if ($action == 'validatehistory') {
$db->rollback();
} else {
$db->commit();
- setEventMessages($langs->trans('AutomaticBindingDone', $nbbinddone, $notpossible), null, ($notpossible ? 'warnings' : 'mesgs'));
+ setEventMessages($langs->trans('AutomaticBindingDone', $nbbinddone, $notpossible), null, ($notpossible ? 'warnings' : 'mesgs'));
if ($nbbindfailed) {
setEventMessages($langs->trans('DoManualBindingForFailedRecord', $nbbindfailed), null, 'warnings');
}
diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php
index 7709806fbb2..ac35e048744 100644
--- a/htdocs/accountancy/supplier/lines.php
+++ b/htdocs/accountancy/supplier/lines.php
@@ -67,7 +67,7 @@ $search_country = GETPOST('search_country', 'alpha');
$search_tvaintra = GETPOST('search_tvaintra', 'alpha');
// Load variable for pagination
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php
index 4e7a4b801f6..6573f18503f 100644
--- a/htdocs/accountancy/supplier/list.php
+++ b/htdocs/accountancy/supplier/list.php
@@ -77,7 +77,7 @@ $search_country = GETPOST('search_country', 'alpha');
$search_tvaintra = GETPOST('search_tvaintra', 'alpha');
// Load variable for pagination
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
@@ -128,7 +128,8 @@ if (empty($search_date_start) && getDolGlobalString('ACCOUNTING_DATE_START_BINDI
*/
if (GETPOST('cancel', 'alpha')) {
- $action = 'list'; $massaction = '';
+ $action = 'list';
+ $massaction = '';
}
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
$massaction = '';
@@ -699,7 +700,7 @@ if ($result) {
//if ($objp->vat_tx_l != $objp->vat_tx_p && price2num($objp->vat_tx_p) && price2num($objp->vat_tx_l)) { // Note: having a vat rate of 0 is often the normal case when sells is intra b2b or to export
// $code_vat_differ = 'warning bold';
//}
- print '';
+ print ' | ';
print vatrate($facturefourn_static_det->tva_tx.($facturefourn_static_det->vat_src_code ? ' ('.$facturefourn_static_det->vat_src_code.')' : ''), false, 0, 0, 1);
print ' | ';
@@ -718,7 +719,8 @@ if ($result) {
// Found accounts
print '';
$s = '1. '.(($facturefourn_static_det->product_type == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': ';
- $shelp = ''; $ttype = 'help';
+ $shelp = '';
+ $ttype = 'help';
if ($suggestedaccountingaccountbydefaultfor == 'eec') {
$shelp .= $langs->trans("SaleEEC");
} elseif ($suggestedaccountingaccountbydefaultfor == 'eecwithvat') {
@@ -734,7 +736,8 @@ if ($result) {
if ($product_static->id > 0) {
print ' ';
$s = '2. '.(($facturefourn_static_det->product_type == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': ';
- $shelp = ''; $ttype = 'help';
+ $shelp = '';
+ $ttype = 'help';
if ($suggestedaccountingaccountfor == 'eec') {
$shelp = $langs->trans("SaleEEC");
} elseif ($suggestedaccountingaccountfor == 'eecwithvat') {
diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php
index 0ec4a3afdbf..06cd83397c4 100644
--- a/htdocs/adherents/admin/member.php
+++ b/htdocs/adherents/admin/member.php
@@ -269,7 +269,7 @@ foreach ($dirModMember as $dirroot) {
dol_syslog($e->getMessage(), LOG_ERR);
continue;
}
- $modCodeMember = new $file;
+ $modCodeMember = new $file();
// Show modules according to features level
if ($modCodeMember->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
@@ -518,7 +518,7 @@ foreach ($dirmodels as $reldir) {
if ($modulequalified) {
print ' | | ';
- print (empty($module->name) ? $name : $module->name);
+ print(empty($module->name) ? $name : $module->name);
print " | \n";
if (method_exists($module, 'info')) {
print $module->info($langs);
diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php
index 90f36033f71..ef217d65871 100644
--- a/htdocs/adherents/agenda.php
+++ b/htdocs/adherents/agenda.php
@@ -38,10 +38,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$langs->loadLangs(array('companies', 'members'));
// Get Parameters
-$id = GETPOST('id', 'int') ?GETPOST('id', 'int') : GETPOST('rowid', 'int');
+$id = GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('rowid', 'int');
// Pagination
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
@@ -64,7 +64,7 @@ if (GETPOST('actioncode', 'array')) {
$actioncode = '0';
}
} else {
- $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
+ $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
}
$search_rowid = GETPOST('search_rowid');
$search_agenda_label = GETPOST('search_agenda_label');
diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php
index 0aa5d7b88fa..4ecdad298ff 100644
--- a/htdocs/adherents/card.php
+++ b/htdocs/adherents/card.php
@@ -57,7 +57,7 @@ $cancel = GETPOST('cancel', 'alpha');
$backtopage = GETPOST('backtopage', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
$rowid = GETPOST('rowid', 'int');
-$id = GETPOST('id') ?GETPOST('id', 'int') : $rowid;
+$id = GETPOST('id') ? GETPOST('id', 'int') : $rowid;
$typeid = GETPOST('typeid', 'int');
$userid = GETPOST('userid', 'int');
$socid = GETPOST('socid', 'int');
@@ -616,7 +616,7 @@ if (empty($reshook)) {
}
}
}
- $action = ($result < 0 || !$error) ? '' : 'create';
+ $action = ($result < 0 || !$error) ? '' : 'create';
if (!$error && $backtopage) {
header("Location: ".$backtopage);
@@ -1022,7 +1022,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$morphys["phy"] = $langs->trans("Physical");
$morphys["mor"] = $langs->trans("Moral");
print ' |
| '.$langs->trans("MemberNature")." | \n";
- print $form->selectarray("morphy", $morphys, (GETPOST('morphy', 'alpha') ?GETPOST('morphy', 'alpha') : $object->morphy), 1, 0, 0, '', 0, 0, 0, '', '', 1);
+ print $form->selectarray("morphy", $morphys, (GETPOST('morphy', 'alpha') ? GETPOST('morphy', 'alpha') : $object->morphy), 1, 0, 0, '', 0, 0, 0, '', '', 1);
print " | \n";
// Company
@@ -1058,7 +1058,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Address
print '
| '.$langs->trans("Address").' | ';
- print '';
+ print '';
print ' |
';
// Zip / Town
@@ -1154,11 +1154,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if ($action == 'edit') {
$res = $object->fetch($id);
if ($res < 0) {
- dol_print_error($db, $object->error); exit;
+ dol_print_error($db, $object->error);
+ exit;
}
$res = $object->fetch_optionals();
if ($res < 0) {
- dol_print_error($db); exit;
+ dol_print_error($db);
+ exit;
}
$adht = new AdherentType($db);
@@ -1307,7 +1309,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Website
print '| '.$form->editfieldkey('Web', 'member_url', GETPOST('member_url', 'alpha'), $object, 0).' | ';
- print ''.img_picto('', 'globe', 'class="pictofixedwidth"').' |
';
+ print ''.img_picto('', 'globe', 'class="pictofixedwidth"').' | ';
// Address
print '| '.$langs->trans("Address").' | ';
@@ -1356,7 +1358,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if (!$value['active']) {
break;
}
- print ' |
| '.$langs->trans($value['label']).' | |
';
+ print '| '.$langs->trans($value['label']).' | |
';
}
}
@@ -1435,17 +1437,20 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if ($id > 0 && $action != 'edit') {
$res = $object->fetch($id);
if ($res < 0) {
- dol_print_error($db, $object->error); exit;
+ dol_print_error($db, $object->error);
+ exit;
}
$res = $object->fetch_optionals();
if ($res < 0) {
- dol_print_error($db); exit;
+ dol_print_error($db);
+ exit;
}
$adht = new AdherentType($db);
$res = $adht->fetch($object->typeid);
if ($res < 0) {
- dol_print_error($db); exit;
+ dol_print_error($db);
+ exit;
}
diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php
index 7809e791c3f..fcfe87209c0 100644
--- a/htdocs/adherents/cartes/carte.php
+++ b/htdocs/adherents/cartes/carte.php
@@ -306,7 +306,7 @@ foreach (array_keys($_Avery_Labels) as $codecards) {
$arrayoflabels[$codecards] = $_Avery_Labels[$codecards]['name'];
}
asort($arrayoflabels);
-print $form->selectarray('model', $arrayoflabels, (GETPOST('model') ?GETPOST('model') : (!getDolGlobalString('ADHERENT_CARD_TYPE') ? '' : $conf->global->ADHERENT_CARD_TYPE)), 1, 0, 0, '', 0, 0, 0, '', '', 1);
+print $form->selectarray('model', $arrayoflabels, (GETPOST('model') ? GETPOST('model') : (!getDolGlobalString('ADHERENT_CARD_TYPE') ? '' : $conf->global->ADHERENT_CARD_TYPE)), 1, 0, 0, '', 0, 0, 0, '', '', 1);
print '
'.$langs->trans("Login").': ';
print '
';
print '';
diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php
index 7926675123a..6a86ba3018d 100644
--- a/htdocs/adherents/class/adherent.class.php
+++ b/htdocs/adherents/class/adherent.class.php
@@ -634,7 +634,7 @@ class Adherent extends CommonObject
try {
require_once $modfile;
$modname = getDolGlobalString('MEMBER_CODEMEMBER_ADDON');
- $modCodeMember = new $modname;
+ $modCodeMember = new $modname();
$this->ref = $modCodeMember->getNextValue($mysoc, $this);
} catch (Exception $e) {
dol_syslog($e->getMessage(), LOG_ERR);
@@ -728,7 +728,7 @@ class Adherent extends CommonObject
$this->state_id = ($this->state_id > 0 ? $this->state_id : $this->state_id);
$this->note_public = ($this->note_public ? $this->note_public : $this->note_public);
$this->note_private = ($this->note_private ? $this->note_private : $this->note_private);
- $this->url = $this->url ?clean_url($this->url, 0) : '';
+ $this->url = $this->url ? clean_url($this->url, 0) : '';
$this->setUpperOrLowerCase();
// Check parameters
if (getDolGlobalString('ADHERENT_MAIL_REQUIRED') && !isValidEMail($this->email)) {
@@ -2328,7 +2328,7 @@ class Adherent extends CommonObject
$label = $langs->trans("ShowUser");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
- $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
+ $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
}
@@ -3229,7 +3229,7 @@ class Adherent extends CommonObject
return $nbko;
}
- /**
+ /**
* Return clicable link of object (with eventually picto)
*
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php
index 0a15cd66524..c75ec565b35 100644
--- a/htdocs/adherents/class/adherent_type.class.php
+++ b/htdocs/adherents/class/adherent_type.class.php
@@ -276,7 +276,7 @@ class AdherentType extends CommonObject
return 1;
}
- /**
+ /**
* Delete a language for this member type
*
* @param string $langtodelete Language code to delete
@@ -401,7 +401,7 @@ class AdherentType extends CommonObject
$sql .= "caneditamount = ".((int) $this->caneditamount).",";
$sql .= "duration = '".$this->db->escape($this->duration_value.$this->duration_unit)."',";
$sql .= "note = '".$this->db->escape($this->note_public)."',";
- $sql .= "vote = ".(integer) $this->db->escape($this->vote).",";
+ $sql .= "vote = ".(int) $this->db->escape($this->vote).",";
$sql .= "mail_valid = '".$this->db->escape($this->mail_valid)."'";
$sql .= " WHERE rowid =".((int) $this->id);
@@ -469,7 +469,9 @@ class AdherentType extends CommonObject
// Call trigger
$result = $this->call_trigger('MEMBER_TYPE_DELETE', $user);
if ($result < 0) {
- $error++; $this->db->rollback(); return -2;
+ $error++;
+ $this->db->rollback();
+ return -2;
}
// End call triggers
@@ -765,7 +767,7 @@ class AdherentType extends CommonObject
}
}
$linkstart = '';
$linkend = '';
@@ -775,7 +777,7 @@ class AdherentType extends CommonObject
$result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), (' class="'.(($withpicto != 2) ? 'paddingright' : '').'"'), 0, 0, $notooltip ? 0 : 1);
}
if ($withpicto != 2) {
- $result .= ($maxlen ?dol_trunc($this->label, $maxlen) : $this->label);
+ $result .= ($maxlen ? dol_trunc($this->label, $maxlen) : $this->label);
}
$result .= $linkend;
diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php
index a658e942cb9..1f02258fae9 100644
--- a/htdocs/adherents/document.php
+++ b/htdocs/adherents/document.php
@@ -123,7 +123,7 @@ if ($id > 0) {
$result = $membert->fetch($object->typeid);
if ($result > 0) {
// Build file list
- $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
+ $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC), 1);
$totalsize = 0;
foreach ($filearray as $key => $file) {
$totalsize += $file['size'];
diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php
index a3f5498aa08..cfe398b920b 100644
--- a/htdocs/adherents/list.php
+++ b/htdocs/adherents/list.php
@@ -47,7 +47,7 @@ $show_files = GETPOST('show_files', 'int');
$confirm = GETPOST('confirm', 'alpha');
$cancel = GETPOST('cancel', 'alpha');
$toselect = GETPOST('toselect', 'array');
-$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'memberslist'; // To manage different context of search
+$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'memberslist'; // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha');
$optioncss = GETPOST('optioncss', 'aZ');
$mode = GETPOST('mode', 'alpha');
@@ -91,14 +91,14 @@ if ($statut != '') {
$search_status = $statut; // For backward compatibility
}
-$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
+$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
if ($search_status < -2) {
$search_status = '';
}
// Pagination parameters
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
diff --git a/htdocs/adherents/partnership.php b/htdocs/adherents/partnership.php
index 38f0886d2f9..aaed1e30234 100644
--- a/htdocs/adherents/partnership.php
+++ b/htdocs/adherents/partnership.php
@@ -129,7 +129,9 @@ if (empty($reshook)) {
}
$object->fields['fk_member']['visible'] = 0;
-if ($object->id > 0 && $object->status == $object::STATUS_REFUSED && empty($action)) $object->fields['reason_decline_or_cancel']['visible'] = 1;
+if ($object->id > 0 && $object->status == $object::STATUS_REFUSED && empty($action)) {
+ $object->fields['reason_decline_or_cancel']['visible'] = 1;
+}
$object->fields['note_public']['visible'] = 1;
diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php
index 56789510e88..4dc2f756df1 100644
--- a/htdocs/adherents/stats/geo.php
+++ b/htdocs/adherents/stats/geo.php
@@ -32,7 +32,7 @@ $graphwidth = DolGraph::getDefaultGraphSizeForStats('width', 700);
$mapratio = 0.5;
$graphheight = round($graphwidth * $mapratio);
-$mode = GETPOST('mode') ?GETPOST('mode') : '';
+$mode = GETPOST('mode') ? GETPOST('mode') : '';
// Security check
@@ -77,7 +77,7 @@ if ($mode == 'memberbyregion') {
llxHeader('', $title, '', '', 0, 0, $arrayjs);
-print load_fiche_titre($title, '', $memberstatic->picto);
+print load_fiche_titre($title, '', $memberstatic->picto);
//dol_mkdir($dir);
@@ -173,7 +173,7 @@ if ($mode) {
if ($mode == 'memberbyregion') { //+
$data[] = array(
'label'=>(($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? img_picto('', DOL_URL_ROOT.'/theme/common/flags/'.strtolower($obj->code).'.png', '', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')),
- 'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label :''.$langs->trans("Unknown").'')),
+ 'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : ''.$langs->trans("Unknown").'')),
'label2'=>($obj->label2 ? $obj->label2 : ''.$langs->trans("Unknown").''),
'nb'=>$obj->nb,
'lastdate'=>$db->jdate($obj->lastdate),
diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php
index d1b5e9c9514..850cd20b831 100644
--- a/htdocs/adherents/subscription/card.php
+++ b/htdocs/adherents/subscription/card.php
@@ -50,7 +50,7 @@ $typeid = (int) GETPOST('typeid', 'int');
$amount = price2num(GETPOST('amount', 'alpha'), 'MT');
if (!$user->hasRight('adherent', 'cotisation', 'lire')) {
- accessforbidden();
+ accessforbidden();
}
$permissionnote = $user->hasRight('adherent', 'cotisation', 'creer'); // Used by the include of actions_setnotes.inc.php
diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php
index cc662e441da..aacb12729f3 100644
--- a/htdocs/adherents/subscription/list.php
+++ b/htdocs/adherents/subscription/list.php
@@ -43,7 +43,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
$mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...)
-$statut = (GETPOSTISSET("statut") ?GETPOST("statut", "alpha") : 1);
+$statut = (GETPOSTISSET("statut") ? GETPOST("statut", "alpha") : 1);
$search_ref = GETPOST('search_ref', 'alpha');
$search_type = GETPOST('search_type', 'alpha');
$search_lastname = GETPOST('search_lastname', 'alpha');
diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php
index fa06b3cafd7..91f3fc328d4 100644
--- a/htdocs/adherents/type.php
+++ b/htdocs/adherents/type.php
@@ -200,7 +200,7 @@ if ($action == 'update' && $user->hasRight('adherent', 'configurer')) {
$object->note_public = trim($comment);
$object->note_private = '';
$object->mail_valid = trim($mail_valid);
- $object->vote = (boolean) trim($vote);
+ $object->vote = (bool) trim($vote);
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
@@ -534,7 +534,7 @@ if ($rowid > 0) {
// Amount
print '| '.$langs->trans("Amount").' | ';
- print ((is_null($object->amount) || $object->amount === '') ? '' : ''.price($object->amount).'');
+ print((is_null($object->amount) || $object->amount === '') ? '' : ''.price($object->amount).'');
print ' |
';
print '| '.$form->textwithpicto($langs->trans("CanEditAmountShort"), $langs->transnoentities("CanEditAmount")).' | ';
@@ -551,7 +551,7 @@ if ($rowid > 0) {
} elseif ($object->duration_value > 0) {
$dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hour"), "d"=>$langs->trans("Day"), "w"=>$langs->trans("Week"), "m"=>$langs->trans("Month"), "y"=>$langs->trans("Year"));
}
- print (!empty($object->duration_unit) && isset($dur[$object->duration_unit]) ? $langs->trans($dur[$object->duration_unit]) : '')." ";
+ print(!empty($object->duration_unit) && isset($dur[$object->duration_unit]) ? $langs->trans($dur[$object->duration_unit]) : '')." ";
print ' |
';
print '| '.$langs->trans("Description").' | ';
@@ -972,7 +972,7 @@ if ($rowid > 0) {
print ' |
| '.$langs->trans("Amount").' | ';
print '';
print ' |
';
diff --git a/htdocs/adherents/type_translation.php b/htdocs/adherents/type_translation.php
index 38988d4aa34..55ee3bbd697 100644
--- a/htdocs/adherents/type_translation.php
+++ b/htdocs/adherents/type_translation.php
@@ -216,7 +216,7 @@ if ($action == 'edit') {
$s = picto_from_langcode($key);
print '
';
print '';
- print ($s ? $s.' ' : '').''.$langs->trans('Language_'.$key).':';
+ print($s ? $s.' ' : '').''.$langs->trans('Language_'.$key).':';
print '
';
print '';
print '
id.'&action=delete&token='.newToken().'&langtodelete='.$key.'">'.img_delete('', 'class="valigntextbottom"')."";
@@ -242,7 +242,7 @@ if ($action == 'edit') {
foreach ($object->multilangs as $key => $value) {
$s = picto_from_langcode($key);
print '
';
- print ($s ? $s.' ' : '').''.$langs->trans('Language_'.$key).':';
+ print($s ? $s.' ' : '').''.$langs->trans('Language_'.$key).':';
print '
';
print '
';
print '
id.'&action=delete&token='.newToken().'&langtodelete='.$key.'">'.img_delete('', 'class="valigntextbottom"').'';
diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php
index 8dac970e6fe..66a1aa7a3b1 100644
--- a/htdocs/admin/accountant.php
+++ b/htdocs/admin/accountant.php
@@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
$action = GETPOST('action', 'aZ09');
-$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'adminaccoutant'; // To manage different context of search
+$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'adminaccoutant'; // To manage different context of search
// Load translation files required by the page
$langs->loadLangs(array('admin', 'companies'));
@@ -54,19 +54,19 @@ if ($reshook < 0) {
if (($action == 'update' && !GETPOST("cancel", 'alpha'))
|| ($action == 'updateedit')) {
- dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_NAME", GETPOST("nom", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_ADDRESS", GETPOST("address", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_TOWN", GETPOST("town", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_ZIP", GETPOST("zipcode", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_STATE", GETPOST("state_id", 'int'), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_REGION", GETPOST("region_code", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_COUNTRY", GETPOST('country_id', 'int'), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_PHONE", GETPOST("tel", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_FAX", GETPOST("fax", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_MAIL", GETPOST("mail", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_WEB", GETPOST("web", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_CODE", GETPOST("code", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_NOTE", GETPOST("note", 'restricthtml'), 'chaine', 0, '', $conf->entity);
+ dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_NAME", GETPOST("nom", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
+ dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_ADDRESS", GETPOST("address", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
+ dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_TOWN", GETPOST("town", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
+ dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_ZIP", GETPOST("zipcode", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
+ dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_STATE", GETPOST("state_id", 'int'), 'chaine', 0, '', $conf->entity);
+ dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_REGION", GETPOST("region_code", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
+ dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_COUNTRY", GETPOST('country_id', 'int'), 'chaine', 0, '', $conf->entity);
+ dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_PHONE", GETPOST("tel", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
+ dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_FAX", GETPOST("fax", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
+ dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_MAIL", GETPOST("mail", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
+ dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_WEB", GETPOST("web", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
+ dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_CODE", GETPOST("code", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
+ dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_NOTE", GETPOST("note", 'restricthtml'), 'chaine', 0, '', $conf->entity);
if ($action != 'updateedit' && !$error) {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
diff --git a/htdocs/admin/accounting.php b/htdocs/admin/accounting.php
index 18d383a1b3c..a891deddd8c 100644
--- a/htdocs/admin/accounting.php
+++ b/htdocs/admin/accounting.php
@@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
$action = GETPOST('action', 'aZ09');
-$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'adminaccoutant'; // To manage different context of search
+$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'adminaccoutant'; // To manage different context of search
// Load translation files required by the page
$langs->loadLangs(array('admin', 'companies', 'accountancy'));
diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php
index b7d81769364..4a47e07e245 100644
--- a/htdocs/admin/agenda.php
+++ b/htdocs/admin/agenda.php
@@ -91,7 +91,7 @@ if ($action == "save" && empty($cancel)) {
foreach ($triggers as $trigger) {
$keyparam = 'MAIN_AGENDA_ACTIONAUTO_'.$trigger['code'];
if ($search_event === '' || preg_match('/'.preg_quote($search_event, '/').'/i', $keyparam)) {
- $res = dolibarr_set_const($db, $keyparam, (GETPOST($keyparam, 'alpha') ?GETPOST($keyparam, 'alpha') : ''), 'chaine', 0, '', $conf->entity);
+ $res = dolibarr_set_const($db, $keyparam, (GETPOST($keyparam, 'alpha') ? GETPOST($keyparam, 'alpha') : ''), 'chaine', 0, '', $conf->entity);
if (!($res > 0)) {
$error++;
}
diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php
index a158a97b279..1abdeab9733 100644
--- a/htdocs/admin/agenda_extsites.php
+++ b/htdocs/admin/agenda_extsites.php
@@ -107,7 +107,8 @@ if (preg_match('/set_(.*)/', $action, $reg)) {
$disableext = GETPOST('AGENDA_DISABLE_EXT', 'alpha');
$res = dolibarr_set_const($db, 'AGENDA_DISABLE_EXT', $disableext, 'chaine', 0, '', $conf->entity);
- $i = 1; $errorsaved = 0;
+ $i = 1;
+ $errorsaved = 0;
// Save agendas
while ($i <= $MAXAGENDA) {
@@ -204,7 +205,11 @@ print "
\n";
$selectedvalue = getDolGlobalInt('AGENDA_DISABLE_EXT');
-if ($selectedvalue==1) $selectedvalue=0; else $selectedvalue=1;
+if ($selectedvalue==1) {
+ $selectedvalue=0;
+} else {
+ $selectedvalue=1;
+}
print "
";
diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php
index fdf566f156b..d29ab9b0b5f 100644
--- a/htdocs/admin/agenda_other.php
+++ b/htdocs/admin/agenda_other.php
@@ -121,7 +121,9 @@ if ($action == 'set') {
$commande->thirdparty = $specimenthirdparty;
// Search template files
- $file = ''; $classname = ''; $filefound = 0;
+ $file = '';
+ $classname = '';
+ $filefound = 0;
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) {
$file = dol_buildpath($reldir."core/modules/action/doc/pdf_".$modele.".modules.php", 0);
@@ -251,7 +253,7 @@ if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
print ''."\n";
print "| ";
- print (empty($module->name) ? $name : $module->name);
+ print(empty($module->name) ? $name : $module->name);
print " | \n";
print "\n";
require_once $dir.'/'.$file;
diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php
index dc4c7aa82a8..766b8222ed6 100644
--- a/htdocs/admin/agenda_reminder.php
+++ b/htdocs/admin/agenda_reminder.php
@@ -84,7 +84,9 @@ if ($action == 'set') {
$commande->thirdparty = $specimenthirdparty;
// Search template files
- $file = ''; $classname = ''; $filefound = 0;
+ $file = '';
+ $classname = '';
+ $filefound = 0;
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) {
$file = dol_buildpath($reldir."core/modules/action/doc/pdf_".$modele.".modules.php", 0);
diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php
index e8f951a4734..5c84c3c8966 100644
--- a/htdocs/admin/agenda_xcal.php
+++ b/htdocs/admin/agenda_xcal.php
@@ -177,37 +177,37 @@ $getentity = ($conf->entity > 1 ? "&entity=".$conf->entity : "");
// Show message
$message = '';
-$urlvcal = '';
-$urlvcal .= $urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'';
+$urlvcal = '';
+$urlvcal .= $urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'';
$message .= img_picto('', 'globe').' '.str_replace('{url}', $urlvcal, ''.$langs->trans("WebCalUrlForVCalExport", 'vcal', '').'');
$message .= '';
$message .= ajax_autoselect('onlinepaymenturl1');
$message .= ' ';
-$urlical = '';
-$urlical .= $urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'';
+$urlical = '';
+$urlical .= $urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'';
$message .= img_picto('', 'globe').' '.str_replace('{url}', $urlical, ''.$langs->trans("WebCalUrlForVCalExport", 'ical/ics', '').'');
$message .= '';
$message .= ajax_autoselect('onlinepaymenturl2');
$message .= ' ';
-$urlrss = '';
-$urlrss .= $urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'';
+$urlrss = '';
+$urlrss .= $urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'';
$message .= img_picto('', 'globe').' '.str_replace('{url}', $urlrss, ''.$langs->trans("WebCalUrlForVCalExport", 'rss', '').'');
$message .= '';
$message .= ajax_autoselect('onlinepaymenturl3');
diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php
index 8446510b65b..7e29be5e759 100644
--- a/htdocs/admin/bank.php
+++ b/htdocs/admin/bank.php
@@ -88,7 +88,8 @@ if ($action == 'setbankcolorizemovement') {
if ($actionsave) {
$db->begin();
- $i = 1; $errorsaved = 0;
+ $i = 1;
+ $errorsaved = 0;
$error = 0;
// Save colors
@@ -445,7 +446,7 @@ if (getDolGlobalInt('BANK_COLORIZE_MOVEMENT')) {
print ' | '.$langs->trans("BankColorizeMovementName".$key)." | ";
// Color
print '';
- print $formother->selectColor((GETPOST("BANK_COLORIZE_MOVEMENT_COLOR".$key) ?GETPOST("BANK_COLORIZE_MOVEMENT_COLOR".$key) : $conf->global->$color), "BANK_COLORIZE_MOVEMENT_COLOR".$key, 'bankmovementcolorconfig', 1, '', 'right hideifnotset');
+ print $formother->selectColor((GETPOST("BANK_COLORIZE_MOVEMENT_COLOR".$key) ? GETPOST("BANK_COLORIZE_MOVEMENT_COLOR".$key) : $conf->global->$color), "BANK_COLORIZE_MOVEMENT_COLOR".$key, 'bankmovementcolorconfig', 1, '', 'right hideifnotset');
print ' | ';
print "
";
$i++;
diff --git a/htdocs/admin/bom.php b/htdocs/admin/bom.php
index c0b0e100aea..9435f55868d 100644
--- a/htdocs/admin/bom.php
+++ b/htdocs/admin/bom.php
@@ -74,7 +74,9 @@ if ($action == 'updateMask') {
$bom->initAsSpecimen();
// Search template files
- $file = ''; $classname = ''; $filefound = 0;
+ $file = '';
+ $classname = '';
+ $filefound = 0;
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) {
$file = dol_buildpath($reldir."core/modules/bom/doc/pdf_".$modele.".modules.php", 0);
@@ -354,7 +356,7 @@ foreach ($dirmodels as $reldir) {
if ($modulequalified) {
print '| ';
- print (empty($module->name) ? $name : $module->name);
+ print(empty($module->name) ? $name : $module->name);
print " | \n";
if (method_exists($module, 'info')) {
print $module->info($langs);
diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php
index 2c79c34978d..189fb532e1f 100644
--- a/htdocs/admin/boxes.php
+++ b/htdocs/admin/boxes.php
@@ -348,7 +348,7 @@ foreach ($boxtoadd as $box) {
$langs->load("errors");
print $langs->trans("WarningUsingThisBoxSlowDown");
} else {
- print ($box->note ? $box->note : ' ');
+ print($box->note ? $box->note : ' ');
}
print ' | '."\n";
print '';
@@ -404,7 +404,7 @@ foreach ($boxactivated as $key => $box) {
if ($box->note == '(WarningUsingThisBoxSlowDown)') {
print img_warning('', 0).' '.$langs->trans("WarningUsingThisBoxSlowDown");
} else {
- print ($box->note ? $box->note : ' ');
+ print($box->note ? $box->note : ' ');
}
print ' | ';
print '';
@@ -415,8 +415,8 @@ foreach ($boxactivated as $key => $box) {
$hasprevious = ($key != 0);
print ' | '.($key + 1).' | ';
print '';
- print ($hasnext ? ''.img_down().' ' : '');
- print ($hasprevious ? ''.img_up().'' : '');
+ print($hasnext ? ''.img_down().' ' : '');
+ print($hasprevious ? ''.img_up().'' : '');
print ' | ';
print '';
print ''.img_delete().'';
diff --git a/htdocs/admin/chequereceipts.php b/htdocs/admin/chequereceipts.php
index 15ce18dcd26..01dd7dcd2db 100644
--- a/htdocs/admin/chequereceipts.php
+++ b/htdocs/admin/chequereceipts.php
@@ -162,7 +162,7 @@ foreach ($dirmodels as $reldir) {
if ($module->isEnabled()) {
print ' |
| ';
- print (empty($module->name) ? $name : $module->name);
+ print(empty($module->name) ? $name : $module->name);
print " | \n";
print $module->info($langs);
diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php
index b0713455ba2..445535a55e4 100644
--- a/htdocs/admin/commande.php
+++ b/htdocs/admin/commande.php
@@ -84,7 +84,9 @@ if ($action == 'updateMask') {
$commande->initAsSpecimen();
// Search template files
- $file = ''; $classname = ''; $filefound = 0;
+ $file = '';
+ $classname = '';
+ $filefound = 0;
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) {
$file = dol_buildpath($reldir."core/modules/commande/doc/pdf_".$modele.".modules.php", 0);
@@ -437,7 +439,7 @@ foreach ($dirmodels as $reldir) {
if ($modulequalified) {
print ' |
| ';
- print (empty($module->name) ? $name : $module->name);
+ print(empty($module->name) ? $name : $module->name);
print " | \n";
if (method_exists($module, 'info')) {
print $module->info($langs);
diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php
index 02f426575eb..11590149cbb 100644
--- a/htdocs/admin/company.php
+++ b/htdocs/admin/company.php
@@ -40,7 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
$action = GETPOST('action', 'aZ09');
-$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'admincompany'; // To manage different context of search
+$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'admincompany'; // To manage different context of search
// Load translation files required by the page
$langs->loadLangs(array('admin', 'companies', 'bills'));
diff --git a/htdocs/admin/company_socialnetworks.php b/htdocs/admin/company_socialnetworks.php
index 41759274ce6..426b5a8eeb3 100644
--- a/htdocs/admin/company_socialnetworks.php
+++ b/htdocs/admin/company_socialnetworks.php
@@ -33,7 +33,7 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
$action = GETPOST('action', 'aZ09');
-$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'admincompany'; // To manage different context of search
+$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'admincompany'; // To manage different context of search
// Load translation files required by the page
$langs->loadLangs(array('admin', 'companies'));
diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php
index de5c6fb0173..f290df752bc 100644
--- a/htdocs/admin/const.php
+++ b/htdocs/admin/const.php
@@ -41,7 +41,7 @@ $constname = GETPOST('constname', 'alphanohtml');
$constvalue = GETPOST('constvalue', 'restricthtml'); // We should be able to send everything here
$constnote = GETPOST('constnote', 'alpha');
// Load variable for pagination
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php
index b6f4b698191..73304f1488e 100644
--- a/htdocs/admin/contract.php
+++ b/htdocs/admin/contract.php
@@ -80,7 +80,9 @@ if ($action == 'updateMask') {
$contract->initAsSpecimen();
// Search template files
- $file = ''; $classname = ''; $filefound = 0;
+ $file = '';
+ $classname = '';
+ $filefound = 0;
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) {
$file = dol_buildpath($reldir."core/modules/contract/doc/pdf_".$modele.".modules.php", 0);
@@ -386,7 +388,7 @@ foreach ($dirmodels as $reldir) {
if ($modulequalified) {
print ' |
| ';
- print (empty($module->name) ? $name : $module->name);
+ print(empty($module->name) ? $name : $module->name);
print " | \n";
if (method_exists($module, 'info')) {
print $module->info($langs);
diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php
index f3c6826309b..bf7eb7d27bf 100644
--- a/htdocs/admin/defaultvalues.php
+++ b/htdocs/admin/defaultvalues.php
@@ -46,7 +46,7 @@ $optioncss = GETPOST('optionscss', 'alphanohtml');
$mode = GETPOST('mode', 'aZ09') ? GETPOST('mode', 'aZ09') : 'createform'; // 'createform', 'filters', 'sortorder', 'focus'
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
@@ -83,7 +83,8 @@ $object = new DefaultValues($db);
*/
if (GETPOST('cancel', 'alpha')) {
- $action = 'list'; $massaction = '';
+ $action = 'list';
+ $massaction = '';
}
if (!GETPOST('confirmmassaction', 'alpha') && !empty($massaction) && $massaction != 'presend' && $massaction != 'confirm_presend') {
$massaction = '';
@@ -365,21 +366,30 @@ if (!is_array($result) && $result < 0) {
// Page
print ' | ';
- if ($action != 'edit' || GETPOST('rowid', 'int') != $defaultvalue->id) print $defaultvalue->page;
- else print '';
+ if ($action != 'edit' || GETPOST('rowid', 'int') != $defaultvalue->id) {
+ print $defaultvalue->page;
+ } else {
+ print '';
+ }
print ' | '."\n";
// Field
print '';
- if ($action != 'edit' || GETPOST('rowid') != $defaultvalue->id) print $defaultvalue->param;
- else print '';
+ if ($action != 'edit' || GETPOST('rowid') != $defaultvalue->id) {
+ print $defaultvalue->param;
+ } else {
+ print '';
+ }
print ' | '."\n";
// Value
if ($mode != 'focus' && $mode != 'mandatory') {
print '';
- if ($action != 'edit' || GETPOST('rowid') != $defaultvalue->id) print dol_escape_htmltag($defaultvalue->value);
- else print '';
+ if ($action != 'edit' || GETPOST('rowid') != $defaultvalue->id) {
+ print dol_escape_htmltag($defaultvalue->value);
+ } else {
+ print '';
+ }
print ' | ';
}
@@ -392,7 +402,7 @@ if (!is_array($result) && $result < 0) {
// Actions
print '';
- if ($action != 'edit' || GETPOST('rowid') != $defaultvalue->id) {
+ if ($action != 'edit' || GETPOST('rowid') != $defaultvalue->id) {
print ''.img_edit().'';
print ''.img_delete().'';
} else {
diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php
index d5006c939cc..804797237b8 100644
--- a/htdocs/admin/delais.php
+++ b/htdocs/admin/delais.php
@@ -331,7 +331,8 @@ if (!getDolGlobalString('MAIN_DISABLE_METEO') || $conf->global->MAIN_DISABLE_MET
if (getDolGlobalString('MAIN_METEO_LEVEL3')) {
$level3 = $conf->global->MAIN_METEO_LEVEL3;
}
- $text = ''; $options = 'class="valignmiddle" height="60px"';
+ $text = '';
+ $options = 'class="valignmiddle" height="60px"';
if ($action == 'edit') {
@@ -373,9 +374,7 @@ if (!getDolGlobalString('MAIN_DISABLE_METEO') || $conf->global->MAIN_DISABLE_MET
print '';
print '';
- print '';
-
- ?>
+ print ''; ?>
|