From 442614f5bdab95a6482653043bef09b1c3873dac Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 3 Jul 2014 16:42:56 +0000 Subject: [PATCH] * Addressbook,Calendar,InfoLog,Timesheet: switch on history / delete preventions, if there is not already a config --- phpgwapi/setup/tables_update_1_8.inc.php | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/phpgwapi/setup/tables_update_1_8.inc.php b/phpgwapi/setup/tables_update_1_8.inc.php index a4870aa715..f5abcc6091 100644 --- a/phpgwapi/setup/tables_update_1_8.inc.php +++ b/phpgwapi/setup/tables_update_1_8.inc.php @@ -565,5 +565,30 @@ function phpgwapi_upgrade1_9_021() } preferences::change_preference('common', 'maxmatchs', '20', null, 'forced'); + // switch on history / delete preventions for addressbook, calendar and infolog, if not yet a config exists + // for new installs this is done in setup_process::save_minimal_config + foreach(array( + 'phgwapi' => array( + 'history' => 'history', // addressbook + 'calendar_delete_history' => 'history', + ), + 'infolog' => array( + 'history' => 'history_admin_delete', + ) + ) as $app => $data) + { + foreach($data as $name => $value) + { + if (!$GLOBALS['egw_setup']->db->select('egw_config','COUNT(*)', $row=array( + 'config_app' => $app, + 'config_name' => $name, + ), __LINE__, __FILE__)->fetchColumn()) + { + $row['config_value'] = $value; + $GLOBALS['egw_setup']->db->insert('egw_config', $row, null, __LINE__, __FILE__); + } + } + } + return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '14.1'; }