Debug modulebuilder

This commit is contained in:
Laurent Destailleur 2017-08-27 13:28:37 +02:00
parent 76b4a2ce06
commit 64bbf35812
3 changed files with 74 additions and 49 deletions

View File

@ -268,11 +268,13 @@ $filepath=$relativepath.$file->label;
$rellink.='&file='.urlencode($filepath); $rellink.='&file='.urlencode($filepath);
$fulllink=$urlwithroot.$rellink; $fulllink=$urlwithroot.$rellink;
print img_picto('','object_globe.png').' '; print img_picto('','object_globe.png').' ';
print '<input type="text" class="quatrevingtpercent" name="downloadlink" value="'.dol_escape_htmltag($fulllink).'">'; print '<input type="text" class="quatrevingtpercent" id="downloadlink" name="downloadlink" value="'.dol_escape_htmltag($fulllink).'">';
print ' <a data-ajax="false" href="'.$fulllink.'">'.$langs->trans("Download").'</a>'; print ' <a href="'.$fulllink.'">'.$langs->trans("Download").'</a>';
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';
print ajax_autoselect('downloadlink');
dol_fiche_end(); dol_fiche_end();
if ($_GET["action"] == 'edit') if ($_GET["action"] == 'edit')

View File

@ -35,6 +35,9 @@ ClassFile=File for PHP DAO CRUD class
ApiClassFile=File for PHP API class ApiClassFile=File for PHP API class
PageForList=PHP page for list of record PageForList=PHP page for list of record
PageForCreateEditView=PHP page to create/edit/view a record PageForCreateEditView=PHP page to create/edit/view a record
PageForAgendaTab=PHP page for event tab
PageForDocumentTab=PHP page for document tab
PageForNoteTab=PHP page for note tab
PathToModulePackage=Path to zip of module/application package PathToModulePackage=Path to zip of module/application package
PathToModuleDocumentation=Path to file of module/application documentation PathToModuleDocumentation=Path to file of module/application documentation
SpaceOrSpecialCharAreNotAllowed=Spaces or special characters are not allowed. SpaceOrSpecialCharAreNotAllowed=Spaces or special characters are not allowed.

View File

@ -411,7 +411,7 @@ if ($dirins && $action == 'confirm_deleteobject' && $objectname)
$filetogenerate = array( $filetogenerate = array(
'myobject_card.php'=>strtolower($objectname).'_card.php', 'myobject_card.php'=>strtolower($objectname).'_card.php',
'myobject_note.php'=>strtolower($objectname).'_note.php', 'myobject_note.php'=>strtolower($objectname).'_note.php',
'myobject_document.php'=>strtolower($objectname).'_note.php', 'myobject_document.php'=>strtolower($objectname).'_document.php',
'myobject_agenda.php'=>strtolower($objectname).'_agenda.php', 'myobject_agenda.php'=>strtolower($objectname).'_agenda.php',
'myobject_list.php'=>strtolower($objectname).'_list.php', 'myobject_list.php'=>strtolower($objectname).'_list.php',
'lib/myobject.lib.php'=>'lib/'.strtolower($objectname).'.lib.php', 'lib/myobject.lib.php'=>'lib/'.strtolower($objectname).'.lib.php',
@ -1227,6 +1227,7 @@ elseif (! empty($module))
foreach($listofobject as $fileobj) foreach($listofobject as $fileobj)
{ {
if (preg_match('/^api_/',$fileobj['name'])) continue; if (preg_match('/^api_/',$fileobj['name'])) continue;
if (preg_match('/^actions_/',$fileobj['name'])) continue;
$tmpcontent=file_get_contents($fileobj['fullname']); $tmpcontent=file_get_contents($fileobj['fullname']);
if (preg_match('/class\s+([^\s]*)\s+extends\s+CommonObject/ims',$tmpcontent,$reg)) if (preg_match('/class\s+([^\s]*)\s+extends\s+CommonObject/ims',$tmpcontent,$reg))
@ -1304,8 +1305,11 @@ elseif (! empty($module))
try { try {
$pathtoclass = strtolower($module).'/class/'.strtolower($tabobj).'.class.php'; $pathtoclass = strtolower($module).'/class/'.strtolower($tabobj).'.class.php';
$pathtoapi = strtolower($module).'/class/api_'.strtolower($tabobj).'.class.php'; $pathtoapi = strtolower($module).'/class/api_'.strtolower($tabobj).'.class.php';
$pathtolist = strtolower($module).'/'.strtolower($tabobj).'_list.php'; $pathtoagenda = strtolower($module).'/'.strtolower($tabobj).'_agenda.php';
$pathtocard = strtolower($module).'/'.strtolower($tabobj).'_card.php'; $pathtocard = strtolower($module).'/'.strtolower($tabobj).'_card.php';
$pathtodocument = strtolower($module).'/'.strtolower($tabobj).'_document.php';
$pathtolist = strtolower($module).'/'.strtolower($tabobj).'_list.php';
$pathtonote = strtolower($module).'/'.strtolower($tabobj).'_note.php';
$pathtophpunit = strtolower($module).'/test/phpunit/'.$tabobj.'Test.php'; $pathtophpunit = strtolower($module).'/test/phpunit/'.$tabobj.'Test.php';
$pathtosql = strtolower($module).'/sql/llx_'.strtolower($tabobj).'.sql'; $pathtosql = strtolower($module).'/sql/llx_'.strtolower($tabobj).'.sql';
$pathtosqlextra = strtolower($module).'/sql/llx_'.strtolower($tabobj).'_extrafields.sql'; $pathtosqlextra = strtolower($module).'/sql/llx_'.strtolower($tabobj).'_extrafields.sql';
@ -1335,6 +1339,15 @@ elseif (! empty($module))
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>'.$pathtocard.'</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 '<span class="fa fa-file"></span> '.$langs->trans("PageForAgendaTab").' : <strong>'.$pathtoagenda.'</strong>';
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtoagenda).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
print '<br>';
print '<span class="fa fa-file"></span> '.$langs->trans("PageForDocumentTab").' : <strong>'.$pathtodocument.'</strong>';
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtodocument).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
print '<br>';
print '<span class="fa fa-file"></span> '.$langs->trans("PageForNoteTab").' : <strong>'.$pathtonote.'</strong>';
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtonote).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
print '</div>'; print '</div>';
print '<br><br><br>'; print '<br><br><br>';
@ -1708,6 +1721,8 @@ elseif (! empty($module))
print_liste_field_titre("Comment",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder); print_liste_field_titre("Comment",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder);
print "</tr>\n"; print "</tr>\n";
if (count($cronjobs))
{
foreach ($cronjobs as $cron) foreach ($cronjobs as $cron)
{ {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
@ -1754,6 +1769,11 @@ elseif (! empty($module))
print '</tr>'; print '</tr>';
} }
}
else
{
print '<tr><td class="opacitymedium" colspan="5">'.$langs->trans("None").'</td></tr>';
}
print '</table>'; print '</table>';
print '</div>'; print '</div>';