Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/core/actions_sendmails.inc.php htdocs/core/class/CMailFile.class.php htdocs/filefunc.inc.php
This commit is contained in:
commit
a60cd49fb0
@ -49,6 +49,8 @@ if (empty($argv[1]))
|
|||||||
print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n";
|
print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n";
|
||||||
exit -1;
|
exit -1;
|
||||||
}
|
}
|
||||||
|
parse_str($argv[1]);
|
||||||
|
|
||||||
$i=0;
|
$i=0;
|
||||||
while ($i < $argc)
|
while ($i < $argc)
|
||||||
{
|
{
|
||||||
@ -98,9 +100,9 @@ foreach ($includeconstants as $countrycode => $tmp)
|
|||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
//$outputfile=dirname(__FILE__).'/../htdocs/install/filelist-'.$release.'.xml';
|
//$outputfile=dirname(__FILE__).'/../htdocs/install/filelist-'.$release.'.xml';
|
||||||
$outputdir=dirname(__FILE__).'/../htdocs/install';
|
$outputdir=dirname(dirname(__FILE__)).'/htdocs/install';
|
||||||
print 'Delete current files '.$outputdir.'/filelist-'.$release.'.xml'."\n";
|
print 'Delete current files '.$outputdir.'/filelist*.xml'."\n";
|
||||||
dol_delete_file($outputdir.'/filelist-'.$release.'.xml',0,1,1);
|
dol_delete_file($outputdir.'/filelist*.xml',0,1,1);
|
||||||
|
|
||||||
$checksumconcat=array();
|
$checksumconcat=array();
|
||||||
|
|
||||||
|
|||||||
9419
dev/initdemo/mysqldump_dolibarr_6.0.0.sql
Normal file
9419
dev/initdemo/mysqldump_dolibarr_6.0.0.sql
Normal file
File diff suppressed because one or more lines are too long
@ -192,6 +192,7 @@ export list="
|
|||||||
--ignore-table=$base.llx_cabinetmed_c_ccam
|
--ignore-table=$base.llx_cabinetmed_c_ccam
|
||||||
--ignore-table=$base.llx_cabinetmed_c_examconclusion
|
--ignore-table=$base.llx_cabinetmed_c_examconclusion
|
||||||
--ignore-table=$base.llx_cabinetmed_cons
|
--ignore-table=$base.llx_cabinetmed_cons
|
||||||
|
--ignore-table=$base.llx_cabinetmed_cons_extrafields
|
||||||
--ignore-table=$base.llx_cabinetmed_diaglec
|
--ignore-table=$base.llx_cabinetmed_diaglec
|
||||||
--ignore-table=$base.llx_cabinetmed_examaut
|
--ignore-table=$base.llx_cabinetmed_examaut
|
||||||
--ignore-table=$base.llx_cabinetmed_exambio
|
--ignore-table=$base.llx_cabinetmed_exambio
|
||||||
@ -207,7 +208,18 @@ export list="
|
|||||||
--ignore-table=$base.llx_dolicloud_customers
|
--ignore-table=$base.llx_dolicloud_customers
|
||||||
--ignore-table=$base.llx_dolicloud_stats
|
--ignore-table=$base.llx_dolicloud_stats
|
||||||
--ignore-table=$base.llx_dolicloud_emailstemplates
|
--ignore-table=$base.llx_dolicloud_emailstemplates
|
||||||
|
--ignore-table=$base.llx_dolireport_column
|
||||||
|
--ignore-table=$base.llx_dolireport_criteria
|
||||||
|
--ignore-table=$base.llx_dolireport_graph
|
||||||
|
--ignore-table=$base.llx_dolireport_plot
|
||||||
|
--ignore-table=$base.llx_dolireport_report
|
||||||
--ignore-table=$base.llx_domain
|
--ignore-table=$base.llx_domain
|
||||||
|
--ignore-table=$base.llx_ecommerce_commande
|
||||||
|
--ignore-table=$base.llx_ecommerce_facture
|
||||||
|
--ignore-table=$base.llx_ecommerce_product
|
||||||
|
--ignore-table=$base.llx_ecommerce_site
|
||||||
|
--ignore-table=$base.llx_ecommerce_societe
|
||||||
|
--ignore-table=$base.llx_ecommerce_socpeople
|
||||||
--ignore-table=$base.llx_element_rang
|
--ignore-table=$base.llx_element_rang
|
||||||
--ignore-table=$base.llx_entity
|
--ignore-table=$base.llx_entity
|
||||||
--ignore-table=$base.llx_filemanager_roots
|
--ignore-table=$base.llx_filemanager_roots
|
||||||
@ -215,6 +227,8 @@ export list="
|
|||||||
--ignore-table=$base.llx_google_maps
|
--ignore-table=$base.llx_google_maps
|
||||||
--ignore-table=$base.llx_milestone
|
--ignore-table=$base.llx_milestone
|
||||||
--ignore-table=$base.llx_monitoring_probes
|
--ignore-table=$base.llx_monitoring_probes
|
||||||
|
--ignore-table=$base.llx_m
|
||||||
|
--ignore-table=$base.llx_m_extrafields
|
||||||
--ignore-table=$base.llx_notes
|
--ignore-table=$base.llx_notes
|
||||||
--ignore-table=$base.llx_pos_cash
|
--ignore-table=$base.llx_pos_cash
|
||||||
--ignore-table=$base.llx_pos_control_cash
|
--ignore-table=$base.llx_pos_control_cash
|
||||||
|
|||||||
@ -158,6 +158,7 @@ class Adherent extends CommonObject
|
|||||||
$from=$conf->email_from;
|
$from=$conf->email_from;
|
||||||
if (! empty($conf->global->ADHERENT_MAIL_FROM)) $from=$conf->global->ADHERENT_MAIL_FROM;
|
if (! empty($conf->global->ADHERENT_MAIL_FROM)) $from=$conf->global->ADHERENT_MAIL_FROM;
|
||||||
|
|
||||||
|
// Send email (substitutionarray must be done just before this)
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||||
$mailfile = new CMailFile($subjecttosend, $this->email, $from, $texttosend, $filename_list, $mimetype_list, $mimefilename_list, $addr_cc, $addr_bcc, $deliveryreceipt, $msgishtml);
|
$mailfile = new CMailFile($subjecttosend, $this->email, $from, $texttosend, $filename_list, $mimetype_list, $mimefilename_list, $addr_cc, $addr_bcc, $deliveryreceipt, $msgishtml);
|
||||||
if ($mailfile->sendfile())
|
if ($mailfile->sendfile())
|
||||||
|
|||||||
@ -46,13 +46,18 @@ if ($action == 'test' || $action == 'send')
|
|||||||
}
|
}
|
||||||
|
|
||||||
$substitutionarrayfortest=array(
|
$substitutionarrayfortest=array(
|
||||||
'__LOGIN__' => $user->login,
|
'__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT,
|
||||||
'__ID__' => 'TESTIdRecord',
|
'__ID__' => 'RecipientIdRecord',
|
||||||
'__EMAIL__' => 'TESTEMail',
|
//'__EMAIL__' => 'RecipientEMail', // Done into actions_sendmails
|
||||||
'__LASTNAME__' => 'TESTLastname',
|
'__CHECK_READ__' => (is_object($object) && is_object($object->thirdparty))?'<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$object->thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>':'',
|
||||||
'__FIRSTNAME__' => 'TESTFirstname',
|
'__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$usersignature:''), // Done into actions_sendmails
|
||||||
'__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$usersignature:''),
|
'__LOGIN__' => 'RecipientLogin',
|
||||||
//'__PERSONALIZED__' => 'TESTPersonalized' // Hiden because not used yet
|
'__LASTNAME__' => 'RecipientLastname',
|
||||||
|
'__FIRSTNAME__' => 'RecipientFirstname',
|
||||||
|
'__ADDRESS__'=> 'RecipientAddress',
|
||||||
|
'__ZIP__'=> 'RecipientZip',
|
||||||
|
'__TOWN_'=> 'RecipientTown',
|
||||||
|
'__COUNTRY__'=> 'RecipientCountry'
|
||||||
);
|
);
|
||||||
complete_substitutions_array($substitutionarrayfortest, $langs);
|
complete_substitutions_array($substitutionarrayfortest, $langs);
|
||||||
|
|
||||||
|
|||||||
@ -61,7 +61,7 @@ $object->substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation
|
|||||||
|
|
||||||
$object->substitutionarrayfortest=array(
|
$object->substitutionarrayfortest=array(
|
||||||
'__ID__' => 'TESTIdRecord',
|
'__ID__' => 'TESTIdRecord',
|
||||||
'__EMAIL__' => 'TESTEMail',
|
//'__EMAIL__' => 'TESTEMail', // Done into "send" action
|
||||||
'__LASTNAME__' => 'TESTLastname',
|
'__LASTNAME__' => 'TESTLastname',
|
||||||
'__FIRSTNAME__' => 'TESTFirstname',
|
'__FIRSTNAME__' => 'TESTFirstname',
|
||||||
'__MAILTOEMAIL__' => 'TESTMailtoEmail',
|
'__MAILTOEMAIL__' => 'TESTMailtoEmail',
|
||||||
@ -409,6 +409,8 @@ if (empty($reshook))
|
|||||||
$msgishtml=-1; // Inconnu par defaut
|
$msgishtml=-1; // Inconnu par defaut
|
||||||
if (preg_match('/[\s\t]*<html>/i',$object->body)) $msgishtml=1;
|
if (preg_match('/[\s\t]*<html>/i',$object->body)) $msgishtml=1;
|
||||||
|
|
||||||
|
$object->substitutionarrayfortest['__EMAIL__'] = $object->sendto; // other are set at begin of page
|
||||||
|
|
||||||
// Pratique les substitutions sur le sujet et message
|
// Pratique les substitutions sur le sujet et message
|
||||||
$tmpsujet=make_substitutions($object->sujet,$object->substitutionarrayfortest);
|
$tmpsujet=make_substitutions($object->sujet,$object->substitutionarrayfortest);
|
||||||
$tmpbody=make_substitutions($object->body,$object->substitutionarrayfortest);
|
$tmpbody=make_substitutions($object->body,$object->substitutionarrayfortest);
|
||||||
|
|||||||
@ -83,7 +83,7 @@ if (! $error && $massaction == 'confirm_presend')
|
|||||||
$result=$objecttmp->fetch($toselectid);
|
$result=$objecttmp->fetch($toselectid);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$listoinvoicesid[$toselectid]=$toselectid;
|
$listofobjectid[$toselectid]=$toselectid;
|
||||||
$thirdpartyid=$objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid;
|
$thirdpartyid=$objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid;
|
||||||
$listofobjectthirdparties[$thirdpartyid]=$thirdpartyid;
|
$listofobjectthirdparties[$thirdpartyid]=$thirdpartyid;
|
||||||
$listofobjectref[$thirdpartyid][$toselectid]=$objecttmp;
|
$listofobjectref[$thirdpartyid][$toselectid]=$objecttmp;
|
||||||
@ -170,7 +170,7 @@ if (! $error && $massaction == 'confirm_presend')
|
|||||||
|
|
||||||
//var_dump($listofobjectref);exit;
|
//var_dump($listofobjectref);exit;
|
||||||
$attachedfiles=array('paths'=>array(), 'names'=>array(), 'mimes'=>array());
|
$attachedfiles=array('paths'=>array(), 'names'=>array(), 'mimes'=>array());
|
||||||
$listofqualifiedinvoice=array();
|
$listofqualifiedid=array();
|
||||||
$listofqualifiedref=array();
|
$listofqualifiedref=array();
|
||||||
foreach($listofobjectref[$thirdpartyid] as $objectid => $object)
|
foreach($listofobjectref[$thirdpartyid] as $objectid => $object)
|
||||||
{
|
{
|
||||||
@ -224,7 +224,7 @@ if (! $error && $massaction == 'confirm_presend')
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$listofqualifiedinvoice[$objectid]=$object;
|
$listofqualifiedid[$objectid]=$object;
|
||||||
$listofqualifiedref[$objectid]=$object->ref;
|
$listofqualifiedref[$objectid]=$object->ref;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -239,8 +239,8 @@ if (! $error && $massaction == 'confirm_presend')
|
|||||||
//var_dump($listofqualifiedref);
|
//var_dump($listofqualifiedref);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Loop on each qualified invoice of the thirdparty
|
// Loop on each qualified objects of the thirdparty
|
||||||
if (count($listofqualifiedinvoice) > 0)
|
if (count($listofqualifiedid) > 0)
|
||||||
{
|
{
|
||||||
$langs->load("commercial");
|
$langs->load("commercial");
|
||||||
|
|
||||||
@ -267,17 +267,35 @@ if (! $error && $massaction == 'confirm_presend')
|
|||||||
$subject = GETPOST('subject');
|
$subject = GETPOST('subject');
|
||||||
$message = GETPOST('message');
|
$message = GETPOST('message');
|
||||||
$sendtocc = GETPOST('sentocc');
|
$sendtocc = GETPOST('sentocc');
|
||||||
$sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO);
|
$sendtobcc = '';
|
||||||
|
if ($objectclass == 'Propale') $sendtocc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO);
|
||||||
|
if ($objectclass == 'Commande') $sendtocc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO);
|
||||||
|
if ($objectclass == 'Facture') $sendtocc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO);
|
||||||
|
if ($objectclass == 'Supplier_Proposal') $sendtocc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO);
|
||||||
|
if ($objectclass == 'CommandeFournisseur') $sendtocc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO);
|
||||||
|
if ($objectclass == 'FactureFournisseur') $sendtocc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO);
|
||||||
|
|
||||||
|
|
||||||
$substitutionarray=array(
|
$substitutionarray=array(
|
||||||
'__ID__' => join(', ',array_keys($listofqualifiedinvoice)),
|
'__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT,
|
||||||
|
'__ID__' => join(', ',array_keys($listofqualifiedid)),
|
||||||
'__EMAIL__' => $thirdparty->email,
|
'__EMAIL__' => $thirdparty->email,
|
||||||
'__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>',
|
'__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>',
|
||||||
'__FACREF__' => join(', ',$listofqualifiedref), // For backward compatibility
|
'__FACREF__' => join(', ',$listofqualifiedref), // For backward compatibility
|
||||||
'__ORDERREF__' => join(', ',$listofqualifiedref), // For backward compatibility
|
'__ORDERREF__' => join(', ',$listofqualifiedref), // For backward compatibility
|
||||||
'__PROPREF__' => join(', ',$listofqualifiedref), // For backward compatibility
|
'__PROPREF__' => join(', ',$listofqualifiedref), // For backward compatibility
|
||||||
'__REF__' => join(', ',$listofqualifiedref),
|
'__REF__' => join(', ',$listofqualifiedref),
|
||||||
'__REFCLIENT__' => $thirdparty->name
|
'__REFCLIENT__' => $thirdparty->name,
|
||||||
|
'__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?dol_string_nohtmltag($user->signature):'')
|
||||||
|
/* not available on all object
|
||||||
|
/'__FIRSTNAME__'=>(is_object($object)?$object->firstname:''),
|
||||||
|
'__LASTNAME__'=>(is_object($object)?$object->lastname:''),
|
||||||
|
'__FULLNAME__'=>(is_object($object)?$object->getFullName($langs):''),
|
||||||
|
'__ADDRESS__'=>(is_object($object)?$object->address:''),
|
||||||
|
'__ZIP__'=>(is_object($object)?$object->zip:''),
|
||||||
|
'__TOWN_'=>(is_object($object)?$object->town:''),
|
||||||
|
'__COUNTRY__'=>(is_object($object)?$object->country:''),
|
||||||
|
*/
|
||||||
);
|
);
|
||||||
|
|
||||||
$subject=make_substitutions($subject, $substitutionarray);
|
$subject=make_substitutions($subject, $substitutionarray);
|
||||||
@ -289,7 +307,7 @@ if (! $error && $massaction == 'confirm_presend')
|
|||||||
|
|
||||||
//var_dump($filepath);
|
//var_dump($filepath);
|
||||||
|
|
||||||
// Send mail
|
// Send mail (substitutionarray must be done just before this)
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php');
|
require_once(DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php');
|
||||||
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1);
|
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1);
|
||||||
if ($mailfile->error)
|
if ($mailfile->error)
|
||||||
@ -306,7 +324,7 @@ if (! $error && $massaction == 'confirm_presend')
|
|||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
// Insert logs into agenda
|
// Insert logs into agenda
|
||||||
foreach($listofqualifiedinvoice as $invid => $object)
|
foreach($listofqualifiedid as $objid => $object)
|
||||||
{
|
{
|
||||||
/*if ($objectclass == 'Propale') $actiontypecode='AC_PROP';
|
/*if ($objectclass == 'Propale') $actiontypecode='AC_PROP';
|
||||||
if ($objectclass == 'Commande') $actiontypecode='AC_COM';
|
if ($objectclass == 'Commande') $actiontypecode='AC_COM';
|
||||||
@ -329,7 +347,7 @@ if (! $error && $massaction == 'confirm_presend')
|
|||||||
$object->sendtoid = 0;
|
$object->sendtoid = 0;
|
||||||
$object->actionmsg = $actionmsg; // Long text
|
$object->actionmsg = $actionmsg; // Long text
|
||||||
$object->actionmsg2 = $actionmsg2; // Short text
|
$object->actionmsg2 = $actionmsg2; // Short text
|
||||||
$object->fk_element = $invid;
|
$object->fk_element = $objid;
|
||||||
$object->elementtype = $object->element;
|
$object->elementtype = $object->element;
|
||||||
|
|
||||||
// Appel des triggers
|
// Appel des triggers
|
||||||
@ -404,7 +422,7 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se
|
|||||||
$result=$objecttmp->fetch($toselectid);
|
$result=$objecttmp->fetch($toselectid);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$listoinvoicesid[$toselectid]=$toselectid;
|
$listofobjectid[$toselectid]=$toselectid;
|
||||||
$thirdpartyid=$objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid;
|
$thirdpartyid=$objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid;
|
||||||
$listofobjectthirdparties[$thirdpartyid]=$thirdpartyid;
|
$listofobjectthirdparties[$thirdpartyid]=$thirdpartyid;
|
||||||
$listofobjectref[$toselectid]=$objecttmp->ref;
|
$listofobjectref[$toselectid]=$objecttmp->ref;
|
||||||
|
|||||||
@ -344,9 +344,31 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send mail
|
$substitutionarray=array(
|
||||||
|
'__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT,
|
||||||
|
'__ID__' => (is_object($object)?$object->id:''),
|
||||||
|
'__EMAIL__' => $sendto,
|
||||||
|
'__CHECK_READ__' => (is_object($object) && is_object($object->thirdparty))?'<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$object->thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>':'',
|
||||||
|
'__REF__' => (is_object($object)?$object->ref:''),
|
||||||
|
'__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?dol_string_nohtmltag($user->signature):'')
|
||||||
|
/* not available on all object
|
||||||
|
/'__FIRSTNAME__'=>(is_object($object)?$object->firstname:''),
|
||||||
|
'__LASTNAME__'=>(is_object($object)?$object->lastname:''),
|
||||||
|
'__FULLNAME__'=>(is_object($object)?$object->getFullName($langs):''),
|
||||||
|
'__ADDRESS__'=>(is_object($object)?$object->address:''),
|
||||||
|
'__ZIP__'=>(is_object($object)?$object->zip:''),
|
||||||
|
'__TOWN_'=>(is_object($object)?$object->town:''),
|
||||||
|
'__COUNTRY__'=>(is_object($object)?$object->country:''),
|
||||||
|
*/
|
||||||
|
);
|
||||||
|
|
||||||
|
$subject=make_substitutions($subject, $substitutionarray);
|
||||||
|
$message=make_substitutions($message, $substitutionarray);
|
||||||
|
|
||||||
|
// Send mail (substitutionarray must be done just before this)
|
||||||
if (empty($sendcontext)) $sendcontext = 'standard';
|
if (empty($sendcontext)) $sendcontext = 'standard';
|
||||||
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1,'','',$trackid,'',$sendcontext);
|
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1,'','',$trackid,'', $sendcontext);
|
||||||
|
|
||||||
if ($mailfile->error)
|
if ($mailfile->error)
|
||||||
{
|
{
|
||||||
setEventMessage($mailfile->error, 'errors');
|
setEventMessage($mailfile->error, 'errors');
|
||||||
|
|||||||
@ -38,6 +38,7 @@ class CMailFile
|
|||||||
{
|
{
|
||||||
public $sendcontext;
|
public $sendcontext;
|
||||||
public $sendmode;
|
public $sendmode;
|
||||||
|
public $sendsetup;
|
||||||
|
|
||||||
var $subject; // Topic: Subject of email
|
var $subject; // Topic: Subject of email
|
||||||
var $addr_from; // From: Label and EMail of sender (must include '<>'). For example '<myemail@example.com>' or 'John Doe <myemail@example.com>' or '<myemail+trackingid@example.com>'). Note that with gmail smtps, value here is forced by google to account (but not the reply-to).
|
var $addr_from; // From: Label and EMail of sender (must include '<>'). For example '<myemail@example.com>' or 'John Doe <myemail@example.com>' or '<myemail+trackingid@example.com>'). Note that with gmail smtps, value here is forced by google to account (but not the reply-to).
|
||||||
@ -178,7 +179,7 @@ class CMailFile
|
|||||||
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
||||||
|
|
||||||
// Replace relative /viewimage to absolute path
|
// Replace relative /viewimage to absolute path
|
||||||
$msg = preg_replace('/src="'.preg_quote(DOL_URL_ROOT,'/').'\/viewimage\.php/', 'src="'.$urlwithroot.'/viewimage.php', $msg, -1, $nbrep);
|
$msg = preg_replace('/src="'.preg_quote(DOL_URL_ROOT,'/').'\/viewimage\.php/ims', 'src="'.$urlwithroot.'/viewimage.php', $msg, -1, $nbrep);
|
||||||
|
|
||||||
if (! empty($conf->global->MAIN_MAIL_FORCE_CONTENT_TYPE_TO_HTML)) $this->msgishtml=1; // To force to send everything with content type html.
|
if (! empty($conf->global->MAIN_MAIL_FORCE_CONTENT_TYPE_TO_HTML)) $this->msgishtml=1; // To force to send everything with content type html.
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2008-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2008-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -201,11 +201,19 @@ function dol_loginfunction($langs,$conf,$mysoc)
|
|||||||
$demopassword=$tab[1];
|
$demopassword=$tab[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute hook getLoginPageOptions
|
// Execute hook getLoginPageOptions (for table)
|
||||||
// Should be an array with differents options in $hookmanager->resArray
|
|
||||||
$parameters=array('entity' => GETPOST('entity','int'));
|
$parameters=array('entity' => GETPOST('entity','int'));
|
||||||
$reshook = $hookmanager->executeHooks('getLoginPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks. resArray is filled by hook.
|
$reshook = $hookmanager->executeHooks('getLoginPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks.
|
||||||
$morelogincontent = $hookmanager->resArray['options']; // TODO Use here a resprints
|
if (is_array($hookmanager->resArray) && ! empty($hookmanager->resArray)) {
|
||||||
|
$morelogincontent = $hookmanager->resArray; // (deprecated) For compatibility
|
||||||
|
} else {
|
||||||
|
$morelogincontent = $hookmanager->resPrint;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Execute hook getLoginPageExtraOptions (eg for js)
|
||||||
|
$parameters=array('entity' => GETPOST('entity','int'));
|
||||||
|
$reshook = $hookmanager->executeHooks('getLoginPageExtraOptions',$parameters); // Note that $action and $object may have been modified by some hooks.
|
||||||
|
$moreloginextracontent = $hookmanager->resPrint;
|
||||||
|
|
||||||
// Login
|
// Login
|
||||||
$login = (! empty($hookmanager->resArray['username']) ? $hookmanager->resArray['username'] : (GETPOST("username","alpha") ? GETPOST("username","alpha") : $demologin));
|
$login = (! empty($hookmanager->resArray['username']) ? $hookmanager->resArray['username'] : (GETPOST("username","alpha") ? GETPOST("username","alpha") : $demologin));
|
||||||
|
|||||||
@ -49,7 +49,7 @@ print top_htmlhead('', $titleofloginpage, 0, 0, $arrayofjs, array(), 0, $disable
|
|||||||
?>
|
?>
|
||||||
<!-- BEGIN PHP TEMPLATE LOGIN.TPL.PHP -->
|
<!-- BEGIN PHP TEMPLATE LOGIN.TPL.PHP -->
|
||||||
|
|
||||||
<body class="body bodylogin"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND)?'':' style="background-size: cover; background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file='.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>>
|
<body class="body bodylogin"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND)?'':' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file='.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>>
|
||||||
|
|
||||||
<?php if (empty($conf->dol_use_jmobile)) { ?>
|
<?php if (empty($conf->dol_use_jmobile)) { ?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@ -123,23 +123,28 @@ if ($disablenofollow) echo '</a>';
|
|||||||
</span>
|
</span>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<?php
|
<?php
|
||||||
if (! empty($morelogincontent) && is_array($morelogincontent)) {
|
if (! empty($morelogincontent)) {
|
||||||
foreach ($morelogincontent as $format => $option)
|
if (is_array($morelogincontent)) {
|
||||||
{
|
foreach ($morelogincontent as $format => $option)
|
||||||
if ($format == 'table') {
|
{
|
||||||
echo '<!-- Option by hook -->';
|
if ($format == 'table') {
|
||||||
echo $option;
|
echo '<!-- Option by hook -->';
|
||||||
|
echo $option;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
echo '<!-- Option by hook -->';
|
||||||
|
echo $morelogincontent;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
<?php
|
if ($captcha) {
|
||||||
if ($captcha) {
|
// Add a variable param to force not using cache (jmobile)
|
||||||
// Add a variable param to force not using cache (jmobile)
|
$php_self = preg_replace('/[&\?]time=(\d+)/','',$php_self); // Remove param time
|
||||||
$php_self = preg_replace('/[&\?]time=(\d+)/','',$php_self); // Remove param time
|
if (preg_match('/\?/',$php_self)) $php_self.='&time='.dol_print_date(dol_now(),'dayhourlog');
|
||||||
if (preg_match('/\?/',$php_self)) $php_self.='&time='.dol_print_date(dol_now(),'dayhourlog');
|
else $php_self.='?time='.dol_print_date(dol_now(),'dayhourlog');
|
||||||
else $php_self.='?time='.dol_print_date(dol_now(),'dayhourlog');
|
// TODO: provide accessible captcha variants
|
||||||
// TODO: provide accessible captcha variants
|
|
||||||
?>
|
?>
|
||||||
<!-- Captcha -->
|
<!-- Captcha -->
|
||||||
<tr>
|
<tr>
|
||||||
@ -275,9 +280,9 @@ if (!empty($conf->global->MAIN_EASTER_EGG_COMMITSTRIP)) {
|
|||||||
|
|
||||||
<!-- Common footer is not used for login page, this is same than footer but inside login tpl -->
|
<!-- Common footer is not used for login page, this is same than footer but inside login tpl -->
|
||||||
|
|
||||||
<?php if (! empty($conf->global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER; ?>
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
if (! empty($conf->global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER;
|
||||||
|
|
||||||
if (! empty($morelogincontent) && is_array($morelogincontent)) {
|
if (! empty($morelogincontent) && is_array($morelogincontent)) {
|
||||||
foreach ($morelogincontent as $format => $option)
|
foreach ($morelogincontent as $format => $option)
|
||||||
{
|
{
|
||||||
@ -287,9 +292,11 @@ if (! empty($morelogincontent) && is_array($morelogincontent)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
else if (! empty($moreloginextracontent)) {
|
||||||
|
echo '<!-- Javascript by hook -->';
|
||||||
|
echo $moreloginextracontent;
|
||||||
|
}
|
||||||
|
|
||||||
<?php
|
|
||||||
// Google Analytics (need Google module)
|
// Google Analytics (need Google module)
|
||||||
if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AN_ID))
|
if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AN_ID))
|
||||||
{
|
{
|
||||||
@ -309,9 +316,7 @@ if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AN_ID)
|
|||||||
print '</script>'."\n";
|
print '</script>'."\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
// Google Adsense
|
// Google Adsense
|
||||||
if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && ! empty($conf->global->MAIN_GOOGLE_AD_SLOT))
|
if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && ! empty($conf->global->MAIN_GOOGLE_AD_SLOT))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -35,7 +35,7 @@ print top_htmlhead('',$langs->trans('SendNewPassword'));
|
|||||||
?>
|
?>
|
||||||
<!-- BEGIN PHP TEMPLATE PASSWORDFORGOTTEN.TPL.PHP -->
|
<!-- BEGIN PHP TEMPLATE PASSWORDFORGOTTEN.TPL.PHP -->
|
||||||
|
|
||||||
<body class="body bodylogin"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND)?'':' style="background-size: cover; background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file='.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>>
|
<body class="body bodylogin"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND)?'':' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file='.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>>
|
||||||
|
|
||||||
<?php if (empty($conf->dol_use_jmobile)) { ?>
|
<?php if (empty($conf->dol_use_jmobile)) { ?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@ -88,14 +88,20 @@ if ($disablenofollow) echo '</a>';
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if (! empty($hookmanager->resArray['options'])) {
|
if (! empty($morelogincontent)) {
|
||||||
foreach ($hookmanager->resArray['options'] as $format => $option)
|
if (is_array($morelogincontent)) {
|
||||||
{
|
foreach ($morelogincontent as $format => $option)
|
||||||
if ($format == 'table') {
|
{
|
||||||
echo '<!-- Option by hook -->';
|
if ($format == 'table') {
|
||||||
echo $option;
|
echo '<!-- Option by hook -->';
|
||||||
|
echo $option;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
echo '<!-- Option by hook -->';
|
||||||
|
echo $morelogincontent;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
@ -175,6 +181,20 @@ if (! empty($hookmanager->resArray['options'])) {
|
|||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
<?php if (! empty($morelogincontent) && is_array($morelogincontent)) {
|
||||||
|
foreach ($morelogincontent as $format => $option)
|
||||||
|
{
|
||||||
|
if ($format == 'js') {
|
||||||
|
echo "\n".'<!-- Javascript by hook -->';
|
||||||
|
echo $option."\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (! empty($moreloginextracontent)) {
|
||||||
|
echo '<!-- Javascript by hook -->';
|
||||||
|
echo $moreloginextracontent;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div> <!-- end of center -->
|
</div> <!-- end of center -->
|
||||||
|
|||||||
@ -797,7 +797,6 @@ if (empty($action))
|
|||||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||||
print '<input type="hidden" name="action" value="list">';
|
|
||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
|
|||||||
@ -71,7 +71,7 @@ MaxSize=Maximum size
|
|||||||
AttachANewFile=Attach a new file/document
|
AttachANewFile=Attach a new file/document
|
||||||
LinkedObject=Linked object
|
LinkedObject=Linked object
|
||||||
NbOfActiveNotifications=Number of notifications (nb of recipient emails)
|
NbOfActiveNotifications=Number of notifications (nb of recipient emails)
|
||||||
PredefinedMailTest=This is a test mail.\nThe two lines are separated by a carriage return.\n\n__SIGNATURE__
|
PredefinedMailTest=This is a test mail sent to __EMAIL__.\nThe two lines are separated by a carriage return.\n\n__SIGNATURE__
|
||||||
PredefinedMailTestHtml=This is a <b>test</b> mail (the word test must be in bold).<br>The two lines are separated by a carriage return.<br><br>__SIGNATURE__
|
PredefinedMailTestHtml=This is a <b>test</b> mail (the word test must be in bold).<br>The two lines are separated by a carriage return.<br><br>__SIGNATURE__
|
||||||
PredefinedMailContentSendInvoice=__CONTACTCIVNAME__\n\nYou will find here the invoice __REF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
|
PredefinedMailContentSendInvoice=__CONTACTCIVNAME__\n\nYou will find here the invoice __REF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
|
||||||
PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__\n\nWe would like to warn you that the invoice __REF__ seems to not being payed. So this is the invoice in attachment again, as a reminder.\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
|
PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__\n\nWe would like to warn you that the invoice __REF__ seems to not being payed. So this is the invoice in attachment again, as a reminder.\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
|
||||||
|
|||||||
@ -224,10 +224,19 @@ if (function_exists("imagecreatefrompng") && ! $disabled)
|
|||||||
$captcha_refresh = img_picto($langs->trans("Refresh"),'refresh','id="captcha_refresh_img"');
|
$captcha_refresh = img_picto($langs->trans("Refresh"),'refresh','id="captcha_refresh_img"');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute hook getPasswordForgottenPageOptions
|
// Execute hook getPasswordForgottenPageOptions (for table)
|
||||||
// Should be an array with differents options in $hookmanager->resArray
|
|
||||||
$parameters=array('entity' => GETPOST('entity','int'));
|
$parameters=array('entity' => GETPOST('entity','int'));
|
||||||
$hookmanager->executeHooks('getPasswordForgottenPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks
|
$hookmanager->executeHooks('getPasswordForgottenPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if (is_array($hookmanager->resArray) && ! empty($hookmanager->resArray)) {
|
||||||
|
$morelogincontent = $hookmanager->resArray; // (deprecated) For compatibility
|
||||||
|
} else {
|
||||||
|
$morelogincontent = $hookmanager->resPrint;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Execute hook getPasswordForgottenPageExtraOptions (eg for js)
|
||||||
|
$parameters=array('entity' => GETPOST('entity','int'));
|
||||||
|
$reshook = $hookmanager->executeHooks('getPasswordForgottenPageExtraOptions',$parameters); // Note that $action and $object may have been modified by some hooks.
|
||||||
|
$moreloginextracontent = $hookmanager->resPrint;
|
||||||
|
|
||||||
include $template_dir.'passwordforgotten.tpl.php'; // To use native PHP
|
include $template_dir.'passwordforgotten.tpl.php'; // To use native PHP
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user