forked from Wavyzz/dolibarr
Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/modulebuilder/index.php htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php htdocs/supplier_proposal/class/supplier_proposal.class.php
This commit is contained in:
@@ -38,6 +38,7 @@ if (!$user->admin) accessforbidden();
|
||||
|
||||
$id = GETPOST('rowid', 'int');
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$optioncss = GETPOST('optionscss', 'alphanohtml');
|
||||
|
||||
$mode = GETPOST('mode', 'aZ09') ?GETPOST('mode', 'aZ09') : 'createform'; // 'createform', 'filters', 'sortorder', 'focus'
|
||||
|
||||
@@ -252,7 +253,7 @@ $texthelp = $langs->trans("PageUrlForDefaultValues");
|
||||
if ($mode == 'createform') $texthelp .= $langs->trans("PageUrlForDefaultValuesCreate", 'societe/card.php', 'societe/card.php?abc=val1&def=val2');
|
||||
else $texthelp .= $langs->trans("PageUrlForDefaultValuesList", 'societe/list.php', 'societe/list.php?abc=val1&def=val2');
|
||||
$texthelp .= '<br><br>'.$langs->trans("AlsoDefaultValuesAreEffectiveForActionCreate");
|
||||
$texturl = $form->textwithpicto($langs->trans("Url"), $texthelp);
|
||||
$texturl = $form->textwithpicto($langs->trans("RelativeURL"), $texthelp);
|
||||
print_liste_field_titre($texturl, $_SERVER["PHP_SELF"], 'page,param', '', $param, '', $sortfield, $sortorder);
|
||||
// Field
|
||||
$texthelp = $langs->trans("TheKeyIsTheNameOfHtmlField");
|
||||
|
||||
@@ -90,13 +90,13 @@ if (empty($reshook))
|
||||
// Action clone object
|
||||
if ($action == 'confirm_clone' && $confirm == 'yes')
|
||||
{
|
||||
if (empty($_REQUEST["clone_content"]) && empty($_REQUEST["clone_receivers"]))
|
||||
if (! GETPOST("clone_content", 'alpha') && ! GETPOST("clone_receivers", 'alpha'))
|
||||
{
|
||||
setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $object->createFromClone($user, $object->id, $_REQUEST["clone_content"], $_REQUEST["clone_receivers"]);
|
||||
$result = $object->createFromClone($user, $object->id, GETPOST("clone_content", 'alpha'), GETPOST("clone_receivers", 'alpha'));
|
||||
if ($result > 0)
|
||||
{
|
||||
header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result);
|
||||
|
||||
@@ -273,8 +273,8 @@ class Mailing extends CommonObject
|
||||
*
|
||||
* @param User $user User making the clone
|
||||
* @param int $fromid Id of object to clone
|
||||
* @param int $option1 1=Copy content, 0=Forget content
|
||||
* @param int $option2 Not used
|
||||
* @param int $option1 1=Clone content, 0=Forget content
|
||||
* @param int $option2 1=Clone recipients
|
||||
* @return int New id of clone
|
||||
*/
|
||||
public function createFromClone(User $user, $fromid, $option1, $option2)
|
||||
@@ -305,7 +305,7 @@ class Mailing extends CommonObject
|
||||
$object->bgcolor = '';
|
||||
$object->bgimage = '';
|
||||
|
||||
$object->email_from = '';
|
||||
//$object->email_from = ''; // We do not reset from email because it is a mandatory value
|
||||
$object->email_replyto = '';
|
||||
$object->email_errorsto = '';
|
||||
|
||||
@@ -331,7 +331,7 @@ class Mailing extends CommonObject
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
//Clone target
|
||||
// Clone recipient targets
|
||||
if (!empty($option2)) {
|
||||
require_once DOL_DOCUMENT_ROOT .'/core/modules/mailings/modules_mailings.php';
|
||||
|
||||
|
||||
@@ -127,10 +127,10 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir =
|
||||
{
|
||||
$i++;
|
||||
$texttoinsert .= "\t\t'".$key."' => array('type'=>'".$val['type']."', 'label'=>'".$val['label']."',";
|
||||
$texttoinsert .= " 'enabled'=>".($val['enabled'] != '' ? $val['enabled'] : 1).",";
|
||||
$texttoinsert .= " 'position'=>".($val['position'] != '' ? $val['position'] : 50).",";
|
||||
$texttoinsert .= " 'enabled'=>".($val['enabled'] !== '' ? $val['enabled'] : 1).",";
|
||||
$texttoinsert .= " 'position'=>".($val['position'] !== '' ? $val['position'] : 50).",";
|
||||
$texttoinsert .= " 'notnull'=>".(empty($val['notnull']) ? 0 : $val['notnull']).",";
|
||||
$texttoinsert .= " 'visible'=>".($val['visible'] != '' ? $val['visible'] : -1).",";
|
||||
$texttoinsert .= " 'visible'=>".($val['visible'] !== '' ? $val['visible'] : -1).",";
|
||||
if ($val['noteditable']) $texttoinsert .= " 'noteditable'=>'".$val['noteditable']."',";
|
||||
if ($val['default']) $texttoinsert .= " 'default'=>'".$val['default']."',";
|
||||
if ($val['index']) $texttoinsert .= " 'index'=>".$val['index'].",";
|
||||
|
||||
@@ -219,6 +219,7 @@ if ($action == 'presend')
|
||||
|
||||
if (!empty($origin) && !empty($origin_id)) {
|
||||
$element = $subelement = $origin;
|
||||
$regs = array();
|
||||
if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) {
|
||||
$element = $regs[1];
|
||||
$subelement = $regs[2];
|
||||
|
||||
@@ -221,6 +221,7 @@ DoliPartnersDesc=List of companies providing custom-developed modules or feature
|
||||
WebSiteDesc=External websites for more add-on (non-core) modules...
|
||||
DevelopYourModuleDesc=Some solutions to develop your own module...
|
||||
URL=URL
|
||||
RelativeURL=Relative URL
|
||||
BoxesAvailable=Widgets available
|
||||
BoxesActivated=Widgets activated
|
||||
ActivateOn=Activate on
|
||||
|
||||
@@ -174,6 +174,7 @@ SaveAndStay=Save and stay
|
||||
SaveAndNew=Save and new
|
||||
TestConnection=Test connection
|
||||
ToClone=Clone
|
||||
ConfirmCloneAsk=Are you sure you want to clone the object <b>%s</b>?
|
||||
ConfirmClone=Choose data you want to clone:
|
||||
NoCloneOptionsSpecified=No data to clone defined.
|
||||
Of=of
|
||||
|
||||
@@ -92,6 +92,7 @@ if (empty($newmask)) // This should no happen
|
||||
|
||||
$result = restrictedArea($user, 'modulebuilder', null);
|
||||
|
||||
$error = 0;
|
||||
|
||||
|
||||
/*
|
||||
@@ -784,12 +785,20 @@ if ($dirins && $action == 'initobject' && $module && GETPOST('createtablearray',
|
||||
|
||||
if ($dirins && $action == 'initobject' && $module && $objectname)
|
||||
{
|
||||
$objectname = ucfirst($objectname);
|
||||
|
||||
if (preg_match('/[^a-z0-9_]/i', $objectname))
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($langs->trans("SpaceOrSpecialCharAreNotAllowed"), null, 'errors');
|
||||
$tabobj = 'newobject';
|
||||
}
|
||||
if (class_exists($objectname)) {
|
||||
// TODO Add a more efficient detection. Scan disk ?
|
||||
$error++;
|
||||
setEventMessages($langs->trans("AnObjectWithThisClassNameAlreadyExists"), null, 'errors');
|
||||
$tabobj = 'newobject';
|
||||
}
|
||||
|
||||
$srcdir = DOL_DOCUMENT_ROOT.'/modulebuilder/template';
|
||||
$destdir = $dirins.'/'.strtolower($module);
|
||||
@@ -881,16 +890,31 @@ if ($dirins && $action == 'initobject' && $module && $objectname)
|
||||
// Edit the class 'class/'.strtolower($objectname).'.class.php'
|
||||
if (GETPOST('includerefgeneration', 'aZ09')) {
|
||||
// Replace 'visible'=>1, 'noteditable'=>0, 'default'=>''
|
||||
$arrayreplacement = array('/\'visible\'=>1,\s*\'noteditable\'=>0,\s*\'default\'=>\'\'/' => "'visible'=>4, 'noteditable'=>1, 'default'=>'(PROV)'");
|
||||
$arrayreplacement = array(
|
||||
'/\'visible\'=>1,\s*\'noteditable\'=>0,\s*\'default\'=>\'\'/' => "'visible'=>4, 'noteditable'=>1, 'default'=>'(PROV)'"
|
||||
);
|
||||
//var_dump($arrayreplacement);exit;
|
||||
//var_dump($destdir.'/class/'.strtolower($objectname).'.class.php');exit;
|
||||
dolReplaceInFile($destdir.'/class/'.strtolower($objectname).'.class.php', $arrayreplacement, '', 0, 0, 1);
|
||||
|
||||
$arrayreplacement = array(
|
||||
'/\'models\' => 0,/' => '\'models\' => 1,'
|
||||
);
|
||||
dolReplaceInFile($destdir.'/core/modules/mod'.$module.'.class.php', $arrayreplacement, '', 0, 0, 1);
|
||||
}
|
||||
|
||||
// Edit the setup file and the card page
|
||||
if (GETPOST('includedocgeneration', 'aZ09')) {
|
||||
// TODO
|
||||
// dolReplaceInFile();
|
||||
// Replace some var init into some files
|
||||
$arrayreplacement = array(
|
||||
'/\$includedocgeneration = 0;/' => '$includedocgeneration = 1;'
|
||||
);
|
||||
dolReplaceInFile($destdir.'/class/'.strtolower($objectname).'.class.php', $arrayreplacement, '', 0, 0, 1);
|
||||
|
||||
$arrayreplacement = array(
|
||||
'/\'models\' => 0,/' => '\'models\' => 1,'
|
||||
);
|
||||
dolReplaceInFile($destdir.'/core/modules/mod'.$module.'.class.php', $arrayreplacement, '', 0, 0, 1);
|
||||
}
|
||||
|
||||
// Scan for object class files
|
||||
@@ -1639,12 +1663,90 @@ $head[$h][1] = '<span class="valignmiddle text-plus-circle">'.$langs->trans("New
|
||||
$head[$h][2] = 'initmodule';
|
||||
$h++;
|
||||
|
||||
foreach ($listofmodules as $tmpmodule => $tmpmodulearray)
|
||||
{
|
||||
$linktoenabledisable = '';
|
||||
$modulestatusinfo = '';
|
||||
|
||||
if (is_array($listofmodules) && count($listofmodules) > 0) {
|
||||
// Define $linktoenabledisable and $modulestatusinfo
|
||||
$modulelowercase=strtolower($module);
|
||||
$const_name = 'MAIN_MODULE_'.strtoupper($module);
|
||||
|
||||
$param='';
|
||||
if ($tab) $param.='&tab='.urlencode($tab);
|
||||
if ($module) $param.='&module='.urlencode($module);
|
||||
if ($tabobj) $param.='&tabobj='.urlencode($tabobj);
|
||||
|
||||
$urltomodulesetup='<a href="'.DOL_URL_ROOT.'/admin/modules.php?search_keyword='.urlencode($module).'">'.$langs->trans('Home').'-'.$langs->trans("Setup").'-'.$langs->trans("Modules").'</a>';
|
||||
if (! empty($conf->global->$const_name)) // If module is already activated
|
||||
{
|
||||
$linktoenabledisable.='<a class="reposition asetresetmodule" href="'.$_SERVER["PHP_SELF"].'?id='.$moduleobj->numero.'&action=reset&value=mod' . $module . $param . '">';
|
||||
$linktoenabledisable.=img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', '', 1);
|
||||
$linktoenabledisable.='</a>';
|
||||
|
||||
$objMod = $moduleobj;
|
||||
$backtourlparam = '';
|
||||
$backtourlparam .= ($backtourlparam ? '&' : '?').'module='.$module; // No urlencode here, done later
|
||||
if ($tab) $backtourlparam .= ($backtourlparam ? '&' : '?').'tab='.$tab; // No urlencode here, done later
|
||||
$backtourl = $_SERVER["PHP_SELF"].$backtourlparam;
|
||||
|
||||
$regs = array();
|
||||
if (is_array($objMod->config_page_url))
|
||||
{
|
||||
$i = 0;
|
||||
foreach ($objMod->config_page_url as $page)
|
||||
{
|
||||
$urlpage = $page;
|
||||
if ($i++)
|
||||
{
|
||||
$linktoenabledisable .= ' <a href="'.$urlpage.'" title="'.$langs->trans($page).'">'.img_picto(ucfirst($page), "setup").'</a>';
|
||||
// print '<a href="'.$page.'">'.ucfirst($page).'</a> ';
|
||||
}
|
||||
else
|
||||
{
|
||||
if (preg_match('/^([^@]+)@([^@]+)$/i', $urlpage, $regs))
|
||||
{
|
||||
$urltouse = dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1);
|
||||
$linktoenabledisable .= ' <a href="'.$urltouse.(preg_match('/\?/', $urltouse) ? '&' : '?').'save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$urltouse = $urlpage;
|
||||
$linktoenabledisable .= ' <a href="'.$urltouse.(preg_match('/\?/', $urltouse) ? '&' : '?').'save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').'</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif (preg_match('/^([^@]+)@([^@]+)$/i', $objMod->config_page_url, $regs))
|
||||
{
|
||||
$linktoenabledisable .= ' <a href="'.dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1).'?save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').'</a>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$linktoenabledisable.='<a class="reposition asetresetmodule" href="'.$_SERVER["PHP_SELF"].'?id='.$moduleobj->numero.'&action=set&value=mod' . $module . $param . '">';
|
||||
$linktoenabledisable.=img_picto($langs->trans("ModuleIsNotActive", $urltomodulesetup), 'switch_off', '', false, 0, 0, '', 'classfortooltip', 1);
|
||||
$linktoenabledisable.="</a>\n";
|
||||
}
|
||||
|
||||
if (! empty($conf->$modulelowercase->enabled))
|
||||
{
|
||||
$modulestatusinfo=$form->textwithpicto('', $langs->trans("Warning").' : '.$langs->trans("ModuleIsLive"), -1, 'warning');
|
||||
}
|
||||
|
||||
// Loop to show tab of each module
|
||||
foreach ($listofmodules as $tmpmodule => $tmpmodulearray)
|
||||
{
|
||||
$head[$h][0] = $_SERVER["PHP_SELF"].'?module='.$tmpmodulearray['modulenamewithcase'].($forceddirread ? '@'.$dirread : '');
|
||||
$head[$h][1] = $tmpmodulearray['modulenamewithcase'];
|
||||
$head[$h][2] = $tmpmodulearray['modulenamewithcase'];
|
||||
|
||||
/*if ($tmpmodule == $modulelowercase) {
|
||||
$head[$h][1] .= ' '.$modulestatusinfo;
|
||||
$head[$h][1] .= ' '.$linktoenabledisable;
|
||||
}*/
|
||||
|
||||
$h++;
|
||||
}
|
||||
}
|
||||
|
||||
$head[$h][0] = $_SERVER["PHP_SELF"].'?module=deletemodule';
|
||||
@@ -1692,9 +1794,6 @@ elseif (!empty($module))
|
||||
{
|
||||
$dirread = $listofmodules[strtolower($module)]['moduledescriptorrootpath'];
|
||||
|
||||
$head2 = array();
|
||||
$h = 0;
|
||||
|
||||
$modulelowercase = strtolower($module);
|
||||
$const_name = 'MAIN_MODULE_'.strtoupper($module);
|
||||
|
||||
@@ -1726,6 +1825,9 @@ elseif (!empty($module))
|
||||
$modulestatusinfo = $form->textwithpicto($langs->trans("ModuleIsLive"), $langs->trans("Warning"), -1, 'warning');
|
||||
}
|
||||
|
||||
$head2 = array();
|
||||
$h = 0;
|
||||
|
||||
$head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=description&module='.$module.($forceddirread ? '@'.$dirread : '');
|
||||
$head2[$h][1] = $langs->trans("Description");
|
||||
$head2[$h][2] = 'description';
|
||||
@@ -1746,16 +1848,16 @@ elseif (!empty($module))
|
||||
$head2[$h][2] = 'objects';
|
||||
$h++;
|
||||
|
||||
$head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=menus&module='.$module.($forceddirread ? '@'.$dirread : '');
|
||||
$head2[$h][1] = $langs->trans("Menus");
|
||||
$head2[$h][2] = 'menus';
|
||||
$h++;
|
||||
|
||||
$head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=permissions&module='.$module.($forceddirread ? '@'.$dirread : '');
|
||||
$head2[$h][1] = $langs->trans("Permissions");
|
||||
$head2[$h][2] = 'permissions';
|
||||
$h++;
|
||||
|
||||
$head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=menus&module='.$module.($forceddirread ? '@'.$dirread : '');
|
||||
$head2[$h][1] = $langs->trans("Menus");
|
||||
$head2[$h][2] = 'menus';
|
||||
$h++;
|
||||
|
||||
$head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=hooks&module='.$module.($forceddirread ? '@'.$dirread : '');
|
||||
$head2[$h][1] = $langs->trans("Hooks");
|
||||
$head2[$h][2] = 'hooks';
|
||||
@@ -1802,8 +1904,8 @@ elseif (!empty($module))
|
||||
$h++;
|
||||
|
||||
// Link to enable / disable
|
||||
print $modulestatusinfo;
|
||||
print ' '.$linktoenabledisable.'<br>';
|
||||
print '<div class="center">'.$modulestatusinfo;
|
||||
print ' '.$linktoenabledisable.'</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
@@ -2083,7 +2185,7 @@ elseif (!empty($module))
|
||||
print_liste_field_titre("Condition", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
if (is_array($dicts))
|
||||
if (is_array($dicts) && is_array($dicts['tabname']))
|
||||
{
|
||||
$i = 0;
|
||||
$maxi = count($dicts['tabname']);
|
||||
@@ -2567,6 +2669,7 @@ elseif (!empty($module))
|
||||
print '<input class="button" type="submit" name="add" value="'.$langs->trans("Add").'">';
|
||||
print '</td></tr>';
|
||||
|
||||
// List of existing properties
|
||||
foreach ($properties as $propkey => $propval)
|
||||
{
|
||||
/* If from Reflection
|
||||
@@ -2638,7 +2741,7 @@ elseif (!empty($module))
|
||||
print $propenabled ? $propenabled : '';
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print $propvisible ? $propvisible : '';
|
||||
print $propvisible ? $propvisible : '0';
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print $propnoteditable ? $propnoteditable : '';
|
||||
|
||||
@@ -552,12 +552,13 @@ class MyObject extends CommonObject
|
||||
}
|
||||
$this->newref = $num;
|
||||
|
||||
if (! empty($num)) {
|
||||
// Validate
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element;
|
||||
$sql .= " SET ref = '".$this->db->escape($num)."',";
|
||||
$sql .= " status = ".self::STATUS_VALIDATED.",";
|
||||
$sql .= " date_validation = '".$this->db->idate($now)."',";
|
||||
$sql .= " fk_user_valid = ".$user->id;
|
||||
$sql .= " status = ".self::STATUS_VALIDATED;
|
||||
if (! empty($this->fields['date_validation'])) $sql .= ", date_validation = '".$this->db->idate($now)."',";
|
||||
if (! empty($this->fields['fk_user_valid'])) $sql .= ", fk_user_valid = ".$user->id;
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
|
||||
dol_syslog(get_class($this)."::validate()", LOG_DEBUG);
|
||||
@@ -576,6 +577,7 @@ class MyObject extends CommonObject
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@@ -951,7 +953,7 @@ class MyObject extends CommonObject
|
||||
$langs->load("mymodule@myobject");
|
||||
|
||||
if (empty($conf->global->MYMODULE_MYOBJECT_ADDON)) {
|
||||
$conf->global->MYMODULE_MYOBJECT_ADDON = 'mod_mymobject_standard';
|
||||
$conf->global->MYMODULE_MYOBJECT_ADDON = 'mod_myobject_standard';
|
||||
}
|
||||
|
||||
if (!empty($conf->global->MYMODULE_MYOBJECT_ADDON))
|
||||
@@ -977,10 +979,11 @@ class MyObject extends CommonObject
|
||||
return '';
|
||||
}
|
||||
|
||||
if (class_exists($classname)) {
|
||||
$obj = new $classname();
|
||||
$numref = $obj->getNextValue($this);
|
||||
|
||||
if ($numref != "")
|
||||
if ($numref != '' && $numref != '-1')
|
||||
{
|
||||
return $numref;
|
||||
}
|
||||
@@ -990,10 +993,14 @@ class MyObject extends CommonObject
|
||||
//dol_print_error($this->db,get_class($this)."::getNextNumRef ".$obj->error);
|
||||
return "";
|
||||
}
|
||||
} else {
|
||||
print $langs->trans("Error")." ".$langs->trans("ClassNotFound").' '.$classname;
|
||||
return "";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("Error")." ".$langs->trans("Error_MYMODULE_MYOBJECT_ADDON_NotDefined");
|
||||
print $langs->trans("ErrorNumberingModuleNotSetup", $this->element);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -1013,6 +1020,9 @@ class MyObject extends CommonObject
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$result = 0;
|
||||
$includedocgeneration = 0;
|
||||
|
||||
$langs->load("mymodule@mymodule");
|
||||
|
||||
if (!dol_strlen($modele)) {
|
||||
@@ -1027,7 +1037,11 @@ class MyObject extends CommonObject
|
||||
|
||||
$modelpath = "core/modules/mymodule/doc/";
|
||||
|
||||
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
|
||||
if ($includedocgeneration) {
|
||||
$result = $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -100,13 +100,18 @@ class mod_myobject_advanced extends ModeleNumRefMyObject
|
||||
{
|
||||
global $conf, $langs, $mysoc;
|
||||
|
||||
$old_code_client = $mysoc->code_client;
|
||||
$object = new MyObject($this->db);
|
||||
$object->initAsSpecimen();
|
||||
|
||||
/*$old_code_client = $mysoc->code_client;
|
||||
$old_code_type = $mysoc->typent_code;
|
||||
$mysoc->code_client = 'CCCCCCCCCC';
|
||||
$mysoc->typent_code = 'TTTTTTTTTT';
|
||||
$numExample = $this->getNextValue($mysoc);
|
||||
$mysoc->code_client = $old_code_client;
|
||||
$mysoc->typent_code = $old_code_type;
|
||||
$mysoc->typent_code = 'TTTTTTTTTT';*/
|
||||
|
||||
$numExample = $this->getNextValue($object);
|
||||
|
||||
/*$mysoc->code_client = $old_code_client;
|
||||
$mysoc->typent_code = $old_code_type;*/
|
||||
|
||||
if (!$numExample)
|
||||
{
|
||||
|
||||
@@ -89,7 +89,12 @@ class mod_myobject_standard extends ModeleNumRefMyObject
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."mymodule_myobject";
|
||||
$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
|
||||
$sql .= " AND entity = ".$conf->entity;
|
||||
if ($object->ismultientitymanaged == 1) {
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
}
|
||||
elseif ($object->ismultientitymanaged == 2) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
@@ -122,7 +127,12 @@ class mod_myobject_standard extends ModeleNumRefMyObject
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."mymodule_myobject";
|
||||
$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
|
||||
$sql .= " AND entity = ".$conf->entity;
|
||||
if ($object->ismultientitymanaged == 1) {
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
}
|
||||
elseif ($object->ismultientitymanaged == 2) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
@@ -290,7 +290,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
if ($action == 'clone') {
|
||||
// Create an array for form
|
||||
$formquestion = array();
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneMyObject', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
|
||||
}
|
||||
|
||||
// Confirmation of action xxxx
|
||||
@@ -581,7 +581,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
}
|
||||
|
||||
//Select mail models is same action as presend
|
||||
/*
|
||||
if (GETPOST('modelselected')) $action = 'presend';
|
||||
|
||||
// Presend form
|
||||
@@ -591,7 +590,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
$trackid = 'myobject'.$object->id;
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
|
||||
*/
|
||||
}
|
||||
|
||||
// End of page
|
||||
|
||||
Reference in New Issue
Block a user