Explorar o código

Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	.travis.yml
Laurent Destailleur %!s(int64=3) %!d(string=hai) anos
pai
achega
3757d7e952

+ 1 - 1
.travis.yml

@@ -416,7 +416,7 @@ script:
   php step5.php 14.0.0 15.0.0 > $TRAVIS_BUILD_DIR/upgrade14001500-3.log
   php upgrade.php 15.0.0 16.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade15001600.log
   php upgrade2.php 15.0.0 16.0.0 > $TRAVIS_BUILD_DIR/upgrade15001600-2.log
-  php step5.php 15.0.0 16.0.0 > $TRAVIS_BUILD_DIR/upgrade14001500-3.log
+  php step5.php 15.0.0 16.0.0 > $TRAVIS_BUILD_DIR/upgrade15001600-3.log
   ls -alrt $TRAVIS_BUILD_DIR/
 
 - |

+ 3 - 3
htdocs/core/boxes/box_produits_alerte_stock.php

@@ -94,12 +94,12 @@ class box_produits_alerte_stock extends ModeleBoxes
 			$sql .= " FROM ".MAIN_DB_PREFIX."product as p";
 			$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as s on p.rowid = s.fk_product";
 			$sql .= ' WHERE p.entity IN ('.getEntity($productstatic->element).')';
-			$sql .= " AND p.tosell = 1 AND p.seuil_stock_alerte > 0";
+			$sql .= " AND p.seuil_stock_alerte > 0";
 			if (empty($user->rights->produit->lire)) {
-				$sql .= ' AND p.fk_product_type != 0';
+				$sql .= ' AND p.fk_product_type <> 0';
 			}
 			if (empty($user->rights->service->lire)) {
-				$sql .= ' AND p.fk_product_type != 1';
+				$sql .= ' AND p.fk_product_type <> 1';
 			}
 			// Add where from hooks
 			if (is_object($hookmanager)) {

+ 3 - 3
htdocs/fourn/commande/card.php

@@ -129,7 +129,7 @@ $result = restrictedArea($user, 'fournisseur', $id, 'commande_fournisseur', 'com
 // Common permissions
 $usercanread	= ($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire);
 $usercancreate	= ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer);
-$usercandelete	= ($user->rights->fournisseur->commande->supprimer || $user->rights->supplier_order->supprimer);
+$usercandelete	= (($user->rights->fournisseur->commande->supprimer || $user->rights->supplier_order->supprimer) || ($usercancreate && isset($object->statut) && $object->statut == $object::STATUS_DRAFT));
 
 // Advanced permissions
 $usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($usercancreate)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->supplier_order_advance->validate)));
@@ -2582,14 +2582,14 @@ if ($action == 'create') {
 			}
 
 			// Cancel
-			if ($object->statut == 2) {
+			if ($object->statut == CommandeFournisseur::STATUS_ACCEPTED) {
 				if ($usercanorder) {
 					print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=cancel">'.$langs->trans("CancelOrder").'</a>';
 				}
 			}
 
 			// Delete
-			if (!empty($usercandelete) || ($object->statut == CommandeFournisseur::STATUS_DRAFT && !empty($usercancreate))) {
+			if (!empty($usercandelete)) {
 				if ($hasreception) {
 					print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("ReceptionExist").'">'.$langs->trans("Delete").'</a>';
 				} else {

+ 2 - 2
htdocs/main.inc.php

@@ -1602,7 +1602,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
 					}
 					// cssfile is a relative path
 					$urlforcss = dol_buildpath($cssfile, 1);
-					if ($urlforcss) {
+					if ($urlforcss && $urlforcss != '/') {
 						print '<!-- Includes CSS added by module '.$modcss.' -->'."\n".'<link rel="stylesheet" type="text/css" href="'.$urlforcss;
 						// We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters, so browser cache is not used.
 						if (!preg_match('/\.css$/i', $cssfile)) {
@@ -1746,7 +1746,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
 					foreach ($filesjs as $jsfile) {
 						// jsfile is a relative path
 						$urlforjs = dol_buildpath($jsfile, 1);
-						if ($urlforjs) {
+						if ($urlforjs && $urlforjs != '/') {
 							print '<!-- Include JS added by module '.$modjs.'-->'."\n".'<script src="'.$urlforjs.((strpos($jsfile, '?') === false) ? '?' : '&amp;').'lang='.$langs->defaultlang.'"></script>'."\n";
 						} else {
 							dol_syslog("Warning: module ".$modjs." declared a js path file for a file we can't find.", LOG_WARNING);