';
@@ -4464,7 +4464,7 @@ if ($module == 'initmodule') {
} elseif (strpos($proptype, 'real') === 0) {
$pictoType = 'double';
}
- print (!empty($pictoType) ? getPictoForType($pictoType) : getPictoForType($proptype)).''.dol_escape_htmltag($proptype).'';
+ print(!empty($pictoType) ? getPictoForType($pictoType) : getPictoForType($proptype)).''.dol_escape_htmltag($proptype).'';
print '';
print '';
if ($proparrayofkeyval) {
@@ -4580,7 +4580,7 @@ if ($module == 'initmodule') {
print '';
$doleditor = new DolEditor('editfilecontent', $content, '', '300', 'Full', 'In', true, false, 'ace', 0, '99%');
- print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09') ?GETPOST('format', 'aZ09') : 'html'));
+ print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09') ? GETPOST('format', 'aZ09') : 'html'));
print ' ';
print '';
print '';
@@ -4622,7 +4622,7 @@ if ($module == 'initmodule') {
print '';
$doleditor = new DolEditor('editfilecontent', $content, '', '300', 'Full', 'In', true, false, 'ace', 0, '99%');
- print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09') ?GETPOST('format', 'aZ09') : 'html'));
+ print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09') ? GETPOST('format', 'aZ09') : 'html'));
print ' ';
print '';
print '';
@@ -4766,7 +4766,7 @@ if ($module == 'initmodule') {
print '';
print '';
- print ($i + 1);
+ print($i + 1);
print ' | ';
print '';
@@ -4819,7 +4819,7 @@ if ($module == 'initmodule') {
print ' | ';
print '| ';
- print ($i + 1);
+ print($i + 1);
print ' | ';
print '';
@@ -4975,7 +4975,7 @@ if ($module == 'initmodule') {
print '';
$doleditor = new DolEditor('editfilecontent', $content, '', '300', 'Full', 'In', true, false, 'ace', 0, '99%');
- print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09') ?GETPOST('format', 'aZ09') : 'html'));
+ print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09') ? GETPOST('format', 'aZ09') : 'html'));
print ' ';
print '';
print '';
@@ -5011,18 +5011,18 @@ if ($module == 'initmodule') {
}
$groupedRights[$key][] = $right;
}
- $groupedRights_json = json_encode($groupedRights);
+ $groupedRights_json = json_encode($groupedRights);
if ($action == 'deletemenu') {
- $formconfirms = $form->formconfirm(
- $_SERVER["PHP_SELF"].'?menukey='.urlencode(GETPOST('menukey', 'int')).'&tab='.urlencode($tab).'&module='.urlencode($module),
- $langs->trans('Delete'),
- ($menus[GETPOST('menukey')]['fk_menu'] === 'fk_mainmenu='.strtolower($module) ? $langs->trans('Warning: you will delete all menus linked to this one.', GETPOST('menukey', 'int')) : $langs->trans('Confirm Delete Menu', GETPOST('menukey', 'int'))),
- 'confirm_deletemenu',
- '',
- 0,
- 1
- );
+ $formconfirms = $form->formconfirm(
+ $_SERVER["PHP_SELF"].'?menukey='.urlencode(GETPOST('menukey', 'int')).'&tab='.urlencode($tab).'&module='.urlencode($module),
+ $langs->trans('Delete'),
+ ($menus[GETPOST('menukey')]['fk_menu'] === 'fk_mainmenu='.strtolower($module) ? $langs->trans('Warning: you will delete all menus linked to this one.', GETPOST('menukey', 'int')) : $langs->trans('Confirm Delete Menu', GETPOST('menukey', 'int'))),
+ 'confirm_deletemenu',
+ '',
+ 0,
+ 1
+ );
print $formconfirms;
}
if ($action != 'editfile' || empty($file)) {
@@ -5149,7 +5149,7 @@ if ($module == 'initmodule') {
$propMainmenu = !empty($menu['mainmenu']) ? $menu['mainmenu'] : GETPOST('mainmenu');
$propLeftmenu = !empty($menu['leftmenu']) ? $menu['leftmenu'] : GETPOST('leftmenu');
$propUrl = !empty($menu['url']) ? $menu['url'] : GETPOST('url', 'alpha');
- $propPerms = !empty($menu['perms']) ? $menu['perms'] : GETPOST('perms');
+ $propPerms = !empty($menu['perms']) ? $menu['perms'] : GETPOST('perms');
$propUser = !empty($menu['user']) ? $menu['user'] : GETPOST('user');
$propTarget = !empty($menu['target']) ? $menu['target'] : GETPOST('target');
$propEnabled = !empty($menu['enabled']) ? $menu['enabled'] : GETPOST('enabled');
@@ -5178,7 +5178,7 @@ if ($module == 'initmodule') {
';
- print ' | ';
print '';
if ($menu['titre'] != 'Module'.$module.'Name') {
- print ''.img_edit().'';
- print ''.img_delete().'';
+ print ''.img_edit().'';
+ print ''.img_delete().'';
}
print ' | ';
}
@@ -5409,7 +5409,7 @@ if ($module == 'initmodule') {
print '';
$doleditor = new DolEditor('editfilecontent', $content, '', '300', 'Full', 'In', true, false, 'ace', 0, '99%');
- print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09') ?GETPOST('format', 'aZ09') : 'html'));
+ print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09') ? GETPOST('format', 'aZ09') : 'html'));
print ' ';
print '';
print '';
@@ -5659,7 +5659,7 @@ if ($module == 'initmodule') {
print '';
$doleditor = new DolEditor('editfilecontent', $content, '', '300', 'Full', 'In', true, false, 'ace', 0, '99%');
- print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09') ?GETPOST('format', 'aZ09') : 'html'));
+ print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09') ? GETPOST('format', 'aZ09') : 'html'));
print ' ';
print '';
print '';
@@ -5714,7 +5714,7 @@ if ($module == 'initmodule') {
print '';
$doleditor = new DolEditor('editfilecontent', $content, '', '300', 'Full', 'In', true, false, 'ace', 0, '99%');
- print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09') ?GETPOST('format', 'aZ09') : 'html'));
+ print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09') ? GETPOST('format', 'aZ09') : 'html'));
print ' ';
print '';
print '';
@@ -5780,7 +5780,7 @@ if ($module == 'initmodule') {
print '';
$doleditor = new DolEditor('editfilecontent', $content, '', '300', 'Full', 'In', true, false, 'ace', 0, '99%');
- print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09') ?GETPOST('format', 'aZ09') : 'html'));
+ print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09') ? GETPOST('format', 'aZ09') : 'html'));
print ' ';
print '';
print '';
@@ -5826,7 +5826,7 @@ if ($module == 'initmodule') {
print '';
$doleditor = new DolEditor('editfilecontent', $content, '', '300', 'Full', 'In', true, false, 'ace', 0, '99%');
- print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09') ?GETPOST('format', 'aZ09') : 'html'));
+ print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09') ? GETPOST('format', 'aZ09') : 'html'));
print ' ';
print '';
print '';
@@ -5872,7 +5872,7 @@ if ($module == 'initmodule') {
print '';
$doleditor = new DolEditor('editfilecontent', $content, '', '300', 'Full', 'In', true, false, 'ace', 0, '99%');
- print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09') ?GETPOST('format', 'aZ09') : 'html'));
+ print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09') ? GETPOST('format', 'aZ09') : 'html'));
print ' ';
print '';
print '';
@@ -5924,7 +5924,7 @@ if ($module == 'initmodule') {
print '';
$doleditor = new DolEditor('editfilecontent', $content, '', '300', 'Full', 'In', true, false, 'ace', 0, '99%');
- print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09') ?GETPOST('format', 'aZ09') : 'html'));
+ print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09') ? GETPOST('format', 'aZ09') : 'html'));
print ' ';
print '';
print '';
@@ -5964,7 +5964,7 @@ if ($module == 'initmodule') {
print '';
$doleditor = new DolEditor('editfilecontent', $content, '', '300', 'Full', 'In', true, false, 'ace', 0, '99%');
- print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09') ?GETPOST('format', 'aZ09') : 'html'));
+ print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09') ? GETPOST('format', 'aZ09') : 'html'));
print ' ';
print '';
print '';
@@ -6044,7 +6044,7 @@ if ($module == 'initmodule') {
print '';
$doleditor = new DolEditor('editfilecontent', $content, '', '300', 'Full', 'In', true, false, 'ace', 0, '99%');
- print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09') ?GETPOST('format', 'aZ09') : 'html'));
+ print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09') ? GETPOST('format', 'aZ09') : 'html'));
print ' ';
print '';
print '';
@@ -6166,7 +6166,7 @@ if ($module == 'initmodule') {
print '';
$doleditor = new DolEditor('editfilecontent', $content, '', '300', 'Full', 'In', true, false, 'ace', 0, '99%');
- print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09') ?GETPOST('format', 'aZ09') : 'html'));
+ print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09') ? GETPOST('format', 'aZ09') : 'html'));
print ' ';
print '';
print '';
@@ -6225,7 +6225,7 @@ if ($module == 'initmodule') {
print '';
$doleditor = new DolEditor('editfilecontent', $content, '', '300', 'Full', 'In', true, false, 'ace', 0, '99%');
- print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09') ?GETPOST('format', 'aZ09') : 'html'));
+ print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09') ? GETPOST('format', 'aZ09') : 'html'));
print ' ';
print '';
print '';
@@ -6469,7 +6469,7 @@ if ($module == 'initmodule') {
print '';
$doleditor = new DolEditor('editfilecontent', $content, '', '300', 'Full', 'In', true, false, 'ace', 0, '99%');
- print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09') ?GETPOST('format', 'aZ09') : 'html'));
+ print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09') ? GETPOST('format', 'aZ09') : 'html'));
print ' ';
print '';
print '';
diff --git a/htdocs/modulebuilder/template/admin/about.php b/htdocs/modulebuilder/template/admin/about.php
index 6e169cad3ec..d2b996cd016 100644
--- a/htdocs/modulebuilder/template/admin/about.php
+++ b/htdocs/modulebuilder/template/admin/about.php
@@ -31,7 +31,8 @@ if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
+ $i--;
+ $j--;
}
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
$res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
diff --git a/htdocs/modulebuilder/template/admin/myobject_extrafields.php b/htdocs/modulebuilder/template/admin/myobject_extrafields.php
index 07653753646..4b7ee34930f 100644
--- a/htdocs/modulebuilder/template/admin/myobject_extrafields.php
+++ b/htdocs/modulebuilder/template/admin/myobject_extrafields.php
@@ -35,7 +35,8 @@ if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
+ $i--;
+ $j--;
}
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
$res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php
index 68b28ea758c..f74c4b7e68a 100644
--- a/htdocs/modulebuilder/template/admin/setup.php
+++ b/htdocs/modulebuilder/template/admin/setup.php
@@ -31,7 +31,8 @@ if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
+ $i--;
+ $j--;
}
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
$res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
@@ -199,7 +200,9 @@ if ($action == 'updateMask') {
$tmpobject->initAsSpecimen();
// Search template files
- $file = ''; $classname = ''; $filefound = 0;
+ $file = '';
+ $classname = '';
+ $filefound = 0;
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) {
$file = dol_buildpath($reldir."core/modules/mymodule/doc/pdf_".$modele."_".strtolower($tmpobjectkey).".modules.php", 0);
@@ -499,7 +502,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
if ($modulequalified) {
print '| ';
- print (empty($module->name) ? $name : $module->name);
+ print(empty($module->name) ? $name : $module->name);
print " | \n";
if (method_exists($module, 'info')) {
print $module->info($langs);
diff --git a/htdocs/modulebuilder/template/class/actions_mymodule.class.php b/htdocs/modulebuilder/template/class/actions_mymodule.class.php
index a4698139a24..de16b676c00 100644
--- a/htdocs/modulebuilder/template/class/actions_mymodule.class.php
+++ b/htdocs/modulebuilder/template/class/actions_mymodule.class.php
@@ -203,7 +203,8 @@ class ActionsMyModule extends CommonHookActions
$outputlangs = $langs;
- $ret = 0; $deltemp = array();
+ $ret = 0;
+ $deltemp = array();
dol_syslog(get_class($this).'::executeHooks action='.$action);
/* print_r($parameters); print_r($object); echo "action: " . $action; */
@@ -230,7 +231,8 @@ class ActionsMyModule extends CommonHookActions
$outputlangs = $langs;
- $ret = 0; $deltemp = array();
+ $ret = 0;
+ $deltemp = array();
dol_syslog(get_class($this).'::executeHooks action='.$action);
/* print_r($parameters); print_r($object); echo "action: " . $action; */
diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php
index 7965ab73181..30490b92e6d 100644
--- a/htdocs/modulebuilder/template/class/myobject.class.php
+++ b/htdocs/modulebuilder/template/class/myobject.class.php
@@ -475,7 +475,9 @@ class MyObject extends CommonObject
// single value
$sqlwhere[] = $key . " = " . intval($value);
} elseif (is_array($value)) {
- if (empty($value)) continue;
+ if (empty($value)) {
+ continue;
+ }
$sqlwhere[] = $key . ' IN (' . $this->db->sanitize(implode(',', array_map('intval', $value))) . ')';
}
continue;
@@ -662,13 +664,15 @@ class MyObject extends CommonObject
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'myobject/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->error = $this->db->lasterror();
+ $error++;
+ $this->error = $this->db->lasterror();
}
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'myobject/".$this->db->escape($this->newref)."'";
$sql .= " WHERE filepath = 'myobject/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->error = $this->db->lasterror();
+ $error++;
+ $this->error = $this->db->lasterror();
}
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
@@ -866,7 +870,7 @@ class MyObject extends CommonObject
$label = $langs->trans("ShowMyObject");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
- $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
+ $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php
index baaaf67c00d..0d34cb3ba06 100644
--- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php
+++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php
@@ -913,7 +913,9 @@ class pdf_standard_myobject extends ModelePDFMyObject
global $conf, $langs;
$ltrdirection = 'L';
- if ($outputlangs->trans("DIRECTION") == 'rtl') $ltrdirection = 'R';
+ if ($outputlangs->trans("DIRECTION") == 'rtl') {
+ $ltrdirection = 'R';
+ }
// Load traductions files required by page
$outputlangs->loadLangs(array("main", "bills", "propal", "companies"));
diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php
index 22877a3fd0e..b8362e973f0 100644
--- a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php
+++ b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php
@@ -83,7 +83,8 @@ class mod_myobject_standard extends ModeleNumRefMyObject
{
global $conf, $langs, $db;
- $coyymm = ''; $max = '';
+ $coyymm = '';
+ $max = '';
$posindice = strlen($this->prefix) + 6;
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
@@ -99,7 +100,8 @@ class mod_myobject_standard extends ModeleNumRefMyObject
if ($resql) {
$row = $db->fetch_row($resql);
if ($row) {
- $coyymm = substr($row[0], 0, 6); $max = $row[0];
+ $coyymm = substr($row[0], 0, 6);
+ $max = $row[0];
}
}
if ($coyymm && !preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i', $coyymm)) {
diff --git a/htdocs/modulebuilder/template/core/tpl/linkedobjectblock_myobject.tpl.php b/htdocs/modulebuilder/template/core/tpl/linkedobjectblock_myobject.tpl.php
index 21cb16c3644..f34850b5166 100644
--- a/htdocs/modulebuilder/template/core/tpl/linkedobjectblock_myobject.tpl.php
+++ b/htdocs/modulebuilder/template/core/tpl/linkedobjectblock_myobject.tpl.php
@@ -41,8 +41,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
$trclass = 'oddeven';
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) {
$trclass .= ' liste_sub_total';
- }
- ?>
+ } ?>
|
| trans("MyObject"); ?> |
getNomUrl(1); ?> |
diff --git a/htdocs/modulebuilder/template/css/mymodule.css.php b/htdocs/modulebuilder/template/css/mymodule.css.php
index 260868a10bf..d805158c114 100644
--- a/htdocs/modulebuilder/template/css/mymodule.css.php
+++ b/htdocs/modulebuilder/template/css/mymodule.css.php
@@ -56,7 +56,8 @@ if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
+ $i--;
+ $j--;
}
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
$res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
diff --git a/htdocs/modulebuilder/template/js/mymodule.js.php b/htdocs/modulebuilder/template/js/mymodule.js.php
index fe04cdc2ad9..416294e214f 100644
--- a/htdocs/modulebuilder/template/js/mymodule.js.php
+++ b/htdocs/modulebuilder/template/js/mymodule.js.php
@@ -64,7 +64,8 @@ if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
+ $i--;
+ $j--;
}
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
$res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
diff --git a/htdocs/modulebuilder/template/mymoduleindex.php b/htdocs/modulebuilder/template/mymoduleindex.php
index 3c7cc5f9ec5..0d2cda18944 100644
--- a/htdocs/modulebuilder/template/mymoduleindex.php
+++ b/htdocs/modulebuilder/template/mymoduleindex.php
@@ -33,7 +33,8 @@ if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
+ $i--;
+ $j--;
}
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
$res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php
index 9e47086656e..0b01fe5f6a4 100644
--- a/htdocs/modulebuilder/template/myobject_agenda.php
+++ b/htdocs/modulebuilder/template/myobject_agenda.php
@@ -50,7 +50,8 @@ if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
+ $i--;
+ $j--;
}
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
$res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
@@ -150,7 +151,9 @@ if ($enablepermissioncheck) {
if (!isModEnabled("mymodule")) {
accessforbidden();
}
-if (!$permissiontoread) accessforbidden();
+if (!$permissiontoread) {
+ accessforbidden();
+}
/*
@@ -310,7 +313,7 @@ if ($object->id > 0) {
//require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
//$cachekey = 'count_events_myobject_'.$object->id;
//$nbEvent = dol_getcache($cachekey);
- $titlelist = $langs->trans("Actions").(is_numeric($nbEvent) ? '('.$nbEvent.')': '');
+ $titlelist = $langs->trans("Actions").(is_numeric($nbEvent) ? '('.$nbEvent.')' : '');
print_barre_liste($titlelist, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 0);
diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php
index 18ed571958f..1f3fc50b0bb 100644
--- a/htdocs/modulebuilder/template/myobject_card.php
+++ b/htdocs/modulebuilder/template/myobject_card.php
@@ -54,7 +54,8 @@ if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
+ $i--;
+ $j--;
}
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
$res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
@@ -501,9 +502,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$parameters = array();
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
- if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
- if (empty($reshook))
+ if ($reshook < 0) {
+ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
+ }
+ if (empty($reshook)) {
$object->formAddObjectLine(1, $mysoc, $soc);
+ }
}
}
@@ -551,7 +555,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Clone
if ($permissiontoadd) {
- print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.(!empty($object->socid)?'&socid='.$object->socid:'').'&action=clone&token='.newToken(), '', $permissiontoadd);
+ print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.(!empty($object->socid) ? '&socid='.$object->socid : '').'&action=clone&token='.newToken(), '', $permissiontoadd);
}
/*
diff --git a/htdocs/modulebuilder/template/myobject_contact.php b/htdocs/modulebuilder/template/myobject_contact.php
index 3fb9e139cb3..51b97e1d3b5 100644
--- a/htdocs/modulebuilder/template/myobject_contact.php
+++ b/htdocs/modulebuilder/template/myobject_contact.php
@@ -31,7 +31,8 @@ if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
+ $i--;
+ $j--;
}
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
$res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
@@ -61,7 +62,7 @@ dol_include_once('/mymodule/lib/mymodule_myobject.lib.php');
// Load translation files required by the page
$langs->loadLangs(array("mymodule@mymodule", "companies", "other", "mails"));
-$id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility
+$id = (GETPOST('id') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility
$ref = GETPOST('ref', 'alpha');
$lineid = GETPOST('lineid', 'int');
$socid = GETPOST('socid', 'int');
@@ -97,7 +98,9 @@ if ($enablepermissioncheck) {
if (!isModEnabled("mymodule")) {
accessforbidden();
}
-if (!$permissiontoread) accessforbidden();
+if (!$permissiontoread) {
+ accessforbidden();
+}
/*
diff --git a/htdocs/modulebuilder/template/myobject_document.php b/htdocs/modulebuilder/template/myobject_document.php
index 8b97342da44..02263a1db91 100644
--- a/htdocs/modulebuilder/template/myobject_document.php
+++ b/htdocs/modulebuilder/template/myobject_document.php
@@ -52,7 +52,8 @@ if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
+ $i--;
+ $j--;
}
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
$res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
@@ -181,7 +182,7 @@ print dol_get_fiche_head($head, 'document', $langs->trans("MyObject"), -1, $obje
// Build file list
-$filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
+$filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC), 1);
$totalsize = 0;
foreach ($filearray as $key => $file) {
$totalsize += $file['size'];
diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php
index 0d3e8285c32..c7904ea3d93 100644
--- a/htdocs/modulebuilder/template/myobject_list.php
+++ b/htdocs/modulebuilder/template/myobject_list.php
@@ -203,7 +203,9 @@ if ($enablepermissioncheck) {
}
// Security check (enable the most restrictive one)
-if ($user->socid > 0) accessforbidden();
+if ($user->socid > 0) {
+ accessforbidden();
+}
//if ($user->socid > 0) accessforbidden();
//$socid = 0; if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
@@ -211,7 +213,9 @@ if ($user->socid > 0) accessforbidden();
if (!isModEnabled("mymodule")) {
accessforbidden('Module mymodule not enabled');
}
-if (!$permissiontoread) accessforbidden();
+if (!$permissiontoread) {
+ accessforbidden();
+}
/*
diff --git a/htdocs/modulebuilder/template/myobject_note.php b/htdocs/modulebuilder/template/myobject_note.php
index 03c1b4c5027..ebcc61745f4 100644
--- a/htdocs/modulebuilder/template/myobject_note.php
+++ b/htdocs/modulebuilder/template/myobject_note.php
@@ -53,7 +53,8 @@ if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
+ $i--;
+ $j--;
}
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
$res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
@@ -124,7 +125,9 @@ if ($enablepermissioncheck) {
if (!isModEnabled("mymodule")) {
accessforbidden();
}
-if (!$permissiontoread) accessforbidden();
+if (!$permissiontoread) {
+ accessforbidden();
+}
/*
@@ -202,7 +205,7 @@ if ($id > 0 || !empty($ref)) {
}
}
}*/
- $morehtmlref .= '';
+ $morehtmlref .= '';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
diff --git a/htdocs/modulebuilder/template/scripts/mymodule.php b/htdocs/modulebuilder/template/scripts/mymodule.php
index 00ae51de42f..8d2e0060d0b 100644
--- a/htdocs/modulebuilder/template/scripts/mymodule.php
+++ b/htdocs/modulebuilder/template/scripts/mymodule.php
@@ -41,7 +41,9 @@
//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler
//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification
-if (!defined('NOSESSION')) define('NOSESSION', '1'); // On CLI mode, no need to use web sessions
+if (!defined('NOSESSION')) {
+ define('NOSESSION', '1');
+} // On CLI mode, no need to use web sessions
$sapi_type = php_sapi_name();
@@ -68,7 +70,8 @@ $res = 0;
// Try master.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
- $i--; $j--;
+ $i--;
+ $j--;
}
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/master.inc.php")) {
$res = @include substr($tmp, 0, ($i + 1))."/master.inc.php";
@@ -99,7 +102,8 @@ $langs->load("main"); // To load language file for default language
// Load user and its permissions
$result = $user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user.
if (!($result > 0)) {
- dol_print_error('', $user->error); exit;
+ dol_print_error('', $user->error);
+ exit;
}
$user->getrights();
diff --git a/htdocs/mrp/ajax/interface.php b/htdocs/mrp/ajax/interface.php
index 195c9a570bd..5d9501d13c2 100644
--- a/htdocs/mrp/ajax/interface.php
+++ b/htdocs/mrp/ajax/interface.php
@@ -50,7 +50,9 @@ if ($action == 'updateselectbatchbywarehouse' && $permissiontoproduce) {
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_stock as ps on ps.rowid = pb.fk_product_stock";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "entrepot as e on e.rowid = ps.fk_entrepot AND e.entity IN (" . getEntity('stock') . ")";
$sql .= " WHERE ps.fk_product = " .((int) $fk_product);
- if ($warehouse_id > 0) $sql .= " AND fk_entrepot = '" . ((int) $warehouse_id) . "'";
+ if ($warehouse_id > 0) {
+ $sql .= " AND fk_entrepot = '" . ((int) $warehouse_id) . "'";
+ }
$sql .= " ORDER BY e.ref, pb.batch";
$resql = $db->query($sql);
@@ -74,7 +76,9 @@ if ($action == 'updateselectbatchbywarehouse' && $permissiontoproduce) {
$sql .= " JOIN " . MAIN_DB_PREFIX . "product_stock as ps on ps.rowid = pb.fk_product_stock";
$sql .= " JOIN " . MAIN_DB_PREFIX . "entrepot as e on e.rowid = ps.fk_entrepot AND e.entity IN (" . getEntity('stock') . ")";
$sql .= " WHERE ps.fk_product = " .((int) $fk_product);
- if ($batch) $sql.= " AND pb.batch = '" . $db->escape($batch) . "'";
+ if ($batch) {
+ $sql.= " AND pb.batch = '" . $db->escape($batch) . "'";
+ }
$sql .= " ORDER BY e.ref, pb.batch";
$resql = $db->query($sql);
diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php
index df60b69fa84..86273c415d0 100644
--- a/htdocs/mrp/class/mo.class.php
+++ b/htdocs/mrp/class/mo.class.php
@@ -739,11 +739,13 @@ class Mo extends CommonObject
$moline->fk_mo = $this->id;
$moline->origin_id = $line->id;
$moline->origin_type = 'bomline';
- if (!empty($line->fk_unit)) $moline->fk_unit = $line->fk_unit;
+ if (!empty($line->fk_unit)) {
+ $moline->fk_unit = $line->fk_unit;
+ }
if ($line->qty_frozen) {
$moline->qty = $line->qty; // Qty to consume does not depends on quantity to produce
} else {
- $moline->qty = price2num(($line->qty / ( !empty($bom->qty) ? $bom->qty : 1 ) ) * $this->qty / ( !empty($line->efficiency) ? $line->efficiency : 1 ), 'MS'); // Calculate with Qty to produce and more presition
+ $moline->qty = price2num(($line->qty / (!empty($bom->qty) ? $bom->qty : 1)) * $this->qty / (!empty($line->efficiency) ? $line->efficiency : 1), 'MS'); // Calculate with Qty to produce and more presition
}
if ($moline->qty <= 0) {
$error++;
@@ -755,7 +757,9 @@ class Mo extends CommonObject
$moline->position = $line->position;
$moline->qty_frozen = $line->qty_frozen;
$moline->disable_stock_change = $line->disable_stock_change;
- if (!empty($line->fk_default_workstation)) $moline->fk_default_workstation = $line->fk_default_workstation;
+ if (!empty($line->fk_default_workstation)) {
+ $moline->fk_default_workstation = $line->fk_default_workstation;
+ }
$resultline = $moline->create($user, false); // Never use triggers here
if ($resultline <= 0) {
@@ -792,7 +796,9 @@ class Mo extends CommonObject
{
$error = 0;
- if ($this->status != self::STATUS_DRAFT) return 1;
+ if ($this->status != self::STATUS_DRAFT) {
+ return 1;
+ }
$this->db->begin();
@@ -805,14 +811,18 @@ class Mo extends CommonObject
while ($obj = $this->db->fetch_object($resql)) {
$moLine = new MoLine($this->db);
$res = $moLine->fetch($obj->rowid);
- if (!$res) $error++;
+ if (!$res) {
+ $error++;
+ }
if ($moLine->role == 'toconsume' || $moLine->role == 'toproduce') {
if (empty($moLine->qty_frozen)) {
$qty = $newQty * $moLine->qty / $oldQty;
$moLine->qty = price2num($qty, 'MS');
$res = $moLine->update($user);
- if (!$res) $error++;
+ if (!$res) {
+ $error++;
+ }
}
}
}
@@ -1074,13 +1084,15 @@ class Mo extends CommonObject
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'mrp/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->error = $this->db->lasterror();
+ $error++;
+ $this->error = $this->db->lasterror();
}
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filepath = 'mrp/".$this->db->escape($this->newref)."'";
$sql .= " WHERE filepath = 'mrp/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->error = $this->db->lasterror();
+ $error++;
+ $this->error = $this->db->lasterror();
}
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
@@ -1430,7 +1442,7 @@ class Mo extends CommonObject
$label = $langs->trans("ShowMo");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
- $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
+ $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
@@ -1574,7 +1586,9 @@ class Mo extends CommonObject
$objectline = new MoLine($this->db);
$TFilters = array('customsql'=>'fk_mo = '.((int) $this->id));
- if (!empty($rolefilter)) $TFilters['role'] = $rolefilter;
+ if (!empty($rolefilter)) {
+ $TFilters['role'] = $rolefilter;
+ }
$result = $objectline->fetchAll('ASC', 'position', 0, 0, $TFilters);
if (is_numeric($result)) {
@@ -1713,7 +1727,9 @@ class Mo extends CommonObject
$reshook = 0;
if (is_object($hookmanager)) {
$parameters = array('line'=>$line, 'i'=>$i, 'restrictlist'=>$restrictlist, 'selectedLines'=> $selectedLines);
- if (!empty($line->fk_parent_line)) { $parameters['fk_parent_line'] = $line->fk_parent_line; }
+ if (!empty($line->fk_parent_line)) {
+ $parameters['fk_parent_line'] = $line->fk_parent_line;
+ }
$reshook = $hookmanager->executeHooks('printOriginObjectLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
}
if (empty($reshook)) {
@@ -1798,7 +1814,6 @@ class Mo extends CommonObject
*/
public function getMoChilds()
{
-
$TMoChilds = array();
$error = 0;
@@ -1814,8 +1829,11 @@ class Mo extends CommonObject
while ($obj = $this->db->fetch_object($resql)) {
$MoChild = new Mo($this->db);
$res = $MoChild->fetch($obj->rowid);
- if ($res > 0) $TMoChilds[$MoChild->id] = $MoChild;
- else $error++;
+ if ($res > 0) {
+ $TMoChilds[$MoChild->id] = $MoChild;
+ } else {
+ $error++;
+ }
}
}
} else {
@@ -1837,16 +1855,22 @@ class Mo extends CommonObject
*/
public function getAllMoChilds($depth = 0)
{
- if ($depth > 1000) return -1;
+ if ($depth > 1000) {
+ return -1;
+ }
$TMoChilds = array();
$error = 0;
$childMoList = $this->getMoChilds();
- if ($childMoList == -1) return -1;
+ if ($childMoList == -1) {
+ return -1;
+ }
- foreach ($childMoList as $childMo) $TMoChilds[$childMo->id] = $childMo;
+ foreach ($childMoList as $childMo) {
+ $TMoChilds[$childMo->id] = $childMo;
+ }
foreach ($childMoList as $childMo) {
$childMoChildren = $childMo->getAllMoChilds($depth + 1);
@@ -1889,7 +1913,9 @@ class Mo extends CommonObject
if ($this->db->num_rows($resql) > 0) {
$obj = $this->db->fetch_object($resql);
$res = $MoParent->fetch($obj->id_moparent);
- if ($res < 0) $error++;
+ if ($res < 0) {
+ $error++;
+ }
} else {
return 0;
}
diff --git a/htdocs/mrp/mo_agenda.php b/htdocs/mrp/mo_agenda.php
index 67c1d13ddc5..755d1f2fbf1 100644
--- a/htdocs/mrp/mo_agenda.php
+++ b/htdocs/mrp/mo_agenda.php
@@ -50,12 +50,12 @@ if (GETPOST('actioncode', 'array')) {
$actioncode = '0';
}
} else {
- $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
+ $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
}
$search_rowid = GETPOST('search_rowid');
$search_agenda_label = GETPOST('search_agenda_label');
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php
index d81d8611995..7dcfec9e805 100644
--- a/htdocs/mrp/mo_card.php
+++ b/htdocs/mrp/mo_card.php
@@ -49,7 +49,7 @@ $ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
$cancel = GETPOST('cancel', 'aZ09');
-$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'mocard'; // To manage different context of search
+$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'mocard'; // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha');
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
$TBomLineId = GETPOST('bomlineid', 'array');
@@ -365,9 +365,7 @@ if ($action == 'create') {
print dol_get_fiche_end();
- mrpCollapseBomManagement();
-
- ?>
+ mrpCollapseBomManagement(); ?>
|