Merge remote-tracking branch 'upstream/6.0' into 6.0

This commit is contained in:
Juanjo Menent 2017-08-30 14:37:43 +02:00
commit d5a9d32778
6 changed files with 22 additions and 24 deletions

View File

@ -45,7 +45,6 @@ $ref = GETPOST('ref','alpha');
$socid=''; $socid='';
if (! empty($user->societe_id)) if (! empty($user->societe_id))
{ {
$action='';
$socid = $user->societe_id; $socid = $user->societe_id;
} }
$result = restrictedArea($user, 'propal', $id); $result = restrictedArea($user, 'propal', $id);

View File

@ -44,7 +44,6 @@ $ref = GETPOST('ref');
// Security check // Security check
if ($user->societe_id) if ($user->societe_id)
{ {
$action='';
$socid = $user->societe_id; $socid = $user->societe_id;
} }
$result=restrictedArea($user,'commande',$id,''); $result=restrictedArea($user,'commande',$id,'');

View File

@ -49,7 +49,6 @@ $confirm=GETPOST('confirm', 'alpha');
// Security check // Security check
if ($user->societe_id) if ($user->societe_id)
{ {
$action='';
$socid = $user->societe_id; $socid = $user->societe_id;
} }
$result=restrictedArea($user,'facture',$id,''); $result=restrictedArea($user,'facture',$id,'');
@ -72,9 +71,11 @@ if ($object->fetch($id))
$upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref); $upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref);
} }
/* /*
* Actions * Actions
*/ */
include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php'; include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';
@ -100,7 +101,7 @@ if ($id > 0 || ! empty($ref))
dol_fiche_head($head, 'documents', $langs->trans('InvoiceCustomer'), -1, 'bill'); dol_fiche_head($head, 'documents', $langs->trans('InvoiceCustomer'), -1, 'bill');
$totalpaye = $object->getSommePaiement(); $totalpaye = $object->getSommePaiement();
// Construit liste des fichiers // Construit liste des fichiers
$filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
$totalsize=0; $totalsize=0;
@ -109,11 +110,11 @@ if ($id > 0 || ! empty($ref))
$totalsize+=$file['size']; $totalsize+=$file['size'];
} }
// Invoice content // Invoice content
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/facture/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; $linkback = '<a href="' . DOL_URL_ROOT . '/compta/facture/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
$morehtmlref='<div class="refidno">'; $morehtmlref='<div class="refidno">';
// Ref customer // Ref customer
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
@ -154,14 +155,14 @@ if ($id > 0 || ! empty($ref))
} }
} }
$morehtmlref.='</div>'; $morehtmlref.='</div>';
$object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status $object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status
dol_banner_tab($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref, '', 0); dol_banner_tab($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref, '', 0);
print '<div class="fichecenter">'; print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td class="titlefield">'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>'; print '<tr><td class="titlefield">'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';

View File

@ -30,9 +30,9 @@ if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
if ($object->id) if ($object->id)
{ {
if (! empty($upload_dirold) && ! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) if (! empty($upload_dirold) && ! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO))
dol_add_file_process($upload_dirold, 0, 1, 'userfile', GETPOST('savingdocmask')); $result = dol_add_file_process($upload_dirold, 0, 1, 'userfile', GETPOST('savingdocmask'));
else else
dol_add_file_process($upload_dir, 0, 1, 'userfile', GETPOST('savingdocmask')); $result = dol_add_file_process($upload_dir, 0, 1, 'userfile', GETPOST('savingdocmask'));
} }
} }
elseif (GETPOST('linkit') && ! empty($conf->global->MAIN_UPLOAD_DOC)) elseif (GETPOST('linkit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
@ -176,7 +176,7 @@ elseif ($action == 'renamefile' && GETPOST('renamefilesave'))
setEventMessages($langs->trans("FileRenamed"), null); setEventMessages($langs->trans("FileRenamed"), null);
} }
else else
{ {
$langs->load("errors"); // key must be loaded because we can't rely on loading during output, we need var substitution to be done now. $langs->load("errors"); // key must be loaded because we can't rely on loading during output, we need var substitution to be done now.
setEventMessages($langs->trans("ErrorFailToRenameFile", $filenamefrom, $filenameto), null, 'errors'); setEventMessages($langs->trans("ErrorFailToRenameFile", $filenamefrom, $filenameto), null, 'errors');

View File

@ -80,7 +80,7 @@ $formfile->form_attach_new_file(
$disablemove=1; $disablemove=1;
if ($modulepart == 'produit') $disablemove=0; if ($modulepart == 'produit') $disablemove=0;
// List of document // List of document
$formfile->list_of_documents( $formfile->list_of_documents(
$filearray, $filearray,

View File

@ -44,7 +44,6 @@ $ref = GETPOST('ref','alpha');
$socid=''; $socid='';
if (! empty($user->societe_id)) if (! empty($user->societe_id))
{ {
$action='';
$socid = $user->societe_id; $socid = $user->societe_id;
} }
$result = restrictedArea($user, 'supplier_proposal', $id); $result = restrictedArea($user, 'supplier_proposal', $id);
@ -96,8 +95,8 @@ if ($object->id > 0)
// Supplier proposal card // Supplier proposal card
$linkback = '<a href="' . DOL_URL_ROOT . '/supplier_proposal/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; $linkback = '<a href="' . DOL_URL_ROOT . '/supplier_proposal/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
$morehtmlref='<div class="refidno">'; $morehtmlref='<div class="refidno">';
// Ref supplier // Ref supplier
//$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1); //$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1);
@ -138,14 +137,14 @@ if ($object->id > 0)
} }
} }
$morehtmlref.='</div>'; $morehtmlref.='</div>';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
print '<div class="fichecenter">'; print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
print '<table class="border"width="100%">'; print '<table class="border"width="100%">';
print '<tr><td class="titlefield">'.$langs->trans("NbOfAttachedFiles").'</td><td>'.count($filearray).'</td></tr>'; print '<tr><td class="titlefield">'.$langs->trans("NbOfAttachedFiles").'</td><td>'.count($filearray).'</td></tr>';
@ -154,9 +153,9 @@ if ($object->id > 0)
print '</table>'; print '</table>';
print '</div>'; print '</div>';
dol_fiche_end(); dol_fiche_end();
$modulepart = 'supplier_proposal'; $modulepart = 'supplier_proposal';
$permission = $user->rights->supplier_proposal->creer; $permission = $user->rights->supplier_proposal->creer;
$permtoedit = $user->rights->supplier_proposal->creer; $permtoedit = $user->rights->supplier_proposal->creer;