Merge remote-tracking branch 'upstream/develop' into actioncomm_category

This commit is contained in:
Frédéric FRANCE 2019-12-03 17:56:43 +01:00
commit 4c5c6b6ff1
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
134 changed files with 4371 additions and 4234 deletions

View File

@ -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
define('QR_FIND_FROM_RANDOM', 2);
with

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -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';
// 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');
$cancel = GETPOST('cancel', 'alpha');
@ -822,7 +822,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
// Actions to send emails
$trigger_name = 'MEMBER_SENTBYMAIL';
$triggersendname = 'MEMBER_SENTBYMAIL';
$paramname = 'id';
$mode = 'emailfrommember';
$trackid = 'mem'.$object->id;

View File

@ -95,7 +95,7 @@ if ($action == 'update' && empty($_POST["cancel"]))
// Actions to send emails
$id = 0;
$actiontypecode = ''; // Not an event for agenda
$trigger_name = ''; // Disable triggers
$triggersendname = ''; // Disable triggers
$paramname = 'id';
$mode = 'emailfortest';
$trackid = (($action == 'testhtml') ? "testhtml" : "test");

View File

@ -77,7 +77,7 @@ if ($action == 'update' && empty($_POST["cancel"]))
// Actions to send emails
$id=0;
$actiontypecode=''; // Not an event for agenda
$trigger_name=''; // Disable triggers
$triggersendname = ''; // Disable triggers
$paramname='id';
$mode='emailfortest';
$trackid=(($action == 'testhtml')?"testhtml":"test");

View File

@ -97,7 +97,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails
$trigger_name = 'ASSET_SENTBYMAIL';
$triggersendname = 'ASSET_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_ASSET_TO';
$trackid = 'asset'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';

View File

@ -46,7 +46,7 @@ function blockedlogadmin_prepare_head()
$b=new BlockedLog($db);
if ($b->alreadyUsed())
{
$head[$h][1].=' <span class="badge">...</span>';
$head[$h][1].='<span class="badge marginleftonlyshort">...</span>';
}
$head[$h][2] = 'fingerprints';
$h++;

View File

@ -119,7 +119,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
// Actions to send emails
$trigger_name = 'BOM_SENTBYMAIL';
$triggersendname = 'BOM_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_BOM_TO';
$trackid = 'bom'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';

View File

@ -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_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'),
//'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,),
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,),
);

View File

@ -72,6 +72,7 @@ $coldisplay++;
$tmpproduct = new Product($object->db);
$tmpproduct->fetch($line->fk_product);
print $tmpproduct->getNomUrl(1);
print ' - '.$tmpproduct->label;
print '</td>';
print '<td class="linecolqty nowrap right">';
$coldisplay++;

View File

@ -695,7 +695,7 @@ if ($object->id > 0)
print '<table class="noborder centpercent lastrecordtable">';
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 '</tr></table></td>';
print '</tr>';
@ -780,7 +780,7 @@ if ($object->id > 0)
print '<table class="noborder centpercent lastrecordtable">';
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>';
//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>';
@ -856,7 +856,7 @@ if ($object->id > 0)
print '<table class="noborder centpercent lastrecordtable">';
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 '</tr></table></td>';
print '</tr>';
@ -921,7 +921,7 @@ if ($object->id > 0)
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 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 '</tr></table></td>';
print '</tr>';
@ -990,7 +990,7 @@ if ($object->id > 0)
print '<table class="noborder centpercent lastrecordtable">';
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 '</tr></table></td>';
print '</tr>';
@ -1063,7 +1063,7 @@ if ($object->id > 0)
print '<table class="noborder centpercent lastrecordtable">';
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>';
}
@ -1168,7 +1168,7 @@ if ($object->id > 0)
print '<table class="noborder centpercent lastrecordtable">';
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 '</tr></table></td>';
print '</tr>';

View File

@ -251,7 +251,7 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
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)
{
@ -333,7 +333,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
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)
{
@ -422,7 +422,7 @@ if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande-
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
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)
{

View File

@ -781,7 +781,7 @@ if (empty($reshook))
// Actions to send emails
$actiontypecode = 'AC_OTH_AUTO';
$trigger_name = 'PROPAL_SENTBYMAIL';
$triggersendname = 'PROPAL_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_PROPOSAL_TO';
$trackid = 'pro'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';

View File

@ -2501,11 +2501,11 @@ class Propal extends CommonObject
if ($resql)
{
$modelpdf = $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED ? $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED : $this->modelpdf;
$trigger_name = 'PROPAL_CLOSE_REFUSED';
$triggerName = 'PROPAL_CLOSE_REFUSED';
if ($statut == self::STATUS_SIGNED)
{
$trigger_name = 'PROPAL_CLOSE_SIGNED';
$triggerName = 'PROPAL_CLOSE_SIGNED';
$modelpdf = $conf->global->PROPALE_ADDON_PDF_ODT_TOBILL ? $conf->global->PROPALE_ADDON_PDF_ODT_TOBILL : $this->modelpdf;
// The connected company is classified as a client
@ -2522,7 +2522,7 @@ class Propal extends CommonObject
}
if ($statut == self::STATUS_BILLED) // Why this ?
{
$trigger_name = 'PROPAL_CLASSIFY_BILLED';
$triggerName = 'PROPAL_CLASSIFY_BILLED';
}
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
@ -2550,7 +2550,7 @@ class Propal extends CommonObject
if (!$notrigger && empty($error))
{
// Call trigger
$result = $this->call_trigger($trigger_name, $user);
$result = $this->call_trigger($triggerName, $user);
if ($result < 0) { $error++; }
// End call triggers
}

View File

@ -62,10 +62,12 @@ if ($action == 'confirm_split' && GETPOST("confirm") == 'yes')
//if ($user->rights->facture->creer)
$amount_ttc_1 = GETPOST('amount_ttc_1');
$amount_ttc_1 = price2num($amount_ttc_1);
$amount_ttc_2 = GETPOST('amount_ttc_2');
$amount_ttc_2 = price2num($amount_ttc_2);
$error = 0;
$remid = GETPOST("remid") ?GETPOST("remid") : 0;
$remid = (GETPOST("remid", 'int') ? GETPOST("remid", 'int') : 0);
$discount = new DiscountAbsolute($db);
$res = $discount->fetch($remid);
if (!$res > 0)

View File

@ -1415,7 +1415,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
// Actions to send emails
$trigger_name = 'ORDER_SENTBYMAIL';
$triggersendname = 'ORDER_SENTBYMAIL';
$paramname = 'id';
$autocopy = 'MAIN_MAIL_AUTOCOPY_ORDER_TO'; // used to know the automatic BCC to add
$trackid = 'ord'.$object->id;

View File

@ -223,7 +223,7 @@ if (empty($reshook))
$permissiontoread = $user->rights->commande->lire;
$permissiontodelete = $user->rights->commande->supprimer;
$uploaddir = $conf->commande->multidir_output[$conf->entity];
$trigger_name = 'ORDER_SENTBYMAIL';
$triggersendname = 'ORDER_SENTBYMAIL';
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}

View File

@ -2481,7 +2481,7 @@ if (empty($reshook))
// Actions to send emails
if (empty($id)) $id = $facid;
$trigger_name = 'BILL_SENTBYMAIL';
$triggersendname = 'BILL_SENTBYMAIL';
$paramname = 'id';
$autocopy = 'MAIN_MAIL_AUTOCOPY_INVOICE_TO';
$trackid = 'inv'.$object->id;

View File

@ -170,7 +170,7 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
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)
{
$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 '<table class="noborder centpercent">';
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)
{
$companystatic = new Societe($db);

View File

@ -482,7 +482,7 @@ if (empty($reshook))
}
// Actions to send emails
$trigger_name = 'CONTACT_SENTBYMAIL';
$triggersendname = 'CONTACT_SENTBYMAIL';
$paramname = 'id';
$mode = 'emailfromcontact';
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';

View File

@ -1002,7 +1002,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
// Actions to send emails
$trigger_name = 'CONTRACT_SENTBYMAIL';
$triggersendname = 'CONTRACT_SENTBYMAIL';
$paramname = 'id';
$mode = 'emailfromcontract';
$trackid = 'con'.$object->id;

View File

