Skip to content
Permalink
Browse files

Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into d…

…evelop
  • Loading branch information
eldy committed Dec 2, 2019
2 parents 6d81bc7 + 92070fa commit 6f7343b14f7f0e34e6878161ec0e9304e32b3985
Showing with 77 additions and 64 deletions.
  1. +1 −1 htdocs/adherents/card.php
  2. +1 −1 htdocs/admin/mails.php
  3. +1 −1 htdocs/admin/mails_emailing.php
  4. +1 −1 htdocs/asset/card.php
  5. +1 −1 htdocs/bom/bom_card.php
  6. +1 −1 htdocs/comm/propal/card.php
  7. +4 −4 htdocs/comm/propal/class/propal.class.php
  8. +1 −1 htdocs/commande/card.php
  9. +1 −1 htdocs/commande/list.php
  10. +1 −1 htdocs/compta/facture/card.php
  11. +1 −1 htdocs/contact/card.php
  12. +1 −1 htdocs/contrat/card.php
  13. +4 −4 htdocs/core/actions_sendmails.inc.php
  14. +3 −3 htdocs/core/class/commonobject.class.php
  15. +1 −1 htdocs/core/class/html.formfile.class.php
  16. +1 −1 htdocs/core/modules/modWebsite.class.php
  17. +1 −1 htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php
  18. +13 −1 htdocs/core/photos_resize.php
  19. +3 −3 htdocs/ecm/class/ecmdirectory.class.php
  20. +1 −1 htdocs/expedition/card.php
  21. +1 −1 htdocs/expensereport/card.php
  22. +1 −1 htdocs/fichinter/card.php
  23. +11 −10 htdocs/fourn/class/fournisseur.commande.class.php
  24. +1 −1 htdocs/fourn/commande/card.php
  25. +1 −1 htdocs/fourn/facture/card.php
  26. +1 −1 htdocs/holiday/card.php
  27. BIN htdocs/install/doctemplates/websites/website_template-corporate.zip
  28. BIN htdocs/install/doctemplates/websites/website_template-stellar.zip
  29. +1 −1 htdocs/modulebuilder/template/myobject_card.php
  30. +1 −1 htdocs/mrp/mo_card.php
  31. +1 −1 htdocs/mrp/mo_production.php
  32. +1 −1 htdocs/product/inventory/card.php
  33. +1 −1 htdocs/product/inventory/inventory.php
  34. +1 −1 htdocs/projet/card.php
  35. +1 −1 htdocs/public/ticket/view.php
  36. +1 −1 htdocs/reception/card.php
  37. +1 −1 htdocs/societe/card.php
  38. +1 −1 htdocs/supplier_proposal/card.php
  39. +4 −4 htdocs/supplier_proposal/class/supplier_proposal.class.php
  40. +1 −1 htdocs/ticket/card.php
  41. +1 −1 htdocs/user/card.php
  42. +1 −1 htdocs/website/index.php
  43. +1 −1 htdocs/website/websiteaccount_card.php
  44. +1 −1 htdocs/zapier/hook_card.php
