';
print '';
- print '';
+ print '| ';
print $langs->trans('Contract');
print ' | ';
if ($action != 'contrat')
{
- print 'id.'">';
+ print ' | id.'">';
print img_edit($langs->trans('SetContract'), 1);
print ' | ';
}
diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php
index 24a42a034a9..429341cb490 100644
--- a/htdocs/fichinter/class/fichinter.class.php
+++ b/htdocs/fichinter/class/fichinter.class.php
@@ -701,51 +701,36 @@ class Fichinter extends CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
- * Returns the label of a statut
+ * Returns the label of a status
*
- * @param int $statut id statut
+ * @param int $status Id status
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
* @return string Label
*/
- public function LibStatut($statut, $mode = 0)
+ public function LibStatut($status, $mode = 0)
{
// phpcs:enable
// Init/load array of translation of status
- if (empty($this->statuts) || empty($this->statuts_short))
+ if (empty($this->statuts) || empty($this->statuts_short) || empty($this->statuts_logo))
{
global $langs;
$langs->load("fichinter");
- $this->statuts[0]=$langs->trans('Draft');
- $this->statuts[1]=$langs->trans('Validated');
- $this->statuts[2]=$langs->trans('StatusInterInvoiced');
- $this->statuts[3]=$langs->trans('Done');
- $this->statuts_short[0]=$langs->trans('Draft');
- $this->statuts_short[1]=$langs->trans('Validated');
- $this->statuts_short[2]=$langs->trans('StatusInterInvoiced');
- $this->statuts_short[3]=$langs->trans('Done');
- $this->statuts_logo[0]='statut0';
- $this->statuts_logo[1]='statut1';
- $this->statuts_logo[2]='statut6';
- $this->statuts_logo[3]='statut6';
+ $this->statuts[self::STATUS_DRAFT]=$langs->trans('Draft');
+ $this->statuts[self::STATUS_VALIDATED]=$langs->trans('Validated');
+ $this->statuts[self::STATUS_BILLED]=$langs->trans('StatusInterInvoiced');
+ $this->statuts[self::STATUS_CLOSED]=$langs->trans('Done');
+ $this->statuts_short[self::STATUS_DRAFT]=$langs->trans('Draft');
+ $this->statuts_short[self::STATUS_VALIDATED]=$langs->trans('Validated');
+ $this->statuts_short[self::STATUS_BILLED]=$langs->trans('StatusInterInvoiced');
+ $this->statuts_short[self::STATUS_CLOSED]=$langs->trans('Done');
+ $this->statuts_logo[self::STATUS_DRAFT]='status0';
+ $this->statuts_logo[self::STATUS_VALIDATED]='status1';
+ $this->statuts_logo[self::STATUS_BILLED]='status6';
+ $this->statuts_logo[self::STATUS_CLOSED]='status6';
}
- if ($mode == 0)
- return $this->statuts[$statut];
- elseif ($mode == 1)
- return $this->statuts_short[$statut];
- elseif ($mode == 2)
- return img_picto($this->statuts_short[$statut], $this->statuts_logo[$statut]).' '.$this->statuts_short[$statut];
- elseif ($mode == 3)
- return img_picto($this->statuts_short[$statut], $this->statuts_logo[$statut]);
- elseif ($mode == 4)
- return img_picto($this->statuts_short[$statut], $this->statuts_logo[$statut]).' '.$this->statuts[$statut];
- elseif ($mode == 5)
- return ''.$this->statuts_short[$statut].' '.img_picto($this->statuts[$statut], $this->statuts_logo[$statut]);
- elseif ($mode == 6)
- return ''.$this->statuts[$statut].' '.img_picto($this->statuts[$statut], $this->statuts_logo[$statut]);
-
- return '';
+ return dolGetStatus($this->statuts[$status], $this->statuts_short[$status], '', $this->statuts_logo[$status], $mode);
}
/**
diff --git a/htdocs/langs/en_US/interventions.lang b/htdocs/langs/en_US/interventions.lang
index e7667ef6946..e65b966ea09 100644
--- a/htdocs/langs/en_US/interventions.lang
+++ b/htdocs/langs/en_US/interventions.lang
@@ -60,6 +60,7 @@ InterDateCreation=Date creation intervention
InterDuration=Duration intervention
InterStatus=Status intervention
InterNote=Note intervention
+InterLine=Line of intervention
InterLineId=Line id intervention
InterLineDate=Line date intervention
InterLineDuration=Line duration intervention
diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang
index 32ad40ea6c6..1f8399d939a 100644
--- a/htdocs/langs/en_US/modulebuilder.lang
+++ b/htdocs/langs/en_US/modulebuilder.lang
@@ -79,6 +79,7 @@ NoTrigger=No trigger
NoWidget=No widget
GoToApiExplorer=Go to API explorer
ListOfMenusEntries=List of menu entries
+ListOfDictionariesEntries=List of dictionaries entries
ListOfPermissionsDefined=List of defined permissions
SeeExamples=See examples here
EnabledDesc=Condition to have this field active (Examples: 1 or $conf->global->MYMODULE_MYOPTION)
@@ -88,8 +89,10 @@ SearchAllDesc=Is the field used to make a search from the quick search tool? (Ex
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
+DictionariesDefDesc=Define here the dictionaries provided by your module
PermissionsDefDesc=Define here the new permissions provided by your module
MenusDefDescTooltip=The menus provided by your module/application are defined into the array $this->menus into the module descriptor file. You can edit manually this file or use the embedded editor.
Note: Once defined (and module re-activated), menus are also visible into the menu editor available to administrator users on %s.
+DictionariesDefDescTooltip=The dictionaries provided by your module/application are defined into the array $this->dictionaries into the module descriptor file. You can edit manually this file or use the embedded editor.
Note: Once defined (and module re-activated), dictionaries are also visible into the setup area to administrator users on %s.
PermissionsDefDescTooltip=The permissions provided by your module/application are defined into the array $this->rights into the module descriptor file. You can edit manually this file or use the embedded editor.
Note: Once defined (and module re-activated), permissions are visible into the default permissions setup %s.
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 0e09f0567ef..0bb48af3b46 100644
--- a/htdocs/modulebuilder/index.php
+++ b/htdocs/modulebuilder/index.php
@@ -1652,6 +1652,11 @@ elseif (! empty($module))
$head2[$h][2] = 'languages';
$h++;
+ $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=dictionaries&module='.$module.($forceddirread?'@'.$dirread:'');
+ $head2[$h][1] = $langs->trans("Dictionaries");
+ $head2[$h][2] = 'dictionaries';
+ $h++;
+
$head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=objects&module='.$module.($forceddirread?'@'.$dirread:'');
$head2[$h][1] = $langs->trans("Objects");
$head2[$h][2] = 'objects';
@@ -1945,6 +1950,139 @@ elseif (! empty($module))
}
}
+ if ($tab == 'dictionaries')
+ {
+ $pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
+
+ $dicts = $moduleobj->dictionaries;
+
+ if ($action != 'editfile' || empty($file))
+ {
+ print '';
+ $htmlhelp=$langs->trans("DictionariesDefDescTooltip", ''.$langs->trans('Setup').' - '.$langs->trans('Dictionaries').'');
+ print $form->textwithpicto($langs->trans("DictionariesDefDesc"), $htmlhelp, 1, 'help', '', 0, 2, 'helpondesc').' ';
+ print '';
+ print ' ';
+
+ print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.'';
+ print ' '.img_picto($langs->trans("Edit"), 'edit').'';
+ print ' ';
+ print ' '.$langs->trans("LanguageFile").' : '.$dicts['langs'].' ';
+
+ print load_fiche_titre($langs->trans("ListOfDictionariesEntries"), '', '');
+
+ print '';
+ }
+ else
+ {
+ $fullpathoffile=dol_buildpath($file, 0);
+
+ $content = file_get_contents($fullpathoffile);
+
+ // New module
+ print '';
+ }
+ }
+
if ($tab == 'objects')
{
$head3 = array();
diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php
index 06c8f583f44..026f46fb925 100644
--- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php
+++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php
@@ -183,25 +183,25 @@ class modMyModule extends DolibarrModules
$this->dictionaries=array();
/* Example:
$this->dictionaries=array(
- 'langs'=>'mylangfile@mymodule',
+ 'langs'=>'mymodule@mymodule',
// List of tables we want to see into dictonnary editor
- 'tabname'=>array(MAIN_DB_PREFIX."table1",MAIN_DB_PREFIX."table2",MAIN_DB_PREFIX."table3"),
+ 'tabname'=>array(MAIN_DB_PREFIX."table1", MAIN_DB_PREFIX."table2", MAIN_DB_PREFIX."table3"),
// Label of tables
- 'tablib'=>array("Table1","Table2","Table3"),
+ 'tablib'=>array("Table1", "Table2", "Table3"),
// Request to select fields
- 'tabsql'=>array('SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table1 as f','SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table2 as f','SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table3 as f'),
+ 'tabsql'=>array('SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table1 as f', 'SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table2 as f', 'SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table3 as f'),
// Sort order
- 'tabsqlsort'=>array("label ASC","label ASC","label ASC"),
+ 'tabsqlsort'=>array("label ASC", "label ASC", "label ASC"),
// List of fields (result of select to show dictionary)
- 'tabfield'=>array("code,label","code,label","code,label"),
+ 'tabfield'=>array("code,label", "code,label", "code,label"),
// List of fields (list of fields to edit a record)
- 'tabfieldvalue'=>array("code,label","code,label","code,label"),
+ 'tabfieldvalue'=>array("code,label", "code,label", "code,label"),
// List of fields (list of fields for insert)
- 'tabfieldinsert'=>array("code,label","code,label","code,label"),
+ 'tabfieldinsert'=>array("code,label", "code,label", "code,label"),
// Name of columns with primary key (try to always name it 'rowid')
- 'tabrowid'=>array("rowid","rowid","rowid"),
+ 'tabrowid'=>array("rowid", "rowid", "rowid"),
// Condition to show each dictionary
- 'tabcond'=>array($conf->mymodule->enabled,$conf->mymodule->enabled,$conf->mymodule->enabled)
+ 'tabcond'=>array($conf->mymodule->enabled, $conf->mymodule->enabled, $conf->mymodule->enabled)
);
*/
|
|