diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl
index 41b54022ee4..1843f3c8cfd 100755
--- a/build/makepack-dolibarr.pl
+++ b/build/makepack-dolibarr.pl
@@ -592,6 +592,8 @@ if ($nboftargetok) {
print "Remove subdir of custom dir\n";
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\;\n";
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs but not files
+ print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\;\n";
+ $ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs, even symbolic links, but not files
}
# Build package for each target
diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php
index b3c7a99d24e..f75e40f2730 100644
--- a/htdocs/modulebuilder/template/class/myobject.class.php
+++ b/htdocs/modulebuilder/template/class/myobject.class.php
@@ -74,7 +74,8 @@ class MyObject extends CommonObject
* @var array Array with all fields and their property
*/
public $fields=array(
- 'ref' =>array('type'=>'varchar(64)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>true, 'index'=>true, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'),
+ 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>true, 'index'=>true, 'position'=>1, 'comment'=>'Id'),
+ 'ref' =>array('type'=>'varchar(64)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>true, 'index'=>true, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'),
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=>true, 'index'=>true, 'position'=>20),
'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1),
'qty' =>array('type'=>'double(24,8)', 'label'=>'Qty', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'searchall'=>0, 'isameasure'=>1),
@@ -84,8 +85,8 @@ class MyObject extends CommonObject
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-1, 'index'=>true, 'position'=>1000, 'nullifempty'=>1),
);
// END MODULEBUILDER PROPERTIES
-
-
+
+
// If this object has a subtable with lines
@@ -129,11 +130,10 @@ class MyObject extends CommonObject
* @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto)
* @param string $option On what the link point to
* @param int $notooltip 1=Disable tooltip
- * @param int $maxlen Max length of visible user name
* @param string $morecss Add more css on link
* @return string String with URL
*/
- function getNomUrl($withpicto=0, $option='', $notooltip=0, $maxlen=24, $morecss='')
+ function getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='')
{
global $db, $conf, $langs;
global $dolibarr_main_authentication, $dolibarr_main_demo;
@@ -144,18 +144,18 @@ class MyObject extends CommonObject
$result = '';
$companylink = '';
- $label = '' . $langs->trans("MyModule") . '';
+ $label = '' . $langs->trans("MyObject") . '';
$label.= '
';
$label.= '' . $langs->trans('Ref') . ': ' . $this->ref;
- $url = DOL_URL_ROOT.'/mymodule/'.$this->table_name.'_card.php?id='.$this->id;
+ $url = $url = dol_buildpath('/mymodule/m_card.php',1).'?id='.$this->id;
$linkclose='';
if (empty($notooltip))
{
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
- $label=$langs->trans("ShowProject");
+ $label=$langs->trans("ShowMyObject");
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
}
$linkclose.=' title="'.dol_escape_htmltag($label, 1).'"';
diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php
index b0f95ba6ff4..fb26f9dde0e 100644
--- a/htdocs/modulebuilder/template/myobject_list.php
+++ b/htdocs/modulebuilder/template/myobject_list.php
@@ -18,9 +18,8 @@
/**
* \file htdocs/modulebuilder/template/myobject_list.php
- * \ingroup mymodule othermodule1 othermodule2
- * \brief This file is an example of a php page
- * Put here some comments
+ * \ingroup mymodule
+ * \brief List page for monmodule
*/
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1');
@@ -472,6 +471,13 @@ while ($i < min($num, $limit))
$obj = $db->fetch_object($resql);
if ($obj)
{
+ // Store properties in $object
+ $object->id = $obj->rowid;
+ foreach($object->fields as $key => $val)
+ {
+ if (isset($obj->$key)) $object->$key = $obj->$key;
+ }
+
// Show here line of result
print '