add vcemail field into db for operator/group

git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@644 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
Evgeny Gryaznov 2009-08-18 23:29:05 +00:00
parent 543a68f17e
commit b07eb9bfb6
3 changed files with 13 additions and 3 deletions

View File

@ -22,6 +22,7 @@
$dbtables = array( $dbtables = array(
"chatgroup" => array( "chatgroup" => array(
"groupid" => "int NOT NULL auto_increment PRIMARY KEY", "groupid" => "int NOT NULL auto_increment PRIMARY KEY",
"vcemail" => "varchar(64)",
"vclocalname" => "varchar(64) NOT NULL", "vclocalname" => "varchar(64) NOT NULL",
"vccommonname" => "varchar(64) NOT NULL", "vccommonname" => "varchar(64) NOT NULL",
"vclocaldescription" => "varchar(1024) NOT NULL", "vclocaldescription" => "varchar(1024) NOT NULL",
@ -69,6 +70,7 @@ $dbtables = array(
"vcpassword" => "varchar(64) NOT NULL", "vcpassword" => "varchar(64) NOT NULL",
"vclocalename" => "varchar(64) NOT NULL", "vclocalename" => "varchar(64) NOT NULL",
"vccommonname" => "varchar(64) NOT NULL", "vccommonname" => "varchar(64) NOT NULL",
"vcemail" => "varchar(64)",
"dtmlastvisited" => "datetime DEFAULT 0", "dtmlastvisited" => "datetime DEFAULT 0",
"istatus" => "int DEFAULT 0", /* 0 - online, 1 - away */ "istatus" => "int DEFAULT 0", /* 0 - online, 1 - away */
"vcavatar" => "varchar(255)", "vcavatar" => "varchar(255)",
@ -113,9 +115,9 @@ $memtables = array();
$dbtables_can_update = array( $dbtables_can_update = array(
"chatthread" => array("agentId", "userTyping", "agentTyping", "messageCount", "nextagent", "shownmessageid", "userid", "userAgent", "groupid"), "chatthread" => array("agentId", "userTyping", "agentTyping", "messageCount", "nextagent", "shownmessageid", "userid", "userAgent", "groupid"),
"chatmessage" => array("agentId"), "chatmessage" => array("agentId"),
"chatoperator" => array("vcavatar", "vcjabbername", "iperm", "istatus"), "chatoperator" => array("vcavatar", "vcjabbername", "iperm", "istatus", "vcemail"),
"chatban" => array(), "chatban" => array(),
"chatgroup" => array(), "chatgroup" => array("vcemail"),
"chatgroupoperator" => array(), "chatgroupoperator" => array(),
"chatresponses" => array(), "chatresponses" => array(),
); );

View File

@ -130,6 +130,10 @@ if ($act == "silentcreateall") {
runsql("ALTER TABLE chatoperator ADD vcjabbername varchar(255)", $link); runsql("ALTER TABLE chatoperator ADD vcjabbername varchar(255)", $link);
} }
if( in_array("chatoperator.vcemail", $absent) ) {
runsql("ALTER TABLE chatoperator ADD vcemail varchar(64)", $link);
}
if( in_array("chatthread.groupid", $absent) ) { if( in_array("chatthread.groupid", $absent) ) {
runsql("ALTER TABLE chatthread ADD groupid int references chatgroup(groupid)", $link); runsql("ALTER TABLE chatthread ADD groupid int references chatgroup(groupid)", $link);
} }
@ -138,6 +142,10 @@ if ($act == "silentcreateall") {
runsql("ALTER TABLE chatthread ADD userAgent varchar(255)", $link); runsql("ALTER TABLE chatthread ADD userAgent varchar(255)", $link);
} }
if( in_array("chatgroup.vcemail", $absent) ) {
runsql("ALTER TABLE chatgroup ADD vcemail varchar(64)", $link);
}
$res = mysql_query("select null from information_schema.statistics where table_name = 'chatmessage' and index_name = 'idx_agentid'", $link); $res = mysql_query("select null from information_schema.statistics where table_name = 'chatmessage' and index_name = 'idx_agentid'", $link);
if($res && mysql_num_rows($res) == 0) { if($res && mysql_num_rows($res) == 0) {
runsql("ALTER TABLE chatmessage ADD INDEX idx_agentid (agentid)", $link); runsql("ALTER TABLE chatmessage ADD INDEX idx_agentid (agentid)", $link);

View File

@ -552,7 +552,7 @@ function webim_mail($toaddr, $reply_to, $subject, $body) {
@mail($toaddr, $real_subject, wordwrap(myiconv($webim_encoding, $mail_encoding, $body),70), $headers); @mail($toaddr, $real_subject, wordwrap(myiconv($webim_encoding, $mail_encoding, $body),70), $headers);
} }
$dbversion = '1.6.2'; $dbversion = '1.6.3';
$settings = array( $settings = array(
'dbversion' => 0, 'dbversion' => 0,