From 78654376ca78444537205999b9ff538eccf7c0b3 Mon Sep 17 00:00:00 2001 From: davidNDU Date: Fri, 9 Oct 2020 16:54:13 +0300 Subject: [PATCH] Fix: Module Builder creation and listing of events --- htdocs/modulebuilder/template/myobject_agenda.php | 8 +++++--- htdocs/modulebuilder/template/myobject_card.php | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php index e05b4e93491..8d69d59c05d 100644 --- a/htdocs/modulebuilder/template/myobject_agenda.php +++ b/htdocs/modulebuilder/template/myobject_agenda.php @@ -223,13 +223,15 @@ if ($object->id > 0) $objthirdparty = $object; $objcon = new stdClass(); - $out = '&origin='.$object->element.'&originid='.$object->id; + $out = '&origin='.$object->element.'%40'.$object->module.'&originid='.$object->id; + $urlbacktopage = $_SERVER['PHP_SELF'].'?id='.$object->id; + $out .= '&backtopage='.urlencode($urlbacktopage); $permok = $user->rights->agenda->myactions->create; if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) { //$out.='trans("AddAnAction"),'filenew'); //$out.=""; @@ -264,7 +266,7 @@ if ($object->id > 0) $filters['search_agenda_label'] = $search_agenda_label; // TODO Replace this with same code than into list.php - show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, 'mymmodule'); + show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, $object->module); } } diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index d97bc8f7f35..a56448c584c 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -569,7 +569,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, $object->element.'@mymodule', (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright); + $somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright); print ''; }