diff --git a/dev/skeletons/build_class_from_table.php b/dev/skeletons/build_class_from_table.php index 43f29a17ad3..6dac857ac11 100755 --- a/dev/skeletons/build_class_from_table.php +++ b/dev/skeletons/build_class_from_table.php @@ -69,8 +69,9 @@ if ($db->type != 'mysql' && $db->type != 'mysqli') } // Show parameters -print 'Tablename='.$argv[1]."\n"; -print "Current dir is ".getcwd()."\n"; +print 'Tablename: '.$argv[1]."\n"; +print "Current dir: ".getcwd()."\n"; +print "Database name: ".$db->database_name."\n"; // Define array with list of properties @@ -304,10 +305,9 @@ foreach($property as $key => $prop) } else { - $varprop.=' \'.(! isset($this->'.$prop['field'].')?\'NULL\':"\'".'; + $varprop.='\'.(! isset($this->'.$prop['field'].')?\'NULL\':"\'".'; $varprop.="\$this->".$prop['field'].""; - $varprop.='.\').'; - + $varprop.='"\'")'; } if ($i < (count($property)-$no_output_field)) $varprop.=".','"; diff --git a/dev/skeletons/modMyModule.class.php b/dev/skeletons/modMyModule.class.php index 7eebdee8bcd..8c55edc3d1a 100644 --- a/dev/skeletons/modMyModule.class.php +++ b/dev/skeletons/modMyModule.class.php @@ -193,7 +193,7 @@ class modMyModule extends DolibarrModules // Add here entries to declare new menus // // Example to declare a new Top Menu entry and its Left menu entry: - // $this->menu[$r]=array( 'fk_menu'=>0, // Put 0 if this is a top menu + // $this->menu[$r]=array( 'fk_menu'=>'', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode // 'type'=>'top', // This is a Top menu entry // 'titre'=>'MyModule top menu', // 'mainmenu'=>'mymodule', @@ -208,7 +208,7 @@ class modMyModule extends DolibarrModules // $r++; // // Example to declare a Left Menu entry into an existing Top menu entry: - // $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=xxx', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + // $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=xxx', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode // 'type'=>'left', // This is a Left menu entry // 'titre'=>'MyModule left menu', // 'mainmenu'=>'xxx', diff --git a/dev/skeletons/skeleton_class.class.php b/dev/skeletons/skeleton_class.class.php index 854e4a4fb47..2f8c78556e1 100644 --- a/dev/skeletons/skeleton_class.class.php +++ b/dev/skeletons/skeleton_class.class.php @@ -38,11 +38,6 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php'; */ class Skeleton_Class extends CommonObject { - /** - * @var DoliDb Database handler - */ - protected $db; - /** * @var string Error code (or message) * @deprecated diff --git a/dev/skeletons/skeleton_page.php b/dev/skeletons/skeleton_page.php index 7665ce9986a..a74088b3702 100644 --- a/dev/skeletons/skeleton_page.php +++ b/dev/skeletons/skeleton_page.php @@ -43,7 +43,7 @@ if (! $res && file_exists("../../../dolibarr/htdocs/main.inc.php")) $res=@includ if (! $res && file_exists("../../../../dolibarr/htdocs/main.inc.php")) $res=@include '../../../../dolibarr/htdocs/main.inc.php'; // Used on dev env only if (! $res) die("Include of main fails"); // Change this following line to use the correct relative path from htdocs -include_once(DOL_DOCUMENT_ROOT.'/core/class/formcompany.class.php'); +include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'); dol_include_once('/module/class/skeleton_class.class.php'); // Load traductions files requiredby by page @@ -62,7 +62,7 @@ if ($user->societe_id > 0) //accessforbidden(); } -if (empty($action) && empty($id) && empty($ref)) $action='create'; +if (empty($action) && empty($id) && empty($ref)) $action='list'; // Load object if id or ref is provided as parameter $object=new Skeleton_Class($db); @@ -225,7 +225,7 @@ jQuery(document).ready(function() { // Part to show a list -if ($action == 'list' || empty($id)) +if ($action == 'list' || (empty($id) && $action != 'create')) { $sql = "SELECT"; $sql.= " t.rowid,"; @@ -243,7 +243,7 @@ if ($action == 'list' || empty($id)) $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; - $sql.= " ORDER BY field1 ASC"; + $sql.=$db->order($sortfield, $sortorder); print '