diff --git a/.gitignore b/.gitignore index 6aa74f44ed0..ffacba65feb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ htdocs/conf/conf.php htdocs/conf/conf.php.old +htdocs/conf/conf.php.sav +htdocs/conf/conf.php.back documents/ custom2/ test/report/ @@ -8,22 +10,33 @@ default.properties .settings/ .buildpath .gitmodules -dolibarr_install.log -upgrade.log -doxygen_warnings.log /.project +/.pydevproject /.vscode .DS_Store .idea *.iml Thumbs.db +/dolibarr_genesis.mp4 +# Log files +dolibarr_install.log +upgrade.log +doxygen_warnings.log # Vagrant generated files .vagrant # Composer installed repositories /htdocs/includes/**/.git # Composer autoloader and unwanted files +composer.phar htdocs/includes/autoload.php htdocs/includes/bin/ htdocs/includes/composer/ -/.pydevproject -/dolibarr_genesis.mp4 +htdocs/includes/doctrine/ +htdocs/includes/jakub-onderka/ +htdocs/includes/phpdocumentor/ +htdocs/includes/phpspec/ +htdocs/includes/phpunit/ +htdocs/includes/sebastian/ +htdocs/includes/squizlabs/ +htdocs/includes/symfony/ +htdocs/includes/webmozart/ diff --git a/ChangeLog b/ChangeLog index 2d398c83535..1ce34b5e87a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24,7 +24,7 @@ Following changes may create regressions for some external modules, but were nec * Removed function dol_micro_time. Use native PHP microtime instead. * The trigger BON_PRELEVEMENT_CREATE has been renamed into DIRECT_DEBIT_ORDER_CREATE. * The constant INVOICE_SHOW_POS_IN_EXPORT has been renamed into INVOICE_SHOW_POS. -* If your logo was visible on the menu bar, you must upload a new logo into 'Home-Setup-Company/Organization' to have it visible agin in menu. +* If your logo is no more visible on the menu bar, you must upload a new logo into 'Home-Setup-Company/Organization' to have it visible again. * All properties 'libstatut', 'labelstatut', 'labelstatus' were renamed into 'labelStatus'. * All properties 'labelstatusshort' and 'labelstatut_short' were renamed into 'labelStatusShort'. * All properties 'type_libelle' were renamed into 'type_label'. diff --git a/build/.gitignore b/build/.gitignore index be85c819547..54c5d8be9c3 100644 --- a/build/.gitignore +++ b/build/.gitignore @@ -5,6 +5,5 @@ /dolibarr-*.tgz /dolibarr-*.rpm /dolibarr-*.zip -/dolibarr-*.tgz /*.exe /html diff --git a/build/exakat/README.md b/build/exakat/README.md new file mode 100644 index 00000000000..3b9052e5281 --- /dev/null +++ b/build/exakat/README.md @@ -0,0 +1,29 @@ + +== Install exakat == +mkdir exakat +cd exakat +curl -o exakat.phar http://dist.exakat.io/index.php?file=latest +curl -o apache-tinkerpop-gremlin-server-3.3.5-bin.zip http://dist.exakat.io/apache-tinkerpop-gremlin-server-3.3.5-bin.zip +unzip apache-tinkerpop-gremlin-server-3.3.5-bin.zip +mv apache-tinkerpop-gremlin-server-3.3.5 tinkergraph +rm -rf apache-tinkerpop-gremlin-server-3.3.5-bin.zip +cd tinkergraph ./bin/gremlin-server.sh -i org.apache.tinkerpop neo4j-gremlin 3.3.5 +cd .. + +php exakat.phar version +php exakat.phar doctor + +== Init project == +php + + +Edit config.ini file to exclude some dirs: +ignore_dirs[] = "/htdocs/includes"; +ignore_dirs[] = "/scripts"; +ignore_dirs[] = "/build"; +ignore_dirs[] = "/dev"; +ignore_dirs[] = "/documents"; + + +== Analyze project == +php diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 8e296163a46..f68ca6a77f5 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -461,15 +461,18 @@ if ($nboftargetok) { print "Clean $BUILDROOT\n"; $ret=`rm -f $BUILDROOT/$PROJECT/.buildpath`; $ret=`rm -fr $BUILDROOT/$PROJECT/.cache`; - $ret=`rm -fr $BUILDROOT/$PROJECT/.editorconfig`; + $ret=`rm -fr $BUILDROOT/$PROJECT/.codeclimate`; $ret=`rm -fr $BUILDROOT/$PROJECT/.externalToolBuilders`; $ret=`rm -fr $BUILDROOT/$PROJECT/.git*`; $ret=`rm -fr $BUILDROOT/$PROJECT/.project`; + $ret=`rm -fr $BUILDROOT/$PROJECT/.pydevproject`; $ret=`rm -fr $BUILDROOT/$PROJECT/.settings`; $ret=`rm -fr $BUILDROOT/$PROJECT/.scrutinizer.yml`; + $ret=`rm -fr $BUILDROOT/$PROJECT/.stickler.yml`; $ret=`rm -fr $BUILDROOT/$PROJECT/.travis.yml`; $ret=`rm -fr $BUILDROOT/$PROJECT/.tx`; $ret=`rm -f $BUILDROOT/$PROJECT/build.xml`; + $ret=`rm -f $BUILDROOT/$PROJECT/phpstan.neon`; $ret=`rm -f $BUILDROOT/$PROJECT/pom.xml`; $ret=`rm -fr $BUILDROOT/$PROJECT/build/html`; diff --git a/composer.json b/composer.json index a3407d7fa20..86acd2f8d60 100644 --- a/composer.json +++ b/composer.json @@ -24,10 +24,10 @@ "vendor-dir" : "htdocs/includes" }, "require" : { - "php" : ">=5.3.0", + "php" : ">=5.5.0", "ext-curl" : "*", "ckeditor/ckeditor" : "4.12.1", - "mike42/escpos-php" : "1.2.1", + "mike42/escpos-php" : "2.2", "mobiledetect/mobiledetectlib" : "2.8.33", "phpoffice/phpexcel" : "1.8.1", "restler/framework" : "3.0.0-RC6", @@ -48,13 +48,12 @@ "ext-mssql" : "To use with MSSQL (experimental)", "ext-pdo_sqlite" : "To use with SQLite (experimental)", "ext-gd" : "Image manipulation (Required but maybe built-in PHP)", - "ext-imagick" : "Image manipulation (TCPDF)", + "ext-imagick" : "Generation of thumbs from PDF", "ext-mcrypt" : "(Required but maybe built-in PHP)", "ext-openssl" : "Secure connections (Emails, SOAP\u2026)", - "ext-mbstring" : "Handle non UTF-8 databases", + "ext-mbstring" : "Handle non UTF-8 characters", "ext-soap" : "Native SOAP", - "ext-zip" : "ODT and Excel support", - "ext-xml" : "Excel support", - "firephp/firephp-core" : "Logging to Firebug console support" + "ext-zip" : "ODT, Excel and file compression support", + "ext-xml" : "Excel support" } } \ No newline at end of file diff --git a/htdocs/.gitignore b/htdocs/.gitignore index d51eaffd235..ef87c0455d6 100644 --- a/htdocs/.gitignore +++ b/htdocs/.gitignore @@ -16,9 +16,6 @@ /teclib* /test.php /ultimatepdf* -/lead -/dolimed* -/allscreens* /ecommerce/ /cabinetmed* /webmail* diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 10a65cab2fe..56d60281078 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -24,12 +24,12 @@ */ require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; -require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; -require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; // Load translation files required by the page -$langs->loadLangs(array("compta","bills","admin","accountancy","salaries")); +$langs->loadLangs(array("compta", "bills", "admin", "accountancy", "salaries")); $mesg = ''; $action = GETPOST('action', 'aZ09'); @@ -37,7 +37,7 @@ $cancel = GETPOST('cancel', 'alpha'); $id = GETPOST('id', 'int'); $rowid = GETPOST('rowid', 'int'); $massaction = GETPOST('massaction', 'aZ09'); -$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 $search_account = GETPOST('search_account', 'alpha'); $search_label = GETPOST('search_label', 'alpha'); @@ -58,10 +58,10 @@ if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -if (! $sortfield) $sortfield = "aa.account_number"; -if (! $sortorder) $sortorder = "ASC"; +if (!$sortfield) $sortfield = "aa.account_number"; +if (!$sortorder) $sortorder = "ASC"; -$arrayfields=array( +$arrayfields = array( 'aa.account_number'=>array('label'=>$langs->trans("AccountNumber"), 'checked'=>1), 'aa.label'=>array('label'=>$langs->trans("Label"), 'checked'=>1), 'aa.account_parent'=>array('label'=>$langs->trans("Accountparent"), 'checked'=>1), @@ -78,27 +78,27 @@ $accounting = new AccountingAccount($db); * Actions */ -if (GETPOST('cancel', 'alpha')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction', 'alpha')) { $massaction=''; } +if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; } +if (!GETPOST('confirmmassaction', 'alpha')) { $massaction = ''; } -$parameters=array(); -$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) { - if (! empty($cancel)) $action = ''; + if (!empty($cancel)) $action = ''; include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; - if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') ||GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers { $search_account = ""; $search_label = ""; $search_accountparent = ""; $search_pcgtype = ""; $search_pcgsubtype = ""; - $search_array_options=array(); + $search_array_options = array(); } if (GETPOST('change_chart', 'alpha') && (GETPOST('valid_change_chart', 'int') || empty($conf->use_javascript_ajax))) @@ -108,8 +108,8 @@ if (empty($reshook)) if ($chartofaccounts > 0) { // Get language code for this $chartofaccounts - $sql ='SELECT code FROM '.MAIN_DB_PREFIX.'c_country as c, '.MAIN_DB_PREFIX.'accounting_system as a'; - $sql.=' WHERE c.rowid = a.fk_country AND a.rowid = '.(int) $chartofaccounts; + $sql = 'SELECT code FROM '.MAIN_DB_PREFIX.'c_country as c, '.MAIN_DB_PREFIX.'accounting_system as a'; + $sql .= ' WHERE c.rowid = a.fk_country AND a.rowid = '.(int) $chartofaccounts; $resql = $db->query($sql); if ($resql) { @@ -132,7 +132,7 @@ if (empty($reshook)) { $offsetforchartofaccount += $reg[1]; } - $offsetforchartofaccount+=($conf->entity * 100000000); + $offsetforchartofaccount += ($conf->entity * 100000000); $result = run_sql($sqlfile, 1, $conf->entity, 1, '', 'default', 32768, 0, $offsetforchartofaccount); @@ -146,7 +146,7 @@ if (empty($reshook)) } } - if (! dolibarr_set_const($db, 'CHARTOFACCOUNTS', $chartofaccounts, 'chaine', 0, '', $conf->entity)) { + if (!dolibarr_set_const($db, 'CHARTOFACCOUNTS', $chartofaccounts, 'chaine', 0, '', $conf->entity)) { $error++; } } else { @@ -179,12 +179,12 @@ if (empty($reshook)) * View */ -$form=new Form($db); +$form = new Form($db); llxHeader('', $langs->trans("ListAccounts")); if ($action == 'delete') { - $formconfirm = $html->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $id, $langs->trans('DeleteAccount'), $langs->trans('ConfirmDeleteAccount'), 'confirm_delete', '', 0, 1); + $formconfirm = $html->formconfirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('DeleteAccount'), $langs->trans('ConfirmDeleteAccount'), 'confirm_delete', '', 0, 1); print $formconfirm; } @@ -192,11 +192,11 @@ $pcgver = $conf->global->CHARTOFACCOUNTS; $sql = "SELECT aa.rowid, aa.fk_pcg_version, aa.pcg_type, aa.pcg_subtype, aa.account_number, aa.account_parent , aa.label, aa.active, "; $sql .= " a2.rowid as rowid2, a2.label as label2, a2.account_number as account_number2"; -$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa"; -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version AND aa.entity = " . $conf->entity; -if ($db->type == 'pgsql') $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = aa.account_parent AND a2.entity = " . $conf->entity; -else $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = aa.account_parent AND a2.entity = " . $conf->entity; -$sql .= " WHERE asy.rowid = " . $pcgver; +$sql .= " FROM ".MAIN_DB_PREFIX."accounting_account as aa"; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version AND aa.entity = ".$conf->entity; +if ($db->type == 'pgsql') $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = aa.account_parent AND a2.entity = ".$conf->entity; +else $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = aa.account_parent AND a2.entity = ".$conf->entity; +$sql .= " WHERE asy.rowid = ".$pcgver; //print $sql; if (strlen(trim($search_account))) $sql .= natural_search("aa.account_number", $search_account); if (strlen(trim($search_label))) $sql .= natural_search("aa.label", $search_label); @@ -220,24 +220,24 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) $sql .= $db->plimit($limit + 1, $offset); -dol_syslog('accountancy/admin/account.php:: $sql=' . $sql); +dol_syslog('accountancy/admin/account.php:: $sql='.$sql); $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); - $param=''; - if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; - if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; - if ($search_account) $param.= '&search_account='.urlencode($search_account); - if ($search_label) $param.= '&search_label='.urlencode($search_label); - if ($search_accountparent) $param.= '&search_accountparent='.urlencode($search_accountparent); - if ($search_pcgtype) $param.= '&search_pcgtype='.urlencode($search_pcgtype); - if ($search_pcgsubtype) $param.= '&search_pcgsubtype='.urlencode($search_pcgsubtype); - if ($optioncss != '') $param.='&optioncss='.$optioncss; + $param = ''; + if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage; + if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit; + if ($search_account) $param .= '&search_account='.urlencode($search_account); + if ($search_label) $param .= '&search_label='.urlencode($search_label); + if ($search_accountparent) $param .= '&search_accountparent='.urlencode($search_accountparent); + if ($search_pcgtype) $param .= '&search_pcgtype='.urlencode($search_pcgtype); + if ($search_pcgsubtype) $param .= '&search_pcgsubtype='.urlencode($search_pcgsubtype); + if ($optioncss != '') $param .= '&optioncss='.$optioncss; - if (! empty($conf->use_javascript_ajax)) + if (!empty($conf->use_javascript_ajax)) { print ' '; } - print '