Uniformize code for mass actions
This commit is contained in:
parent
8222624ff0
commit
7a48ceb635
@ -103,6 +103,7 @@ if (! empty($socid))
|
||||
}
|
||||
$result = restrictedArea($user, $module, $objectid, $dbtable);
|
||||
|
||||
$diroutputmassaction=$conf->propal->dir_output . '/temp/massgeneration/'.$user->id;
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
$hookmanager->initHooks(array('propallist'));
|
||||
|
||||
@ -76,6 +76,8 @@ $id = (GETPOST('orderid')?GETPOST('orderid'):GETPOST('id','int'));
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'commande', $id,'');
|
||||
|
||||
$diroutputmassaction=$conf->commande->dir_output . '/temp/massgeneration/'.$user->id;
|
||||
|
||||
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
|
||||
@ -45,10 +45,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
}
|
||||
if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
|
||||
$langs->load('bills');
|
||||
$langs->load('companies');
|
||||
@ -115,8 +112,7 @@ $fieldid = (! empty($ref)?'facnumber':'rowid');
|
||||
if (! empty($user->societe_id)) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'facture', $id,'','','fk_soc',$fieldid);
|
||||
|
||||
$diroutputpdf=$conf->facture->dir_output . '/unpaid/temp';
|
||||
if (! $user->rights->societe->client->voir || $socid) $diroutputpdf.='/private/'.$user->id; // If user has no permission to see all, output dir is specific to user
|
||||
$diroutputmassaction=$conf->facture->dir_output . '/temp/massgeneration/'.$user->id;
|
||||
|
||||
$object=new Facture($db);
|
||||
|
||||
@ -577,7 +573,7 @@ if (empty($reshook))
|
||||
}
|
||||
|
||||
// Create output dir if not exists
|
||||
dol_mkdir($diroutputpdf);
|
||||
dol_mkdir($diroutputmassaction);
|
||||
|
||||
// Save merged file
|
||||
$filename=strtolower(dol_sanitizeFileName($langs->transnoentities("Invoices")));
|
||||
@ -591,7 +587,7 @@ if (empty($reshook))
|
||||
if ($pagecount)
|
||||
{
|
||||
$now=dol_now();
|
||||
$file=$diroutputpdf.'/'.$filename.'_'.dol_print_date($now,'dayhourlog').'.pdf';
|
||||
$file=$diroutputmassaction.'/'.$filename.'_'.dol_print_date($now,'dayhourlog').'.pdf';
|
||||
$pdf->Output($file,'F');
|
||||
if (! empty($conf->global->MAIN_UMASK))
|
||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||
@ -611,7 +607,7 @@ if (empty($reshook))
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
$langs->load("other");
|
||||
$upload_dir = $diroutputpdf;
|
||||
$upload_dir = $diroutputmassaction;
|
||||
$file = $upload_dir . '/' . GETPOST('file');
|
||||
$ret=dol_delete_file($file);
|
||||
if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('file')), null, 'mesgs');
|
||||
@ -1446,7 +1442,7 @@ if ($resql)
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
|
||||
$urlsource.=str_replace('&','&',$param);
|
||||
|
||||
$filedir=$diroutputpdf;
|
||||
$filedir=$diroutputmassaction;
|
||||
$genallowed=$user->rights->facture->lire;
|
||||
$delallowed=$user->rights->facture->lire;
|
||||
|
||||
|
||||
@ -39,6 +39,8 @@ $expeditionid = GETPOST('id','int');
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'expedition',$expeditionid,'');
|
||||
|
||||
$diroutputmassaction=$conf->expedition->dir_output . '/temp/massgeneration/'.$user->id;
|
||||
|
||||
$search_ref_exp = GETPOST("search_ref_exp");
|
||||
$search_ref_liv = GETPOST('search_ref_liv');
|
||||
$search_company = GETPOST("search_company");
|
||||
|
||||
@ -45,7 +45,7 @@ FormatedExportDesc2=First step is to choose a predefined dataset, then to choose
|
||||
FormatedExportDesc3=When data to export are selected, you can define output file format you want to export your data to.
|
||||
Sheet=Sheet
|
||||
NoImportableData=No importable data (no module with definitions to allow data imports)
|
||||
FileSuccessfullyBuilt=Export file generated
|
||||
FileSuccessfullyBuilt=File generated
|
||||
SQLUsedForExport=SQL Request used to build export file
|
||||
LineId=Id of line
|
||||
LineLabel=Label of line
|
||||
|
||||
Loading…
Reference in New Issue
Block a user