@@ -822,7 +822,7 @@
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
// Actions to send emails
$trigger_name = 'MEMBER_SENTBYMAIL';
$triggersendname = 'MEMBER_SENTBYMAIL';
$paramname = 'id';
$mode = 'emailfrommember';
$trackid = 'mem'.$object->id;
@@ -95,7 +95,7 @@
// Actions to send emails
$id = 0;
$actiontypecode = ''; // Not an event for agenda
$trigger_name = ''; // Disable triggers
$triggersendname = ''; // Disable triggers
$paramname = 'id';
$mode = 'emailfortest';
$trackid = (($action == 'testhtml') ? "testhtml" : "test");
@@ -77,7 +77,7 @@
// Actions to send emails
$id=0;
$actiontypecode=''; // Not an event for agenda
$trigger_name=''; // Disable triggers
$triggersendname = ''; // Disable triggers
$paramname='id';
$mode='emailfortest';
$trackid=(($action == 'testhtml')?"testhtml":"test");
@@ -97,7 +97,7 @@
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails
$trigger_name = 'ASSET_SENTBYMAIL';
$triggersendname = 'ASSET_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_ASSET_TO';
$trackid = 'asset'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
@@ -119,7 +119,7 @@
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
// Actions to send emails
$trigger_name = 'BOM_SENTBYMAIL';
$triggersendname = 'BOM_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_BOM_TO';
$trackid = 'bom'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
@@ -781,7 +781,7 @@
// Actions to send emails
$actiontypecode = 'AC_OTH_AUTO';
$trigger_name = 'PROPAL_SENTBYMAIL';
$triggersendname = 'PROPAL_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_PROPOSAL_TO';
$trackid = 'pro'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
@@ -2501,11 +2501,11 @@ public function cloture($user, $statut, $note = "", $notrigger = 0)
if ($resql)
{
$modelpdf = $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED ? $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED : $this->modelpdf;
$trigger_name = 'PROPAL_CLOSE_REFUSED';
$triggerName = 'PROPAL_CLOSE_REFUSED';
if ($statut == self::STATUS_SIGNED)
{
$trigger_name = 'PROPAL_CLOSE_SIGNED';
$triggerName = 'PROPAL_CLOSE_SIGNED';
$modelpdf = $conf->global->PROPALE_ADDON_PDF_ODT_TOBILL ? $conf->global->PROPALE_ADDON_PDF_ODT_TOBILL : $this->modelpdf;
// The connected company is classified as a client
@@ -2522,7 +2522,7 @@ public function cloture($user, $statut, $note = "", $notrigger = 0)
}
if ($statut == self::STATUS_BILLED) // Why this ?
{
$trigger_name = 'PROPAL_CLASSIFY_BILLED';
$triggerName = 'PROPAL_CLASSIFY_BILLED';
}
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
@@ -2550,7 +2550,7 @@ public function cloture($user, $statut, $note = "", $notrigger = 0)
if (!$notrigger && empty($error))
{
// Call trigger
$result = $this->call_trigger($trigger_name, $user);
$result = $this->call_trigger($triggerName, $user);
if ($result < 0) { $error++; }
// End call triggers
}
@@ -1415,7 +1415,7 @@
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
// Actions to send emails
$trigger_name = 'ORDER_SENTBYMAIL';
$triggersendname = 'ORDER_SENTBYMAIL';
$paramname = 'id';
$autocopy = 'MAIN_MAIL_AUTOCOPY_ORDER_TO'; // used to know the automatic BCC to add
$trackid = 'ord'.$object->id;
@@ -223,7 +223,7 @@
$permissiontoread = $user->rights->commande->lire;
$permissiontodelete = $user->rights->commande->supprimer;
$uploaddir = $conf->commande->multidir_output[$conf->entity];
$trigger_name = 'ORDER_SENTBYMAIL';
$triggersendname = 'ORDER_SENTBYMAIL';
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}
@@ -2481,7 +2481,7 @@
// Actions to send emails
if (empty($id)) $id = $facid;
$trigger_name = 'BILL_SENTBYMAIL';
$triggersendname = 'BILL_SENTBYMAIL';
$paramname = 'id';
$autocopy = 'MAIN_MAIL_AUTOCOPY_INVOICE_TO';
$trackid = 'inv'.$object->id;
@@ -482,7 +482,7 @@
}
// Actions to send emails
$trigger_name = 'CONTACT_SENTBYMAIL';
$triggersendname = 'CONTACT_SENTBYMAIL';
$paramname = 'id';
$mode = 'emailfromcontact';
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
@@ -1002,7 +1002,7 @@
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
// Actions to send emails
$trigger_name = 'CONTRACT_SENTBYMAIL';
$triggersendname = 'CONTRACT_SENTBYMAIL';
$paramname = 'id';
$mode = 'emailfromcontract';
$trackid = 'con'.$object->id;
@@ -26,7 +26,7 @@
// $id must be defined
// $paramname may be defined
// $autocopy may be defined (used to know the automatic BCC to add)
// $trigger_name must be set (can be '')
// $triggersendname must be set (can be '')
// $actiontypecode can be set
// $object and $uobject may be defined
@@ -453,12 +453,12 @@
$object->email_subject = $subject;
$object->email_msgid = $mailfile->msgid;
// Call of triggers
if (! empty($trigger_name))
// Call of triggers (you should have set $triggersendname to execute trigger. $trigger_name is deprcated)
if (! empty($triggersendname) || ! empty($trigger_name))
{
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($db);
$result=$interface->run_triggers($trigger_name, $object, $user, $langs, $conf);
$result=$interface->run_triggers(empty($triggersendname)?$trigger_name:$triggersendname, $object, $user, $langs, $conf);
if ($result < 0) {
setEventMessages($interface->error, $interface->errors, 'errors');
}
@@ -4956,11 +4956,11 @@ public function getDefaultCreateValueFor($fieldname, $alternatevalue = null)
* NB: Error from trigger are stacked in interface->errors
* NB2: If return code of triggers are < 0, action calling trigger should cancel all transaction.
*
* @param string $trigger_name trigger's name to execute
* @param string $triggerName trigger's name to execute
* @param User $user Object user
* @return int Result of run_triggers
*/
public function call_trigger($trigger_name, $user)
public function call_trigger($triggerName, $user)
{
// phpcs:enable
global $langs, $conf;
@@ -4972,7 +4972,7 @@ public function call_trigger($trigger_name, $user)
include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php';
$interface = new Interfaces($this->db);
$result = $interface->run_triggers($trigger_name, $this, $user, $langs, $conf);
$result = $interface->run_triggers($triggerName, $this, $user, $langs, $conf);
if ($result < 0)
{
@@ -1099,7 +1099,7 @@ public function list_of_documents($filearray, $object, $modulepart, $param = '',
if ($disablecrop == -1)
{
$disablecrop = 1;
if (in_array($modulepart, array('bank', 'bom', 'expensereport', 'holiday', 'member', 'project', 'product', 'produit', 'service', 'societe', 'tax', 'ticket', 'user'))) $disablecrop = 0;
if (in_array($modulepart, array('bank', 'bom', 'expensereport', 'holiday', 'member', 'mrp', 'project', 'product', 'produit', 'service', 'societe', 'tax', 'ticket', 'user'))) $disablecrop = 0;
}
// Define relative path used to store the file
@@ -189,7 +189,7 @@ public function init($options = '')
$src=$srcroot.'/'.$cursorfile['name'];
$dest=$destroot.'/'.$cursorfile['name'];
$result=dol_copy($src, $dest, 0, 0);
$result=dol_copy($src, $dest, 0, 1); // For full zip templates, we overwrite old existing files
if ($result < 0) {
$langs->load("errors");
$this->error=$langs->trans('ErrorFailToCopyFile', $src, $dest);
@@ -825,7 +825,7 @@ protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs
}
// Escompte
if ($object->close_code == Facture::CLOSECODE_DISCOUNTVAT)
if ($object->close_code == FactureFournisseur::CLOSECODE_DISCOUNTVAT)
{
$index++;
$pdf->SetFillColor(255, 255, 255);
@@ -210,6 +210,17 @@
$dir = $conf->$modulepart->dir_output; // By default
}
}
elseif ($modulepart == 'mrp')
{
require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php';
$object = new MO($db);
if ($id > 0)
{
$result = $object->fetch($id);
if ($result <= 0) dol_print_error($db, 'Failed to load object');
$dir = $conf->$modulepart->dir_output; // By default
}
}
elseif ($modulepart == 'bank')
{
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
@@ -222,7 +233,7 @@
}
}
else {
print 'Action crop for modulepart = '.$modulepart.' is not supported yet.';
print 'Action crop for modulepart = '.$modulepart.' is not supported yet by photos_resize.php.';
}
if (empty($backtourl))
@@ -237,6 +248,7 @@
elseif (in_array($modulepart, array('ticket'))) $backtourl = DOL_URL_ROOT."/ticket/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
elseif (in_array($modulepart, array('user'))) $backtourl = DOL_URL_ROOT."/user/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
elseif (in_array($modulepart, array('bank'))) $backtourl = DOL_URL_ROOT."/compta/bank/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
elseif (in_array($modulepart, array('mrp'))) $backtourl = DOL_URL_ROOT."/mrp/mo_document.php?id=".$id.'&file='.urldecode($_POST["file"]);
else $backtourl = DOL_URL_ROOT."/".$modulepart."/".$modulepart."_document.php?id=".$id.'&file='.urldecode($_POST["file"]);
}
@@ -795,18 +795,18 @@ public function refreshcachenboffile($all = 0)
* NB2: if trigger fail, action should be canceled.
* NB3: Should be deleted if EcmDirectory extend CommonObject
*
* @param string $trigger_name trigger's name to execute
* @param string $triggerName trigger's name to execute
* @param User $user Object user
* @return int Result of run_triggers
*/
public function call_trigger($trigger_name, $user)
public function call_trigger($triggerName, $user)
{
// phpcs:enable
global $langs,$conf;
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($this->db);
$result=$interface->run_triggers($trigger_name, $this, $user, $langs, $conf);
$result=$interface->run_triggers($triggerName, $this, $user, $langs, $conf);
if ($result < 0) {
if (!empty($this->errors))
{
@@ -849,7 +849,7 @@
// Actions to send emails
if (empty($id)) $id = $facid;
$trigger_name = 'SHIPPING_SENTBYMAIL';
$triggersendname = 'SHIPPING_SENTBYMAIL';
$paramname = 'id';
$mode = 'emailfromshipment';
$trackid = 'shi'.$object->id;
@@ -1411,7 +1411,7 @@
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails
$trigger_name = 'EXPENSEREPORT_SENTBYMAIL';
$triggersendname = 'EXPENSEREPORT_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_EXPENSEREPORT_TO';
$trackid = 'exp'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
@@ -721,7 +721,7 @@
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails
$trigger_name = 'FICHINTER_SENTBYMAIL';
$triggersendname = 'FICHINTER_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_FICHINTER_TO';
$trackid = 'int'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
@@ -2420,18 +2420,19 @@ public function setStatus($user, $status)
if ($resql)
{
// Trigger names for each status
$trigger_name[0] = 'DRAFT';
$trigger_name[1] = 'VALIDATED';
$trigger_name[2] = 'APPROVED';
$trigger_name[3] = 'ORDERED'; // Ordered
$trigger_name[4] = 'RECEIVED_PARTIALLY';
$trigger_name[5] = 'RECEIVED_COMPLETELY';
$trigger_name[6] = 'CANCELED';
$trigger_name[7] = 'CANCELED';
$trigger_name[9] = 'REFUSED';
$triggerName = array();
$triggerName[0] = 'DRAFT';
$triggerName[1] = 'VALIDATED';
$triggerName[2] = 'APPROVED';
$triggerName[3] = 'ORDERED'; // Ordered
$triggerName[4] = 'RECEIVED_PARTIALLY';
$triggerName[5] = 'RECEIVED_COMPLETELY';
$triggerName[6] = 'CANCELED';
$triggerName[7] = 'CANCELED';
$triggerName[9] = 'REFUSED';
// Call trigger
$result = $this->call_trigger("ORDER_SUPPLIER_STATUS_".$trigger_name[$status], $user);
$result = $this->call_trigger("ORDER_SUPPLIER_STATUS_".$triggerName[$status], $user);
if ($result < 0) { $error++; }
// End call triggers
}
@@ -1028,7 +1028,7 @@
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails
$trigger_name = 'ORDER_SUPPLIER_SENTBYMAIL';
$triggersendname = 'ORDER_SUPPLIER_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO';
$trackid = 'sor'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
@@ -1497,7 +1497,7 @@
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails
$trigger_name = 'BILL_SUPPLIER_SENTBYMAIL';
$triggersendname = 'BILL_SUPPLIER_SENTBYMAIL';
$paramname = 'id';
$autocopy = 'MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO';
$trackid = 'sin'.$object->id;
@@ -872,7 +872,7 @@
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails
$trigger_name='HOLIDAY_SENTBYMAIL';
$triggersendname = 'HOLIDAY_SENTBYMAIL';
$autocopy='MAIN_MAIL_AUTOCOPY_HOLIDAY_TO';
$trackid='leav'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
Binary file not shown.
Binary file not shown.
@@ -160,7 +160,7 @@
}
// Actions to send emails
$trigger_name = 'MYOBJECT_SENTBYMAIL';
$triggersendname = 'MYOBJECT_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_MYOBJECT_TO';
$trackid = 'myobject'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
@@ -146,7 +146,7 @@
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails
$trigger_name = 'MO_SENTBYMAIL';
$triggersendname = 'MO_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_MO_TO';
$trackid = 'mo'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
@@ -133,7 +133,7 @@
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails
$trigger_name = 'MO_SENTBYMAIL';
$triggersendname = 'MO_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_MO_TO';
$trackid = 'mo'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
@@ -112,7 +112,7 @@
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails
/*$trigger_name='MYOBJECT_SENTBYMAIL';
/*$triggersendname = 'MYOBJECT_SENTBYMAIL';
$autocopy='MAIN_MAIL_AUTOCOPY_MYOBJECT_TO';
$trackid='myobject'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';*/
@@ -119,7 +119,7 @@
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails
/*$trigger_name='MYOBJECT_SENTBYMAIL';
/*$triggersendname = 'MYOBJECT_SENTBYMAIL';
$autocopy='MAIN_MAIL_AUTOCOPY_MYOBJECT_TO';
$trackid='myobject'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';*/

0 comments on commit 6f7343b

Please sign in to comment.
You can’t perform that action at this time.