diff --git a/ChangeLog b/ChangeLog index 9e9fb51ab84..9aae192541f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,7 @@ For users: MARGIN_PMP_AS_DEFAULT_BUY_PRICE to replace with first supplier price. - Introduce option MAIN_HTML_TITLE to start to control format of html title content. - Add extrafields on bank account cards. +- Added delay between mails in Newsletter module For translators: - Update language files. diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php index 22a6531fad6..8c080999e6c 100644 --- a/htdocs/admin/mailing.php +++ b/htdocs/admin/mailing.php @@ -48,11 +48,14 @@ if ($action == 'setvalue') $mailerror = GETPOST('MAILING_EMAIL_ERRORSTO','alpha'); $checkread = GETPOST('value','alpha'); $checkread_key = GETPOST('MAILING_EMAIL_UNSUBSCRIBE_KEY','alpha'); + $mailingdelay = GETPOST('MAILING_DELAY', 'int'); $res=dolibarr_set_const($db, "MAILING_EMAIL_FROM",$mailfrom,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; $res=dolibarr_set_const($db, "MAILING_EMAIL_ERRORSTO",$mailerror,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; + $res=dolibarr_set_const($db, "MAILING_DELAY",$mailingdelay,'chaine',0,'',$conf->entity); + if (! $res > 0) $error++; // Create temporary encryption key if nedded $res=dolibarr_set_const($db, "MAILING_EMAIL_UNSUBSCRIBE_KEY",$checkread_key,'chaine',0,'',$conf->entity); @@ -124,6 +127,12 @@ print ''; +$var=!$var; +print ''; +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. $var=!$var; diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index a775408e9a8..8fdab8115a6 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -519,7 +519,7 @@ if ($id > 0) print ''; print ''; - print '
'; + print ''; print ''; @@ -531,11 +531,13 @@ if ($id > 0) $objp = $db->fetch_object($resql); $var=!$var; print ""; - print '\n"; print ''; print ''; @@ -592,7 +594,7 @@ if ($id > 0) print '
'.$langs->trans("LastPropals",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllPropals").' ('.$num.')'; print ''; print '
'.$langs->trans("LastPropals",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllPropals").' '.$num.''.img_picto($langs->trans("Statistics"),'stats').'
'.img_object($langs->trans("ShowPropal"),"propal").' '.$objp->ref.''."\n"; - if ( ($db->jdate($objp->dp) < ($now - $conf->propal->cloture->warning_delay)) && $objp->fk_statut == 1 ) - { - print " ".img_warning(); - } + print ''; + $propal_static->id=$objp->propalid; + $propal_static->ref=$objp->ref; + print $propal_static->getNomUrl(1); + if ( ($db->jdate($objp->dp) < ($now - $conf->propal->cloture->warning_delay)) && $objp->fk_statut == 1 ) { + print " ".img_warning(); + } print ''.dol_print_date($db->jdate($objp->dp),'day')."'.price($objp->total_ht).''.$propal_static->LibStatut($objp->fk_statut,5).'
'; print ''; - print '
'; + print ''; print ''; } $i = 0; @@ -706,7 +711,7 @@ if ($id > 0) print '
'.$langs->trans("LastOrders",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllOrders").' ('.$num.')'; print ''; //if($num2 > 0) print ''; //else print ''; @@ -606,7 +608,10 @@ if ($id > 0) $objp = $db->fetch_object($resql); $var=!$var; print ""; - print '\n"; print ''; print ''; @@ -647,7 +652,7 @@ if ($id > 0) print ''; print ''; + print '
'.$langs->trans("LastOrders",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllOrders").' '.$num.''.img_picto($langs->trans("Statistics"),'stats').''.img_picto($langs->trans("CreateInvoiceForThisCustomer"),'object_bill').''.img_picto($langs->trans("NoOrdersToInvoice"),'object_bill').'
'.img_object($langs->trans("ShowOrder"),"order").' '.$objp->ref."\n"; + print ''; + $commande_static->id=$objp->cid; + $commande_static->ref=$objp->ref; + print $commande_static->getNomUrl(1); print ''.dol_print_date($db->jdate($objp->dc),'day')."'.price($objp->total_ht).''.$commande_static->LibStatut($objp->fk_statut,$objp->facture,5).'
'; - print '
'.$langs->trans("LastContracts",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllContracts").' ('.$num.')
'.$langs->trans("AllContracts").' '.$num.'
'; print ''; - print ''; + print ''; print ''; $var=!$var; } @@ -769,7 +774,7 @@ if ($id > 0) $tableaushown=1; print ''; - print ''; print ''; @@ -367,7 +367,11 @@ if ($object->id > 0) $var=!$var; print ""; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/fourn/index.php b/htdocs/fourn/index.php index 9da28281779..29f12fed38f 100644 --- a/htdocs/fourn/index.php +++ b/htdocs/fourn/index.php @@ -126,7 +126,7 @@ if (! empty($conf->fournisseur->enabled)) { print '
'.$langs->trans("LastInterventions",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllInterventions").' ('.$num.')
'.$langs->trans("LastInterventions",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllInterventions").' '.$num.'
'; + print ''; print ''; diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 509b26ae104..f9d00ad7956 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -325,8 +325,12 @@ if (empty($reshook)) } } + if (!empty($conf->global->MAILING_DELAY)) + { + sleep($conf->global->MAILING_DELAY); + } - //test if CHECK READ change statut prospect contact + //test if CHECK READ change statut prospect contact } else { diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index de51cf63104..a0e8a3409ab 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -313,7 +313,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) $var=true; print '
'.$langs->trans("LastCustomersBills",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllBills").' ('.$num.')'; print ''; print '
'.$langs->trans("LastCustomersBills",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllBills").' '.$num.''.img_picto($langs->trans("Statistics"),'stats').'
'; - print ''; + print ''; $nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?500:$conf->global->MAIN_MAXLIST_OVERLOAD)); while ($i < $nbofloop) @@ -399,7 +399,7 @@ if (! empty($conf->propal->enabled)) print '
'.$langs->trans("ProposalsOpened").' ('.$num.')
'.$langs->trans("ProposalsOpened").' '.$num.'
'; print ''; - print ''; + print ''; if ($num) { @@ -471,7 +471,7 @@ if (! empty($conf->propal->enabled)) print '
'.$langs->trans("ProposalsToProcess").' ('.$num.')
'.$langs->trans("ProposalsToProcess").' '.$num.'
'; print ''; - print ''; + print ''; if ($num) { diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 0d2815a6d67..40b39ccb666 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -303,7 +303,7 @@ if (! empty($conf->commande->enabled)) print '
'.$langs->trans("OnProcessOrders").' ('.$num.')
'.$langs->trans("OnProcessOrders").' '.$num.'
'; print ''; - print ''; + print ''; if ($num) { @@ -374,7 +374,7 @@ if (! empty($conf->commande->enabled)) print '
'.$langs->trans("OrdersToProcess").' ('.$num.')
'.$langs->trans("OrdersToProcess").' '.$num.'
'; print ''; - print ''; + print ''; if ($num) { diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 991601a4fbd..6087a5a0adb 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -30,6 +30,36 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; */ abstract class CommonInvoice extends CommonObject { + /** + * Standard invoice + */ + const TYPE_STANDARD = 0; + + /** + * Replacement invoice + */ + const TYPE_REPLACEMENT = 1; + + /** + * Credit note invoice + */ + const TYPE_CREDIT_NOTE = 2; + + /** + * Deposit invoice + */ + const TYPE_DEPOSIT = 3; + + /** + * Proforma invoice + */ + const TYPE_PROFORMA = 4; + + /** + * Situation invoice + */ + const TYPE_SITUATION = 5; + /** * Return amount of payments already done * @@ -145,12 +175,12 @@ abstract class CommonInvoice extends CommonObject function getLibType() { global $langs; - if ($this->type == Facture::TYPE_STANDARD) return $langs->trans("InvoiceStandard"); - if ($this->type == Facture::TYPE_REPLACEMENT) return $langs->trans("InvoiceReplacement"); - if ($this->type == Facture::TYPE_CREDIT_NOTE) return $langs->trans("InvoiceAvoir"); - if ($this->type == Facture::TYPE_DEPOSIT) return $langs->trans("InvoiceDeposit"); - if ($this->type == Facture::TYPE_PROFORMA) return $langs->trans("InvoiceProForma"); - if ($this->type == Facture::TYPE_SITUATION) return $langs->trans("InvoiceSituation"); + if ($this->type == CommonInvoice::TYPE_STANDARD) return $langs->trans("InvoiceStandard"); + if ($this->type == CommonInvoice::TYPE_REPLACEMENT) return $langs->trans("InvoiceReplacement"); + if ($this->type == CommonInvoice::TYPE_CREDIT_NOTE) return $langs->trans("InvoiceAvoir"); + if ($this->type == CommonInvoice::TYPE_DEPOSIT) return $langs->trans("InvoiceDeposit"); + if ($this->type == CommonInvoice::TYPE_PROFORMA) return $langs->trans("InvoiceProForma"); + if ($this->type == CommonInvoice::TYPE_SITUATION) return $langs->trans("InvoiceSituation"); return $langs->trans("Unknown"); } diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 205d1a89ea6..0fefa8d4555 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -299,7 +299,7 @@ if ($object->id > 0) print '
'.$langs->trans("OnProcessOrders").' ('.$num.')
'.$langs->trans("OnProcessOrders").' '.$num.'
'; print ''; print '
'.$langs->trans("ProductsAndServices").''; - print ''.$langs->trans("All").' ('.$object->nbOfProductRefs().')'; + print ''.$langs->trans("All").' '.$object->nbOfProductRefs().''; print '
'; } @@ -355,7 +355,7 @@ if ($object->id > 0) print '
'; print ''; - print ''; + print ''; print ''; print '
'.$langs->trans("LastOrders",($num<$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllOrders").' ('.$num.')'.$langs->trans("AllOrders").' '.$num.''.img_picto($langs->trans("Statistics"),'stats').'
'; print '
'.img_object($langs->trans("ShowOrder"),"order")." ".$obj->ref.''; + $orderstatic->id=$obj->rowid; + $orderstatic->ref=$obj->ref; + print $orderstatic->getNomUrl(1); + print ''; if ($obj->dc) { @@ -422,7 +426,7 @@ if ($object->id > 0) print '
'; - print ''; + print '
'.$langs->trans('LastSuppliersBills',($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans('AllBills').' ('.$num.')
'; print ''; print '
'.$langs->trans('LastSuppliersBills',($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans('AllBills').' '.$num.''.img_picto($langs->trans("Statistics"),'stats').'
'; print '
'; print ''; - print ''; + print ''; $i = 0; $var = true; @@ -183,7 +183,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- { print '
'.$langs->trans("DraftOrders").' ('.$num.')
'.$langs->trans("DraftOrders").' '.$num.'
'; print ''; - print ''; + print ''; $i = 0; $tot_ttc = 0; $var = True; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 04278f312aa..bca163db8bd 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1395,6 +1395,7 @@ RSSUrlExample=An interesting RSS feed MailingSetup=EMailing module setup MailingEMailFrom=Sender EMail (From) for emails sent by emailing module MailingEMailError=Return EMail (Errors-to) for emails with errors +MailingDelay=Seconds to wait after sending next message ##### Notification ##### NotificationSetup=EMail notification module setup NotificationEMailFrom=Sender EMail (From) for emails sent for notifications diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php index 1de66b491ed..e7b32b2d3bc 100755 --- a/scripts/emailings/mailing-send.php +++ b/scripts/emailings/mailing-send.php @@ -245,6 +245,11 @@ if ($resql) $error++; } } + + if (!empty($conf->global->MAILING_DELAY)) { + sleep($conf->global->MAILING_DELAY); + } + } } else
'.$langs->trans("DraftBills").' ('.$num.')
'.$langs->trans("DraftBills").' '.$num.'