Browse Source

FIX Bulk pdf merge on supplier proposals

Laurent Destailleur 8 years ago
parent
commit
ddd101757e

+ 4 - 1
htdocs/core/actions_massactions.inc.php

@@ -434,8 +434,11 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se
     // Create output dir if not exists
     dol_mkdir($diroutputmassaction);
 
-    // Save merged file
+    // Defined name of merged file
     $filename=strtolower(dol_sanitizeFileName($langs->transnoentities($objectlabel)));
+    $filename=preg_replace('/\s/','_',$filename);
+    
+    // Save merged file
     if ($filter=='paye:0')
     {
         if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))).'_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late")));

+ 1 - 1
htdocs/core/lib/files.lib.php

@@ -1821,7 +1821,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
 	    {
 	        $accessallowed=1;
 	    }
-	    $original_file=$conf->propal->dir_output.'/temp/massgeneration/'.$user->id.'/'.$original_file;
+	    $original_file=$conf->supplier_proposal->dir_output.'/temp/massgeneration/'.$user->id.'/'.$original_file;
 	}
 	else if ($modulepart == 'massfilesarea_supplier_order')
 	{

+ 1 - 1
htdocs/langs/en_US/supplier_proposal.lang

@@ -47,7 +47,7 @@ CommercialAsk=Price request
 DefaultModelSupplierProposalCreate=Default model creation
 DefaultModelSupplierProposalToBill=Default template when closing a price request (accepted)
 DefaultModelSupplierProposalClosed=Default template when closing a price request (refused)
-ListOfSupplierProposal=List of supplier proposal requests
+ListOfSupplierProposals=List of supplier proposal requests
 ListSupplierProposalsAssociatedProject=List of supplier proposals associated with project
 SupplierProposalsToClose=Supplier proposals to close
 SupplierProposalsToProcess=Supplier proposals to process

+ 6 - 6
htdocs/supplier_proposal/list.php

@@ -1,6 +1,6 @@
 <?php
 /* Copyright (C) 2001-2007 Rodolphe Quiedeville  <rodolphe@quiedeville.org>
- * Copyright (C) 2004-2011 Laurent Destailleur   <eldy@users.sourceforge.net>
+ * Copyright (C) 2004-2017 Laurent Destailleur   <eldy@users.sourceforge.net>
  * Copyright (C) 2004      Eric Seigne           <eric.seigne@ryxeo.com>
  * Copyright (C) 2005      Marc Barilley / Ocebo <marc@ocebo.com>
  * Copyright (C) 2005-2013 Regis Houssin         <regis.houssin@capnetworks.com>
@@ -316,11 +316,11 @@ if ($result)
 	{
 	    $soc = new Societe($db);
 	    $soc->fetch($socid);
-	    $title = $langs->trans('ListOfProposals') . ' - '.$soc->name;
+	    $title = $langs->trans('ListOfSupplierProposals') . ' - '.$soc->name;
 	}
 	else
 	{
-	    $title = $langs->trans('ListOfProposals');
+	    $title = $langs->trans('ListOfSupplierProposals');
 	}
 	
 	$num = $db->num_rows($result);
@@ -706,10 +706,10 @@ if ($result)
 	    $urlsource.=str_replace('&amp;','&',$param);
 	
 	    $filedir=$diroutputmassaction;
-	    $genallowed=$user->rights->propal->lire;
-	    $delallowed=$user->rights->propal->lire;
+	    $genallowed=$user->rights->supplier_proposal->lire;
+	    $delallowed=$user->rights->supplier_proposal->lire;
 	
-	    print $formfile->showdocuments('massfilesarea_proposals','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,'','');
+	    print $formfile->showdocuments('massfilesarea_supplier_proposal','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,'','');
 	}
 	else
 	{