From: <reg...@us...> - 2005-11-30 11:41:51
|
Update of /cvsroot/egroupware/workflow/setup In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29120/setup Modified Files: setup.inc.php tables_update.inc.php Log Message: bugfixes: group mapping was broken in the workflow with latest update to phpgwapi 1.2 Index: setup.inc.php =================================================================== RCS file: /cvsroot/egroupware/workflow/setup/setup.inc.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** setup.inc.php 27 Nov 2005 17:18:47 -0000 1.15 --- setup.inc.php 30 Nov 2005 11:41:34 -0000 1.16 *************** *** 13,17 **** $setup_info['workflow']['name'] = 'workflow'; $setup_info['workflow']['title'] = 'Workflow management'; ! $setup_info['workflow']['version'] = '1.2.00.002'; $setup_info['workflow']['app_order'] = 10; $setup_info['workflow']['enable'] = 1; --- 13,17 ---- $setup_info['workflow']['name'] = 'workflow'; $setup_info['workflow']['title'] = 'Workflow management'; ! $setup_info['workflow']['version'] = '1.2.01.000'; $setup_info['workflow']['app_order'] = 10; $setup_info['workflow']['enable'] = 1; Index: tables_update.inc.php =================================================================== RCS file: /cvsroot/egroupware/workflow/setup/tables_update.inc.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tables_update.inc.php 27 Nov 2005 17:18:47 -0000 1.12 --- tables_update.inc.php 30 Nov 2005 11:41:34 -0000 1.13 *************** *** 303,306 **** --- 303,327 ---- return $GLOBALS['setup_info']['workflow']['currentver']; } + $test[] = '1.2.00.002'; + function workflow_upgrade1_2_00_002() + { + #groups Ids are now negative in egroupware, we need to negative all user id which is positive and of type 'g' + #code inspired by phpgwapi/setup/table_update.inc.php + // convert all positive group id's to negative ones + // this allows duplicate id for users and groups in ldap + $where = false; + list($table,$col,$where) = $data; + $table = 'egw_wf_user_roles'; + $col = 'wf_user'; + $where = "wf_account_type='g' and (SUBSTR($col,1,1) <> '-')"; + $set = $col.'='.$GLOBALS['egw_setup']->db->concat("'-'",$col); + $query = "UPDATE $table SET $set WHERE $where"; + echo "<p>debug query: $query</p>\n"; + $GLOBALS['egw_setup']->db->query($query,__LINE__,__FILE__); + + #updating the current version + $GLOBALS['setup_info']['workflow']['currentver'] = '1.2.01.000'; + return $GLOBALS['setup_info']['workflow']['currentver']; + } |