7 include_once (
"FDL/Lib.Attr.php");
8 include_once (
"FDL/Class.DocFam.php");
16 $action->exitError(
"Empty dbaccess: action->dbaccess.");
20 $usage->setDefinitionText(
"Migrate IUSERS from dynacase 3.1 to 3.2");
29 $q = sprintf(
"WITH RECURSIVE q AS ( SELECT id, fromid FROM docfam WHERE fromid = 128 UNION ALL SELECT docfam.id, docfam.fromid FROM docfam, q WHERE q.id = docfam.fromid ) SELECT id FROM q ORDER BY id");
39 $q = sprintf(
"SELECT id, docid FROM docattr WHERE docid IN (120, 128) AND (type IS NULL OR type NOT IN ('frame', 'tab', 'array', 'menu')) AND id !~ '^:' AND id NOT IN ('us_defaultgroup', 'us_lname', 'us_fname', 'us_mail', 'us_extmail', 'us_meid', 'us_login', 'us_whatid', 'us_roles', 'us_rolesorigin', 'us_rolegorigin', 'us_group', 'us_idgroup', 'us_expires', 'us_daydelay', 'us_expiresd', 'us_expirest', 'us_passdelay', 'us_ldapdn', 'us_substitute', 'us_incumbents', 'us_passwd1', 'us_passwd2', 'us_status', 'us_loginfailure', 'us_accexpiredate')");
44 $sqlList[] = sprintf(
"DELETE FROM docattr WHERE docid = 128 AND id = '%s';", pg_escape_string($attr[
'id']));
47 $q = sprintf(
"SELECT count(%s) AS count FROM doc128 WHERE %s IS NOT NULL", pg_escape_string($attr[
'id']) , pg_escape_string($attr[
'id']));
50 if (!isset($count[0][
'count'])) {
51 printf(
"Error: missing 'count' in result from query '%s'.",
$q);
55 if ($count[0][
'count'] > 0) {
62 $sqlList[] = sprintf(
'ALTER TABLE doc128 DROP COLUMN "%s" CASCADE;', pg_escape_string($attr[
'id']));
69 $q = sprintf(
"SELECT id, docid FROM docattr WHERE docid IN (120, 128) AND id !~ '^:' AND id NOT IN ('us_defaultgroup', 'us_lname', 'us_fname', 'us_mail', 'us_extmail', 'us_meid', 'us_login', 'us_whatid', 'us_roles', 'us_rolesorigin', 'us_rolegorigin', 'us_group', 'us_idgroup', 'us_expires', 'us_daydelay', 'us_expiresd', 'us_expirest', 'us_passdelay', 'us_ldapdn', 'us_substitute', 'us_incumbents', 'us_passwd1', 'us_passwd2', 'us_status', 'us_loginfailure', 'us_accexpiredate')");
72 $sqlList[] = sprintf(
"DELETE FROM docattr WHERE docid IN (%s) AND id = ':%s';", join(
', ',
$childIdList) , pg_escape_string($attr[
'id']));
78 $sqlList[] =
"DELETE FROM docattr WHERE docid = 128 AND type IN ('frame', 'array', 'tab') AND id NOT IN (SELECT DISTINCT dright.id FROM docattr AS dleft, docattr AS dright WHERE dleft.docid = 128 AND dleft.docid = dright.docid AND dleft.frameid = dright.id);";
83 UPDATE docfam SET methods = array_to_string(
86 SELECT regexp_split_to_table(methods, E
'\n') AS method FROM docfam AS docfam2 WHERE docfam2.id = docfam.id
87 ) AS methodlist WHERE method NOT IN (
89 'Method.FAddBook.php',
90 'Method.DocSociety.php',
91 'Method.FAddBookSociety.php',
105 printf(
"%s\n",
$sql);
110 catch(Exception $e) {
111 printf(
"Exception: %s\n", $e->getMessage());
112 printf(
"Error executing SQL transaction:\n%s\n",
$sql);
120 ===========================================================
121 We have detected that you have families that inherits from
122 IUSER, or have modified the IUSER family, and you are
using
123 deprecated attributes that are not present anymore on the
126 The SQL columns and the data have been kept, and you MUST
127 update your families and migrate the data to
new
130 Deprecated columns with data:
134 Press [Continue] to proceed with migration and fix it later
135 ===========================================================
foreach($childList as $child) $resList
simpleQuery($dbaccess, $query, &$result=array(), $singlecolumn=false, $singleresult=false, $useStrict=null)
if($file) if($subject==""&&$file) if($subject=="") $err
Verify arguments for wsh programs.