';
diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php
index b93083d9a9f..84c7ab389f3 100644
--- a/htdocs/core/class/html.formactions.class.php
+++ b/htdocs/core/class/html.formactions.class.php
@@ -187,20 +187,22 @@ class FormActions
elseif ($typeelement == 'project') $title=$langs->trans('LatestLinkedEvents', $max?$max:'');
elseif ($typeelement == 'task') $title=$langs->trans('LatestLinkedEvents', $max?$max:'');
elseif ($typeelement == 'member') $title=$langs->trans('LatestLinkedEvents', $max?$max:'');
- else $title=$langs->trans("Actions");
+ else $title=$langs->trans("LatestLinkedEvents", $max?$max:'');
$urlbacktopage=$_SERVER['PHP_SELF'].'?id='.$object->id.($moreparambacktopage?'&'.$moreparambacktopage:'');
$buttontoaddnewevent = '
';
+
+ print ''."\n";
print load_fiche_titre($title, $buttontoaddnewevent, '');
$page=0; $param='';
$total = 0;
- print '
';
+ print '
';
print '
';
print '';
print getTitleFieldOfList('Ref', 0, $_SERVER["PHP_SELF"], '', $page, $param, '', $sortfield, $sortorder, '', 1);
@@ -214,63 +216,70 @@ class FormActions
$userstatic = new User($this->db);
- $cursorevent = 0;
- foreach($listofactions as $action)
+ if (count($listofactions))
{
- if ($max && $cursorevent >= $max) break;
+ $cursorevent = 0;
+ foreach($listofactions as $action)
+ {
+ if ($max && $cursorevent >= $max) break;
- $ref=$action->getNomUrl(1,-1);
- $label=$action->getNomUrl(0,38);
+ $ref=$action->getNomUrl(1,-1);
+ $label=$action->getNomUrl(0,38);
- print '
';
- print '| '.$ref.' | ';
- print ''.$label.' | ';
- print '';
- if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
- {
- if ($action->type_picto) print img_picto('', $action->type_picto);
- else {
- if ($action->type_code == 'AC_RDV') print img_picto('', 'object_group').' ';
- if ($action->type_code == 'AC_TEL') print img_picto('', 'object_phoning').' ';
- if ($action->type_code == 'AC_FAX') print img_picto('', 'object_phoning_fax').' ';
- if ($action->type_code == 'AC_EMAIL') print img_picto('', 'object_email').' ';
- }
- }
- print $action->type;
- print ' | ';
- print ''.dol_print_date($action->datep,'dayhour');
- if ($action->datef)
- {
- $tmpa=dol_getdate($action->datep);
- $tmpb=dol_getdate($action->datef);
- if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year'])
+ print ' |
';
+ print '| '.$ref.' | ';
+ print ''.$label.' | ';
+ print '';
+ if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
{
- if ($tmpa['hours'] != $tmpb['hours'] || $tmpa['minutes'] != $tmpb['minutes'] && $tmpa['seconds'] != $tmpb['seconds']) print '-'.dol_print_date($action->datef,'hour');
+ if ($action->type_picto) print img_picto('', $action->type_picto);
+ else {
+ if ($action->type_code == 'AC_RDV') print img_picto('', 'object_group').' ';
+ if ($action->type_code == 'AC_TEL') print img_picto('', 'object_phoning').' ';
+ if ($action->type_code == 'AC_FAX') print img_picto('', 'object_phoning_fax').' ';
+ if ($action->type_code == 'AC_EMAIL') print img_picto('', 'object_email').' ';
+ }
}
- else print '-'.dol_print_date($action->datef,'dayhour');
- }
- print ' | ';
- print '';
- if (! empty($action->userownerid))
- {
- $userstatic->fetch($action->userownerid); // TODO Introduce a cache on users fetched
- print $userstatic->getNomUrl(-1, '', 0, 0, 16, 0, '', '');
- }
- print ' | ';
- print '';
- if (! empty($action->author->id))
- {
- print $action->getLibStatut(3);
- }
- print ' | ';
- print '
';
+ print $action->type;
+ print '';
+ print ''.dol_print_date($action->datep,'dayhour');
+ if ($action->datef)
+ {
+ $tmpa=dol_getdate($action->datep);
+ $tmpb=dol_getdate($action->datef);
+ if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year'])
+ {
+ if ($tmpa['hours'] != $tmpb['hours'] || $tmpa['minutes'] != $tmpb['minutes'] && $tmpa['seconds'] != $tmpb['seconds']) print '-'.dol_print_date($action->datef,'hour');
+ }
+ else print '-'.dol_print_date($action->datef,'dayhour');
+ }
+ print ' | ';
+ print '';
+ if (! empty($action->userownerid))
+ {
+ $userstatic->fetch($action->userownerid); // TODO Introduce a cache on users fetched
+ print $userstatic->getNomUrl(-1, '', 0, 0, 16, 0, '', '');
+ }
+ print ' | ';
+ print '';
+ if (! empty($action->author->id))
+ {
+ print $action->getLibStatut(3);
+ }
+ print ' | ';
+ print '';
- $cursorevent++;
+ $cursorevent++;
+ }
+ }
+ else
+ {
+ print '| '.$langs->trans("None").' |
';
}
if ($max && $num > $max)
{
- print '| '.$langs->trans("More").'... |
';
+ print '| '.$langs->trans("More").'... |
';
}
print '
';
diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang
index 732514de9c1..081f67fb022 100644
--- a/htdocs/langs/en_US/modulebuilder.lang
+++ b/htdocs/langs/en_US/modulebuilder.lang
@@ -64,8 +64,14 @@ IsAMeasure=Is a measure
DirScanned=Directory scanned
NoTrigger=No trigger
NoWidget=No widget
+ListOfPermissionsDefined=List of defined permissions
EnabledDesc=Condition to have this field active (Examples: 1 or $conf->global->MYMODULE_MYOPTION)
-VisibleDesc=Is field is visible in list (-1 means not shown by default but can be added into list to be viewed)
+VisibleDesc=Is the field visible into list ? (Examples: 0=not visible, 1=visible by default on list, -1=not shown by default on list but can be added into list to be viewed)
+IsAMeasureDesc=Can the value of field be cumulated to get a total into list ? (Examples: 1 or 0)
+SearchAllDesc=Is the field used to make a search from the quick search tool ? (Examples: 1 or 0)
+SpecDefDesc=Enter here all documentation you want to provide with your module that is not already defined by other tabs. You can use .md or better, the rich .asciidoc syntax.
+LanguageDefDesc=Enter in this files, all the key and the translation for each language file.
MenusDefDesc=Define here the menus provided by your module (once defined, they are visible into the menu editor %s)
PermissionsDefDesc=Define here the new permissions provided by your module (once defined, they are visible into the default permissions setup %s)
-ListOfPermissionsDefined=List of defined permissions
+HooksDefDesc=Define in the
module_parts['hooks'] property in the module descriptor the context of hooks you want to manage (list of contexts can be found by a search on '
initHooks(' in core code).
Edit the hook file to add code of your hooked functions (hookable functions can be found by a search on '
executeHooks' in core code).
+TriggerDefDesc=Define in the trigger file the code you want to execute for each business event executed
diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php
index 31514435cd7..145d68f7c2f 100644
--- a/htdocs/modulebuilder/index.php
+++ b/htdocs/modulebuilder/index.php
@@ -1194,6 +1194,9 @@ elseif (! empty($module))
{
if ($action != 'editfile' || empty($file))
{
+ print $langs->trans("SpecDefDesc").'
';
+ print '
';
+
$specs=dol_dir_list(dol_buildpath($modulelowercase.'/doc', 0), 'files', 1, '(\.md|\.asciidoc)$');
foreach ($specs as $spec)
@@ -1241,6 +1244,9 @@ elseif (! empty($module))
{
if ($action != 'editfile' || empty($file))
{
+ print $langs->trans("LanguageDefDesc").'
';
+ print '
';
+
$langfiles=dol_dir_list(dol_buildpath($modulelowercase.'/langs', 0), 'files', 1, '\.lang$');
foreach ($langfiles as $langfile)
@@ -1419,11 +1425,14 @@ elseif (! empty($module))
print '
';
print '
';
+ $urloflist = dol_buildpath(strtolower($module).'/'.strtolower($tabobj).'_list.php', 1);
+ $urlofcard = dol_buildpath(strtolower($module).'/'.strtolower($tabobj).'_card.php', 1);
+
print '
';
- print '
'.$langs->trans("PageForList").' :
'.$pathtolist.'';
+ print '
'.$langs->trans("PageForList").' :
'.$pathtolist.'';
print '
'.img_picto($langs->trans("Edit"), 'edit').'';
print '
';
- print '
'.$langs->trans("PageForCreateEditView").' :
'.$pathtocard.'';
+ print '
'.$langs->trans("PageForCreateEditView").' :
'.$pathtocard.'?action=create';
print '
'.img_picto($langs->trans("Edit"), 'edit').'';
print '
';
print '
'.$langs->trans("PageForAgendaTab").' :
'.$pathtoagenda.'';
@@ -1479,8 +1488,8 @@ elseif (! empty($module))
print '
'.$langs->trans("Position").' | ';
print '
'.$form->textwithpicto($langs->trans("Enabled"), $langs->trans("EnabledDesc")).' | ';
print '
'.$form->textwithpicto($langs->trans("Visible"), $langs->trans("VisibleDesc")).' | ';
- print '
'.$langs->trans("IsAMeasure").' | ';
- print '
'.$langs->trans("SearchAll").' | ';
+ print '
'.$form->textwithpicto($langs->trans("IsAMeasure"), $langs->trans("IsAMeasureDesc")).' | ';
+ print '
'.$form->textwithpicto($langs->trans("SearchAll"), $langs->trans("SearchAllDesc")).' | ';
print '
'.$langs->trans("Comment").' | ';
print '
| ';
print '';
@@ -1885,8 +1894,16 @@ elseif (! empty($module))
{
if ($action != 'editfile' || empty($file))
{
- $pathtohook = strtolower($module).'/class/actions_'.strtolower($module).'.class.php';
- print '
'.$langs->trans("HooksFile").' :
'.$pathtohook.'';
+ print $langs->trans("HooksDefDesc").'
';
+ print '
';
+
+ $pathtofile = $modulelowercase.'/core/modules/mod'.$module.'.class.php';
+ print '
'.$langs->trans("DescriptorFile").' :
'.$pathtofile.'';
+ print '
'.img_picto($langs->trans("Edit"), 'edit').'';
+ print '
';
+
+ $pathtohook = strtolower($module).'/class/actions_'.strtolower($module).'.class.php';
+ print '
'.$langs->trans("HooksFile").' :
'.$pathtohook.'';
print '
'.img_picto($langs->trans("Edit"), 'edit').'';
print '
';
}
@@ -1926,6 +1943,9 @@ elseif (! empty($module))
if ($action != 'editfile' || empty($file))
{
+ print $langs->trans("TriggerDefDesc").'
';
+ print '
';
+
if (! empty($triggers))
{
foreach ($triggers as $trigger)
diff --git a/htdocs/modulebuilder/template/doc/Specifications.asciidoc b/htdocs/modulebuilder/template/doc/Specifications.asciidoc
index 7b1711cf514..d2150c0865d 100644
--- a/htdocs/modulebuilder/template/doc/Specifications.asciidoc
+++ b/htdocs/modulebuilder/template/doc/Specifications.asciidoc
@@ -1 +1,3 @@
-# SPECIFICATIONS OF MODULE MYMODULE FOR DOLIBARR ERP CRM
\ No newline at end of file
+# SPECIFICATIONS OF MODULE MYMODULE FOR DOLIBARR ERP CRM
+
+There is no detailed specification available yet.
diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php
index 9aa0f8cd361..97662c150da 100644
--- a/htdocs/modulebuilder/template/myobject_card.php
+++ b/htdocs/modulebuilder/template/myobject_card.php
@@ -534,10 +534,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '
';
+ $MAXEVENT = 10;
+
// List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
- $somethingshown = $formactions->showactions($object, 'myobject', $socid, 1);
+ $somethingshown = $formactions->showactions($object, 'myobject', $socid, 1, '', $MAXEVENT);
print '
';
}
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index 4451135830c..1fbd4e44037 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -719,7 +719,9 @@ div.myavailability {
margin-top: 6px;
margin-bottom: 12px;
}
-
+#builddoc_form ~ .showlinkedobjectblock {
+ margin-top: 20px;
+}
/* For the long description of module */
.moduledesclong p img, .moduledesclong p a img {