Add transaction support to menu and users app_defaults.php.
This commit is contained in:
parent
59b81e5b3d
commit
7e3a375659
|
|
@ -81,6 +81,7 @@
|
|||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
$result_count = count($result);
|
||||
$db->beginTransaction();
|
||||
foreach($result as $field) {
|
||||
//get the menu_uuid
|
||||
$menu_uuid = $field['menu_uuid'];
|
||||
|
|
@ -116,6 +117,7 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
$db->commit();
|
||||
unset($prep_statement);
|
||||
}
|
||||
|
||||
|
|
@ -129,6 +131,7 @@
|
|||
$result_count = count($result);
|
||||
unset($prep_statement);
|
||||
if ($result_count > 0) {
|
||||
$db->beginTransaction();
|
||||
foreach($result as $field) {
|
||||
$menu_item_group_uuid = uuid();
|
||||
$sql = "update v_menu_item_groups ";
|
||||
|
|
@ -141,6 +144,7 @@
|
|||
$count = $db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
}
|
||||
$db->commit();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ if ($domains_processed == 1) {
|
|||
$tmp[$x]['group_name'] = 'agent';
|
||||
$tmp[$x]['group_description'] = 'Call Center Agent Group';
|
||||
$tmp[$x]['group_protected'] = 'false';
|
||||
$db->beginTransaction();
|
||||
foreach($tmp as $row) {
|
||||
if (strlen($row['group_name']) > 0) {
|
||||
$sql = "insert into v_groups ";
|
||||
|
|
@ -76,6 +77,7 @@ if ($domains_processed == 1) {
|
|||
unset($sql);
|
||||
}
|
||||
}
|
||||
$db->commit();
|
||||
}
|
||||
unset($prep_statement, $sub_result);
|
||||
}
|
||||
|
|
@ -131,6 +133,7 @@ if ($domains_processed == 1) {
|
|||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
$db->beginTransaction();
|
||||
foreach($result as $row) {
|
||||
if (strlen($row['group_name']) > 0) {
|
||||
//get the group_uuid
|
||||
|
|
@ -149,6 +152,7 @@ if ($domains_processed == 1) {
|
|||
unset($sql);
|
||||
}
|
||||
}
|
||||
$db->commit();
|
||||
unset ($prep_statement);
|
||||
}
|
||||
|
||||
|
|
@ -161,6 +165,8 @@ if ($domains_processed == 1) {
|
|||
$sub_result = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
||||
unset ($prep_statement);
|
||||
if ($sub_result['count'] > 0) {
|
||||
//begin the transaction
|
||||
$db->beginTransaction();
|
||||
//send output
|
||||
if ($display_type == "text") {
|
||||
echo " Users: set enabled=true\n";
|
||||
|
|
@ -170,6 +176,8 @@ if ($domains_processed == 1) {
|
|||
$sql .= "user_enabled = 'true' ";
|
||||
$db->exec($sql);
|
||||
unset($sql);
|
||||
//end the transaction
|
||||
$db->commit();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue