Fix debug module eventorganization
This commit is contained in:
parent
2b2d01cdc9
commit
b562ab9948
@ -220,7 +220,7 @@ if ($action == 'edit') {
|
|||||||
foreach ($arrayofparameters as $constname => $val) {
|
foreach ($arrayofparameters as $constname => $val) {
|
||||||
if ($val['enabled']==1) {
|
if ($val['enabled']==1) {
|
||||||
$setupnotempty++;
|
$setupnotempty++;
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td><!-- '.$constname.' -->';
|
||||||
$tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
|
$tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
|
||||||
$tooltiphelp .= (($langs->trans($constname . 'Tooltip2') && $langs->trans($constname . 'Tooltip2') != $constname . 'Tooltip2') ? '<br><br>'."\n".$langs->trans($constname . 'Tooltip2') : '');
|
$tooltiphelp .= (($langs->trans($constname . 'Tooltip2') && $langs->trans($constname . 'Tooltip2') != $constname . 'Tooltip2') ? '<br><br>'."\n".$langs->trans($constname . 'Tooltip2') : '');
|
||||||
print '<span id="helplink'.$constname.'" class="spanforparamtooltip">'.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1, 'info', '', 0, 3, 'tootips'.$constname).'</span>';
|
print '<span id="helplink'.$constname.'" class="spanforparamtooltip">'.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1, 'info', '', 0, 3, 'tootips'.$constname).'</span>';
|
||||||
@ -313,7 +313,8 @@ if ($action == 'edit') {
|
|||||||
foreach ($arrayofparameters as $constname => $val) {
|
foreach ($arrayofparameters as $constname => $val) {
|
||||||
if ($val['enabled']==1) {
|
if ($val['enabled']==1) {
|
||||||
$setupnotempty++;
|
$setupnotempty++;
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven">';
|
||||||
|
print '<td><!-- '.$constname.' -->';
|
||||||
$tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
|
$tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
|
||||||
$tooltiphelp .= (($langs->trans($constname . 'Tooltip2') && $langs->trans($constname . 'Tooltip2') != $constname . 'Tooltip2') ? '<br><br>'."\n".$langs->trans($constname . 'Tooltip2') : '');
|
$tooltiphelp .= (($langs->trans($constname . 'Tooltip2') && $langs->trans($constname . 'Tooltip2') != $constname . 'Tooltip2') ? '<br><br>'."\n".$langs->trans($constname . 'Tooltip2') : '');
|
||||||
print $form->textwithpicto($langs->trans($constname), $tooltiphelp);
|
print $form->textwithpicto($langs->trans($constname), $tooltiphelp);
|
||||||
@ -331,12 +332,17 @@ if ($action == 'edit') {
|
|||||||
$formmail = new FormMail($db);
|
$formmail = new FormMail($db);
|
||||||
|
|
||||||
$tmp = explode(':', $val['type']);
|
$tmp = explode(':', $val['type']);
|
||||||
|
$labelemailtemplate = getDolGlobalString($constname);
|
||||||
$template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, getDolGlobalString($constname));
|
if ($labelemailtemplate && $labelemailtemplate != '-1') {
|
||||||
if ($template < 0) {
|
$template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, getDolGlobalString($constname));
|
||||||
setEventMessages(null, $formmail->errors, 'errors');
|
if (is_numeric($template) && $template < 0) {
|
||||||
|
setEventMessages($formmail->error, $formmail->errors, 'errors');
|
||||||
|
} else {
|
||||||
|
if ($template->label != 'default') {
|
||||||
|
print $langs->trans($template->label);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print $langs->trans($template->label);
|
|
||||||
}
|
}
|
||||||
} elseif (preg_match('/category:/', $val['type'])) {
|
} elseif (preg_match('/category:/', $val['type'])) {
|
||||||
if (getDolGlobalString($constname)) {
|
if (getDolGlobalString($constname)) {
|
||||||
@ -364,16 +370,21 @@ if ($action == 'edit') {
|
|||||||
}
|
}
|
||||||
} elseif ($val['type'] == 'product') {
|
} elseif ($val['type'] == 'product') {
|
||||||
$product = new Product($db);
|
$product = new Product($db);
|
||||||
$resprod = $product->fetch(getDolGlobalString($constname));
|
$idproduct = getDolGlobalString($constname);
|
||||||
if ($resprod > 0) {
|
if ($idproduct > 0) {
|
||||||
print $product->getNomUrl(1);
|
$resprod = $product->fetch($idproduct);
|
||||||
} elseif ($resprod < 0) {
|
if ($resprod > 0) {
|
||||||
setEventMessages($product->error, $product->errors, "errors");
|
print $product->getNomUrl(1);
|
||||||
|
} elseif ($resprod < 0) {
|
||||||
|
setEventMessages($product->error, $product->errors, "errors");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print getDolGlobalString($constname);
|
print getDolGlobalString($constname);
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td>';
|
||||||
|
|
||||||
|
print '</tr>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1277,7 +1277,7 @@ class FormMail extends Form
|
|||||||
* @param int $id Id of template to get, or -1 for first found with position 0, or 0 for first found whatever is position (priority order depends on lang provided or not) or -2 for exact match with label (no answer if not found)
|
* @param int $id Id of template to get, or -1 for first found with position 0, or 0 for first found whatever is position (priority order depends on lang provided or not) or -2 for exact match with label (no answer if not found)
|
||||||
* @param int $active 1=Only active template, 0=Only disabled, -1=All
|
* @param int $active 1=Only active template, 0=Only disabled, -1=All
|
||||||
* @param string $label Label of template to get
|
* @param string $label Label of template to get
|
||||||
* @return ModelMail|integer One instance of ModelMail or -1 if error
|
* @return ModelMail|integer One instance of ModelMail or < 0 if error
|
||||||
*/
|
*/
|
||||||
public function getEMailTemplate($dbs, $type_template, $user, $outputlangs, $id = 0, $active = 1, $label = '')
|
public function getEMailTemplate($dbs, $type_template, $user, $outputlangs, $id = 0, $active = 1, $label = '')
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user