소스 검색

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

Laurent Destailleur 4 년 전
부모
커밋
f6080d45fa

+ 7 - 7
ChangeLog

@@ -30,13 +30,13 @@ FIX: 11.0 when a mandatory extrafield of type sellist contains '0' it should be
 FIX: 11.0 when a new intervention is created from an object, a new $extrafields object is instantiated but not initialized
 FIX: create MO, Column 'tms' cannot be null
 FIX: #14290 #15900
-FIX: #16076
-FIX: #16077
-FIX: #16079
-FIX: #16080
-FIX: 16084
+FIX: #16076  patch user/list.php for extrafields
+FIX: #16077  patch wrong timezone
+FIX: #16079  error of service date at duplicated invoice
+FIX: #16080  mailing list title
+FIX: #16084  DB error at projects
 FIX: #16107
-FIX: #16118 Timezone problem on some fields
+FIX: #16118  Timezone problem on some fields
 FIX: #16131
 FIX: #16135
 FIX: #16143
@@ -67,7 +67,7 @@ FIX: select default mail template
 FIX: Select transport mode function when creating a supplier invoice and add unique key to the table llx_c_transport_mode in migrate sql
 FIX: Merge of thirdparties : "unknow column fk_soc" + "Delivery" label
 FIX: SQL Error in group by with postgres or mysql strict mode
-FIX: takepos : load date function
+FIX: TakePOS : load date function
 FIX: Timeout during import
 FIX: Trigger on expense report was not fired
 FIX: User creation of expense report not visible

+ 4 - 2
build/generate_filelist_xml.php

