diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php
index cdc70cf0cd1..5a75fdbae2e 100644
--- a/htdocs/adherents/class/subscription.class.php
+++ b/htdocs/adherents/class/subscription.class.php
@@ -99,7 +99,7 @@ class Subscription extends CommonObject
'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>20),
'fk_adherent' =>array('type'=>'integer', 'label'=>'Member', 'enabled'=>1, 'visible'=>-1, 'position'=>25),
'dateadh' =>array('type'=>'datetime', 'label'=>'DateSubscription', 'enabled'=>1, 'visible'=>-1, 'position'=>30),
- 'datef' =>array('type'=>'date', 'label'=>'DateEndSubscription', 'enabled'=>1, 'visible'=>-1, 'position'=>35),
+ 'datef' =>array('type'=>'datetime', 'label'=>'DateEndSubscription', 'enabled'=>1, 'visible'=>-1, 'position'=>35),
'subscription' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>-1, 'position'=>40, 'isameasure'=>1),
'fk_bank' =>array('type'=>'integer', 'label'=>'BankId', 'enabled'=>1, 'visible'=>-1, 'position'=>45),
'note' =>array('type'=>'text', 'label'=>'Note', 'enabled'=>1, 'visible'=>-1, 'position'=>50),
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index 56d77aa22c9..17b1307fb89 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -440,7 +440,7 @@ if (!empty($conf->use_javascript_ajax)) // If javascript on
$s .= ''."\n";
// Local calendar
- $s .= '
';
+ // Preview of attachment
+ preg_match('#^(/)(\w+)(/)(.+)$#', substr($val, (strlen(DOL_DATA_ROOT)-strlen($val))), $formfile_params);
$out .= img_mime($listofnames[$key]).' '.$listofnames[$key];
+ $out .= $formfile->showPreview(array(), $formfile_params[2], $formfile_params[4]);
if (!$this->withfilereadonly)
{
$out .= '
';
diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php
index a8654f6bfc5..8dcd4965c65 100644
--- a/htdocs/core/class/html.formticket.class.php
+++ b/htdocs/core/class/html.formticket.class.php
@@ -987,12 +987,12 @@ class FormTicket
print '';
}
- // MESSAGE
- $defaultmessage = "";
- if (is_array($arraydefaultmessage) && count($arraydefaultmessage) > 0 && $arraydefaultmessage->content) {
+ // MESSAGE
+ $defaultmessage="";
+ if (is_object($arraydefaultmessage) && $arraydefaultmessage->content) {
$defaultmessage = $arraydefaultmessage->content;
}
- $defaultmessage = str_replace('\n', "\n", $defaultmessage);
+ $defaultmessage = str_replace('\n', "\n", $defaultmessage);
// Deal with format differences between message and signature (text / HTML)
if (dol_textishtml($defaultmessage) && !dol_textishtml($this->substit['__SIGNATURE__'])) {
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index 3f6e8563a50..f9849cded57 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -1408,7 +1408,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
$langs->load("mails");
$sql2 = "SELECT m.rowid as id, m.titre as label, mc.date_envoi as dp, mc.date_envoi as dp2, '100' as percent, 'mailing' as type";
- $sql2 .= ", '' as fk_element, '' as elementtype, '' as contact_id";
+ $sql2 .= ", null as fk_element, '' as elementtype, null as contact_id";
$sql2 .= ", 'AC_EMAILING' as acode, '' as alabel, '' as apicto";
$sql2 .= ", u.rowid as user_id, u.login as user_login, u.photo as user_photo, u.firstname as user_firstname, u.lastname as user_lastname"; // User that valid action
if (is_object($filterobj) && get_class($filterobj) == 'Societe') $sql2 .= ", '' as lastname, '' as firstname";
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 8f1f54edaa1..119a981891c 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -7474,23 +7474,6 @@ function printCommonFooter($zone = 'private')
print '});'."\n";
- // Google Analytics
- // TODO Add a hook here
- if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AN_ID))
- {
- print "\n";
- print "/* JS CODE TO ENABLE for google analtics tag */\n";
- print ' var _gaq = _gaq || [];'."\n";
- print ' _gaq.push([\'_setAccount\', \''.$conf->global->MAIN_GOOGLE_AN_ID.'\']);'."\n";
- print ' _gaq.push([\'_trackPageview\']);'."\n";
- print ''."\n";
- print ' (function() {'."\n";
- print ' var ga = document.createElement(\'script\'); ga.type = \'text/javascript\'; ga.async = true;'."\n";
- print ' ga.src = (\'https:\' == document.location.protocol ? \'https://ssl\' : \'http://www\') + \'.google-analytics.com/ga.js\';'."\n";
- print ' var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(ga, s);'."\n";
- print ' })();'."\n";
- }
-
// End of tuning
if (!empty($_SERVER['MAIN_SHOW_TUNING_INFO']) || !empty($conf->global->MAIN_SHOW_TUNING_INFO))
{
@@ -7519,6 +7502,28 @@ function printCommonFooter($zone = 'private')
}
print "\n".''."\n";
+
+ // Google Analytics
+ // TODO Add a hook here
+ if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AN_ID))
+ {
+ $tmptagarray = explode(',', $conf->global->MAIN_GOOGLE_AN_ID);
+ foreach($tmptagarray as $tmptag) {
+ print "\n";
+ print "\n";
+ print "
+
+
+ ";
+ print "\n";
+ }
+ }
}
// Add Xdebug coverage of code
diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php
index dbd26cc1f75..df2b1a086c8 100644
--- a/htdocs/core/lib/ticket.lib.php
+++ b/htdocs/core/lib/ticket.lib.php
@@ -410,7 +410,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
$langs->load("mails");
$sql2 = "SELECT m.rowid as id, m.titre as label, mc.date_envoi as dp, mc.date_envoi as dp2, '100' as percent, 'mailing' as type";
- $sql2 .= ", '' as fk_element, '' as elementtype, '' as contact_id";
+ $sql2 .= ", null as fk_element, '' as elementtype, null as contact_id";
$sql2 .= ", 'AC_EMAILING' as acode, '' as alabel, '' as apicto";
$sql2 .= ", u.rowid as user_id, u.login as user_login, u.photo as user_photo, u.firstname as user_firstname, u.lastname as user_lastname"; // User that valid action
if (is_object($filterobj) && get_class($filterobj) == 'Societe') $sql2 .= ", '' as lastname, '' as firstname";
diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php
index b3fa0dfb023..f0d380c58b7 100644
--- a/htdocs/core/lib/website.lib.php
+++ b/htdocs/core/lib/website.lib.php
@@ -763,7 +763,8 @@ function getSocialNetworkSharingLinks()
// Reddit
$out .= '
'."\n";
// Facebook
diff --git a/htdocs/core/modules/modContrat.class.php b/htdocs/core/modules/modContrat.class.php
index d3b1c56b054..31c7a136aac 100644
--- a/htdocs/core/modules/modContrat.class.php
+++ b/htdocs/core/modules/modContrat.class.php
@@ -220,7 +220,7 @@ class modContrat extends DolibarrModules
*/
public function init($options = '')
{
- global $conf;
+ global $conf, $langs;
// Nettoyage avant activation
$this->remove($options);
diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php
index 5d2374a9f60..6f2ca762a7c 100644
--- a/htdocs/core/tpl/login.tpl.php
+++ b/htdocs/core/tpl/login.tpl.php
@@ -334,23 +334,25 @@ if (!empty($morelogincontent) && is_array($morelogincontent)) {
echo $moreloginextracontent;
}
-// Google Analytics (need Google module)
+// Google Analytics
+// TODO Add a hook here
if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AN_ID))
{
- if (empty($conf->dol_use_jmobile))
- {
+ $tmptagarray = explode(',', $conf->global->MAIN_GOOGLE_AN_ID);
+ foreach($tmptagarray as $tmptag) {
+ print "\n";
+ print "\n";
+ print "
+
+
+ ";
print "\n";
- print ''."\n";
}
}
diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php
index 1e90b04fba7..742a7862100 100644
--- a/htdocs/core/tpl/objectline_view.tpl.php
+++ b/htdocs/core/tpl/objectline_view.tpl.php
@@ -272,13 +272,19 @@ if ($line->special_code == 3) { ?>
$tooltiponprice = $langs->transcountry("TotalHT", $mysoc->country_code).'='.price($line->total_ht);
$tooltiponprice .= '
'.$langs->transcountry("TotalVAT", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_tva);
if (!$senderissupplier && is_object($object->thirdparty)) {
- if ($object->thirdparty->useLocalTax(1)) {
- if (price2num($line->total_localtax1)) $tooltiponprice .= '
'.$langs->transcountry("TotalLT1", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_localtax1);
- else $tooltiponprice .= '
'.$langs->transcountry("TotalLT1", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'=
'.$langs->trans("NotUsedForThisCustomer").'';
+ if ($mysoc->useLocalTax(1)) {
+ if (($mysoc->country_code == $object->thirdparty->country_code) || $object->thirdparty->useLocalTax(1)) {
+ $tooltiponprice .= '
'.$langs->transcountry("TotalLT1", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_localtax1);
+ } else {
+ $tooltiponprice .= '
'.$langs->transcountry("TotalLT1", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'=
'.$langs->trans("NotUsedForThisCustomer").'';
+ }
}
- if ($object->thirdparty->useLocalTax(1)) {
- if (price2num($line->total_localtax2)) $tooltiponprice .= '
'.$langs->transcountry("TotalLT2", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_localtax2);
- else $tooltiponprice .= '
'.$langs->transcountry("TotalLT2", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'=
'.$langs->trans("NotUsedForThisCustomer").'';
+ if ($mysoc->useLocalTax(2)) {
+ if (($mysoc->country_code == $object->thirdparty->country_code) || $object->thirdparty->useLocalTax(2)) {
+ $tooltiponprice .= '
'.$langs->transcountry("TotalLT2", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_localtax2);
+ } else {
+ $tooltiponprice .= '
'.$langs->transcountry("TotalLT2", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'=
'.$langs->trans("NotUsedForThisCustomer").'';
+ }
}
}
$tooltiponprice .= '
'.$langs->transcountry("TotalTTC", $mysoc->country_code).'='.price($line->total_ttc);
diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php
index ad62ad43686..4a37ea8ab3e 100644
--- a/htdocs/core/tpl/passwordforgotten.tpl.php
+++ b/htdocs/core/tpl/passwordforgotten.tpl.php
@@ -205,7 +205,13 @@ if (!empty($morelogincontent)) {
-
+
+global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER;
+
+if (!empty($morelogincontent) && is_array($morelogincontent)) {
foreach ($morelogincontent as $format => $option)
{
if ($format == 'js') {
@@ -217,8 +223,53 @@ if (!empty($morelogincontent)) {
echo '';
echo $moreloginextracontent;
}
+
+// Google Analytics
+// TODO Add a hook here
+if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AN_ID))
+{
+ $tmptagarray = explode(',', $conf->global->MAIN_GOOGLE_AN_ID);
+ foreach($tmptagarray as $tmptag) {
+ print "\n";
+ print "\n";
+ print "
+
+
+ ";
+ print "\n";
+ }
+}
+
+// Google Adsense
+if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && !empty($conf->global->MAIN_GOOGLE_AD_SLOT))
+{
+ if (empty($conf->dol_use_jmobile))
+ {
+ ?>
+