Merge remote-tracking branch 'upstream/develop' into actioncomm_category
This commit is contained in:
commit
4c5c6b6ff1
@ -67,6 +67,21 @@ with
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
* In tecnickcom/tcpdf/include/tcpdf_static, in function fopenLocal, replace
|
||||||
|
|
||||||
|
if (strpos($filename, '://') === false) {
|
||||||
|
|
||||||
|
with
|
||||||
|
|
||||||
|
if (strpos($filename, '//') === 0)
|
||||||
|
{
|
||||||
|
// Share folder on a (windows) server
|
||||||
|
// e.g.: "//[MyServerName]/[MySharedFolder]/"
|
||||||
|
//
|
||||||
|
// nothing to change
|
||||||
|
}
|
||||||
|
elseif (strpos($filename, '://') === false)
|
||||||
|
|
||||||
* To avoid to have QRcode changed because generated with a random mask, replace
|
* To avoid to have QRcode changed because generated with a random mask, replace
|
||||||
define('QR_FIND_FROM_RANDOM', 2);
|
define('QR_FIND_FROM_RANDOM', 2);
|
||||||
with
|
with
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("companies", "bills", "members", "users", "other"));
|
$langs->loadLangs(array("companies", "bills", "members", "users", "other", "paypal"));
|
||||||
|
|
||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'alpha');
|
||||||
$cancel = GETPOST('cancel', 'alpha');
|
$cancel = GETPOST('cancel', 'alpha');
|
||||||
@ -822,7 +822,7 @@ if (empty($reshook))
|
|||||||
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||||
|
|
||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
$trigger_name = 'MEMBER_SENTBYMAIL';
|
$triggersendname = 'MEMBER_SENTBYMAIL';
|
||||||
$paramname = 'id';
|
$paramname = 'id';
|
||||||
$mode = 'emailfrommember';
|
$mode = 'emailfrommember';
|
||||||
$trackid = 'mem'.$object->id;
|
$trackid = 'mem'.$object->id;
|
||||||
|
|||||||
@ -95,7 +95,7 @@ if ($action == 'update' && empty($_POST["cancel"]))
|
|||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
$id = 0;
|
$id = 0;
|
||||||
$actiontypecode = ''; // Not an event for agenda
|
$actiontypecode = ''; // Not an event for agenda
|
||||||
$trigger_name = ''; // Disable triggers
|
$triggersendname = ''; // Disable triggers
|
||||||
$paramname = 'id';
|
$paramname = 'id';
|
||||||
$mode = 'emailfortest';
|
$mode = 'emailfortest';
|
||||||
$trackid = (($action == 'testhtml') ? "testhtml" : "test");
|
$trackid = (($action == 'testhtml') ? "testhtml" : "test");
|
||||||
|
|||||||
@ -77,7 +77,7 @@ if ($action == 'update' && empty($_POST["cancel"]))
|
|||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
$id=0;
|
$id=0;
|
||||||
$actiontypecode=''; // Not an event for agenda
|
$actiontypecode=''; // Not an event for agenda
|
||||||
$trigger_name=''; // Disable triggers
|
$triggersendname = ''; // Disable triggers
|
||||||
$paramname='id';
|
$paramname='id';
|
||||||
$mode='emailfortest';
|
$mode='emailfortest';
|
||||||
$trackid=(($action == 'testhtml')?"testhtml":"test");
|
$trackid=(($action == 'testhtml')?"testhtml":"test");
|
||||||
|
|||||||
@ -97,7 +97,7 @@ if (empty($reshook))
|
|||||||
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
||||||
|
|
||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
$trigger_name = 'ASSET_SENTBYMAIL';
|
$triggersendname = 'ASSET_SENTBYMAIL';
|
||||||
$autocopy = 'MAIN_MAIL_AUTOCOPY_ASSET_TO';
|
$autocopy = 'MAIN_MAIL_AUTOCOPY_ASSET_TO';
|
||||||
$trackid = 'asset'.$object->id;
|
$trackid = 'asset'.$object->id;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||||
|
|||||||
@ -46,7 +46,7 @@ function blockedlogadmin_prepare_head()
|
|||||||
$b=new BlockedLog($db);
|
$b=new BlockedLog($db);
|
||||||
if ($b->alreadyUsed())
|
if ($b->alreadyUsed())
|
||||||
{
|
{
|
||||||
$head[$h][1].=' <span class="badge">...</span>';
|
$head[$h][1].='<span class="badge marginleftonlyshort">...</span>';
|
||||||
}
|
}
|
||||||
$head[$h][2] = 'fingerprints';
|
$head[$h][2] = 'fingerprints';
|
||||||
$h++;
|
$h++;
|
||||||
|
|||||||
@ -119,7 +119,7 @@ if (empty($reshook))
|
|||||||
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||||
|
|
||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
$trigger_name = 'BOM_SENTBYMAIL';
|
$triggersendname = 'BOM_SENTBYMAIL';
|
||||||
$autocopy = 'MAIN_MAIL_AUTOCOPY_BOM_TO';
|
$autocopy = 'MAIN_MAIL_AUTOCOPY_BOM_TO';
|
||||||
$trackid = 'bom'.$object->id;
|
$trackid = 'bom'.$object->id;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||||
|
|||||||
@ -1051,7 +1051,7 @@ class BOMLine extends CommonObjectLine
|
|||||||
'qty' => array('type'=>'double(24,8)', 'label'=>'Quantity', 'enabled'=>1, 'visible'=>1, 'position'=>100, 'notnull'=>1, 'isameasure'=>'1',),
|
'qty' => array('type'=>'double(24,8)', 'label'=>'Quantity', 'enabled'=>1, 'visible'=>1, 'position'=>100, 'notnull'=>1, 'isameasure'=>'1',),
|
||||||
'qty_frozen' => array('type'=>'smallint', 'label'=>'QuantityFrozen', 'enabled'=>1, 'visible'=>1, 'default'=>0, 'position'=>105, 'css'=>'maxwidth50imp', 'help'=>'QuantityConsumedInvariable'),
|
'qty_frozen' => array('type'=>'smallint', 'label'=>'QuantityFrozen', 'enabled'=>1, 'visible'=>1, 'default'=>0, 'position'=>105, 'css'=>'maxwidth50imp', 'help'=>'QuantityConsumedInvariable'),
|
||||||
'disable_stock_change' => array('type'=>'smallint', 'label'=>'DisableStockChange', 'enabled'=>1, 'visible'=>1, 'default'=>0, 'position'=>108, 'css'=>'maxwidth50imp', 'help'=>'DisableStockChangeHelp'),
|
'disable_stock_change' => array('type'=>'smallint', 'label'=>'DisableStockChange', 'enabled'=>1, 'visible'=>1, 'default'=>0, 'position'=>108, 'css'=>'maxwidth50imp', 'help'=>'DisableStockChangeHelp'),
|
||||||
//'efficiency' => array('type'=>'double(8,4)', 'label'=>'ManufacturingEfficiency', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'position'=>110, 'notnull'=>1, 'css'=>'maxwidth50imp', 'help'=>'ValueOfEfficiencyConsumedMeans'),
|
//'efficiency' => array('type'=>'double(24,8)', 'label'=>'ManufacturingEfficiency', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'position'=>110, 'notnull'=>1, 'css'=>'maxwidth50imp', 'help'=>'ValueOfEfficiencyConsumedMeans'),
|
||||||
'position' => array('type'=>'integer', 'label'=>'Rank', 'enabled'=>1, 'visible'=>0, 'default'=>0, 'position'=>200, 'notnull'=>1,),
|
'position' => array('type'=>'integer', 'label'=>'Rank', 'enabled'=>1, 'visible'=>0, 'default'=>0, 'position'=>200, 'notnull'=>1,),
|
||||||
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,),
|
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -72,6 +72,7 @@ $coldisplay++;
|
|||||||
$tmpproduct = new Product($object->db);
|
$tmpproduct = new Product($object->db);
|
||||||
$tmpproduct->fetch($line->fk_product);
|
$tmpproduct->fetch($line->fk_product);
|
||||||
print $tmpproduct->getNomUrl(1);
|
print $tmpproduct->getNomUrl(1);
|
||||||
|
print ' - '.$tmpproduct->label;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="linecolqty nowrap right">';
|
print '<td class="linecolqty nowrap right">';
|
||||||
$coldisplay++;
|
$coldisplay++;
|
||||||
|
|||||||
@ -695,7 +695,7 @@ if ($object->id > 0)
|
|||||||
print '<table class="noborder centpercent lastrecordtable">';
|
print '<table class="noborder centpercent lastrecordtable">';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastPropals", ($num <= $MAXLIST ? "" : $MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/comm/propal/list.php?socid='.$object->id.'">'.$langs->trans("AllPropals").' <span class="badge">'.$num.'</span></a></td>';
|
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastPropals", ($num <= $MAXLIST ? "" : $MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/comm/propal/list.php?socid='.$object->id.'">'.$langs->trans("AllPropals").'<span class="badge marginleftonlyshort">'.$num.'</span></a></td>';
|
||||||
print '<td width="20px" class="right"><a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
|
print '<td width="20px" class="right"><a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
|
||||||
print '</tr></table></td>';
|
print '</tr></table></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -780,7 +780,7 @@ if ($object->id > 0)
|
|||||||
print '<table class="noborder centpercent lastrecordtable">';
|
print '<table class="noborder centpercent lastrecordtable">';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastCustomerOrders", ($num <= $MAXLIST ? "" : $MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->id.'">'.$langs->trans("AllOrders").' <span class="badge">'.$num.'</span></a></td>';
|
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastCustomerOrders", ($num <= $MAXLIST ? "" : $MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->id.'">'.$langs->trans("AllOrders").'<span class="badge marginleftonlyshort">'.$num.'</span></a></td>';
|
||||||
print '<td width="20px" class="right"><a href="'.DOL_URL_ROOT.'/commande/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
|
print '<td width="20px" class="right"><a href="'.DOL_URL_ROOT.'/commande/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
|
||||||
//if($num2 > 0) print '<td width="20px" class="right"><a href="'.DOL_URL_ROOT.'/commande/orderstoinvoice.php?socid='.$object->id.'">'.img_picto($langs->trans("CreateInvoiceForThisCustomer"),'object_bill').'</a></td>';
|
//if($num2 > 0) print '<td width="20px" class="right"><a href="'.DOL_URL_ROOT.'/commande/orderstoinvoice.php?socid='.$object->id.'">'.img_picto($langs->trans("CreateInvoiceForThisCustomer"),'object_bill').'</a></td>';
|
||||||
//else print '<td width="20px" class="right"><a href="#">'.img_picto($langs->trans("NoOrdersToInvoice"),'object_bill').'</a></td>';
|
//else print '<td width="20px" class="right"><a href="#">'.img_picto($langs->trans("NoOrdersToInvoice"),'object_bill').'</a></td>';
|
||||||
@ -856,7 +856,7 @@ if ($object->id > 0)
|
|||||||
print '<table class="noborder centpercent lastrecordtable">';
|
print '<table class="noborder centpercent lastrecordtable">';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastSendings", ($num <= $MAXLIST ? "" : $MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/expedition/list.php?socid='.$object->id.'">'.$langs->trans("AllSendings").' <span class="badge">'.$num.'</span></a></td>';
|
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastSendings", ($num <= $MAXLIST ? "" : $MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/expedition/list.php?socid='.$object->id.'">'.$langs->trans("AllSendings").'<span class="badge marginleftonlyshort">'.$num.'</span></a></td>';
|
||||||
print '<td width="20px" class="right"><a href="'.DOL_URL_ROOT.'/expedition/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
|
print '<td width="20px" class="right"><a href="'.DOL_URL_ROOT.'/expedition/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
|
||||||
print '</tr></table></td>';
|
print '</tr></table></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -921,7 +921,7 @@ if ($object->id > 0)
|
|||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="6"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastContracts", ($num <= $MAXLIST ? "" : $MAXLIST)).'</td>';
|
print '<td colspan="6"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastContracts", ($num <= $MAXLIST ? "" : $MAXLIST)).'</td>';
|
||||||
print '<td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/contrat/list.php?socid='.$object->id.'">'.$langs->trans("AllContracts").' <span class="badge">'.$num.'</span></a></td>';
|
print '<td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/contrat/list.php?socid='.$object->id.'">'.$langs->trans("AllContracts").'<span class="badge marginleftonlyshort">'.$num.'</span></a></td>';
|
||||||
//print '<td width="20px" class="right"><a href="'.DOL_URL_ROOT.'/contract/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"),'stats').'</a></td>';
|
//print '<td width="20px" class="right"><a href="'.DOL_URL_ROOT.'/contract/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"),'stats').'</a></td>';
|
||||||
print '</tr></table></td>';
|
print '</tr></table></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -990,7 +990,7 @@ if ($object->id > 0)
|
|||||||
print '<table class="noborder centpercent lastrecordtable">';
|
print '<table class="noborder centpercent lastrecordtable">';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="3"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastInterventions", ($num <= $MAXLIST ? "" : $MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/fichinter/list.php?socid='.$object->id.'">'.$langs->trans("AllInterventions").' <span class="badge">'.$num.'</span></td>';
|
print '<td colspan="3"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastInterventions", ($num <= $MAXLIST ? "" : $MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/fichinter/list.php?socid='.$object->id.'">'.$langs->trans("AllInterventions").'<span class="badge marginleftonlyshort">'.$num.'</span></td>';
|
||||||
print '<td width="20px" class="right"><a href="'.DOL_URL_ROOT.'/fichinter/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
|
print '<td width="20px" class="right"><a href="'.DOL_URL_ROOT.'/fichinter/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
|
||||||
print '</tr></table></td>';
|
print '</tr></table></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -1063,7 +1063,7 @@ if ($object->id > 0)
|
|||||||
print '<table class="noborder centpercent lastrecordtable">';
|
print '<table class="noborder centpercent lastrecordtable">';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LatestCustomerTemplateInvoices", ($num <= $MAXLIST ? "" : $MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->id.'">'.$langs->trans("AllCustomerTemplateInvoices").' <span class="badge">'.$num.'</span></a></td>';
|
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LatestCustomerTemplateInvoices", ($num <= $MAXLIST ? "" : $MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->id.'">'.$langs->trans("AllCustomerTemplateInvoices").'<span class="badge marginleftonlyshort">'.$num.'</span></a></td>';
|
||||||
print '</tr></table></td>';
|
print '</tr></table></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
@ -1168,7 +1168,7 @@ if ($object->id > 0)
|
|||||||
print '<table class="noborder centpercent lastrecordtable">';
|
print '<table class="noborder centpercent lastrecordtable">';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="5"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastCustomersBills", ($num <= $MAXLIST ? "" : $MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->id.'">'.$langs->trans("AllBills").' <span class="badge">'.$num.'</span></a></td>';
|
print '<td colspan="5"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastCustomersBills", ($num <= $MAXLIST ? "" : $MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->id.'">'.$langs->trans("AllBills").'<span class="badge marginleftonlyshort">'.$num.'</span></a></td>';
|
||||||
print '<td width="20px" class="right"><a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
|
print '<td width="20px" class="right"><a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
|
||||||
print '</tr></table></td>';
|
print '</tr></table></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|||||||
@ -251,7 +251,7 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa
|
|||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<th colspan="3">'.$langs->trans("SupplierProposalsDraft").($num ? ' <span class="badge">'.$num.'</span>' : '').'</th></tr>';
|
print '<th colspan="3">'.$langs->trans("SupplierProposalsDraft").($num ? '<span class="badge marginleftonlyshort">'.$num.'</span>' : '').'</th></tr>';
|
||||||
|
|
||||||
if ($num > 0)
|
if ($num > 0)
|
||||||
{
|
{
|
||||||
@ -333,7 +333,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
|
|||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<th colspan="3">'.$langs->trans("DraftOrders").($num ? ' <span class="badge">'.$num.'</span>' : '').'</th></tr>';
|
print '<th colspan="3">'.$langs->trans("DraftOrders").($num ? '<span class="badge marginleftonlyshort">'.$num.'</span>' : '').'</th></tr>';
|
||||||
|
|
||||||
if ($num > 0)
|
if ($num > 0)
|
||||||
{
|
{
|
||||||
@ -422,7 +422,7 @@ if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande-
|
|||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<th colspan="3">'.$langs->trans("DraftSuppliersOrders").($num ? ' <span class="badge">'.$num.'</span>' : '').'</th></tr>';
|
print '<th colspan="3">'.$langs->trans("DraftSuppliersOrders").($num ? '<span class="badge marginleftonlyshort">'.$num.'</span>' : '').'</th></tr>';
|
||||||
|
|
||||||
if ($num > 0)
|
if ($num > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -781,7 +781,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
$actiontypecode = 'AC_OTH_AUTO';
|
$actiontypecode = 'AC_OTH_AUTO';
|
||||||
$trigger_name = 'PROPAL_SENTBYMAIL';
|
$triggersendname = 'PROPAL_SENTBYMAIL';
|
||||||
$autocopy = 'MAIN_MAIL_AUTOCOPY_PROPOSAL_TO';
|
$autocopy = 'MAIN_MAIL_AUTOCOPY_PROPOSAL_TO';
|
||||||
$trackid = 'pro'.$object->id;
|
$trackid = 'pro'.$object->id;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||||
|
|||||||
@ -2501,11 +2501,11 @@ class Propal extends CommonObject
|
|||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$modelpdf = $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED ? $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED : $this->modelpdf;
|
$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)
|
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;
|
$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
|
// The connected company is classified as a client
|
||||||
@ -2522,7 +2522,7 @@ class Propal extends CommonObject
|
|||||||
}
|
}
|
||||||
if ($statut == self::STATUS_BILLED) // Why this ?
|
if ($statut == self::STATUS_BILLED) // Why this ?
|
||||||
{
|
{
|
||||||
$trigger_name = 'PROPAL_CLASSIFY_BILLED';
|
$triggerName = 'PROPAL_CLASSIFY_BILLED';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
||||||
@ -2550,7 +2550,7 @@ class Propal extends CommonObject
|
|||||||
if (!$notrigger && empty($error))
|
if (!$notrigger && empty($error))
|
||||||
{
|
{
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result = $this->call_trigger($trigger_name, $user);
|
$result = $this->call_trigger($triggerName, $user);
|
||||||
if ($result < 0) { $error++; }
|
if ($result < 0) { $error++; }
|
||||||
// End call triggers
|
// End call triggers
|
||||||
}
|
}
|
||||||
|
|||||||
@ -62,10 +62,12 @@ if ($action == 'confirm_split' && GETPOST("confirm") == 'yes')
|
|||||||
//if ($user->rights->facture->creer)
|
//if ($user->rights->facture->creer)
|
||||||
|
|
||||||
$amount_ttc_1 = GETPOST('amount_ttc_1');
|
$amount_ttc_1 = GETPOST('amount_ttc_1');
|
||||||
|
$amount_ttc_1 = price2num($amount_ttc_1);
|
||||||
$amount_ttc_2 = GETPOST('amount_ttc_2');
|
$amount_ttc_2 = GETPOST('amount_ttc_2');
|
||||||
|
$amount_ttc_2 = price2num($amount_ttc_2);
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
$remid = GETPOST("remid") ?GETPOST("remid") : 0;
|
$remid = (GETPOST("remid", 'int') ? GETPOST("remid", 'int') : 0);
|
||||||
$discount = new DiscountAbsolute($db);
|
$discount = new DiscountAbsolute($db);
|
||||||
$res = $discount->fetch($remid);
|
$res = $discount->fetch($remid);
|
||||||
if (!$res > 0)
|
if (!$res > 0)
|
||||||
|
|||||||
@ -1415,7 +1415,7 @@ if (empty($reshook))
|
|||||||
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||||
|
|
||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
$trigger_name = 'ORDER_SENTBYMAIL';
|
$triggersendname = 'ORDER_SENTBYMAIL';
|
||||||
$paramname = 'id';
|
$paramname = 'id';
|
||||||
$autocopy = 'MAIN_MAIL_AUTOCOPY_ORDER_TO'; // used to know the automatic BCC to add
|
$autocopy = 'MAIN_MAIL_AUTOCOPY_ORDER_TO'; // used to know the automatic BCC to add
|
||||||
$trackid = 'ord'.$object->id;
|
$trackid = 'ord'.$object->id;
|
||||||
|
|||||||
@ -223,7 +223,7 @@ if (empty($reshook))
|
|||||||
$permissiontoread = $user->rights->commande->lire;
|
$permissiontoread = $user->rights->commande->lire;
|
||||||
$permissiontodelete = $user->rights->commande->supprimer;
|
$permissiontodelete = $user->rights->commande->supprimer;
|
||||||
$uploaddir = $conf->commande->multidir_output[$conf->entity];
|
$uploaddir = $conf->commande->multidir_output[$conf->entity];
|
||||||
$trigger_name = 'ORDER_SENTBYMAIL';
|
$triggersendname = 'ORDER_SENTBYMAIL';
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2481,7 +2481,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
if (empty($id)) $id = $facid;
|
if (empty($id)) $id = $facid;
|
||||||
$trigger_name = 'BILL_SENTBYMAIL';
|
$triggersendname = 'BILL_SENTBYMAIL';
|
||||||
$paramname = 'id';
|
$paramname = 'id';
|
||||||
$autocopy = 'MAIN_MAIL_AUTOCOPY_INVOICE_TO';
|
$autocopy = 'MAIN_MAIL_AUTOCOPY_INVOICE_TO';
|
||||||
$trackid = 'inv'.$object->id;
|
$trackid = 'inv'.$object->id;
|
||||||
|
|||||||
@ -170,7 +170,7 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
|
|||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<th colspan="3">'.$langs->trans("CustomersDraftInvoices").($num ? ' <span class="badge">'.$num.'</span>' : '').'</th></tr>';
|
print '<th colspan="3">'.$langs->trans("CustomersDraftInvoices").($num ? '<span class="badge marginleftonlyshort">'.$num.'</span>' : '').'</th></tr>';
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
$companystatic = new Societe($db);
|
$companystatic = new Societe($db);
|
||||||
@ -257,7 +257,7 @@ if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->
|
|||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<th colspan="3">'.$langs->trans("SuppliersDraftInvoices").($num ? ' <span class="badge">'.$num.'</span>' : '').'</th></tr>';
|
print '<th colspan="3">'.$langs->trans("SuppliersDraftInvoices").($num ? '<span class="badge marginleftonlyshort">'.$num.'</span>' : '').'</th></tr>';
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
$companystatic = new Societe($db);
|
$companystatic = new Societe($db);
|
||||||
|
|||||||
@ -482,7 +482,7 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
$trigger_name = 'CONTACT_SENTBYMAIL';
|
$triggersendname = 'CONTACT_SENTBYMAIL';
|
||||||
$paramname = 'id';
|
$paramname = 'id';
|
||||||
$mode = 'emailfromcontact';
|
$mode = 'emailfromcontact';
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||||
|
|||||||
@ -1002,7 +1002,7 @@ if (empty($reshook))
|
|||||||
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||||
|
|
||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
$trigger_name = 'CONTRACT_SENTBYMAIL';
|
$triggersendname = 'CONTRACT_SENTBYMAIL';
|
||||||
$paramname = 'id';
|
$paramname = 'id';
|
||||||
$mode = 'emailfromcontract';
|
$mode = 'emailfromcontract';
|
||||||
$trackid = 'con'.$object->id;
|
$trackid = 'con'.$object->id;
|
||||||
|
|||||||
@ -260,7 +260,7 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire)
|
|||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<th colspan="3">'.$langs->trans("DraftContracts").($num ? ' <span class="badge">'.$num.'</span>' : '').'</th></tr>';
|
print '<th colspan="3">'.$langs->trans("DraftContracts").($num ? '<span class="badge marginleftonlyshort">'.$num.'</span>' : '').'</th></tr>';
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
$companystatic = new Societe($db);
|
$companystatic = new Societe($db);
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
// $id must be defined
|
// $id must be defined
|
||||||
// $paramname may be defined
|
// $paramname may be defined
|
||||||
// $autocopy may be defined (used to know the automatic BCC to add)
|
// $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
|
// $actiontypecode can be set
|
||||||
// $object and $uobject may be defined
|
// $object and $uobject may be defined
|
||||||
|
|
||||||
@ -453,12 +453,12 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
|||||||
$object->email_subject = $subject;
|
$object->email_subject = $subject;
|
||||||
$object->email_msgid = $mailfile->msgid;
|
$object->email_msgid = $mailfile->msgid;
|
||||||
|
|
||||||
// Call of triggers
|
// Call of triggers (you should have set $triggersendname to execute trigger. $trigger_name is deprcated)
|
||||||
if (! empty($trigger_name))
|
if (! empty($triggersendname) || ! empty($trigger_name))
|
||||||
{
|
{
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||||
$interface=new Interfaces($db);
|
$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) {
|
if ($result < 0) {
|
||||||
setEventMessages($interface->error, $interface->errors, 'errors');
|
setEventMessages($interface->error, $interface->errors, 'errors');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -296,6 +296,30 @@ if ($type == 'directory')
|
|||||||
$perm=($user->rights->website->write || $user->rights->emailing->creer);
|
$perm=($user->rights->website->write || $user->rights->emailing->creer);
|
||||||
$title='none';
|
$title='none';
|
||||||
}
|
}
|
||||||
|
elseif($module == 'ecm') // DMS/ECM -> manual structure
|
||||||
|
{
|
||||||
|
if($user->rights->ecm->read)
|
||||||
|
{
|
||||||
|
// Buttons: Preview
|
||||||
|
$useinecm = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($user->rights->ecm->upload)
|
||||||
|
{
|
||||||
|
// Buttons: Preview + Delete
|
||||||
|
$useinecm = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($user->rights->ecm->setup)
|
||||||
|
{
|
||||||
|
// Buttons: Preview + Delete + Edit
|
||||||
|
$useinecm = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
$perm=$user->rights->ecm->upload;
|
||||||
|
$modulepart='ecm';
|
||||||
|
$title=''; // Use default
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$useinecm = 5;
|
$useinecm = 5;
|
||||||
|
|||||||
@ -4956,11 +4956,11 @@ abstract class CommonObject
|
|||||||
* NB: Error from trigger are stacked in interface->errors
|
* NB: Error from trigger are stacked in interface->errors
|
||||||
* NB2: If return code of triggers are < 0, action calling trigger should cancel all transaction.
|
* 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
|
* @param User $user Object user
|
||||||
* @return int Result of run_triggers
|
* @return int Result of run_triggers
|
||||||
*/
|
*/
|
||||||
public function call_trigger($trigger_name, $user)
|
public function call_trigger($triggerName, $user)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs, $conf;
|
global $langs, $conf;
|
||||||
@ -4972,7 +4972,7 @@ abstract class CommonObject
|
|||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php';
|
||||||
$interface = new Interfaces($this->db);
|
$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 ($result < 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -689,6 +689,11 @@ class DiscountAbsolute
|
|||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
$result='';
|
$result='';
|
||||||
|
$link = '';
|
||||||
|
$linkend = '';
|
||||||
|
$label = '';
|
||||||
|
$picto = '';
|
||||||
|
$ref = '';
|
||||||
|
|
||||||
if ($option == 'invoice') {
|
if ($option == 'invoice') {
|
||||||
$facid=! empty($this->discount_type)?$this->fk_invoice_supplier_source:$this->fk_facture_source;
|
$facid=! empty($this->discount_type)?$this->fk_invoice_supplier_source:$this->fk_facture_source;
|
||||||
|
|||||||
@ -228,6 +228,7 @@ class Form
|
|||||||
elseif (preg_match('/^select;/', $typeofdata))
|
elseif (preg_match('/^select;/', $typeofdata))
|
||||||
{
|
{
|
||||||
$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
|
$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
|
||||||
|
$arraylist = array();
|
||||||
foreach ($arraydata as $val)
|
foreach ($arraydata as $val)
|
||||||
{
|
{
|
||||||
$tmp = explode(':', $val);
|
$tmp = explode(':', $val);
|
||||||
@ -265,6 +266,7 @@ class Form
|
|||||||
elseif (preg_match('/^select;/', $typeofdata))
|
elseif (preg_match('/^select;/', $typeofdata))
|
||||||
{
|
{
|
||||||
$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
|
$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
|
||||||
|
$arraylist = array();
|
||||||
foreach ($arraydata as $val)
|
foreach ($arraydata as $val)
|
||||||
{
|
{
|
||||||
$tmp = explode(':', $val);
|
$tmp = explode(':', $val);
|
||||||
@ -4869,7 +4871,7 @@ class Form
|
|||||||
* @param int $forcecombo Force to use combo box
|
* @param int $forcecombo Force to use combo box
|
||||||
* @param array $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
|
* @param array $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
|
||||||
* @param int $nooutput No print output. Return it only.
|
* @param int $nooutput No print output. Return it only.
|
||||||
* @return void
|
* @return void|string
|
||||||
*/
|
*/
|
||||||
public function form_thirdparty($page, $selected = '', $htmlname = 'socid', $filter = '', $showempty = 0, $showtype = 0, $forcecombo = 0, $events = array(), $nooutput = 0)
|
public function form_thirdparty($page, $selected = '', $htmlname = 'socid', $filter = '', $showempty = 0, $showtype = 0, $forcecombo = 0, $events = array(), $nooutput = 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1099,7 +1099,7 @@ class FormFile
|
|||||||
if ($disablecrop == -1)
|
if ($disablecrop == -1)
|
||||||
{
|
{
|
||||||
$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
|
// Define relative path used to store the file
|
||||||
|
|||||||
@ -341,6 +341,7 @@ class Notify
|
|||||||
$object_type = '';
|
$object_type = '';
|
||||||
$link = '';
|
$link = '';
|
||||||
$num = 0;
|
$num = 0;
|
||||||
|
$error = 0;
|
||||||
|
|
||||||
$oldref=(empty($object->oldref)?$object->ref:$object->oldref);
|
$oldref=(empty($object->oldref)?$object->ref:$object->oldref);
|
||||||
$newref=(empty($object->newref)?$object->ref:$object->newref);
|
$newref=(empty($object->newref)?$object->ref:$object->newref);
|
||||||
|
|||||||
@ -486,7 +486,7 @@ function actions_prepare_head($object)
|
|||||||
$nbLinks=Link::count($db, $object->element, $object->id);
|
$nbLinks=Link::count($db, $object->element, $object->id);
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/comm/action/document.php?id='.$object->id;
|
$head[$h][0] = DOL_URL_ROOT.'/comm/action/document.php?id='.$object->id;
|
||||||
$head[$h][1] = $langs->trans("Documents");
|
$head[$h][1] = $langs->trans("Documents");
|
||||||
if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>';
|
if (($nbFiles+$nbLinks) > 0) $head[$h][1].= '<span class="badge marginleftonlyshort">'.($nbFiles+$nbLinks).'</span>';
|
||||||
$head[$h][2] = 'documents';
|
$head[$h][2] = 'documents';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
|||||||
@ -185,7 +185,7 @@ function account_statement_prepare_head($object, $num)
|
|||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT."/compta/bank/account_statement_document.php?account=".$object->id."&num=".$num;
|
$head[$h][0] = DOL_URL_ROOT."/compta/bank/account_statement_document.php?account=".$object->id."&num=".$num;
|
||||||
$head[$h][1] = $langs->trans("Documents");
|
$head[$h][1] = $langs->trans("Documents");
|
||||||
if (($nbFiles + $nbLinks) > 0) $head[$h][1] .= ' <span class="badge">'.($nbFiles + $nbLinks).'</span>';
|
if (($nbFiles + $nbLinks) > 0) $head[$h][1] .= '<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).'</span>';
|
||||||
$head[$h][2] = 'document';
|
$head[$h][2] = 'document';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
|||||||
@ -228,7 +228,7 @@ function societe_prepare_head(Societe $object)
|
|||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.$object->id;
|
$head[$h][0] = DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.$object->id;
|
||||||
$head[$h][1] = $title;
|
$head[$h][1] = $title;
|
||||||
if ($foundonexternalonlinesystem) $head[$h][1] .= ' <span class="badge">...</span>';
|
if ($foundonexternalonlinesystem) $head[$h][1] .= '<span class="badge marginleftonlyshort">...</span>';
|
||||||
elseif ($nbBankAccount > 0) $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbBankAccount.'</span>';
|
elseif ($nbBankAccount > 0) $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbBankAccount.'</span>';
|
||||||
$head[$h][2] = 'rib';
|
$head[$h][2] = 'rib';
|
||||||
$h++;
|
$h++;
|
||||||
|
|||||||
@ -7896,23 +7896,26 @@ function dol_mimetype($file, $default = 'application/octet-stream', $mode = 0)
|
|||||||
|
|
||||||
$tmpfile = preg_replace('/\.noexe$/', '', $file);
|
$tmpfile = preg_replace('/\.noexe$/', '', $file);
|
||||||
|
|
||||||
// Text files
|
// Plain text files
|
||||||
if (preg_match('/\.txt$/i', $tmpfile)) { $mime = 'text/plain'; $imgmime = 'text.png'; $famime = 'file-text-o'; }
|
if (preg_match('/\.txt$/i', $tmpfile)) { $mime = 'text/plain'; $imgmime = 'text.png'; $famime = 'file-text-o'; }
|
||||||
if (preg_match('/\.rtx$/i', $tmpfile)) { $mime = 'text/richtext'; $imgmime = 'text.png'; $famime = 'file-text-o'; }
|
if (preg_match('/\.rtx$/i', $tmpfile)) { $mime = 'text/richtext'; $imgmime = 'text.png'; $famime = 'file-text-o'; }
|
||||||
if (preg_match('/\.csv$/i', $tmpfile)) { $mime = 'text/csv'; $imgmime = 'text.png'; $famime = 'file-text-o'; }
|
if (preg_match('/\.csv$/i', $tmpfile)) { $mime = 'text/csv'; $imgmime = 'text.png'; $famime = 'file-text-o'; }
|
||||||
if (preg_match('/\.tsv$/i', $tmpfile)) { $mime = 'text/tab-separated-values'; $imgmime = 'text.png'; $famime = 'file-text-o'; }
|
if (preg_match('/\.tsv$/i', $tmpfile)) { $mime = 'text/tab-separated-values'; $imgmime = 'text.png'; $famime = 'file-text-o'; }
|
||||||
if (preg_match('/\.(cf|conf|log)$/i', $tmpfile)) { $mime = 'text/plain'; $imgmime = 'text.png'; $famime = 'file-text-o'; }
|
if (preg_match('/\.(cf|conf|log)$/i', $tmpfile)) { $mime = 'text/plain'; $imgmime = 'text.png'; $famime = 'file-text-o'; }
|
||||||
if (preg_match('/\.ini$/i', $tmpfile)) { $mime = 'text/plain'; $imgmime = 'text.png'; $srclang = 'ini'; $famime = 'file-text-o'; }
|
if (preg_match('/\.ini$/i', $tmpfile)) { $mime = 'text/plain'; $imgmime = 'text.png'; $srclang = 'ini'; $famime = 'file-text-o'; }
|
||||||
|
if (preg_match('/\.md$/i', $tmpfile)) { $mime = 'text/plain'; $imgmime = 'text.png'; $srclang = 'md'; $famime = 'file-text-o'; }
|
||||||
if (preg_match('/\.css$/i', $tmpfile)) { $mime = 'text/css'; $imgmime = 'css.png'; $srclang = 'css'; $famime = 'file-text-o'; }
|
if (preg_match('/\.css$/i', $tmpfile)) { $mime = 'text/css'; $imgmime = 'css.png'; $srclang = 'css'; $famime = 'file-text-o'; }
|
||||||
// Certificate files
|
// Certificate files
|
||||||
if (preg_match('/\.(crt|cer|key|pub)$/i', $tmpfile)) { $mime = 'text/plain'; $imgmime = 'text.png'; $famime = 'file-text-o'; }
|
if (preg_match('/\.(crt|cer|key|pub)$/i', $tmpfile)) { $mime = 'text/plain'; $imgmime = 'text.png'; $famime = 'file-text-o'; }
|
||||||
// HTML/XML
|
// XML based (HTML/XML/XAML)
|
||||||
if (preg_match('/\.(html|htm|shtml)$/i', $tmpfile)) { $mime = 'text/html'; $imgmime = 'html.png'; $srclang = 'html'; $famime = 'file-text-o'; }
|
if (preg_match('/\.(html|htm|shtml)$/i', $tmpfile)) { $mime = 'text/html'; $imgmime = 'html.png'; $srclang = 'html'; $famime = 'file-text-o'; }
|
||||||
if (preg_match('/\.(xml|xhtml)$/i', $tmpfile)) { $mime = 'text/xml'; $imgmime = 'other.png'; $srclang = 'xml'; $famime = 'file-text-o'; }
|
if (preg_match('/\.(xml|xhtml)$/i', $tmpfile)) { $mime = 'text/xml'; $imgmime = 'other.png'; $srclang = 'xml'; $famime = 'file-text-o'; }
|
||||||
|
if (preg_match('/\.xaml$/i', $tmpfile)) { $mime = 'text/xml'; $imgmime = 'other.png'; $srclang = 'xaml'; $famime = 'file-text-o'; }
|
||||||
// Languages
|
// Languages
|
||||||
if (preg_match('/\.bas$/i', $tmpfile)) { $mime = 'text/plain'; $imgmime = 'text.png'; $srclang = 'bas'; $famime = 'file-code-o'; }
|
if (preg_match('/\.bas$/i', $tmpfile)) { $mime = 'text/plain'; $imgmime = 'text.png'; $srclang = 'bas'; $famime = 'file-code-o'; }
|
||||||
if (preg_match('/\.(c)$/i', $tmpfile)) { $mime = 'text/plain'; $imgmime = 'text.png'; $srclang = 'c'; $famime = 'file-code-o'; }
|
if (preg_match('/\.(c)$/i', $tmpfile)) { $mime = 'text/plain'; $imgmime = 'text.png'; $srclang = 'c'; $famime = 'file-code-o'; }
|
||||||
if (preg_match('/\.(cpp)$/i', $tmpfile)) { $mime = 'text/plain'; $imgmime = 'text.png'; $srclang = 'cpp'; $famime = 'file-code-o'; }
|
if (preg_match('/\.(cpp)$/i', $tmpfile)) { $mime = 'text/plain'; $imgmime = 'text.png'; $srclang = 'cpp'; $famime = 'file-code-o'; }
|
||||||
|
if (preg_match('/\.cs$/i', $tmpfile)) { $mime = 'text/plain'; $imgmime = 'text.png'; $srclang = 'cs'; $famime = 'file-code-o'; }
|
||||||
if (preg_match('/\.(h)$/i', $tmpfile)) { $mime = 'text/plain'; $imgmime = 'text.png'; $srclang = 'h'; $famime = 'file-code-o'; }
|
if (preg_match('/\.(h)$/i', $tmpfile)) { $mime = 'text/plain'; $imgmime = 'text.png'; $srclang = 'h'; $famime = 'file-code-o'; }
|
||||||
if (preg_match('/\.(java|jsp)$/i', $tmpfile)) { $mime = 'text/plain'; $imgmime = 'text.png'; $srclang = 'java'; $famime = 'file-code-o'; }
|
if (preg_match('/\.(java|jsp)$/i', $tmpfile)) { $mime = 'text/plain'; $imgmime = 'text.png'; $srclang = 'java'; $famime = 'file-code-o'; }
|
||||||
if (preg_match('/\.php([0-9]{1})?$/i', $tmpfile)) { $mime = 'text/plain'; $imgmime = 'php.png'; $srclang = 'php'; $famime = 'file-code-o'; }
|
if (preg_match('/\.php([0-9]{1})?$/i', $tmpfile)) { $mime = 'text/plain'; $imgmime = 'php.png'; $srclang = 'php'; $famime = 'file-code-o'; }
|
||||||
|
|||||||
@ -111,7 +111,7 @@ function project_prepare_head($object)
|
|||||||
if (!empty($object->note_public)) $nbNote++;
|
if (!empty($object->note_public)) $nbNote++;
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/projet/note.php?id='.$object->id;
|
$head[$h][0] = DOL_URL_ROOT.'/projet/note.php?id='.$object->id;
|
||||||
$head[$h][1] = $langs->trans('Notes');
|
$head[$h][1] = $langs->trans('Notes');
|
||||||
if ($nbNote > 0) $head[$h][1] .= ' <span class="badge">'.$nbNote.'</span>';
|
if ($nbNote > 0) $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>';
|
||||||
$head[$h][2] = 'notes';
|
$head[$h][2] = 'notes';
|
||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
@ -2071,18 +2071,23 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide
|
|||||||
else {
|
else {
|
||||||
if ($task->hasDelay()) $out .= img_warning($langs->trans("Late")).' ';
|
if ($task->hasDelay()) $out .= img_warning($langs->trans("Late")).' ';
|
||||||
|
|
||||||
$out .= !empty($diff) ? $diff.' ' : '';
|
$url = DOL_URL_ROOT.'/projet/tasks/time.php?id='.$task->id;
|
||||||
|
|
||||||
|
$out .= !empty($diff) ? $diff.' ' : '';
|
||||||
|
$out .= '<a href="'.$url.'" >';
|
||||||
$out .= '<b title="'.$langs->trans('TimeSpent').'" >';
|
$out .= '<b title="'.$langs->trans('TimeSpent').'" >';
|
||||||
if ($task->duration_effective) $out .= convertSecondToTime($task->duration_effective, $timespentoutputformat);
|
if ($task->duration_effective) $out .= convertSecondToTime($task->duration_effective, $timespentoutputformat);
|
||||||
else $out .= '--:--';
|
else $out .= '--:--';
|
||||||
$out .= '</b>';
|
$out .= '</b>';
|
||||||
|
$out .= '</a>';
|
||||||
|
|
||||||
$out .= '/';
|
$out .= '/';
|
||||||
|
|
||||||
|
$out .= '<a href="'.$url.'" >';
|
||||||
$out .= '<span title="'.$langs->trans('PlannedWorkload').'" >';
|
$out .= '<span title="'.$langs->trans('PlannedWorkload').'" >';
|
||||||
if ($task->planned_workload) $out .= convertSecondToTime($task->planned_workload, $plannedworkloadoutputformat);
|
if ($task->planned_workload) $out .= convertSecondToTime($task->planned_workload, $plannedworkloadoutputformat);
|
||||||
else $out .= '--:--';
|
else $out .= '--:--';
|
||||||
|
$out .= '</a>';
|
||||||
}
|
}
|
||||||
$out .= ' </span>';
|
$out .= ' </span>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -510,6 +510,7 @@ class ExportExcel extends ModeleExports
|
|||||||
{
|
{
|
||||||
|
|
||||||
$c = intval($c);
|
$c = intval($c);
|
||||||
|
$letter = '';
|
||||||
if ($c <= 0) {
|
if ($c <= 0) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -62,11 +62,11 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder
|
|||||||
*/
|
*/
|
||||||
public function info()
|
public function info()
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs, $db;
|
||||||
|
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
|
|
||||||
$form = new Form($this->db);
|
$form = new Form($db);
|
||||||
|
|
||||||
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
||||||
$texte .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
$texte .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
|
|||||||
@ -150,6 +150,8 @@ class modStripe extends DolibarrModules
|
|||||||
'target' => '',
|
'target' => '',
|
||||||
'user' => 0
|
'user' => 0
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$r++;
|
||||||
$this->menu[$r] = array(
|
$this->menu[$r] = array(
|
||||||
'fk_menu' => 'fk_mainmenu=bank,fk_leftmenu=stripe',
|
'fk_menu' => 'fk_mainmenu=bank,fk_leftmenu=stripe',
|
||||||
'type' => 'left',
|
'type' => 'left',
|
||||||
|
|||||||
@ -189,7 +189,7 @@ class modWebsite extends DolibarrModules
|
|||||||
$src=$srcroot.'/'.$cursorfile['name'];
|
$src=$srcroot.'/'.$cursorfile['name'];
|
||||||
$dest=$destroot.'/'.$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) {
|
if ($result < 0) {
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$this->error=$langs->trans('ErrorFailToCopyFile', $src, $dest);
|
$this->error=$langs->trans('ErrorFailToCopyFile', $src, $dest);
|
||||||
|
|||||||
@ -64,11 +64,11 @@ class mod_propale_saphir extends ModeleNumRefPropales
|
|||||||
*/
|
*/
|
||||||
public function info()
|
public function info()
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs, $db;
|
||||||
|
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
|
|
||||||
$form = new Form($this->db);
|
$form = new Form($db);
|
||||||
|
|
||||||
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
||||||
$texte .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
$texte .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2018 Quentin Vial-Gouteyron <quentin.vial-gouteyron@atm-consulting.fr>
|
/* Copyright (C) 2018 Quentin Vial-Gouteyron <quentin.vial-gouteyron@atm-consulting.fr>
|
||||||
|
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* 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
|
||||||
@ -40,11 +41,11 @@ class mod_reception_moonstone extends ModelNumRefReception
|
|||||||
*/
|
*/
|
||||||
public function info()
|
public function info()
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf, $langs, $db;
|
||||||
|
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
|
|
||||||
$form = new Form($this->db);
|
$form = new Form($db);
|
||||||
|
|
||||||
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
||||||
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
|
|||||||
@ -825,7 +825,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Escompte
|
// Escompte
|
||||||
if ($object->close_code == Facture::CLOSECODE_DISCOUNTVAT)
|
if ($object->close_code == FactureFournisseur::CLOSECODE_DISCOUNTVAT)
|
||||||
{
|
{
|
||||||
$index++;
|
$index++;
|
||||||
$pdf->SetFillColor(255, 255, 255);
|
$pdf->SetFillColor(255, 255, 255);
|
||||||
|
|||||||
@ -64,11 +64,11 @@ class mod_supplier_proposal_saphir extends ModeleNumRefSupplierProposal
|
|||||||
*/
|
*/
|
||||||
public function info()
|
public function info()
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs, $db;
|
||||||
|
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
|
|
||||||
$form = new Form($this->db);
|
$form = new Form($db);
|
||||||
|
|
||||||
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
||||||
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
|
|||||||
@ -210,6 +210,17 @@ elseif ($modulepart == 'bom')
|
|||||||
$dir = $conf->$modulepart->dir_output; // By default
|
$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')
|
elseif ($modulepart == 'bank')
|
||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
@ -222,7 +233,7 @@ elseif ($modulepart == 'bank')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
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))
|
if (empty($backtourl))
|
||||||
@ -237,6 +248,7 @@ if (empty($backtourl))
|
|||||||
elseif (in_array($modulepart, array('ticket'))) $backtourl = DOL_URL_ROOT."/ticket/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
|
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('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('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"]);
|
else $backtourl = DOL_URL_ROOT."/".$modulepart."/".$modulepart."_document.php?id=".$id.'&file='.urldecode($_POST["file"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -81,7 +81,7 @@ if ($permtoadd)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<a href="#" class="inline-block valignmiddle toolbarbutton" title="'.$langs->trans("NotAllowed").'">';
|
print '<a href="#" class="inline-block valignmiddle toolbarbutton" title="'.$langs->trans("NotAllowed").'">';
|
||||||
print '<img class="toolbarbutton" border="0" src="'.DOL_URL_ROOT.'/theme/common/folder-new.png">';
|
print '<img class="toolbarbutton disabled" border="0" src="'.DOL_URL_ROOT.'/theme/common/folder-new.png">';
|
||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
if ($module == 'ecm')
|
if ($module == 'ecm')
|
||||||
|
|||||||
@ -795,18 +795,18 @@ class EcmDirectory // extends CommonObject
|
|||||||
* NB2: if trigger fail, action should be canceled.
|
* NB2: if trigger fail, action should be canceled.
|
||||||
* NB3: Should be deleted if EcmDirectory extend CommonObject
|
* 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
|
* @param User $user Object user
|
||||||
* @return int Result of run_triggers
|
* @return int Result of run_triggers
|
||||||
*/
|
*/
|
||||||
public function call_trigger($trigger_name, $user)
|
public function call_trigger($triggerName, $user)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||||
$interface=new Interfaces($this->db);
|
$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 ($result < 0) {
|
||||||
if (!empty($this->errors))
|
if (!empty($this->errors))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -849,7 +849,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
if (empty($id)) $id = $facid;
|
if (empty($id)) $id = $facid;
|
||||||
$trigger_name = 'SHIPPING_SENTBYMAIL';
|
$triggersendname = 'SHIPPING_SENTBYMAIL';
|
||||||
$paramname = 'id';
|
$paramname = 'id';
|
||||||
$mode = 'emailfromshipment';
|
$mode = 'emailfromshipment';
|
||||||
$trackid = 'shi'.$object->id;
|
$trackid = 'shi'.$object->id;
|
||||||
|
|||||||
@ -1411,7 +1411,7 @@ if (empty($reshook))
|
|||||||
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
||||||
|
|
||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
$trigger_name = 'EXPENSEREPORT_SENTBYMAIL';
|
$triggersendname = 'EXPENSEREPORT_SENTBYMAIL';
|
||||||
$autocopy = 'MAIN_MAIL_AUTOCOPY_EXPENSEREPORT_TO';
|
$autocopy = 'MAIN_MAIL_AUTOCOPY_EXPENSEREPORT_TO';
|
||||||
$trackid = 'exp'.$object->id;
|
$trackid = 'exp'.$object->id;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||||
@ -2148,12 +2148,15 @@ else
|
|||||||
if ($action != 'editline' || $line->rowid != GETPOST('rowid', 'int'))
|
if ($action != 'editline' || $line->rowid != GETPOST('rowid', 'int'))
|
||||||
{
|
{
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
// Num
|
// Num
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
print $numline;
|
print $numline;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Date
|
// Date
|
||||||
print '<td class="center">'.dol_print_date($db->jdate($line->date), 'day').'</td>';
|
print '<td class="center">'.dol_print_date($db->jdate($line->date), 'day').'</td>';
|
||||||
|
|
||||||
// Project
|
// Project
|
||||||
if (!empty($conf->projet->enabled))
|
if (!empty($conf->projet->enabled))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -721,7 +721,7 @@ if (empty($reshook))
|
|||||||
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
||||||
|
|
||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
$trigger_name = 'FICHINTER_SENTBYMAIL';
|
$triggersendname = 'FICHINTER_SENTBYMAIL';
|
||||||
$autocopy = 'MAIN_MAIL_AUTOCOPY_FICHINTER_TO';
|
$autocopy = 'MAIN_MAIL_AUTOCOPY_FICHINTER_TO';
|
||||||
$trackid = 'int'.$object->id;
|
$trackid = 'int'.$object->id;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||||
|
|||||||
@ -468,7 +468,7 @@ if ($object->id > 0)
|
|||||||
print '<table class="noborder centpercent lastrecordtable">';
|
print '<table class="noborder centpercent lastrecordtable">';
|
||||||
print '<tr class="liste_titre'.(($num == 0) ? ' nobottom' : '').'">';
|
print '<tr class="liste_titre'.(($num == 0) ? ' nobottom' : '').'">';
|
||||||
print '<td colspan="3">'.$langs->trans("ProductsAndServices").'</td><td class="right">';
|
print '<td colspan="3">'.$langs->trans("ProductsAndServices").'</td><td class="right">';
|
||||||
print '<a class="notasortlink" href="'.DOL_URL_ROOT.'/fourn/product/list.php?fourn_id='.$object->id.'">'.$langs->trans("AllProductReferencesOfSupplier").' <span class="badge">'.$object->nbOfProductRefs().'</span>';
|
print '<a class="notasortlink" href="'.DOL_URL_ROOT.'/fourn/product/list.php?fourn_id='.$object->id.'">'.$langs->trans("AllProductReferencesOfSupplier").'<span class="badge marginleftonlyshort">'.$object->nbOfProductRefs().'</span>';
|
||||||
print '</a></td></tr>';
|
print '</a></td></tr>';
|
||||||
|
|
||||||
$return = array();
|
$return = array();
|
||||||
@ -542,7 +542,7 @@ if ($object->id > 0)
|
|||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
print '<table class="nobordernopadding centpercent"><tr><td>'.$langs->trans("LastSupplierProposals", ($num < $MAXLIST ? "" : $MAXLIST)).'</td>';
|
print '<table class="nobordernopadding centpercent"><tr><td>'.$langs->trans("LastSupplierProposals", ($num < $MAXLIST ? "" : $MAXLIST)).'</td>';
|
||||||
print '<td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/supplier_proposal/list.php?socid='.$object->id.'">'.$langs->trans("AllPriceRequests").' <span class="badge">'.$num.'</span></td>';
|
print '<td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/supplier_proposal/list.php?socid='.$object->id.'">'.$langs->trans("AllPriceRequests").'<span class="badge marginleftonlyshort">'.$num.'</span></td>';
|
||||||
print '<td width="20px" class="right"><a href="'.DOL_URL_ROOT.'/supplier_proposal/stats/index.php?mode=supplier&socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
|
print '<td width="20px" class="right"><a href="'.DOL_URL_ROOT.'/supplier_proposal/stats/index.php?mode=supplier&socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -653,7 +653,7 @@ if ($object->id > 0)
|
|||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
print '<table class="nobordernopadding" width="100%"><tr><td>'.$langs->trans("LastSupplierOrders", ($num < $MAXLIST ? "" : $MAXLIST)).'</td>';
|
print '<table class="nobordernopadding" width="100%"><tr><td>'.$langs->trans("LastSupplierOrders", ($num < $MAXLIST ? "" : $MAXLIST)).'</td>';
|
||||||
print '<td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/fourn/commande/list.php?socid='.$object->id.'">'.$langs->trans("AllOrders").' <span class="badge">'.$num.'</span></td>';
|
print '<td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/fourn/commande/list.php?socid='.$object->id.'">'.$langs->trans("AllOrders").'<span class="badge marginleftonlyshort">'.$num.'</span></td>';
|
||||||
print '<td width="20px" class="right"><a href="'.DOL_URL_ROOT.'/commande/stats/index.php?mode=supplier&socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
|
print '<td width="20px" class="right"><a href="'.DOL_URL_ROOT.'/commande/stats/index.php?mode=supplier&socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -725,7 +725,7 @@ if ($object->id > 0)
|
|||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="4">';
|
print '<td colspan="4">';
|
||||||
print '<table class="nobordernopadding" width="100%"><tr><td>'.$langs->trans('LastSuppliersBills', ($num <= $MAXLIST ? "" : $MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/fourn/facture/list.php?socid='.$object->id.'">'.$langs->trans('AllBills').' <span class="badge">'.$num.'</span></td>';
|
print '<table class="nobordernopadding" width="100%"><tr><td>'.$langs->trans('LastSuppliersBills', ($num <= $MAXLIST ? "" : $MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/fourn/facture/list.php?socid='.$object->id.'">'.$langs->trans('AllBills').'<span class="badge marginleftonlyshort">'.$num.'</span></td>';
|
||||||
print '<td width="20px" class="right"><a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?mode=supplier&socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
|
print '<td width="20px" class="right"><a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?mode=supplier&socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
@ -2420,18 +2420,19 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
// Trigger names for each status
|
// Trigger names for each status
|
||||||
$trigger_name[0] = 'DRAFT';
|
$triggerName = array();
|
||||||
$trigger_name[1] = 'VALIDATED';
|
$triggerName[0] = 'DRAFT';
|
||||||
$trigger_name[2] = 'APPROVED';
|
$triggerName[1] = 'VALIDATED';
|
||||||
$trigger_name[3] = 'ORDERED'; // Ordered
|
$triggerName[2] = 'APPROVED';
|
||||||
$trigger_name[4] = 'RECEIVED_PARTIALLY';
|
$triggerName[3] = 'ORDERED'; // Ordered
|
||||||
$trigger_name[5] = 'RECEIVED_COMPLETELY';
|
$triggerName[4] = 'RECEIVED_PARTIALLY';
|
||||||
$trigger_name[6] = 'CANCELED';
|
$triggerName[5] = 'RECEIVED_COMPLETELY';
|
||||||
$trigger_name[7] = 'CANCELED';
|
$triggerName[6] = 'CANCELED';
|
||||||
$trigger_name[9] = 'REFUSED';
|
$triggerName[7] = 'CANCELED';
|
||||||
|
$triggerName[9] = 'REFUSED';
|
||||||
|
|
||||||
// Call trigger
|
// 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++; }
|
if ($result < 0) { $error++; }
|
||||||
// End call triggers
|
// End call triggers
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1028,7 +1028,7 @@ if (empty($reshook))
|
|||||||
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
||||||
|
|
||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
$trigger_name = 'ORDER_SUPPLIER_SENTBYMAIL';
|
$triggersendname = 'ORDER_SUPPLIER_SENTBYMAIL';
|
||||||
$autocopy = 'MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO';
|
$autocopy = 'MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO';
|
||||||
$trackid = 'sor'.$object->id;
|
$trackid = 'sor'.$object->id;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||||
|
|||||||
@ -1497,7 +1497,7 @@ if (empty($reshook))
|
|||||||
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
||||||
|
|
||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
$trigger_name = 'BILL_SUPPLIER_SENTBYMAIL';
|
$triggersendname = 'BILL_SUPPLIER_SENTBYMAIL';
|
||||||
$paramname = 'id';
|
$paramname = 'id';
|
||||||
$autocopy = 'MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO';
|
$autocopy = 'MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO';
|
||||||
$trackid = 'sin'.$object->id;
|
$trackid = 'sin'.$object->id;
|
||||||
|
|||||||
@ -872,7 +872,7 @@ if (empty($reshook))
|
|||||||
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
||||||
|
|
||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
$trigger_name='HOLIDAY_SENTBYMAIL';
|
$triggersendname = 'HOLIDAY_SENTBYMAIL';
|
||||||
$autocopy='MAIN_MAIL_AUTOCOPY_HOLIDAY_TO';
|
$autocopy='MAIN_MAIL_AUTOCOPY_HOLIDAY_TO';
|
||||||
$trackid='leav'.$object->id;
|
$trackid='leav'.$object->id;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||||
|
|||||||
@ -1807,17 +1807,29 @@ class TCPDF_STATIC {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Wrapper to use fopen only with local files
|
* Wrapper to use fopen only with local files
|
||||||
* @param filename (string) Name of the file to open
|
* @param string $filename The full path to the file to open
|
||||||
* @param $mode (string)
|
* @param string $mode Acceses type for the file ('r', 'r+', 'w', 'w+', 'a', 'a+', 'x', 'x+', 'c', 'c+' or 'e')
|
||||||
* @return Returns a file pointer resource on success, or FALSE on error.
|
* @return resource Returns a file pointer resource on success, or FALSE on error.
|
||||||
* @public static
|
* @public static
|
||||||
*/
|
*/
|
||||||
public static function fopenLocal($filename, $mode) {
|
public static function fopenLocal($filename, $mode)
|
||||||
if (strpos($filename, '://') === false) {
|
{
|
||||||
|
if (strpos($filename, '//') === 0)
|
||||||
|
{
|
||||||
|
// Share folder on a (windows) server
|
||||||
|
// e.g.: "//[MyServerName]/[MySharedFolder]/"
|
||||||
|
//
|
||||||
|
// nothing to change
|
||||||
|
}
|
||||||
|
elseif (strpos($filename, '://') === false)
|
||||||
|
{
|
||||||
$filename = 'file://'.$filename;
|
$filename = 'file://'.$filename;
|
||||||
} elseif (stream_is_local($filename) !== true) {
|
}
|
||||||
|
elseif (stream_is_local($filename) !== true)
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return fopen($filename, $mode);
|
return fopen($filename, $mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@ -78,7 +78,7 @@ ALTER TABLE llx_rights_def ADD COLUMN family_position INTEGER NOT NULL DEFAULT 0
|
|||||||
|
|
||||||
UPDATE llx_rights_def SET subperms = 'write' WHERE perms = 'fiscalyear' AND module = 'accounting' AND subperms IS NULL;
|
UPDATE llx_rights_def SET subperms = 'write' WHERE perms = 'fiscalyear' AND module = 'accounting' AND subperms IS NULL;
|
||||||
|
|
||||||
ALTER TABLE llx_bom_bom ADD COLUMN duration double(8,4) DEFAULT NULL;
|
ALTER TABLE llx_bom_bom ADD COLUMN duration double(24,8) DEFAULT NULL;
|
||||||
ALTER TABLE llx_bom_bom ADD COLUMN fk_warehouse integer;
|
ALTER TABLE llx_bom_bom ADD COLUMN fk_warehouse integer;
|
||||||
ALTER TABLE llx_bom_bomline ADD COLUMN position integer NOT NULL DEFAULT 0;
|
ALTER TABLE llx_bom_bomline ADD COLUMN position integer NOT NULL DEFAULT 0;
|
||||||
ALTER TABLE llx_bom_bomline ADD COLUMN qty_frozen smallint DEFAULT 0;
|
ALTER TABLE llx_bom_bomline ADD COLUMN qty_frozen smallint DEFAULT 0;
|
||||||
|
|||||||
@ -26,8 +26,8 @@ CREATE TABLE llx_bom_bom(
|
|||||||
note_private text,
|
note_private text,
|
||||||
fk_warehouse integer,
|
fk_warehouse integer,
|
||||||
qty double(24,8),
|
qty double(24,8),
|
||||||
efficiency double(8,4) DEFAULT 1,
|
efficiency double(24,8) DEFAULT 1,
|
||||||
duration double(8,4) DEFAULT NULL,
|
duration double(24,8) DEFAULT NULL,
|
||||||
date_creation datetime NOT NULL,
|
date_creation datetime NOT NULL,
|
||||||
date_valid datetime,
|
date_valid datetime,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
|
|||||||
@ -24,7 +24,7 @@ CREATE TABLE llx_bom_bomline(
|
|||||||
qty double(24,8) NOT NULL,
|
qty double(24,8) NOT NULL,
|
||||||
qty_frozen smallint DEFAULT 0,
|
qty_frozen smallint DEFAULT 0,
|
||||||
disable_stock_change smallint DEFAULT 0,
|
disable_stock_change smallint DEFAULT 0,
|
||||||
efficiency double(8,4) NOT NULL DEFAULT 1,
|
efficiency double(24,8) NOT NULL DEFAULT 1,
|
||||||
position integer NOT NULL DEFAULT 0
|
position integer NOT NULL DEFAULT 0
|
||||||
-- END MODULEBUILDER FIELDS
|
-- END MODULEBUILDER FIELDS
|
||||||
) ENGINE=innodb;
|
) ENGINE=innodb;
|
||||||
|
|||||||
@ -1138,7 +1138,7 @@ TriggerAlwaysActive=Triggers in this file are always active, whatever are the ac
|
|||||||
TriggerActiveAsModuleActive=Triggers in this file are active as module <b>%s</b> is enabled.
|
TriggerActiveAsModuleActive=Triggers in this file are active as module <b>%s</b> is enabled.
|
||||||
GeneratedPasswordDesc=Choose the method to be used for auto-generated passwords.
|
GeneratedPasswordDesc=Choose the method to be used for auto-generated passwords.
|
||||||
DictionaryDesc=Insert all reference data. You can add your values to the default.
|
DictionaryDesc=Insert all reference data. You can add your values to the default.
|
||||||
ConstDesc=This page allows you to edit (override) parameters not available in other pages. These are mostly reserved parameters for developers/advanced troubleshooting. For a full list of the parameters available <a href="https://wiki.dolibarr.org/index.php/Setup_Other#List_of_known_hidden_options" title="External Site - opens in a new window" target="_blank">see here</a>.
|
ConstDesc=This page allows you to edit (override) parameters not available in other pages. These are mostly reserved parameters for developers/advanced troubleshooting only.
|
||||||
MiscellaneousDesc=All other security related parameters are defined here.
|
MiscellaneousDesc=All other security related parameters are defined here.
|
||||||
LimitsSetup=Limits/Precision setup
|
LimitsSetup=Limits/Precision setup
|
||||||
LimitsDesc=You can define limits, precisions and optimizations used by Dolibarr here
|
LimitsDesc=You can define limits, precisions and optimizations used by Dolibarr here
|
||||||
|
|||||||
@ -160,7 +160,7 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
$trigger_name = 'MYOBJECT_SENTBYMAIL';
|
$triggersendname = 'MYOBJECT_SENTBYMAIL';
|
||||||
$autocopy = 'MAIN_MAIL_AUTOCOPY_MYOBJECT_TO';
|
$autocopy = 'MAIN_MAIL_AUTOCOPY_MYOBJECT_TO';
|
||||||
$trackid = 'myobject'.$object->id;
|
$trackid = 'myobject'.$object->id;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||||
|
|||||||
@ -231,7 +231,19 @@ class Mo extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function create(User $user, $notrigger = false)
|
public function create(User $user, $notrigger = false)
|
||||||
{
|
{
|
||||||
return $this->createCommon($user, $notrigger);
|
$this->db->begin();
|
||||||
|
|
||||||
|
$result = $this->createCommon($user, $notrigger);
|
||||||
|
|
||||||
|
// Insert lines in mrp_production table
|
||||||
|
|
||||||
|
if ($result > 0) {
|
||||||
|
$this->db->commit();
|
||||||
|
} else {
|
||||||
|
$this->db->rollback();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -146,7 +146,7 @@ if (empty($reshook))
|
|||||||
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
||||||
|
|
||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
$trigger_name = 'MO_SENTBYMAIL';
|
$triggersendname = 'MO_SENTBYMAIL';
|
||||||
$autocopy = 'MAIN_MAIL_AUTOCOPY_MO_TO';
|
$autocopy = 'MAIN_MAIL_AUTOCOPY_MO_TO';
|
||||||
$trackid = 'mo'.$object->id;
|
$trackid = 'mo'.$object->id;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||||
|
|||||||
@ -133,7 +133,7 @@ if (empty($reshook))
|
|||||||
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
||||||
|
|
||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
$trigger_name = 'MO_SENTBYMAIL';
|
$triggersendname = 'MO_SENTBYMAIL';
|
||||||
$autocopy = 'MAIN_MAIL_AUTOCOPY_MO_TO';
|
$autocopy = 'MAIN_MAIL_AUTOCOPY_MO_TO';
|
||||||
$trackid = 'mo'.$object->id;
|
$trackid = 'mo'.$object->id;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||||
|
|||||||
@ -30,8 +30,8 @@ if (empty($conf) || ! is_object($conf))
|
|||||||
print '<tr class="oddeven'.(empty($this->tpl['strike'])?'':' strikefordisabled').'">';
|
print '<tr class="oddeven'.(empty($this->tpl['strike'])?'':' strikefordisabled').'">';
|
||||||
print '<td>'.$this->tpl['label'].'</td>';
|
print '<td>'.$this->tpl['label'].'</td>';
|
||||||
print '<td class="right">'.$this->tpl['qty'].'</td>';
|
print '<td class="right">'.$this->tpl['qty'].'</td>';
|
||||||
print '<td class="center">'.yn($this->tpl['qty_frozen']).'</td>';
|
print '<td class="center">'.($this->tpl['qty_frozen'] ? yn($this->tpl['qty_frozen']) : '').'</td>';
|
||||||
print '<td class="center">'.yn($this->tpl['disable_stock_change']).'</td>';
|
print '<td class="center">'.($this->tpl['disable_stock_change'] ? yn($this->tpl['disable_stock_change']) : '').'</td>';
|
||||||
//print '<td class="right">'.$this->tpl['efficiency'].'</td>';
|
//print '<td class="right">'.$this->tpl['efficiency'].'</td>';
|
||||||
|
|
||||||
$selected=1;
|
$selected=1;
|
||||||
|
|||||||
@ -1122,31 +1122,19 @@ class Product extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Delete a product from database (if not used)
|
* Delete a product from database (if not used)
|
||||||
*
|
*
|
||||||
* @param User $user Product id (usage of this is deprecated, delete should be called without parameters on a fetched object)
|
* @param User $user User (object) deleting product
|
||||||
* @param int $notrigger Do not execute trigger
|
* @param int $notrigger Do not execute trigger
|
||||||
* @return int < 0 if KO, 0 = Not possible, > 0 if OK
|
* @return int < 0 if KO, 0 = Not possible, > 0 if OK
|
||||||
*/
|
*/
|
||||||
public function delete(User $user, $notrigger = 0)
|
public function delete(User $user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
// Deprecation warning
|
|
||||||
if ($id > 0) {
|
|
||||||
dol_syslog(__METHOD__." with parameter is deprecated", LOG_WARNING);
|
|
||||||
}
|
|
||||||
|
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
// Clean parameters
|
|
||||||
if (empty($id)) {
|
|
||||||
$id = $this->id;
|
|
||||||
} else {
|
|
||||||
$this->fetch($id);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if (empty($id)) {
|
if (empty($this->id)) {
|
||||||
$this->error = "Object must be fetched before calling delete";
|
$this->error = "Object must be fetched before calling delete";
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1155,14 +1143,15 @@ class Product extends CommonObject
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$objectisused = $this->isObjectUsed($id);
|
$objectisused = $this->isObjectUsed($this->id);
|
||||||
if (empty($objectisused)) {
|
if (empty($objectisused)) {
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
if (!$error && empty($notrigger)) {
|
if (!$error && empty($notrigger)) {
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result = $this->call_trigger('PRODUCT_DELETE', $user);
|
$result = $this->call_trigger('PRODUCT_DELETE', $user);
|
||||||
if ($result < 0) { $error++;
|
if ($result < 0) {
|
||||||
|
$error++;
|
||||||
}
|
}
|
||||||
// End call triggers
|
// End call triggers
|
||||||
}
|
}
|
||||||
@ -1172,7 +1161,7 @@ class Product extends CommonObject
|
|||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX.'product_batch';
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX.'product_batch';
|
||||||
$sql .= " WHERE fk_product_stock IN (";
|
$sql .= " WHERE fk_product_stock IN (";
|
||||||
$sql .= "SELECT rowid FROM ".MAIN_DB_PREFIX.'product_stock';
|
$sql .= "SELECT rowid FROM ".MAIN_DB_PREFIX.'product_stock';
|
||||||
$sql .= " WHERE fk_product = ".$id.")";
|
$sql .= " WHERE fk_product = ".(int) $this->id.")";
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
@ -1188,7 +1177,7 @@ class Product extends CommonObject
|
|||||||
{
|
{
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$table;
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$table;
|
||||||
$sql .= " WHERE fk_product = ".$id;
|
$sql .= " WHERE fk_product = ".(int) $this->id;
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
@ -1206,7 +1195,7 @@ class Product extends CommonObject
|
|||||||
//If it is a parent product, then we remove the association with child products
|
//If it is a parent product, then we remove the association with child products
|
||||||
$prodcomb = new ProductCombination($this->db);
|
$prodcomb = new ProductCombination($this->db);
|
||||||
|
|
||||||
if ($prodcomb->deleteByFkProductParent($user, $id) < 0) {
|
if ($prodcomb->deleteByFkProductParent($user, $this->id) < 0) {
|
||||||
$error++;
|
$error++;
|
||||||
$this->errors[] = 'Error deleting combinations';
|
$this->errors[] = 'Error deleting combinations';
|
||||||
}
|
}
|
||||||
@ -1221,7 +1210,7 @@ class Product extends CommonObject
|
|||||||
// Delete from product_association
|
// Delete from product_association
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."product_association";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."product_association";
|
||||||
$sql .= " WHERE fk_product_pere = ".$id." OR fk_product_fils = ".$id;
|
$sql .= " WHERE fk_product_pere = ".(int) $this->id." OR fk_product_fils = ".(int) $this->id;
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
@ -1233,7 +1222,7 @@ class Product extends CommonObject
|
|||||||
// Delete product
|
// Delete product
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$sqlz = "DELETE FROM ".MAIN_DB_PREFIX."product";
|
$sqlz = "DELETE FROM ".MAIN_DB_PREFIX."product";
|
||||||
$sqlz .= " WHERE rowid = ".$id;
|
$sqlz .= " WHERE rowid = ".(int) $this->id;
|
||||||
|
|
||||||
$resultz = $this->db->query($sqlz);
|
$resultz = $this->db->query($sqlz);
|
||||||
if (!$resultz) {
|
if (!$resultz) {
|
||||||
@ -1308,7 +1297,7 @@ class Product extends CommonObject
|
|||||||
$sql = "SELECT rowid";
|
$sql = "SELECT rowid";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."product_lang";
|
$sql .= " FROM ".MAIN_DB_PREFIX."product_lang";
|
||||||
$sql .= " WHERE fk_product=".$this->id;
|
$sql .= " WHERE fk_product=".$this->id;
|
||||||
$sql .= " AND lang='".$key."'";
|
$sql .= " AND lang='".$this->db->escape($key)."'";
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
|
|
||||||
@ -1330,7 +1319,8 @@ class Product extends CommonObject
|
|||||||
$sql2 .= ")";
|
$sql2 .= ")";
|
||||||
$sql2 .= " VALUES(".$this->id.",'".$this->db->escape($key)."','".$this->db->escape($this->label)."',";
|
$sql2 .= " VALUES(".$this->id.",'".$this->db->escape($key)."','".$this->db->escape($this->label)."',";
|
||||||
$sql2 .= " '".$this->db->escape($this->description)."'";
|
$sql2 .= " '".$this->db->escape($this->description)."'";
|
||||||
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2 .= ", '".$this->db->escape($this->other)."'";
|
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) {
|
||||||
|
$sql2 .= ", '".$this->db->escape($this->other)."'";
|
||||||
}
|
}
|
||||||
$sql2 .= ")";
|
$sql2 .= ")";
|
||||||
}
|
}
|
||||||
@ -1344,7 +1334,7 @@ class Product extends CommonObject
|
|||||||
$sql = "SELECT rowid";
|
$sql = "SELECT rowid";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."product_lang";
|
$sql .= " FROM ".MAIN_DB_PREFIX."product_lang";
|
||||||
$sql .= " WHERE fk_product=".$this->id;
|
$sql .= " WHERE fk_product=".$this->id;
|
||||||
$sql .= " AND lang='".$key."'";
|
$sql .= " AND lang='".$this->db->escape($key)."'";
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
|
|
||||||
@ -1354,7 +1344,8 @@ class Product extends CommonObject
|
|||||||
$sql2 .= " SET ";
|
$sql2 .= " SET ";
|
||||||
$sql2 .= " label='".$this->db->escape($this->multilangs["$key"]["label"])."',";
|
$sql2 .= " label='".$this->db->escape($this->multilangs["$key"]["label"])."',";
|
||||||
$sql2 .= " description='".$this->db->escape($this->multilangs["$key"]["description"])."'";
|
$sql2 .= " description='".$this->db->escape($this->multilangs["$key"]["description"])."'";
|
||||||
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2 .= ", note='".$this->db->escape($this->multilangs["$key"]["other"])."'";
|
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) {
|
||||||
|
$sql2 .= ", note='".$this->db->escape($this->multilangs["$key"]["other"])."'";
|
||||||
}
|
}
|
||||||
$sql2 .= " WHERE fk_product=".$this->id." AND lang='".$this->db->escape($key)."'";
|
$sql2 .= " WHERE fk_product=".$this->id." AND lang='".$this->db->escape($key)."'";
|
||||||
}
|
}
|
||||||
@ -1366,7 +1357,8 @@ class Product extends CommonObject
|
|||||||
$sql2 .= ")";
|
$sql2 .= ")";
|
||||||
$sql2 .= " VALUES(".$this->id.",'".$this->db->escape($key)."','".$this->db->escape($this->multilangs["$key"]["label"])."',";
|
$sql2 .= " VALUES(".$this->id.",'".$this->db->escape($key)."','".$this->db->escape($this->multilangs["$key"]["label"])."',";
|
||||||
$sql2 .= " '".$this->db->escape($this->multilangs["$key"]["description"])."'";
|
$sql2 .= " '".$this->db->escape($this->multilangs["$key"]["description"])."'";
|
||||||
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2 .= ", '".$this->db->escape($this->multilangs["$key"]["other"])."'";
|
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) {
|
||||||
|
$sql2 .= ", '".$this->db->escape($this->multilangs["$key"]["other"])."'";
|
||||||
}
|
}
|
||||||
$sql2 .= ")";
|
$sql2 .= ")";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -112,7 +112,7 @@ if (empty($reshook))
|
|||||||
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
||||||
|
|
||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
/*$trigger_name='MYOBJECT_SENTBYMAIL';
|
/*$triggersendname = 'MYOBJECT_SENTBYMAIL';
|
||||||
$autocopy='MAIN_MAIL_AUTOCOPY_MYOBJECT_TO';
|
$autocopy='MAIN_MAIL_AUTOCOPY_MYOBJECT_TO';
|
||||||
$trackid='myobject'.$object->id;
|
$trackid='myobject'.$object->id;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';*/
|
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';*/
|
||||||
|
|||||||
@ -119,7 +119,7 @@ if (empty($reshook))
|
|||||||
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
||||||
|
|
||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
/*$trigger_name='MYOBJECT_SENTBYMAIL';
|
/*$triggersendname = 'MYOBJECT_SENTBYMAIL';
|
||||||
$autocopy='MAIN_MAIL_AUTOCOPY_MYOBJECT_TO';
|
$autocopy='MAIN_MAIL_AUTOCOPY_MYOBJECT_TO';
|
||||||
$trackid='myobject'.$object->id;
|
$trackid='myobject'.$object->id;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';*/
|
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';*/
|
||||||
|
|||||||
@ -152,7 +152,14 @@ if ($action == 'order' && isset($_POST['valid']))
|
|||||||
{
|
{
|
||||||
$productsupplier->getMultiLangs();
|
$productsupplier->getMultiLangs();
|
||||||
}
|
}
|
||||||
$line->desc = $productsupplier->description;
|
|
||||||
|
// if we use supplier description of the products
|
||||||
|
if (!empty($productsupplier->desc_supplier) && !empty($conf->global->PRODUIT_FOURN_TEXTS)) {
|
||||||
|
$desc = $productsupplier->desc_supplier;
|
||||||
|
} else {
|
||||||
|
$desc = $productsupplier->description;
|
||||||
|
}
|
||||||
|
$line->desc = $desc;
|
||||||
if (! empty($conf->global->MAIN_MULTILANGS))
|
if (! empty($conf->global->MAIN_MULTILANGS))
|
||||||
{
|
{
|
||||||
// TODO Get desc in language of thirdparty
|
// TODO Get desc in language of thirdparty
|
||||||
|
|||||||
@ -456,7 +456,7 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
$trigger_name = 'PROJECT_SENTBYMAIL';
|
$triggersendname = 'PROJECT_SENTBYMAIL';
|
||||||
$paramname = 'id';
|
$paramname = 'id';
|
||||||
$autocopy = 'MAIN_MAIL_AUTOCOPY_PROJECT_TO'; // used to know the automatic BCC to add
|
$autocopy = 'MAIN_MAIL_AUTOCOPY_PROJECT_TO'; // used to know the automatic BCC to add
|
||||||
$trackid = 'proj'.$object->id;
|
$trackid = 'proj'.$object->id;
|
||||||
|
|||||||
@ -198,7 +198,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
|
|||||||
//$object->doActions($action);
|
//$object->doActions($action);
|
||||||
|
|
||||||
// Actions to send emails (for ticket, we need to manage the addfile and removefile only)
|
// Actions to send emails (for ticket, we need to manage the addfile and removefile only)
|
||||||
$trigger_name = 'TICKET_SENTBYMAIL';
|
$triggersendname = 'TICKET_SENTBYMAIL';
|
||||||
$paramname = 'id';
|
$paramname = 'id';
|
||||||
$autocopy = 'MAIN_MAIL_AUTOCOPY_TICKET_TO'; // used to know the automatic BCC to add
|
$autocopy = 'MAIN_MAIL_AUTOCOPY_TICKET_TO'; // used to know the automatic BCC to add
|
||||||
$trackid = 'tic'.$object->id;
|
$trackid = 'tic'.$object->id;
|
||||||
|
|||||||
@ -688,7 +688,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
if (empty($id)) $id = $facid;
|
if (empty($id)) $id = $facid;
|
||||||
$trigger_name = 'RECEPTION_SENTBYMAIL';
|
$triggersendname = 'RECEPTION_SENTBYMAIL';
|
||||||
$paramname = 'id';
|
$paramname = 'id';
|
||||||
$mode = 'emailfromreception';
|
$mode = 'emailfromreception';
|
||||||
$trackid = 'shi'.$object->id;
|
$trackid = 'shi'.$object->id;
|
||||||
|
|||||||
@ -862,7 +862,7 @@ if (empty($reshook))
|
|||||||
$object->fetch($socid);
|
$object->fetch($socid);
|
||||||
|
|
||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
$trigger_name = 'COMPANY_SENTBYMAIL';
|
$triggersendname = 'COMPANY_SENTBYMAIL';
|
||||||
$paramname = 'socid';
|
$paramname = 'socid';
|
||||||
$mode = 'emailfromthirdparty';
|
$mode = 'emailfromthirdparty';
|
||||||
$trackid = 'thi'.$object->id;
|
$trackid = 'thi'.$object->id;
|
||||||
|
|||||||
@ -106,7 +106,6 @@ if (!$rowid) {
|
|||||||
print_liste_field_titre("DateOperation", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'center ');
|
print_liste_field_titre("DateOperation", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'center ');
|
||||||
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'left ');
|
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'left ');
|
||||||
print_liste_field_titre("Paid", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'right ');
|
print_liste_field_titre("Paid", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'right ');
|
||||||
print_liste_field_titre("Fee", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'right ');
|
|
||||||
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "", "", "", '', '', '', 'right ');
|
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "", "", "", '', '', '', 'right ');
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
@ -204,7 +203,6 @@ if (!$rowid) {
|
|||||||
print '<td>'.$payout->description.'</td>';
|
print '<td>'.$payout->description.'</td>';
|
||||||
// Amount
|
// Amount
|
||||||
print '<td class="right">'.price(($payout->amount) / 100, 0, '', 1, -1, -1, strtoupper($payout->currency))."</td>";
|
print '<td class="right">'.price(($payout->amount) / 100, 0, '', 1, -1, -1, strtoupper($payout->currency))."</td>";
|
||||||
print '<td class="right">'.price(($payout->fee) / 100, 0, '', 1, - 1, - 1, strtoupper($payout->currency))."</td>";
|
|
||||||
// Status
|
// Status
|
||||||
print "<td class='right'>";
|
print "<td class='right'>";
|
||||||
if ($payout->status == 'paid') {
|
if ($payout->status == 'paid') {
|
||||||
|
|||||||
@ -105,7 +105,7 @@ if (!$rowid) {
|
|||||||
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'left ');
|
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'left ');
|
||||||
print_liste_field_titre("Paid", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'right ');
|
print_liste_field_titre("Paid", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'right ');
|
||||||
print_liste_field_titre("Fee", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'right ');
|
print_liste_field_titre("Fee", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'right ');
|
||||||
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "", "", "", '', '', '', 'right_');
|
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "", "", "", '', '', '', 'right ');
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|||||||
@ -491,7 +491,7 @@ if (empty($reshook))
|
|||||||
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
||||||
|
|
||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
$trigger_name = 'PROPOSAL_SUPPLIER_SENTBYMAIL';
|
$triggersendname = 'PROPOSAL_SUPPLIER_SENTBYMAIL';
|
||||||
$autocopy = 'MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO';
|
$autocopy = 'MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO';
|
||||||
$trackid = 'spr'.$object->id;
|
$trackid = 'spr'.$object->id;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||||
|
|||||||
@ -1729,11 +1729,11 @@ class SupplierProposal extends CommonObject
|
|||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$modelpdf=$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED?$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED:$this->modelpdf;
|
$modelpdf=$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED?$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED:$this->modelpdf;
|
||||||
$trigger_name='SUPPLIER_PROPOSAL_CLOSE_REFUSED';
|
$triggerName = 'SUPPLIER_PROPOSAL_CLOSE_REFUSED';
|
||||||
|
|
||||||
if ($status == 2)
|
if ($status == 2)
|
||||||
{
|
{
|
||||||
$trigger_name='SUPPLIER_PROPOSAL_CLOSE_SIGNED';
|
$triggerName='SUPPLIER_PROPOSAL_CLOSE_SIGNED';
|
||||||
$modelpdf=$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL?$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL:$this->modelpdf;
|
$modelpdf=$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL?$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL:$this->modelpdf;
|
||||||
|
|
||||||
if (! empty($conf->global->SUPPLIER_PROPOSAL_UPDATE_PRICE_ON_SUPPlIER_PROPOSAL)) // TODO This option was not tested correctly. Error if product ref does not exists
|
if (! empty($conf->global->SUPPLIER_PROPOSAL_UPDATE_PRICE_ON_SUPPlIER_PROPOSAL)) // TODO This option was not tested correctly. Error if product ref does not exists
|
||||||
@ -1743,7 +1743,7 @@ class SupplierProposal extends CommonObject
|
|||||||
}
|
}
|
||||||
if ($status == 4)
|
if ($status == 4)
|
||||||
{
|
{
|
||||||
$trigger_name='SUPPLIER_PROPOSAL_CLASSIFY_BILLED';
|
$triggerName='SUPPLIER_PROPOSAL_CLASSIFY_BILLED';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
||||||
@ -1760,7 +1760,7 @@ class SupplierProposal extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result=$this->call_trigger($trigger_name, $user);
|
$result=$this->call_trigger($triggerName, $user);
|
||||||
if ($result < 0) { $error++; }
|
if ($result < 0) { $error++; }
|
||||||
// End call triggers
|
// End call triggers
|
||||||
|
|
||||||
|
|||||||
@ -43,7 +43,7 @@ $id = GETPOST('id', 'int');
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($action == "getProducts") {
|
if ($action == 'getProducts') {
|
||||||
$object = new Categorie($db);
|
$object = new Categorie($db);
|
||||||
$result = $object->fetch($category);
|
$result = $object->fetch($category);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
@ -65,7 +65,7 @@ if ($action == "getProducts") {
|
|||||||
echo 'Failed to load category with id='.$category;
|
echo 'Failed to load category with id='.$category;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ($action == "search" && $term != '') {
|
elseif ($action == 'search' && $term != '') {
|
||||||
// Define $filteroncategids, the filter on category ID if there is a Root category defined.
|
// Define $filteroncategids, the filter on category ID if there is a Root category defined.
|
||||||
$filteroncategids = '';
|
$filteroncategids = '';
|
||||||
if ($conf->global->TAKEPOS_ROOT_CATEGORY_ID > 0) { // A root category is defined, we must filter on products inside this category tree
|
if ($conf->global->TAKEPOS_ROOT_CATEGORY_ID > 0) { // A root category is defined, we must filter on products inside this category tree
|
||||||
@ -81,10 +81,10 @@ elseif ($action == "search" && $term != '') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'SELECT rowid, ref, label, tosell, tobuy FROM '.MAIN_DB_PREFIX.'product as p';
|
$sql = 'SELECT rowid, ref, label, tosell, tobuy FROM '.MAIN_DB_PREFIX.'product as p';
|
||||||
if ($filteroncategids) {
|
|
||||||
$sql.= ' INNER JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product = p.rowid AND cp.fk_categorie IN ('.$filteroncategids.')';
|
|
||||||
}
|
|
||||||
$sql .= ' WHERE entity IN ('.getEntity('product').')';
|
$sql .= ' WHERE entity IN ('.getEntity('product').')';
|
||||||
|
if ($filteroncategids) {
|
||||||
|
$sql.= ' AND rowid IN (SELECT DISTINCT fk_product FROM '.MAIN_DB_PREFIX.'categorie_product WHERE fk_categorie IN ('.$filteroncategids.'))';
|
||||||
|
}
|
||||||
$sql .= ' AND tosell = 1';
|
$sql .= ' AND tosell = 1';
|
||||||
$sql .= natural_search(array('ref', 'label', 'barcode'), $term);
|
$sql .= natural_search(array('ref', 'label', 'barcode'), $term);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
|
|||||||
@ -593,7 +593,7 @@ $permissiontoadd = $user->rights->ticket->write;
|
|||||||
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||||
|
|
||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
$trigger_name = 'TICKET_SENTBYMAIL';
|
$triggersendname = 'TICKET_SENTBYMAIL';
|
||||||
$paramname = 'id';
|
$paramname = 'id';
|
||||||
$autocopy = 'MAIN_MAIL_AUTOCOPY_TICKET_TO'; // used to know the automatic BCC to add
|
$autocopy = 'MAIN_MAIL_AUTOCOPY_TICKET_TO'; // used to know the automatic BCC to add
|
||||||
$trackid = 'tic'.$object->id;
|
$trackid = 'tic'.$object->id;
|
||||||
@ -994,7 +994,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
|
|||||||
print '<td class="titlefield">';
|
print '<td class="titlefield">';
|
||||||
print $langs->trans('TicketChangeType');
|
print $langs->trans('TicketChangeType');
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
print $formticket->selectTypesTickets($object->type_code, 'update_value_type', '', 2);
|
$formticket->selectTypesTickets($object->type_code, 'update_value_type', '', 2);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
// Group
|
// Group
|
||||||
@ -1002,7 +1002,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
|
|||||||
print '<td>';
|
print '<td>';
|
||||||
print $langs->trans('TicketChangeCategory');
|
print $langs->trans('TicketChangeCategory');
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
print $formticket->selectGroupTickets($object->category_code, 'update_value_category', '', 2);
|
$formticket->selectGroupTickets($object->category_code, 'update_value_category', '', 2);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
// Severity
|
// Severity
|
||||||
@ -1010,7 +1010,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
|
|||||||
print '<td>';
|
print '<td>';
|
||||||
print $langs->trans('TicketChangeSeverity');
|
print $langs->trans('TicketChangeSeverity');
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
print $formticket->selectSeveritiesTickets($object->severity_code, 'update_value_severity', '', 2);
|
$formticket->selectSeveritiesTickets($object->severity_code, 'update_value_severity', '', 2);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -1368,6 +1368,8 @@ class Ticket extends CommonObject
|
|||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
|
$error = 0;
|
||||||
|
|
||||||
if ($this->statut != self::STATUS_CANCELED) { // no closed
|
if ($this->statut != self::STATUS_CANCELED) { // no closed
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
@ -1420,6 +1422,7 @@ class Ticket extends CommonObject
|
|||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
|
$error = 0;
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$this->oldcopy = dol_clone($this);
|
$this->oldcopy = dol_clone($this);
|
||||||
|
|||||||
@ -235,8 +235,11 @@ if (empty($reshook)) {
|
|||||||
$object->employee = GETPOST('employee', 'alphanohtml');
|
$object->employee = GETPOST('employee', 'alphanohtml');
|
||||||
|
|
||||||
$object->thm = GETPOST("thm", 'alphanohtml') != '' ? GETPOST("thm", 'alphanohtml') : '';
|
$object->thm = GETPOST("thm", 'alphanohtml') != '' ? GETPOST("thm", 'alphanohtml') : '';
|
||||||
|
$object->thm = price2num($object->thm);
|
||||||
$object->tjm = GETPOST("tjm", 'alphanohtml') != '' ? GETPOST("tjm", 'alphanohtml') : '';
|
$object->tjm = GETPOST("tjm", 'alphanohtml') != '' ? GETPOST("tjm", 'alphanohtml') : '';
|
||||||
|
$object->tjm = price2num($object->tjm);
|
||||||
$object->salary = GETPOST("salary", 'alphanohtml') != '' ? GETPOST("salary", 'alphanohtml') : '';
|
$object->salary = GETPOST("salary", 'alphanohtml') != '' ? GETPOST("salary", 'alphanohtml') : '';
|
||||||
|
$object->salary = price2num($object->salary);
|
||||||
$object->salaryextra = GETPOST("salaryextra", 'alphanohtml') != '' ? GETPOST("salaryextra", 'alphanohtml') : '';
|
$object->salaryextra = GETPOST("salaryextra", 'alphanohtml') != '' ? GETPOST("salaryextra", 'alphanohtml') : '';
|
||||||
$object->weeklyhours = GETPOST("weeklyhours", 'alphanohtml') != '' ? GETPOST("weeklyhours", 'alphanohtml') : '';
|
$object->weeklyhours = GETPOST("weeklyhours", 'alphanohtml') != '' ? GETPOST("weeklyhours", 'alphanohtml') : '';
|
||||||
|
|
||||||
@ -394,10 +397,15 @@ if (empty($reshook)) {
|
|||||||
$object->employee = GETPOST('employee', 'int');
|
$object->employee = GETPOST('employee', 'int');
|
||||||
|
|
||||||
$object->thm = GETPOST("thm", 'alphanohtml') != '' ? GETPOST("thm", 'alphanohtml') : '';
|
$object->thm = GETPOST("thm", 'alphanohtml') != '' ? GETPOST("thm", 'alphanohtml') : '';
|
||||||
|
$object->thm = price2num($object->thm);
|
||||||
$object->tjm = GETPOST("tjm", 'alphanohtml') != '' ? GETPOST("tjm", 'alphanohtml') : '';
|
$object->tjm = GETPOST("tjm", 'alphanohtml') != '' ? GETPOST("tjm", 'alphanohtml') : '';
|
||||||
|
$object->thm = price2num($object->thm);
|
||||||
$object->salary = GETPOST("salary", 'alphanohtml') != '' ? GETPOST("salary", 'alphanohtml') : '';
|
$object->salary = GETPOST("salary", 'alphanohtml') != '' ? GETPOST("salary", 'alphanohtml') : '';
|
||||||
|
$object->salary = price2num($object->salary);
|
||||||
$object->salaryextra = GETPOST("salaryextra", 'alphanohtml') != '' ? GETPOST("salaryextra", 'alphanohtml') : '';
|
$object->salaryextra = GETPOST("salaryextra", 'alphanohtml') != '' ? GETPOST("salaryextra", 'alphanohtml') : '';
|
||||||
|
$object->salaryextra = price2num($object->salaryextra);
|
||||||
$object->weeklyhours = GETPOST("weeklyhours", 'alphanohtml') != '' ? GETPOST("weeklyhours", 'alphanohtml') : '';
|
$object->weeklyhours = GETPOST("weeklyhours", 'alphanohtml') != '' ? GETPOST("weeklyhours", 'alphanohtml') : '';
|
||||||
|
$object->weeklyhours = price2num($object->weeklyhours);
|
||||||
|
|
||||||
$object->color = GETPOST("color", 'alphanohtml') != '' ? GETPOST("color", 'alphanohtml') : '';
|
$object->color = GETPOST("color", 'alphanohtml') != '' ? GETPOST("color", 'alphanohtml') : '';
|
||||||
$dateemployment = dol_mktime(0, 0, 0, GETPOST('dateemploymentmonth', 'int'), GETPOST('dateemploymentday', 'int'), GETPOST('dateemploymentyear', 'int'));
|
$dateemployment = dol_mktime(0, 0, 0, GETPOST('dateemploymentmonth', 'int'), GETPOST('dateemploymentday', 'int'), GETPOST('dateemploymentyear', 'int'));
|
||||||
@ -657,7 +665,7 @@ if (empty($reshook)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
$trigger_name = 'USER_SENTBYMAIL';
|
$triggersendname = 'USER_SENTBYMAIL';
|
||||||
$paramname = 'id'; // Name of param key to open the card
|
$paramname = 'id'; // Name of param key to open the card
|
||||||
$mode = 'emailfromuser';
|
$mode = 'emailfromuser';
|
||||||
$trackid = 'use'.$id;
|
$trackid = 'use'.$id;
|
||||||
|
|||||||
@ -2124,7 +2124,7 @@ if (!GETPOST('hide_websitemenu'))
|
|||||||
}
|
}
|
||||||
elseif (empty($virtualurl))
|
elseif (empty($virtualurl))
|
||||||
{
|
{
|
||||||
$htmltext .= '<br><span class="error">'.$langs->trans("VirtualHostUrlNotDefined").'</span><br><br>';
|
//$htmltext .= '<br><span class="error">'.$langs->trans("VirtualHostUrlNotDefined").'</span><br><br>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -97,7 +97,7 @@ if (empty($reshook))
|
|||||||
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
||||||
|
|
||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
$trigger_name = 'WEBSITEACCOUNT_SENTBYMAIL';
|
$triggersendname = 'WEBSITEACCOUNT_SENTBYMAIL';
|
||||||
$autocopy = 'MAIN_MAIL_AUTOCOPY_WEBSITEACCOUNT_TO';
|
$autocopy = 'MAIN_MAIL_AUTOCOPY_WEBSITEACCOUNT_TO';
|
||||||
$trackid = 'websiteaccount'.$object->id;
|
$trackid = 'websiteaccount'.$object->id;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||||
|
|||||||
@ -138,7 +138,7 @@ if (empty($reshook))
|
|||||||
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
||||||
|
|
||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
$trigger_name = 'MYOBJECT_SENTBYMAIL';
|
$triggersendname = 'MYOBJECT_SENTBYMAIL';
|
||||||
$autocopy = 'MAIN_MAIL_AUTOCOPY_MYOBJECT_TO';
|
$autocopy = 'MAIN_MAIL_AUTOCOPY_MYOBJECT_TO';
|
||||||
$trackid = 'myobject'.$object->id;
|
$trackid = 'myobject'.$object->id;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||||
|
|||||||
@ -253,10 +253,11 @@ if ($resql) {
|
|||||||
$paymentstatic->fetch($links[$key]['url_id']);
|
$paymentstatic->fetch($links[$key]['url_id']);
|
||||||
$tmparray = $paymentstatic->getBillsArray('');
|
$tmparray = $paymentstatic->getBillsArray('');
|
||||||
if (is_array($tmparray)) {
|
if (is_array($tmparray)) {
|
||||||
foreach ($tmparray as $key => $val) {
|
foreach ($tmparray as $tmpkey => $tmpval) {
|
||||||
$invoicestatic->fetch($val);
|
$invoicestatic->fetch($tmpval);
|
||||||
if ($accountelem)
|
if ($accountelem) {
|
||||||
$accountelem .= ', ';
|
$accountelem .= ', ';
|
||||||
|
}
|
||||||
$accountelem .= $invoicestatic->ref;
|
$accountelem .= $invoicestatic->ref;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -264,28 +265,32 @@ if ($resql) {
|
|||||||
$paymentsupplierstatic->fetch($links[$key]['url_id']);
|
$paymentsupplierstatic->fetch($links[$key]['url_id']);
|
||||||
$tmparray = $paymentsupplierstatic->getBillsArray('');
|
$tmparray = $paymentsupplierstatic->getBillsArray('');
|
||||||
if (is_array($tmparray)) {
|
if (is_array($tmparray)) {
|
||||||
foreach ($tmparray as $key => $val) {
|
foreach ($tmparray as $tmpkey => $tmpval) {
|
||||||
$invoicesupplierstatic->fetch($val);
|
$invoicesupplierstatic->fetch($tmpval);
|
||||||
if ($accountelem)
|
if ($accountelem) {
|
||||||
$accountelem .= ', ';
|
$accountelem .= ', ';
|
||||||
|
}
|
||||||
$accountelem .= $invoicesupplierstatic->ref;
|
$accountelem .= $invoicesupplierstatic->ref;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elseif ($links[$key]['type'] == 'payment_sc') {
|
} elseif ($links[$key]['type'] == 'payment_sc') {
|
||||||
$paymentsocialcontributionstatic->fetch($links[$key]['url_id']);
|
$paymentsocialcontributionstatic->fetch($links[$key]['url_id']);
|
||||||
if ($accountelem)
|
if ($accountelem) {
|
||||||
$accountelem .= ', ';
|
$accountelem .= ', ';
|
||||||
|
}
|
||||||
$accountelem .= $langs->transnoentitiesnoconv("SocialContribution") . ' ' . $paymentsocialcontributionstatic->ref;
|
$accountelem .= $langs->transnoentitiesnoconv("SocialContribution") . ' ' . $paymentsocialcontributionstatic->ref;
|
||||||
} elseif ($links[$key]['type'] == 'payment_vat') {
|
} elseif ($links[$key]['type'] == 'payment_vat') {
|
||||||
$paymentvatstatic->fetch($links[$key]['url_id']);
|
$paymentvatstatic->fetch($links[$key]['url_id']);
|
||||||
if ($accountelem)
|
if ($accountelem) {
|
||||||
$accountelem .= ', ';
|
$accountelem .= ', ';
|
||||||
|
}
|
||||||
$accountelem .= $langs->transnoentitiesnoconv("VATPayments") . ' ' . $paymentvatstatic->ref;
|
$accountelem .= $langs->transnoentitiesnoconv("VATPayments") . ' ' . $paymentvatstatic->ref;
|
||||||
} elseif ($links[$key]['type'] == 'banktransfert') {
|
} elseif ($links[$key]['type'] == 'banktransfert') {
|
||||||
$comment = $outputlangs->transnoentitiesnoconv("Transfer");
|
$comment = $outputlangs->transnoentitiesnoconv("Transfer");
|
||||||
if ($objp->amount > 0) {
|
if ($objp->amount > 0) {
|
||||||
if ($comment)
|
if ($comment) {
|
||||||
$comment .= ' ';
|
$comment .= ' ';
|
||||||
|
}
|
||||||
$banklinestatic->fetch($links[$key]['url_id']);
|
$banklinestatic->fetch($links[$key]['url_id']);
|
||||||
$bankstatic->id = $banklinestatic->fk_account;
|
$bankstatic->id = $banklinestatic->fk_account;
|
||||||
$bankstatic->label = $banklinestatic->bank_account_label;
|
$bankstatic->label = $banklinestatic->bank_account_label;
|
||||||
@ -297,8 +302,9 @@ if ($resql) {
|
|||||||
$comment .= $bankstatic->getNomUrl(1, '');
|
$comment .= $bankstatic->getNomUrl(1, '');
|
||||||
$comment .= ')';
|
$comment .= ')';
|
||||||
} else {
|
} else {
|
||||||
if ($comment)
|
if ($comment) {
|
||||||
$comment .= ' ';
|
$comment .= ' ';
|
||||||
|
}
|
||||||
$bankstatic->id = $objp->bankid;
|
$bankstatic->id = $objp->bankid;
|
||||||
$bankstatic->label = $objp->bankref;
|
$bankstatic->label = $objp->bankref;
|
||||||
$comment .= ' (' . $langs->transnoentitiesnoconv("from") . ' ';
|
$comment .= ' (' . $langs->transnoentitiesnoconv("from") . ' ';
|
||||||
@ -311,13 +317,15 @@ if ($resql) {
|
|||||||
$comment .= ')';
|
$comment .= ')';
|
||||||
}
|
}
|
||||||
} elseif ($links[$key]['type'] == 'company') {
|
} elseif ($links[$key]['type'] == 'company') {
|
||||||
if ($thirdparty)
|
if ($thirdparty) {
|
||||||
$thirdparty .= ', ';
|
$thirdparty .= ', ';
|
||||||
|
}
|
||||||
$thirdparty .= dol_trunc($links[$key]['label'], 24);
|
$thirdparty .= dol_trunc($links[$key]['label'], 24);
|
||||||
$newline = 0;
|
$newline = 0;
|
||||||
} elseif ($links[$key]['type'] == 'member') {
|
} elseif ($links[$key]['type'] == 'member') {
|
||||||
if ($thirdparty)
|
if ($thirdparty) {
|
||||||
$accountelem .= ', ';
|
$accountelem .= ', ';
|
||||||
|
}
|
||||||
$thirdparty .= $links[$key]['label'];
|
$thirdparty .= $links[$key]['label'];
|
||||||
$newline = 0;
|
$newline = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2016 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2016 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
|
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.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
|
||||||
@ -90,6 +91,8 @@ if ($resql) {
|
|||||||
$emailing = new Mailing($db);
|
$emailing = new Mailing($db);
|
||||||
$emailing->fetch($obj->rowid);
|
$emailing->fetch($obj->rowid);
|
||||||
|
|
||||||
|
$upload_dir = $conf->mailing->dir_output . "/" . get_exdir($emailing->id, 2, 0, 1, $emailing, 'mailing');
|
||||||
|
|
||||||
$id = $emailing->id;
|
$id = $emailing->id;
|
||||||
$subject = $emailing->sujet;
|
$subject = $emailing->sujet;
|
||||||
$message = $emailing->body;
|
$message = $emailing->body;
|
||||||
@ -228,9 +231,25 @@ if ($resql) {
|
|||||||
|
|
||||||
$substitutionisok = true;
|
$substitutionisok = true;
|
||||||
|
|
||||||
|
$arr_file = array();
|
||||||
|
$arr_mime = array();
|
||||||
|
$arr_name = array();
|
||||||
|
$arr_css = array();
|
||||||
|
|
||||||
|
$listofpaths=dol_dir_list($upload_dir, 'all', 0, '', '', 'name', SORT_ASC, 0);
|
||||||
|
|
||||||
|
if (count($listofpaths))
|
||||||
|
{
|
||||||
|
foreach($listofpaths as $key => $val)
|
||||||
|
{
|
||||||
|
$arr_file[]=$listofpaths[$key]['fullname'];
|
||||||
|
$arr_mime[]=dol_mimetype($listofpaths[$key]['name']);
|
||||||
|
$arr_name[]=$listofpaths[$key]['name'];
|
||||||
|
}
|
||||||
|
}
|
||||||
// Fabrication du mail
|
// Fabrication du mail
|
||||||
$trackid = 'emailing-' . $obj->fk_mailing . '-' . $obj->rowid;
|
$trackid = 'emailing-' . $obj->fk_mailing . '-' . $obj->rowid;
|
||||||
$mail = new CMailFile($newsubject, $sendto, $from, $newmessage, array(), array(), array(), '', '', 0, $msgishtml, $errorsto, '', $trackid, '', 'emailing');
|
$mail = new CMailFile($newsubject, $sendto, $from, $newmessage, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $errorsto, $arr_css, $trackid, '', 'emailing');
|
||||||
|
|
||||||
if ($mail->error) {
|
if ($mail->error) {
|
||||||
$res = 0;
|
$res = 0;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user