diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php
index 43f679541ab..31514435cd7 100644
--- a/htdocs/modulebuilder/index.php
+++ b/htdocs/modulebuilder/index.php
@@ -967,12 +967,14 @@ elseif (! empty($module))
$linktoenabledisable.=img_picto($langs->trans("Disabled"),'switch_off');
$linktoenabledisable.="\n";
}
-
- $modulestatusinfo=img_info('').' '.$langs->trans("ModuleIsNotActive", $urltomodulesetup);
- if (! empty($conf->$module->enabled))
+ if (! empty($conf->$modulelowercase->enabled))
{
$modulestatusinfo=img_warning().' '.$langs->trans("ModuleIsLive");
}
+ else
+ {
+ $modulestatusinfo=img_info('').' '.$langs->trans("ModuleIsNotActive", $urltomodulesetup);
+ }
$head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=description&module='.$module.($forceddirread?'@'.$dirread:'');
$head2[$h][1] = $langs->trans("Description");
@@ -1308,12 +1310,12 @@ elseif (! empty($module))
//$objectname = preg_replace('/\.txt$/', '', $fileobj['name']);
$objectname = $reg[1];
if (empty($firstobjectname)) $firstobjectname = $objectname;
- }
- $head3[$h][0] = $_SERVER["PHP_SELF"].'?tab=objects&module='.$module.($forceddirread?'@'.$dirread:'').'&tabobj='.$objectname;
- $head3[$h][1] = $objectname;
- $head3[$h][2] = $objectname;
- $h++;
+ $head3[$h][0] = $_SERVER["PHP_SELF"].'?tab=objects&module='.$module.($forceddirread?'@'.$dirread:'').'&tabobj='.$objectname;
+ $head3[$h][1] = $objectname;
+ $head3[$h][2] = $objectname;
+ $h++;
+ }
}
$head3[$h][0] = $_SERVER["PHP_SELF"].'?tab=objects&module='.$module.($forceddirread?'@'.$dirread:'').'&tabobj=deleteobject';
@@ -1483,98 +1485,105 @@ elseif (! empty($module))
print '
| ';
print '';
- // Line to add a property
- print '';
- print ' | ';
- print ' | ';
- print ' | ';
- print ' | ';
- //print ' | ';
- print ' | ';
- print ' | ';
- print ' | ';
- print ' | ';
- print ' | ';
- print ' | ';
- print ' | ';
- print '';
- print '';
- print ' |
';
-
$properties = dol_sort_array($tmpobjet->fields, 'position');
- foreach($properties as $propkey => $propval)
+ if (! empty($properties))
{
- /* If from Reflection
- if ($propval->class == $tabobj)
- {
- $propname=$propval->getName();
- $comment=$propval->getDocComment();
- $type=gettype($tmpobjet->$propname);
- $default=$propdefault[$propname];
- // Discard generic properties
- if (in_array($propname, array('element', 'childtables', 'table_element', 'table_element_line', 'class_element_line', 'isnolinkedbythird', 'ismultientitymanaged'))) continue;
+ // Line to add a property
+ print '';
+ print ' | ';
+ print ' | ';
+ print ' | ';
+ print ' | ';
+ //print ' | ';
+ print ' | ';
+ print ' | ';
+ print ' | ';
+ print ' | ';
+ print ' | ';
+ print ' | ';
+ print ' | ';
+ print '';
+ print '';
+ print ' |
';
- // Keep or not lines
- if (in_array($propname, array('fk_element', 'lines'))) continue;
- }*/
+ foreach($properties as $propkey => $propval)
+ {
+ /* If from Reflection
+ if ($propval->class == $tabobj)
+ {
+ $propname=$propval->getName();
+ $comment=$propval->getDocComment();
+ $type=gettype($tmpobjet->$propname);
+ $default=$propdefault[$propname];
+ // Discard generic properties
+ if (in_array($propname, array('element', 'childtables', 'table_element', 'table_element_line', 'class_element_line', 'isnolinkedbythird', 'ismultientitymanaged'))) continue;
- $propname=$propkey;
- $proplabel=$propval['label'];
- $proptype=$propval['type'];
- $propnotnull=$propval['notnull'];
- $propsearchall=$propval['searchall'];
- //$propdefault=$propval['default'];
- $propindex=$propval['index'];
- $propposition=$propval['position'];
- $propenabled=$propval['enabled'];
- $propvisible=$propval['visible'];
- $propisameasure=$propval['isameasure'];
- $propcomment=$propval['comment'];
+ // Keep or not lines
+ if (in_array($propname, array('fk_element', 'lines'))) continue;
+ }*/
- print '';
+ $propname=$propkey;
+ $proplabel=$propval['label'];
+ $proptype=$propval['type'];
+ $propnotnull=$propval['notnull'];
+ $propsearchall=$propval['searchall'];
+ //$propdefault=$propval['default'];
+ $propindex=$propval['index'];
+ $propposition=$propval['position'];
+ $propenabled=$propval['enabled'];
+ $propvisible=$propval['visible'];
+ $propisameasure=$propval['isameasure'];
+ $propcomment=$propval['comment'];
- print '| ';
- print $propname;
- print ' | ';
- print '';
- print $proplabel;
- print ' | ';
- print '';
- print $proptype;
- print ' | ';
- print '';
- print $propnotnull;
- print ' | ';
- /*print '';
- print $propdefault;
- print ' | ';*/
- print '';
- print $propindex?'X':'';
- print ' | ';
- print '';
- print $propposition;
- print ' | ';
- print '';
- print $propenabled?$propenabled:'';
- print ' | ';
- print '';
- print $propvisible?$propvisible:'';
- print ' | ';
- print '';
- print $propisameasure?$propisameasure:'';
- print ' | ';
- print '';
- print $propsearchall?'X':'';
- print ' | ';
- print '';
- print $propcomment;
- print ' | ';
- print '';
- print ''.img_delete().'';
- print ' | ';
+ print '
';
- print '
';
+ print '';
+ print $propname;
+ print ' | ';
+ print '';
+ print $proplabel;
+ print ' | ';
+ print '';
+ print $proptype;
+ print ' | ';
+ print '';
+ print $propnotnull;
+ print ' | ';
+ /*print '';
+ print $propdefault;
+ print ' | ';*/
+ print '';
+ print $propindex?'X':'';
+ print ' | ';
+ print '';
+ print $propposition;
+ print ' | ';
+ print '';
+ print $propenabled?$propenabled:'';
+ print ' | ';
+ print '';
+ print $propvisible?$propvisible:'';
+ print ' | ';
+ print '';
+ print $propisameasure?$propisameasure:'';
+ print ' | ';
+ print '';
+ print $propsearchall?'X':'';
+ print ' | ';
+ print '';
+ print $propcomment;
+ print ' | ';
+ print '';
+ print ''.img_delete().'';
+ print ' | ';
+
+ print '';
+ }
+ }
+ else
+ {
+ print '| '.$langs->trans('Property $field not found into the class. The class was probably not generated by modulebuilder.').' |
';
}
print '';
print '';