Skip to content
Snippets Groups Projects
Commit 2a133f4a authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Generate table for extrafields

parent 9e6666e5
Branches
Tags
No related merge requests found
...@@ -51,6 +51,7 @@ WidgetFile=Widget file ...@@ -51,6 +51,7 @@ WidgetFile=Widget file
ReadmeFile=Readme file ReadmeFile=Readme file
ChangeLog=ChangeLog file ChangeLog=ChangeLog file
SqlFile=Sql file SqlFile=Sql file
SqlFileExtraFields=Sql file for complementary attributes
SqlFileKey=Sql file for keys SqlFileKey=Sql file for keys
AnObjectAlreadyExistWithThisNameAndDiffCase=An object already exists with this name and a different case AnObjectAlreadyExistWithThisNameAndDiffCase=An object already exists with this name and a different case
UseAsciiDocFormat=You can use Markdown format, but it is recommanded to use Asciidoc format (Comparison between .md and .asciidoc: http://asciidoctor.org/docs/user-manual/#compared-to-markdown) UseAsciiDocFormat=You can use Markdown format, but it is recommanded to use Asciidoc format (Comparison between .md and .asciidoc: http://asciidoctor.org/docs/user-manual/#compared-to-markdown)
\ No newline at end of file
...@@ -110,8 +110,9 @@ if ($dirins && $action == 'initmodule' && $modulename) ...@@ -110,8 +110,9 @@ if ($dirins && $action == 'initmodule' && $modulename)
dol_delete_file($destdir.'/myobject_card.php'); dol_delete_file($destdir.'/myobject_card.php');
dol_delete_file($destdir.'/myobject_list.php'); dol_delete_file($destdir.'/myobject_list.php');
dol_delete_file($destdir.'/test/phpunit/MyObjectTest.php'); dol_delete_file($destdir.'/test/phpunit/MyObjectTest.php');
dol_delete_file($destdir.'/sql/llx_myobject.key.sql');
dol_delete_file($destdir.'/sql/llx_myobject.sql'); dol_delete_file($destdir.'/sql/llx_myobject.sql');
dol_delete_file($destdir.'/sql/llx_myobject_extrafields.sql');
dol_delete_file($destdir.'/sql/llx_myobject.key.sql');
dol_delete_file($destdir.'/scripts/myobject.php'); dol_delete_file($destdir.'/scripts/myobject.php');
dol_delete_file($destdir.'/img/object_myobject.png'); dol_delete_file($destdir.'/img/object_myobject.png');
dol_delete_file($destdir.'/class/myobject.class.php'); dol_delete_file($destdir.'/class/myobject.class.php');
...@@ -189,8 +190,9 @@ if ($dirins && $action == 'initobject' && $module && $objectname) ...@@ -189,8 +190,9 @@ if ($dirins && $action == 'initobject' && $module && $objectname)
'myobject_card.php'=>strtolower($objectname).'_card.php', 'myobject_card.php'=>strtolower($objectname).'_card.php',
'myobject_list.php'=>strtolower($objectname).'_list.php', 'myobject_list.php'=>strtolower($objectname).'_list.php',
'test/phpunit/MyObjectTest.php'=>'test/phpunit/'.$objectname.'Test.php', 'test/phpunit/MyObjectTest.php'=>'test/phpunit/'.$objectname.'Test.php',
'sql/llx_myobject.key.sql'=>'sql/llx_'.strtolower($objectname).'.key.sql',
'sql/llx_myobject.sql'=>'sql/llx_'.strtolower($objectname).'.sql', 'sql/llx_myobject.sql'=>'sql/llx_'.strtolower($objectname).'.sql',
'sql/llx_myobject_extrafields.sql'=>'sql/llx_'.strtolower($objectname).'_extrafields.sql',
'sql/llx_myobject.key.sql'=>'sql/llx_'.strtolower($objectname).'.key.sql',
'scripts/myobject.php'=>'scripts/'.strtolower($objectname).'.php', 'scripts/myobject.php'=>'scripts/'.strtolower($objectname).'.php',
'img/object_myobject.png'=>'img/object_'.strtolower($objectname).'.png', 'img/object_myobject.png'=>'img/object_'.strtolower($objectname).'.png',
'class/myobject.class.php'=>'class/'.strtolower($objectname).'.class.php', 'class/myobject.class.php'=>'class/'.strtolower($objectname).'.class.php',
...@@ -377,8 +379,9 @@ if ($dirins && $action == 'confirm_deleteobject' && $objectname) ...@@ -377,8 +379,9 @@ if ($dirins && $action == 'confirm_deleteobject' && $objectname)
'myobject_card.php'=>strtolower($objectname).'_card.php', 'myobject_card.php'=>strtolower($objectname).'_card.php',
'myobject_list.php'=>strtolower($objectname).'_list.php', 'myobject_list.php'=>strtolower($objectname).'_list.php',
'test/phpunit/MyObjectTest.php'=>'test/phpunit/'.$objectname.'Test.php', 'test/phpunit/MyObjectTest.php'=>'test/phpunit/'.$objectname.'Test.php',
'sql/llx_myobject.key.sql'=>'sql/llx_'.strtolower($objectname).'.key.sql',
'sql/llx_myobject.sql'=>'sql/llx_'.strtolower($objectname).'.sql', 'sql/llx_myobject.sql'=>'sql/llx_'.strtolower($objectname).'.sql',
'sql/llx_myobject_extrafields.sql'=>'sql/llx_'.strtolower($objectname).'_extrafields.sql',
'sql/llx_myobject.key.sql'=>'sql/llx_'.strtolower($objectname).'.key.sql',
'scripts/myobject.php'=>'scripts/'.strtolower($objectname).'.php', 'scripts/myobject.php'=>'scripts/'.strtolower($objectname).'.php',
'img/object_myobject.png'=>'img/object_'.strtolower($objectname).'.png', 'img/object_myobject.png'=>'img/object_'.strtolower($objectname).'.png',
'class/myobject.class.php'=>'class/'.strtolower($objectname).'.class.php', 'class/myobject.class.php'=>'class/'.strtolower($objectname).'.class.php',
...@@ -423,6 +426,7 @@ if ($dirins && $action == 'confirm_deleteproperty' && $propertykey) ...@@ -423,6 +426,7 @@ if ($dirins && $action == 'confirm_deleteproperty' && $propertykey)
// File of sql // File of sql
$fileforsql = $dirins.'/'.$modulelowercase.'/sql/'.$objectlowercase.'.sql'; $fileforsql = $dirins.'/'.$modulelowercase.'/sql/'.$objectlowercase.'.sql';
$fileforsqlextra = $dirins.'/'.$modulelowercase.'/sql/'.$objectlowercase.'_extrafields.sql';
$fileforsqlkey = $dirins.'/'.$modulelowercase.'/sql/'.$objectlowercase.'.key.sql'; $fileforsqlkey = $dirins.'/'.$modulelowercase.'/sql/'.$objectlowercase.'.key.sql';
...@@ -1179,6 +1183,7 @@ elseif (! empty($module)) ...@@ -1179,6 +1183,7 @@ elseif (! empty($module))
$pathtolist = strtolower($module).'/'.strtolower($tabobj).'_list.php'; $pathtolist = strtolower($module).'/'.strtolower($tabobj).'_list.php';
$pathtocard = strtolower($module).'/'.strtolower($tabobj).'_card.php'; $pathtocard = strtolower($module).'/'.strtolower($tabobj).'_card.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';
$pathtosqlkey = strtolower($module).'/sql/llx_'.strtolower($tabobj).'.key.sql'; $pathtosqlkey = strtolower($module).'/sql/llx_'.strtolower($tabobj).'.key.sql';
print '<div class="fichehalfleft">'; print '<div class="fichehalfleft">';
print '<span class="fa fa-file"></span> '.$langs->trans("ClassFile").' : <strong>'.$pathtoclass.'</strong>'; print '<span class="fa fa-file"></span> '.$langs->trans("ClassFile").' : <strong>'.$pathtoclass.'</strong>';
...@@ -1190,6 +1195,9 @@ elseif (! empty($module)) ...@@ -1190,6 +1195,9 @@ elseif (! empty($module))
print '<span class="fa fa-file"></span> '.$langs->trans("SqlFile").' : <strong>'.$pathtosql.'</strong>'; print '<span class="fa fa-file"></span> '.$langs->trans("SqlFile").' : <strong>'.$pathtosql.'</strong>';
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&file='.urlencode($pathtosql).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>'; print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&file='.urlencode($pathtosql).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
print '<br>'; print '<br>';
print '<span class="fa fa-file"></span> '.$langs->trans("SqlFileExtraFields").' : <strong>'.$pathtosqlextra.'</strong>';
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&file='.urlencode($pathtosqlextra).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
print '<br>';
print '<span class="fa fa-file"></span> '.$langs->trans("SqlFileKey").' : <strong>'.$pathtosqlkey.'</strong>'; print '<span class="fa fa-file"></span> '.$langs->trans("SqlFileKey").' : <strong>'.$pathtosqlkey.'</strong>';
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&file='.urlencode($pathtosqlkey).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>'; print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&file='.urlencode($pathtosqlkey).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
print '</div>'; print '</div>';
......
-- Copyright (C) ---Put here your own copyright and developer email---
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
create table llx_myobject_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment