diff --git a/.travis.yml b/.travis.yml index cccc1efe1c4..d5583ef6ff2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -200,6 +200,7 @@ before_script: mysql -D travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql fi if [ "$DB" = 'postgresql' ]; then + #pgsql travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql #pgloader mysql://root:pass@127.0.0.1/dolibarr_9 postgresql://dolibarrowner:dolibarrownerpass@127.0.0.1/dolibarr_dev echo pgloader mysql://root@127.0.0.1/travis postgresql:///travis pgloader mysql://root@127.0.0.1/travis postgresql:///travis @@ -209,7 +210,6 @@ before_script: #echo 'select * from information_schema.table_constraints;' | psql travis #echo 'ALTER TABLE "llx_accounting_account" DROP CONSTRAINT "idx_16390_primary"' | psql travis fi - # TODO: SQLite echo - | @@ -222,6 +222,7 @@ before_script: echo '$'dolibarr_main_db_host=\'127.0.0.1\'';' >> $CONF_FILE echo '$'dolibarr_main_db_name=\'travis\'';' >> $CONF_FILE echo '$'dolibarr_main_db_user=\'travis\'';' >> $CONF_FILE + echo '$'dolibarr_main_instance_unique_id=\'travis1234567890\'';' >> $CONF_FILE if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ]; then echo '$'dolibarr_main_db_type=\'mysqli\'';' >> $CONF_FILE echo '$'dolibarr_main_db_port=\'3306\'';' >> $CONF_FILE @@ -230,7 +231,6 @@ before_script: echo '$'dolibarr_main_db_type=\'pgsql\'';' >> $CONF_FILE echo '$'dolibarr_main_db_port=\'5432\'';' >> $CONF_FILE fi - # TODO: SQLite echo '$'dolibarr_main_authentication=\'dolibarr\'';' >> $CONF_FILE cat $CONF_FILE echo @@ -299,10 +299,70 @@ script: set +e echo -# TODO: Check Javascript (jshint?) +- | + export INSTALL_FORCED_FILE=htdocs/install/install.forced.php + echo "Setting up Dolibarr $INSTALL_FORCED_FILE to test installation" + # Ensure we catch errors + set +e + echo ' $INSTALL_FORCED_FILE + echo '$'force_install_noedit=2';' >> $INSTALL_FORCED_FILE + if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ]; then + echo '$'force_install_type=\'mysqli\'';' >> $INSTALL_FORCED_FILE + fi + if [ "$DB" = 'postgresql' ]; then + echo '$'force_install_type=\'pgsql\'';' >> $INSTALL_FORCED_FILE + fi + echo '$'force_install_dbserver=\'127.0.0.1\'';' >> $INSTALL_FORCED_FILE + echo '$'force_install_database=\'travis\'';' >> $INSTALL_FORCED_FILE + echo '$'force_install_databaselogin=\'travis\'';' >> $INSTALL_FORCED_FILE + echo '$'force_install_databasepass=\'\'';' >> $INSTALL_FORCED_FILE + echo '$'force_install_port=\'5432\'';' >> $INSTALL_FORCED_FILE + echo '$'force_install_prefix=\'llx_\'';' >> $INSTALL_FORCED_FILE + echo '$'force_install_createdatabase=false';' >> $INSTALL_FORCED_FILE + echo '$'force_install_createuser=false';' >> $INSTALL_FORCED_FILE + echo '$'force_install_mainforcehttps=false';' >> $INSTALL_FORCED_FILE + echo '$'force_install_main_data_root=\'$TRAVIS_BUILD_DIR/htdocs\'';' >> $INSTALL_FORCED_FILE + #cat $INSTALL_FORCED_FILE -# TODO: Check CSS (csslint?) +#- | +# echo "Installing Dolibarr" +# cd htdocs/install +# php step1.php $TRAVIS_BUILD_DIR/htdocs > $TRAVIS_BUILD_DIR/install.log +# php step2.php set >> $TRAVIS_BUILD_DIR/install.log +# if [ "$?" -ne "0" ]; then +# echo "SORRY, AN ERROR OCCURED DURING INSTALLATION PROCESS" +# cat $TRAVIS_BUILD_DIR/install.log +# exit 1 +# fi +# cd ../.. +# rm $INSTALL_FORCED_FILE +# #cat $TRAVIS_BUILD_DIR/install.log +# set +e +# echo +- | + echo "Setting up database to test migrations" + if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ] || [ "$DB" = 'postgresql' ]; then + echo "MySQL" + mysql -e 'DROP DATABASE IF EXISTS travis;' + mysql -e 'CREATE DATABASE IF NOT EXISTS travis;' + mysql -e 'GRANT ALL PRIVILEGES ON travis.* TO travis@127.0.0.1;' + mysql -e 'FLUSH PRIVILEGES;' + mysql -D travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql + fi + if [ "$DB" = 'postgresql' ]; then + #pgsql travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql + #pgloader mysql://root:pass@127.0.0.1/base postgresql://dolibarrowner@127.0.0.1/dolibarr + echo pgloader mysql://root@127.0.0.1/travis postgresql:///travis + pgloader mysql://root@127.0.0.1/travis postgresql:///travis + echo 'ALTER SEQUENCE llx_accountingaccount_rowid_seq RENAME TO llx_accounting_account_rowid_seq' | psql travis + echo 'ALTER SEQUENCE llx_accounting_account_rowid_seq RESTART WITH 1000001;' | psql travis + #echo 'select * from INFORMATION_SCHEMA.COLUMNS where table_name = 'llx_accountingaccount' | psql travis + #echo 'select * from information_schema.table_constraints;' | psql travis + #echo 'ALTER TABLE "llx_accounting_account" DROP CONSTRAINT "idx_16390_primary"' | psql travis + fi + echo + - | echo "Upgrading Dolibarr" # Ensure we catch errors. Set this to +e if you want to go to the end to see log files. diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 765f2e6f995..e21dc942284 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -808,36 +808,39 @@ print ''; print '
'; print load_fiche_titre($langs->trans("PathToDocuments"), '', ''); -print ''."\n"; +print '
'; +print '
'."\n"; print ''."\n"; print ''."\n"; print ''."\n"; print "\n"; -print ''."\n"; +print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; print "
'.$langs->trans("Name").''.$langs->trans("Value").'
'.$langs->trans("PathDirectory").''.$conf->facture->dir_output.'
\n"; - +print "\n"; /* * Notifications */ print '
'; print load_fiche_titre($langs->trans("Notifications"), '', ''); -print ''; + +print '
'; +print '
'; print ''; print ''; print ''; print ''; print "\n"; - print '\n"; - print '
'.$langs->trans("Parameter").' 
'; print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'
'; print '
'; print "
'; +print "\n"; + dol_fiche_end(); diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index 67b530ef96c..91e7ca379b4 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -138,15 +138,15 @@ class pdf_baleine extends ModelePDFProjects $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10; $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; - $this->option_logo = 1; // Affiche logo FAC_PDF_LOGO - $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION - $this->option_codeproduitservice = 1; // Affiche code produit-service + $this->option_logo = 1; // Display logo FAC_PDF_LOGO + $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION + $this->option_codeproduitservice = 1; // Display product-service code - // Retrieves transmitter + // Get source company $this->emetteur=$mysoc; if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default if not defined - // Define column position + // Define position of columns $this->posxref=$this->marge_gauche+1; $this->posxlabel=$this->marge_gauche+25; $this->posxworkload=$this->marge_gauche+120; @@ -167,7 +167,7 @@ class pdf_baleine extends ModelePDFProjects // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Fonction generant le projet sur le disque + * Function to build pdf project onto disk * * @param Project $object Object project a generer * @param Translate $outputlangs Lang output object diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index 9741aff1123..b854afc6bdc 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -21,7 +21,7 @@ /** * \file htdocs/core/modules/project/doc/pdf_beluga.modules.php * \ingroup project - * \brief File of the class allowing to generate projects with the beluga model + * \brief File of class to generate project document beluga */ require_once DOL_DOCUMENT_ROOT.'/core/modules/project/modules_project.php'; @@ -99,15 +99,15 @@ class pdf_beluga extends ModelePDFProjects $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10; $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; - $this->option_logo = 1; // Affiche logo FAC_PDF_LOGO - $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION - $this->option_codeproduitservice = 1; // Affiche code produit-service + $this->option_logo = 1; // Display logo FAC_PDF_LOGO + $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION + $this->option_codeproduitservice = 1; // Display product-service code - // Retrieves transmitter + // Get source company $this->emetteur=$mysoc; if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default if not defined - // Define column position + // Define position of columns if ($this->orientation == 'L' || $this->orientation == 'Landscape') { $this->posxref=$this->marge_gauche+1; $this->posxdate=$this->marge_gauche+105; diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index 2e475a05731..44db5868f74 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -70,15 +70,15 @@ class pdf_timespent extends ModelePDFProjects $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10; $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; - $this->option_logo = 1; // Affiche logo FAC_PDF_LOGO - $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION - $this->option_codeproduitservice = 1; // Affiche code produit-service + $this->option_logo = 1; // Display logo FAC_PDF_LOGO + $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION + $this->option_codeproduitservice = 1; // Display product-service code - // Retrieves transmitter + // Get source company $this->emetteur=$mysoc; if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default if not defined - // Define column position + // Define position of columns $this->posxref=$this->marge_gauche+1; $this->posxlabel=$this->marge_gauche+25; $this->posxtimespent=$this->marge_gauche+120; diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index d2db60faa96..2c5299b5aae 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -27,7 +27,7 @@ /** * \file htdocs/core/modules/propale/doc/pdf_azur.modules.php * \ingroup propale - * \brief Fichier de la classe permettant de generer les propales au modele Azur + * \brief File of Class to generate PDF proposal with Azur template */ require_once DOL_DOCUMENT_ROOT.'/core/modules/propale/modules_propale.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; @@ -148,16 +148,16 @@ class pdf_azur extends ModelePDFPropales $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10; $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION - $this->option_modereg = 1; // Affiche mode reglement - $this->option_condreg = 1; // Affiche conditions reglement - $this->option_codeproduitservice = 1; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION + $this->option_modereg = 1; // Display payment mode + $this->option_condreg = 1; // Display payment terms + $this->option_codeproduitservice = 1; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text - $this->option_draft_watermark = 1; //Support add of a watermark on drafts + $this->option_draft_watermark = 1; // Support add of a watermark on drafts $this->franchise=!$mysoc->tva_assuj; diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 11c4ac111d1..1dffeb6dc1a 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -27,7 +27,7 @@ /** * \file htdocs/core/modules/propale/doc/pdf_cyan.modules.php * \ingroup propale - * \brief Fichier de la classe permettant de generer les propales au modele Cyan + * \brief File of Class to generate PDF proposal with Cyan template */ require_once DOL_DOCUMENT_ROOT.'/core/modules/propale/modules_propale.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; @@ -148,16 +148,16 @@ class pdf_cyan extends ModelePDFPropales $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10; $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION - $this->option_modereg = 1; // Affiche mode reglement - $this->option_condreg = 1; // Affiche conditions reglement - $this->option_codeproduitservice = 1; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION + $this->option_modereg = 1; // Display payment mode + $this->option_condreg = 1; // Display payment terms + $this->option_codeproduitservice = 1; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text - $this->option_draft_watermark = 1; //Support add of a watermark on drafts + $this->option_draft_watermark = 1; // Support add of a watermark on drafts $this->franchise=!$mysoc->tva_assuj; diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index c8dc7fd4382..bcca012eeac 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -544,12 +544,16 @@ function detect_dolibarr_main_url_root() $dolibarr_main_url_root = $_SERVER["SERVER_URL"] . $_SERVER["DOCUMENT_URI"]; } // If SCRIPT_URI, SERVER_URL, DOCUMENT_URI not defined (Ie: Apache 2.0.44 for Windows) else { - $proto = ( (!empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') || $_SERVER['SERVER_PORT'] == 443) ? 'https' : 'http'; + $proto = ((!empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') || (! empty($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443)) ? 'https' : 'http'; if (!empty($_SERVER["HTTP_HOST"])) { $serverport = $_SERVER["HTTP_HOST"]; - } else { + } + elseif (!empty($_SERVER["SERVER_NAME"])) { $serverport = $_SERVER["SERVER_NAME"]; } + else { + $serverport = 'localhost'; + } $dolibarr_main_url_root = $proto . "://" . $serverport . $_SERVER["SCRIPT_NAME"]; } // Clean proposed URL diff --git a/htdocs/install/step1.php b/htdocs/install/step1.php index 508f60cfd9a..4b86b6ac32f 100644 --- a/htdocs/install/step1.php +++ b/htdocs/install/step1.php @@ -80,6 +80,7 @@ if (@file_exists($forcedfile)) { // If forced install is enabled, replace the post values. These are empty because form fields are disabled. if ($force_install_noedit) { $main_dir = detect_dolibarr_main_document_root(); + if (!empty($argv[1])) $main_dir = $argv[1]; // override when executing the script in command line if (!empty($force_install_main_data_root)) { $main_data_dir = $force_install_main_data_root; } else { diff --git a/htdocs/install/step2.php b/htdocs/install/step2.php index 46c84a01351..0b576ac341d 100644 --- a/htdocs/install/step2.php +++ b/htdocs/install/step2.php @@ -64,6 +64,8 @@ if ($conffile == "/etc/dolibarr/conf.php") $forcedfile="/etc/dolibarr/install.fo if (@file_exists($forcedfile)) { $useforcedwizard = true; include_once $forcedfile; + // test for travis + if (!empty($argv[1]) && $argv[1] == "set") $action = "set"; } dolibarr_install_syslog("- step2: entering step2.php page"); diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php index 2c76285437d..b56758c9493 100644 --- a/htdocs/ticket/messaging.php +++ b/htdocs/ticket/messaging.php @@ -243,7 +243,7 @@ if (!empty($object->id)) // Show link to add event (if read and not closed) $btnstatus = $object->fk_statut < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; - $url = dol_buildpath('/comm/action/card.php', 1).'?action=create&datep='.date('YmdHi').'&origin=ticket&originid='.$object->id.'&projectid='.$object->fk_project.'&backtopage='.urlencode($_SERVER["PHP_SELF"]); + $url = dol_buildpath('/comm/action/card.php', 1).'?action=create&datep='.date('YmdHi').'&origin=ticket&originid='.$object->id.'&projectid='.$object->fk_project.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id=' . $object->track_id); $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', $url, 'add-new-ticket-even-button', $btnstatus);