diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php index 3aa3b3364c0..1cbb177f3e5 100644 --- a/htdocs/admin/mailing.php +++ b/htdocs/admin/mailing.php @@ -60,7 +60,7 @@ if ($action == 'setvalue') // Create temporary encryption key if nedded $res=dolibarr_set_const($db, "MAILING_EMAIL_UNSUBSCRIBE_KEY",$checkread_key,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; - + if (! $error) { $db->commit(); @@ -128,6 +128,7 @@ print $langs->trans("MailingDelay").''; print ''; print ''; + // Constant to add salt into the unsubscribe and check read tag. // It is also used as a security key parameter. @@ -137,6 +138,13 @@ print ''; +if (!empty($conf->use_javascript_ajax) && $conf->global->MAIN_FEATURES_LEVEL >=1) { + print ''; + print $langs->trans("MailAdvTargetRecipients").''; + print ajax_constantonoff('EMAILING_USE_ADVANCED_SELECTOR'); + print ''; +} + print ''; print '
'; diff --git a/htdocs/comm/mailing/advtargetemailing.php b/htdocs/comm/mailing/advtargetemailing.php index cfafdaa725b..d39feb3784d 100644 --- a/htdocs/comm/mailing/advtargetemailing.php +++ b/htdocs/comm/mailing/advtargetemailing.php @@ -237,6 +237,7 @@ if ($action == 'add') { if (! empty($template_id)) { $query_temlate_id = '&template_id=' . $template_id; } + setEventMessages($langs->trans("XTargetsAdded",$result), null, 'mesgs'); header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id . $query_temlate_id); exit(); } diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 676c9c3e98e..ccbca0fd419 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -561,7 +561,7 @@ if ($object->fetch($id) >= 0) include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; $objectstatic=new Adherent($db); $objectstatic->fetch($obj->source_id); - print $objectstatic->getNomUrl(2); + print $objectstatic->getNomUrl(1); } else if ($obj->source_type == 'user') { @@ -569,14 +569,21 @@ if ($object->fetch($id) >= 0) $objectstatic=new User($db); $objectstatic->fetch($obj->source_id); $objectstatic->id=$obj->source_id; - print $objectstatic->getNomUrl(2); + print $objectstatic->getNomUrl(1); } else if ($obj->source_type == 'thirdparty') { include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; $objectstatic=new Societe($db); $objectstatic->fetch($obj->source_id); - print $objectstatic->getNomUrl(2); + print $objectstatic->getNomUrl(1); + } + else if ($obj->source_type == 'contact') + { + include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; + $objectstatic=new Contact($db); + $objectstatic->fetch($obj->source_id); + print $objectstatic->getNomUrl(1); } else { diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index c68f14a4896..ca7b8d7e1ba 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6085,7 +6085,12 @@ abstract class CommonObject // Convert date into timestamp format (value in memory must be a timestamp) if (in_array($extrafields->attributes[$this->table_element]['type'][$key],array('date','datetime'))) { - $value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix)?dol_mktime(GETPOST($keyprefix.'options_'.$key.$keysuffix."hour", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."min",'int',3), 0, GETPOST($keyprefix.'options_'.$key.$keysuffix."month",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."day",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."year",'int',3)):$this->db->jdate($this->array_options['options_'.$key]); + $datenotinstring = $this->array_options['options_' . $key]; + if (! is_numeric($this->array_options['options_' . $key])) // For backward compatibility + { + $datenotinstring = $this->db->jdate($datenotinstring); + } + $value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix)?dol_mktime(GETPOST($keyprefix.'options_'.$key.$keysuffix."hour", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."min",'int',3), 0, GETPOST($keyprefix.'options_'.$key.$keysuffix."month",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."day",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."year",'int',3)):$datenotinstring; } // Convert float submited string into real php numeric (value in memory must be a php numeric) if (in_array($extrafields->attributes[$this->table_element]['type'][$key],array('price','double'))) diff --git a/htdocs/core/modules/mailings/advthirdparties.modules.php b/htdocs/core/modules/mailings/advthirdparties.modules.php index 38636396da5..78aab1a5bd7 100644 --- a/htdocs/core/modules/mailings/advthirdparties.modules.php +++ b/htdocs/core/modules/mailings/advthirdparties.modules.php @@ -293,7 +293,7 @@ class mailing_advthirdparties extends MailingTargets } elseif ($type=='contact') { $contactstatic=new Contact($this->db); $contactstatic->fetch($id); - return $contactstatic->getNomUrl(0, '', 0, '', -1, 0); + return $contactstatic->getNomUrl(0, '', 0, '', -1, 1); } } diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang index e80dd03b623..5979854d785 100644 --- a/htdocs/langs/en_US/mails.lang +++ b/htdocs/langs/en_US/mails.lang @@ -166,4 +166,4 @@ InGoingEmailSetup=Incoming email setup OutGoingEmailSetupForEmailing=Outgoing email setup (for mass emailing) DefaultOutgoingEmailSetup=Default outgoing email setup Information=Information - +ContactsWithThirdpartyFilter=Contact avec filtre client diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 1dfc3c21481..039918ea66c 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -707,5 +707,37 @@ class Entrepot extends CommonObject return $TChildWarehouses; } + + /** + * Create object on disk + * + * @param string $modele force le modele a utiliser ('' to not force) + * @param Translate $outputlangs Object langs to use for output + * @param int $hidedetails Hide details of lines + * @param int $hidedesc Hide description + * @param int $hideref Hide ref + * @return int 0 if KO, 1 if OK + */ + public function generateDocument($modele, $outputlangs='',$hidedetails=0,$hidedesc=0,$hideref=0) + { + global $conf,$user,$langs; + + $langs->load("stocks"); + + if (! dol_strlen($modele)) { + + $modele = 'standard'; + + if ($this->modelpdf) { + $modele = $this->modelpdf; + } elseif (! empty($conf->global->STOCK_ADDON_PDF)) { + $modele = $conf->global->STOCK_ADDON_PDF; + } + } + + $modelpath = "core/modules/stock/doc/"; + + return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref); + } }