From 304819a72685d40c38bcc64633d238d1e336d5e0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 Nov 2017 16:26:39 +0100 Subject: [PATCH] Work on module builder --- htdocs/admin/modules.php | 19 ++- htdocs/core/lib/files.lib.php | 6 +- htdocs/langs/en_US/modulebuilder.lang | 8 +- htdocs/modulebuilder/index.php | 122 ++++++++++++----- .../template/doc/Specifications.asciidoc | 111 +-------------- .../doc/Specifications_full_en.asciidoc | 126 ++++++++++++++++++ .../template/langs/en_US/mymodule.lang | 16 +-- .../template/langs/fr_FR/mymodule.lang | 10 +- htdocs/theme/eldy/style.css.php | 1 + 9 files changed, 257 insertions(+), 162 deletions(-) create mode 100644 htdocs/modulebuilder/template/doc/Specifications_full_en.asciidoc diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index ce5d4ec55eb..25352372d8d 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -34,8 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/admin/dolistore/class/dolistore.class.php'; -$langs->load("errors"); -$langs->load("admin"); +$langs->loadLangs(array("errors","admin","modulebuilder")); $mode=GETPOST('mode', 'alpha'); if (empty($mode)) $mode='common'; @@ -1009,9 +1008,21 @@ if ($mode == 'develop') print ''.$langs->trans("URL").''; print ''; - print "\n"; + print ''."\n"; + print ''; + //span class="fa fa-bug"> + //print ''; + print '
'; + print ''; + print ''.$langs->trans("TryToUseTheModuleBuilder").''; + print ''.$langs->trans("SeeTopRightMenu").''; + print ''; + + print ''."\n"; $url='https://partners.dolibarr.org'; - print ''; + print ''; + print''; + print ''; print ''.$langs->trans("DoliPartnersDesc").''; print ''.$url.''; print ''; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 02e10fbd21a..77476b0d506 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -46,7 +46,7 @@ function dol_basename($pathfile) * @param int $recursive Determines whether subdirectories are searched * @param string $filter Regex filter to restrict list. This regex value must be escaped for '/' by doing preg_quote($var,'/'), since this char is used for preg_match function, * but must not contains the start and end '/'. Filter is checked into basename only. - * @param array $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview.*\.png)$','^\.')). Exclude is checked into fullpath. + * @param array $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview.*\.png)$','^\.')). Exclude is checked both into fullpath and into basename (So '^xxx' may exclude 'xxx/dirscanned/...' and dirscanned/xxx'). * @param string $sortcriteria Sort criteria ('','fullname','relativename','name','date','size') * @param string $sortorder Sort order (SORT_ASC, SORT_DESC) * @param int $mode 0=Return array minimum keys loaded (faster), 1=Force all keys like date and size to be loaded (slower), 2=Force load of date only, 3=Force load of size only @@ -107,6 +107,7 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil while (false !== ($file = readdir($dir))) // $file is always a basename (into directory $newpath) { if (! utf8_check($file)) $file=utf8_encode($file); // To be sure data is stored in utf8 in memory + $fullpathfile=($newpath?$newpath.'/':'').$file; $qualified=1; @@ -120,10 +121,11 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil // Check if file is qualified foreach($excludefilterarray as $filt) { - if (preg_match('/'.$filt.'/i',$file)) { + if (preg_match('/'.$filt.'/i', $file) || preg_match('/'.$filt.'/i', $fullpathfile)) { $qualified=0; break; } } + //print $fullpathfile.' '.$file.' '.$qualified.'
'; if ($qualified) { diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index ceedb00707a..2cec8d87788 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -60,6 +60,7 @@ ReadmeFile=Readme file ChangeLog=ChangeLog file TestClassFile=File for PHP Unit Test class SqlFile=Sql file +PageForLib=File for PHP libraries SqlFileExtraFields=Sql file for complementary attributes SqlFileKey=Sql file for keys AnObjectAlreadyExistWithThisNameAndDiffCase=An object already exists with this name and a different case @@ -69,6 +70,7 @@ DirScanned=Directory scanned NoTrigger=No trigger NoWidget=No widget GoToApiExplorer=Go to API explorer +ListOfMenusEntries=List of menu entries ListOfPermissionsDefined=List of defined permissions EnabledDesc=Condition to have this field active (Examples: 1 or $conf->global->MYMODULE_MYOPTION) VisibleDesc=Is the field visible ? (Examples: 0=Never visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only. Using a negative value means field is not shown by default on list but can be selected for viewing) @@ -82,4 +84,8 @@ HooksDefDesc=Define in the module_parts['hooks'] property, in the module TriggerDefDesc=Define in the trigger file the code you want to execute for each business event executed. SeeIDsInUse=See IDs in use in your installation SeeReservedIDsRangeHere=See range of reserved IDs -ToolkitForDevelopers=Toolkit for Dolibarr developers \ No newline at end of file +ToolkitForDevelopers=Toolkit for Dolibarr developers +TryToUseTheModuleBuilder=If you have knowledge in SQL and PHP, you can try to use the native module builder wizard. Just enable the module and use the wizard by clicking the on the top right menu. Warning: This is a developer feature, bad use may breaks your application. +SeeTopRightMenu=See on the top right menu +AddLanguageFile=Add language file +YouCanUseTranslationKey=You can use here a key that is the translation key found into language file (see tab "Languages") \ No newline at end of file diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index b655fddbbde..2658b105c35 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -172,6 +172,14 @@ if ($dirins && $action == 'initmodule' && $modulename) } } +if ($dirins && $action == 'addlanguage' && !empty($module)) +{ + $newlangcode=GETPOST('newlangcode', 'aZ09'); + $srcfile = $dirins.'/'.strtolower($module).'/langs/en_US'; + $destfile = $dirins.'/'.strtolower($module).'/langs/'.$newlangcode; + $result = dolCopyDir($srcfile, $destfile, 0, 0); +} + if ($dirins && $action == 'initobject' && $module && $objectname) { if (preg_match('/[^a-z0-9_]/i', $objectname)) @@ -643,16 +651,51 @@ if ($dirins && $action == 'generatedoc') $arrayversion=explode('.',$moduleobj->version,3); if (count($arrayversion)) { - $FILENAMEDOC=$modulelowercase.'.html'; + $FILENAMEASCII=$modulelowercase.'.asciidoc'; + $FILENAMEDOC=$modulelowercase.'.html'; // TODO Use/text PDF $dirofmodule = dol_buildpath($modulelowercase, 0).'/doc'; + $dirofmoduletmp = dol_buildpath($modulelowercase, 0).'/doc/temp'; $outputfiledoc = $dirofmodule.'/'.$FILENAMEDOC; if ($dirofmodule) { if (! dol_is_dir($dirofmodule)) dol_mkdir($dirofmodule); - //... + if (! dol_is_dir($dirofmoduletmp)) dol_mkdir($dirofmoduletmp); - $result = 0; + + $srcfile=$dirofmodule.'/Specifications.asciidoc'; + $destfile=$dirofmoduletmp.'/'.$FILENAMEASCII; + dol_copy($srcfile, $destfile, 0, 1); + + $fhandle = fopen($dirofmoduletmp.'/'.$FILENAMEASCII, 'a+'); + if ($fhandle) + { + fwrite($fhandle, "\n\n\n== DATA SPECIFICATIONS...\n\n"); + + // TODO + fwrite($fhandle, "TODO..."); + + fclose($fhandle); + } + + $conf->global->MODULEBUILDER_ASCIIDOCTOR='asciidoctor'; + if (empty($conf->global->MODULEBUILDER_ASCIIDOCTOR)) + { + dol_print_error('', 'Module setup not complete'); + exit; + } + + $command=$conf->global->MODULEBUILDER_ASCIIDOCTOR.' '.$destfile.' -n -o '.$dirofmodule.'/'.$FILENAMEDOC; + $outfile=$dirofmoduletmp.'/out.tmp'; + + require_once DOL_DOCUMENT_ROOT.'/core/class/utils.class.php'; + $utils = new Utils($db); + $resarray = $utils->executeCLI($command, $outfile); + if ($resarray['result'] != '0') + { + setEventMessages($resarray['error'].' '.$resarray['output'], null, 'errors'); + } + $result = ($resarray['result'] == 0) ? 1 : 0; } else { @@ -1062,15 +1105,15 @@ elseif (! empty($module)) print $langs->trans("ModuleBuilderDesc".$tab).'

