瀏覽代碼

Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0

Conflicts:
	.travis.yml
	htdocs/api/class/api_documents.class.php
	htdocs/core/db/pgsql.class.php
Laurent Destailleur 1 年之前
父節點
當前提交
ec39199b85
共有 3 個文件被更改,包括 17 次插入4 次删除
  1. 4 2
      .travis.yml
  2. 12 1
      htdocs/api/class/api_documents.class.php
  3. 1 1
      htdocs/core/db/mysqli.class.php

+ 4 - 2
.travis.yml

@@ -374,7 +374,9 @@ script:
   
   - |
     echo "Upgrading Dolibarr"
-    # Ensure we catch errors. Set this to +e if you want to go to the end to see log files.
+    # Ensure we catch errors with -e. Set this to +e if you want to go to the end to see log files.
+    # Note: We keep +e because with pgsql, one of upgrade process fails even if migration seems ok, so
+    # I disable stop on error to be able to continue. 
     set +e
     cd htdocs/install
     php upgrade.php 3.5.0 3.6.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade350360.log
@@ -470,7 +472,7 @@ script:
     phpunitresult=$?
     echo "Phpunit return code = $phpunitresult"
     set +e
-  
+
 after_script:
   - |
     echo "After script - Output last lines of dolibarr.log"

+ 12 - 1
htdocs/api/class/api_documents.class.php

@@ -547,6 +547,17 @@ class Documents extends DolibarrApi
 			}
 
 			$upload_dir = $conf->contrat->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'contract');
+		} elseif ($modulepart == 'projet' || $modulepart == 'project') {
+			$modulepart = 'project';
+			require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
+
+			$object = new Project($this->db);
+			$result = $object->fetch($id, $ref);
+			if (!$result) {
+				throw new RestException(404, 'Project not found');
+			}
+
+			$upload_dir = $conf->projet->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'project');
 		} else {
 			throw new RestException(500, 'Modulepart '.$modulepart.' not implemented yet.');
 		}
@@ -676,7 +687,7 @@ class Documents extends DolibarrApi
 
 					require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
 					$object = new CommandeFournisseur($this->db);
-			} elseif ($modulepart == 'project') {
+			} elseif ($modulepart == 'projet' || $modulepart == 'project') {
 				require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
 				$object = new Project($this->db);
 			} elseif ($modulepart == 'task' || $modulepart == 'project_task') {

+ 1 - 1
htdocs/core/db/mysqli.class.php

@@ -341,7 +341,7 @@ class DoliDBMysqli extends DoliDB
 				$this->lasterror = $this->error();
 				$this->lasterrno = $this->errno();
 
-				if ($conf->global->SYSLOG_LEVEL < LOG_DEBUG) {
+				if (getDolGlobalInt('SYSLOG_LEVEL') < LOG_DEBUG) {
 					dol_syslog(get_class($this)."::query SQL Error query: ".$query, LOG_ERR); // Log of request was not yet done previously
 				}
 				dol_syslog(get_class($this)."::query SQL Error message: ".$this->lasterrno." ".$this->lasterror, LOG_ERR);