@@ -153,6 +153,7 @@ $files = new RegexIterator($iterator1, '#^(?:[A-Z]:)?(?:/(?!(?:'.($includecustom
 $regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$';
 $regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|sabre\/sabre\/.*\/tests|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$';  // Exclude dirs
 $files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname');
+
 $dir='';
 $needtoclose=0;
 foreach ($files as $filetmp) {
@@ -160,9 +161,10 @@ foreach ($files as $filetmp) {
     //$newdir = str_replace(dirname(__FILE__).'/../htdocs', '', dirname($file));
     $newdir = str_replace(DOL_DOCUMENT_ROOT, '', dirname($file));
     if ($newdir!=$dir) {
-        if ($needtoclose)
+    	if ($needtoclose) {
             fputs($fp, '  </dir>'."\n");
-        fputs($fp, '  <dir name="'.$newdir.'" >'."\n");
+    	}
+        fputs($fp, '  <dir name="'.$newdir.'">'."\n");
         $dir = $newdir;
         $needtoclose=1;
     }

+ 0 - 2
build/makepack-dolibarr.pl

@@ -579,7 +579,6 @@ if ($nboftargetok) {
 		$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/teclib*`;
 		$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/timesheet*`;
 		$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/webmail*`;
-		$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/workstation*`;
 		$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/oblyon*`;
 		$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/allscreen*`;
 		$ret=`rm -f  $BUILDROOT/$PROJECT/htdocs/theme/common/octicons/LICENSE`;
@@ -624,7 +623,6 @@ if ($nboftargetok) {
         $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/freefont-*`;
         $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/ae_fonts_*`;
         $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/utils`;
-        $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`;
         $ret=`rm -f  $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/LICENSE.TXT`;
         $ret=`rm -f  $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`;
         $ret=`rm -f  $BUILDROOT/$PROJECT/htdocs/includes/vendor`;

+ 1 - 0
build/rpm/dolibarr_fedora.spec

@@ -212,6 +212,7 @@ done >>%{name}.lang
 %_datadir/dolibarr/htdocs/product
 %_datadir/dolibarr/htdocs/projet
 %_datadir/dolibarr/htdocs/public
+%_datadir/dolibarr/htdocs/recruitment
 %_datadir/dolibarr/htdocs/reception
 %_datadir/dolibarr/htdocs/resource
 %_datadir/dolibarr/htdocs/salaries

+ 1 - 1
htdocs/accountancy/bookkeeping/list.php

@@ -110,7 +110,7 @@ $form = new Form($db);
 
 if (!in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && !GETPOSTISSET('begin') && !GETPOSTISSET('formfilteraction') && GETPOST('page', 'int') == '' && !GETPOST('noreset', 'int') && $user->rights->accounting->mouvements->export)
 {
-	if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('restore_lastsearch_values'))
+	if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('restore_lastsearch_values') && !GETPOST('search_accountancy_code_start'))
 	{
 		$query = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear ";
 		$query .= " where date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."' limit 1";

+ 15 - 10
htdocs/admin/system/filecheck.php

@@ -374,14 +374,6 @@ if (!$error && $xml)
 		}
 		$out .= '</table>';
 		$out .= '</div>';
-
-		// Show warning
-		if (empty($tmpfilelist) && empty($tmpfilelist2) && empty($tmpfilelist3))
-		{
-			setEventMessages($langs->trans("FileIntegrityIsStrictlyConformedWithReference"), null, 'mesgs');
-		} else {
-			setEventMessages($langs->trans("FileIntegritySomeFilesWereRemovedOrModified"), null, 'warnings');
-		}
 	} else {
 		print 'Error: Failed to found dolibarr_htdocs_dir into XML file '.$xmlfile;
 		$error++;
@@ -407,6 +399,8 @@ if (!$error && $xml)
     var_dump($checksumtoget);
     var_dump($checksumget == $checksumtoget);*/
 
+	$resultcomment = '';
+
 	$outexpectedchecksum = ($checksumtoget ? $checksumtoget : $langs->trans("Unknown"));
 	if ($checksumget == $checksumtoget)
 	{
@@ -414,7 +408,7 @@ if (!$error && $xml)
 		{
 			$resultcode = 'warning';
 			$resultcomment = 'FileIntegrityIsOkButFilesWereAdded';
-			$outcurrentchecksum = $checksumget.' - <span class="'.$resultcode.'">'.$langs->trans("FileIntegrityIsOkButFilesWereAdded").'</span>';
+			$outcurrentchecksum = $checksumget.' - <span class="'.$resultcode.'">'.$langs->trans($resultcomment).'</span>';
 		} else {
 			$resultcode = 'ok';
 			$resultcomment = 'Success';
@@ -426,7 +420,18 @@ if (!$error && $xml)
 		$outcurrentchecksum = '<span class="'.$resultcode.'">'.$checksumget.'</span>';
 	}
 
-	print load_fiche_titre($langs->trans("GlobalChecksum")).'<br>';
+	// Show warning
+	if (empty($tmpfilelist) && empty($tmpfilelist2) && empty($tmpfilelist3) && $resultcode == 'ok') {
+		setEventMessages($langs->trans("FileIntegrityIsStrictlyConformedWithReference"), null, 'mesgs');
+	} else {
+		if ($resultcode == 'warning') {
+			setEventMessages($langs->trans($resultcomment), null, 'warnings');
+		} else {
+			setEventMessages($langs->trans("FileIntegritySomeFilesWereRemovedOrModified"), null, 'errors');
+		}
+	}
+
+	print load_fiche_titre($langs->trans("GlobalChecksum"));
 	print $langs->trans("ExpectedChecksum").' = '.$outexpectedchecksum.'<br>';
 	print $langs->trans("CurrentChecksum").' = '.$outcurrentchecksum;
 

+ 1 - 1
htdocs/contact/card.php

@@ -821,7 +821,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
 				print '<tr><td>'.$langs->trans("ContactByDefaultFor").'</td>';
 				print '<td colspan="3">';
 				$contactType = $object->listeTypeContacts('external', '', 1);
-				print $form->multiselectarray('roles', $contactType);
+				print $form->multiselectarray('roles', $contactType, array(), 0, 0, 'minwidth500');
 				print '</td></tr>';
 			}
 

+ 35 - 6
htdocs/core/actions_massactions.inc.php

@@ -3,7 +3,7 @@
  * Copyright (C) 2018	   Nicolas ZABOURI	<info@inovea-conseil.com>
  * Copyright (C) 2018 	   Juanjo Menent  <jmenent@2byte.es>
  * Copyright (C) 2019 	   Ferran Marcet  <fmarcet@2byte.es>
- * Copyright (C) 2019      Frédéric France         <frederic.france@netlogic.fr>
+ * Copyright (C) 2019-2021 Frédéric France <frederic.france@netlogic.fr>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -1126,18 +1126,47 @@ if (!$error && $massaction == 'validate' && $permissiontoadd)
 			if ($result > 0)
 			{
 				$result = $objecttmp->validate($user);
-				if ($result == 0)
-				{
+				if ($result == 0) {
 					$langs->load("errors");
 					setEventMessages($langs->trans("ErrorObjectMustHaveStatusDraftToBeValidated", $objecttmp->ref), null, 'errors');
 					$error++;
 					break;
-				} elseif ($result < 0)
-				{
+				} elseif ($result < 0) {
 					setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
 					$error++;
 					break;
-				} else $nbok++;
+				} else {
+					// validate() rename pdf but do not regenerate
+					// Define output language
+					if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
+						$outputlangs = $langs;
+						$newlang = '';
+						if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
+							$newlang = GETPOST('lang_id', 'aZ09');
+						}
+						if ($conf->global->MAIN_MULTILANGS && empty($newlang)) {
+							$newlang = $objecttmp->thirdparty->default_lang;
+						}
+						if (!empty($newlang)) {
+							$outputlangs = new Translate("", $conf);
+							$outputlangs->setDefaultLang($newlang);
+							$outputlangs->load('products');
+						}
+						$model = $objecttmp->model_pdf;
+						$ret = $objecttmp->fetch($objecttmp->id); // Reload to get new records
+						// To be sure vars is defined
+						$hidedetails = !empty($hidedetails) ? $hidedetails : 0;
+						$hidedesc = !empty($hidedesc) ? $hidedesc : 0;
+						$hideref = !empty($hideref) ? $hideref : 0;
+						$moreparams = !empty($moreparams) ? $moreparams : null;
+
+						$result = $objecttmp->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
+						if ($result < 0) {
+							setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
+						}
+					}
+					$nbok++;
+				}
 			} else {
 				setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
 				$error++;

+ 9 - 3
htdocs/core/class/commonobject.class.php

@@ -1412,6 +1412,8 @@ abstract class CommonObject
 		if ($resql) {
 			$num = $this->db->num_rows($resql);
 			if ($num > 0) {
+				$langs->loadLangs(array("propal", "orders", "bills", "suppliers", "contracts", "supplier_proposal"));
+
 				while ($obj = $this->db->fetch_object($resql)) {
 					$modulename = $obj->element;
 					if (strpos($obj->element, 'project') !== false) {
@@ -1427,11 +1429,15 @@ abstract class CommonObject
 					}
 					if (!empty($conf->{$modulename}->enabled)) {
 						$libelle_element = $langs->trans('ContactDefault_'.$obj->element);
-						$transkey = "TypeContact_".$obj->element."_".$source."_".$obj->code;
+						$tmpelement = $obj->element;
+						$transkey = "TypeContact_".$tmpelement."_".$source."_".$obj->code;
 						$libelle_type = ($langs->trans($transkey) != $transkey ? $langs->trans($transkey) : $obj->libelle);
-						if (empty($option))
+						if (empty($option)) {
+							$tab[$obj->rowid] = $libelle_element.' - '.$libelle_type;
+						}
+						else {
 							$tab[$obj->rowid] = $libelle_element.' - '.$libelle_type;
-						else $tab[$obj->rowid] = $libelle_element.' - '.$libelle_type;
+						}
 					}
 				}
 			}

+ 3 - 0
htdocs/langs/en_US/supplier_proposal.lang

@@ -53,3 +53,6 @@ SupplierProposalsToClose=Vendor proposals to close
 SupplierProposalsToProcess=Vendor proposals to process
 LastSupplierProposals=Latest %s price requests
 AllPriceRequests=All requests
+TypeContact_supplier_proposal_external_SHIPPING=Vendor contact for delivery
+TypeContact_supplier_proposal_external_BILLING=Vendor contact for billing
+TypeContact_supplier_proposal_external_SERVICE=Representative following-up proposal