mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Clean code
This commit is contained in:
parent
600eb2b23b
commit
e74c50aa8a
|
|
@ -95,7 +95,7 @@ $arrayfields = array(
|
|||
'aa.import_key'=>array('label'=>"ImportId", 'checked'=>-1)
|
||||
);
|
||||
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL < 2) {
|
||||
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
|
||||
unset($arrayfields['categories']);
|
||||
unset($arrayfields['aa.reconcilable']);
|
||||
}
|
||||
|
|
@ -146,7 +146,7 @@ if (empty($reshook)) {
|
|||
$search_array_options = array();
|
||||
}
|
||||
if ((GETPOST('valid_change_chart', 'alpha') && GETPOST('chartofaccounts', 'int') > 0) // explicit click on button 'Change and load' with js on
|
||||
|| (GETPOST('chartofaccounts', 'int') > 0 && GETPOST('chartofaccounts', 'int') != $conf->global->CHARTOFACCOUNTS)) { // a submit of form is done and chartofaccounts combo has been modified
|
||||
|| (GETPOST('chartofaccounts', 'int') > 0 && GETPOST('chartofaccounts', 'int') != getDolGlobalInt('CHARTOFACCOUNTS'))) { // a submit of form is done and chartofaccounts combo has been modified
|
||||
if ($chartofaccounts > 0 && $permissiontoadd) {
|
||||
// Get language code for this $chartofaccounts
|
||||
$sql = 'SELECT code FROM '.MAIN_DB_PREFIX.'c_country as c, '.MAIN_DB_PREFIX.'accounting_system as a';
|
||||
|
|
@ -228,7 +228,7 @@ if ($action == 'delete') {
|
|||
print $formconfirm;
|
||||
}
|
||||
|
||||
$pcgver = $conf->global->CHARTOFACCOUNTS;
|
||||
$pcgver = getDolGlobalInt('CHARTOFACCOUNTS');
|
||||
|
||||
$sql = "SELECT aa.rowid, aa.fk_pcg_version, aa.pcg_type, aa.account_number, aa.account_parent, aa.label, aa.labelshort, aa.fk_accounting_category,";
|
||||
$sql .= " aa.reconcilable, aa.active, aa.import_key,";
|
||||
|
|
@ -240,8 +240,8 @@ $sql .= " WHERE asy.rowid = ".((int) $pcgver);
|
|||
//print $sql;
|
||||
if (strlen(trim($search_account))) {
|
||||
$lengthpaddingaccount = 0;
|
||||
if ($conf->global->ACCOUNTING_LENGTH_GACCOUNT || $conf->global->ACCOUNTING_LENGTH_AACCOUNT) {
|
||||
$lengthpaddingaccount = max($conf->global->ACCOUNTING_LENGTH_GACCOUNT, $conf->global->ACCOUNTING_LENGTH_AACCOUNT);
|
||||
if (getDolGlobalInt('ACCOUNTING_LENGTH_GACCOUNT') || getDolGlobalInt('ACCOUNTING_LENGTH_AACCOUNT')) {
|
||||
$lengthpaddingaccount = max(getDolGlobalInt('ACCOUNTING_LENGTH_GACCOUNT'), getDolGlobalInt('ACCOUNTING_LENGTH_AACCOUNT'));
|
||||
}
|
||||
$search_account_tmp = $search_account;
|
||||
$weremovedsomezero = 0;
|
||||
|
|
@ -289,7 +289,7 @@ $sql .= $db->order($sortfield, $sortorder);
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$resql = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($resql);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ if ($action == 'add' && $user->hasRight('accounting', 'chartofaccount')) {
|
|||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors');
|
||||
$action = 'create';
|
||||
} else {
|
||||
$sql = "SELECT pcg_version FROM " . MAIN_DB_PREFIX . "accounting_system WHERE rowid = ".((int) $conf->global->CHARTOFACCOUNTS);
|
||||
$sql = "SELECT pcg_version FROM " . MAIN_DB_PREFIX . "accounting_system WHERE rowid = ".((int) getDolGlobalInt('CHARTOFACCOUNTS'));
|
||||
|
||||
dol_syslog('accountancy/admin/card.php:: $sql=' . $sql);
|
||||
$result = $db->query($sql);
|
||||
|
|
@ -139,7 +139,7 @@ if ($action == 'add' && $user->hasRight('accounting', 'chartofaccount')) {
|
|||
} else {
|
||||
$result = $object->fetch($id);
|
||||
|
||||
$sql = "SELECT pcg_version FROM ".MAIN_DB_PREFIX."accounting_system WHERE rowid=".((int) $conf->global->CHARTOFACCOUNTS);
|
||||
$sql = "SELECT pcg_version FROM ".MAIN_DB_PREFIX."accounting_system WHERE rowid=".((int) getDolGlobalInt('CHARTOFACCOUNTS'));
|
||||
|
||||
dol_syslog('accountancy/admin/card.php:: $sql=' . $sql);
|
||||
$result2 = $db->query($sql);
|
||||
|
|
@ -211,7 +211,7 @@ $form = new Form($db);
|
|||
$formaccounting = new FormAccounting($db);
|
||||
|
||||
$accountsystem = new AccountancySystem($db);
|
||||
$accountsystem->fetch($conf->global->CHARTOFACCOUNTS);
|
||||
$accountsystem->fetch(getDolGlobalInt('CHARTOFACCOUNTS'));
|
||||
|
||||
$title = $langs->trans('AccountAccounting')." - ".$langs->trans('Card');
|
||||
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ $sql .= $db->order($sortfield, $sortorder);
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
|
|
|
|||
|
|
@ -361,7 +361,7 @@ print '</tr>';
|
|||
foreach ($list as $key) {
|
||||
print '<tr class="oddeven value">';
|
||||
|
||||
if (!empty($conf->global->ACCOUNTING_MANAGE_ZERO) && ($key == 'ACCOUNTING_LENGTH_GACCOUNT' || $key == 'ACCOUNTING_LENGTH_AACCOUNT')) {
|
||||
if (getDolGlobalInt('ACCOUNTING_MANAGE_ZERO') && ($key == 'ACCOUNTING_LENGTH_GACCOUNT' || $key == 'ACCOUNTING_LENGTH_AACCOUNT')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -394,7 +394,7 @@ if (empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
|
|||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$resql = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($resql);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ $arrayfields = array(
|
|||
'reconcilable'=>array('label'=>$langs->trans("Reconcilable"), 'checked'=>1)
|
||||
);
|
||||
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL < 2) {
|
||||
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
|
||||
unset($arrayfields['reconcilable']);
|
||||
}
|
||||
|
||||
|
|
@ -137,8 +137,8 @@ $sql .= " AND sa.code_compta <> ''";
|
|||
//print $sql;
|
||||
if (strlen(trim($search_subaccount))) {
|
||||
$lengthpaddingaccount = 0;
|
||||
if ($conf->global->ACCOUNTING_LENGTH_AACCOUNT) {
|
||||
$lengthpaddingaccount = max($conf->global->ACCOUNTING_LENGTH_AACCOUNT);
|
||||
if (getDolGlobalInt('ACCOUNTING_LENGTH_AACCOUNT')) {
|
||||
$lengthpaddingaccount = getDolGlobalInt('ACCOUNTING_LENGTH_AACCOUNT');
|
||||
}
|
||||
$search_subaccount_tmp = $search_subaccount;
|
||||
$weremovedsomezero = 0;
|
||||
|
|
@ -184,8 +184,8 @@ $sql .= " AND sa.code_compta_fournisseur <> ''";
|
|||
//print $sql;
|
||||
if (strlen(trim($search_subaccount))) {
|
||||
$lengthpaddingaccount = 0;
|
||||
if ($conf->global->ACCOUNTING_LENGTH_AACCOUNT) {
|
||||
$lengthpaddingaccount = max($conf->global->ACCOUNTING_LENGTH_AACCOUNT);
|
||||
if (getDolGlobalInt('ACCOUNTING_LENGTH_AACCOUNT')) {
|
||||
$lengthpaddingaccount = getDolGlobalInt('ACCOUNTING_LENGTH_AACCOUNT');
|
||||
}
|
||||
$search_subaccount_tmp = $search_subaccount;
|
||||
$weremovedsomezero = 0;
|
||||
|
|
@ -231,8 +231,8 @@ $sql .= " AND u.accountancy_code <> ''";
|
|||
//print $sql;
|
||||
if (strlen(trim($search_subaccount))) {
|
||||
$lengthpaddingaccount = 0;
|
||||
if ($conf->global->ACCOUNTING_LENGTH_AACCOUNT) {
|
||||
$lengthpaddingaccount = max($conf->global->ACCOUNTING_LENGTH_AACCOUNT);
|
||||
if (getDolGlobalInt('ACCOUNTING_LENGTH_AACCOUNT')) {
|
||||
$lengthpaddingaccount = getDolGlobalInt('ACCOUNTING_LENGTH_AACCOUNT');
|
||||
}
|
||||
$search_subaccount_tmp = $search_subaccount;
|
||||
$weremovedsomezero = 0;
|
||||
|
|
@ -274,7 +274,7 @@ $sql .= $db->order($sortfield, $sortorder);
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$resql = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($resql);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
|
|
|
|||
|
|
@ -254,7 +254,7 @@ llxHeader('', $title_page);
|
|||
if ($action != 'export_csv') {
|
||||
// List
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
if ($type == 'sub') {
|
||||
$nbtotalofrecords = $object->fetchAllBalance($sortorder, $sortfield, 0, 0, $filter, 'AND', 1);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -670,7 +670,7 @@ $title_page = $langs->trans("Operations").' - '.$langs->trans("ExportAccountancy
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -665,7 +665,7 @@ $title_page = $langs->trans("Operations").' - '.$langs->trans("Journals");
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -559,7 +559,7 @@ llxHeader('', $title_page);
|
|||
|
||||
// List
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
// TODO Perf Replace this by a count
|
||||
if ($type == 'sub') {
|
||||
$nbtotalofrecords = $object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter, 'AND', 1, 1);
|
||||
|
|
|
|||
|
|
@ -466,7 +466,7 @@ class AccountancyCategory // extends CommonObject
|
|||
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_account as aa";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
|
||||
$sql .= " WHERE (aa.fk_accounting_category <> ".((int) $id)." OR aa.fk_accounting_category IS NULL)";
|
||||
$sql .= " AND asy.rowid = ".((int) $conf->global->CHARTOFACCOUNTS);
|
||||
$sql .= " AND asy.rowid = ".((int) getDolGlobalInt('CHARTOFACCOUNTS'));
|
||||
$sql .= " AND aa.active = 1";
|
||||
$sql .= " AND aa.entity = ".$conf->entity;
|
||||
$sql .= " GROUP BY aa.account_number, aa.label";
|
||||
|
|
@ -512,7 +512,7 @@ class AccountancyCategory // extends CommonObject
|
|||
$sql = "SELECT aa.rowid, aa.account_number";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_account as aa";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
|
||||
$sql .= " AND asy.rowid = ".((int) $conf->global->CHARTOFACCOUNTS);
|
||||
$sql .= " AND asy.rowid = ".((int) getDolGlobalInt('CHARTOFACCOUNTS'));
|
||||
$sql .= " AND aa.active = 1";
|
||||
$sql .= " AND aa.entity = ".$conf->entity;
|
||||
$sql .= " ORDER BY LENGTH(aa.account_number) DESC;"; // LENGTH is ok with mysql and postgresql
|
||||
|
|
@ -839,7 +839,7 @@ class AccountancyCategory // extends CommonObject
|
|||
exit();
|
||||
}
|
||||
|
||||
$pcgverid = $conf->global->CHARTOFACCOUNTS;
|
||||
$pcgverid = getDolGlobalInt('CHARTOFACCOUNTS');
|
||||
$pcgvercode = dol_getIdFromCode($this->db, $pcgverid, 'accounting_system', 'rowid', 'pcg_version');
|
||||
if (empty($pcgvercode)) {
|
||||
$pcgvercode = $pcgverid;
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ class AccountingAccount extends CommonObject
|
|||
global $conf;
|
||||
|
||||
$this->db = $db;
|
||||
$this->next_prev_filter = "fk_pcg_version IN (SELECT pcg_version FROM ".MAIN_DB_PREFIX."accounting_system WHERE rowid = ".((int) $conf->global->CHARTOFACCOUNTS).")"; // Used to add a filter in Form::showrefnav method
|
||||
$this->next_prev_filter = "fk_pcg_version IN (SELECT pcg_version FROM ".MAIN_DB_PREFIX."accounting_system WHERE rowid = ".((int) getDolGlobalInt('CHARTOFACCOUNTS')).")"; // Used to add a filter in Form::showrefnav method
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -198,7 +198,7 @@ class AccountingAccount extends CommonObject
|
|||
$sql .= " AND a.entity = ".$conf->entity;
|
||||
}
|
||||
if (!empty($limittocurrentchart)) {
|
||||
$sql .= ' AND a.fk_pcg_version IN (SELECT pcg_version FROM '.MAIN_DB_PREFIX.'accounting_system WHERE rowid = '.((int) $conf->global->CHARTOFACCOUNTS).')';
|
||||
$sql .= ' AND a.fk_pcg_version IN (SELECT pcg_version FROM '.MAIN_DB_PREFIX.'accounting_system WHERE rowid = '.((int) getDolGlobalInt('CHARTOFACCOUNTS')).')';
|
||||
}
|
||||
if (!empty($limittoachartaccount)) {
|
||||
$sql .= " AND a.fk_pcg_version = '".$this->db->escape($limittoachartaccount)."'";
|
||||
|
|
|
|||
|
|
@ -2031,7 +2031,7 @@ class BookKeeping extends CommonObject
|
|||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
|
||||
$pcgver = $conf->global->CHARTOFACCOUNTS;
|
||||
$pcgver = getDolGlobalInt('CHARTOFACCOUNTS');
|
||||
|
||||
$sql = "SELECT DISTINCT ab.numero_compte as account_number, aa.label as label, aa.rowid as rowid, aa.fk_pcg_version";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as ab";
|
||||
|
|
@ -2093,7 +2093,7 @@ class BookKeeping extends CommonObject
|
|||
public function getRootAccount($account = null)
|
||||
{
|
||||
global $conf;
|
||||
$pcgver = $conf->global->CHARTOFACCOUNTS;
|
||||
$pcgver = getDolGlobalInt('CHARTOFACCOUNTS');
|
||||
|
||||
$sql = "SELECT root.rowid, root.account_number, root.label as label,";
|
||||
$sql .= " parent.rowid as parent_rowid, parent.account_number as parent_account_number, parent.label as parent_label";
|
||||
|
|
@ -2135,7 +2135,7 @@ class BookKeeping extends CommonObject
|
|||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$pcgver = $conf->global->CHARTOFACCOUNTS;
|
||||
$pcgver = getDolGlobalInt('CHARTOFACCOUNTS');
|
||||
$sql = "SELECT aa.account_number, aa.label, aa.rowid, aa.fk_pcg_version, cat.label as category";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_account as aa ";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ $year_current = $year_start;
|
|||
// Validate History
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version');
|
||||
$chartaccountcode = dol_getIdFromCode($db, getDolGlobalInt('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version');
|
||||
|
||||
// Security check
|
||||
if (!isModEnabled('accounting')) {
|
||||
|
|
@ -102,9 +102,9 @@ if (($action == 'clean' || $action == 'validatehistory') && $user->hasRight('acc
|
|||
$sql1 .= ' (SELECT accnt.rowid ';
|
||||
$sql1 .= ' FROM '.MAIN_DB_PREFIX.'accounting_account as accnt';
|
||||
$sql1 .= ' INNER JOIN '.MAIN_DB_PREFIX.'accounting_system as syst';
|
||||
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid='.((int) $conf->global->CHARTOFACCOUNTS).' AND accnt.entity = '.((int) $conf->entity).')';
|
||||
$sql1 .= ' AND fd.fk_facture IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'facture WHERE entity = '.((int) $conf->entity).')';
|
||||
$sql1 .= ' AND fk_code_ventilation <> 0';
|
||||
$sql1 .= " ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid = ".((int) getDolGlobalInt('CHARTOFACCOUNTS'))." AND accnt.entity = ".((int) $conf->entity).")";
|
||||
$sql1 .= " AND fd.fk_facture IN (SELECT rowid FROM ".MAIN_DB_PREFIX."facture WHERE entity = ".((int) $conf->entity).")";
|
||||
$sql1 .= " AND fk_code_ventilation <> 0";
|
||||
|
||||
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
|
||||
$resql1 = $db->query($sql1);
|
||||
|
|
|
|||
|
|
@ -303,7 +303,7 @@ $sql .= $db->order($sortfield, $sortorder);
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ $hookmanager->initHooks(array('accountancycustomerlist'));
|
|||
$formaccounting = new FormAccounting($db);
|
||||
$accountingAccount = new AccountingAccount($db);
|
||||
|
||||
$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version');
|
||||
$chartaccountcode = dol_getIdFromCode($db, getDolGlobalInt('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version');
|
||||
|
||||
// Security check
|
||||
if (!isModEnabled('accounting')) {
|
||||
|
|
@ -359,7 +359,7 @@ $sql .= $db->order($sortfield, $sortorder);
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ $year_current = $year_start;
|
|||
// Validate History
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version');
|
||||
$chartaccountcode = dol_getIdFromCode($db, getDolGlobalInt('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version');
|
||||
|
||||
// Security check
|
||||
if (!isModEnabled('accounting')) {
|
||||
|
|
@ -85,7 +85,7 @@ if (($action == 'clean' || $action == 'validatehistory') && $user->hasRight('acc
|
|||
$sql1 .= ' (SELECT accnt.rowid ';
|
||||
$sql1 .= ' FROM '.MAIN_DB_PREFIX.'accounting_account as accnt';
|
||||
$sql1 .= ' INNER JOIN '.MAIN_DB_PREFIX.'accounting_system as syst';
|
||||
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid='.((int) $conf->global->CHARTOFACCOUNTS).' AND accnt.entity = '.((int) $conf->entity).')';
|
||||
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid='.((int) getDolGlobalInt('CHARTOFACCOUNTS')).' AND accnt.entity = '.((int) $conf->entity).')';
|
||||
$sql1 .= ' AND erd.fk_expensereport IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'expensereport WHERE entity = '.((int) $conf->entity).')';
|
||||
$sql1 .= ' AND fk_code_ventilation <> 0';
|
||||
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ $sql .= $db->order($sortfield, $sortorder);
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ $hookmanager->initHooks(array('accountancyexpensereportlist'));
|
|||
$formaccounting = new FormAccounting($db);
|
||||
$accounting = new AccountingAccount($db);
|
||||
|
||||
$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version');
|
||||
$chartaccountcode = dol_getIdFromCode($db, getDolGlobalInt('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version');
|
||||
|
||||
// Security check
|
||||
if (!isModEnabled('accounting')) {
|
||||
|
|
@ -283,7 +283,7 @@ $sql .= $db->order($sortfield, $sortorder);
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ $year_current = $year_start;
|
|||
// Validate History
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version');
|
||||
$chartaccountcode = dol_getIdFromCode($db, getDolGlobalInt('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version');
|
||||
|
||||
// Security check
|
||||
if (!isModEnabled('accounting')) {
|
||||
|
|
@ -100,9 +100,9 @@ if (($action == 'clean' || $action == 'validatehistory') && $user->rights->accou
|
|||
$sql1 .= ' (SELECT accnt.rowid ';
|
||||
$sql1 .= ' FROM '.MAIN_DB_PREFIX.'accounting_account as accnt';
|
||||
$sql1 .= ' INNER JOIN '.MAIN_DB_PREFIX.'accounting_system as syst';
|
||||
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid='.$conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity.')';
|
||||
$sql1 .= ' AND fd.fk_facture_fourn IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'facture_fourn WHERE entity = '.$conf->entity.')';
|
||||
$sql1 .= ' AND fk_code_ventilation <> 0';
|
||||
$sql1 .= " ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid = ".getDolGlobalInt('CHARTOFACCOUNTS')." AND accnt.entity = ".((int) $conf->entity).")";
|
||||
$sql1 .= " AND fd.fk_facture_fourn IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'facture_fourn WHERE entity = ".((int) $conf->entity).")";
|
||||
$sql1 .= " AND fk_code_ventilation <> 0";
|
||||
|
||||
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
|
||||
$resql1 = $db->query($sql1);
|
||||
|
|
|
|||
|
|
@ -308,7 +308,7 @@ $sql .= $db->order($sortfield, $sortorder);
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ $hookmanager->initHooks(array('accountancysupplierlist'));
|
|||
$formaccounting = new FormAccounting($db);
|
||||
$accountingAccount = new AccountingAccount($db);
|
||||
|
||||
$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version');
|
||||
$chartaccountcode = dol_getIdFromCode($db, getDolGlobalInt('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version');
|
||||
|
||||
// Security check
|
||||
if (!isModEnabled('accounting')) {
|
||||
|
|
@ -363,7 +363,7 @@ $sql .= $db->order($sortfield, $sortorder);
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
|
|
|
|||
|
|
@ -500,7 +500,7 @@ $sql .= $hookmanager->resPrint;
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ $sql .= $hookmanager->resPrint;
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -634,7 +634,7 @@ if ($rowid > 0) {
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -275,7 +275,7 @@ $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $objec
|
|||
$sql .= $hookmanager->resPrint;
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$resql = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($resql);
|
||||
|
||||
|
|
|
|||
|
|
@ -298,7 +298,7 @@ $sql .= $db->order($sortfield, $sortorder);
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$resql = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($resql);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0
|
||||
|
|
|
|||
|
|
@ -127,10 +127,10 @@ foreach ($modulesdir as $dir) {
|
|||
|
||||
// We discard modules according to features level (PS: if module is activated we always show it)
|
||||
$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($objMod)));
|
||||
if ($objMod->version == 'development' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 2))) {
|
||||
if ($objMod->version == 'development' && (empty($conf->global->$const_name) && (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2))) {
|
||||
$modulequalified = 0;
|
||||
}
|
||||
if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 1))) {
|
||||
if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1))) {
|
||||
$modulequalified = 0;
|
||||
}
|
||||
if (preg_match('/deprecated/', $objMod->version) && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL >= 0))) {
|
||||
|
|
|
|||
|
|
@ -396,10 +396,10 @@ foreach ($modulesdir as $dir) {
|
|||
|
||||
// We discard modules according to features level (PS: if module is activated we always show it)
|
||||
$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($objMod)));
|
||||
if ($objMod->version == 'development' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 2))) {
|
||||
if ($objMod->version == 'development' && (empty($conf->global->$const_name) && (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2))) {
|
||||
$modulequalified = 0;
|
||||
}
|
||||
if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 1))) {
|
||||
if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1))) {
|
||||
$modulequalified = 0;
|
||||
}
|
||||
if (preg_match('/deprecated/', $objMod->version) && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL >= 0))) {
|
||||
|
|
@ -598,7 +598,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
|||
|
||||
if (getDolGlobalInt('MAIN_FEATURES_LEVEL')) {
|
||||
$array_version = array('stable'=>$langs->transnoentitiesnoconv("Stable"));
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL < 0) {
|
||||
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 0) {
|
||||
$array_version['deprecated'] = $langs->trans("Deprecated");
|
||||
}
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL > 0) {
|
||||
|
|
|
|||
|
|
@ -544,7 +544,7 @@ if ($action == 'edit') {
|
|||
print '<datalist id="pcg_type_datalist">';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountancysystem.class.php';
|
||||
$accountsystem = new AccountancySystem($db);
|
||||
$accountsystem->fetch($conf->global->CHARTOFACCOUNTS);
|
||||
$accountsystem->fetch(getDolGlobalInt('CHARTOFACCOUNTS'));
|
||||
$sql = 'SELECT DISTINCT pcg_type FROM ' . MAIN_DB_PREFIX . 'accounting_account';
|
||||
$sql .= " WHERE fk_pcg_version = '" . $db->escape($accountsystem->ref) . "'";
|
||||
$sql .= ' AND entity in ('.getEntity('accounting_account', 0).')'; // Always limit to current entity. No sharing in accountancy.
|
||||
|
|
|
|||
|
|
@ -299,7 +299,7 @@ $sql .= !empty($hookmanager->resPrint) ? (" HAVING 1=1 " . $hookmanager->resPrin
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -301,7 +301,7 @@ $sql .= !empty($hookmanager->resPrint) ? (" HAVING 1=1 " . $hookmanager->resPrin
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* This old and fast method to get and count full list returns all record so use a high amount of memory.
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
|
|
|
|||
|
|
@ -385,7 +385,7 @@ $sql=preg_replace('/,\s*$/','', $sql);
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -311,7 +311,7 @@ $sql .= empty($hookmanager->resPrint) ? "" : " HAVING 1=1 ".$hookmanager->resPri
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* This old and fast method to get and count full list returns all record so use a high amount of memory.
|
||||
$resql = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($resql);
|
||||
|
|
|
|||
|
|
@ -311,7 +311,7 @@ $sql .= empty($hookmanager->resPrint) ? "" : " HAVING 1=1 ".$hookmanager->resPri
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* This old and fast method to get and count full list returns all record so use a high amount of memory.
|
||||
$resql = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($resql);
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ if (!$user->admin) {
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -983,7 +983,7 @@ class Categorie extends CommonObject
|
|||
|
||||
$offset = 0;
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$result = $this->db->query($sql);
|
||||
$nbtotalofrecords = $this->db->num_rows($result);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
|
|
|
|||
|
|
@ -570,7 +570,7 @@ $sql .= $hookmanager->resPrint;
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ $sql .= " GROUP BY year, month, df";
|
|||
$sql .= " ORDER BY year DESC, month DESC, df DESC";
|
||||
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
|
|
|
|||
|
|
@ -593,7 +593,7 @@ if ($object->fetch($id) >= 0) {
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ $sql .= $hookmanager->resPrint;
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -809,7 +809,7 @@ $sql .= empty($hookmanager->resPrint) ? "" : " HAVING 1=1 ".$hookmanager->resPri
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ $sql .= $db->order($sortfield, $sortorder);
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
|
||||
|
|
|
|||
|
|
@ -1060,7 +1060,7 @@ $sql .= empty($hookmanager->resPrint) ? "" : " HAVING 1=1 ".$hookmanager->resPri
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -602,7 +602,7 @@ $sql .= $db->order($sortfield, $sortorder);
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
|
||||
|
|
|
|||
|
|
@ -701,7 +701,7 @@ $sql .= $db->order($sortfield, $sortorder);
|
|||
|
||||
$nbtotalofrecords = '';
|
||||
$nbtotalofpages = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
$nbtotalofpages = ceil($nbtotalofrecords / $limit);
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@ $sql .= $hookmanager->resPrint;
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ if (empty($numref)) {
|
|||
|
||||
// Count total nb of records
|
||||
$totalnboflines = 0;
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$result = $db->query($sql);
|
||||
$totalnboflines = $db->num_rows($result);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -296,7 +296,7 @@ if ($search_all) {
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -290,7 +290,7 @@ $sql=preg_replace('/,\s*$/','', $sql);
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -386,7 +386,7 @@ if ($search_date_when_end) {
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -935,7 +935,7 @@ $sql .= empty($hookmanager->resPrint) ? "" : " HAVING 1=1 ".$hookmanager->resPri
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ $sql .= dolSqlDateFilter('bc.date_bordereau', 0, $month, $year);
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ if (GETPOST("orphelins", "alpha")) {
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ $sql .= $db->order($sortfield, $sortorder);
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
|
|
|
|||
|
|
@ -392,7 +392,7 @@ if ($id > 0 || $ref) {
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
if (($page * $limit) > $nbtotalofrecords) {
|
||||
|
|
|
|||
|
|
@ -366,7 +366,7 @@ if ($socid > 0) {
|
|||
}
|
||||
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
if (($page * $limit) > $nbtotalofrecords) {
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ $sql .= $db->order($sortfield, $sortorder);
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$resql = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($resql);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ $sql .= $db->order($sortfield, $sortorder);
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$resql = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($resql);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ $sql .= " ORDER BY pl.amount DESC";
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ if ($search_company) {
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ if ($search_amount) {
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -282,8 +282,8 @@ if ($modecompta == 'BOOKKEEPING') {
|
|||
$predefinedgroupwhere .= " (pcg_type = 'INCOME')";
|
||||
$predefinedgroupwhere .= ")";
|
||||
|
||||
$charofaccountstring = $conf->global->CHARTOFACCOUNTS;
|
||||
$charofaccountstring = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version');
|
||||
$charofaccountstring = getDolGlobalInt('CHARTOFACCOUNTS');
|
||||
$charofaccountstring = dol_getIdFromCode($db, getDolGlobalInt('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version');
|
||||
|
||||
$sql = "SELECT -1 as socid, aa.pcg_type, SUM(f.credit - f.debit) as amount";
|
||||
if ($showaccountdetail == 'no') {
|
||||
|
|
|
|||
|
|
@ -917,8 +917,8 @@ if (isModEnabled('accounting') && ($modecompta == 'BOOKKEEPING')) {
|
|||
$predefinedgroupwhere .= " (aa.pcg_type = 'INCOME')";
|
||||
$predefinedgroupwhere .= ")";
|
||||
|
||||
$charofaccountstring = $conf->global->CHARTOFACCOUNTS;
|
||||
$charofaccountstring = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version');
|
||||
$charofaccountstring = getDolGlobalInt('CHARTOFACCOUNTS');
|
||||
$charofaccountstring = dol_getIdFromCode($db, getDolGlobalInt('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version');
|
||||
|
||||
$sql = "SELECT b.doc_ref, b.numero_compte, b.subledger_account, b.subledger_label, aa.pcg_type, date_format(b.doc_date,'%Y-%m') as dm, sum(b.debit) as debit, sum(b.credit) as credit, sum(b.montant) as amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b, ".MAIN_DB_PREFIX."accounting_account as aa";
|
||||
|
|
|
|||
|
|
@ -270,7 +270,7 @@ if (isModEnabled('project')) {
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ if (preg_match('/^cs\./', $sortfield)
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$resql = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($resql);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ if ($modecompta == 'CREANCES-DETTES') {
|
|||
$sql .= " AND f.fk_soc = ".((int) $socid);
|
||||
}
|
||||
} elseif ($modecompta == "BOOKKEEPING") {
|
||||
$pcgverid = $conf->global->CHARTOFACCOUNTS;
|
||||
$pcgverid = getDolGlobalInt('CHARTOFACCOUNTS');
|
||||
$pcgvercode = dol_getIdFromCode($db, $pcgverid, 'accounting_system', 'rowid', 'pcg_version');
|
||||
if (empty($pcgvercode)) {
|
||||
$pcgvercode = $pcgverid;
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ if ($modecompta == 'CREANCES-DETTES') {
|
|||
$sql .= " AND f.fk_soc = ".((int) $socid);
|
||||
}
|
||||
} elseif ($modecompta == "BOOKKEEPING") {
|
||||
$pcgverid = $conf->global->CHARTOFACCOUNTS;
|
||||
$pcgverid = getDolGlobalInt('CHARTOFACCOUNTS');
|
||||
$pcgvercode = dol_getIdFromCode($db, $pcgverid, 'accounting_system', 'rowid', 'pcg_version');
|
||||
if (empty($pcgvercode)) {
|
||||
$pcgvercode = $pcgverid;
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ $sql .= " GROUP BY t.rowid, t.amount, t.label, t.datev, t.datep, t.paye, t.fk_ty
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -686,7 +686,7 @@ $sql .= $hookmanager->resPrint;
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -462,7 +462,7 @@ $sql .= $hookmanager->resPrint;
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
//$result = $db->query($sql);
|
||||
//$nbtotalofrecords = $db->num_rows($result);
|
||||
|
||||
|
|
|
|||
|
|
@ -368,7 +368,7 @@ $sql .= $db->order($sortfield, $sortorder);
|
|||
//print $sql;
|
||||
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class box_validated_projects extends ModeleBoxes
|
|||
|
||||
$this->hidden = empty($user->rights->projet->lire);
|
||||
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL < 2) {
|
||||
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
|
||||
$this->enabled = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -370,7 +370,7 @@ class FormAccounting extends Form
|
|||
$sql = "SELECT DISTINCT aa.account_number, aa.label, aa.labelshort, aa.rowid, aa.fk_pcg_version";
|
||||
$sql .= " FROM ".$this->db->prefix()."accounting_account as aa";
|
||||
$sql .= " INNER JOIN ".$this->db->prefix()."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
|
||||
$sql .= " AND asy.rowid = ".((int) $conf->global->CHARTOFACCOUNTS);
|
||||
$sql .= " AND asy.rowid = ".((int) getDolGlobalInt('CHARTOFACCOUNTS'));
|
||||
if ($active === '1') {
|
||||
$sql .= " AND aa.active = 1";
|
||||
} elseif ($active === '0') {
|
||||
|
|
@ -390,7 +390,7 @@ class FormAccounting extends Form
|
|||
|
||||
$num_rows = $this->db->num_rows($resql);
|
||||
|
||||
if ($num_rows == 0 && (empty($conf->global->CHARTOFACCOUNTS) || $conf->global->CHARTOFACCOUNTS < 0)) {
|
||||
if ($num_rows == 0 && (empty(getDolGlobalInt('CHARTOFACCOUNTS')) || getDolGlobalInt('CHARTOFACCOUNTS') < 0)) {
|
||||
$langs->load("errors");
|
||||
$showempty = $langs->trans("ErrorYouMustFirstSetupYourChartOfAccount");
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -243,10 +243,10 @@ class FormAdmin
|
|||
foreach ($menuarray as $key => $val) {
|
||||
$tab = explode('_', $key);
|
||||
$newprefix = $tab[0];
|
||||
if ($newprefix == '1' && ($conf->global->MAIN_FEATURES_LEVEL < 1)) {
|
||||
if ($newprefix == '1' && (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1)) {
|
||||
continue;
|
||||
}
|
||||
if ($newprefix == '2' && ($conf->global->MAIN_FEATURES_LEVEL < 2)) {
|
||||
if ($newprefix == '2' && (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2)) {
|
||||
continue;
|
||||
}
|
||||
if ($newprefix != $oldprefix) { // Add separators
|
||||
|
|
|
|||
|
|
@ -90,10 +90,10 @@ function show_skin($fuser, $edit = 0)
|
|||
if (is_dir($dirskin."/".$subdir) && substr($subdir, 0, 1) <> '.'
|
||||
&& substr($subdir, 0, 3) <> 'CVS' && !preg_match('/common|phones/i', $subdir)) {
|
||||
// Disable not stable themes (dir ends with _exp or _dev)
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL < 2 && preg_match('/_dev$/i', $subdir)) {
|
||||
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2 && preg_match('/_dev$/i', $subdir)) {
|
||||
continue;
|
||||
}
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL < 1 && preg_match('/_exp$/i', $subdir)) {
|
||||
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1 && preg_match('/_exp$/i', $subdir)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -409,10 +409,10 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
|
|||
if (is_dir($dirtheme."/".$subdir) && substr($subdir, 0, 1) <> '.'
|
||||
&& substr($subdir, 0, 3) <> 'CVS' && !preg_match('/common|phones/i', $subdir)) {
|
||||
// Disable not stable themes (dir ends with _exp or _dev)
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL < 2 && preg_match('/_dev$/i', $subdir)) {
|
||||
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2 && preg_match('/_dev$/i', $subdir)) {
|
||||
continue;
|
||||
}
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL < 1 && preg_match('/_exp$/i', $subdir)) {
|
||||
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1 && preg_match('/_exp$/i', $subdir)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -581,10 +581,10 @@ function showWebsiteTemplates(Website $website)
|
|||
$subdirwithoutzip = preg_replace('/\.zip$/i', '', $subdir);
|
||||
|
||||
// Disable not stable themes (dir ends with _exp or _dev)
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL < 2 && preg_match('/_dev$/i', $subdir)) {
|
||||
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2 && preg_match('/_dev$/i', $subdir)) {
|
||||
continue;
|
||||
}
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL < 1 && preg_match('/_exp$/i', $subdir)) {
|
||||
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1 && preg_match('/_exp$/i', $subdir)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -450,9 +450,9 @@ class ImportCsv extends ModeleImports
|
|||
//var_dump($arrayrecord[0]['val']);
|
||||
/*include_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancysystem.class.php';
|
||||
$tmpchartofaccount = new AccountancySystem($this->db);
|
||||
$tmpchartofaccount->fetch($conf->global->CHARTOFACCOUNTS);
|
||||
$tmpchartofaccount->fetch(getDolGlobalInt('CHARTOFACCOUNTS'));
|
||||
//var_dump($tmpchartofaccount->ref.' - '.$arrayrecord[0]['val']);
|
||||
if ((! ($conf->global->CHARTOFACCOUNTS > 0)) || $tmpchartofaccount->ref != $arrayrecord[0]['val'])
|
||||
if ((! (getDolGlobalInt('CHARTOFACCOUNTS') > 0)) || $tmpchartofaccount->ref != $arrayrecord[0]['val'])
|
||||
{
|
||||
$this->errors[$error]['lib']=$langs->trans('ErrorImportOfChartLimitedToCurrentChart', $tmpchartofaccount->ref);
|
||||
$this->errors[$error]['type']='RESTRICTONCURRENCTCHART';
|
||||
|
|
|
|||
|
|
@ -493,9 +493,9 @@ class ImportXlsx extends ModeleImports
|
|||
//var_dump($arrayrecord[0]['val']);
|
||||
/*include_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancysystem.class.php';
|
||||
$tmpchartofaccount = new AccountancySystem($this->db);
|
||||
$tmpchartofaccount->fetch($conf->global->CHARTOFACCOUNTS);
|
||||
$tmpchartofaccount->fetch(getDolGlobalInt('CHARTOFACCOUNTS'));
|
||||
//var_dump($tmpchartofaccount->ref.' - '.$arrayrecord[0]['val']);
|
||||
if ((! ($conf->global->CHARTOFACCOUNTS > 0)) || $tmpchartofaccount->ref != $arrayrecord[0]['val'])
|
||||
if ((! (getDolGlobalInt('CHARTOFACCOUNTS') > 0)) || $tmpchartofaccount->ref != $arrayrecord[0]['val'])
|
||||
{
|
||||
$this->errors[$error]['lib']=$langs->trans('ErrorImportOfChartLimitedToCurrentChart', $tmpchartofaccount->ref);
|
||||
$this->errors[$error]['type']='RESTRICTONCURRENCTCHART';
|
||||
|
|
|
|||
|
|
@ -337,7 +337,7 @@ class pdf_standard extends ModelePDFMovement
|
|||
$sql .= $this->db->order($sortfield, $sortorder);
|
||||
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$result = $this->db->query($sql);
|
||||
$nbtotalofrecords = $this->db->num_rows($result);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
|
|
|
|||
|
|
@ -302,7 +302,7 @@ $sql .= $db->order($sortfield, $sortorder);
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ if ($search_amount) {
|
|||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
|
|
|
|||
|
|
@ -590,7 +590,7 @@ $sql .= $hookmanager->resPrint;
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -338,7 +338,7 @@ $sql .= $hookmanager->resPrint;
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -451,7 +451,7 @@ $reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $obje
|
|||
$sql .= empty($hookmanager->resPrint) ? "" : " HAVING 1=1 ".$hookmanager->resPrint;
|
||||
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -346,7 +346,7 @@ $sql .= $hookmanager->resPrint;
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@ $sql .= ' ba.rowid, ba.ref, ba.label, ba.number, ba.account_number, ba.iban_pref
|
|||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
|
|
|
|||
|
|
@ -328,7 +328,7 @@ $sql .= $hookmanager->resPrint;
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -970,7 +970,7 @@ $sql .= $hookmanager->resPrint;
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -358,7 +358,7 @@ if ($tmpsortfield == 'recurring') {
|
|||
$sql .= $db->order($tmpsortfield, $sortorder);
|
||||
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
|
|
|
|||
|
|
@ -705,7 +705,7 @@ $sql .= empty($hookmanager->resPrint) ? "" : " HAVING 1=1 ".$hookmanager->resPri
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -244,7 +244,7 @@ if (empty($user->rights->societe->client->voir)) {
|
|||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ $sql .= $hookmanager->resPrint;
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -368,7 +368,7 @@ $sql .= $hookmanager->resPrint;
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ $log_holiday = $object->fetchLog($sqlorder, $sqlwhere); // Load $object->logs
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
//TODO: $result = $db->query($sql);
|
||||
//TODO: $nbtotalofrecords = $db->num_rows($result);
|
||||
$nbtotalofrecords = is_array($object->logs) ? count($object->logs) : 0;
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ $sql .= " WHERE e.entity IN (".getEntity('establishment').')';
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$resql = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($resql);
|
||||
|
||||
|
|
|
|||
|
|
@ -313,7 +313,7 @@ $sql .= $db->order($sortfield, $sortorder);
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$resql = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($resql);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0
|
||||
|
|
|
|||
|
|
@ -301,7 +301,7 @@ $sql = preg_replace('/,\s*$/', '', $sql);
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$resql = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($resql);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0
|
||||
|
|
|
|||
|
|
@ -424,7 +424,7 @@ if ($job->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$resql = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($resql);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0
|
||||
|
|
@ -985,7 +985,7 @@ function DisplayPositionList()
|
|||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$resql = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($resql);
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user