Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/3.7' into develop

Conflicts:
	htdocs/fourn/facture/card.php
Laurent Destailleur 10 gadi atpakaļ
vecāks
revīzija
38d30b5590

+ 2 - 0
ChangeLog

@@ -231,6 +231,8 @@ FIX [ bug #2855 ] Wrong translation key in localtax report page
 FIX [ bug #1852 ] JS error when editing a customer order line
 FIX [ bug #2900 ] Courtesy title is not stored in create thirdparty form
 FIX [ bug #3055 ] Product image thumbnails were not deleted after deleting the image
+FIX [ bug 1634 ] Error deleting a project when it had many linked objects
+FIX [ bug 1925 ] "Link to order" option in supplier invoices is not working properly
 
 ***** ChangeLog for 3.7.1 compared to 3.7.* *****
 FIX Bug in the new photo system

+ 1 - 0
build/makepack-dolibarr.pl

@@ -475,6 +475,7 @@ if ($nboftargetok) {
 		$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/lead*`;
 		$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/management*`;
 		$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/multicompany*`;
+		$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/ndf*`;
 		$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/nltechno*`;
 	    $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/oscim*`;
 		$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/pos*`;

+ 5 - 4
htdocs/.gitignore

@@ -1,13 +1,14 @@
-/test.php
-/extensions*
-/nltechno*
 /ancot*
-/teclib*
 /bootstrap*
+/extensions*
 /google*
 /multicompany*
+/ndf*
 /numberingpack*
+/nltechno*
 /ovh*
 /pos
+/teclib*
+/test.php
 /ultimatepdf*
 /lead

+ 8 - 6
htdocs/comm/action/class/actioncomm.class.php

@@ -456,11 +456,12 @@ class ActionComm extends CommonObject
     /**
      *    Load object from database
      *
-     *    @param	int		$id     Id of action to get
-     *    @param	string	$ref    Ref of action to get
-     *    @return	int				<0 if KO, >0 if OK
+     *    @param	int		$id     	Id of action to get
+     *    @param	string	$ref    	Ref of action to get
+     *    @param	string	$ref_ext	Ref ext to get
+     *    @return	int					<0 if KO, >0 if OK
      */
-    function fetch($id, $ref='')
+    function fetch($id, $ref='',$ref_ext='')
     {
         global $langs;
 
@@ -484,11 +485,12 @@ class ActionComm extends CommonObject
         $sql.= " s.nom as socname,";
         $sql.= " u.firstname, u.lastname as lastname";
         $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a ";
-        $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action=c.id ";
+        $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action=c.id ";
         $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_author";
         $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = a.fk_soc";
         $sql.= " WHERE ";
-        if ($ref) $sql.= " a.id=".$ref;		// No field ref, we use id
+        if ($ref) $sql.= " a.id=".$ref;											// No field ref, we use id
+        elseif ($ref_ext) $sql.= " a.ref_ext='".$this->db->escape($ref_ext)."'";
         else $sql.= " a.id=".$id;
 
         dol_syslog(get_class($this)."::fetch", LOG_DEBUG);

+ 3 - 2
htdocs/core/lib/date.lib.php

@@ -272,6 +272,7 @@ function convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengt
 
 /**
  *	Convert a string date into a GM Timestamps date
+ *	Warning: YYYY-MM-DDTHH:MM:SS+02:00 (RFC3339) is not supported. If parameter gm is 1, we will use no TZ, if not we will use TZ of server, not the one inside string.
  *
  *	@param	string	$string		Date in a string
  *				     	        YYYYMMDD
@@ -306,8 +307,8 @@ function dol_stringtotime($string, $gm=1)
         $string=sprintf("%04d%02d%02d%02d%02d%02d",$syear,$smonth,$sday,$shour,$smin,$ssec);
     }
     else if (
-    	   preg_match('/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})Z$/i',$string,$reg)	// Convert date with format RFC3339
-		|| preg_match('/^([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})$/i',$string,$reg)	// Convert date with format YYYY-MM-DD HH:MM:SS
+    	   preg_match('/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})Z$/i',$string,$reg)	// Convert date with format YYYY-MM-DDTHH:MM:SSZ (RFC3339)
+    	|| preg_match('/^([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})$/i',$string,$reg)	// Convert date with format YYYY-MM-DD HH:MM:SS
    		|| preg_match('/^([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2})([0-9]{2})([0-9]{2})Z$/i',$string,$reg)		// Convert date with format YYYYMMDDTHHMMSSZ
     )
     {

+ 1 - 1
htdocs/fourn/facture/card.php

@@ -887,7 +887,7 @@ if (empty($reshook))
 	if (GETPOST('linkedOrder')) {
 		$object->fetch($id);
 		$object->fetch_thirdparty();
-		$result = $object->add_object_linked('commande', GETPOST('linkedOrder'));
+		$result = $object->add_object_linked('order_supplier', GETPOST('linkedOrder'));
 	}
 
 	// Add file in email form

+ 2 - 2
htdocs/projet/card.php

@@ -250,7 +250,7 @@ if (empty($reshook))
 	    	if ($result < 0)
 	    	{
 	    		$error++;
-	    		setEventMessage($object->errors,'errors');
+		        setEventMessages($object->error, $object->errors,'errors');
 	    	}
 	    }
 
@@ -373,7 +373,7 @@ if (empty($reshook))
 	    $result=$object->createFromClone($object->id,$clone_contacts,$clone_tasks,$clone_project_files,$clone_task_files,$clone_notes,$move_date);
 	    if ($result <= 0)
 	    {
-		    setEventMessage($object->error, 'errors');
+	        setEventMessages($object->error, $object->errors, 'errors');
 	    }
 	    else
 	    {

+ 1 - 1
htdocs/projet/class/project.class.php

@@ -617,7 +617,7 @@ class Project extends CommonObject
 	        $resql = $this->db->query($sql);
 	        if (!$resql)
 	        {
-	        	$this->errors[] = $this->db->lasterror();
+	        	$this->errors[] = $langs->trans("CantRemoveProject");
 	        	$error++;
 	        }
         }