This commit is contained in:
Laurent Destailleur 2017-09-23 12:59:49 +02:00
parent 91beb3a4d6
commit 414f633e75
7 changed files with 103 additions and 62 deletions

View File

@ -5551,8 +5551,8 @@ class Form
{ {
$nbofdifferenttypes = count($object->linkedObjects); $nbofdifferenttypes = count($object->linkedObjects);
print '<br><!-- showLinkedObjectBlock -->'; print '<!-- showLinkedObjectBlock -->';
print load_fiche_titre($langs->trans('RelatedObjects'), $morehtmlright, ''); print load_fiche_titre($langs->trans('RelatedObjects'), $morehtmlright, '', 0, 0, 'showlinkedobjectblock');
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';

View File

@ -187,20 +187,22 @@ class FormActions
elseif ($typeelement == 'project') $title=$langs->trans('LatestLinkedEvents', $max?$max:''); elseif ($typeelement == 'project') $title=$langs->trans('LatestLinkedEvents', $max?$max:'');
elseif ($typeelement == 'task') $title=$langs->trans('LatestLinkedEvents', $max?$max:''); elseif ($typeelement == 'task') $title=$langs->trans('LatestLinkedEvents', $max?$max:'');
elseif ($typeelement == 'member') $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:''); $urlbacktopage=$_SERVER['PHP_SELF'].'?id='.$object->id.($moreparambacktopage?'&'.$moreparambacktopage:'');
$buttontoaddnewevent = '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.dol_print_date(dol_now(),'dayhourlog').'&origin='.$typeelement.'&originid='.$object->id.'&socid='.$object->socid.'&projectid='.$object->fk_project.'&backtopage='.urlencode($urlbacktopage).'">'; $buttontoaddnewevent = '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.dol_print_date(dol_now(),'dayhourlog').'&origin='.$typeelement.'&originid='.$object->id.'&socid='.$object->socid.'&projectid='.$object->fk_project.'&backtopage='.urlencode($urlbacktopage).'">';
$buttontoaddnewevent.= $langs->trans("AddEvent"); $buttontoaddnewevent.= $langs->trans("AddEvent");
$buttontoaddnewevent.= '</a>'; $buttontoaddnewevent.= '</a>';
print '<!-- formactions->showactions -->'."\n";
print load_fiche_titre($title, $buttontoaddnewevent, ''); print load_fiche_titre($title, $buttontoaddnewevent, '');
$page=0; $param=''; $page=0; $param='';
$total = 0; $total = 0;
print '<div class="div-table-responsive">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder'.($morecss?' '.$morecss:'').'" width="100%">'; print '<table class="noborder'.($morecss?' '.$morecss:'').'" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print getTitleFieldOfList('Ref', 0, $_SERVER["PHP_SELF"], '', $page, $param, '', $sortfield, $sortorder, '', 1); print getTitleFieldOfList('Ref', 0, $_SERVER["PHP_SELF"], '', $page, $param, '', $sortfield, $sortorder, '', 1);
@ -214,6 +216,8 @@ class FormActions
$userstatic = new User($this->db); $userstatic = new User($this->db);
if (count($listofactions))
{
$cursorevent = 0; $cursorevent = 0;
foreach($listofactions as $action) foreach($listofactions as $action)
{ {
@ -267,10 +271,15 @@ class FormActions
$cursorevent++; $cursorevent++;
} }
}
else
{
print '<tr class="oddeven"><td colspan="6" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
if ($max && $num > $max) if ($max && $num > $max)
{ {
print '<tr class="oddeven"><td colspan="6">'.$langs->trans("More").'...</td></tr>'; print '<tr class="oddeven"><td colspan="6" class="opacitymedium">'.$langs->trans("More").'...</td></tr>';
} }
print '</table>'; print '</table>';

View File

@ -64,8 +64,14 @@ IsAMeasure=Is a measure
DirScanned=Directory scanned DirScanned=Directory scanned
NoTrigger=No trigger NoTrigger=No trigger
NoWidget=No widget NoWidget=No widget
ListOfPermissionsDefined=List of defined permissions
EnabledDesc=Condition to have this field active (Examples: 1 or $conf->global->MYMODULE_MYOPTION) 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) 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) 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 <b>module_parts['hooks']</b> property in the module descriptor the context of hooks you want to manage (list of contexts can be found by a search on '<b>initHooks(</b>' in core code).<br>Edit the hook file to add code of your hooked functions (hookable functions can be found by a search on '<b>executeHooks</b>' in core code).
TriggerDefDesc=Define in the trigger file the code you want to execute for each business event executed

View File