'; - print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; + print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; - print ' '.$langs->trans("ReadmeFile").' : '.$pathtofilereadme.''; + print ' '.$langs->trans("ReadmeFile").' : '.$pathtofilereadme.''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; - print ' '.$langs->trans("ChangeLog").' : '.$pathtochangelog.''; + print ' '.$langs->trans("ChangeLog").' : '.$pathtochangelog.''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; @@ -1213,14 +1256,14 @@ elseif (! empty($module)) print $langs->trans("SpecDefDesc").'
'; print '
'; - $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)$', array('\/temp\/')); foreach ($specs as $spec) { $pathtofile = $modulelowercase.'/doc/'.$spec['relativename']; $format='asciidoc'; if (preg_match('/\.md$/i', $spec['name'])) $format='markdown'; - print ' '.$langs->trans("SpecificationFile").' : '.$pathtofile.''; + print ' '.$langs->trans("SpecificationFile").' : '.$pathtofile.''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; } @@ -1270,7 +1313,7 @@ elseif (! empty($module)) print ''; print ''; print ''; - print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'MAIN_LANG_DEFAULT', 1, 0, 0, 0, 0, 'minwidth300', 1); + print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'newlangcode', 0, 0, 1, 0, 0, 'minwidth300', 1); print '
'; print ''; @@ -1282,7 +1325,7 @@ elseif (! empty($module)) foreach ($langfiles as $langfile) { $pathtofile = $modulelowercase.'/langs/'.$langfile['relativename']; - print ' '.$langs->trans("LanguageFile").' '.basename(dirname($pathtofile)).' : '.$pathtofile.''; + print ' '.$langs->trans("LanguageFile").' '.basename(dirname($pathtofile)).' : '.$pathtofile.''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; } @@ -1443,37 +1486,37 @@ elseif (! empty($module)) $realpathtopicto = dol_buildpath($pathtopicto, 0, 1); print '
'; - print ' '.$langs->trans("ClassFile").' : '.($realpathtoclass?'':'').$pathtoclass.($realpathtoclass?'':'').''; + print ' '.$langs->trans("ClassFile").' : '.($realpathtoclass?'':'').$pathtoclass.($realpathtoclass?'':'').''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; - print ' '.$langs->trans("ApiClassFile").' : '.($realpathtoapi?'':'').$pathtoapi.($realpathtoapi?'':'').''; + print ' '.$langs->trans("ApiClassFile").' : '.($realpathtoapi?'':'').$pathtoapi.($realpathtoapi?'':'').''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '   '.$langs->trans("GoToApiExplorer").''; print '
'; - print ' '.$langs->trans("TestClassFile").' : '.($realpathtophpunit?'':'').$pathtophpunit.($realpathtophpunit?'':'').''; + print ' '.$langs->trans("TestClassFile").' : '.($realpathtophpunit?'':'').$pathtophpunit.($realpathtophpunit?'':'').''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; print '
'; - print ' '.$langs->trans("PageForLib").' : '.($realpathtolib?'':'').$pathtolib.($realpathtodocument?'':'').''; + print ' '.$langs->trans("PageForLib").' : '.($realpathtolib?'':'').$pathtolib.($realpathtodocument?'':'').''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; - print ' '.$langs->trans("PageForPicto").' : '.($realpathtopicto?'':'').$pathtopicto.($realpathtopicto?'':'').''; + print ' '.$langs->trans("Image").' : '.($realpathtopicto?'':'').$pathtopicto.($realpathtopicto?'':'').''; //print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; print '
'; - print ' '.$langs->trans("SqlFile").' : '.($realpathtosql?'':'').$pathtosql.($realpathtosql?'':'').''; + print ' '.$langs->trans("SqlFile").' : '.($realpathtosql?'':'').$pathtosql.($realpathtosql?'':'').''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; - print '   '.$langs->trans("DropTableIfEmpty").''; + print '   '.$langs->trans("DropTableIfEmpty").''; //print '   '.$langs->trans("RunSql").''; print '
'; - print ' '.$langs->trans("SqlFileExtraFields").' : '.($realpathtosqlextra?'':'').$pathtosqlextra.($realpathtosqlextra?'':'').''; + print ' '.$langs->trans("SqlFileExtraFields").' : '.($realpathtosqlextra?'':'').$pathtosqlextra.($realpathtosqlextra?'':'').''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; //print '   '.$langs->trans("RunSql").''; print '
'; - print ' '.$langs->trans("SqlFileKey").' : '.($realpathtosqlkey?'':'').$pathtosqlkey.($realpathtosqlkey?'':'').''; + print ' '.$langs->trans("SqlFileKey").' : '.($realpathtosqlkey?'':'').$pathtosqlkey.($realpathtosqlkey?'':'').''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; //print '   '.$langs->trans("RunSql").''; print '
'; @@ -1485,19 +1528,19 @@ elseif (! empty($module)) $urlofcard = dol_buildpath($pathtocard, 1); print '
'; - print ' '.$langs->trans("PageForList").' : '.($realpathtosql?'':'').$pathtolist.($realpathtosql?'':'').''; + print ' '.$langs->trans("PageForList").' : '.($realpathtosql?'':'').$pathtolist.($realpathtosql?'':'').''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; - print ' '.$langs->trans("PageForCreateEditView").' : '.($realpathtocard?'':'').$pathtocard.($realpathtocard?'':'').'?action=create'; + print ' '.$langs->trans("PageForCreateEditView").' : '.($realpathtocard?'':'').$pathtocard.($realpathtocard?'':'').'?action=create'; print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; - print ' '.$langs->trans("PageForAgendaTab").' : '.($realpathtoagenda?'':'').$pathtoagenda.($realpathtoagenda?'':'').''; + print ' '.$langs->trans("PageForAgendaTab").' : '.($realpathtoagenda?'':'').$pathtoagenda.($realpathtoagenda?'':'').''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; - print ' '.$langs->trans("PageForDocumentTab").' : '.($realpathtodocument?'':'').$pathtodocument.($realpathtodocument?'':'').''; + print ' '.$langs->trans("PageForDocumentTab").' : '.($realpathtodocument?'':'').$pathtodocument.($realpathtodocument?'':'').''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; - print ' '.$langs->trans("PageForNoteTab").' : '.($realpathtonote?'':'').$pathtonote.($realpathtonote?'':'').''; + print ' '.$langs->trans("PageForNoteTab").' : '.($realpathtonote?'':'').$pathtonote.($realpathtonote?'':'').''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; @@ -1742,13 +1785,14 @@ elseif (! empty($module)) print $langs->trans("MenusDefDesc", ''.$langs->trans('Menus').'').'
'; print '
'; - print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; + print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; print '
'; - //print load_fiche_titre($langs->trans("MenusList"), '', ''); + print load_fiche_titre($langs->trans("ListOfMenusEntries"), '', ''); + print 'TODO...'; print '
'; print ''; print ''; @@ -1866,7 +1910,7 @@ elseif (! empty($module)) print $langs->trans("PermissionsDefDesc", ''.$langs->trans('DefaultPermissions').'').'
'; print '
'; - print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; + print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; @@ -1988,12 +2032,12 @@ elseif (! empty($module)) print '
'; $pathtofile = $modulelowercase.'/core/modules/mod'.$module.'.class.php'; - print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; + 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 ' '.$langs->trans("HooksFile").' : '.$pathtohook.''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; } @@ -2042,7 +2086,7 @@ elseif (! empty($module)) { $pathtofile = $trigger['relpath']; - print ' '.$langs->trans("TriggersFile").' : '.$pathtofile.''; + print ' '.$langs->trans("TriggersFile").' : '.$pathtofile.''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; } @@ -2093,7 +2137,7 @@ elseif (! empty($module)) { $pathtofile = $widget['relpath']; - print ' '.$langs->trans("WidgetFile").' : '.$pathtofile.''; + print ' '.$langs->trans("WidgetFile").' : '.$pathtofile.''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; } @@ -2138,10 +2182,10 @@ elseif (! empty($module)) if ($action != 'editfile' || empty($file)) { - print $langs->trans("CronJobDefDesc", ''.$langs->trans('CronList').'').'
'; + print $langs->trans("CronJobDefDesc", ''.$langs->transnoentities('CronList').'').'
'; print '
'; - print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; + print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; @@ -2296,11 +2340,13 @@ elseif (! empty($module)) $FILENAMEDOC=$modulelowercase.'.html'; $outputfiledoc = dol_buildpath($modulelowercase, 0).'/doc/'.$FILENAMEDOC; + $outputfiledocurl = dol_buildpath($modulelowercase, 1).'/doc/'.$FILENAMEDOC; + // TODO Use/test PDF } print '
'; - print ' '. $langs->trans("PathToModulePackage") . ' : '; + print ' '. $langs->trans("PathToModulePackage") . ' : '; if (! dol_is_file($outputfilezip)) print ''.$langs->trans("FileNotYetGenerated").''; else { $relativepath = $modulelowercase.'/bin/'.$FILENAMEZIP; @@ -2320,10 +2366,14 @@ elseif (! empty($module)) print '


