Debug modulebuilder
This commit is contained in:
parent
35d00fd2ec
commit
91beb3a4d6
@ -967,12 +967,14 @@ elseif (! empty($module))
|
|||||||
$linktoenabledisable.=img_picto($langs->trans("Disabled"),'switch_off');
|
$linktoenabledisable.=img_picto($langs->trans("Disabled"),'switch_off');
|
||||||
$linktoenabledisable.="</a>\n";
|
$linktoenabledisable.="</a>\n";
|
||||||
}
|
}
|
||||||
|
if (! empty($conf->$modulelowercase->enabled))
|
||||||
$modulestatusinfo=img_info('').' '.$langs->trans("ModuleIsNotActive", $urltomodulesetup);
|
|
||||||
if (! empty($conf->$module->enabled))
|
|
||||||
{
|
{
|
||||||
$modulestatusinfo=img_warning().' '.$langs->trans("ModuleIsLive");
|
$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][0] = $_SERVER["PHP_SELF"].'?tab=description&module='.$module.($forceddirread?'@'.$dirread:'');
|
||||||
$head2[$h][1] = $langs->trans("Description");
|
$head2[$h][1] = $langs->trans("Description");
|
||||||
@ -1308,12 +1310,12 @@ elseif (! empty($module))
|
|||||||
//$objectname = preg_replace('/\.txt$/', '', $fileobj['name']);
|
//$objectname = preg_replace('/\.txt$/', '', $fileobj['name']);
|
||||||
$objectname = $reg[1];
|
$objectname = $reg[1];
|
||||||
if (empty($firstobjectname)) $firstobjectname = $objectname;
|
if (empty($firstobjectname)) $firstobjectname = $objectname;
|
||||||
}
|
|
||||||
|
|
||||||
$head3[$h][0] = $_SERVER["PHP_SELF"].'?tab=objects&module='.$module.($forceddirread?'@'.$dirread:'').'&tabobj='.$objectname;
|
$head3[$h][0] = $_SERVER["PHP_SELF"].'?tab=objects&module='.$module.($forceddirread?'@'.$dirread:'').'&tabobj='.$objectname;
|
||||||
$head3[$h][1] = $objectname;
|
$head3[$h][1] = $objectname;
|
||||||
$head3[$h][2] = $objectname;
|
$head3[$h][2] = $objectname;
|
||||||
$h++;
|
$h++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$head3[$h][0] = $_SERVER["PHP_SELF"].'?tab=objects&module='.$module.($forceddirread?'@'.$dirread:'').'&tabobj=deleteobject';
|
$head3[$h][0] = $_SERVER["PHP_SELF"].'?tab=objects&module='.$module.($forceddirread?'@'.$dirread:'').'&tabobj=deleteobject';
|
||||||
@ -1483,98 +1485,105 @@ elseif (! empty($module))
|
|||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Line to add a property
|
|
||||||
print '<tr>';
|
|
||||||
print '<td><input class="text" name="propname" value="'.GETPOST('propname','alpha').'"></td>';
|
|
||||||
print '<td><input class="text" name="proplabel" value="'.GETPOST('proplabel','alpha').'"></td>';
|
|
||||||
print '<td><input class="text" name="proptype" value="'.GETPOST('proptype','alpha').'"></td>';
|
|
||||||
print '<td class="center"><input class="text" size="2" name="propnotnull" value="'.GETPOST('propnotnull','alpha').'"></td>';
|
|
||||||
//print '<td><input class="text" name="propdefault" value=""></td>';
|
|
||||||
print '<td class="center"><input class="text" size="2" name="propindex" value="'.GETPOST('propindex','alpha').'"></td>';
|
|
||||||
print '<td class="right"><input class="text right" size="2" name="propposition" value="'.GETPOST('propposition','alpha').'"></td>';
|
|
||||||
print '<td class="center"><input class="text" size="2" name="propenabled" value="'.GETPOST('propenabled','alpha').'"></td>';
|
|
||||||
print '<td class="center"><input class="text" size="2" name="propvisible" value="'.GETPOST('propvisible','alpha').'"></td>';
|
|
||||||
print '<td class="center"><input class="text" size="2" name="propisameasure" value="'.GETPOST('propisameasure','alpha').'"></td>';
|
|
||||||
print '<td class="center"><input class="text" size="2" name="propsearchall" value="'.GETPOST('propsearchall','alpha').'"></td>';
|
|
||||||
print '<td><input class="text" name="propcomment" value="'.GETPOST('propcomment','alpha').'"></td>';
|
|
||||||
print '<td align="center">';
|
|
||||||
print '<input class="button" type="submit" name="add" value="'.$langs->trans("Add").'">';
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
$properties = dol_sort_array($tmpobjet->fields, 'position');
|
$properties = dol_sort_array($tmpobjet->fields, 'position');
|
||||||
|
|
||||||
foreach($properties as $propkey => $propval)
|
if (! empty($properties))
|
||||||
{
|
{
|
||||||
/* If from Reflection
|
// Line to add a property
|
||||||
if ($propval->class == $tabobj)
|
print '<tr>';
|
||||||
{
|
print '<td><input class="text" name="propname" value="'.GETPOST('propname','alpha').'"></td>';
|
||||||
$propname=$propval->getName();
|
print '<td><input class="text" name="proplabel" value="'.GETPOST('proplabel','alpha').'"></td>';
|
||||||
$comment=$propval->getDocComment();
|
print '<td><input class="text" name="proptype" value="'.GETPOST('proptype','alpha').'"></td>';
|
||||||
$type=gettype($tmpobjet->$propname);
|
print '<td class="center"><input class="text" size="2" name="propnotnull" value="'.GETPOST('propnotnull','alpha').'"></td>';
|
||||||
$default=$propdefault[$propname];
|
//print '<td><input class="text" name="propdefault" value=""></td>';
|
||||||
// Discard generic properties
|
print '<td class="center"><input class="text" size="2" name="propindex" value="'.GETPOST('propindex','alpha').'"></td>';
|
||||||
if (in_array($propname, array('element', 'childtables', 'table_element', 'table_element_line', 'class_element_line', 'isnolinkedbythird', 'ismultientitymanaged'))) continue;
|
print '<td class="right"><input class="text right" size="2" name="propposition" value="'.GETPOST('propposition','alpha').'"></td>';
|
||||||
|
print '<td class="center"><input class="text" size="2" name="propenabled" value="'.GETPOST('propenabled','alpha').'"></td>';
|
||||||
|
print '<td class="center"><input class="text" size="2" name="propvisible" value="'.GETPOST('propvisible','alpha').'"></td>';
|
||||||
|
print '<td class="center"><input class="text" size="2" name="propisameasure" value="'.GETPOST('propisameasure','alpha').'"></td>';
|
||||||
|
print '<td class="center"><input class="text" size="2" name="propsearchall" value="'.GETPOST('propsearchall','alpha').'"></td>';
|
||||||
|
print '<td><input class="text" name="propcomment" value="'.GETPOST('propcomment','alpha').'"></td>';
|
||||||
|
print '<td align="center">';
|
||||||
|
print '<input class="button" type="submit" name="add" value="'.$langs->trans("Add").'">';
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
// Keep or not lines
|
foreach($properties as $propkey => $propval)
|
||||||
if (in_array($propname, array('fk_element', 'lines'))) continue;
|
{
|
||||||
}*/
|
/* 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;
|
// Keep or not lines
|
||||||
$proplabel=$propval['label'];
|
if (in_array($propname, array('fk_element', 'lines'))) continue;
|
||||||
$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 '<tr class="oddeven">';
|
$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 '<td>';
|
print '<tr class="oddeven">';
|
||||||
print $propname;
|
|
||||||
print '</td>';
|
|
||||||
print '<td>';
|
|
||||||
print $proplabel;
|
|
||||||
print '</td>';
|
|
||||||
print '<td>';
|
|
||||||
print $proptype;
|
|
||||||
print '</td>';
|
|
||||||
print '<td class="center">';
|
|
||||||
print $propnotnull;
|
|
||||||
print '</td>';
|
|
||||||
/*print '<td>';
|
|
||||||
print $propdefault;
|
|
||||||
print '</td>';*/
|
|
||||||
print '<td class="center">';
|
|
||||||
print $propindex?'X':'';
|
|
||||||
print '</td>';
|
|
||||||
print '<td align="right">';
|
|
||||||
print $propposition;
|
|
||||||
print '</td>';
|
|
||||||
print '<td class="center">';
|
|
||||||
print $propenabled?$propenabled:'';
|
|
||||||
print '</td>';
|
|
||||||
print '<td class="center">';
|
|
||||||
print $propvisible?$propvisible:'';
|
|
||||||
print '</td>';
|
|
||||||
print '<td class="center">';
|
|
||||||
print $propisameasure?$propisameasure:'';
|
|
||||||
print '</td>';
|
|
||||||
print '<td class="center">';
|
|
||||||
print $propsearchall?'X':'';
|
|
||||||
print '</td>';
|
|
||||||
print '<td>';
|
|
||||||
print $propcomment;
|
|
||||||
print '</td>';
|
|
||||||
print '<td class="center">';
|
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=deleteproperty&propertykey='.urlencode($propname).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.urlencode($tabobj).'">'.img_delete().'</a>';
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
print '</tr>';
|
print '<td>';
|
||||||
|
print $propname;
|
||||||
|
print '</td>';
|
||||||
|
print '<td>';
|
||||||
|
print $proplabel;
|
||||||
|
print '</td>';
|
||||||
|
print '<td>';
|
||||||
|
print $proptype;
|
||||||
|
print '</td>';
|
||||||
|
print '<td class="center">';
|
||||||
|
print $propnotnull;
|
||||||
|
print '</td>';
|
||||||
|
/*print '<td>';
|
||||||
|
print $propdefault;
|
||||||
|
print '</td>';*/
|
||||||
|
print '<td class="center">';
|
||||||
|
print $propindex?'X':'';
|
||||||
|
print '</td>';
|
||||||
|
print '<td align="right">';
|
||||||
|
print $propposition;
|
||||||
|
print '</td>';
|
||||||
|
print '<td class="center">';
|
||||||
|
print $propenabled?$propenabled:'';
|
||||||
|
print '</td>';
|
||||||
|
print '<td class="center">';
|
||||||
|
print $propvisible?$propvisible:'';
|
||||||
|
print '</td>';
|
||||||
|
print '<td class="center">';
|
||||||
|
print $propisameasure?$propisameasure:'';
|
||||||
|
print '</td>';
|
||||||
|
print '<td class="center">';
|
||||||
|
print $propsearchall?'X':'';
|
||||||
|
print '</td>';
|
||||||
|
print '<td>';
|
||||||
|
print $propcomment;
|
||||||
|
print '</td>';
|
||||||
|
print '<td class="center">';
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=deleteproperty&propertykey='.urlencode($propname).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.urlencode($tabobj).'">'.img_delete().'</a>';
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<tr><td><span class="warning">'.$langs->trans('Property $field not found into the class. The class was probably not generated by modulebuilder.').'</warning></td></tr>';
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user