Enhance modulebuilder
This commit is contained in:
parent
a9e7f8b9e6
commit
f2a437fa89
@ -495,7 +495,6 @@ print "<br>";
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Other options
|
* Other options
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("OtherOptions"),'','');
|
print load_fiche_titre($langs->trans("OtherOptions"),'','');
|
||||||
|
|||||||
@ -101,7 +101,6 @@ if ($action == 'edit')
|
|||||||
print '<input type="hidden" name="action" value="update">';
|
print '<input type="hidden" name="action" value="update">';
|
||||||
|
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
$var=true;
|
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||||
@ -135,8 +134,6 @@ if ($action == 'edit')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$var=true;
|
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2014-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -17,15 +17,43 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/core/actions_setnotes.inc.php
|
* \file htdocs/core/actions_setmoduleoptions.inc.php
|
||||||
* \brief Code for actions on setting notes of object page
|
* \brief Code for actions on setting notes of object page
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
// $action must be defined
|
// $action must be defined
|
||||||
// $_FILES may be defined
|
// $arrayofparameters must be set for action 'update'
|
||||||
|
// $nomessageinupdate can be set to 1
|
||||||
// $nomessageinsetmoduleoptions can be set to 1
|
// $nomessageinsetmoduleoptions can be set to 1
|
||||||
|
|
||||||
|
if ($action == 'update' && is_array($arrayofparameters))
|
||||||
|
{
|
||||||
|
$db->begin();
|
||||||
|
|
||||||
|
$ok=True;
|
||||||
|
foreach($arrayofparameters as $key => $val)
|
||||||
|
{
|
||||||
|
$result=dolibarr_set_const($db,$key,GETPOST($key, 'alpha'),'chaine',0,'',$conf->entity);
|
||||||
|
if ($result < 0)
|
||||||
|
{
|
||||||
|
$ok=False;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$db->commit();
|
||||||
|
if (empty($nomessageinupdate)) setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$db->rollback();
|
||||||
|
if (empty($nomessageinupdate)) setEventMessages($langs->trans("SetupNotSaved"), null, 'errors');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...)
|
// Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...)
|
||||||
if ($action == 'setModuleOptions')
|
if ($action == 'setModuleOptions')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1929,7 +1929,7 @@ function dol_most_recent_file($dir,$regexfilter='',$excludefilter=array('(\.meta
|
|||||||
function dol_check_secure_access_document($modulepart, $original_file, $entity, $fuser='', $refname='', $mode='read')
|
function dol_check_secure_access_document($modulepart, $original_file, $entity, $fuser='', $refname='', $mode='read')
|
||||||
{
|
{
|
||||||
global $user, $conf, $db;
|
global $user, $conf, $db;
|
||||||
global $dolibarr_main_data_root;
|
global $dolibarr_main_data_root, $dolibarr_main_document_root_alt;
|
||||||
|
|
||||||
if (! is_object($fuser)) $fuser=$user;
|
if (! is_object($fuser)) $fuser=$user;
|
||||||
|
|
||||||
@ -1965,6 +1965,16 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
|
|||||||
$accessallowed=($user->admin && basename($original_file) == $original_file && preg_match('/^dolibarr.*\.log$/', basename($original_file)));
|
$accessallowed=($user->admin && basename($original_file) == $original_file && preg_match('/^dolibarr.*\.log$/', basename($original_file)));
|
||||||
$original_file=$dolibarr_main_data_root.'/'.$original_file;
|
$original_file=$dolibarr_main_data_root.'/'.$original_file;
|
||||||
}
|
}
|
||||||
|
// Wrapping for *.zip files, like when used with url http://.../document.php?modulepart=packages&file=module_myfile.zip
|
||||||
|
elseif ($modulepart == 'packages' && !empty($dolibarr_main_data_root))
|
||||||
|
{
|
||||||
|
// Dir for custom dirs
|
||||||
|
$tmp=explode(',', $dolibarr_main_document_root_alt);
|
||||||
|
$dirins = $tmp[0];
|
||||||
|
|
||||||
|
$accessallowed=($user->admin && preg_match('/^module_.*\.zip$/', basename($original_file)));
|
||||||
|
$original_file=$dirins.'/'.$original_file;
|
||||||
|
}
|
||||||
// Wrapping for some images
|
// Wrapping for some images
|
||||||
elseif (($modulepart == 'mycompany' || $modulepart == 'companylogo') && !empty($conf->mycompany->dir_output))
|
elseif (($modulepart == 'mycompany' || $modulepart == 'companylogo') && !empty($conf->mycompany->dir_output))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -55,7 +55,7 @@ CronSaveSucess=Save successfully
|
|||||||
CronNote=Comment
|
CronNote=Comment
|
||||||
CronFieldMandatory=Fields %s is mandatory
|
CronFieldMandatory=Fields %s is mandatory
|
||||||
CronErrEndDateStartDt=End date cannot be before start date
|
CronErrEndDateStartDt=End date cannot be before start date
|
||||||
StatusAtInstall=Status at installation
|
StatusAtInstall=Status at module installation
|
||||||
CronStatusActiveBtn=Enable
|
CronStatusActiveBtn=Enable
|
||||||
CronStatusInactiveBtn=Disable
|
CronStatusInactiveBtn=Disable
|
||||||
CronTaskInactive=This job is disabled
|
CronTaskInactive=This job is disabled
|
||||||
|
|||||||
@ -59,3 +59,5 @@ AnObjectAlreadyExistWithThisNameAndDiffCase=An object already exists with this n
|
|||||||
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)
|
||||||
IsAMeasure=Is a measure
|
IsAMeasure=Is a measure
|
||||||
DirScanned=Directory scanned
|
DirScanned=Directory scanned
|
||||||
|
NoTrigger=No trigger
|
||||||
|
NoWidget=No widget
|
||||||
@ -149,7 +149,7 @@ if ($dirins && $action == 'initmodule' && $modulename)
|
|||||||
'my module'=>$modulename,
|
'my module'=>$modulename,
|
||||||
'Mon module'=>$modulename,
|
'Mon module'=>$modulename,
|
||||||
'mon module'=>$modulename,
|
'mon module'=>$modulename,
|
||||||
'htdocs/modulebuilder/template/'=>strtolower($modulename),
|
'htdocs/modulebuilder/template'=>strtolower($modulename),
|
||||||
'---Put here your own copyright and developer email---'=>dol_print_date($now,'%Y').' '.$user->getFullName($langs).($user->email?' <'.$user->email.'>':'')
|
'---Put here your own copyright and developer email---'=>dol_print_date($now,'%Y').' '.$user->getFullName($langs).($user->email?' <'.$user->email.'>':'')
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -508,11 +508,11 @@ if ($dirins && $action == 'generatepackage')
|
|||||||
$FILENAMEZIP="module_".$modulelowercase.'-'.$arrayversion[0].'.'.$arrayversion[1].($arrayversion[2]?".".$arrayversion[2]:"").".zip";
|
$FILENAMEZIP="module_".$modulelowercase.'-'.$arrayversion[0].'.'.$arrayversion[1].($arrayversion[2]?".".$arrayversion[2]:"").".zip";
|
||||||
|
|
||||||
$dirofmodule = dol_buildpath($modulelowercase, 0).'/bin';
|
$dirofmodule = dol_buildpath($modulelowercase, 0).'/bin';
|
||||||
$outputfile = $dirofmodule.'/'.$FILENAMEZIP;
|
$outputfilezip = $dirofmodule.'/'.$FILENAMEZIP;
|
||||||
if ($dirofmodule)
|
if ($dirofmodule)
|
||||||
{
|
{
|
||||||
if (! dol_is_dir($dirofmodule)) dol_mkdir($dirofmodule);
|
if (! dol_is_dir($dirofmodule)) dol_mkdir($dirofmodule);
|
||||||
$result = dol_compress_dir($dir, $outputfile, 'zip');
|
$result = dol_compress_dir($dir, $outputfilezip, 'zip');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -521,13 +521,13 @@ if ($dirins && $action == 'generatepackage')
|
|||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("ZipFileGeneratedInto", $outputfile), null);
|
setEventMessages($langs->trans("ZipFileGeneratedInto", $outputfilezip), null);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
setEventMessages($langs->trans("ErrorFailToGenerateFile", $outputfile), null, 'errors');
|
setEventMessages($langs->trans("ErrorFailToGenerateFile", $outputfilezip), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -576,7 +576,7 @@ if ($dirins && $action == 'generatedoc')
|
|||||||
$FILENAMEDOC=$modulelowercase.'.html';
|
$FILENAMEDOC=$modulelowercase.'.html';
|
||||||
|
|
||||||
$dirofmodule = dol_buildpath($modulelowercase, 0).'/doc';
|
$dirofmodule = dol_buildpath($modulelowercase, 0).'/doc';
|
||||||
$outputfile = $dirofmodule.'/'.$FILENAMEDOC;
|
$outputfiledoc = $dirofmodule.'/'.$FILENAMEDOC;
|
||||||
if ($dirofmodule)
|
if ($dirofmodule)
|
||||||
{
|
{
|
||||||
if (! dol_is_dir($dirofmodule)) dol_mkdir($dirofmodule);
|
if (! dol_is_dir($dirofmodule)) dol_mkdir($dirofmodule);
|
||||||
@ -591,13 +591,13 @@ if ($dirins && $action == 'generatedoc')
|
|||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("DocFileGeneratedInto", $outputfile), null);
|
setEventMessages($langs->trans("DocFileGeneratedInto", $outputfiledoc), null);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
setEventMessages($langs->trans("ErrorFailToGenerateFile", $outputfile), null, 'errors');
|
setEventMessages($langs->trans("ErrorFailToGenerateFile", $outputfiledoc), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1577,6 +1577,8 @@ elseif (! empty($module))
|
|||||||
$triggers = $interfaces->getTriggersList(array('/'.strtolower($module).'/core/triggers'));
|
$triggers = $interfaces->getTriggersList(array('/'.strtolower($module).'/core/triggers'));
|
||||||
|
|
||||||
if ($action != 'editfile' || empty($file))
|
if ($action != 'editfile' || empty($file))
|
||||||
|
{
|
||||||
|
if (! empty($triggers))
|
||||||
{
|
{
|
||||||
foreach ($triggers as $trigger)
|
foreach ($triggers as $trigger)
|
||||||
{
|
{
|
||||||
@ -1588,6 +1590,11 @@ elseif (! empty($module))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
print $langs->trans("NoTrigger");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
$fullpathoffile=dol_buildpath($file, 0);
|
$fullpathoffile=dol_buildpath($file, 0);
|
||||||
|
|
||||||
@ -1621,6 +1628,8 @@ elseif (! empty($module))
|
|||||||
$widgets = ModeleBoxes::getWidgetsList(array('/'.strtolower($module).'/core/boxes'));
|
$widgets = ModeleBoxes::getWidgetsList(array('/'.strtolower($module).'/core/boxes'));
|
||||||
|
|
||||||
if ($action != 'editfile' || empty($file))
|
if ($action != 'editfile' || empty($file))
|
||||||
|
{
|
||||||
|
if (! empty($widget))
|
||||||
{
|
{
|
||||||
foreach ($widgets as $widget)
|
foreach ($widgets as $widget)
|
||||||
{
|
{
|
||||||
@ -1632,6 +1641,11 @@ elseif (! empty($module))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
print $langs->trans("NoWidget");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
$fullpathoffile=dol_buildpath($file, 0);
|
$fullpathoffile=dol_buildpath($file, 0);
|
||||||
|
|
||||||
@ -1811,7 +1825,7 @@ elseif (! empty($module))
|
|||||||
if (count($arrayversion))
|
if (count($arrayversion))
|
||||||
{
|
{
|
||||||
$FILENAMEZIP="module_".$modulelowercase.'-'.$arrayversion[0].'.'.$arrayversion[1].($arrayversion[2]?".".$arrayversion[2]:"").".zip";
|
$FILENAMEZIP="module_".$modulelowercase.'-'.$arrayversion[0].'.'.$arrayversion[1].($arrayversion[2]?".".$arrayversion[2]:"").".zip";
|
||||||
$outputfile = dol_buildpath($modulelowercase, 0).'/bin/'.$FILENAMEZIP;
|
$outputfilezip = dol_buildpath($modulelowercase, 0).'/bin/'.$FILENAMEZIP;
|
||||||
|
|
||||||
$FILENAMEDOC=$modulelowercase.'.html';
|
$FILENAMEDOC=$modulelowercase.'.html';
|
||||||
$outputfiledoc = dol_buildpath($modulelowercase, 0).'/doc/'.$FILENAMEDOC;
|
$outputfiledoc = dol_buildpath($modulelowercase, 0).'/doc/'.$FILENAMEDOC;
|
||||||
@ -1820,10 +1834,11 @@ elseif (! empty($module))
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<span class="fa fa-file"></span> '. $langs->trans("PathToModulePackage") . ' : ';
|
print '<span class="fa fa-file"></span> '. $langs->trans("PathToModulePackage") . ' : ';
|
||||||
if (! dol_is_file($outputfile)) print '<strong>'.$langs->trans("FileNotYetGenerated").'</strong>';
|
if (! dol_is_file($outputfilezip)) print '<strong>'.$langs->trans("FileNotYetGenerated").'</strong>';
|
||||||
else {
|
else {
|
||||||
print '<strong>'.$outputfile.'</strong>';
|
$relativepath = $modulelowercase.'/bin/'.$FILENAMEZIP;
|
||||||
print ' ('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfile), 'dayhour').')';
|
print '<strong><a href="'.DOL_URL_ROOT.'/document.php?modulepart=packages&file='.urlencode($relativepath).'">'.$outputfilezip.'</a></strong>';
|
||||||
|
print ' ('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfilezip), 'dayhour').')';
|
||||||
}
|
}
|
||||||
print '</strong><br>';
|
print '</strong><br>';
|
||||||
|
|
||||||
|
|||||||
@ -81,16 +81,11 @@ $head = mymoduleAdminPrepareHead();
|
|||||||
dol_fiche_head(
|
dol_fiche_head(
|
||||||
$head,
|
$head,
|
||||||
'about',
|
'about',
|
||||||
$langs->trans("MyModuleName"),
|
$langs->trans("ModuleMyModuleName"),
|
||||||
0,
|
0,
|
||||||
'mymodule@mymodule'
|
'mymodule@mymodule'
|
||||||
);
|
);
|
||||||
|
|
||||||
// About page goes here
|
|
||||||
echo $langs->trans("MyModuleAboutPage");
|
|
||||||
|
|
||||||
echo '<br>';
|
|
||||||
|
|
||||||
dol_include_once('/mymodule/core/modules/modMyModule.class.php');
|
dol_include_once('/mymodule/core/modules/modMyModule.class.php');
|
||||||
$tmpmodule = new modMyModule($db);
|
$tmpmodule = new modMyModule($db);
|
||||||
print $tmpmodule->getDescLong();
|
print $tmpmodule->getDescLong();
|
||||||
|
|||||||
@ -42,8 +42,9 @@ global $langs, $user;
|
|||||||
require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php";
|
require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php";
|
||||||
require_once '../lib/mymodule.lib.php';
|
require_once '../lib/mymodule.lib.php';
|
||||||
//require_once "../class/myclass.class.php";
|
//require_once "../class/myclass.class.php";
|
||||||
|
|
||||||
// Translations
|
// Translations
|
||||||
$langs->load("mymodule@mymodule");
|
$langs->loadLangs(array("admin", "mymodule@mymodule"));
|
||||||
|
|
||||||
// Access control
|
// Access control
|
||||||
if (! $user->admin) accessforbidden();
|
if (! $user->admin) accessforbidden();
|
||||||
@ -51,6 +52,8 @@ if (! $user->admin) accessforbidden();
|
|||||||
// Parameters
|
// Parameters
|
||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'alpha');
|
||||||
|
|
||||||
|
$arrayofparameters=array('MYMODULE_MYPARAM1'=>'1', 'MYMODULE_MYPARAM2'=>'2');
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@ -76,14 +79,62 @@ $head = mymoduleAdminPrepareHead();
|
|||||||
dol_fiche_head(
|
dol_fiche_head(
|
||||||
$head,
|
$head,
|
||||||
'settings',
|
'settings',
|
||||||
$langs->trans("Module500000Name"),
|
$langs->trans("ModuleMyModuleName"),
|
||||||
0,
|
-1,
|
||||||
"mymodule@mymodule"
|
"mymodule@mymodule"
|
||||||
);
|
);
|
||||||
|
|
||||||
// Setup page goes here
|
// Setup page goes here
|
||||||
echo $langs->trans("MyModuleSetupPage");
|
echo $langs->trans("MyModuleSetupPage");
|
||||||
|
|
||||||
|
|
||||||
|
if ($action == 'edit')
|
||||||
|
{
|
||||||
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
print '<input type="hidden" name="action" value="update">';
|
||||||
|
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
|
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||||
|
|
||||||
|
foreach($arrayofparameters as $key => $val)
|
||||||
|
{
|
||||||
|
print '<tr class="oddeven"><td>';
|
||||||
|
print $form->textwithpicto($langs->trans($key),$langs->trans($key.'Tooltip'));
|
||||||
|
print '</td><td><input class="flat" name="'.$key.'" size="3" value="' . $conf->global->$key . '"></td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
|
print '<br><div class="center">';
|
||||||
|
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
print '</form>';
|
||||||
|
print '<br>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
|
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||||
|
|
||||||
|
foreach($arrayofparameters as $key => $val)
|
||||||
|
{
|
||||||
|
print '<tr class="oddeven"><td>';
|
||||||
|
print $form->textwithpicto($langs->trans($key),$langs->trans($key.'Tooltip'));
|
||||||
|
print '</td><td>' . $conf->global->$key . '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
|
print '<div class="tabsAction">';
|
||||||
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
|
||||||
|
print '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Page end
|
// Page end
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
$db->close();
|
||||||
|
|||||||
@ -311,10 +311,11 @@ class modMyModule extends DolibarrModules
|
|||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
$extrafields = new ExtraFields($this->db);
|
$extrafields = new ExtraFields($this->db);
|
||||||
|
|
||||||
//$result1=$extrafields->addExtraField('myattr1', "New Attr 1 label", 'boolean', 1, 3, 'thirdparty');
|
$result1=$extrafields->addExtraField('myattr1', "New Attr 1 label", 'boolean', 1, 3, 'thirdparty');
|
||||||
//$result2=$extrafields->addExtraField('myattr2', "New Attr 2 label", 'string', 1, 10, 'project');
|
//$result2=$extrafields->addExtraField('myattr2', "New Attr 2 label", 'varchar', 1, 10, 'project');
|
||||||
//$param=array('options'=>array('code1'=>'Val1','code2'=>'Val2','code3'=>'Val3'));
|
//$result3=$extrafields->addExtraField('myattr3', "New Attr 3 label", 'varchar', 1, 10, 'bank_account');
|
||||||
//$result3=$extrafields->addExtraField('myattr3', "New Attr 3 label", 'select', 1, 3, 'thirdparty', 0, 1, '', $param, 1);
|
//$result4=$extrafields->addExtraField('myattr4', "New Attr 4 label", 'select', 1, 3, 'thirdparty', 0, 1, '', array('options'=>array('code1'=>'Val1','code2'=>'Val2','code3'=>'Val3')), 1);
|
||||||
|
//$result5=$extrafields->addExtraField('myattr5', "New Attr 5 label", 'text', 1, 10, 'user');
|
||||||
|
|
||||||
$sql = array();
|
$sql = array();
|
||||||
|
|
||||||
|
|||||||
@ -28,6 +28,11 @@ ModuleMyModuleDesc = My module description
|
|||||||
MyModuleSetup = My module setup
|
MyModuleSetup = My module setup
|
||||||
Settings = Settings
|
Settings = Settings
|
||||||
MyModuleSetupPage = My module setup page
|
MyModuleSetupPage = My module setup page
|
||||||
|
MYMODULE_MYPARAM1 = My param 1
|
||||||
|
MYMODULE_MYPARAM1Tooltip = My param 1 tooltip
|
||||||
|
MYMODULE_MYPARAM2=My param 2
|
||||||
|
MYMODULE_MYPARAM2Tooltip=My param 2 tooltip
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# About page
|
# About page
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user