mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 09:15:15 +02:00
Solved issues in ModuleTemplates class
This commit is contained in:
parent
a6ce19db66
commit
a93812d1a8
@ -337,8 +337,10 @@ class ModuleTemplates extends HTML
|
|||||||
$success = false;
|
$success = false;
|
||||||
} else {
|
} else {
|
||||||
db_process_sql_delete('tnetwork_profile_pen', ['id_np' => $this->id_np]);
|
db_process_sql_delete('tnetwork_profile_pen', ['id_np' => $this->id_np]);
|
||||||
|
if (empty($this->pen)) {
|
||||||
|
$success = true;
|
||||||
|
} else {
|
||||||
$pensList = explode(',', $this->pen);
|
$pensList = explode(',', $this->pen);
|
||||||
if (count($pensList) > 0) {
|
|
||||||
// Set again the new PENs associated.
|
// Set again the new PENs associated.
|
||||||
foreach ($pensList as $currentPen) {
|
foreach ($pensList as $currentPen) {
|
||||||
$dbResult_pen = db_process_sql_insert(
|
$dbResult_pen = db_process_sql_insert(
|
||||||
@ -355,8 +357,6 @@ class ModuleTemplates extends HTML
|
|||||||
|
|
||||||
$success = true;
|
$success = true;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
$success = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -379,6 +379,9 @@ class ModuleTemplates extends HTML
|
|||||||
if ($dbResult_tnp != false) {
|
if ($dbResult_tnp != false) {
|
||||||
// Set the new id_np.
|
// Set the new id_np.
|
||||||
$this->id_np = $dbResult_tnp;
|
$this->id_np = $dbResult_tnp;
|
||||||
|
if (empty($this->pen)) {
|
||||||
|
$success = true;
|
||||||
|
} else {
|
||||||
$pensList = explode(',', $this->pen);
|
$pensList = explode(',', $this->pen);
|
||||||
// Insert all of new PENs associated with this id_np.
|
// Insert all of new PENs associated with this id_np.
|
||||||
foreach ($pensList as $currentPen) {
|
foreach ($pensList as $currentPen) {
|
||||||
@ -397,6 +400,7 @@ class ModuleTemplates extends HTML
|
|||||||
$success = true;
|
$success = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($success === true) {
|
if ($success === true) {
|
||||||
$msg = __('Template %s successfully created', $this->name);
|
$msg = __('Template %s successfully created', $this->name);
|
||||||
@ -527,8 +531,7 @@ class ModuleTemplates extends HTML
|
|||||||
// 2 arrays. 1 with the groups, 1 with the groups by parent
|
// 2 arrays. 1 with the groups, 1 with the groups by parent
|
||||||
$groups = [];
|
$groups = [];
|
||||||
$groups_compound = [];
|
$groups_compound = [];
|
||||||
// Default group filter.
|
|
||||||
$groups_compound[0] = 'Group - All';
|
|
||||||
foreach ($result as $row) {
|
foreach ($result as $row) {
|
||||||
$groups[$row['id_sg']] = $row['name'];
|
$groups[$row['id_sg']] = $row['name'];
|
||||||
}
|
}
|
||||||
@ -612,7 +615,7 @@ class ModuleTemplates extends HTML
|
|||||||
'script' => 'filterGroupComponents(event);',
|
'script' => 'filterGroupComponents(event);',
|
||||||
'class' => 'float-right',
|
'class' => 'float-right',
|
||||||
'fields' => $groups_compound,
|
'fields' => $groups_compound,
|
||||||
'nothing' => $groups_compound[$this->ncGroup],
|
'nothing' => 'Group - All',
|
||||||
'return' => true,
|
'return' => true,
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user