@ -260,7 +260,7 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire)
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
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)
{
$companystatic = new Societe($db);

View File

@ -26,7 +26,7 @@
// $id must be defined
// $paramname may be defined
// $autocopy may be defined (used to know the automatic BCC to add)
// $trigger_name must be set (can be '')
// $triggersendname must be set (can be '')
// $actiontypecode can be set
// $object and $uobject may be defined
@ -453,12 +453,12 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
$object->email_subject = $subject;
$object->email_msgid = $mailfile->msgid;
// Call of triggers
if (! empty($trigger_name))
// Call of triggers (you should have set $triggersendname to execute trigger. $trigger_name is deprcated)
if (! empty($triggersendname) || ! empty($trigger_name))
{
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($db);
$result=$interface->run_triggers($trigger_name, $object, $user, $langs, $conf);
$result=$interface->run_triggers(empty($triggersendname)?$trigger_name:$triggersendname, $object, $user, $langs, $conf);
if ($result < 0) {
setEventMessages($interface->error, $interface->errors, 'errors');
}

View File

@ -296,6 +296,30 @@ if ($type == 'directory')
$perm=($user->rights->website->write || $user->rights->emailing->creer);
$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
{
$useinecm = 5;

View File

@ -4956,11 +4956,11 @@ abstract class CommonObject
* NB: Error from trigger are stacked in interface->errors
* NB2: If return code of triggers are < 0, action calling trigger should cancel all transaction.
*
* @param string $trigger_name trigger's name to execute
* @param string $triggerName trigger's name to execute
* @param User $user Object user
* @return int Result of run_triggers
*/
public function call_trigger($trigger_name, $user)
public function call_trigger($triggerName, $user)
{
// phpcs:enable
global $langs, $conf;
@ -4972,7 +4972,7 @@ abstract class CommonObject
include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php';
$interface = new Interfaces($this->db);
$result = $interface->run_triggers($trigger_name, $this, $user, $langs, $conf);
$result = $interface->run_triggers($triggerName, $this, $user, $langs, $conf);
if ($result < 0)
{

View File

@ -689,6 +689,11 @@ class DiscountAbsolute
global $langs;
$result='';
$link = '';
$linkend = '';
$label = '';
$picto = '';
$ref = '';
if ($option == 'invoice') {
$facid=! empty($this->discount_type)?$this->fk_invoice_supplier_source:$this->fk_facture_source;

View File

@ -228,6 +228,7 @@ class Form
elseif (preg_match('/^select;/', $typeofdata))
{
$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
$arraylist = array();
foreach ($arraydata as $val)
{
$tmp = explode(':', $val);
@ -265,6 +266,7 @@ class Form
elseif (preg_match('/^select;/', $typeofdata))
{
$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
$arraylist = array();
foreach ($arraydata as $val)
{
$tmp = explode(':', $val);
@ -4869,7 +4871,7 @@ class Form
* @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 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)
{

View File

@ -1099,7 +1099,7 @@ class FormFile
if ($disablecrop == -1)
{
$disablecrop = 1;
if (in_array($modulepart, array('bank', 'bom', 'expensereport', 'holiday', 'member', 'project', 'product', 'produit', 'service', 'societe', 'tax', 'ticket', 'user'))) $disablecrop = 0;
if (in_array($modulepart, array('bank', 'bom', 'expensereport', 'holiday', 'member', 'mrp', 'project', 'product', 'produit', 'service', 'societe', 'tax', 'ticket', 'user'))) $disablecrop = 0;
}
// Define relative path used to store the file

View File

@ -341,6 +341,7 @@ class Notify
$object_type = '';
$link = '';
$num = 0;
$error = 0;
$oldref=(empty($object->oldref)?$object->ref:$object->oldref);
$newref=(empty($object->newref)?$object->ref:$object->newref);

View File

@ -486,7 +486,7 @@ function actions_prepare_head($object)
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/comm/action/document.php?id='.$object->id;
$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';
$h++;

View File

@ -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][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';
$h++;

View File

@ -228,7 +228,7 @@ function societe_prepare_head(Societe $object)
$head[$h][0] = DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.$object->id;
$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>';
$head[$h][2] = 'rib';
$h++;

View File

@ -7896,23 +7896,26 @@ function dol_mimetype($file, $default = 'application/octet-stream', $mode = 0)
$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('/\.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('/\.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('/\.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'; }
// Certificate files
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('/\.(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
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('/\.(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('/\.(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'; }

View File

@ -111,7 +111,7 @@ function project_prepare_head($object)
if (!empty($object->note_public)) $nbNote++;
$head[$h][0] = DOL_URL_ROOT.'/projet/note.php?id='.$object->id;
$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';
$h++;
}
@ -2071,18 +2071,23 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide
else {
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').'" >';
if ($task->duration_effective) $out .= convertSecondToTime($task->duration_effective, $timespentoutputformat);
else $out .= '--:--';
$out .= '</b>';
$out .= '</a>';
$out .= '/';
$out .= '<a href="'.$url.'" >';
$out .= '<span title="'.$langs->trans('PlannedWorkload').'" >';
if ($task->planned_workload) $out .= convertSecondToTime($task->planned_workload, $plannedworkloadoutputformat);
else $out .= '--:--';
$out .= '</a>';
}
$out .= ' </span>';
}

View File

@ -510,6 +510,7 @@ class ExportExcel extends ModeleExports
{
$c = intval($c);
$letter = '';
if ($c <= 0) {
return '';
}

View File

@ -62,11 +62,11 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder
*/
public function info()
{
global $conf, $langs;
global $conf, $langs, $db;
$langs->load("bills");
$form = new Form($this->db);
$form = new Form($db);
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
$texte .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';

View File

@ -150,6 +150,8 @@ class modStripe extends DolibarrModules
'target' => '',
'user' => 0
);
$r++;
$this->menu[$r] = array(
'fk_menu' => 'fk_mainmenu=bank,fk_leftmenu=stripe',
'type' => 'left',

View File

@ -189,7 +189,7 @@ class modWebsite extends DolibarrModules
$src=$srcroot.'/'.$cursorfile['name'];
$dest=$destroot.'/'.$cursorfile['name'];
$result=dol_copy($src, $dest, 0, 0);
$result=dol_copy($src, $dest, 0, 1); // For full zip templates, we overwrite old existing files
if ($result < 0) {
$langs->load("errors");
$this->error=$langs->trans('ErrorFailToCopyFile', $src, $dest);

View File

@ -64,11 +64,11 @@ class mod_propale_saphir extends ModeleNumRefPropales
*/
public function info()
{
global $conf, $langs;
global $conf, $langs, $db;
$langs->load("bills");
$form = new Form($this->db);
$form = new Form($db);
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
$texte .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';

View File

@ -1,5 +1,6 @@
<?php
/* 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
* 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()
{
global $conf,$langs;
global $conf, $langs, $db;
$langs->load("bills");
$form = new Form($this->db);
$form = new Form($db);
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';

View File

@ -825,7 +825,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
}
// Escompte
if ($object->close_code == Facture::CLOSECODE_DISCOUNTVAT)
if ($object->close_code == FactureFournisseur::CLOSECODE_DISCOUNTVAT)
{
$index++;
$pdf->SetFillColor(255, 255, 255);

View File

@ -64,11 +64,11 @@ class mod_supplier_proposal_saphir extends ModeleNumRefSupplierProposal
*/
public function info()
{
global $conf, $langs;
global $conf, $langs, $db;
$langs->load("bills");
$form = new Form($this->db);
$form = new Form($db);
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';

View File

@ -210,6 +210,17 @@ elseif ($modulepart == 'bom')
$dir = $conf->$modulepart->dir_output; // By default
}
}
elseif ($modulepart == 'mrp')
{
require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php';
$object = new MO($db);
if ($id > 0)
{
$result = $object->fetch($id);
if ($result <= 0) dol_print_error($db, 'Failed to load object');
$dir = $conf->$modulepart->dir_output; // By default
}
}
elseif ($modulepart == 'bank')
{
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
@ -222,7 +233,7 @@ elseif ($modulepart == 'bank')
}
}
else {
print 'Action crop for modulepart = '.$modulepart.' is not supported yet.';
print 'Action crop for modulepart = '.$modulepart.' is not supported yet by photos_resize.php.';
}
if (empty($backtourl))
@ -237,6 +248,7 @@ 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('user'))) $backtourl = DOL_URL_ROOT."/user/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
elseif (in_array($modulepart, array('bank'))) $backtourl = DOL_URL_ROOT."/compta/bank/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
elseif (in_array($modulepart, array('mrp'))) $backtourl = DOL_URL_ROOT."/mrp/mo_document.php?id=".$id.'&file='.urldecode($_POST["file"]);
else $backtourl = DOL_URL_ROOT."/".$modulepart."/".$modulepart."_document.php?id=".$id.'&file='.urldecode($_POST["file"]);
}

View File

@ -81,7 +81,7 @@ if ($permtoadd)
else
{
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>';
}
if ($module == 'ecm')

View File

@ -795,18 +795,18 @@ class EcmDirectory // extends CommonObject
* NB2: if trigger fail, action should be canceled.
* NB3: Should be deleted if EcmDirectory extend CommonObject
*
* @param string $trigger_name trigger's name to execute
* @param string $triggerName trigger's name to execute
* @param User $user Object user
* @return int Result of run_triggers
*/
public function call_trigger($trigger_name, $user)
public function call_trigger($triggerName, $user)
{
// phpcs:enable
global $langs,$conf;
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($this->db);
$result=$interface->run_triggers($trigger_name, $this, $user, $langs, $conf);
$result=$interface->run_triggers($triggerName, $this, $user, $langs, $conf);
if ($result < 0) {
if (!empty($this->errors))
{

View File

@ -849,7 +849,7 @@ if (empty($reshook))
// Actions to send emails
if (empty($id)) $id = $facid;
$trigger_name = 'SHIPPING_SENTBYMAIL';
$triggersendname = 'SHIPPING_SENTBYMAIL';
$paramname = 'id';
$mode = 'emailfromshipment';
$trackid = 'shi'.$object->id;

View File

@ -1411,7 +1411,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails
$trigger_name = 'EXPENSEREPORT_SENTBYMAIL';
$triggersendname = 'EXPENSEREPORT_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_EXPENSEREPORT_TO';
$trackid = 'exp'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
@ -2148,12 +2148,15 @@ else
if ($action != 'editline' || $line->rowid != GETPOST('rowid', 'int'))
{
print '<tr class="oddeven">';
// Num
print '<td class="center">';
print $numline;
print '</td>';
// Date
print '<td class="center">'.dol_print_date($db->jdate($line->date), 'day').'</td>';
// Project
if (!empty($conf->projet->enabled))
{

View File

@ -721,7 +721,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails
$trigger_name = 'FICHINTER_SENTBYMAIL';
$triggersendname = 'FICHINTER_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_FICHINTER_TO';
$trackid = 'int'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';

View File

@ -468,7 +468,7 @@ if ($object->id > 0)
print '<table class="noborder centpercent lastrecordtable">';
print '<tr class="liste_titre'.(($num == 0) ? ' nobottom' : '').'">';
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>';
$return = array();
@ -542,7 +542,7 @@ if ($object->id > 0)
print '<tr class="liste_titre">';
print '<td colspan="3">';
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 '</tr></table>';
print '</td></tr>';
@ -653,7 +653,7 @@ if ($object->id > 0)
print '<tr class="liste_titre">';
print '<td colspan="3">';
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 '</tr></table>';
print '</td></tr>';
@ -725,7 +725,7 @@ if ($object->id > 0)
print '<tr class="liste_titre">';
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 '</tr></table>';
print '</td></tr>';

View File

@ -2420,18 +2420,19 @@ class CommandeFournisseur extends CommonOrder
if ($resql)
{
// Trigger names for each status
$trigger_name[0] = 'DRAFT';
$trigger_name[1] = 'VALIDATED';
$trigger_name[2] = 'APPROVED';
$trigger_name[3] = 'ORDERED'; // Ordered
$trigger_name[4] = 'RECEIVED_PARTIALLY';
$trigger_name[5] = 'RECEIVED_COMPLETELY';
$trigger_name[6] = 'CANCELED';
$trigger_name[7] = 'CANCELED';
$trigger_name[9] = 'REFUSED';
$triggerName = array();
$triggerName[0] = 'DRAFT';
$triggerName[1] = 'VALIDATED';
$triggerName[2] = 'APPROVED';
$triggerName[3] = 'ORDERED'; // Ordered
$triggerName[4] = 'RECEIVED_PARTIALLY';
$triggerName[5] = 'RECEIVED_COMPLETELY';
$triggerName[6] = 'CANCELED';
$triggerName[7] = 'CANCELED';
$triggerName[9] = 'REFUSED';
// Call trigger
$result = $this->call_trigger("ORDER_SUPPLIER_STATUS_".$trigger_name[$status], $user);
$result = $this->call_trigger("ORDER_SUPPLIER_STATUS_".$triggerName[$status], $user);
if ($result < 0) { $error++; }
// End call triggers
}

View File

@ -1028,7 +1028,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails
$trigger_name = 'ORDER_SUPPLIER_SENTBYMAIL';
$triggersendname = 'ORDER_SUPPLIER_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO';
$trackid = 'sor'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';

View File

@ -1497,7 +1497,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails
$trigger_name = 'BILL_SUPPLIER_SENTBYMAIL';
$triggersendname = 'BILL_SUPPLIER_SENTBYMAIL';
$paramname = 'id';
$autocopy = 'MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO';
$trackid = 'sin'.$object->id;

View File

@ -872,7 +872,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails
$trigger_name='HOLIDAY_SENTBYMAIL';
$triggersendname = 'HOLIDAY_SENTBYMAIL';
$autocopy='MAIN_MAIL_AUTOCOPY_HOLIDAY_TO';
$trackid='leav'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';

View File

@ -1807,17 +1807,29 @@ class TCPDF_STATIC {
/**
* Wrapper to use fopen only with local files
* @param filename (string) Name of the file to open
* @param $mode (string)
* @return Returns a file pointer resource on success, or FALSE on error.
* @param string $filename The full path to the file to open
* @param string $mode Acceses type for the file ('r', 'r+', 'w', 'w+', 'a', 'a+', 'x', 'x+', 'c', 'c+' or 'e')
* @return resource Returns a file pointer resource on success, or FALSE on error.
* @public static
*/
public static function fopenLocal($filename, $mode) {
if (strpos($filename, '://') === false) {
public static function fopenLocal($filename, $mode)
{
if (strpos($filename, '//') === 0)
{
// Share folder on a (windows) server
// e.g.: "//[MyServerName]/[MySharedFolder]/"
//
// nothing to change
}
elseif (strpos($filename, '://') === false)
{
$filename = 'file://'.$filename;
} elseif (stream_is_local($filename) !== true) {
}
elseif (stream_is_local($filename) !== true)
{
return false;
}
return fopen($filename, $mode);
}

View File

@ -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;
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_bomline ADD COLUMN position integer NOT NULL DEFAULT 0;
ALTER TABLE llx_bom_bomline ADD COLUMN qty_frozen smallint DEFAULT 0;

View File

@ -26,8 +26,8 @@ CREATE TABLE llx_bom_bom(
note_private text,
fk_warehouse integer,
qty double(24,8),
efficiency double(8,4) DEFAULT 1,
duration double(8,4) DEFAULT NULL,
efficiency double(24,8) DEFAULT 1,
duration double(24,8) DEFAULT NULL,
date_creation datetime NOT NULL,
date_valid datetime,
tms timestamp,

View File

@ -24,7 +24,7 @@ CREATE TABLE llx_bom_bomline(
qty double(24,8) NOT NULL,
qty_frozen 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
-- END MODULEBUILDER FIELDS
) ENGINE=innodb;

View File

@ -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.
GeneratedPasswordDesc=Choose the method to be used for auto-generated passwords.
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.
LimitsSetup=Limits/Precision setup
LimitsDesc=You can define limits, precisions and optimizations used by Dolibarr here

View File

@ -160,7 +160,7 @@ if (empty($reshook))
}
// Actions to send emails
$trigger_name = 'MYOBJECT_SENTBYMAIL';
$triggersendname = 'MYOBJECT_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_MYOBJECT_TO';
$trackid = 'myobject'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';

View File

@ -231,7 +231,19 @@ class Mo extends CommonObject
*/
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;
}
/**

View File

@ -146,7 +146,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails
$trigger_name = 'MO_SENTBYMAIL';
$triggersendname = 'MO_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_MO_TO';
$trackid = 'mo'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';

View File

@ -133,7 +133,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails
$trigger_name = 'MO_SENTBYMAIL';
$triggersendname = 'MO_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_MO_TO';
$trackid = 'mo'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';

View File

@ -30,8 +30,8 @@ if (empty($conf) || ! is_object($conf))
print '<tr class="oddeven'.(empty($this->tpl['strike'])?'':' strikefordisabled').'">';
print '<td>'.$this->tpl['label'].'</td>';
print '<td class="right">'.$this->tpl['qty'].'</td>';
print '<td class="center">'.yn($this->tpl['qty_frozen']).'</td>';
print '<td class="center">'.yn($this->tpl['disable_stock_change']).'</td>';
print '<td class="center">'.($this->tpl['qty_frozen'] ? yn($this->tpl['qty_frozen']) : '').'</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>';
$selected=1;

View File

@ -1122,31 +1122,19 @@ class Product extends CommonObject
/**
* 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
* @return int < 0 if KO, 0 = Not possible, > 0 if OK
*/
public function delete(User $user, $notrigger = 0)
{
// Deprecation warning
if ($id > 0) {
dol_syslog(__METHOD__." with parameter is deprecated", LOG_WARNING);
}
global $conf, $langs;
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$error = 0;
// Clean parameters
if (empty($id)) {
$id = $this->id;
} else {
$this->fetch($id);
}
// Check parameters
if (empty($id)) {
if (empty($this->id)) {
$this->error = "Object must be fetched before calling delete";
return -1;
}
@ -1155,14 +1143,15 @@ class Product extends CommonObject
return 0;
}
$objectisused = $this->isObjectUsed($id);
$objectisused = $this->isObjectUsed($this->id);
if (empty($objectisused)) {
$this->db->begin();
if (!$error && empty($notrigger)) {
// Call trigger
$result = $this->call_trigger('PRODUCT_DELETE', $user);
if ($result < 0) { $error++;
if ($result < 0) {
$error++;
}
// End call triggers
}
@ -1172,7 +1161,7 @@ class Product extends CommonObject
$sql = "DELETE FROM ".MAIN_DB_PREFIX.'product_batch';
$sql .= " WHERE fk_product_stock IN (";
$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);
if (!$result) {
@ -1188,7 +1177,7 @@ class Product extends CommonObject
{
if (!$error) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$table;
$sql .= " WHERE fk_product = ".$id;
$sql .= " WHERE fk_product = ".(int) $this->id;
$result = $this->db->query($sql);
if (!$result) {
@ -1206,7 +1195,7 @@ class Product extends CommonObject
//If it is a parent product, then we remove the association with child products
$prodcomb = new ProductCombination($this->db);
if ($prodcomb->deleteByFkProductParent($user, $id) < 0) {
if ($prodcomb->deleteByFkProductParent($user, $this->id) < 0) {
$error++;
$this->errors[] = 'Error deleting combinations';
}
@ -1221,7 +1210,7 @@ class Product extends CommonObject
// Delete from product_association
if (!$error) {
$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);
if (!$result) {
@ -1233,7 +1222,7 @@ class Product extends CommonObject
// Delete product
if (!$error) {
$sqlz = "DELETE FROM ".MAIN_DB_PREFIX."product";
$sqlz .= " WHERE rowid = ".$id;
$sqlz .= " WHERE rowid = ".(int) $this->id;
$resultz = $this->db->query($sqlz);
if (!$resultz) {
@ -1308,7 +1297,7 @@ class Product extends CommonObject
$sql = "SELECT rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."product_lang";
$sql .= " WHERE fk_product=".$this->id;
$sql .= " AND lang='".$key."'";
$sql .= " AND lang='".$this->db->escape($key)."'";
$result = $this->db->query($sql);
@ -1330,7 +1319,8 @@ class Product extends CommonObject
$sql2 .= ")";
$sql2 .= " VALUES(".$this->id.",'".$this->db->escape($key)."','".$this->db->escape($this->label)."',";
$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 .= ")";
}
@ -1344,7 +1334,7 @@ class Product extends CommonObject
$sql = "SELECT rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."product_lang";
$sql .= " WHERE fk_product=".$this->id;
$sql .= " AND lang='".$key."'";
$sql .= " AND lang='".$this->db->escape($key)."'";
$result = $this->db->query($sql);
@ -1354,7 +1344,8 @@ class Product extends CommonObject
$sql2 .= " SET ";
$sql2 .= " label='".$this->db->escape($this->multilangs["$key"]["label"])."',";
$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)."'";
}
@ -1366,7 +1357,8 @@ class Product extends CommonObject
$sql2 .= ")";
$sql2 .= " VALUES(".$this->id.",'".$this->db->escape($key)."','".$this->db->escape($this->multilangs["$key"]["label"])."',";
$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 .= ")";
}

View File

@ -112,7 +112,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails
/*$trigger_name='MYOBJECT_SENTBYMAIL';
/*$triggersendname = 'MYOBJECT_SENTBYMAIL';
$autocopy='MAIN_MAIL_AUTOCOPY_MYOBJECT_TO';
$trackid='myobject'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';*/

View File

@ -119,7 +119,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails
/*$trigger_name='MYOBJECT_SENTBYMAIL';
/*$triggersendname = 'MYOBJECT_SENTBYMAIL';
$autocopy='MAIN_MAIL_AUTOCOPY_MYOBJECT_TO';
$trackid='myobject'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';*/

View File

@ -152,7 +152,14 @@ if ($action == 'order' && isset($_POST['valid']))
{
$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))
{
// TODO Get desc in language of thirdparty

View File

@ -456,7 +456,7 @@ if (empty($reshook))
}
// Actions to send emails
$trigger_name = 'PROJECT_SENTBYMAIL';
$triggersendname = 'PROJECT_SENTBYMAIL';
$paramname = 'id';
$autocopy = 'MAIN_MAIL_AUTOCOPY_PROJECT_TO'; // used to know the automatic BCC to add
$trackid = 'proj'.$object->id;

View File

@ -198,7 +198,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
//$object->doActions($action);
// Actions to send emails (for ticket, we need to manage the addfile and removefile only)
$trigger_name = 'TICKET_SENTBYMAIL';
$triggersendname = 'TICKET_SENTBYMAIL';
$paramname = 'id';
$autocopy = 'MAIN_MAIL_AUTOCOPY_TICKET_TO'; // used to know the automatic BCC to add
$trackid = 'tic'.$object->id;

View File

@ -688,7 +688,7 @@ if (empty($reshook))
// Actions to send emails
if (empty($id)) $id = $facid;
$trigger_name = 'RECEPTION_SENTBYMAIL';
$triggersendname = 'RECEPTION_SENTBYMAIL';
$paramname = 'id';
$mode = 'emailfromreception';
$trackid = 'shi'.$object->id;

View File

@ -862,7 +862,7 @@ if (empty($reshook))
$object->fetch($socid);
// Actions to send emails
$trigger_name = 'COMPANY_SENTBYMAIL';
$triggersendname = 'COMPANY_SENTBYMAIL';
$paramname = 'socid';
$mode = 'emailfromthirdparty';
$trackid = 'thi'.$object->id;

View File

@ -106,7 +106,6 @@ if (!$rowid) {
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("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 "</tr>\n";
@ -204,7 +203,6 @@ if (!$rowid) {
print '<td>'.$payout->description.'</td>';
// Amount
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
print "<td class='right'>";
if ($payout->status == 'paid') {

View File

@ -105,7 +105,7 @@ if (!$rowid) {
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("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";

View File

@ -491,7 +491,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails
$trigger_name = 'PROPOSAL_SUPPLIER_SENTBYMAIL';
$triggersendname = 'PROPOSAL_SUPPLIER_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO';
$trackid = 'spr'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';

View File

@ -1729,11 +1729,11 @@ class SupplierProposal extends CommonObject
if ($resql)
{
$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)
{
$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;
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)
{
$trigger_name='SUPPLIER_PROPOSAL_CLASSIFY_BILLED';
$triggerName='SUPPLIER_PROPOSAL_CLASSIFY_BILLED';
}
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
@ -1760,7 +1760,7 @@ class SupplierProposal extends CommonObject
}
// Call trigger
$result=$this->call_trigger($trigger_name, $user);
$result=$this->call_trigger($triggerName, $user);
if ($result < 0) { $error++; }
// End call triggers

View File

@ -43,7 +43,7 @@ $id = GETPOST('id', 'int');
* View
*/
if ($action == "getProducts") {
if ($action == 'getProducts') {
$object = new Categorie($db);
$result = $object->fetch($category);
if ($result > 0)
@ -65,7 +65,7 @@ if ($action == "getProducts") {
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.
$filteroncategids = '';
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';
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').')';
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 .= natural_search(array('ref', 'label', 'barcode'), $term);
$resql = $db->query($sql);

View File

@ -593,7 +593,7 @@ $permissiontoadd = $user->rights->ticket->write;
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
// Actions to send emails
$trigger_name = 'TICKET_SENTBYMAIL';
$triggersendname = 'TICKET_SENTBYMAIL';
$paramname = 'id';
$autocopy = 'MAIN_MAIL_AUTOCOPY_TICKET_TO'; // used to know the automatic BCC to add
$trackid = 'tic'.$object->id;
@ -994,7 +994,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
print '<td class="titlefield">';
print $langs->trans('TicketChangeType');
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 '</tr>';
// Group
@ -1002,7 +1002,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
print '<td>';
print $langs->trans('TicketChangeCategory');
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 '</tr>';
// Severity
@ -1010,7 +1010,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
print '<td>';
print $langs->trans('TicketChangeSeverity');
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 '</tr>';
} else {

View File

@ -1368,6 +1368,8 @@ class Ticket extends CommonObject
{
global $conf, $langs;
$error = 0;
if ($this->statut != self::STATUS_CANCELED) { // no closed
$this->db->begin();
@ -1420,6 +1422,7 @@ class Ticket extends CommonObject
{
global $conf, $langs;
$error = 0;
$this->db->begin();
$this->oldcopy = dol_clone($this);

View File

@ -235,8 +235,11 @@ if (empty($reshook)) {
$object->employee = GETPOST('employee', 'alphanohtml');
$object->thm = GETPOST("thm", 'alphanohtml') != '' ? GETPOST("thm", 'alphanohtml') : '';
$object->thm = price2num($object->thm);
$object->tjm = GETPOST("tjm", 'alphanohtml') != '' ? GETPOST("tjm", 'alphanohtml') : '';
$object->tjm = price2num($object->tjm);
$object->salary = GETPOST("salary", 'alphanohtml') != '' ? GETPOST("salary", 'alphanohtml') : '';
$object->salary = price2num($object->salary);
$object->salaryextra = GETPOST("salaryextra", 'alphanohtml') != '' ? GETPOST("salaryextra", 'alphanohtml') : '';
$object->weeklyhours = GETPOST("weeklyhours", 'alphanohtml') != '' ? GETPOST("weeklyhours", 'alphanohtml') : '';
@ -394,10 +397,15 @@ if (empty($reshook)) {
$object->employee = GETPOST('employee', 'int');
$object->thm = GETPOST("thm", 'alphanohtml') != '' ? GETPOST("thm", 'alphanohtml') : '';
$object->thm = price2num($object->thm);
$object->tjm = GETPOST("tjm", 'alphanohtml') != '' ? GETPOST("tjm", 'alphanohtml') : '';
$object->thm = price2num($object->thm);
$object->salary = GETPOST("salary", 'alphanohtml') != '' ? GETPOST("salary", 'alphanohtml') : '';
$object->salary = price2num($object->salary);
$object->salaryextra = GETPOST("salaryextra", 'alphanohtml') != '' ? GETPOST("salaryextra", 'alphanohtml') : '';
$object->salaryextra = price2num($object->salaryextra);
$object->weeklyhours = GETPOST("weeklyhours", 'alphanohtml') != '' ? GETPOST("weeklyhours", 'alphanohtml') : '';
$object->weeklyhours = price2num($object->weeklyhours);
$object->color = GETPOST("color", 'alphanohtml') != '' ? GETPOST("color", 'alphanohtml') : '';
$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
$trigger_name = 'USER_SENTBYMAIL';
$triggersendname = 'USER_SENTBYMAIL';
$paramname = 'id'; // Name of param key to open the card
$mode = 'emailfromuser';
$trackid = 'use'.$id;

View File

@ -2124,7 +2124,7 @@ if (!GETPOST('hide_websitemenu'))
}
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
{

View File

@ -97,7 +97,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails
$trigger_name = 'WEBSITEACCOUNT_SENTBYMAIL';
$triggersendname = 'WEBSITEACCOUNT_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_WEBSITEACCOUNT_TO';
$trackid = 'websiteaccount'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';

View File

@ -138,7 +138,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails
$trigger_name = 'MYOBJECT_SENTBYMAIL';
$triggersendname = 'MYOBJECT_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_MYOBJECT_TO';
$trackid = 'myobject'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';

View File

@ -253,10 +253,11 @@ if ($resql) {
$paymentstatic->fetch($links[$key]['url_id']);
$tmparray = $paymentstatic->getBillsArray('');
if (is_array($tmparray)) {
foreach ($tmparray as $key => $val) {
$invoicestatic->fetch($val);
if ($accountelem)
foreach ($tmparray as $tmpkey => $tmpval) {
$invoicestatic->fetch($tmpval);
if ($accountelem) {
$accountelem .= ', ';
}
$accountelem .= $invoicestatic->ref;
}
}
@ -264,28 +265,32 @@ if ($resql) {
$paymentsupplierstatic->fetch($links[$key]['url_id']);
$tmparray = $paymentsupplierstatic->getBillsArray('');
if (is_array($tmparray)) {
foreach ($tmparray as $key => $val) {
$invoicesupplierstatic->fetch($val);
if ($accountelem)
foreach ($tmparray as $tmpkey => $tmpval) {
$invoicesupplierstatic->fetch($tmpval);
if ($accountelem) {
$accountelem .= ', ';
}
$accountelem .= $invoicesupplierstatic->ref;
}
}
} elseif ($links[$key]['type'] == 'payment_sc') {
$paymentsocialcontributionstatic->fetch($links[$key]['url_id']);
if ($accountelem)
if ($accountelem) {
$accountelem .= ', ';
}
$accountelem .= $langs->transnoentitiesnoconv("SocialContribution") . ' ' . $paymentsocialcontributionstatic->ref;
} elseif ($links[$key]['type'] == 'payment_vat') {
$paymentvatstatic->fetch($links[$key]['url_id']);
if ($accountelem)
if ($accountelem) {
$accountelem .= ', ';
}
$accountelem .= $langs->transnoentitiesnoconv("VATPayments") . ' ' . $paymentvatstatic->ref;
} elseif ($links[$key]['type'] == 'banktransfert') {
$comment = $outputlangs->transnoentitiesnoconv("Transfer");
if ($objp->amount > 0) {
if ($comment)
if ($comment) {
$comment .= ' ';
}
$banklinestatic->fetch($links[$key]['url_id']);
$bankstatic->id = $banklinestatic->fk_account;
$bankstatic->label = $banklinestatic->bank_account_label;
@ -297,8 +302,9 @@ if ($resql) {
$comment .= $bankstatic->getNomUrl(1, '');
$comment .= ')';
} else {
if ($comment)
if ($comment) {
$comment .= ' ';
}
$bankstatic->id = $objp->bankid;
$bankstatic->label = $objp->bankref;
$comment .= ' (' . $langs->transnoentitiesnoconv("from") . ' ';
@ -311,13 +317,15 @@ if ($resql) {
$comment .= ')';
}
} elseif ($links[$key]['type'] == 'company') {
if ($thirdparty)
if ($thirdparty) {
$thirdparty .= ', ';
}
$thirdparty .= dol_trunc($links[$key]['label'], 24);
$newline = 0;
} elseif ($links[$key]['type'] == 'member') {
if ($thirdparty)
if ($thirdparty) {
$accountelem .= ', ';
}
$thirdparty .= $links[$key]['label'];
$newline = 0;
}

View File

@ -4,6 +4,7 @@
* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* 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
* it under the terms of the GNU General Public License as published by
@ -90,6 +91,8 @@ if ($resql) {
$emailing = new Mailing($db);
$emailing->fetch($obj->rowid);
$upload_dir = $conf->mailing->dir_output . "/" . get_exdir($emailing->id, 2, 0, 1, $emailing, 'mailing');
$id = $emailing->id;
$subject = $emailing->sujet;
$message = $emailing->body;
@ -228,9 +231,25 @@ if ($resql) {
$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
$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) {
$res = 0;