'; - print ' '. $langs->trans("PathToModuleDocumentation") . ' : '; + print ' '. $langs->trans("PathToModuleDocumentation") . ' : '; if (! dol_is_file($outputfiledoc)) print ''.$langs->trans("FileNotYetGenerated").''; else { - print ''.$outputfiledoc.''; + print ''; + print ''; + print $outputfiledoc; + print ''; + print ''; print ' ('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledoc), 'dayhour').')'; } print '
'; diff --git a/htdocs/modulebuilder/template/doc/Specifications.asciidoc b/htdocs/modulebuilder/template/doc/Specifications.asciidoc index adfaeb4e9b5..4610cb188f9 100644 --- a/htdocs/modulebuilder/template/doc/Specifications.asciidoc +++ b/htdocs/modulebuilder/template/doc/Specifications.asciidoc @@ -1,38 +1,11 @@ = MYMODULE = -Copyright (C) ---Put here your own copyright and developer email--- :subtitle: MYMODULE SPECIFICATIONS -== Topic of document - -This document was build from following input: - -* Date 1 -... - -* Date 2 -... - - -The document includes an introductory chapter of functional specifications, presenting the different actors involved in the rebuild of the definitions -of business terms that will be used (some of which may be new or different). -The main following chapter will present the entire process, also known as *uses cases*, according to a principle of a description, in chronological sequence if possible, -to present the actor and the action performed, as in the following example: - -* *X* Actor realizes Action A. -* *Y* Actor communicates Info B to Actor *Z* -* *Automaton* performs update of data for... -* Etc ... - -Functional requirements are complemented by a chapter of technical requirements. -The chapter on data lists key information specific to Presto that were identified at the time of writing specification. It will be enriched as -iterations occurs. - -Finally, in the Appendix, the documents known when writing this document are centralized to illustrate the existing document or inspire the new expected one. -These documents have their content directly integrated in this specification or have a reference to -external documents stored in the *Appendices* directory accompanying this document. +== TOPIC OF DOCUMENT +This document describe specifications of module MyModule *Log of versions* @@ -40,88 +13,14 @@ external documents stored in the *Appendices* directory accompanying this docume [options="header",format="csv"] |=== Author, Date, Version -John Doe, Date YYY-MM-DD, Version 1.0 +---Put here your own copyright and developer email---, Date YYY-MM-DD, Version 1.0 |=== - -<<< - - -== BUSINESS SPECIFICATIONS - INTRODUCTION - -=== List of actors [[actors]] - -Actors are physical people or moral entities working on at least one process. -The following chart prensts list of actors or partners identified by the project for the defined scope of project. We will use then the name defined into first column to speak about roles in the rest of documents. - -[options="header",format="csv"] -|=== -Actor/profil/role, Description of role, Access to system or not, Example of actor -Customer Service, Receive and create Sales orders (SO), Yes, Mr Smith -Purchase, Make puchase order (PO), Yes, 5 people -Administrator - IT, Administration of users/groups and IT services, Yes, John Doe -Automaton, Execute automatic data processing, Yes, NA -|=== - - -=== Definitions [[definitions]] - -To understand the descriptions of the target process, it was necessary to define or redefine some vocabulary concepts. We must see these definitions as defined in the -new system. Indeed, some terms are already being used but have either not a definition in line with standards, or even differs between services. To bring everyone, -and to consolidate the process, these terms are redefined here, and with their definition in the target objective. - -*Definition ABC* - -... - -*Definition DEF* - -... - - [NOTE] ============== -Important information will be noticed with a notice like this one. - -* Main information 1 -* Main information 2 +This document was generated using Dolibarr ERP CRM process ============== - - -== BUSINESS SPECIFICATION - PROCESS - -Specifications were cut into different business process. We call a business process a workflow with a starting situation and ending situation. Between start and end, we will find actions -done by actors to bring the value of the company. This actions are described using the syntax rule: -*Actor X* do action Y, *Actor Z* do action W. - -_Each process/use case is described into a separate chapter._ - - -=== Use case / Process 1 [[process_1]] - -==== Title and goals - -... - -==== Actors or roles - -* Members of group *...* - -==== Standard flow - -* Members of Groupe *...*: Do ... -* Members of Groupe *...*: Do ... -* Members of Groupe *...*: Do ... - -==== Alternative flow - -* A user without role *...*: Can't do ... - -==== Business rules - -* Business rule 1 -* Business rule 2 - +<<< diff --git a/htdocs/modulebuilder/template/doc/Specifications_full_en.asciidoc b/htdocs/modulebuilder/template/doc/Specifications_full_en.asciidoc new file mode 100644 index 00000000000..72d1d5f4d82 --- /dev/null +++ b/htdocs/modulebuilder/template/doc/Specifications_full_en.asciidoc @@ -0,0 +1,126 @@ += MYMODULE = +:subtitle: MYMODULE SPECIFICATIONS + + + +== TOPIC OF DOCUMENT + +This document was build from following input: + +* Date 1 +... + +* Date 2 +... + + +The document includes an introductory chapter of functional specifications, presenting the different actors involved in the rebuild of the definitions +of business terms that will be used (some of which may be new or different). +The main following chapter will present the entire process, also known as *uses cases*, according to a principle of a description, in chronological sequence if possible, +to present the actor and the action performed, as in the following example: + +* *X* Actor realizes Action A. +* *Y* Actor communicates Info B to Actor *Z* +* *Automaton* performs update of data for... +* Etc ... + +Functional requirements are complemented by a chapter of technical requirements. +The chapter on data lists key information specific to Presto that were identified at the time of writing specification. It will be enriched as +iterations occurs. + +Finally, in the Appendix, the documents known when writing this document are centralized to illustrate the existing document or inspire the new expected one. +These documents have their content directly integrated in this specification or have a reference to +external documents stored in the *Appendices* directory accompanying this document. + + + +*Log of versions* + +[options="header",format="csv"] +|=== +Author, Date, Version +John Doe, Date YYY-MM-DD, Version 1.0 +|=== + + + +<<< + + +== BUSINESS SPECIFICATIONS - INTRODUCTION + +=== List of actors [[actors]] + +Actors are physical people or moral entities working on at least one process. +The following chart prensts list of actors or partners identified by the project for the defined scope of project. We will use then the name defined into first column to speak about roles in the rest of documents. + +[options="header",format="csv"] +|=== +Actor/profil/role, Description of role, Access to system or not, Example of actor +Customer Service, Receive and create Sales orders (SO), Yes, Mr Smith +Purchase, Make puchase order (PO), Yes, 5 people +Administrator - IT, Administration of users/groups and IT services, Yes, John Doe +Automaton, Execute automatic data processing, Yes, NA +|=== + + +=== Definitions [[definitions]] + +To understand the descriptions of the target process, it was necessary to define or redefine some vocabulary concepts. We must see these definitions as defined in the +new system. Indeed, some terms are already being used but have either not a definition in line with standards, or even differs between services. To bring everyone, +and to consolidate the process, these terms are redefined here, and with their definition in the target objective. + +*Definition ABC* + +... + +*Definition DEF* + +... + + +[NOTE] +============== +Important information will be noticed with a notice like this one. + +* Main information 1 +* Main information 2 +============== + + + +== BUSINESS SPECIFICATION - PROCESS + +Specifications were cut into different business process. We call a business process a workflow with a starting situation and ending situation. Between start and end, we will find actions +done by actors to bring the value of the company. This actions are described using the syntax rule: +*Actor X* do action Y, *Actor Z* do action W. + +_Each process/use case is described into a separate chapter._ + + +=== Use case / Process 1 [[process_1]] + +==== Title and goals + +... + +==== Actors or roles + +* Members of group *...* + +==== Standard flow + +* Members of Groupe *...*: Do ... +* Members of Groupe *...*: Do ... +* Members of Groupe *...*: Do ... + +==== Alternative flow + +* A user without role *...*: Can't do ... + +==== Business rules + +* Business rule 1 +* Business rule 2 + + diff --git a/htdocs/modulebuilder/template/langs/en_US/mymodule.lang b/htdocs/modulebuilder/template/langs/en_US/mymodule.lang index a37d8e0c241..314e5a7269b 100644 --- a/htdocs/modulebuilder/template/langs/en_US/mymodule.lang +++ b/htdocs/modulebuilder/template/langs/en_US/mymodule.lang @@ -18,16 +18,16 @@ # # Module label 'ModuleMyModuleName' -ModuleMyModuleName = My module +ModuleMyModuleName = MyModule # Module description 'ModuleMyModuleDesc' -ModuleMyModuleDesc = My module description +ModuleMyModuleDesc = MyModule description # # Admin page # -MyModuleSetup = My module setup +MyModuleSetup = MyModule setup Settings = Settings -MyModuleSetupPage = My module setup page +MyModuleSetupPage = MyModule setup page MYMODULE_MYPARAM1 = My param 1 MYMODULE_MYPARAM1Tooltip = My param 1 tooltip MYMODULE_MYPARAM2=My param 2 @@ -38,8 +38,8 @@ MYMODULE_MYPARAM2Tooltip=My param 2 tooltip # About page # About = About -MyModuleAbout = About my module -MyModuleAboutPage = My module about page +MyModuleAbout = About MyModule +MyModuleAboutPage = MyModule about page # # Sample page @@ -47,7 +47,7 @@ MyModuleAboutPage = My module about page MyPageName = My page name # -# Sample box +# Sample widget # MyWidget = My widget -MyWidgetDescription = My widget description \ No newline at end of file +MyWidgetDescription = My widget description diff --git a/htdocs/modulebuilder/template/langs/fr_FR/mymodule.lang b/htdocs/modulebuilder/template/langs/fr_FR/mymodule.lang index aa271536edf..740734ce04c 100644 --- a/htdocs/modulebuilder/template/langs/fr_FR/mymodule.lang +++ b/htdocs/modulebuilder/template/langs/fr_FR/mymodule.lang @@ -20,21 +20,21 @@ # Module label 'ModuleMyModuleName' ModuleMyModuleName = Mon module # Module description 'ModuleMyModuleDesc' -ModuleMyModuleDesc = Description de mon module +ModuleMyModuleDesc = Description de MyModule # # Page d'administration # -MyModuleSetup = Configuration du module mon module +MyModuleSetup = Configuration du module MyModule Settings = Réglages -MyModuleSetupPage = Page de réglage de mon module +MyModuleSetupPage = Page de configuration du module MyModule # # Page À propos # About = À propos -MyModuleAbout = À propos de mon module -MyModuleAboutPage = Page à propos de mon module +MyModuleAbout = À propos de MyModule +MyModuleAboutPage = Page à propos de MyModule # # Page d'exemple diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 66d5365bc8e..b9eaac506e9 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -854,6 +854,7 @@ select.selectarrowonleft option { .titlefield { width: 25%; } .titlefieldmiddle { width: 50%; } .imgmaxwidth180 { max-width: 180px; } +.imgmaxheight50 { max-height: 50px; } .width20p { width:20%; } .width25p { width:25%; }