@ -1194,6 +1194,9 @@ elseif (! empty($module))
{ {
if ($action != 'editfile' || empty($file)) if ($action != 'editfile' || empty($file))
{ {
print $langs->trans("SpecDefDesc").'<br>';
print '<br>';
$specs=dol_dir_list(dol_buildpath($modulelowercase.'/doc', 0), 'files', 1, '(\.md|\.asciidoc)$'); $specs=dol_dir_list(dol_buildpath($modulelowercase.'/doc', 0), 'files', 1, '(\.md|\.asciidoc)$');
foreach ($specs as $spec) foreach ($specs as $spec)
@ -1241,6 +1244,9 @@ elseif (! empty($module))
{ {
if ($action != 'editfile' || empty($file)) if ($action != 'editfile' || empty($file))
{ {
print $langs->trans("LanguageDefDesc").'<br>';
print '<br>';
$langfiles=dol_dir_list(dol_buildpath($modulelowercase.'/langs', 0), 'files', 1, '\.lang$'); $langfiles=dol_dir_list(dol_buildpath($modulelowercase.'/langs', 0), 'files', 1, '\.lang$');
foreach ($langfiles as $langfile) foreach ($langfiles as $langfile)
@ -1419,11 +1425,14 @@ elseif (! empty($module))
print '<br>'; print '<br>';
print '</div>'; print '</div>';
$urloflist = dol_buildpath(strtolower($module).'/'.strtolower($tabobj).'_list.php', 1);
$urlofcard = dol_buildpath(strtolower($module).'/'.strtolower($tabobj).'_card.php', 1);
print '<div class="fichehalfleft">'; print '<div class="fichehalfleft">';
print '<span class="fa fa-file"></span> '.$langs->trans("PageForList").' : <strong>'.$pathtolist.'</strong>'; print '<span class="fa fa-file"></span> '.$langs->trans("PageForList").' : <strong><a href="'.$urloflist.'" target="_test">'.$pathtolist.'</a></strong>';
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtolist).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>'; print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtolist).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
print '<br>'; print '<br>';
print '<span class="fa fa-file"></span> '.$langs->trans("PageForCreateEditView").' : <strong>'.$pathtocard.'</strong>'; print '<span class="fa fa-file"></span> '.$langs->trans("PageForCreateEditView").' : <strong><a href="'.$urlofcard.'?action=create" target="_test">'.$pathtocard.'?action=create</a></strong>';
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtocard).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>'; print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtocard).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
print '<br>'; print '<br>';
print '<span class="fa fa-file"></span> '.$langs->trans("PageForAgendaTab").' : <strong>'.$pathtoagenda.'</strong>'; print '<span class="fa fa-file"></span> '.$langs->trans("PageForAgendaTab").' : <strong>'.$pathtoagenda.'</strong>';
@ -1479,8 +1488,8 @@ elseif (! empty($module))
print '<td class="right">'.$langs->trans("Position").'</td>'; print '<td class="right">'.$langs->trans("Position").'</td>';
print '<td class="center">'.$form->textwithpicto($langs->trans("Enabled"), $langs->trans("EnabledDesc")).'</td>'; print '<td class="center">'.$form->textwithpicto($langs->trans("Enabled"), $langs->trans("EnabledDesc")).'</td>';
print '<td class="center">'.$form->textwithpicto($langs->trans("Visible"), $langs->trans("VisibleDesc")).'</td>'; print '<td class="center">'.$form->textwithpicto($langs->trans("Visible"), $langs->trans("VisibleDesc")).'</td>';
print '<td class="center">'.$langs->trans("IsAMeasure").'</td>'; print '<td class="center">'.$form->textwithpicto($langs->trans("IsAMeasure"), $langs->trans("IsAMeasureDesc")).'</td>';
print '<td class="center">'.$langs->trans("SearchAll").'</td>'; print '<td class="center">'.$form->textwithpicto($langs->trans("SearchAll"), $langs->trans("SearchAllDesc")).'</td>';
print '<td>'.$langs->trans("Comment").'</td>'; print '<td>'.$langs->trans("Comment").'</td>';
print '<td></td>'; print '<td></td>';
print '</tr>'; print '</tr>';
@ -1885,6 +1894,14 @@ elseif (! empty($module))
{ {
if ($action != 'editfile' || empty($file)) if ($action != 'editfile' || empty($file))
{ {
print $langs->trans("HooksDefDesc").'<br>';
print '<br>';
$pathtofile = $modulelowercase.'/core/modules/mod'.$module.'.class.php';
print '<span class="fa fa-file"></span> '.$langs->trans("DescriptorFile").' : <strong>'.$pathtofile.'</strong>';
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&format=php&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
print '<br>';
$pathtohook = strtolower($module).'/class/actions_'.strtolower($module).'.class.php'; $pathtohook = strtolower($module).'/class/actions_'.strtolower($module).'.class.php';
print '<span class="fa fa-file"></span> '.$langs->trans("HooksFile").' : <strong>'.$pathtohook.'</strong>'; print '<span class="fa fa-file"></span> '.$langs->trans("HooksFile").' : <strong>'.$pathtohook.'</strong>';
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&format=php&file='.urlencode($pathtohook).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>'; print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&format=php&file='.urlencode($pathtohook).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
@ -1926,6 +1943,9 @@ elseif (! empty($module))
if ($action != 'editfile' || empty($file)) if ($action != 'editfile' || empty($file))
{ {
print $langs->trans("TriggerDefDesc").'<br>';
print '<br>';
if (! empty($triggers)) if (! empty($triggers))
{ {
foreach ($triggers as $trigger) foreach ($triggers as $trigger)

View File

@ -1 +1,3 @@
# SPECIFICATIONS OF MODULE MYMODULE FOR DOLIBARR ERP CRM # SPECIFICATIONS OF MODULE MYMODULE FOR DOLIBARR ERP CRM
There is no detailed specification available yet.

View File

@ -534,10 +534,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '</div><div class="fichehalfright"><div class="ficheaddleft">'; print '</div><div class="fichehalfright"><div class="ficheaddleft">';
$MAXEVENT = 10;
// List of actions on element // List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db); $formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'myobject', $socid, 1); $somethingshown = $formactions->showactions($object, 'myobject', $socid, 1, '', $MAXEVENT);
print '</div></div></div>'; print '</div></div></div>';
} }

View File

@ -719,7 +719,9 @@ div.myavailability {
margin-top: 6px; margin-top: 6px;
margin-bottom: 12px; margin-bottom: 12px;
} }
#builddoc_form ~ .showlinkedobjectblock {
margin-top: 20px;
}
/* For the long description of module */ /* For the long description of module */
.moduledesclong p img, .moduledesclong p a img { .moduledesclong p img, .moduledesclong p a img {