diff --git a/ChangeLog b/ChangeLog
index 965ff2b3443..80383795325 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,20 @@
English Dolibarr ChangeLog
--------------------------------------------------------------
+
+***** ChangeLog for 3.5.1 compared to 3.5.0 *****
+Fix: Bug of import of agenda when using https link
+Fix: Field nature not saved correctly
+Fix: Substituion of extra field was ko for order
+Fix: Bad translation of date format for pt_BR.
+Fix: priority field of agenda record is smallint.
+Fix: Missing loading of lang in some pages.
+Fix: Write note in invoice when using pos module.
+Fix: Link to paypal was invalid into email text.
+Fix: ref and date of supplier invoice.
+Fix: Check on bank account.
+Fix: Problem with file upload and download.
+
***** ChangeLog for 3.5 compared to 3.4.* *****
For users:
- New: Add hidden option BANK_DISABLE_DIRECT_INPUT.
diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php
index 848c8057b6d..9ca99f8634b 100644
--- a/htdocs/comm/action/document.php
+++ b/htdocs/comm/action/document.php
@@ -55,16 +55,16 @@ if ($user->societe_id > 0)
}
$result = restrictedArea($user, 'agenda', $objectid, 'actioncomm&societe', 'myactions&allactions', 'fk_soc', 'id');
-$act = new ActionComm($db);
+$object = new ActionComm($db);
if ($objectid > 0)
{
- $ret = $act->fetch($objectid);
+ $ret = $object->fetch($objectid);
if ($ret > 0) {
$company=new Societe($db);
- $company->fetch($act->societe->id);
- $act->societe=$company; // For backward compatibility
- $act->thirdparty=$company;
+ $company->fetch($object->societe->id);
+ $object->societe=$company; // For backward compatibility
+ $object->thirdparty=$company;
}
}
@@ -79,6 +79,9 @@ $pagenext = $page + 1;
if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="name";
+$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($object->ref);
+$modulepart='contract';
+
/*
* Actions
@@ -96,17 +99,15 @@ $help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda';
llxHeader('',$langs->trans("Agenda"),$help_url);
-if ($act->id > 0)
+if ($object->id > 0)
{
- $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid);
-
$author=new User($db);
- $author->fetch($act->author->id);
- $act->author=$author;
+ $author->fetch($object->author->id);
+ $object->author=$author;
- if ($act->contact->id) $act->fetch_contact($act->contact->id);
+ if ($object->contact->id) $object->fetch_contact($object->contact->id);
- $head=actions_prepare_head($act);
+ $head=actions_prepare_head($object);
dol_fiche_head($head, 'documents', $langs->trans("Action"),0,'action');
// Affichage fiche action en mode visu
@@ -116,53 +117,53 @@ if ($act->id > 0)
// Ref
print '
| '.$langs->trans("Ref").' | ';
- print $form->showrefnav($act, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '');
+ print $form->showrefnav($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '');
print ' |
';
// Type
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
{
- print '| '.$langs->trans("Type").' | '.$act->type.' |
';
+ print '| '.$langs->trans("Type").' | '.$object->type.' |
';
}
// Title
- print '| '.$langs->trans("Title").' | '.$act->label.' |
';
+ print '| '.$langs->trans("Title").' | '.$object->label.' |
';
// Full day event
- print '| '.$langs->trans("EventOnFullDay").' | '.yn($act->fulldayevent).' |
';
+ print '| '.$langs->trans("EventOnFullDay").' | '.yn($object->fulldayevent).' |
';
// Date start
print '| '.$langs->trans("DateActionStart").' | ';
- if (! $act->fulldayevent) print dol_print_date($act->datep,'dayhour');
- else print dol_print_date($act->datep,'day');
- if ($act->percentage == 0 && $act->datep && $act->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late"));
+ if (! $object->fulldayevent) print dol_print_date($object->datep,'dayhour');
+ else print dol_print_date($object->datep,'day');
+ if ($object->percentage == 0 && $object->datep && $object->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late"));
print ' | ';
print ''."\n";
print ''."\n";
print ''."\n";
print ''."\n";
print ' | ';
@@ -170,43 +171,43 @@ if ($act->id > 0)
// Date end
print '
| '.$langs->trans("DateActionEnd").' | ';
- if (! $act->fulldayevent) print dol_print_date($act->datef,'dayhour');
- else print dol_print_date($act->datef,'day');
- if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late"));
+ if (! $object->fulldayevent) print dol_print_date($object->datef,'dayhour');
+ else print dol_print_date($object->datef,'day');
+ if ($object->percentage > 0 && $object->percentage < 100 && $object->datef && $object->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late"));
print ' |
';
// Status
print '| '.$langs->trans("Status").' / '.$langs->trans("Percentage").' | ';
- print $act->getLibStatut(4);
+ print $object->getLibStatut(4);
print ' |
';
// Location
- print '| '.$langs->trans("Location").' | '.$act->location.' |
';
+ print '| '.$langs->trans("Location").' | '.$object->location.' |
';
print '
';
// Third party - Contact
- print '| '.$langs->trans("ActionOnCompany").' | '.($act->societe->id?$act->societe->getNomUrl(1):$langs->trans("None"));
- if ($act->societe->id && $act->type_code == 'AC_TEL')
+ print ' |
| '.$langs->trans("ActionOnCompany").' | '.($object->societe->id?$object->societe->getNomUrl(1):$langs->trans("None"));
+ if ($object->societe->id && $object->type_code == 'AC_TEL')
{
- if ($act->societe->fetch($act->societe->id))
+ if ($object->societe->fetch($object->societe->id))
{
- print " ".dol_print_phone($act->societe->phone);
+ print " ".dol_print_phone($object->societe->phone);
}
}
print ' | ';
print ''.$langs->trans("Contact").' | ';
print '';
- if ($act->contact->id > 0)
+ if ($object->contact->id > 0)
{
- print $act->contact->getNomUrl(1);
- if ($act->contact->id && $act->type_code == 'AC_TEL')
+ print $object->contact->getNomUrl(1);
+ if ($object->contact->id && $object->type_code == 'AC_TEL')
{
- if ($act->contact->fetch($act->contact->id))
+ if ($object->contact->fetch($object->contact->id))
{
- print " ".dol_print_phone($act->contact->phone_pro);
+ print " ".dol_print_phone($object->contact->phone_pro);
}
}
}
@@ -221,10 +222,10 @@ if ($act->id > 0)
if (! empty($conf->projet->enabled))
{
print ' |
| '.$langs->trans("Project").' | ';
- if ($act->fk_project)
+ if ($object->fk_project)
{
$project=new Project($db);
- $project->fetch($act->fk_project);
+ $project->fetch($object->fk_project);
print $project->getNomUrl(1);
}
print ' |
';
@@ -232,7 +233,7 @@ if ($act->id > 0)
// Priority
print '| '.$langs->trans("Priority").' | ';
- print ($act->priority?$act->priority:'');
+ print ($object->priority?$object->priority:'');
print ' |
';
@@ -255,7 +256,7 @@ if ($act->id > 0)
$modulepart = 'actions';
$permission = $user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create;
- $param = '&id=' . $act->id;
+ $param = '&id=' . $object->id;
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
}
else
diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php
index 86d924b5fa2..f636831952c 100644
--- a/htdocs/core/class/commondocgenerator.class.php
+++ b/htdocs/core/class/commondocgenerator.class.php
@@ -260,7 +260,7 @@ abstract class CommonDocGenerator
$array_key.'_total_localtax2'=>price2num($object->total_localtax2),
$array_key.'_total_ttc'=>price2num($object->total_ttc),
$array_key.'_total_discount_ht' => price2num($object->getTotalDiscount()),
-
+
$array_key.'_vatrate'=>vatrate($object->tva),
$array_key.'_note_private'=>$object->note,
$array_key.'_note'=>$object->note_public,
@@ -314,7 +314,7 @@ abstract class CommonDocGenerator
'line_date_end'=>$line->date_end
);
}
-
+
/**
* Define array with couple substitution key => substitution value
*
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 172d65b4ca6..1319ad766d0 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -765,6 +765,7 @@ class FormFile
{
$relativepath=(! empty($object->ref)?dol_sanitizeFileName($object->ref):'').'/';
if ($object->element == 'invoice_supplier') $relativepath=get_exdir($object->id,2).$relativepath;
+ if ($object->element == 'member') $relativepath=get_exdir($object->id,2).$relativepath;
}
$var=!$var;
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index dd4ff4b6ed3..d2310e25ac0 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -1564,6 +1564,15 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
$original_file=$conf->projet->dir_output.'/'.$original_file;
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."projet WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity;
}
+ else if ($modulepart == 'project_task')
+ {
+ if ($fuser->rights->projet->lire || preg_match('/^specimen/i',$original_file))
+ {
+ $accessallowed=1;
+ }
+ $original_file=$conf->projet->dir_output.'/'.$original_file;
+ $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."projet WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity;
+ }
// Wrapping pour les commandes fournisseurs
else if ($modulepart == 'commande_fournisseur' || $modulepart == 'order_supplier')
@@ -1786,6 +1795,12 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
}
else
{
+ if (empty($conf->$modulepart->dir_output)) // modulepart not supported
+ {
+ dol_print_error('','Error call dol_check_secure_access_document with not supported value for modulepart parameter ('.$modulepart.')');
+ exit;
+ }
+
$perm=GETPOST('perm');
$subperm=GETPOST('subperm');
if ($perm || $subperm)
diff --git a/htdocs/core/tpl/document_actions_post_headers.tpl.php b/htdocs/core/tpl/document_actions_post_headers.tpl.php
index eeb598d20f8..2ae7b9ad595 100644
--- a/htdocs/core/tpl/document_actions_post_headers.tpl.php
+++ b/htdocs/core/tpl/document_actions_post_headers.tpl.php
@@ -42,7 +42,7 @@ $formfile=new FormFile($db);
// Show upload form (document and links)
$formfile->form_attach_new_file(
- $_SERVER["PHP_SELF"].'?id='.$object->id,
+ $_SERVER["PHP_SELF"].'?id='.$object->id.(empty($withproject)?'':'&withproject=1'),
'',
0,
0,
diff --git a/htdocs/core/tpl/document_actions_pre_headers.tpl.php b/htdocs/core/tpl/document_actions_pre_headers.tpl.php
index 7bfc5964140..989a3bcaf73 100644
--- a/htdocs/core/tpl/document_actions_pre_headers.tpl.php
+++ b/htdocs/core/tpl/document_actions_pre_headers.tpl.php
@@ -16,6 +16,7 @@
* or see http://www.gnu.org/
*/
+// Variable $upload_dir must be defined when entering here
// Send file/link
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC)) {
diff --git a/htdocs/document.php b/htdocs/document.php
index bb6bd032301..1b3d494d1a1 100644
--- a/htdocs/document.php
+++ b/htdocs/document.php
@@ -168,7 +168,7 @@ if (! file_exists($original_file_osencoded))
exit;
}
-// Les drois sont ok et fichier trouve, on l'envoie
+// Permissions are ok and file found, so we return it
header('Content-Description: File Transfer');
if ($encoding) header('Content-Encoding: '.$encoding);