diff --git a/.gitignore b/.gitignore index 0f182a0..b82a7cd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,12 @@ *.class +*.prefs +.settings +.project +.classpath # Package Files # *.jar *.war *.ear +/crm/src/main/webapp/Charts/exporting-server/java/highcharts-export/highcharts-export-convert/target/ +/crm/src/main/webapp/Charts/exporting-server/java/highcharts-export/highcharts-export-web/target/ \ No newline at end of file diff --git a/README.md b/README.md index 0b0c46b..0800f68 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,30 @@ -tigerp +fei ====== -Tiger's public repo \ No newline at end of file +Fy's public repo for the BaaS system. + + +Some notes: +

+1. You can create your database schema and restore database by executing following command +

mysql -ucrm crmdb < src/main/db/dump.sql +

+2. If you want to try 'offline' version of the service, you can check it out at http://localhost:8080/offline/home.html + +

+some users/password roles for the testing. +
+tig/12345 Manager +
+li/12345 Admin +
+pi/12345 Sales +
+ki/12345 Sales +
+
+All report to tig +
+ + + diff --git a/crm/.gitignore b/crm/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/crm/.gitignore @@ -0,0 +1 @@ +/target diff --git a/crm/ReportEngine/genReport.bat b/crm/ReportEngine/genReport.bat new file mode 100644 index 0000000..b9273ea --- /dev/null +++ b/crm/ReportEngine/genReport.bat @@ -0,0 +1,91 @@ +ECHO off + +REM org.eclipse.birt.report.engine.impl.ReportRunner Usage: +REM --mode/-m [ run | render | runrender] the default is runrender +REM for runrender mode: +REM we should add it in the end +REM --format/-f [ HTML \| PDF ] +REM --output/-o +REM --htmlType/-t < HTML \| ReportletNoCSS > +REM --locale /-l +REM --parameter/-p <"parameterName=parameterValue"> +REM --file/-F +REM --encoding/-e +REM +REM Locale: default is english +REM parameters in command line will overide parameters in parameter file +REM parameter name cant include characters such as \ ', '=', ':' +REM +REM For RUN mode: +REM we should add it in the end +REM --output/-o +REM --locale /-l +REM --parameter/-p +REM --file/-F +REM +REM Locale: default is english +REM parameters in command line will overide parameters in parameter file +REM parameter name cant include characters such as \ ', '=', ':' +REM +REM For RENDER mode: +REM we should add it in the end +REM --output/-o +REM --page/-p +REM --locale /-l +REM +REM Locale: default is english +IF not "%BIRT_HOME%" == "" GOTO runBirt +ECHO "Please set BIRT_HOME first." +GOTO end +:runBirt + + +SET java.io.tmpdir=%BIRT_HOME%\ReportEngine\tmpdir +SET org.eclipse.datatools_workspacepath=%java.io.tmpdir%\workspace_dtp + + +IF not exist %java.io.tmpdir% mkdir %java.io.tmpdir% +IF not exist %org.eclipse.datatools_workspacepath% mkdir %org.eclipse.datatools_workspacepath% + + +REM set the birt class path. +setlocal enabledelayedexpansion +set BIRTCLASSPATH= +for %%i in (%BIRT_HOME%\ReportEngine\lib\*.jar) do set BIRTCLASSPATH=%%i;!BIRTCLASSPATH! + + +REM set command +SET JAVACMD=java +set p1=%1 +set p2=%2 +set p3=%3 +set p4=%4 +set p5=%5 +set p6=%6 +set p7=%7 +set p8=%8 +set p9=%9 +shift +set p10=%9 +shift +set p11=%9 +shift +set p12=%9 +shift +set p13=%9 +shift +set p14=%9 +shift +set p15=%9 +shift +set p16=%9 +shift +set p17=%9 +shift +set p18=%9 +shift +set p19=%9 + +%JAVACMD% -cp "%BIRTCLASSPATH%" -DBIRT_HOME="%BIRT_HOME%\ReportEngine" org.eclipse.birt.report.engine.api.ReportRunner %p1% %p2% %p3% %p4% %p5% %p6% %p7% %p8% %p9% %p10% %p11% %p12% %p13% %p14% %p15% %p16% %p17% %p18% %p19% + +:end diff --git a/crm/ReportEngine/genReport.sh b/crm/ReportEngine/genReport.sh new file mode 100644 index 0000000..49530d2 --- /dev/null +++ b/crm/ReportEngine/genReport.sh @@ -0,0 +1,53 @@ +################USAGE OF REPORTRUNNER######################### +# echo "org.eclipse.birt.report.engine.impl.ReportRunner Usage:"; +# echo "--mode/-m [ run | render | runrender] the default is runrender " +# echo "for runrender mode: " +# echo "" "we should add it in the end " +# echo "" "--format/-f [ HTML | PDF ] " +# echo "" "--output/-o " +# echo "" "--htmlType/-t < HTML | ReportletNoCSS >" +# echo "" "--locale /-l" +# echo "" "--parameter/-p <"parameterName=parameterValue">" +# echo "" "--file/-F " +# echo "" "--encoding/-e " +# echo " " +# echo "Locale: default is english" +# echo "parameters in command line will overide parameters in parameter file" +# echo "parameter name cant include characters such as \ ', '=', ':'" +# echo " " +# echo "For RUN mode:" +# echo "we should add it in the end" +# echo "" "--output/-o " +# echo "" "--locale /-l" +# echo "" "--parameter/-p " +# echo "" "--file/-F " +# echo " " +# echo "Locale: default is english" +# echo "parameters in command line will overide parameters in parameter file" +# echo "parameter name cant include characters such as \ ', '=', ':'" +# echo " " +# echo "For RENDER mode:" +# echo "" "we should add it in the end" +# echo "" "--output/-o " +# echo "" "--page/-p " +# echo "" "--locale /-l" +# echo " " +# echo "Locale: default is english" +################END OF USAGE ######################### +if [ "$BIRT_HOME" = "" ]; + +then +echo " The BIRT_HOME need be set before BirtRunner can run."; +else + + +java_io_tmpdir=$BIRT_HOME/ReportEngine/tmpdir +org_eclipse_datatools_workspacepath=$java_io_tmpdir/workspace_dtp +mkdir -p $org_eclipse_datatools_workspacepath +unset BIRTCLASSPATH +for i in `ls $BIRT_HOME/ReportEngine/lib/*.jar`;do export BIRTCLASSPATH=$i:$BIRTCLASSPATH;done + +JAVACMD='java'; +$JAVACMD -Djava.awt.headless=true -cp "$BIRTCLASSPATH" -DBIRT_HOME="$BIRT_HOME/ReportEngine" -Dorg.eclipse.datatools_workspacepath="$org_eclipse_datatools_workspacepath" org.eclipse.birt.report.engine.api.ReportRunner ${1+"$@"} + +fi diff --git a/crm/ReportEngine/samples/AccountAndContact.rptdesign b/crm/ReportEngine/samples/AccountAndContact.rptdesign new file mode 100644 index 0000000..6542a0d --- /dev/null +++ b/crm/ReportEngine/samples/AccountAndContact.rptdesign @@ -0,0 +1,1473 @@ + + + Eclipse BIRT Designer Version 4.3.1.v201309091055 Build <4.3.1.v20130917-1035> + in + /templates/blank_report.gif + ltr + 72 + + + + + metadataBidiFormatStr + ILYNN + + + disabledMetadataBidiFormatStr + + + contentBidiFormatStr + ILYNN + + + disabledContentBidiFormatStr + + + com.mysql.jdbc.Driver + jdbc:mysql://localhost/crmdb + crm + + + + + + + id + measure + cid + cid + + + name + dimension + cname + cname + + + id_3 + measure + aid + aid + + + name_4 + dimension + aname + aname + + + bdm_code + dimension + BDMCode + BDMCode + + + + + + 1 + id + integer + + + 2 + name + string + + + 3 + id_3 + integer + + + 4 + name_4 + string + + + 5 + bdm_code + string + + + + Data Source + + + 1 + id + id + integer + 4 + + + 2 + name + name + string + 12 + + + 3 + id_3 + id + integer + 4 + + + 4 + name_4 + name + string + 12 + + + 5 + bdm_code + bdm_code + string + 12 + + + + + + 2.0 + + + + + + + id + 1 + + 4 + 9 + 0 + NotNullable + + cid + + + + cid + + 9 + + + + + + + name + 2 + + 12 + 255 + 0 + NotNullable + + cname + + + + cname + + 255 + + + + + + + id + 3 + + 4 + 9 + 0 + Nullable + + aid + + + + aid + + 9 + + + + + + + name + 4 + + 12 + 255 + 0 + Nullable + + aname + + + + aname + + 255 + + + + + + + bdm_code + 5 + + 12 + 255 + 0 + Nullable + + BDMCode + + + + BDMCode + + 255 + + + + + + + +]]> + + + + + + + NewTabularHierarchy + + + + + integer + id_3 + + + + + + + NewTabularHierarchy1 + + + + + string + name_4 + + + + + + + + + + + count + dataSetRow["name_4"] + integer + + + + + Account&Contact + + + + + + + + + + + + + html + new Date()]]> + + + + + + + solid + 1px + solid + 1px + solid + 1px + solid + 1px + 7.930555555555555in + Account&Contact + + + id + cid + dataSetRow["id"] + integer + + + name + cname + dataSetRow["name"] + string + + + id_3 + aid + dataSetRow["id_3"] + integer + + + name_4 + aname + dataSetRow["name_4"] + string + + + bdm_code + BDMCode + dataSetRow["bdm_code"] + string + + + + justify + 1.5694444444444444in + + + 1.6111111111111112in + + + justify + 1.5833333333333333in + + + justify + 1.5833333333333333in + + + justify + 1.5833333333333333in + +
+ + none + none + none + none + + NewStyle + solid + medium + + + + NewStyle + solid + medium + + + + NewStyle + solid + medium + + + + NewStyle + solid + medium + + + + NewStyle + none + none + solid + medium + none + + + +
+ + + none + none + none + none + + NewStyle + solid + medium + + none + none + none + none + id + + + + NewStyle + solid + medium + + none + none + none + none + name + + + + NewStyle + solid + medium + + none + none + none + none + id_3 + + + + NewStyle + solid + medium + + none + none + none + none + name_4 + + + + NewStyle + solid + medium + + none + none + none + none + bdm_code + + + + +
+ + + solid + medium + + + solid + medium + + + solid + medium + + + solid + medium + + + solid + medium + + +
+
+ + Data Cube + + 2.6.1 + Pie Chart + Standard + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true + + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true + 5 + 5 + + + + 0 + + 255 + 0 + 0 + 0 + + false + + + 0.0 + 0.0 + 0.0 + 0.0 + + + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true + + + + 0 + + 255 + 0 + 0 + 0 + + false + + + 2.0 + 2.0 + 2.0 + 2.0 + + + + + + + + + Vertical + Top_Bottom + + + 1 + + 255 + 0 + 0 + 0 + + true + + Right + Categories + + <Caption> + <Value></Value> + <Font> + <Alignment/> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + <Visible>false</Visible> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>false</Visible> + + Above + + + 0.0 + 0.0 + 212.0 + 130.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true + + Two_Dimensional + Points + 10.0 + 0 + + enable.area.alt + false + + + + 'A','B','C','D','E' + + + 6,4,12,8,10 + 0 + + + + + + This chart contains no data. + + + Center + Center + + + + + 64 + 127 + 127 + 127 + + + + 128 + 127 + 127 + 127 + + true + + + 10.0 + 10.0 + 10.0 + 10.0 + + false + + + + + + + + 255 + 80 + 166 + 218 + + + 255 + 242 + 88 + 106 + + + 255 + 232 + 172 + 57 + + + 255 + 128 + 255 + 128 + + + 255 + 64 + 128 + 128 + + + 255 + 128 + 128 + 192 + + + 255 + 170 + 85 + 85 + + + 255 + 128 + 128 + 0 + + + 255 + 192 + 192 + 192 + + + 255 + 255 + 255 + 128 + + + 255 + 128 + 192 + 128 + + + 255 + 7 + 146 + 94 + + + 255 + 0 + 128 + 255 + + + 255 + 255 + 128 + 192 + + + 255 + 0 + 255 + 255 + + + 255 + 255 + 128 + 128 + + + 255 + 0 + 128 + 192 + + + 255 + 128 + 128 + 192 + + + 255 + 255 + 0 + 255 + + + 255 + 128 + 64 + 64 + + + 255 + 255 + 128 + 64 + + + 255 + 80 + 240 + 120 + + + 255 + 0 + 64 + 128 + + + 255 + 128 + 0 + 64 + + + 255 + 255 + 0 + 128 + + + 255 + 128 + 128 + 64 + + + 255 + 128 + 128 + 128 + + + 255 + 255 + 128 + 255 + + + 255 + 0 + 64 + 0 + + + 255 + 0 + 0 + 0 + + + 255 + 255 + 255 + 255 + + + 255 + 255 + 128 + 0 + + + + + + + + + 255 + 80 + 166 + 218 + + + 255 + 242 + 88 + 106 + + + 255 + 232 + 172 + 57 + + + 255 + 128 + 255 + 128 + + + 255 + 64 + 128 + 128 + + + 255 + 128 + 128 + 192 + + + 255 + 170 + 85 + 85 + + + 255 + 128 + 128 + 0 + + + 255 + 192 + 192 + 192 + + + 255 + 255 + 255 + 128 + + + 255 + 128 + 192 + 128 + + + 255 + 7 + 146 + 94 + + + 255 + 0 + 128 + 255 + + + 255 + 255 + 128 + 192 + + + 255 + 0 + 255 + 255 + + + 255 + 255 + 128 + 128 + + + 255 + 0 + 128 + 192 + + + 255 + 128 + 128 + 192 + + + 255 + 255 + 0 + 255 + + + 255 + 128 + 64 + 64 + + + 255 + 255 + 128 + 64 + + + 255 + 80 + 240 + 120 + + + 255 + 0 + 64 + 128 + + + 255 + 128 + 0 + 64 + + + 255 + 255 + 0 + 128 + + + 255 + 128 + 128 + 64 + + + 255 + 128 + 128 + 128 + + + 255 + 255 + 128 + 255 + + + 255 + 0 + 64 + 0 + + + 255 + 0 + 0 + 0 + + + 255 + 255 + 255 + 255 + + + 255 + 255 + 128 + 0 + + + + true + + + data["id/aname"] + + Text + Sum + + + + + Orthogonal_Value + + , + + Outside + false + + onmouseover + + Show_Tooltip + + + 200 + + + + 0 + + <Caption> + <Value></Value> + <Font> + <Size>16.0</Size> + <Bold>true</Bold> + <Alignment/> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>true</Visible> + + Below + + + 1 + true + + 10.0 + + + Text + Sum + + + + true + + + data["name/aname"] + + + + + Orthogonal_Value + + , + + Outside + false + + + Text + Sum + + + +]]> + SVG + false + 130pt + 212pt + + + id/aid + dimension["id"]["aid"] + integer + + + name/aname + dimension["name"]["aname"] + string + + + id/aid1 + measure["aid"] + integer + SUM + + + id/aname + measure["aname"] + integer + SUM + + + + +
diff --git a/crm/ReportEngine/samples/UserAndRole.rptdesign b/crm/ReportEngine/samples/UserAndRole.rptdesign new file mode 100644 index 0000000..3b50061 --- /dev/null +++ b/crm/ReportEngine/samples/UserAndRole.rptdesign @@ -0,0 +1,2604 @@ + + + Eclipse BIRT Designer Version 4.3.1.v201309091055 Build <4.3.1.v20130917-1035> + in + /templates/blank_report.gif + ltr + 72 + + + + + metadataBidiFormatStr + ILYNN + + + disabledMetadataBidiFormatStr + + + contentBidiFormatStr + ILYNN + + + disabledContentBidiFormatStr + + + com.mysql.jdbc.Driver + jdbc:mysql://localhost/crmdb + crm + + + + + + + id + measure + uid + uid + + + name + dimension + uname + uname + + + id_3 + measure + cid + cid + + + name_4 + dimension + cname + cname + + + id_5 + measure + rid + rid + + + val + dimension + rolename + rolename + + + + + + + 1 + id + integer + + + 2 + name + string + + + 3 + id_3 + integer + + + 4 + name_4 + string + + + 5 + id_5 + integer + + + 6 + val + string + + + + Data Source + + + 1 + id + id + integer + 4 + + + 2 + name + name + string + 12 + + + 3 + id_3 + id + integer + 4 + + + 4 + name_4 + name + string + 12 + + + 5 + id_5 + id + integer + 4 + + + 6 + val + val + string + 12 + + + ""]]> + + + 2.0 + + + + + + + id + 1 + + 4 + 9 + 0 + NotNullable + + uid + + + + uid + + 9 + + + + + + + name + 2 + + 12 + 255 + 0 + NotNullable + + uname + + + + uname + + 255 + + + + + + + id + 3 + + 4 + 9 + 0 + Nullable + + cid + + + + cid + + 9 + + + + + + + name + 4 + + 12 + 255 + 0 + Nullable + + cname + + + + cname + + 255 + + + + + + + id + 5 + + 4 + 9 + 0 + Nullable + + rid + + + + rid + + 9 + + + + + + + val + 6 + + 12 + 255 + 0 + Nullable + + rolename + + + + rolename + + 255 + + + + + + + +]]> + + + + + + + NewTabularHierarchy + + + + + integer + id_3 + + + + + + + NewTabularHierarchy1 + + + + + string + name + + + + + + + NewTabularHierarchy2 + + + + + string + val + + + + + + + + + + + count + false + dataSetRow["id_5"] + integer + true + + + + + User&Role + + + + + + + + + + + + html + new Date()]]> + + + + + + + left + User&Role + + + id + uid + dataSetRow["id"] + integer + + + name + uname + dataSetRow["name"] + string + + + id_3 + cid + dataSetRow["id_3"] + integer + + + name_4 + cname + dataSetRow["name_4"] + string + + + id_5 + rid + dataSetRow["id_5"] + integer + + + val + rolename + dataSetRow["val"] + string + + + + + + + + +
+ + + 6 + 1 + + + + + 12pt + bold + #996633 + + + + + + + + + + + + + + + + + + + +
+ + + + + id + + + + + name + + + + + id_3 + + + + + name_4 + + + + + id_5 + + + + + val + + + + +
+ + 0.19444444444444445in + + + + + + + +
+
+ + User&Role + + +
+ + + + Data Cube + + 2.6.1 + Pie Chart + Standard + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true +
+ + 0 + 255 + 255 + 255 + + + + 1 + + 255 + 0 + 0 + 0 + + + + 0.0 + 2.0 + 0.0 + 3.0 + + true + + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true + 5 + 5 + + + + 0 + + 255 + 0 + 0 + 0 + + false + + + 0.0 + 0.0 + 0.0 + 0.0 + + + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true + + + + 0 + + 255 + 0 + 0 + 0 + + false + + + 2.0 + 2.0 + 2.0 + 2.0 + + + + + + + + + Vertical + Top_Bottom + + + 1 + + 255 + 0 + 0 + 0 + + true + + Right + Categories + + <Caption> + <Value></Value> + <Font> + <Alignment/> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + <Visible>false</Visible> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>false</Visible> + + Above + + + 0.0 + 0.0 + 212.0 + 130.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true + + Two_Dimensional + Points + 10.0 + 0 + + enable.area.alt + false + + + + 'A','B','C','D','E' + + + 6,4,12,8,10 + 0 + + + + + + + 64 + 127 + 127 + 127 + + + + 128 + 127 + 127 + 127 + + true + + + 10.0 + 10.0 + 10.0 + 10.0 + + false + + + + + + + + 255 + 80 + 166 + 218 + + + 255 + 242 + 88 + 106 + + + 255 + 232 + 172 + 57 + + + 255 + 128 + 255 + 128 + + + 255 + 64 + 128 + 128 + + + 255 + 128 + 128 + 192 + + + 255 + 170 + 85 + 85 + + + 255 + 128 + 128 + 0 + + + 255 + 192 + 192 + 192 + + + 255 + 255 + 255 + 128 + + + 255 + 128 + 192 + 128 + + + 255 + 7 + 146 + 94 + + + 255 + 0 + 128 + 255 + + + 255 + 255 + 128 + 192 + + + 255 + 0 + 255 + 255 + + + 255 + 255 + 128 + 128 + + + 255 + 0 + 128 + 192 + + + 255 + 128 + 128 + 192 + + + 255 + 255 + 0 + 255 + + + 255 + 128 + 64 + 64 + + + 255 + 255 + 128 + 64 + + + 255 + 80 + 240 + 120 + + + 255 + 0 + 64 + 128 + + + 255 + 128 + 0 + 64 + + + 255 + 255 + 0 + 128 + + + 255 + 128 + 128 + 64 + + + 255 + 128 + 128 + 128 + + + 255 + 255 + 128 + 255 + + + 255 + 0 + 64 + 0 + + + 255 + 0 + 0 + 0 + + + 255 + 255 + 255 + 255 + + + 255 + 255 + 128 + 0 + + + + + + + + + 255 + 80 + 166 + 218 + + + 255 + 242 + 88 + 106 + + + 255 + 232 + 172 + 57 + + + 255 + 128 + 255 + 128 + + + 255 + 64 + 128 + 128 + + + 255 + 128 + 128 + 192 + + + 255 + 170 + 85 + 85 + + + 255 + 128 + 128 + 0 + + + 255 + 192 + 192 + 192 + + + 255 + 255 + 255 + 128 + + + 255 + 128 + 192 + 128 + + + 255 + 7 + 146 + 94 + + + 255 + 0 + 128 + 255 + + + 255 + 255 + 128 + 192 + + + 255 + 0 + 255 + 255 + + + 255 + 255 + 128 + 128 + + + 255 + 0 + 128 + 192 + + + 255 + 128 + 128 + 192 + + + 255 + 255 + 0 + 255 + + + 255 + 128 + 64 + 64 + + + 255 + 255 + 128 + 64 + + + 255 + 80 + 240 + 120 + + + 255 + 0 + 64 + 128 + + + 255 + 128 + 0 + 64 + + + 255 + 255 + 0 + 128 + + + 255 + 128 + 128 + 64 + + + 255 + 128 + 128 + 128 + + + 255 + 255 + 128 + 255 + + + 255 + 0 + 64 + 0 + + + 255 + 0 + 0 + 0 + + + 255 + 255 + 255 + 255 + + + 255 + 255 + 128 + 0 + + + + true + + + 0 + 255 + 255 + 255 + + + + 1 + + 255 + 0 + 0 + 0 + + false + + + 0.0 + 2.0 + 0.0 + 3.0 + + false + + + data["Summary Field/rid"] + + false + Text + + + + + + Orthogonal_Value + + , + + Outside + false + + onmouseover + + Show_Tooltip + + + 200 + + + + 0 + + <Caption> + <Value></Value> + <Font> + <Size>16.0</Size> + <Bold>true</Bold> + <Alignment/> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>true</Visible> + + Below + + + 1 + true + + 10.0 + + + Text + Sum + + + + true + + + 0 + 255 + 255 + 255 + + + + 1 + + 255 + 0 + 0 + 0 + + false + + + 0.0 + 2.0 + 0.0 + 3.0 + + false + + + data["rname/rolename"] + + + + + Orthogonal_Value + + , + + Outside + false + + + false + Text + Sum + + + +]]> + SVG + false + 130pt + 212pt + + + cid/cid + dimension["cid"]["cid"] + integer + + + uname/uname + dimension["uname"]["uname"] + string + + + rname/rolename + dimension["rname"]["rolename"] + string + + + Summary Field/rid + measure["rid"] + integer + SUM + + + + + + + Data Cube + + 2.6.1 + Bar Chart + Side-by-side + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true + + + 0 + 255 + 255 + 255 + + + + 1 + + 255 + 0 + 0 + 0 + + + + 0.0 + 2.0 + 0.0 + 3.0 + + true + + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true + 5 + 5 + + + + 0 + + 255 + 0 + 0 + 0 + + false + + + 0.0 + 0.0 + 0.0 + 0.0 + + + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true + + + + 0 + + 255 + 0 + 0 + 0 + + false + + + 2.0 + 2.0 + 2.0 + 2.0 + + + + + + + + + Vertical + Top_Bottom + + + 1 + + 255 + 0 + 0 + 0 + + true + + Right + Categories + + <Caption> + <Value></Value> + <Font> + <Alignment/> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + <Visible>false</Visible> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>false</Visible> + + Above + + + 0.0 + 0.0 + 212.0 + 130.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true + + Two_Dimensional + Points + 10.0 + + enable.area.alt + false + + + + A, B, C + + + 5,4,12 + 0 + + + + + + + 64 + 127 + 127 + 127 + + + + 128 + 127 + 127 + 127 + + true + + + 10.0 + 10.0 + 10.0 + 10.0 + + false + + + Text + + <Caption> + <Value>X-Axis Title</Value> + <Font> + <Size>14.0</Size> + <Bold>true</Bold> + <Alignment> + <horizontalAlignment>Center</horizontalAlignment> + <verticalAlignment>Center</verticalAlignment> + </Alignment> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>false</Visible> + + Below + + Linear + + <Caption> + <Value>Y-Axis Title</Value> + <Font> + <Size>14.0</Size> + <Bold>true</Bold> + <Alignment> + <horizontalAlignment>Center</horizontalAlignment> + <verticalAlignment>Center</verticalAlignment> + </Alignment> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>false</Visible> + + Left + + + + + + + 255 + 80 + 166 + 218 + + + 255 + 242 + 88 + 106 + + + 255 + 232 + 172 + 57 + + + 255 + 128 + 255 + 128 + + + 255 + 64 + 128 + 128 + + + 255 + 128 + 128 + 192 + + + 255 + 170 + 85 + 85 + + + 255 + 128 + 128 + 0 + + + 255 + 192 + 192 + 192 + + + 255 + 255 + 255 + 128 + + + 255 + 128 + 192 + 128 + + + 255 + 7 + 146 + 94 + + + 255 + 0 + 128 + 255 + + + 255 + 255 + 128 + 192 + + + 255 + 0 + 255 + 255 + + + 255 + 255 + 128 + 128 + + + 255 + 0 + 128 + 192 + + + 255 + 128 + 128 + 192 + + + 255 + 255 + 0 + 255 + + + 255 + 128 + 64 + 64 + + + 255 + 255 + 128 + 64 + + + 255 + 80 + 240 + 120 + + + 255 + 0 + 64 + 128 + + + 255 + 128 + 0 + 64 + + + 255 + 255 + 0 + 128 + + + 255 + 128 + 128 + 64 + + + 255 + 128 + 128 + 128 + + + 255 + 255 + 128 + 255 + + + 255 + 0 + 64 + 0 + + + 255 + 0 + 0 + 0 + + + 255 + 255 + 255 + 255 + + + 255 + 255 + 128 + 0 + + + + true + + + 0 + 255 + 255 + 255 + + + + 1 + + 255 + 0 + 0 + 0 + + false + + + 0.0 + 2.0 + 0.0 + 3.0 + + false + + + data["Summary Field/rid"] + + false + Text + + + + Series 1 + + + Orthogonal_Value + + , + + Outside + false + + onmouseover + + Show_Tooltip + + + 200 + + + + Rectangle + + + Text + Sum + + + Vertical + + + 1 + + 255 + 0 + 0 + 0 + + true + + + + 0 + 255 + 255 + 255 + + + + 1 + + 255 + 0 + 0 + 0 + + + + 0.0 + 2.0 + 0.0 + 3.0 + + true + + Left + + + + 1 + + 255 + 196 + 196 + 196 + + false + + Across + + + 1 + + 255 + 196 + 196 + 196 + + true + + + + + + 1 + + 255 + 225 + 225 + 225 + + false + + Across + + + 1 + + 255 + 225 + 225 + 225 + + false + + + + 5 + + + Min + + 0.0 + + + true + false + + + + + + + + 255 + 80 + 166 + 218 + + + 255 + 242 + 88 + 106 + + + 255 + 232 + 172 + 57 + + + 255 + 128 + 255 + 128 + + + 255 + 64 + 128 + 128 + + + 255 + 128 + 128 + 192 + + + 255 + 170 + 85 + 85 + + + 255 + 128 + 128 + 0 + + + 255 + 192 + 192 + 192 + + + 255 + 255 + 255 + 128 + + + 255 + 128 + 192 + 128 + + + 255 + 7 + 146 + 94 + + + 255 + 0 + 128 + 255 + + + 255 + 255 + 128 + 192 + + + 255 + 0 + 255 + 255 + + + 255 + 255 + 128 + 128 + + + 255 + 0 + 128 + 192 + + + 255 + 128 + 128 + 192 + + + 255 + 255 + 0 + 255 + + + 255 + 128 + 64 + 64 + + + 255 + 255 + 128 + 64 + + + 255 + 80 + 240 + 120 + + + 255 + 0 + 64 + 128 + + + 255 + 128 + 0 + 64 + + + 255 + 255 + 0 + 128 + + + 255 + 128 + 128 + 64 + + + 255 + 128 + 128 + 128 + + + 255 + 255 + 128 + 255 + + + 255 + 0 + 64 + 0 + + + 255 + 0 + 0 + 0 + + + 255 + 255 + 255 + 255 + + + 255 + 255 + 128 + 0 + + + + true + + + 0 + 255 + 255 + 255 + + + + 1 + + 255 + 0 + 0 + 0 + + false + + + 0.0 + 2.0 + 0.0 + 3.0 + + false + + + data["rname/rolename"] + + + + + Orthogonal_Value + + , + + Outside + false + + + false + Text + Sum + + + Horizontal + + + 1 + + 255 + 0 + 0 + 0 + + true + + + + 0 + 255 + 255 + 255 + + + + 1 + + 255 + 0 + 0 + 0 + + + + 0.0 + 2.0 + 0.0 + 3.0 + + true + + Below + + + + 1 + + 255 + 196 + 196 + 196 + + false + + Across + + + 1 + + 255 + 196 + 196 + 196 + + true + + + + + + 1 + + 255 + 225 + 225 + 225 + + false + + Across + + + 1 + + 255 + 225 + 225 + 225 + + false + + + + 5 + + + Min + + 0.0 + + + true + true + false + + Vertical + 50.0 + + + -20.0 + 45.0 + 0.0 + None + + + +]]> + JPG + false + 130pt + 212pt + + + cid/cid + dimension["cid"]["cid"] + integer + + + uname/uname + dimension["uname"]["uname"] + string + + + rname/rolename + dimension["rname"]["rolename"] + string + + + Summary Field/rid + measure["rid"] + integer + SUM + + + + + + +
+ 角色分布情况 + + 16.0 + true + + Center + Center + + + + This chart contains no data. + + + Center + Center + + + + + + + + + + + + + + 角色分布情况 + + 16.0 + true + + Center + Center + + + + This chart contains no data. + + + Center + Center + + + + + + + + + + + + + + + + + + + + + + +
+ +
diff --git a/crm/WebContent/META-INF/MANIFEST.MF b/crm/WebContent/META-INF/MANIFEST.MF new file mode 100644 index 0000000..254272e --- /dev/null +++ b/crm/WebContent/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git a/crm/WebContent/WEB-INF/web.xml b/crm/WebContent/WEB-INF/web.xml new file mode 100644 index 0000000..1aa8cdb --- /dev/null +++ b/crm/WebContent/WEB-INF/web.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/crm/nb-configuration.xml b/crm/nb-configuration.xml new file mode 100644 index 0000000..6f59166 --- /dev/null +++ b/crm/nb-configuration.xml @@ -0,0 +1,26 @@ + + + + + + JDK_1.7 + + /less:/css + false + /scss:/css + false + + bootstrap-datepicker/js/locales + Tomcat + + diff --git a/crm/pom.xml b/crm/pom.xml new file mode 100644 index 0000000..972de33 --- /dev/null +++ b/crm/pom.xml @@ -0,0 +1,315 @@ + + + + + 4.0.0 + com.rex.crm + crm + war + 1.0 + + CRM + + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + 6.7.0 + 7.6.3.v20120416 + UTF-8 + + + + org.eclipse.birt.runtime + org.eclipse.birt.runtime + 4.3.0 + + + org.apache.poi + org.eclipse.birt.runtime + + + + + org.apache.poi + poi + 3.9 + + + + + org.apache.wicket + wicket-core + ${wicket.version} + + + + + + + + org.slf4j + slf4j-log4j12 + 1.6.4 + + + log4j + log4j + 1.2.16 + + + + + junit + junit + 4.10 + test + + + + + org.eclipse.jetty.aggregate + jetty-all-server + ${jetty.version} + provided + + + + org.apache.wicket + wicket-extensions + 6.7.0 + + + org.apache.wicket + wicket-auth-roles + 6.7.0 + + + + com.google.code.gson + gson + 2.2.2 + + + + commons-configuration + commons-configuration + 1.9 + + + + com.google.guava + guava + 14.0.1 + + + + org.apache.velocity + velocity + 1.7 + + + commons-dbutils + commons-dbutils + 1.5 + + + mysql + mysql-connector-java + 5.1.26 + + + commons-beanutils + commons-beanutils + 1.8.3 + + + org.apache.commons + commons-lang3 + 3.1 + + + + commons-codec + commons-codec + 1.8 + + + + args4j + args4j + 2.0.25 + + + javax.mail + mail + 1.4 + + + org.eclipse.persistence + eclipselink + 2.5.1 + + + javax.transaction + jta + 1.1 + provided + + + org.jumpmind.symmetric + symmetric-csv + 3.5.9 + + + + + + false + src/main/resources + + + false + src/main/java + + ** + + + **/*.java + + + + + + false + src/test/resources + + + false + src/test/java + + ** + + + **/*.java + + + + + + true + org.apache.maven.plugins + maven-compiler-plugin + 2.5.1 + + 1.7 + 1.7 + UTF-8 + true + true + + + + org.mortbay.jetty + jetty-maven-plugin + ${jetty.version} + + + + 8080 + 3600000 + + + 8443 + 3600000 + ${project.build.directory}/test-classes/keystore + wicket + wicket + + + + + + org.apache.maven.plugins + maven-eclipse-plugin + 2.9 + + true + + + + + + + + + + Apache Nexus + https://repository.apache.org/content/repositories/snapshots/ + + false + + + true + + + + http://download.eclipse.org/rt/eclipselink/maven.repo/ + eclipselink + default + Repository for library EclipseLink (JPA 2.1) + + + diff --git a/crm/src/main/db/crmDB.sql b/crm/src/main/db/crmDB.sql new file mode 100644 index 0000000..f6c6943 --- /dev/null +++ b/crm/src/main/db/crmDB.sql @@ -0,0 +1,2 @@ +DROP DATABASE IF EXISTS crmdb; +CREATE DATABASE crmdb CHARSET utf8 COLLATE utf8_general_ci; \ No newline at end of file diff --git a/crm/src/main/db/dump.sql b/crm/src/main/db/dump.sql new file mode 100644 index 0000000..a2ded82 --- /dev/null +++ b/crm/src/main/db/dump.sql @@ -0,0 +1,2269 @@ +-- MySQL dump 10.13 Distrib 5.5.30, for osx10.6 (i386) +-- +-- Host: localhost Database: crmdb +-- ------------------------------------------------------ +-- Server version 5.5.30 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `account` +-- + +DROP TABLE IF EXISTS `account`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `account` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `bdm_code` varchar(255) DEFAULT NULL, + `administrativ_level` mediumint(9) DEFAULT NULL, + `hospital_type` mediumint(9) DEFAULT NULL, + `local_or_army` mediumint(9) DEFAULT NULL, + `comprehensive_or_specialized` mediumint(9) DEFAULT NULL, + `key_type` mediumint(9) DEFAULT NULL, + `status` mediumint(9) DEFAULT NULL, + `duty_officer` varchar(255) DEFAULT NULL, + `num_of_doctors` mediumint(9) DEFAULT NULL, + `num_of_assistant_doctors` mediumint(9) DEFAULT NULL, + `num_of_staff` mediumint(9) DEFAULT NULL, + `num_of_treat_per_year` mediumint(9) DEFAULT NULL, + `num_of_outpatient` mediumint(9) DEFAULT NULL, + `total_num_of_sickbed` mediumint(9) DEFAULT NULL, + `num_of_anesthesia_doctor` mediumint(9) DEFAULT NULL, + `num_of_pain_doctor` mediumint(9) DEFAULT NULL, + `num_of_surgery_per_year` mediumint(9) DEFAULT NULL, + `num_of_surgery_room` mediumint(9) DEFAULT NULL, + `num_of_using_opiates_medicine` mediumint(9) DEFAULT NULL, + `num_of_using_opiates_injection` mediumint(9) DEFAULT NULL, + `date_of_establish` varchar(128) DEFAULT NULL, + `registered_capital` mediumint(9) DEFAULT NULL, + `tel` varchar(255) DEFAULT NULL, + `fax` varchar(255) DEFAULT NULL, + `market_classification` mediumint(9) DEFAULT NULL, + `province` int(11) DEFAULT NULL, + `city` int(11) DEFAULT NULL, + `districts` varchar(255) DEFAULT NULL, + `address` varchar(255) DEFAULT NULL, + `owner` varchar(255) DEFAULT NULL, + `whenadded` datetime DEFAULT NULL, + `modifier` varchar(255) DEFAULT NULL, + `modify_datetime` datetime DEFAULT NULL, + `responsible_person` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE, + UNIQUE KEY `account_ix_01` (`bdm_code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `account` +-- + +LOCK TABLES `account` WRITE; +/*!40000 ALTER TABLE `account` DISABLE KEYS */; +/*!40000 ALTER TABLE `account` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `account_administrativ_level_pl` +-- + +DROP TABLE IF EXISTS `account_administrativ_level_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `account_administrativ_level_pl` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `account_administrativ_level_pl` +-- + +LOCK TABLES `account_administrativ_level_pl` WRITE; +/*!40000 ALTER TABLE `account_administrativ_level_pl` DISABLE KEYS */; +INSERT INTO `account_administrativ_level_pl` VALUES (1,'一级'),(5,'二级'),(9,'三级'),(13,'未评级'); +/*!40000 ALTER TABLE `account_administrativ_level_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `account_comprehensive_or_specialized_pl` +-- + +DROP TABLE IF EXISTS `account_comprehensive_or_specialized_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `account_comprehensive_or_specialized_pl` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `account_comprehensive_or_specialized_pl` +-- + +LOCK TABLES `account_comprehensive_or_specialized_pl` WRITE; +/*!40000 ALTER TABLE `account_comprehensive_or_specialized_pl` DISABLE KEYS */; +INSERT INTO `account_comprehensive_or_specialized_pl` VALUES (1,'综合医院'),(2,'专科医院'); +/*!40000 ALTER TABLE `account_comprehensive_or_specialized_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `account_local_or_army_pl` +-- + +DROP TABLE IF EXISTS `account_local_or_army_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `account_local_or_army_pl` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `account_local_or_army_pl` +-- + +LOCK TABLES `account_local_or_army_pl` WRITE; +/*!40000 ALTER TABLE `account_local_or_army_pl` DISABLE KEYS */; +INSERT INTO `account_local_or_army_pl` VALUES (1,'地方医院'),(2,'部队医院'); +/*!40000 ALTER TABLE `account_local_or_army_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `account_market_classification_pl` +-- + +DROP TABLE IF EXISTS `account_market_classification_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `account_market_classification_pl` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `account_market_classification_pl` +-- + +LOCK TABLES `account_market_classification_pl` WRITE; +/*!40000 ALTER TABLE `account_market_classification_pl` DISABLE KEYS */; +INSERT INTO `account_market_classification_pl` VALUES (1,'战略城市'),(2,'一级城市'),(3,'二级城市'),(4,'三级城市'),(5,'四级城市'); +/*!40000 ALTER TABLE `account_market_classification_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `account_medicaltype_pl` +-- + +DROP TABLE IF EXISTS `account_medicaltype_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `account_medicaltype_pl` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `account_medicaltype_pl` +-- + +LOCK TABLES `account_medicaltype_pl` WRITE; +/*!40000 ALTER TABLE `account_medicaltype_pl` DISABLE KEYS */; +INSERT INTO `account_medicaltype_pl` VALUES (1,'麻药目标医院'),(2,'慢痛目标医院'),(3,'其他'); +/*!40000 ALTER TABLE `account_medicaltype_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `account_point_pl` +-- + +DROP TABLE IF EXISTS `account_point_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `account_point_pl` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `account_point_pl` +-- + +LOCK TABLES `account_point_pl` WRITE; +/*!40000 ALTER TABLE `account_point_pl` DISABLE KEYS */; +INSERT INTO `account_point_pl` VALUES (1,'癌痛重点医院'),(2,'慢痛重点医院'),(3,'奥诺美重点医院'),(4,'非重点医院'); +/*!40000 ALTER TABLE `account_point_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `account_status_pl` +-- + +DROP TABLE IF EXISTS `account_status_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `account_status_pl` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `account_status_pl` +-- + +LOCK TABLES `account_status_pl` WRITE; +/*!40000 ALTER TABLE `account_status_pl` DISABLE KEYS */; +INSERT INTO `account_status_pl` VALUES (1,'有效'),(2,'无效'); +/*!40000 ALTER TABLE `account_status_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `account_type_pl` +-- + +DROP TABLE IF EXISTS `account_type_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `account_type_pl` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `account_type_pl` +-- + +LOCK TABLES `account_type_pl` WRITE; +/*!40000 ALTER TABLE `account_type_pl` DISABLE KEYS */; +INSERT INTO `account_type_pl` VALUES (1,'癌痛目标医院'),(2,'慢痛目标医院'),(3,'奥诺美目标医院'),(4,'非目标医院'); +/*!40000 ALTER TABLE `account_type_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `accountcrmuser` +-- + +DROP TABLE IF EXISTS `accountcrmuser`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `accountcrmuser` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `accountId` mediumint(9) NOT NULL, + `crmuserId` mediumint(9) NOT NULL, + `externalId` varchar(45) DEFAULT NULL, + `whenadded` datetime DEFAULT NULL, + `modifier` varchar(255) DEFAULT NULL, + `modify_datetime` datetime DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE, + UNIQUE KEY `accountId` (`accountId`,`crmuserId`), + KEY `account_crmuser_cons2` (`crmuserId`), + CONSTRAINT `account_crmuser_cons` FOREIGN KEY (`accountId`) REFERENCES `account` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `account_crmuser_cons2` FOREIGN KEY (`crmuserId`) REFERENCES `crmuser` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `accountcrmuser` +-- + +LOCK TABLES `accountcrmuser` WRITE; +/*!40000 ALTER TABLE `accountcrmuser` DISABLE KEYS */; +/*!40000 ALTER TABLE `accountcrmuser` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `activity` +-- + +DROP TABLE IF EXISTS `activity`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `activity` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `crmuserId` mediumint(9) NOT NULL, + `event_type` mediumint(9) NOT NULL, + `endtime` bigint(20) DEFAULT NULL, + `starttime` bigint(20) NOT NULL DEFAULT '0', + `title` varchar(128) DEFAULT NULL, + `participants` varchar(512) DEFAULT NULL, + `activity_type` mediumint(9) DEFAULT NULL, + `contactId` mediumint(9) DEFAULT NULL, + `coacheeId` int(32) DEFAULT NULL, + `status` mediumint(9) DEFAULT NULL, + `visiting_purpose` mediumint(9) DEFAULT NULL, + `feature_product` mediumint(9) DEFAULT NULL, + `act_endtime` datetime DEFAULT NULL, + `owner` varchar(255) DEFAULT NULL, + `whenadded` datetime DEFAULT NULL, + `modifier` varchar(255) DEFAULT NULL, + `modify_datetime` datetime DEFAULT NULL, + `responsible_person` varchar(255) DEFAULT NULL, + `coach` int(32) DEFAULT NULL, + `location` varchar(255) DEFAULT NULL, + `total_score` mediumint(9) DEFAULT NULL, + `planing` mediumint(9) DEFAULT NULL, + `openling` mediumint(9) DEFAULT NULL, + `enquery_listening` mediumint(9) DEFAULT NULL, + `deliverable` mediumint(9) DEFAULT NULL, + `objection_handing` mediumint(9) DEFAULT NULL, + `summary` mediumint(9) DEFAULT NULL, + `whetherCoach` mediumint(9) DEFAULT NULL, + `coachTime` mediumint(9) DEFAULT NULL, + `accountId` mediumint(9) DEFAULT NULL, + `department` mediumint(9) DEFAULT NULL, + `whether_coach` varchar(255) DEFAULT NULL, + `activity_daypart` mediumint(9) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE, + KEY `crmuserId_activity_cons` (`crmuserId`), + KEY `contactId_activity_cons` (`contactId`), + CONSTRAINT `contactId_activity_cons` FOREIGN KEY (`contactId`) REFERENCES `contact` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `crmuserId_activity_cons` FOREIGN KEY (`crmuserId`) REFERENCES `crmuser` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `activity` +-- + +LOCK TABLES `activity` WRITE; +/*!40000 ALTER TABLE `activity` DISABLE KEYS */; +/*!40000 ALTER TABLE `activity` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `activity_activity_types_pl` +-- + +DROP TABLE IF EXISTS `activity_activity_types_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `activity_activity_types_pl` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `activity_activity_types_pl` +-- + +LOCK TABLES `activity_activity_types_pl` WRITE; +/*!40000 ALTER TABLE `activity_activity_types_pl` DISABLE KEYS */; +INSERT INTO `activity_activity_types_pl` VALUES (1,'专业化拜访'),(2,'事务性拜访'); +/*!40000 ALTER TABLE `activity_activity_types_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Temporary table structure for view `activity_alert` +-- + +DROP TABLE IF EXISTS `activity_alert`; +/*!50001 DROP VIEW IF EXISTS `activity_alert`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `activity_alert` ( + `id` tinyint NOT NULL, + `time` tinyint NOT NULL, + `title` tinyint NOT NULL, + `name` tinyint NOT NULL, + `times` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; + +-- +-- Table structure for table `activity_coachtime_pl` +-- + +DROP TABLE IF EXISTS `activity_coachtime_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `activity_coachtime_pl` ( + `id` int(11) NOT NULL, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `activity_coachtime_pl` +-- + +LOCK TABLES `activity_coachtime_pl` WRITE; +/*!40000 ALTER TABLE `activity_coachtime_pl` DISABLE KEYS */; +INSERT INTO `activity_coachtime_pl` VALUES (1,'无'),(2,'半天'),(3,'全天'); +/*!40000 ALTER TABLE `activity_coachtime_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `activity_daypart_pl` +-- + +DROP TABLE IF EXISTS `activity_daypart_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `activity_daypart_pl` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `activity_daypart_pl` +-- + +LOCK TABLES `activity_daypart_pl` WRITE; +/*!40000 ALTER TABLE `activity_daypart_pl` DISABLE KEYS */; +INSERT INTO `activity_daypart_pl` VALUES (1,'上午'),(2,'下午'); +/*!40000 ALTER TABLE `activity_daypart_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `activity_event_type_pl` +-- + +DROP TABLE IF EXISTS `activity_event_type_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `activity_event_type_pl` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `activity_event_type_pl` +-- + +LOCK TABLES `activity_event_type_pl` WRITE; +/*!40000 ALTER TABLE `activity_event_type_pl` DISABLE KEYS */; +INSERT INTO `activity_event_type_pl` VALUES (1,'拜访'),(2,'拜访辅导'),(3,'科室会辅导'); +/*!40000 ALTER TABLE `activity_event_type_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `activity_feature_product_pl` +-- + +DROP TABLE IF EXISTS `activity_feature_product_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `activity_feature_product_pl` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `activity_feature_product_pl` +-- + +LOCK TABLES `activity_feature_product_pl` WRITE; +/*!40000 ALTER TABLE `activity_feature_product_pl` DISABLE KEYS */; +INSERT INTO `activity_feature_product_pl` VALUES (1,'美施康定'),(2,'奥施康定'),(3,'奇曼丁'),(4,'若思本'),(5,'奥诺美'); +/*!40000 ALTER TABLE `activity_feature_product_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `activity_score3_pl` +-- + +DROP TABLE IF EXISTS `activity_score3_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `activity_score3_pl` ( + `id` int(11) NOT NULL, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `activity_score3_pl` +-- + +LOCK TABLES `activity_score3_pl` WRITE; +/*!40000 ALTER TABLE `activity_score3_pl` DISABLE KEYS */; +INSERT INTO `activity_score3_pl` VALUES (0,'0'),(1,'1'),(2,'2'),(3,'3'),(4,'4'),(5,'5'),(6,'6'),(7,'7'),(8,'8'),(9,'9'),(10,'10'); +/*!40000 ALTER TABLE `activity_score3_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `activity_score4_pl` +-- + +DROP TABLE IF EXISTS `activity_score4_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `activity_score4_pl` ( + `id` int(11) NOT NULL, + `val` varchar(25) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `activity_score4_pl` +-- + +LOCK TABLES `activity_score4_pl` WRITE; +/*!40000 ALTER TABLE `activity_score4_pl` DISABLE KEYS */; +INSERT INTO `activity_score4_pl` VALUES (0,'0'),(1,'1'),(2,'2'),(3,'3'),(4,'4'),(5,'5'),(6,'6'),(7,'7'),(8,'8'),(9,'9'),(10,'10'),(11,'11'),(12,'12'),(13,'13'),(14,'14'),(15,'15'),(16,'16'),(17,'17'),(18,'18'),(19,'19'),(20,'20'),(21,'21'),(22,'22'),(23,'23'),(24,'24'),(25,'25'); +/*!40000 ALTER TABLE `activity_score4_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `activity_score5_pl` +-- + +DROP TABLE IF EXISTS `activity_score5_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `activity_score5_pl` ( + `id` int(11) NOT NULL, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `activity_score5_pl` +-- + +LOCK TABLES `activity_score5_pl` WRITE; +/*!40000 ALTER TABLE `activity_score5_pl` DISABLE KEYS */; +INSERT INTO `activity_score5_pl` VALUES (0,'0'),(1,'1'),(2,'2'),(3,'3'),(4,'4'),(5,'5'),(6,'6'),(7,'7'),(8,'8'),(9,'9'),(10,'10'),(11,'11'),(12,'12'),(13,'13'),(14,'14'),(15,'15'),(16,'16'),(17,'17'),(18,'18'),(19,'19'),(20,'20'),(21,'21'),(22,'22'),(23,'23'),(24,'24'),(25,'25'),(26,'26'),(27,'27'),(28,'28'),(29,'29'),(30,'30'),(31,'31'),(32,'32'),(33,'33'),(34,'34'),(35,'35'),(36,'36'),(37,'37'),(38,'38'),(39,'39'),(40,'40'),(41,'41'),(42,'42'),(43,'43'),(44,'44'),(45,'45'),(46,'46'),(47,'47'),(48,'48'),(49,'49'),(50,'50'); +/*!40000 ALTER TABLE `activity_score5_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `activity_status` +-- + +DROP TABLE IF EXISTS `activity_status`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `activity_status` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `activity_status` +-- + +LOCK TABLES `activity_status` WRITE; +/*!40000 ALTER TABLE `activity_status` DISABLE KEYS */; +INSERT INTO `activity_status` VALUES (1,'计划'),(2,'完成'); +/*!40000 ALTER TABLE `activity_status` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `activity_status_pl` +-- + +DROP TABLE IF EXISTS `activity_status_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `activity_status_pl` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `activity_status_pl` +-- + +LOCK TABLES `activity_status_pl` WRITE; +/*!40000 ALTER TABLE `activity_status_pl` DISABLE KEYS */; +INSERT INTO `activity_status_pl` VALUES (1,'计划'),(2,'完成'),(3,'未执行'); +/*!40000 ALTER TABLE `activity_status_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `activity_types` +-- + +DROP TABLE IF EXISTS `activity_types`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `activity_types` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `activity_types` +-- + +LOCK TABLES `activity_types` WRITE; +/*!40000 ALTER TABLE `activity_types` DISABLE KEYS */; +INSERT INTO `activity_types` VALUES (1,'拜访'),(2,'外部会议'),(3,'内部会议'); +/*!40000 ALTER TABLE `activity_types` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `activity_visiting_purpose_pl` +-- + +DROP TABLE IF EXISTS `activity_visiting_purpose_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `activity_visiting_purpose_pl` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + `activity_type` mediumint(9) DEFAULT NULL, + `parentId` mediumint(9) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `activity_visiting_purpose_pl` +-- + +LOCK TABLES `activity_visiting_purpose_pl` WRITE; +/*!40000 ALTER TABLE `activity_visiting_purpose_pl` DISABLE KEYS */; +INSERT INTO `activity_visiting_purpose_pl` VALUES (1,'传递产品知识',1,1),(2,'处方观念沟通',1,1),(3,'病例沟通',1,1),(4,'会议安排',2,2),(5,'会议跟进',2,2),(6,'交接工作',2,2),(7,'了解竞争',2,2); +/*!40000 ALTER TABLE `activity_visiting_purpose_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `activity_whethercoach_pl` +-- + +DROP TABLE IF EXISTS `activity_whethercoach_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `activity_whethercoach_pl` ( + `id` mediumint(9) NOT NULL, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `activity_whethercoach_pl` +-- + +LOCK TABLES `activity_whethercoach_pl` WRITE; +/*!40000 ALTER TABLE `activity_whethercoach_pl` DISABLE KEYS */; +INSERT INTO `activity_whethercoach_pl` VALUES (1,'协访半天'),(2,'协访一天'); +/*!40000 ALTER TABLE `activity_whethercoach_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `activitycrmuser` +-- + +DROP TABLE IF EXISTS `activitycrmuser`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `activitycrmuser` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `activityId` mediumint(9) NOT NULL, + `crmuserId` mediumint(9) NOT NULL, + PRIMARY KEY (`id`) USING BTREE, + UNIQUE KEY `activityId` (`activityId`,`crmuserId`), + KEY `crm_activity_cons` (`crmuserId`), + CONSTRAINT `crm_activity_cons` FOREIGN KEY (`crmuserId`) REFERENCES `crmuser` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `crm_activity_cons2` FOREIGN KEY (`activityId`) REFERENCES `activity` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `activitycrmuser` +-- + +LOCK TABLES `activitycrmuser` WRITE; +/*!40000 ALTER TABLE `activitycrmuser` DISABLE KEYS */; +/*!40000 ALTER TABLE `activitycrmuser` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `alert` +-- + +DROP TABLE IF EXISTS `alert`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `alert` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `publishDate` bigint(20) DEFAULT NULL, + `expired` bigint(20) DEFAULT NULL, + `priority` mediumint(9) DEFAULT NULL, + `towhom` mediumint(9) DEFAULT NULL, + `description` longtext, + `owner` varchar(255) DEFAULT NULL, + `whenadded` datetime DEFAULT NULL, + `modifier` varchar(255) DEFAULT NULL, + `modify_datetime` datetime DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `alert` +-- + +LOCK TABLES `alert` WRITE; +/*!40000 ALTER TABLE `alert` DISABLE KEYS */; +/*!40000 ALTER TABLE `alert` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `alert_priority_pl` +-- + +DROP TABLE IF EXISTS `alert_priority_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `alert_priority_pl` ( + `id` mediumint(9) NOT NULL, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `alert_priority_pl` +-- + +LOCK TABLES `alert_priority_pl` WRITE; +/*!40000 ALTER TABLE `alert_priority_pl` DISABLE KEYS */; +INSERT INTO `alert_priority_pl` VALUES (1,'高级'),(2,'中级'),(3,'低级'); +/*!40000 ALTER TABLE `alert_priority_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `alert_publicobject_pl` +-- + +DROP TABLE IF EXISTS `alert_publicobject_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `alert_publicobject_pl` ( + `id` mediumint(9) NOT NULL, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `alert_publicobject_pl` +-- + +LOCK TABLES `alert_publicobject_pl` WRITE; +/*!40000 ALTER TABLE `alert_publicobject_pl` DISABLE KEYS */; +INSERT INTO `alert_publicobject_pl` VALUES (1,'管理员'),(2,'主管'),(3,'代表'); +/*!40000 ALTER TABLE `alert_publicobject_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `appinfo` +-- + +DROP TABLE IF EXISTS `appinfo`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `appinfo` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `appinfo` +-- + +LOCK TABLES `appinfo` WRITE; +/*!40000 ALTER TABLE `appinfo` DISABLE KEYS */; +INSERT INTO `appinfo` VALUES (1,'爱奇艺'),(2,'影视圈'),(3,'多米音乐'),(4,'百度地图'),(5,'新浪微博'),(6,'三星学习'),(7,'印象笔记'),(8,'愤怒的小鸟'),(9,'疯狂飙车'),(10,'股票专家'),(11,'名片全能王'),(12,'携程旅游'); +/*!40000 ALTER TABLE `appinfo` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `boolean_pl` +-- + +DROP TABLE IF EXISTS `boolean_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `boolean_pl` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `boolean_pl` +-- + +LOCK TABLES `boolean_pl` WRITE; +/*!40000 ALTER TABLE `boolean_pl` DISABLE KEYS */; +INSERT INTO `boolean_pl` VALUES (1,'是'),(2,'否'); +/*!40000 ALTER TABLE `boolean_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `city` +-- + +DROP TABLE IF EXISTS `city`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `city` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `val` varchar(20) DEFAULT NULL, + `externalId` varchar(20) DEFAULT NULL, + `parentId` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `city_parentid_cons` (`parentId`), + CONSTRAINT `city_parentid_cons` FOREIGN KEY (`parentId`) REFERENCES `province` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=344 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `city` +-- + +LOCK TABLES `city` WRITE; +/*!40000 ALTER TABLE `city` DISABLE KEYS */; +INSERT INTO `city` VALUES (1,'北京','110100',1),(2,'石家庄','130100',3),(3,'唐山','130200',3),(4,'秦皇岛','130300',3),(5,'邯郸','130400',3),(6,'邢台','130500',3),(7,'保定','130600',3),(8,'张家口','130700',3),(9,'承德','130800',3),(10,'沧州','130900',3),(11,'廊坊','131000',3),(12,'衡水','131100',3),(13,'太原','140100',4),(14,'大同','140200',4),(15,'阳泉','140300',4),(16,'长治','140400',4),(17,'晋城','140500',4),(18,'朔州','140600',4),(19,'晋中','140700',4),(20,'运城','140800',4),(21,'忻州','140900',4),(22,'临汾','141000',4),(23,'吕梁','141100',4),(24,'呼和浩特','150100',5),(25,'包头','150200',5),(26,'乌海','150300',5),(27,'赤峰','150400',5),(28,'通辽','150500',5),(29,'鄂尔多斯','150600',5),(30,'呼伦贝尔','150700',5),(31,'巴彦淖尔','150800',5),(32,'乌兰察布','150900',5),(33,'兴安盟','152200',5),(34,'锡林郭勒盟','152500',5),(35,'阿拉善盟','152900',5),(36,'沈阳','210100',6),(37,'大连','210200',6),(38,'鞍山','210300',6),(39,'抚顺','210400',6),(40,'本溪','210500',6),(41,'丹东','210600',6),(42,'锦州','210700',6),(43,'营口','210800',6),(44,'阜新','210900',6),(45,'辽阳','211000',6),(46,'盘锦','211100',6),(47,'铁岭','211200',6),(48,'朝阳','211300',6),(49,'葫芦岛','211400',6),(50,'长春','220100',7),(51,'吉林','220200',7),(52,'四平','220300',7),(53,'辽源','220400',7),(54,'通化','220500',7),(55,'白山','220600',7),(56,'松原','220700',7),(57,'白城','220800',7),(58,'延边朝鲜族自治州','222400',7),(59,'哈尔滨','230100',8),(60,'齐齐哈尔','230200',8),(61,'鸡西','230300',8),(62,'鹤岗','230400',8),(63,'双鸭山','230500',8),(64,'大庆','230600',8),(65,'伊春','230700',8),(66,'佳木斯','230800',8),(67,'七台河','230900',8),(68,'牡丹江','231000',8),(69,'黑河','231100',8),(70,'绥化','231200',8),(71,'大兴安岭地区','232700',8),(72,'上海','310100',9),(73,'县','310200',9),(74,'南京','320100',10),(75,'无锡','320200',10),(76,'徐州','320300',10),(77,'常州','320400',10),(78,'苏州','320500',10),(79,'南通','320600',10),(80,'连云港','320700',10),(81,'淮安','320800',10),(82,'盐城','320900',10),(83,'扬州','321000',10),(84,'镇江','321100',10),(85,'泰州','321200',10),(86,'宿迁','321300',10),(87,'杭州','330100',11),(88,'宁波','330200',11),(89,'温州','330300',11),(90,'嘉兴','330400',11),(91,'湖州','330500',11),(92,'绍兴','330600',11),(93,'金华','330700',11),(94,'衢州','330800',11),(95,'舟山','330900',11),(96,'台州','331000',11),(97,'丽水','331100',11),(98,'合肥','340100',12),(99,'芜湖','340200',12),(100,'蚌埠','340300',12),(101,'淮南','340400',12),(102,'马鞍山','340500',12),(103,'淮北','340600',12),(104,'铜陵','340700',12),(105,'安庆','340800',12),(106,'黄山','341000',12),(107,'滁州','341100',12),(108,'阜阳','341200',12),(109,'宿州','341300',12),(110,'巢湖','341400',12),(111,'六安','341500',12),(112,'亳州','341600',12),(113,'池州','341700',12),(114,'宣城','341800',12),(115,'福州','350100',13),(116,'厦门','350200',13),(117,'莆田','350300',13),(118,'三明','350400',13),(119,'泉州','350500',13),(120,'漳州','350600',13),(121,'南平','350700',13),(122,'龙岩','350800',13),(123,'宁德','350900',13),(124,'南昌','360100',14),(125,'景德镇','360200',14),(126,'萍乡','360300',14),(127,'九江','360400',14),(128,'新余','360500',14),(129,'鹰潭','360600',14),(130,'赣州','360700',14),(131,'吉安','360800',14),(132,'宜春','360900',14),(133,'抚州','361000',14),(134,'上饶','361100',14),(135,'济南','370100',15),(136,'青岛','370200',15),(137,'淄博','370300',15),(138,'枣庄','370400',15),(139,'东营','370500',15),(140,'烟台','370600',15),(141,'潍坊','370700',15),(142,'济宁','370800',15),(143,'泰安','370900',15),(144,'威海','371000',15),(145,'日照','371100',15),(146,'莱芜','371200',15),(147,'临沂','371300',15),(148,'德州','371400',15),(149,'聊城','371500',15),(150,'滨州','371600',15),(151,'荷泽','371700',15),(152,'郑州','410100',16),(153,'开封','410200',16),(154,'洛阳','410300',16),(155,'平顶山','410400',16),(156,'安阳','410500',16),(157,'鹤壁','410600',16),(158,'新乡','410700',16),(159,'焦作','410800',16),(160,'濮阳','410900',16),(161,'许昌','411000',16),(162,'漯河','411100',16),(163,'三门峡','411200',16),(164,'南阳','411300',16),(165,'商丘','411400',16),(166,'信阳','411500',16),(167,'周口','411600',16),(168,'驻马店','411700',16),(169,'武汉','420100',17),(170,'黄石','420200',17),(171,'十堰','420300',17),(172,'宜昌','420500',17),(173,'襄樊','420600',17),(174,'鄂州','420700',17),(175,'荆门','420800',17),(176,'孝感','420900',17),(177,'荆州','421000',17),(178,'黄冈','421100',17),(179,'咸宁','421200',17),(180,'随州','421300',17),(181,'恩施土家族苗族自治州','422800',17),(182,'省直辖行政单位','429000',17),(183,'长沙','430100',18),(184,'株洲','430200',18),(185,'湘潭','430300',18),(186,'衡阳','430400',18),(187,'邵阳','430500',18),(188,'岳阳','430600',18),(189,'常德','430700',18),(190,'张家界','430800',18),(191,'益阳','430900',18),(192,'郴州','431000',18),(193,'永州','431100',18),(194,'怀化','431200',18),(195,'娄底','431300',18),(196,'湘西土家族苗族自治州','433100',18),(197,'广州','440100',19),(198,'韶关','440200',19),(199,'深圳','440300',19),(200,'珠海','440400',19),(201,'汕头','440500',19),(202,'佛山','440600',19),(203,'江门','440700',19),(204,'湛江','440800',19),(205,'茂名','440900',19),(206,'肇庆','441200',19),(207,'惠州','441300',19),(208,'梅州','441400',19),(209,'汕尾','441500',19),(210,'河源','441600',19),(211,'阳江','441700',19),(212,'清远','441800',19),(213,'东莞','441900',19),(214,'中山','442000',19),(215,'潮州','445100',19),(216,'揭阳','445200',19),(217,'云浮','445300',19),(218,'南宁','450100',20),(219,'柳州','450200',20),(220,'桂林','450300',20),(221,'梧州','450400',20),(222,'北海','450500',20),(223,'防城港','450600',20),(224,'钦州','450700',20),(225,'贵港','450800',20),(226,'玉林','450900',20),(227,'百色','451000',20),(228,'贺州','451100',20),(229,'河池','451200',20),(230,'来宾','451300',20),(231,'崇左','451400',20),(232,'海口','460100',21),(233,'三亚','460200',21),(234,'省直辖县级行政单位','469000',21),(235,'辖区','500100',22),(236,'县','500200',22),(237,'','500300',22),(238,'成都','510100',23),(239,'自贡','510300',23),(240,'攀枝花','510400',23),(241,'泸州','510500',23),(242,'德阳','510600',23),(243,'绵阳','510700',23),(244,'广元','510800',23),(245,'遂宁','510900',23),(246,'内江','511000',23),(247,'乐山','511100',23),(248,'南充','511300',23),(249,'眉山','511400',23),(250,'宜宾','511500',23),(251,'广安','511600',23),(252,'达州','511700',23),(253,'雅安','511800',23),(254,'巴中','511900',23),(255,'资阳','512000',23),(256,'阿坝藏族羌族自治州','513200',23),(257,'甘孜藏族自治州','513300',23),(258,'凉山彝族自治州','513400',23),(259,'贵阳','520100',24),(260,'六盘水','520200',24),(261,'遵义','520300',24),(262,'安顺','520400',24),(263,'铜仁地区','522200',24),(264,'黔西南布依族苗族自治州','522300',24),(265,'毕节地区','522400',24),(266,'黔东南苗族侗族自治州','522600',24),(267,'黔南布依族苗族自治州','522700',24),(268,'昆明','530100',25),(269,'曲靖','530300',25),(270,'玉溪','530400',25),(271,'保山','530500',25),(272,'昭通','530600',25),(273,'丽江','530700',25),(274,'思茅','530800',25),(275,'临沧','530900',25),(276,'楚雄彝族自治州','532300',25),(277,'红河哈尼族彝族自治州','532500',25),(278,'文山壮族苗族自治州','532600',25),(279,'西双版纳傣族自治州','532800',25),(280,'大理白族自治州','532900',25),(281,'德宏傣族景颇族自治州','533100',25),(282,'怒江傈僳族自治州','533300',25),(283,'迪庆藏族自治州','533400',25),(284,'拉萨','540100',26),(285,'昌都地区','542100',26),(286,'山南地区','542200',26),(287,'日喀则地区','542300',26),(288,'那曲地区','542400',26),(289,'阿里地区','542500',26),(290,'林芝地区','542600',26),(291,'西安','610100',27),(292,'铜川','610200',27),(293,'宝鸡','610300',27),(294,'咸阳','610400',27),(295,'渭南','610500',27),(296,'延安','610600',27),(297,'汉中','610700',27),(298,'榆林','610800',27),(299,'安康','610900',27),(300,'商洛','611000',27),(301,'兰州','620100',28),(302,'嘉峪关','620200',28),(303,'金昌','620300',28),(304,'白银','620400',28),(305,'天水','620500',28),(306,'武威','620600',28),(307,'张掖','620700',28),(308,'平凉','620800',28),(309,'酒泉','620900',28),(310,'庆阳','621000',28),(311,'定西','621100',28),(312,'陇南','621200',28),(313,'临夏回族自治州','622900',28),(314,'甘南藏族自治州','623000',28),(315,'西宁','630100',29),(316,'海东地区','632100',29),(317,'海北藏族自治州','632200',29),(318,'黄南藏族自治州','632300',29),(319,'海南藏族自治州','632500',29),(320,'果洛藏族自治州','632600',29),(321,'玉树藏族自治州','632700',29),(322,'海西蒙古族藏族自治州','632800',29),(323,'银川','640100',30),(324,'石嘴山','640200',30),(325,'吴忠','640300',30),(326,'固原','640400',30),(327,'中卫','640500',30),(328,'乌鲁木齐','650100',31),(329,'克拉玛依','650200',31),(330,'吐鲁番地区','652100',31),(331,'哈密地区','652200',31),(332,'昌吉回族自治州','652300',31),(333,'博尔塔拉蒙古自治州','652700',31),(334,'巴音郭楞蒙古自治州','652800',31),(335,'阿克苏地区','652900',31),(336,'克孜勒苏柯尔克孜自治州','653000',31),(337,'喀什地区','653100',31),(338,'和田地区','653200',31),(339,'伊犁哈萨克自治州','654000',31),(340,'塔城地区','654200',31),(341,'阿勒泰地区','654300',31),(342,'省直辖行政单位','659000',31),(343,'天津',NULL,2); +/*!40000 ALTER TABLE `city` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `com_visiting_purpose_pl` +-- + +DROP TABLE IF EXISTS `com_visiting_purpose_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `com_visiting_purpose_pl` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `com_visiting_purpose_pl` +-- + +LOCK TABLES `com_visiting_purpose_pl` WRITE; +/*!40000 ALTER TABLE `com_visiting_purpose_pl` DISABLE KEYS */; +INSERT INTO `com_visiting_purpose_pl` VALUES (1,'处方观念沟通'),(2,'病例沟通'); +/*!40000 ALTER TABLE `com_visiting_purpose_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `contact` +-- + +DROP TABLE IF EXISTS `contact`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `contact` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `accountId` mediumint(9) NOT NULL, + `department` mediumint(9) DEFAULT NULL, + `sex` mediumint(9) DEFAULT NULL, + `native_place` varchar(255) DEFAULT NULL, + `office_tel` varchar(255) DEFAULT NULL, + `office_fax` varchar(255) DEFAULT NULL, + `cellphone` varchar(255) DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `status` varchar(255) DEFAULT NULL, + `market_classification` mediumint(9) DEFAULT NULL, + `grade` mediumint(9) DEFAULT NULL, + `province` int(11) DEFAULT NULL, + `city` int(11) DEFAULT NULL, + `districts` varchar(255) DEFAULT NULL, + `duty` mediumint(9) DEFAULT NULL, + `job_title` mediumint(9) DEFAULT NULL, + `visiting_target` mediumint(9) DEFAULT NULL, + `product_target` varchar(255) DEFAULT NULL, + `owner` varchar(255) DEFAULT NULL, + `whenadded` datetime DEFAULT NULL, + `modifier` varchar(255) DEFAULT NULL, + `modify_datetime` datetime DEFAULT NULL, + `responsible_person` varchar(255) DEFAULT NULL, + `contactCode` varchar(255) DEFAULT NULL, + `num_of_monthlySurgery` mediumint(9) DEFAULT NULL, + `num_of_monthlyAnalgesia` mediumint(9) DEFAULT NULL, + `externalId` varchar(128) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE, + UNIQUE KEY `contactCode_UNIQUE` (`contactCode`), + UNIQUE KEY `externalId` (`externalId`), + KEY `account_id_cons` (`accountId`), + CONSTRAINT `account_id_cons` FOREIGN KEY (`accountId`) REFERENCES `account` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `contact` +-- + +LOCK TABLES `contact` WRITE; +/*!40000 ALTER TABLE `contact` DISABLE KEYS */; +/*!40000 ALTER TABLE `contact` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `contact_department_pl` +-- + +DROP TABLE IF EXISTS `contact_department_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `contact_department_pl` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=74 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `contact_department_pl` +-- + +LOCK TABLES `contact_department_pl` WRITE; +/*!40000 ALTER TABLE `contact_department_pl` DISABLE KEYS */; +INSERT INTO `contact_department_pl` VALUES (1,'ICU'),(2,'内科'),(3,'外科'),(4,'中医科'),(5,'化疗科'),(6,'关怀科'),(7,'牙科'),(8,'急症科'),(9,'骨科'),(10,'肝胆外科'),(11,'血液科'),(12,'风湿科'),(13,'呼吸科'),(14,'保健科'),(15,'采购科'),(16,'传染科'),(17,'创伤外科'),(18,'儿科'),(19,'耳鼻喉科'),(20,'方便门诊'),(21,'放化疗科'),(22,'放疗科'),(23,'放射科'),(24,'妇产科'),(25,'妇科'),(26,'感染科'),(27,'肛肠科'),(28,'姑息科'),(29,'国际医疗科'),(30,'核医学科'),(31,'呼吸内科'),(32,'护理科'),(33,'急诊科'),(34,'介入科'),(35,'康复科'),(36,'口腔科'),(37,'老干科'),(38,'麻醉科'),(39,'泌尿外科'),(40,'脑外科'),(41,'内分泌科'),(42,'宁养科'),(43,'皮肤科'),(44,'普外科'),(45,'其他'),(46,'乳腺外科'),(47,'烧伤整形科'),(48,'神经科'),(49,'神经内科'),(50,'神经外科'),(51,'肾内科'),(52,'生物治疗科'),(53,'特需科'),(54,'疼痛科'),(55,'微创科'),(56,'胃肠外科'),(57,'消化科'),(58,'消化内科'),(59,'消化外科'),(60,'心内科'),(61,'心胸外科'),(62,'血管外科'),(63,'血透科'),(64,'药剂科'),(65,'医保办'),(66,'医务科'),(67,'整形美容科'),(68,'质控科'),(69,'中西医结合科'),(70,'肿瘤科'),(71,'肿瘤内科'),(72,'肿瘤外科'),(73,'综合科'); +/*!40000 ALTER TABLE `contact_department_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `contact_duty_pl` +-- + +DROP TABLE IF EXISTS `contact_duty_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `contact_duty_pl` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `contact_duty_pl` +-- + +LOCK TABLES `contact_duty_pl` WRITE; +/*!40000 ALTER TABLE `contact_duty_pl` DISABLE KEYS */; +INSERT INTO `contact_duty_pl` VALUES (1,'主任'),(2,'主治医师'),(3,'科室主任'),(4,'采购'),(5,'科室主任'),(6,'院长'),(7,'副院长'),(8,'药剂科主任'),(9,'医生'),(10,'副主任'),(11,'院长助理'),(12,'书记'),(13,'副书记'),(14,'护士'),(15,'护士长'),(16,'库管'),(17,'采购科科长'),(18,'药师'),(19,'药剂科副主任'),(20,'医务科科长'),(21,'医务科副科长'),(22,'医保办主任'),(23,'科教科主任'),(24,'信息卡科长'),(25,'其他'); +/*!40000 ALTER TABLE `contact_duty_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `contact_generalization_target_pl` +-- + +DROP TABLE IF EXISTS `contact_generalization_target_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `contact_generalization_target_pl` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `contact_generalization_target_pl` +-- + +LOCK TABLES `contact_generalization_target_pl` WRITE; +/*!40000 ALTER TABLE `contact_generalization_target_pl` DISABLE KEYS */; +INSERT INTO `contact_generalization_target_pl` VALUES (1,'美施康定'),(2,'奥施康定'),(3,'奇曼丁'),(4,'若思本'),(5,'奥诺美'); +/*!40000 ALTER TABLE `contact_generalization_target_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `contact_grade_pl` +-- + +DROP TABLE IF EXISTS `contact_grade_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `contact_grade_pl` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `contact_grade_pl` +-- + +LOCK TABLES `contact_grade_pl` WRITE; +/*!40000 ALTER TABLE `contact_grade_pl` DISABLE KEYS */; +INSERT INTO `contact_grade_pl` VALUES (1,'A'),(2,'B'),(3,'C'),(4,'D'),(5,'V'),(6,'非目标医生'); +/*!40000 ALTER TABLE `contact_grade_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `contact_job_title_pl` +-- + +DROP TABLE IF EXISTS `contact_job_title_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `contact_job_title_pl` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `contact_job_title_pl` +-- + +LOCK TABLES `contact_job_title_pl` WRITE; +/*!40000 ALTER TABLE `contact_job_title_pl` DISABLE KEYS */; +INSERT INTO `contact_job_title_pl` VALUES (1,'住院医师'),(2,'主治医师'),(3,'副主任医师'),(4,'主任医师'),(5,'护士'),(6,'主管护士'),(7,'药师'),(8,'技师'),(9,'副主任护士'),(10,'主任护师'),(11,'主管药师'),(12,'副主任药师'),(13,'主任药师'),(14,'主管技师'),(15,'副主任技师'),(16,'主任技师'),(17,'其他'); +/*!40000 ALTER TABLE `contact_job_title_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `contact_market_classification_pl` +-- + +DROP TABLE IF EXISTS `contact_market_classification_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `contact_market_classification_pl` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `contact_market_classification_pl` +-- + +LOCK TABLES `contact_market_classification_pl` WRITE; +/*!40000 ALTER TABLE `contact_market_classification_pl` DISABLE KEYS */; +INSERT INTO `contact_market_classification_pl` VALUES (1,'战略城市'),(2,'一级城市'),(3,'二级城市'),(4,'三级城市'),(5,'四级城市'); +/*!40000 ALTER TABLE `contact_market_classification_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `contact_status_pl` +-- + +DROP TABLE IF EXISTS `contact_status_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `contact_status_pl` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `contact_status_pl` +-- + +LOCK TABLES `contact_status_pl` WRITE; +/*!40000 ALTER TABLE `contact_status_pl` DISABLE KEYS */; +INSERT INTO `contact_status_pl` VALUES (1,'有效'),(2,'无效'); +/*!40000 ALTER TABLE `contact_status_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `contactcrmuser` +-- + +DROP TABLE IF EXISTS `contactcrmuser`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `contactcrmuser` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `contactId` mediumint(9) NOT NULL, + `crmuserId` mediumint(9) NOT NULL, + PRIMARY KEY (`id`) USING BTREE, + UNIQUE KEY `contactId` (`contactId`,`crmuserId`), + KEY `crm_contact_cons1` (`crmuserId`), + CONSTRAINT `crm_contact_cons1` FOREIGN KEY (`crmuserId`) REFERENCES `crmuser` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `crm_contact_cons2` FOREIGN KEY (`contactId`) REFERENCES `contact` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `contactcrmuser` +-- + +LOCK TABLES `contactcrmuser` WRITE; +/*!40000 ALTER TABLE `contactcrmuser` DISABLE KEYS */; +/*!40000 ALTER TABLE `contactcrmuser` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `crmuser` +-- + +DROP TABLE IF EXISTS `crmuser`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `crmuser` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `code` varchar(255) DEFAULT NULL, + `reportto` mediumint(9) DEFAULT NULL, + `role` mediumint(9) DEFAULT NULL, + `pl1` mediumint(9) DEFAULT NULL, + `pl2` mediumint(9) DEFAULT NULL, + `pl4` mediumint(9) DEFAULT NULL, + `pl5` mediumint(9) DEFAULT NULL, + `city` mediumint(9) DEFAULT NULL, + `department` varchar(255) DEFAULT NULL, + `whenadded` datetime DEFAULT NULL, + `modifier` varchar(255) DEFAULT NULL, + `modify_datetime` date DEFAULT NULL, + `owner` varchar(255) DEFAULT NULL, + `level` mediumint(9) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE, + UNIQUE KEY `code` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `crmuser` +-- + +LOCK TABLES `crmuser` WRITE; +/*!40000 ALTER TABLE `crmuser` DISABLE KEYS */; +INSERT INTO `crmuser` VALUES (-1,'无','BJ',0,-1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(1,'管理员','BJ231011001',-1,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `crmuser` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `crmuser_activited` +-- + +DROP TABLE IF EXISTS `crmuser_activited`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `crmuser_activited` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `crmuser_activited` +-- + +LOCK TABLES `crmuser_activited` WRITE; +/*!40000 ALTER TABLE `crmuser_activited` DISABLE KEYS */; +INSERT INTO `crmuser_activited` VALUES (0,'未激活'),(1,'已激活'); +/*!40000 ALTER TABLE `crmuser_activited` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `crmuser_level_pl` +-- + +DROP TABLE IF EXISTS `crmuser_level_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `crmuser_level_pl` ( + `id` int(11) NOT NULL, + `val` varchar(45) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `crmuser_level_pl` +-- + +LOCK TABLES `crmuser_level_pl` WRITE; +/*!40000 ALTER TABLE `crmuser_level_pl` DISABLE KEYS */; +INSERT INTO `crmuser_level_pl` VALUES (11,'11'),(21,'21'),(31,'31'); +/*!40000 ALTER TABLE `crmuser_level_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `crmuser_pl1` +-- + +DROP TABLE IF EXISTS `crmuser_pl1`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `crmuser_pl1` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `crmuser_pl1` +-- + +LOCK TABLES `crmuser_pl1` WRITE; +/*!40000 ALTER TABLE `crmuser_pl1` DISABLE KEYS */; +INSERT INTO `crmuser_pl1` VALUES (1,'有效'),(2,'无效'); +/*!40000 ALTER TABLE `crmuser_pl1` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `crmuser_pl2` +-- + +DROP TABLE IF EXISTS `crmuser_pl2`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `crmuser_pl2` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `crmuser_pl2` +-- + +LOCK TABLES `crmuser_pl2` WRITE; +/*!40000 ALTER TABLE `crmuser_pl2` DISABLE KEYS */; +INSERT INTO `crmuser_pl2` VALUES (1,'麻药'),(2,'慢痛'),(3,'奥诺美'),(4,'全部'); +/*!40000 ALTER TABLE `crmuser_pl2` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `data_exchange_operation` +-- + +DROP TABLE IF EXISTS `data_exchange_operation`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `data_exchange_operation` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `version` bigint(20) NOT NULL, + `val` varchar(255) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `val` (`val`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `data_exchange_operation` +-- + +LOCK TABLES `data_exchange_operation` WRITE; +/*!40000 ALTER TABLE `data_exchange_operation` DISABLE KEYS */; +INSERT INTO `data_exchange_operation` VALUES (1,0,'Import'),(2,0,'Export'); +/*!40000 ALTER TABLE `data_exchange_operation` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `data_exchange_status` +-- + +DROP TABLE IF EXISTS `data_exchange_status`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `data_exchange_status` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `version` bigint(20) NOT NULL, + `val` varchar(255) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `val` (`val`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `data_exchange_status` +-- + +LOCK TABLES `data_exchange_status` WRITE; +/*!40000 ALTER TABLE `data_exchange_status` DISABLE KEYS */; +INSERT INTO `data_exchange_status` VALUES (1,0,'Pending'),(2,0,'Abort'),(3,0,'Completed'),(4,0,'Cancelled'); +/*!40000 ALTER TABLE `data_exchange_status` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `data_exchange_teample` +-- + +DROP TABLE IF EXISTS `data_exchange_teample`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `data_exchange_teample` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `template` longtext NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `data_exchange_teample` +-- + +LOCK TABLES `data_exchange_teample` WRITE; +/*!40000 ALTER TABLE `data_exchange_teample` DISABLE KEYS */; +INSERT INTO `data_exchange_teample` VALUES (1,'Account Full Import Template 1.0','\r\n\r\n 1000\r\n Account\r\n BdmCode\r\n account.csv\r\n crm_mysql\r\n \r\n 记录行ID\r\n String\r\n BdmCode\r\n \r\n \r\n \r\n 年诊疗人数\r\n Integer\r\n NumOfTreatPerYear\r\n \r\n\r\n \r\n 成立时间\r\n Date\r\n DateOfEstablish\r\n m/d/yy\r\n \r\n \r\n\r\n \r\n 客户名称\r\n String\r\n Name\r\n \r\n\r\n \r\n 医院行政级别\r\n Lookup\r\n AdministrativLevel\r\n AccountAdministrativLevelPl\r\n Val\r\n Id\r\n \r\n\r\n \r\n 医院分级\r\n Lookup\r\n Grade\r\n AccountGradePl\r\n Val\r\n Id\r\n \r\n\r\n \r\n 医院类型\r\n Lookup\r\n HospitalType\r\n AccountTypePl\r\n Val\r\n Id\r\n \r\n\r\n \r\n 地方军队医院\r\n Lookup\r\n LocalOrArmy\r\n AccountLocalOrArmyPl\r\n Val\r\n Id\r\n \r\n\r\n \r\n 综合专科医院\r\n Lookup\r\n ComprehensiveOrSpecialized\r\n AccountComprehensiveOrSpecializedPl\r\n Val\r\n Id\r\n \r\n\r\n \r\n 重点医院\r\n Lookup\r\n KeyType\r\n AccountPointPl\r\n Val\r\n Id\r\n \r\n\r\n \r\n 状态\r\n Lookup\r\n Status\r\n AccountStatusPl\r\n Val\r\n Id\r\n \r\n\r\n \r\n 法人\r\n String\r\n DutyOfficer\r\n \r\n\r\n \r\n 医生数量\r\n Integer\r\n NumOfDoctors\r\n \r\n\r\n \r\n 助理医师人数\r\n Integer\r\n NumOfAssistantDoctors\r\n \r\n \r\n \r\n 员工总数\r\n Integer\r\n NumOfStaff\r\n \r\n\r\n \r\n 门诊人数\r\n Integer\r\n NumOfOutpatient\r\n \r\n\r\n \r\n 总病床数\r\n Integer\r\n TotalNumOfSickbed\r\n \r\n\r\n \r\n 麻醉科医生数\r\n Integer\r\n NumOfAnesthesiaDoctor\r\n \r\n\r\n \r\n 疼痛学组医生数\r\n Integer\r\n NumOfPainDoctor\r\n \r\n\r\n \r\n 手术量年\r\n Integer\r\n NumOfSurgeryPerYear\r\n \r\n\r\n \r\n 手术间\r\n Integer\r\n NumOfSurgeryRoom\r\n \r\n\r\n \r\n 阿片类用药量\r\n Integer\r\n NumOfUsingOpiatesMedicine\r\n \r\n\r\n \r\n 阿片类注射剂量\r\n Integer\r\n NumOfUsingOpiatesInjection\r\n \r\n\r\n \r\n 注册资金\r\n Integer\r\n RegisteredCapital\r\n \r\n\r\n \r\n 主要电话号码\r\n String\r\n Tel\r\n \r\n\r\n \r\n 主要传真号码\r\n String\r\n Fax\r\n \r\n\r\n \r\n 市场分类\r\n Lookup\r\n MarketClassification\r\n AccountMarketClassificationPl\r\n Val\r\n Id\r\n \r\n\r\n \r\n 医院省份\r\n String\r\n Province\r\n \r\n\r\n \r\n 医院区县\r\n String\r\n Districts\r\n \r\n \r\n \r\n 医院详细地址\r\n String\r\n Address\r\n \r\n'); +/*!40000 ALTER TABLE `data_exchange_teample` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `dealeraccount` +-- + +DROP TABLE IF EXISTS `dealeraccount`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `dealeraccount` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `address` varchar(255) DEFAULT NULL, + `tele` varchar(255) DEFAULT NULL, + `status` mediumint(9) DEFAULT NULL, + `pl1` mediumint(9) DEFAULT NULL, + `pl2` mediumint(9) DEFAULT NULL, + `whenadded` datetime DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=89 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `dealeraccount` +-- + +LOCK TABLES `dealeraccount` WRITE; +/*!40000 ALTER TABLE `dealeraccount` DISABLE KEYS */; +INSERT INTO `dealeraccount` VALUES (1,'经销商0','北京市朝阳区望京东路0号','1381199260',1,1,1,NULL),(2,'经销商1','北京市朝阳区望京东路1号','1381199261',2,2,2,NULL),(3,'经销商2','北京市朝阳区望京东路2号','1381199262',1,3,3,NULL),(4,'经销商3','北京市朝阳区望京东路3号','1381199263',2,1,4,NULL),(5,'经销商4','北京市朝阳区望京东路4号','1381199264',1,2,5,NULL),(6,'经销商5','北京市朝阳区望京东路5号','1381199265',2,3,6,NULL),(7,'经销商6','北京市朝阳区望京东路6号','1381199266',1,1,7,NULL),(8,'经销商7','北京市朝阳区望京东路7号','1381199267',2,2,1,NULL),(9,'经销商8','北京市朝阳区望京东路8号','1381199268',1,3,2,NULL),(10,'经销商9','北京市朝阳区望京东路9号','1381199269',2,1,3,NULL),(11,'经销商10','北京市朝阳区望京东路10号','13811992610',1,2,4,NULL),(12,'经销商11','北京市朝阳区望京东路11号','13811992611',2,3,5,NULL),(13,'经销商12','北京市朝阳区望京东路12号','13811992612',1,1,6,NULL),(14,'经销商13','北京市朝阳区望京东路13号','13811992613',2,2,7,NULL),(15,'经销商14','北京市朝阳区望京东路14号','13811992614',1,3,1,NULL),(16,'经销商15','北京市朝阳区望京东路15号','13811992615',2,1,2,NULL),(17,'经销商16','北京市朝阳区望京东路16号','13811992616',1,2,3,NULL),(18,'经销商17','北京市朝阳区望京东路17号','13811992617',2,3,4,NULL),(19,'经销商18','北京市朝阳区望京东路18号','13811992618',1,1,5,NULL),(20,'经销商19','北京市朝阳区望京东路19号','13811992619',2,2,6,NULL),(21,'经销商20','北京市朝阳区望京东路20号','13811992620',1,3,7,NULL),(22,'经销商21','北京市朝阳区望京东路21号','13811992621',2,1,1,NULL),(23,'经销商22','北京市朝阳区望京东路22号','13811992622',1,2,2,NULL),(24,'经销商23','北京市朝阳区望京东路23号','13811992623',2,3,3,NULL),(25,'经销商24','北京市朝阳区望京东路24号','13811992624',1,1,4,NULL),(26,'经销商25','北京市朝阳区望京东路25号','13811992625',2,2,5,NULL),(27,'经销商26','北京市朝阳区望京东路26号','13811992626',1,3,6,NULL),(28,'经销商27','北京市朝阳区望京东路27号','13811992627',2,1,7,NULL),(29,'经销商28','北京市朝阳区望京东路28号','13811992628',1,2,1,NULL),(30,'经销商29','北京市朝阳区望京东路29号','13811992629',2,3,2,NULL),(31,'经销商30','北京市朝阳区望京东路30号','13811992630',1,1,3,NULL),(32,'经销商31','北京市朝阳区望京东路31号','13811992631',2,2,4,NULL),(33,'经销商32','北京市朝阳区望京东路32号','13811992632',1,3,5,NULL),(34,'经销商33','北京市朝阳区望京东路33号','13811992633',2,1,6,NULL),(35,'经销商34','北京市朝阳区望京东路34号','13811992634',1,2,7,NULL),(36,'经销商35','北京市朝阳区望京东路35号','13811992635',2,3,1,NULL),(37,'经销商36','北京市朝阳区望京东路36号','13811992636',1,1,2,NULL),(38,'经销商37','北京市朝阳区望京东路37号','13811992637',2,2,3,NULL),(39,'经销商38','北京市朝阳区望京东路38号','13811992638',1,3,4,NULL),(40,'经销商39','北京市朝阳区望京东路39号','13811992639',2,1,5,NULL),(41,'经销商40','北京市朝阳区望京东路40号','13811992640',1,2,6,NULL),(42,'经销商41','北京市朝阳区望京东路41号','13811992641',2,3,7,NULL),(43,'经销商42','北京市朝阳区望京东路42号','13811992642',1,1,1,NULL),(44,'经销商43','北京市朝阳区望京东路43号','13811992643',2,2,2,NULL),(45,'经销商44','北京市朝阳区望京东路44号','13811992644',1,3,3,NULL),(46,'经销商45','北京市朝阳区望京东路45号','13811992645',2,1,4,NULL),(47,'经销商46','北京市朝阳区望京东路46号','13811992646',1,2,5,NULL),(48,'经销商47','北京市朝阳区望京东路47号','13811992647',2,3,6,NULL),(49,'经销商48','北京市朝阳区望京东路48号','13811992648',1,1,7,NULL),(50,'经销商49','北京市朝阳区望京东路49号','13811992649',2,2,1,NULL),(51,'经销商50','北京市朝阳区望京东路50号','13811992650',1,3,2,NULL),(52,'经销商51','北京市朝阳区望京东路51号','13811992651',2,1,3,NULL),(53,'经销商52','北京市朝阳区望京东路52号','13811992652',1,2,4,NULL),(54,'经销商53','北京市朝阳区望京东路53号','13811992653',2,3,5,NULL),(55,'经销商54','北京市朝阳区望京东路54号','13811992654',1,1,6,NULL),(56,'经销商55','北京市朝阳区望京东路55号','13811992655',2,2,7,NULL),(57,'经销商56','北京市朝阳区望京东路56号','13811992656',1,3,1,NULL),(58,'经销商57','北京市朝阳区望京东路57号','13811992657',2,1,2,NULL),(59,'经销商58','北京市朝阳区望京东路58号','13811992658',1,2,3,NULL),(60,'经销商59','北京市朝阳区望京东路59号','13811992659',2,3,4,NULL),(61,'经销商60','北京市朝阳区望京东路60号','13811992660',1,1,5,NULL),(62,'经销商61','北京市朝阳区望京东路61号','13811992661',2,2,6,NULL),(63,'经销商62','北京市朝阳区望京东路62号','13811992662',1,3,7,NULL),(64,'经销商63','北京市朝阳区望京东路63号','13811992663',2,1,1,NULL),(65,'经销商64','北京市朝阳区望京东路64号','13811992664',1,2,2,NULL),(66,'经销商65','北京市朝阳区望京东路65号','13811992665',2,3,3,NULL),(67,'经销商66','北京市朝阳区望京东路66号','13811992666',1,1,4,NULL),(68,'经销商67','北京市朝阳区望京东路67号','13811992667',2,2,5,NULL),(69,'经销商68','北京市朝阳区望京东路68号','13811992668',1,3,6,NULL),(70,'经销商69','北京市朝阳区望京东路69号','13811992669',2,1,7,NULL),(71,'经销商70','北京市朝阳区望京东路70号','13811992670',1,2,1,NULL),(72,'经销商71','北京市朝阳区望京东路71号','13811992671',2,3,2,NULL),(73,'经销商72','北京市朝阳区望京东路72号','13811992672',1,1,3,NULL),(74,'经销商73','北京市朝阳区望京东路73号','13811992673',2,2,4,NULL),(75,'经销商74','北京市朝阳区望京东路74号','13811992674',1,3,5,NULL),(76,'经销商75','北京市朝阳区望京东路75号','13811992675',2,1,6,NULL),(77,'经销商76','北京市朝阳区望京东路76号','13811992676',1,2,7,NULL),(78,'经销商77','北京市朝阳区望京东路77号','13811992677',2,3,1,NULL),(79,'经销商78','北京市朝阳区望京东路78号','13811992678',1,1,2,NULL),(80,'经销商79','北京市朝阳区望京东路79号','13811992679',2,2,3,NULL),(81,'经销商80','北京市朝阳区望京东路80号','13811992680',1,3,4,NULL),(82,'经销商81','北京市朝阳区望京东路81号','13811992681',2,1,5,NULL),(83,'经销商82','北京市朝阳区望京东路82号','13811992682',1,2,6,NULL),(84,'经销商83','北京市朝阳区望京东路83号','13811992683',2,3,7,NULL),(85,'经销商84','北京市朝阳区望京东路84号','13811992684',1,1,1,NULL),(86,'经销商85','北京市朝阳区望京东路85号','13811992685',2,2,2,NULL),(87,'经销商86','北京市朝阳区望京东路86号','13811992686',1,3,3,NULL),(88,'经销商87','北京市朝阳区望京东路87号','13811992687',2,1,4,NULL); +/*!40000 ALTER TABLE `dealeraccount` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `dealercontact` +-- + +DROP TABLE IF EXISTS `dealercontact`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `dealercontact` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `sex` mediumint(9) DEFAULT NULL, + `tel_work` varchar(255) DEFAULT NULL, + `dealerAccountId` mediumint(9) NOT NULL, + `status` mediumint(9) DEFAULT NULL, + `pl1` mediumint(9) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `dealercontact` +-- + +LOCK TABLES `dealercontact` WRITE; +/*!40000 ALTER TABLE `dealercontact` DISABLE KEYS */; +/*!40000 ALTER TABLE `dealercontact` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `dl` +-- + +DROP TABLE IF EXISTS `dl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `dl` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `deviceName` varchar(255) DEFAULT NULL, + `appId` mediumint(9) DEFAULT NULL, + `dlDate` datetime DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=2000 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `dl` +-- + +LOCK TABLES `dl` WRITE; +/*!40000 ALTER TABLE `dl` DISABLE KEYS */; +INSERT INTO `dl` VALUES (1,'N2',2,'2013-10-09 14:42:28'),(2,'N3',3,'2013-10-20 15:42:28'),(3,'N1',4,'2013-10-04 16:42:28'),(4,'N2',5,'2013-10-28 17:42:28'),(5,'N3',6,'2013-10-06 18:42:28'),(6,'N1',7,'2013-10-23 19:42:28'),(7,'N2',8,'2013-10-03 20:42:28'),(8,'N3',9,'2013-10-18 21:42:28'),(9,'N1',10,'2013-10-22 22:42:28'),(10,'N2',1,'2013-10-13 23:42:28'),(11,'N3',2,'2013-10-06 00:42:28'),(12,'N1',3,'2013-10-18 01:42:28'),(13,'N2',4,'2013-10-13 02:42:28'),(14,'N3',5,'2013-10-19 03:42:28'),(15,'N1',6,'2013-10-11 04:42:28'),(16,'N2',7,'2013-10-02 05:42:28'),(17,'N3',8,'2013-10-09 06:42:28'),(18,'N1',9,'2013-10-27 07:42:28'),(19,'N2',10,'2013-10-24 08:42:28'),(20,'N3',1,'2013-10-24 09:42:28'),(21,'N1',2,'2013-10-21 10:42:28'),(22,'N2',3,'2013-10-15 13:42:28'),(23,'N3',4,'2013-10-24 14:42:28'),(24,'N1',5,'2013-10-13 15:42:28'),(25,'N2',6,'2013-10-01 16:42:28'),(26,'N3',7,'2013-10-25 17:42:28'),(27,'N1',8,'2013-10-06 18:42:28'),(28,'N2',9,'2013-10-04 19:42:28'),(29,'N3',10,'2013-10-05 20:42:28'),(30,'N1',1,'2013-10-28 21:42:28'),(31,'N2',2,'2013-10-09 22:42:28'),(32,'N3',3,'2013-10-29 23:42:28'),(33,'N1',4,'2013-10-12 00:42:28'),(34,'N2',5,'2013-10-04 01:42:28'),(35,'N3',6,'2013-10-12 02:42:28'),(36,'N1',7,'2013-10-03 03:42:28'),(37,'N2',8,'2013-10-19 04:42:28'),(38,'N3',9,'2013-10-04 05:42:28'),(39,'N1',10,'2013-10-16 06:42:28'),(40,'N2',1,'2013-10-11 07:42:28'),(41,'N3',2,'2013-10-12 08:42:28'),(42,'N1',3,'2013-10-18 09:42:28'),(43,'N2',4,'2013-10-11 10:42:28'),(44,'N3',5,'2013-10-21 13:42:28'),(45,'N1',6,'2013-10-11 14:42:28'),(46,'N2',7,'2013-10-21 15:42:28'),(47,'N3',8,'2013-10-21 16:42:28'),(48,'N1',9,'2013-10-16 17:42:28'),(49,'N2',10,'2013-10-22 18:42:28'),(50,'N3',1,'2013-10-13 19:42:28'),(51,'N1',2,'2013-10-29 20:42:28'),(52,'N2',3,'2013-10-02 21:42:28'),(53,'N3',4,'2013-10-07 22:42:28'),(54,'N1',5,'2013-10-19 23:42:28'),(55,'N2',6,'2013-10-20 00:42:28'),(56,'N3',7,'2013-10-04 01:42:28'),(57,'N1',8,'2013-10-18 02:42:28'),(58,'N2',9,'2013-10-30 03:42:28'),(59,'N3',10,'2013-10-22 04:42:28'),(60,'N1',1,'2013-10-10 05:42:28'),(61,'N2',2,'2013-10-08 06:42:28'),(62,'N3',3,'2013-10-09 07:42:28'),(63,'N1',4,'2013-10-08 08:42:28'),(64,'N2',5,'2013-10-16 09:42:28'),(65,'N3',6,'2013-10-19 10:42:28'),(66,'N1',7,'2013-10-06 13:42:28'),(67,'N2',8,'2013-10-02 14:42:28'),(68,'N3',9,'2013-10-10 15:42:28'),(69,'N1',10,'2013-10-15 16:42:28'),(70,'N2',1,'2013-10-18 17:42:28'),(71,'N3',2,'2013-10-23 18:42:28'),(72,'N1',3,'2013-10-21 19:42:28'),(73,'N2',4,'2013-10-04 20:42:28'),(74,'N3',5,'2013-10-17 21:42:28'),(75,'N1',6,'2013-10-16 22:42:28'),(76,'N2',7,'2013-10-01 23:42:28'),(77,'N3',8,'2013-10-06 00:42:28'),(78,'N1',9,'2013-10-12 01:42:28'),(79,'N2',10,'2013-10-11 02:42:28'),(80,'N3',1,'2013-10-12 03:42:28'),(81,'N1',2,'2013-10-15 04:42:28'),(82,'N2',3,'2013-10-24 05:42:28'),(83,'N3',4,'2013-10-04 06:42:28'),(84,'N1',5,'2013-10-25 07:42:28'),(85,'N2',6,'2013-10-25 08:42:28'),(86,'N3',7,'2013-10-18 09:42:28'),(87,'N1',8,'2013-10-21 10:42:28'),(88,'N2',9,'2013-10-15 13:42:28'),(89,'N3',10,'2013-10-14 14:42:28'),(90,'N1',1,'2013-10-29 15:42:28'),(91,'N2',2,'2013-10-07 16:42:28'),(92,'N3',3,'2013-10-17 17:42:28'),(93,'N1',4,'2013-10-14 18:42:28'),(94,'N2',5,'2013-10-27 19:42:28'),(95,'N3',6,'2013-10-20 20:42:28'),(96,'N1',7,'2013-10-04 21:42:28'),(97,'N2',8,'2013-10-05 22:42:28'),(98,'N3',9,'2013-10-20 23:42:28'),(99,'N1',10,'2013-10-08 00:42:28'),(100,'N2',1,'2013-10-24 01:42:28'),(101,'N3',2,'2013-10-24 02:42:28'),(102,'N1',3,'2013-10-04 03:42:28'),(103,'N2',4,'2013-10-30 04:42:28'),(104,'N3',5,'2013-10-05 05:42:28'),(105,'N1',6,'2013-10-22 06:42:28'),(106,'N2',7,'2013-10-02 07:42:28'),(107,'N3',8,'2013-10-22 08:42:28'),(108,'N1',9,'2013-10-24 09:42:28'),(109,'N2',10,'2013-10-24 10:42:28'),(110,'N3',1,'2013-10-08 13:42:28'),(111,'N1',2,'2013-10-18 14:42:28'),(112,'N2',3,'2013-10-02 15:42:28'),(113,'N3',4,'2013-10-21 16:42:28'),(114,'N1',5,'2013-10-08 17:42:28'),(115,'N2',6,'2013-10-12 18:42:28'),(116,'N3',7,'2013-10-09 19:42:28'),(117,'N1',8,'2013-10-23 20:42:28'),(118,'N2',9,'2013-10-21 21:42:28'),(119,'N3',10,'2013-10-24 22:42:28'),(120,'N1',1,'2013-10-19 23:42:28'),(121,'N2',2,'2013-10-18 00:42:28'),(122,'N3',3,'2013-10-08 01:42:28'),(123,'N1',4,'2013-10-11 02:42:28'),(124,'N2',5,'2013-10-13 03:42:28'),(125,'N3',6,'2013-10-03 04:42:28'),(126,'N1',7,'2013-10-15 05:42:28'),(127,'N2',8,'2013-10-23 06:42:28'),(128,'N3',9,'2013-10-30 07:42:28'),(129,'N1',10,'2013-10-12 08:42:28'),(130,'N2',1,'2013-10-06 09:42:28'),(131,'N3',2,'2013-10-09 10:42:28'),(132,'N1',3,'2013-10-04 13:42:28'),(133,'N2',4,'2013-10-03 14:42:28'),(134,'N3',5,'2013-10-14 15:42:28'),(135,'N1',6,'2013-10-17 16:42:28'),(136,'N2',7,'2013-10-22 17:42:28'),(137,'N3',8,'2013-10-04 18:42:28'),(138,'N1',9,'2013-10-19 19:42:28'),(139,'N2',10,'2013-10-07 20:42:28'),(140,'N3',1,'2013-10-28 21:42:28'),(141,'N1',2,'2013-10-05 22:42:28'),(142,'N2',3,'2013-10-27 23:42:28'),(143,'N3',4,'2013-10-28 00:42:28'),(144,'N1',5,'2013-10-20 01:42:28'),(145,'N2',6,'2013-10-30 02:42:28'),(146,'N3',7,'2013-10-25 03:42:28'),(147,'N1',8,'2013-10-25 04:42:28'),(148,'N2',9,'2013-10-02 05:42:28'),(149,'N3',10,'2013-10-06 06:42:28'),(150,'N1',1,'2013-10-24 07:42:28'),(151,'N2',2,'2013-10-29 08:42:28'),(152,'N3',3,'2013-10-23 09:42:28'),(153,'N1',4,'2013-10-13 10:42:28'),(154,'N2',5,'2013-10-16 13:42:28'),(155,'N3',6,'2013-10-06 14:42:28'),(156,'N1',7,'2013-10-22 15:42:28'),(157,'N2',8,'2013-10-19 16:42:28'),(158,'N3',9,'2013-10-29 17:42:28'),(159,'N1',10,'2013-10-25 18:42:28'),(160,'N2',1,'2013-10-13 19:42:28'),(161,'N3',2,'2013-10-10 20:42:28'),(162,'N1',3,'2013-10-13 21:42:28'),(163,'N2',4,'2013-10-28 22:42:28'),(164,'N3',5,'2013-10-09 23:42:28'),(165,'N1',6,'2013-10-09 00:42:28'),(166,'N2',7,'2013-10-02 01:42:28'),(167,'N3',8,'2013-10-13 02:42:28'),(168,'N1',9,'2013-10-23 03:42:28'),(169,'N2',10,'2013-10-29 04:42:28'),(170,'N3',1,'2013-10-15 05:42:28'),(171,'N1',2,'2013-10-27 06:42:28'),(172,'N2',3,'2013-10-02 07:42:28'),(173,'N3',4,'2013-10-16 08:42:28'),(174,'N1',5,'2013-10-03 09:42:28'),(175,'N2',6,'2013-10-04 10:42:28'),(176,'N3',7,'2013-10-04 13:42:28'),(177,'N1',8,'2013-10-21 14:42:28'),(178,'N2',9,'2013-10-06 15:42:28'),(179,'N3',10,'2013-10-11 16:42:28'),(180,'N1',1,'2013-10-24 17:42:28'),(181,'N2',2,'2013-10-07 18:42:28'),(182,'N3',3,'2013-10-05 19:42:28'),(183,'N1',4,'2013-10-26 20:42:28'),(184,'N2',5,'2013-10-22 21:42:28'),(185,'N3',6,'2013-10-13 22:42:28'),(186,'N1',7,'2013-10-05 23:42:28'),(187,'N2',8,'2013-10-22 00:42:28'),(188,'N3',9,'2013-10-03 01:42:28'),(189,'N1',10,'2013-10-07 02:42:28'),(190,'N2',1,'2013-10-15 03:42:28'),(191,'N3',2,'2013-10-07 04:42:28'),(192,'N1',3,'2013-10-11 05:42:28'),(193,'N2',4,'2013-10-24 06:42:28'),(194,'N3',5,'2013-10-29 07:42:28'),(195,'N1',6,'2013-10-15 08:42:28'),(196,'N2',7,'2013-10-12 09:42:28'),(197,'N3',8,'2013-10-26 10:42:28'),(198,'N1',9,'2013-10-04 13:42:28'),(199,'N2',10,'2013-10-07 14:42:28'),(200,'N3',1,'2013-10-20 15:42:28'),(201,'N1',2,'2013-10-23 16:42:28'),(202,'N2',3,'2013-10-16 17:42:28'),(203,'N3',4,'2013-10-02 18:42:28'),(204,'N1',5,'2013-10-23 19:42:28'),(205,'N2',6,'2013-10-08 20:42:28'),(206,'N3',7,'2013-10-02 21:42:28'),(207,'N1',8,'2013-10-21 22:42:28'),(208,'N2',9,'2013-10-18 23:42:28'),(209,'N3',10,'2013-10-11 00:42:28'),(210,'N1',1,'2013-10-23 01:42:28'),(211,'N2',2,'2013-10-29 02:42:28'),(212,'N3',3,'2013-10-18 03:42:28'),(213,'N1',4,'2013-10-06 04:42:28'),(214,'N2',5,'2013-10-16 05:42:28'),(215,'N3',6,'2013-10-11 06:42:28'),(216,'N1',7,'2013-10-22 07:42:28'),(217,'N2',8,'2013-10-23 08:42:28'),(218,'N3',9,'2013-10-25 09:42:28'),(219,'N1',10,'2013-10-28 10:42:28'),(220,'N2',1,'2013-10-04 13:42:28'),(221,'N3',2,'2013-10-14 14:42:28'),(222,'N1',3,'2013-10-14 15:42:28'),(223,'N2',4,'2013-10-13 16:42:28'),(224,'N3',5,'2013-10-17 17:42:28'),(225,'N1',6,'2013-10-12 18:42:28'),(226,'N2',7,'2013-10-15 19:42:28'),(227,'N3',8,'2013-10-29 20:42:28'),(228,'N1',9,'2013-10-21 21:42:28'),(229,'N2',10,'2013-10-08 22:42:28'),(230,'N3',1,'2013-10-24 23:42:28'),(231,'N1',2,'2013-10-08 00:42:28'),(232,'N2',3,'2013-10-06 01:42:28'),(233,'N3',4,'2013-10-26 02:42:28'),(234,'N1',5,'2013-10-20 03:42:28'),(235,'N2',6,'2013-10-07 04:42:28'),(236,'N3',7,'2013-10-22 05:42:28'),(237,'N1',8,'2013-10-21 06:42:28'),(238,'N2',9,'2013-10-29 07:42:28'),(239,'N3',10,'2013-10-28 08:42:28'),(240,'N1',1,'2013-10-10 09:42:28'),(241,'N2',2,'2013-10-14 10:42:28'),(242,'N3',3,'2013-10-01 13:42:28'),(243,'N1',4,'2013-10-10 14:42:28'),(244,'N2',5,'2013-10-18 15:42:28'),(245,'N3',6,'2013-10-08 16:42:28'),(246,'N1',7,'2013-10-22 17:42:28'),(247,'N2',8,'2013-10-05 18:42:28'),(248,'N3',9,'2013-10-21 19:42:28'),(249,'N1',10,'2013-10-23 20:42:28'),(250,'N2',1,'2013-10-11 21:42:28'),(251,'N3',2,'2013-10-10 22:42:28'),(252,'N1',3,'2013-10-17 23:42:28'),(253,'N2',4,'2013-10-23 00:42:28'),(254,'N3',5,'2013-10-06 01:42:28'),(255,'N1',6,'2013-10-17 02:42:28'),(256,'N2',7,'2013-10-03 03:42:28'),(257,'N3',8,'2013-10-27 04:42:28'),(258,'N1',9,'2013-10-10 05:42:28'),(259,'N2',10,'2013-10-29 06:42:28'),(260,'N3',1,'2013-10-09 07:42:28'),(261,'N1',2,'2013-10-22 08:42:28'),(262,'N2',3,'2013-10-23 09:42:28'),(263,'N3',4,'2013-10-08 10:42:28'),(264,'N1',5,'2013-10-20 13:42:28'),(265,'N2',6,'2013-10-02 14:42:28'),(266,'N3',7,'2013-10-08 15:42:28'),(267,'N1',8,'2013-10-15 16:42:28'),(268,'N2',9,'2013-10-05 17:42:28'),(269,'N3',10,'2013-10-18 18:42:28'),(270,'N1',1,'2013-10-11 19:42:28'),(271,'N2',2,'2013-10-12 20:42:28'),(272,'N3',3,'2013-10-09 21:42:28'),(273,'N1',4,'2013-10-11 22:42:28'),(274,'N2',5,'2013-10-04 23:42:28'),(275,'N3',6,'2013-10-16 00:42:28'),(276,'N1',7,'2013-10-08 01:42:28'),(277,'N2',8,'2013-10-03 02:42:28'),(278,'N3',9,'2013-10-30 03:42:28'),(279,'N1',10,'2013-10-05 04:42:28'),(280,'N2',1,'2013-10-25 05:42:28'),(281,'N3',2,'2013-10-12 06:42:28'),(282,'N1',3,'2013-10-02 07:42:28'),(283,'N2',4,'2013-10-04 08:42:28'),(284,'N3',5,'2013-10-09 09:42:28'),(285,'N1',6,'2013-10-12 10:42:28'),(286,'N2',7,'2013-10-16 13:42:28'),(287,'N3',8,'2013-10-21 14:42:28'),(288,'N1',9,'2013-10-20 15:42:28'),(289,'N2',10,'2013-10-23 16:42:28'),(290,'N3',1,'2013-10-04 17:42:28'),(291,'N1',2,'2013-10-14 18:42:28'),(292,'N2',3,'2013-10-06 19:42:28'),(293,'N3',4,'2013-10-20 20:42:28'),(294,'N1',5,'2013-10-21 21:42:28'),(295,'N2',6,'2013-10-14 22:42:28'),(296,'N3',7,'2013-10-24 23:42:28'),(297,'N1',8,'2013-10-04 00:42:28'),(298,'N2',9,'2013-10-02 01:42:28'),(299,'N3',10,'2013-10-28 02:42:28'),(300,'N1',1,'2013-10-09 03:42:28'),(301,'N2',2,'2013-10-10 04:42:28'),(302,'N3',3,'2013-10-28 05:42:28'),(303,'N1',4,'2013-10-20 06:42:28'),(304,'N2',5,'2013-10-26 07:42:28'),(305,'N3',6,'2013-10-27 08:42:28'),(306,'N1',7,'2013-10-28 09:42:28'),(307,'N2',8,'2013-10-04 10:42:28'),(308,'N3',9,'2013-10-07 13:42:28'),(309,'N1',10,'2013-10-27 14:42:28'),(310,'N2',1,'2013-10-06 15:42:28'),(311,'N3',2,'2013-10-13 16:42:28'),(312,'N1',3,'2013-10-07 17:42:28'),(313,'N2',4,'2013-10-06 18:42:28'),(314,'N3',5,'2013-10-26 19:42:28'),(315,'N1',6,'2013-10-22 20:42:28'),(316,'N2',7,'2013-10-08 21:42:28'),(317,'N3',8,'2013-10-02 22:42:28'),(318,'N1',9,'2013-10-20 23:42:28'),(319,'N2',10,'2013-10-02 00:42:28'),(320,'N3',1,'2013-10-22 01:42:28'),(321,'N1',2,'2013-10-13 02:42:28'),(322,'N2',3,'2013-10-25 03:42:28'),(323,'N3',4,'2013-10-28 04:42:28'),(324,'N1',5,'2013-10-26 05:42:28'),(325,'N2',6,'2013-10-20 06:42:28'),(326,'N3',7,'2013-10-28 07:42:28'),(327,'N1',8,'2013-10-16 08:42:28'),(328,'N2',9,'2013-10-22 09:42:28'),(329,'N3',10,'2013-10-26 10:42:28'),(330,'N1',1,'2013-10-03 13:42:28'),(331,'N2',2,'2013-10-08 14:42:28'),(332,'N3',3,'2013-10-21 15:42:28'),(333,'N1',4,'2013-10-22 16:42:28'),(334,'N2',5,'2013-10-22 17:42:28'),(335,'N3',6,'2013-10-12 18:42:28'),(336,'N1',7,'2013-10-25 19:42:28'),(337,'N2',8,'2013-10-07 20:42:28'),(338,'N3',9,'2013-10-19 21:42:28'),(339,'N1',10,'2013-10-06 22:42:28'),(340,'N2',1,'2013-10-04 23:42:28'),(341,'N3',2,'2013-10-27 00:42:28'),(342,'N1',3,'2013-10-16 01:42:28'),(343,'N2',4,'2013-10-28 02:42:28'),(344,'N3',5,'2013-10-03 03:42:28'),(345,'N1',6,'2013-10-05 04:42:28'),(346,'N2',7,'2013-10-14 05:42:28'),(347,'N3',8,'2013-10-23 06:42:28'),(348,'N1',9,'2013-10-23 07:42:28'),(349,'N2',10,'2013-10-08 08:42:28'),(350,'N3',1,'2013-10-22 09:42:28'),(351,'N1',2,'2013-10-27 10:42:28'),(352,'N2',3,'2013-10-11 13:42:28'),(353,'N3',4,'2013-10-22 14:42:28'),(354,'N1',5,'2013-10-01 15:42:28'),(355,'N2',6,'2013-10-25 16:42:28'),(356,'N3',7,'2013-10-21 17:42:28'),(357,'N1',8,'2013-10-27 18:42:28'),(358,'N2',9,'2013-10-23 19:42:28'),(359,'N3',10,'2013-10-09 20:42:28'),(360,'N1',1,'2013-10-16 21:42:28'),(361,'N2',2,'2013-10-08 22:42:28'),(362,'N3',3,'2013-10-01 23:42:28'),(363,'N1',4,'2013-10-25 00:42:28'),(364,'N2',5,'2013-10-02 01:42:28'),(365,'N3',6,'2013-10-06 02:42:28'),(366,'N1',7,'2013-10-10 03:42:28'),(367,'N2',8,'2013-10-12 04:42:28'),(368,'N3',9,'2013-10-17 05:42:28'),(369,'N1',10,'2013-10-12 06:42:28'),(370,'N2',1,'2013-10-26 07:42:28'),(371,'N3',2,'2013-10-12 08:42:28'),(372,'N1',3,'2013-10-11 09:42:28'),(373,'N2',4,'2013-10-18 10:42:28'),(374,'N3',5,'2013-10-13 13:42:28'),(375,'N1',6,'2013-10-12 14:42:28'),(376,'N2',7,'2013-10-26 15:42:28'),(377,'N3',8,'2013-10-08 16:42:28'),(378,'N1',9,'2013-10-18 17:42:28'),(379,'N2',10,'2013-10-02 18:42:28'),(380,'N3',1,'2013-10-11 19:42:28'),(381,'N1',2,'2013-10-15 20:42:28'),(382,'N2',3,'2013-10-15 21:42:28'),(383,'N3',4,'2013-10-23 22:42:28'),(384,'N1',5,'2013-10-17 23:42:28'),(385,'N2',6,'2013-10-03 00:42:28'),(386,'N3',7,'2013-10-06 01:42:28'),(387,'N1',8,'2013-10-06 02:42:28'),(388,'N2',9,'2013-10-26 03:42:28'),(389,'N3',10,'2013-10-26 04:42:28'),(390,'N1',1,'2013-10-03 05:42:28'),(391,'N2',2,'2013-10-23 06:42:28'),(392,'N3',3,'2013-10-18 07:42:28'),(393,'N1',4,'2013-10-03 08:42:28'),(394,'N2',5,'2013-10-26 09:42:28'),(395,'N3',6,'2013-10-26 10:42:28'),(396,'N1',7,'2013-10-26 13:42:28'),(397,'N2',8,'2013-10-18 14:42:28'),(398,'N3',9,'2013-10-14 15:42:28'),(399,'N1',10,'2013-10-09 16:42:28'),(400,'N2',1,'2013-10-13 17:42:28'),(401,'N3',2,'2013-10-12 18:42:28'),(402,'N1',3,'2013-10-12 19:42:28'),(403,'N2',4,'2013-10-27 20:42:28'),(404,'N3',5,'2013-10-16 21:42:28'),(405,'N1',6,'2013-10-19 22:42:28'),(406,'N2',7,'2013-10-21 23:42:28'),(407,'N3',8,'2013-10-04 00:42:28'),(408,'N1',9,'2013-10-26 01:42:28'),(409,'N2',10,'2013-10-25 02:42:28'),(410,'N3',1,'2013-10-26 03:42:28'),(411,'N1',2,'2013-10-25 04:42:28'),(412,'N2',3,'2013-10-25 05:42:28'),(413,'N3',4,'2013-10-21 06:42:28'),(414,'N1',5,'2013-10-03 07:42:28'),(415,'N2',6,'2013-10-21 08:42:28'),(416,'N3',7,'2013-10-07 09:42:28'),(417,'N1',8,'2013-10-12 10:42:28'),(418,'N2',9,'2013-10-20 13:42:28'),(419,'N3',10,'2013-10-13 14:42:28'),(420,'N1',1,'2013-10-20 15:42:28'),(421,'N2',2,'2013-10-05 16:42:28'),(422,'N3',3,'2013-10-27 17:42:28'),(423,'N1',4,'2013-10-11 18:42:28'),(424,'N2',5,'2013-10-06 19:42:28'),(425,'N3',6,'2013-10-01 20:42:28'),(426,'N1',7,'2013-10-10 21:42:28'),(427,'N2',8,'2013-10-20 22:42:28'),(428,'N3',9,'2013-10-27 23:42:28'),(429,'N1',10,'2013-10-03 00:42:28'),(430,'N2',1,'2013-10-29 01:42:28'),(431,'N3',2,'2013-10-03 02:42:28'),(432,'N1',3,'2013-10-17 03:42:28'),(433,'N2',4,'2013-10-17 04:42:28'),(434,'N3',5,'2013-10-26 05:42:28'),(435,'N1',6,'2013-10-12 06:42:28'),(436,'N2',7,'2013-10-21 07:42:28'),(437,'N3',8,'2013-10-04 08:42:28'),(438,'N1',9,'2013-10-28 09:42:28'),(439,'N2',10,'2013-10-13 10:42:28'),(440,'N3',1,'2013-10-02 13:42:28'),(441,'N1',2,'2013-10-16 14:42:28'),(442,'N2',3,'2013-10-15 15:42:28'),(443,'N3',4,'2013-10-17 16:42:28'),(444,'N1',5,'2013-10-19 17:42:28'),(445,'N2',6,'2013-10-21 18:42:28'),(446,'N3',7,'2013-10-23 19:42:28'),(447,'N1',8,'2013-10-05 20:42:28'),(448,'N2',9,'2013-10-10 21:42:28'),(449,'N3',10,'2013-10-12 22:42:28'),(450,'N1',1,'2013-10-12 23:42:28'),(451,'N2',2,'2013-10-18 00:42:28'),(452,'N3',3,'2013-10-16 01:42:28'),(453,'N1',4,'2013-10-20 02:42:28'),(454,'N2',5,'2013-10-20 03:42:28'),(455,'N3',6,'2013-10-05 04:42:28'),(456,'N1',7,'2013-10-14 05:42:28'),(457,'N2',8,'2013-10-16 06:42:28'),(458,'N3',9,'2013-10-13 07:42:28'),(459,'N1',10,'2013-10-27 08:42:28'),(460,'N2',1,'2013-10-20 09:42:28'),(461,'N3',2,'2013-10-17 10:42:28'),(462,'N1',3,'2013-10-19 13:42:28'),(463,'N2',4,'2013-10-10 14:42:28'),(464,'N3',5,'2013-10-25 15:42:28'),(465,'N1',6,'2013-10-24 16:42:28'),(466,'N2',7,'2013-10-03 17:42:28'),(467,'N3',8,'2013-10-08 18:42:28'),(468,'N1',9,'2013-10-19 19:42:28'),(469,'N2',10,'2013-10-07 20:42:28'),(470,'N3',1,'2013-10-28 21:42:28'),(471,'N1',2,'2013-10-04 22:42:28'),(472,'N2',3,'2013-10-24 23:42:28'),(473,'N3',4,'2013-10-09 00:42:28'),(474,'N1',5,'2013-10-20 01:42:28'),(475,'N2',6,'2013-10-17 02:42:28'),(476,'N3',7,'2013-10-09 03:42:28'),(477,'N1',8,'2013-10-03 04:42:28'),(478,'N2',9,'2013-10-13 05:42:28'),(479,'N3',10,'2013-10-03 06:42:28'),(480,'N1',1,'2013-10-25 07:42:28'),(481,'N2',2,'2013-10-20 08:42:28'),(482,'N3',3,'2013-10-15 09:42:28'),(483,'N1',4,'2013-10-24 10:42:28'),(484,'N2',5,'2013-10-29 13:42:28'),(485,'N3',6,'2013-10-04 14:42:28'),(486,'N1',7,'2013-10-09 15:42:28'),(487,'N2',8,'2013-10-20 16:42:28'),(488,'N3',9,'2013-10-15 17:42:28'),(489,'N1',10,'2013-10-01 18:42:28'),(490,'N2',1,'2013-10-03 19:42:28'),(491,'N3',2,'2013-10-22 20:42:28'),(492,'N1',3,'2013-10-13 21:42:28'),(493,'N2',4,'2013-10-19 22:42:28'),(494,'N3',5,'2013-10-20 23:42:28'),(495,'N1',6,'2013-10-05 00:42:28'),(496,'N2',7,'2013-10-02 01:42:28'),(497,'N3',8,'2013-10-17 02:42:28'),(498,'N1',9,'2013-10-06 03:42:28'),(499,'N2',10,'2013-10-07 04:42:28'),(500,'N3',1,'2013-10-24 05:42:28'),(501,'N1',2,'2013-10-21 06:42:28'),(502,'N2',3,'2013-10-29 07:42:28'),(503,'N3',4,'2013-10-21 08:42:28'),(504,'N1',5,'2013-10-22 09:42:28'),(505,'N2',6,'2013-10-21 10:42:28'),(506,'N3',7,'2013-10-24 13:42:28'),(507,'N1',8,'2013-10-07 14:42:28'),(508,'N2',9,'2013-10-09 15:42:28'),(509,'N3',10,'2013-10-11 16:42:28'),(510,'N1',1,'2013-10-19 17:42:28'),(511,'N2',2,'2013-10-12 18:42:28'),(512,'N3',3,'2013-10-03 19:42:28'),(513,'N1',4,'2013-10-25 20:42:28'),(514,'N2',5,'2013-10-04 21:42:28'),(515,'N3',6,'2013-10-18 22:42:28'),(516,'N1',7,'2013-10-08 23:42:28'),(517,'N2',8,'2013-10-17 00:42:28'),(518,'N3',9,'2013-10-20 01:42:28'),(519,'N1',10,'2013-10-22 02:42:28'),(520,'N2',1,'2013-10-24 03:42:28'),(521,'N3',2,'2013-10-07 04:42:28'),(522,'N1',3,'2013-10-19 05:42:28'),(523,'N2',4,'2013-10-28 06:42:28'),(524,'N3',5,'2013-10-10 07:42:28'),(525,'N1',6,'2013-10-10 08:42:28'),(526,'N2',7,'2013-10-10 09:42:28'),(527,'N3',8,'2013-10-30 10:42:28'),(528,'N1',9,'2013-10-11 13:42:28'),(529,'N2',10,'2013-10-22 14:42:28'),(530,'N3',1,'2013-10-12 15:42:28'),(531,'N1',2,'2013-10-02 16:42:28'),(532,'N2',3,'2013-10-07 17:42:28'),(533,'N3',4,'2013-10-16 18:42:28'),(534,'N1',5,'2013-10-15 19:42:28'),(535,'N2',6,'2013-10-15 20:42:28'),(536,'N3',7,'2013-10-13 21:42:28'),(537,'N1',8,'2013-10-11 22:42:28'),(538,'N2',9,'2013-10-09 23:42:28'),(539,'N3',10,'2013-10-07 00:42:28'),(540,'N1',1,'2013-10-05 01:42:28'),(541,'N2',2,'2013-10-10 02:42:28'),(542,'N3',3,'2013-10-21 03:42:28'),(543,'N1',4,'2013-10-15 04:42:28'),(544,'N2',5,'2013-10-12 05:42:28'),(545,'N3',6,'2013-10-16 06:42:28'),(546,'N1',7,'2013-10-04 07:42:28'),(547,'N2',8,'2013-10-12 08:42:28'),(548,'N3',9,'2013-10-20 09:42:28'),(549,'N1',10,'2013-10-12 10:42:28'),(550,'N2',1,'2013-10-17 13:42:28'),(551,'N3',2,'2013-10-22 14:42:28'),(552,'N1',3,'2013-10-26 15:42:28'),(553,'N2',4,'2013-10-29 16:42:28'),(554,'N3',5,'2013-10-12 17:42:28'),(555,'N1',6,'2013-10-13 18:42:28'),(556,'N2',7,'2013-10-06 19:42:28'),(557,'N3',8,'2013-10-18 20:42:28'),(558,'N1',9,'2013-10-12 21:42:28'),(559,'N2',10,'2013-10-02 22:42:28'),(560,'N3',1,'2013-10-03 23:42:28'),(561,'N1',2,'2013-10-27 00:42:28'),(562,'N2',3,'2013-10-23 01:42:28'),(563,'N3',4,'2013-10-17 02:42:28'),(564,'N1',5,'2013-10-23 03:42:28'),(565,'N2',6,'2013-10-03 04:42:28'),(566,'N3',7,'2013-10-26 05:42:28'),(567,'N1',8,'2013-10-05 06:42:28'),(568,'N2',9,'2013-10-06 07:42:28'),(569,'N3',10,'2013-10-09 08:42:28'),(570,'N1',1,'2013-10-15 09:42:28'),(571,'N2',2,'2013-10-07 10:42:28'),(572,'N3',3,'2013-10-21 13:42:28'),(573,'N1',4,'2013-10-16 14:42:28'),(574,'N2',5,'2013-10-13 15:42:28'),(575,'N3',6,'2013-10-04 16:42:28'),(576,'N1',7,'2013-10-26 17:42:28'),(577,'N2',8,'2013-10-24 18:42:28'),(578,'N3',9,'2013-10-27 19:42:28'),(579,'N1',10,'2013-10-25 20:42:28'),(580,'N2',1,'2013-10-16 21:42:28'),(581,'N3',2,'2013-10-08 22:42:28'),(582,'N1',3,'2013-10-15 23:42:28'),(583,'N2',4,'2013-10-29 00:42:28'),(584,'N3',5,'2013-10-06 01:42:28'),(585,'N1',6,'2013-10-04 02:42:28'),(586,'N2',7,'2013-10-28 03:42:28'),(587,'N3',8,'2013-10-25 04:42:28'),(588,'N1',9,'2013-10-10 05:42:28'),(589,'N2',10,'2013-10-07 06:42:28'),(590,'N3',1,'2013-10-27 07:42:28'),(591,'N1',2,'2013-10-19 08:42:28'),(592,'N2',3,'2013-10-19 09:42:28'),(593,'N3',4,'2013-10-29 10:42:28'),(594,'N1',5,'2013-10-10 13:42:28'),(595,'N2',6,'2013-10-27 14:42:28'),(596,'N3',7,'2013-10-19 15:42:28'),(597,'N1',8,'2013-10-10 16:42:28'),(598,'N2',9,'2013-10-24 17:42:28'),(599,'N3',10,'2013-10-28 18:42:28'),(600,'N1',1,'2013-10-29 19:42:28'),(601,'N2',2,'2013-10-03 20:42:28'),(602,'N3',3,'2013-10-15 21:42:28'),(603,'N1',4,'2013-10-14 22:42:28'),(604,'N2',5,'2013-10-17 23:42:28'),(605,'N3',6,'2013-10-07 00:42:28'),(606,'N1',7,'2013-10-09 01:42:28'),(607,'N2',8,'2013-10-17 02:42:28'),(608,'N3',9,'2013-10-18 03:42:28'),(609,'N1',10,'2013-10-24 04:42:28'),(610,'N2',1,'2013-10-25 05:42:28'),(611,'N3',2,'2013-10-05 06:42:28'),(612,'N1',3,'2013-10-16 07:42:28'),(613,'N2',4,'2013-10-04 08:42:28'),(614,'N3',5,'2013-10-08 09:42:28'),(615,'N1',6,'2013-10-13 10:42:28'),(616,'N2',7,'2013-10-06 13:42:28'),(617,'N3',8,'2013-10-20 14:42:28'),(618,'N1',9,'2013-10-08 15:42:28'),(619,'N2',10,'2013-10-19 16:42:28'),(620,'N3',1,'2013-10-26 17:42:28'),(621,'N1',2,'2013-10-16 18:42:28'),(622,'N2',3,'2013-10-18 19:42:28'),(623,'N3',4,'2013-10-24 20:42:28'),(624,'N1',5,'2013-10-13 21:42:28'),(625,'N2',6,'2013-10-17 22:42:28'),(626,'N3',7,'2013-10-10 23:42:28'),(627,'N1',8,'2013-10-03 00:42:28'),(628,'N2',9,'2013-10-03 01:42:28'),(629,'N3',10,'2013-10-14 02:42:28'),(630,'N1',1,'2013-10-11 03:42:28'),(631,'N2',2,'2013-10-22 04:42:28'),(632,'N3',3,'2013-10-26 05:42:28'),(633,'N1',4,'2013-10-05 06:42:28'),(634,'N2',5,'2013-10-09 07:42:28'),(635,'N3',6,'2013-10-10 08:42:28'),(636,'N1',7,'2013-10-07 09:42:28'),(637,'N2',8,'2013-10-14 10:42:28'),(638,'N3',9,'2013-10-29 13:42:28'),(639,'N1',10,'2013-10-27 14:42:28'),(640,'N2',1,'2013-10-22 15:42:28'),(641,'N3',2,'2013-10-19 16:42:28'),(642,'N1',3,'2013-10-17 17:42:28'),(643,'N2',4,'2013-10-19 18:42:28'),(644,'N3',5,'2013-10-19 19:42:28'),(645,'N1',6,'2013-10-25 20:42:28'),(646,'N2',7,'2013-10-22 21:42:28'),(647,'N3',8,'2013-10-11 22:42:28'),(648,'N1',9,'2013-10-26 23:42:28'),(649,'N2',10,'2013-10-10 00:42:28'),(650,'N3',1,'2013-10-13 01:42:28'),(651,'N1',2,'2013-10-08 02:42:28'),(652,'N2',3,'2013-10-30 03:42:28'),(653,'N3',4,'2013-10-29 04:42:28'),(654,'N1',5,'2013-10-12 05:42:28'),(655,'N2',6,'2013-10-23 06:42:28'),(656,'N3',7,'2013-10-05 07:42:28'),(657,'N1',8,'2013-10-21 08:42:28'),(658,'N2',9,'2013-10-08 09:42:28'),(659,'N3',10,'2013-10-23 10:42:28'),(660,'N1',1,'2013-10-13 13:42:28'),(661,'N2',2,'2013-10-16 14:42:28'),(662,'N3',3,'2013-10-26 15:42:28'),(663,'N1',4,'2013-10-01 16:42:28'),(664,'N2',5,'2013-10-09 17:42:28'),(665,'N3',6,'2013-10-14 18:42:28'),(666,'N1',7,'2013-10-15 19:42:28'),(667,'N2',8,'2013-10-29 20:42:28'),(668,'N3',9,'2013-10-15 21:42:28'),(669,'N1',10,'2013-10-07 22:42:28'),(670,'N2',1,'2013-10-03 23:42:28'),(671,'N3',2,'2013-10-20 00:42:28'),(672,'N1',3,'2013-10-12 01:42:28'),(673,'N2',4,'2013-10-13 02:42:28'),(674,'N3',5,'2013-10-23 03:42:28'),(675,'N1',6,'2013-10-25 04:42:28'),(676,'N2',7,'2013-10-07 05:42:28'),(677,'N3',8,'2013-10-11 06:42:28'),(678,'N1',9,'2013-10-24 07:42:28'),(679,'N2',10,'2013-10-07 08:42:28'),(680,'N3',1,'2013-10-14 09:42:28'),(681,'N1',2,'2013-10-03 10:42:28'),(682,'N2',3,'2013-10-07 13:42:28'),(683,'N3',4,'2013-10-15 14:42:28'),(684,'N1',5,'2013-10-28 15:42:28'),(685,'N2',6,'2013-10-05 16:42:28'),(686,'N3',7,'2013-10-11 17:42:28'),(687,'N1',8,'2013-10-15 18:42:28'),(688,'N2',9,'2013-10-09 19:42:28'),(689,'N3',10,'2013-10-04 20:42:28'),(690,'N1',1,'2013-10-27 21:42:28'),(691,'N2',2,'2013-10-02 22:42:28'),(692,'N3',3,'2013-10-10 23:42:28'),(693,'N1',4,'2013-10-18 00:42:28'),(694,'N2',5,'2013-10-22 01:42:28'),(695,'N3',6,'2013-10-04 02:42:28'),(696,'N1',7,'2013-10-04 03:42:28'),(697,'N2',8,'2013-10-05 04:42:28'),(698,'N3',9,'2013-10-08 05:42:28'),(699,'N1',10,'2013-10-23 06:42:28'),(700,'N2',1,'2013-10-24 07:42:28'),(701,'N3',2,'2013-10-17 08:42:28'),(702,'N1',3,'2013-10-03 09:42:28'),(703,'N2',4,'2013-10-23 10:42:28'),(704,'N3',5,'2013-10-08 13:42:28'),(705,'N1',6,'2013-10-23 14:42:28'),(706,'N2',7,'2013-10-07 15:42:28'),(707,'N3',8,'2013-10-13 16:42:28'),(708,'N1',9,'2013-10-13 17:42:28'),(709,'N2',10,'2013-10-17 18:42:28'),(710,'N3',1,'2013-10-01 19:42:28'),(711,'N1',2,'2013-10-28 20:42:28'),(712,'N2',3,'2013-10-27 21:42:28'),(713,'N3',4,'2013-10-02 22:42:28'),(714,'N1',5,'2013-10-08 23:42:28'),(715,'N2',6,'2013-10-09 00:42:28'),(716,'N3',7,'2013-10-13 01:42:28'),(717,'N1',8,'2013-10-28 02:42:28'),(718,'N2',9,'2013-10-19 03:42:28'),(719,'N3',10,'2013-10-24 04:42:28'),(720,'N1',1,'2013-10-12 05:42:28'),(721,'N2',2,'2013-10-22 06:42:28'),(722,'N3',3,'2013-10-14 07:42:28'),(723,'N1',4,'2013-10-09 08:42:28'),(724,'N2',5,'2013-10-09 09:42:28'),(725,'N3',6,'2013-10-30 10:42:28'),(726,'N1',7,'2013-10-15 13:42:28'),(727,'N2',8,'2013-10-23 14:42:28'),(728,'N3',9,'2013-10-14 15:42:28'),(729,'N1',10,'2013-10-22 16:42:28'),(730,'N2',1,'2013-10-12 17:42:28'),(731,'N3',2,'2013-10-02 18:42:28'),(732,'N1',3,'2013-10-18 19:42:28'),(733,'N2',4,'2013-10-20 20:42:28'),(734,'N3',5,'2013-10-05 21:42:28'),(735,'N1',6,'2013-10-10 22:42:28'),(736,'N2',7,'2013-10-21 23:42:28'),(737,'N3',8,'2013-10-08 00:42:28'),(738,'N1',9,'2013-10-02 01:42:28'),(739,'N2',10,'2013-10-23 02:42:28'),(740,'N3',1,'2013-10-24 03:42:28'),(741,'N1',2,'2013-10-27 04:42:28'),(742,'N2',3,'2013-10-05 05:42:28'),(743,'N3',4,'2013-10-29 06:42:28'),(744,'N1',5,'2013-10-21 07:42:28'),(745,'N2',6,'2013-10-05 08:42:28'),(746,'N3',7,'2013-10-12 09:42:28'),(747,'N1',8,'2013-10-22 10:42:28'),(748,'N2',9,'2013-10-13 13:42:28'),(749,'N3',10,'2013-10-05 14:42:28'),(750,'N1',1,'2013-10-25 15:42:28'),(751,'N2',2,'2013-10-21 16:42:28'),(752,'N3',3,'2013-10-01 17:42:28'),(753,'N1',4,'2013-10-16 18:42:28'),(754,'N2',5,'2013-10-24 19:42:28'),(755,'N3',6,'2013-10-25 20:42:28'),(756,'N1',7,'2013-10-03 21:42:28'),(757,'N2',8,'2013-10-23 22:42:28'),(758,'N3',9,'2013-10-09 23:42:28'),(759,'N1',10,'2013-10-29 00:42:28'),(760,'N2',1,'2013-10-30 01:42:28'),(761,'N3',2,'2013-10-11 02:42:28'),(762,'N1',3,'2013-10-26 03:42:28'),(763,'N2',4,'2013-10-13 04:42:28'),(764,'N3',5,'2013-10-05 05:42:28'),(765,'N1',6,'2013-10-23 06:42:28'),(766,'N2',7,'2013-10-13 07:42:28'),(767,'N3',8,'2013-10-18 08:42:28'),(768,'N1',9,'2013-10-12 09:42:28'),(769,'N2',10,'2013-10-17 10:42:28'),(770,'N3',1,'2013-10-29 13:42:28'),(771,'N1',2,'2013-10-13 14:42:28'),(772,'N2',3,'2013-10-05 15:42:28'),(773,'N3',4,'2013-10-01 16:42:28'),(774,'N1',5,'2013-10-15 17:42:28'),(775,'N2',6,'2013-10-23 18:42:28'),(776,'N3',7,'2013-10-16 19:42:28'),(777,'N1',8,'2013-10-23 20:42:28'),(778,'N2',9,'2013-10-26 21:42:28'),(779,'N3',10,'2013-10-29 22:42:28'),(780,'N1',1,'2013-10-02 23:42:28'),(781,'N2',2,'2013-10-30 00:42:28'),(782,'N3',3,'2013-10-19 01:42:28'),(783,'N1',4,'2013-10-17 02:42:28'),(784,'N2',5,'2013-10-12 03:42:28'),(785,'N3',6,'2013-10-12 04:42:28'),(786,'N1',7,'2013-10-07 05:42:28'),(787,'N2',8,'2013-10-20 06:42:28'),(788,'N3',9,'2013-10-15 07:42:28'),(789,'N1',10,'2013-10-22 08:42:28'),(790,'N2',1,'2013-10-17 09:42:28'),(791,'N3',2,'2013-10-04 10:42:28'),(792,'N1',3,'2013-10-18 13:42:28'),(793,'N2',4,'2013-10-10 14:42:28'),(794,'N3',5,'2013-10-12 15:42:28'),(795,'N1',6,'2013-10-26 16:42:28'),(796,'N2',7,'2013-10-25 17:42:28'),(797,'N3',8,'2013-10-21 18:42:28'),(798,'N1',9,'2013-10-18 19:42:28'),(799,'N2',10,'2013-10-25 20:42:28'),(800,'N3',1,'2013-10-10 21:42:28'),(801,'N1',2,'2013-10-07 22:42:28'),(802,'N2',3,'2013-10-09 23:42:28'),(803,'N3',4,'2013-10-07 00:42:28'),(804,'N1',5,'2013-10-19 01:42:28'),(805,'N2',6,'2013-10-15 02:42:28'),(806,'N3',7,'2013-10-24 03:42:28'),(807,'N1',8,'2013-10-11 04:42:28'),(808,'N2',9,'2013-10-22 05:42:28'),(809,'N3',10,'2013-10-08 06:42:28'),(810,'N1',1,'2013-10-23 07:42:28'),(811,'N2',2,'2013-10-08 08:42:28'),(812,'N3',3,'2013-10-24 09:42:28'),(813,'N1',4,'2013-10-12 10:42:28'),(814,'N2',5,'2013-10-15 13:42:28'),(815,'N3',6,'2013-10-07 14:42:28'),(816,'N1',7,'2013-10-01 15:42:28'),(817,'N2',8,'2013-10-12 16:42:28'),(818,'N3',9,'2013-10-04 17:42:28'),(819,'N1',10,'2013-10-14 18:42:28'),(820,'N2',1,'2013-10-17 19:42:28'),(821,'N3',2,'2013-10-27 20:42:28'),(822,'N1',3,'2013-10-16 21:42:28'),(823,'N2',4,'2013-10-25 22:42:28'),(824,'N3',5,'2013-10-29 23:42:28'),(825,'N1',6,'2013-10-29 00:42:28'),(826,'N2',7,'2013-10-11 01:42:28'),(827,'N3',8,'2013-10-16 02:42:28'),(828,'N1',9,'2013-10-04 03:42:28'),(829,'N2',10,'2013-10-09 04:42:28'),(830,'N3',1,'2013-10-04 05:42:28'),(831,'N1',2,'2013-10-28 06:42:28'),(832,'N2',3,'2013-10-11 07:42:28'),(833,'N3',4,'2013-10-15 08:42:28'),(834,'N1',5,'2013-10-25 09:42:28'),(835,'N2',6,'2013-10-06 10:42:28'),(836,'N3',7,'2013-10-06 13:42:28'),(837,'N1',8,'2013-10-06 14:42:28'),(838,'N2',9,'2013-10-05 15:42:28'),(839,'N3',10,'2013-10-14 16:42:28'),(840,'N1',1,'2013-10-10 17:42:28'),(841,'N2',2,'2013-10-02 18:42:28'),(842,'N3',3,'2013-10-08 19:42:28'),(843,'N1',4,'2013-10-24 20:42:28'),(844,'N2',5,'2013-10-19 21:42:28'),(845,'N3',6,'2013-10-19 22:42:28'),(846,'N1',7,'2013-10-25 23:42:28'),(847,'N2',8,'2013-10-21 00:42:28'),(848,'N3',9,'2013-10-18 01:42:28'),(849,'N1',10,'2013-10-14 02:42:28'),(850,'N2',1,'2013-10-07 03:42:28'),(851,'N3',2,'2013-10-26 04:42:28'),(852,'N1',3,'2013-10-04 05:42:28'),(853,'N2',4,'2013-10-23 06:42:28'),(854,'N3',5,'2013-10-04 07:42:28'),(855,'N1',6,'2013-10-12 08:42:28'),(856,'N2',7,'2013-10-25 09:42:28'),(857,'N3',8,'2013-10-24 10:42:28'),(858,'N1',9,'2013-10-02 13:42:28'),(859,'N2',10,'2013-10-11 14:42:28'),(860,'N3',1,'2013-10-13 15:42:28'),(861,'N1',2,'2013-10-09 16:42:28'),(862,'N2',3,'2013-10-03 17:42:28'),(863,'N3',4,'2013-10-24 18:42:28'),(864,'N1',5,'2013-10-17 19:42:28'),(865,'N2',6,'2013-10-11 20:42:28'),(866,'N3',7,'2013-10-25 21:42:28'),(867,'N1',8,'2013-10-29 22:42:28'),(868,'N2',9,'2013-10-01 23:42:28'),(869,'N3',10,'2013-10-17 00:42:28'),(870,'N1',1,'2013-10-07 01:42:28'),(871,'N2',2,'2013-10-12 02:42:28'),(872,'N3',3,'2013-10-29 03:42:28'),(873,'N1',4,'2013-10-23 04:42:28'),(874,'N2',5,'2013-10-20 05:42:28'),(875,'N3',6,'2013-10-21 06:42:28'),(876,'N1',7,'2013-10-14 07:42:28'),(877,'N2',8,'2013-10-22 08:42:28'),(878,'N3',9,'2013-10-13 09:42:28'),(879,'N1',10,'2013-10-17 10:42:28'),(880,'N2',1,'2013-10-13 13:42:28'),(881,'N3',2,'2013-10-27 14:42:28'),(882,'N1',3,'2013-10-27 15:42:28'),(883,'N2',4,'2013-10-01 16:42:28'),(884,'N3',5,'2013-10-15 17:42:28'),(885,'N1',6,'2013-10-17 18:42:28'),(886,'N2',7,'2013-10-12 19:42:28'),(887,'N3',8,'2013-10-12 20:42:28'),(888,'N1',9,'2013-10-25 21:42:28'),(889,'N2',10,'2013-10-14 22:42:28'),(890,'N3',1,'2013-10-29 23:42:28'),(891,'N1',2,'2013-10-08 00:42:28'),(892,'N2',3,'2013-10-20 01:42:28'),(893,'N3',4,'2013-10-18 02:42:28'),(894,'N1',5,'2013-10-29 03:42:28'),(895,'N2',6,'2013-10-11 04:42:28'),(896,'N3',7,'2013-10-11 05:42:28'),(897,'N1',8,'2013-10-06 06:42:28'),(898,'N2',9,'2013-10-04 07:42:28'),(899,'N3',10,'2013-10-27 08:42:28'),(900,'N1',1,'2013-10-25 09:42:28'),(901,'N2',2,'2013-10-13 10:42:28'),(902,'N3',3,'2013-10-28 13:42:28'),(903,'N1',4,'2013-10-23 14:42:28'),(904,'N2',5,'2013-10-20 15:42:28'),(905,'N3',6,'2013-10-21 16:42:28'),(906,'N1',7,'2013-10-08 17:42:28'),(907,'N2',8,'2013-10-07 18:42:28'),(908,'N3',9,'2013-10-29 19:42:28'),(909,'N1',10,'2013-10-01 20:42:28'),(910,'N2',1,'2013-10-15 21:42:28'),(911,'N3',2,'2013-10-08 22:42:28'),(912,'N1',3,'2013-10-18 23:42:28'),(913,'N2',4,'2013-10-16 00:42:28'),(914,'N3',5,'2013-10-24 01:42:28'),(915,'N1',6,'2013-10-10 02:42:28'),(916,'N2',7,'2013-10-17 03:42:28'),(917,'N3',8,'2013-10-11 04:42:28'),(918,'N1',9,'2013-10-03 05:42:28'),(919,'N2',10,'2013-10-30 06:42:28'),(920,'N3',1,'2013-10-23 07:42:28'),(921,'N1',2,'2013-10-28 08:42:28'),(922,'N2',3,'2013-10-22 09:42:28'),(923,'N3',4,'2013-10-14 10:42:28'),(924,'N1',5,'2013-10-17 13:42:28'),(925,'N2',6,'2013-10-11 14:42:28'),(926,'N3',7,'2013-10-03 15:42:28'),(927,'N1',8,'2013-10-17 16:42:28'),(928,'N2',9,'2013-10-05 17:42:28'),(929,'N3',10,'2013-10-25 18:42:28'),(930,'N1',1,'2013-10-26 19:42:28'),(931,'N2',2,'2013-10-01 20:42:28'),(932,'N3',3,'2013-10-08 21:42:28'),(933,'N1',4,'2013-10-17 22:42:28'),(934,'N2',5,'2013-10-01 23:42:28'),(935,'N3',6,'2013-10-27 00:42:28'),(936,'N1',7,'2013-10-03 01:42:28'),(937,'N2',8,'2013-10-13 02:42:28'),(938,'N3',9,'2013-10-25 03:42:28'),(939,'N1',10,'2013-10-02 04:42:28'),(940,'N2',1,'2013-10-29 05:42:28'),(941,'N3',2,'2013-10-11 06:42:28'),(942,'N1',3,'2013-10-12 07:42:28'),(943,'N2',4,'2013-10-09 08:42:28'),(944,'N3',5,'2013-10-02 09:42:28'),(945,'N1',6,'2013-10-26 10:42:28'),(946,'N2',7,'2013-10-19 13:42:28'),(947,'N3',8,'2013-10-12 14:42:28'),(948,'N1',9,'2013-10-26 15:42:28'),(949,'N2',10,'2013-10-26 16:42:28'),(950,'N3',1,'2013-10-18 17:42:28'),(951,'N1',2,'2013-10-04 18:42:28'),(952,'N2',3,'2013-10-12 19:42:28'),(953,'N3',4,'2013-10-17 20:42:28'),(954,'N1',5,'2013-10-12 21:42:28'),(955,'N2',6,'2013-10-29 22:42:28'),(956,'N3',7,'2013-10-19 23:42:28'),(957,'N1',8,'2013-10-22 00:42:28'),(958,'N2',9,'2013-10-21 01:42:28'),(959,'N3',10,'2013-10-28 02:42:28'),(960,'N1',1,'2013-10-08 03:42:28'),(961,'N2',2,'2013-10-09 04:42:28'),(962,'N3',3,'2013-10-23 05:42:28'),(963,'N1',4,'2013-10-07 06:42:28'),(964,'N2',5,'2013-10-04 07:42:28'),(965,'N3',6,'2013-10-14 08:42:28'),(966,'N1',7,'2013-10-08 09:42:28'),(967,'N2',8,'2013-10-03 10:42:28'),(968,'N3',9,'2013-10-22 13:42:28'),(969,'N1',10,'2013-10-25 14:42:28'),(970,'N2',1,'2013-10-27 15:42:28'),(971,'N3',2,'2013-10-06 16:42:28'),(972,'N1',3,'2013-10-19 17:42:28'),(973,'N2',4,'2013-10-28 18:42:28'),(974,'N3',5,'2013-10-21 19:42:28'),(975,'N1',6,'2013-10-12 20:42:28'),(976,'N2',7,'2013-10-29 21:42:28'),(977,'N3',8,'2013-10-18 22:42:28'),(978,'N1',9,'2013-10-07 23:42:28'),(979,'N2',10,'2013-10-14 00:42:28'),(980,'N3',1,'2013-10-10 01:42:28'),(981,'N1',2,'2013-10-27 02:42:28'),(982,'N2',3,'2013-10-05 03:42:28'),(983,'N3',4,'2013-10-27 04:42:28'),(984,'N1',5,'2013-10-16 05:42:28'),(985,'N2',6,'2013-10-27 06:42:28'),(986,'N3',7,'2013-10-17 07:42:28'),(987,'N1',8,'2013-10-24 08:42:28'),(988,'N2',9,'2013-10-06 09:42:28'),(989,'N3',10,'2013-10-22 10:42:28'),(990,'N1',1,'2013-10-04 13:42:28'),(991,'N2',2,'2013-10-26 14:42:28'),(992,'N3',3,'2013-10-27 15:42:28'),(993,'N1',4,'2013-10-28 16:42:28'),(994,'N2',5,'2013-10-28 17:42:28'),(995,'N3',6,'2013-10-21 18:42:28'),(996,'N1',7,'2013-10-03 19:42:28'),(997,'N2',8,'2013-10-26 20:42:28'),(998,'N3',9,'2013-10-10 21:42:28'),(999,'N1',10,'2013-10-05 22:42:28'),(1000,'N2',1,'2013-10-27 23:42:28'),(1001,'N3',2,'2013-10-07 00:42:28'),(1002,'N1',3,'2013-10-25 01:42:28'),(1003,'N2',4,'2013-10-27 02:42:28'),(1004,'N3',5,'2013-10-13 03:42:28'),(1005,'N1',6,'2013-10-13 04:42:28'),(1006,'N2',7,'2013-10-15 05:42:28'),(1007,'N3',8,'2013-10-23 06:42:28'),(1008,'N1',9,'2013-10-26 07:42:28'),(1009,'N2',10,'2013-10-21 08:42:28'),(1010,'N3',1,'2013-10-05 09:42:28'),(1011,'N1',2,'2013-10-21 10:42:28'),(1012,'N2',3,'2013-10-22 13:42:28'),(1013,'N3',4,'2013-10-21 14:42:28'),(1014,'N1',5,'2013-10-29 15:42:28'),(1015,'N2',6,'2013-10-22 16:42:28'),(1016,'N3',7,'2013-10-08 17:42:28'),(1017,'N1',8,'2013-10-07 18:42:28'),(1018,'N2',9,'2013-10-22 19:42:28'),(1019,'N3',10,'2013-10-07 20:42:28'),(1020,'N1',1,'2013-10-16 21:42:28'),(1021,'N2',2,'2013-10-03 22:42:28'),(1022,'N3',3,'2013-10-06 23:42:28'),(1023,'N1',4,'2013-10-26 00:42:28'),(1024,'N2',5,'2013-10-18 01:42:28'),(1025,'N3',6,'2013-10-21 02:42:28'),(1026,'N1',7,'2013-10-20 03:42:28'),(1027,'N2',8,'2013-10-17 04:42:28'),(1028,'N3',9,'2013-10-16 05:42:28'),(1029,'N1',10,'2013-10-14 06:42:28'),(1030,'N2',1,'2013-10-29 07:42:28'),(1031,'N3',2,'2013-10-27 08:42:28'),(1032,'N1',3,'2013-10-10 09:42:28'),(1033,'N2',4,'2013-10-25 10:42:28'),(1034,'N3',5,'2013-10-17 13:42:28'),(1035,'N1',6,'2013-10-23 14:42:28'),(1036,'N2',7,'2013-10-24 15:42:28'),(1037,'N3',8,'2013-10-27 16:42:28'),(1038,'N1',9,'2013-10-28 17:42:28'),(1039,'N2',10,'2013-10-18 18:42:28'),(1040,'N3',1,'2013-10-01 19:42:28'),(1041,'N1',2,'2013-10-18 20:42:28'),(1042,'N2',3,'2013-10-26 21:42:28'),(1043,'N3',4,'2013-10-03 22:42:28'),(1044,'N1',5,'2013-10-27 23:42:28'),(1045,'N2',6,'2013-10-29 00:42:28'),(1046,'N3',7,'2013-10-06 01:42:28'),(1047,'N1',8,'2013-10-02 02:42:28'),(1048,'N2',9,'2013-10-14 03:42:28'),(1049,'N3',10,'2013-10-02 04:42:28'),(1050,'N1',1,'2013-10-02 05:42:28'),(1051,'N2',2,'2013-10-06 06:42:28'),(1052,'N3',3,'2013-10-22 07:42:28'),(1053,'N1',4,'2013-10-05 08:42:28'),(1054,'N2',5,'2013-10-03 09:42:28'),(1055,'N3',6,'2013-10-10 10:42:28'),(1056,'N1',7,'2013-10-20 13:42:28'),(1057,'N2',8,'2013-10-03 14:42:28'),(1058,'N3',9,'2013-10-29 15:42:28'),(1059,'N1',10,'2013-10-20 16:42:28'),(1060,'N2',1,'2013-10-20 17:42:28'),(1061,'N3',2,'2013-10-23 18:42:28'),(1062,'N1',3,'2013-10-01 19:42:28'),(1063,'N2',4,'2013-10-13 20:42:28'),(1064,'N3',5,'2013-10-07 21:42:28'),(1065,'N1',6,'2013-10-12 22:42:28'),(1066,'N2',7,'2013-10-07 23:42:28'),(1067,'N3',8,'2013-10-10 00:42:28'),(1068,'N1',9,'2013-10-15 01:42:28'),(1069,'N2',10,'2013-10-16 02:42:28'),(1070,'N3',1,'2013-10-05 03:42:28'),(1071,'N1',2,'2013-10-19 04:42:28'),(1072,'N2',3,'2013-10-06 05:42:28'),(1073,'N3',4,'2013-10-16 06:42:28'),(1074,'N1',5,'2013-10-08 07:42:28'),(1075,'N2',6,'2013-10-20 08:42:28'),(1076,'N3',7,'2013-10-29 09:42:28'),(1077,'N1',8,'2013-10-22 10:42:28'),(1078,'N2',9,'2013-10-17 13:42:28'),(1079,'N3',10,'2013-10-24 14:42:28'),(1080,'N1',1,'2013-10-18 15:42:28'),(1081,'N2',2,'2013-10-24 16:42:28'),(1082,'N3',3,'2013-10-04 17:42:28'),(1083,'N1',4,'2013-10-24 18:42:28'),(1084,'N2',5,'2013-10-07 19:42:28'),(1085,'N3',6,'2013-10-18 20:42:28'),(1086,'N1',7,'2013-10-26 21:42:28'),(1087,'N2',8,'2013-10-01 22:42:28'),(1088,'N3',9,'2013-10-04 23:42:28'),(1089,'N1',10,'2013-10-16 00:42:28'),(1090,'N2',1,'2013-10-23 01:42:28'),(1091,'N3',2,'2013-10-25 02:42:28'),(1092,'N1',3,'2013-10-27 03:42:28'),(1093,'N2',4,'2013-10-06 04:42:28'),(1094,'N3',5,'2013-10-02 05:42:28'),(1095,'N1',6,'2013-10-16 06:42:28'),(1096,'N2',7,'2013-10-08 07:42:28'),(1097,'N3',8,'2013-10-12 08:42:28'),(1098,'N1',9,'2013-10-13 09:42:28'),(1099,'N2',10,'2013-10-18 10:42:28'),(1100,'N3',1,'2013-10-29 13:42:28'),(1101,'N1',2,'2013-10-05 14:42:28'),(1102,'N2',3,'2013-10-06 15:42:28'),(1103,'N3',4,'2013-10-13 16:42:28'),(1104,'N1',5,'2013-10-16 17:42:28'),(1105,'N2',6,'2013-10-28 18:42:28'),(1106,'N3',7,'2013-10-23 19:42:28'),(1107,'N1',8,'2013-10-07 20:42:28'),(1108,'N2',9,'2013-10-16 21:42:28'),(1109,'N3',10,'2013-10-13 22:42:28'),(1110,'N1',1,'2013-10-18 23:42:28'),(1111,'N2',2,'2013-10-28 00:42:28'),(1112,'N3',3,'2013-10-24 01:42:28'),(1113,'N1',4,'2013-10-03 02:42:28'),(1114,'N2',5,'2013-10-06 03:42:28'),(1115,'N3',6,'2013-10-06 04:42:28'),(1116,'N1',7,'2013-10-02 05:42:28'),(1117,'N2',8,'2013-10-11 06:42:28'),(1118,'N3',9,'2013-10-13 07:42:28'),(1119,'N1',10,'2013-10-26 08:42:28'),(1120,'N2',1,'2013-10-27 09:42:28'),(1121,'N3',2,'2013-10-02 10:42:28'),(1122,'N1',3,'2013-10-26 13:42:28'),(1123,'N2',4,'2013-10-05 14:42:28'),(1124,'N3',5,'2013-10-12 15:42:28'),(1125,'N1',6,'2013-10-17 16:42:28'),(1126,'N2',7,'2013-10-29 17:42:28'),(1127,'N3',8,'2013-10-12 18:42:28'),(1128,'N1',9,'2013-10-13 19:42:28'),(1129,'N2',10,'2013-10-19 20:42:28'),(1130,'N3',1,'2013-10-29 21:42:28'),(1131,'N1',2,'2013-10-04 22:42:28'),(1132,'N2',3,'2013-10-01 23:42:28'),(1133,'N3',4,'2013-10-11 00:42:28'),(1134,'N1',5,'2013-10-15 01:42:28'),(1135,'N2',6,'2013-10-09 02:42:28'),(1136,'N3',7,'2013-10-30 03:42:28'),(1137,'N1',8,'2013-10-08 04:42:28'),(1138,'N2',9,'2013-10-25 05:42:28'),(1139,'N3',10,'2013-10-15 06:42:28'),(1140,'N1',1,'2013-10-02 07:42:28'),(1141,'N2',2,'2013-10-05 08:42:28'),(1142,'N3',3,'2013-10-05 09:42:28'),(1143,'N1',4,'2013-10-08 10:42:28'),(1144,'N2',5,'2013-10-01 13:42:28'),(1145,'N3',6,'2013-10-26 14:42:28'),(1146,'N1',7,'2013-10-21 15:42:28'),(1147,'N2',8,'2013-10-16 16:42:28'),(1148,'N3',9,'2013-10-26 17:42:28'),(1149,'N1',10,'2013-10-18 18:42:28'),(1150,'N2',1,'2013-10-27 19:42:28'),(1151,'N3',2,'2013-10-13 20:42:28'),(1152,'N1',3,'2013-10-22 21:42:28'),(1153,'N2',4,'2013-10-29 22:42:28'),(1154,'N3',5,'2013-10-16 23:42:28'),(1155,'N1',6,'2013-10-23 00:42:28'),(1156,'N2',7,'2013-10-02 01:42:28'),(1157,'N3',8,'2013-10-23 02:42:28'),(1158,'N1',9,'2013-10-14 03:42:28'),(1159,'N2',10,'2013-10-14 04:42:28'),(1160,'N3',1,'2013-10-19 05:42:28'),(1161,'N1',2,'2013-10-16 06:42:28'),(1162,'N2',3,'2013-10-14 07:42:28'),(1163,'N3',4,'2013-10-11 08:42:28'),(1164,'N1',5,'2013-10-27 09:42:28'),(1165,'N2',6,'2013-10-20 10:42:28'),(1166,'N3',7,'2013-10-10 13:42:28'),(1167,'N1',8,'2013-10-01 14:42:28'),(1168,'N2',9,'2013-10-18 15:42:28'),(1169,'N3',10,'2013-10-26 16:42:28'),(1170,'N1',1,'2013-10-16 17:42:28'),(1171,'N2',2,'2013-10-08 18:42:28'),(1172,'N3',3,'2013-10-27 19:42:28'),(1173,'N1',4,'2013-10-12 20:42:28'),(1174,'N2',5,'2013-10-17 21:42:28'),(1175,'N3',6,'2013-10-08 22:42:28'),(1176,'N1',7,'2013-10-19 23:42:28'),(1177,'N2',8,'2013-10-05 00:42:28'),(1178,'N3',9,'2013-10-22 01:42:28'),(1179,'N1',10,'2013-10-15 02:42:28'),(1180,'N2',1,'2013-10-29 03:42:28'),(1181,'N3',2,'2013-10-05 04:42:28'),(1182,'N1',3,'2013-10-17 05:42:28'),(1183,'N2',4,'2013-10-15 06:42:28'),(1184,'N3',5,'2013-10-17 07:42:28'),(1185,'N1',6,'2013-10-18 08:42:28'),(1186,'N2',7,'2013-10-15 09:42:28'),(1187,'N3',8,'2013-10-19 10:42:28'),(1188,'N1',9,'2013-10-16 13:42:28'),(1189,'N2',10,'2013-10-17 14:42:28'),(1190,'N3',1,'2013-10-16 15:42:28'),(1191,'N1',2,'2013-10-21 16:42:28'),(1192,'N2',3,'2013-10-11 17:42:28'),(1193,'N3',4,'2013-10-27 18:42:28'),(1194,'N1',5,'2013-10-21 19:42:28'),(1195,'N2',6,'2013-10-17 20:42:28'),(1196,'N3',7,'2013-10-01 21:42:28'),(1197,'N1',8,'2013-10-26 22:42:28'),(1198,'N2',9,'2013-10-20 23:42:28'),(1199,'N3',10,'2013-10-13 00:42:28'),(1200,'N1',1,'2013-10-06 01:42:28'),(1201,'N2',2,'2013-10-14 02:42:28'),(1202,'N3',3,'2013-10-08 03:42:28'),(1203,'N1',4,'2013-10-03 04:42:28'),(1204,'N2',5,'2013-10-23 05:42:28'),(1205,'N3',6,'2013-10-05 06:42:28'),(1206,'N1',7,'2013-10-09 07:42:28'),(1207,'N2',8,'2013-10-26 08:42:28'),(1208,'N3',9,'2013-10-09 09:42:28'),(1209,'N1',10,'2013-10-17 10:42:28'),(1210,'N2',1,'2013-10-06 13:42:28'),(1211,'N3',2,'2013-10-22 14:42:28'),(1212,'N1',3,'2013-10-17 15:42:28'),(1213,'N2',4,'2013-10-03 16:42:28'),(1214,'N3',5,'2013-10-16 17:42:28'),(1215,'N1',6,'2013-10-25 18:42:28'),(1216,'N2',7,'2013-10-08 19:42:28'),(1217,'N3',8,'2013-10-20 20:42:28'),(1218,'N1',9,'2013-10-06 21:42:28'),(1219,'N2',10,'2013-10-17 22:42:28'),(1220,'N3',1,'2013-10-19 23:42:28'),(1221,'N1',2,'2013-10-27 00:42:28'),(1222,'N2',3,'2013-10-22 01:42:28'),(1223,'N3',4,'2013-10-29 02:42:28'),(1224,'N1',5,'2013-10-13 03:42:28'),(1225,'N2',6,'2013-10-22 04:42:28'),(1226,'N3',7,'2013-10-03 05:42:28'),(1227,'N1',8,'2013-10-11 06:42:28'),(1228,'N2',9,'2013-10-06 07:42:28'),(1229,'N3',10,'2013-10-07 08:42:28'),(1230,'N1',1,'2013-10-11 09:42:28'),(1231,'N2',2,'2013-10-17 10:42:28'),(1232,'N3',3,'2013-10-12 13:42:28'),(1233,'N1',4,'2013-10-11 14:42:28'),(1234,'N2',5,'2013-10-28 15:42:28'),(1235,'N3',6,'2013-10-22 16:42:28'),(1236,'N1',7,'2013-10-28 17:42:28'),(1237,'N2',8,'2013-10-07 18:42:28'),(1238,'N3',9,'2013-10-06 19:42:28'),(1239,'N1',10,'2013-10-11 20:42:28'),(1240,'N2',1,'2013-10-18 21:42:28'),(1241,'N3',2,'2013-10-19 22:42:28'),(1242,'N1',3,'2013-10-17 23:42:28'),(1243,'N2',4,'2013-10-22 00:42:28'),(1244,'N3',5,'2013-10-09 01:42:28'),(1245,'N1',6,'2013-10-13 02:42:28'),(1246,'N2',7,'2013-10-05 03:42:28'),(1247,'N3',8,'2013-10-16 04:42:28'),(1248,'N1',9,'2013-10-28 05:42:28'),(1249,'N2',10,'2013-10-30 06:42:28'),(1250,'N3',1,'2013-10-02 07:42:28'),(1251,'N1',2,'2013-10-06 08:42:28'),(1252,'N2',3,'2013-10-05 09:42:28'),(1253,'N3',4,'2013-10-07 10:42:28'),(1254,'N1',5,'2013-10-13 13:42:28'),(1255,'N2',6,'2013-10-18 14:42:28'),(1256,'N3',7,'2013-10-07 15:42:28'),(1257,'N1',8,'2013-10-17 16:42:28'),(1258,'N2',9,'2013-10-24 17:42:28'),(1259,'N3',10,'2013-10-22 18:42:28'),(1260,'N1',1,'2013-10-08 19:42:28'),(1261,'N2',2,'2013-10-15 20:42:28'),(1262,'N3',3,'2013-10-02 21:42:28'),(1263,'N1',4,'2013-10-18 22:42:28'),(1264,'N2',5,'2013-10-27 23:42:28'),(1265,'N3',6,'2013-10-16 00:42:28'),(1266,'N1',7,'2013-10-13 01:42:28'),(1267,'N2',8,'2013-10-21 02:42:28'),(1268,'N3',9,'2013-10-08 03:42:28'),(1269,'N1',10,'2013-10-20 04:42:28'),(1270,'N2',1,'2013-10-24 05:42:28'),(1271,'N3',2,'2013-10-26 06:42:28'),(1272,'N1',3,'2013-10-02 07:42:28'),(1273,'N2',4,'2013-10-07 08:42:28'),(1274,'N3',5,'2013-10-29 09:42:28'),(1275,'N1',6,'2013-10-26 10:42:28'),(1276,'N2',7,'2013-10-05 13:42:28'),(1277,'N3',8,'2013-10-14 14:42:28'),(1278,'N1',9,'2013-10-10 15:42:28'),(1279,'N2',10,'2013-10-05 16:42:28'),(1280,'N3',1,'2013-10-03 17:42:28'),(1281,'N1',2,'2013-10-12 18:42:28'),(1282,'N2',3,'2013-10-26 19:42:28'),(1283,'N3',4,'2013-10-16 20:42:28'),(1284,'N1',5,'2013-10-02 21:42:28'),(1285,'N2',6,'2013-10-28 22:42:28'),(1286,'N3',7,'2013-10-03 23:42:28'),(1287,'N1',8,'2013-10-17 00:42:28'),(1288,'N2',9,'2013-10-04 01:42:28'),(1289,'N3',10,'2013-10-25 02:42:28'),(1290,'N1',1,'2013-10-07 03:42:28'),(1291,'N2',2,'2013-10-07 04:42:28'),(1292,'N3',3,'2013-10-05 05:42:28'),(1293,'N1',4,'2013-10-12 06:42:28'),(1294,'N2',5,'2013-10-17 07:42:28'),(1295,'N3',6,'2013-10-26 08:42:28'),(1296,'N1',7,'2013-10-29 09:42:28'),(1297,'N2',8,'2013-10-08 10:42:28'),(1298,'N3',9,'2013-10-02 13:42:28'),(1299,'N1',10,'2013-10-25 14:42:28'),(1300,'N2',1,'2013-10-23 15:42:28'),(1301,'N3',2,'2013-10-20 16:42:28'),(1302,'N1',3,'2013-10-01 17:42:28'),(1303,'N2',4,'2013-10-21 18:42:28'),(1304,'N3',5,'2013-10-20 19:42:28'),(1305,'N1',6,'2013-10-16 20:42:28'),(1306,'N2',7,'2013-10-29 21:42:28'),(1307,'N3',8,'2013-10-21 22:42:28'),(1308,'N1',9,'2013-10-13 23:42:28'),(1309,'N2',10,'2013-10-30 00:42:28'),(1310,'N3',1,'2013-10-08 01:42:28'),(1311,'N1',2,'2013-10-13 02:42:28'),(1312,'N2',3,'2013-10-10 03:42:28'),(1313,'N3',4,'2013-10-22 04:42:28'),(1314,'N1',5,'2013-10-16 05:42:28'),(1315,'N2',6,'2013-10-07 06:42:28'),(1316,'N3',7,'2013-10-20 07:42:28'),(1317,'N1',8,'2013-10-27 08:42:28'),(1318,'N2',9,'2013-10-14 09:42:28'),(1319,'N3',10,'2013-10-12 10:42:28'),(1320,'N1',1,'2013-10-03 13:42:28'),(1321,'N2',2,'2013-10-15 14:42:28'),(1322,'N3',3,'2013-10-27 15:42:28'),(1323,'N1',4,'2013-10-09 16:42:28'),(1324,'N2',5,'2013-10-02 17:42:28'),(1325,'N3',6,'2013-10-25 18:42:28'),(1326,'N1',7,'2013-10-19 19:42:28'),(1327,'N2',8,'2013-10-24 20:42:28'),(1328,'N3',9,'2013-10-23 21:42:28'),(1329,'N1',10,'2013-10-18 22:42:28'),(1330,'N2',1,'2013-10-11 23:42:28'),(1331,'N3',2,'2013-10-17 00:42:28'),(1332,'N1',3,'2013-10-14 01:42:28'),(1333,'N2',4,'2013-10-14 02:42:28'),(1334,'N3',5,'2013-10-27 03:42:28'),(1335,'N1',6,'2013-10-13 04:42:28'),(1336,'N2',7,'2013-10-22 05:42:28'),(1337,'N3',8,'2013-10-23 06:42:28'),(1338,'N1',9,'2013-10-14 07:42:28'),(1339,'N2',10,'2013-10-25 08:42:28'),(1340,'N3',1,'2013-10-05 09:42:28'),(1341,'N1',2,'2013-10-28 10:42:28'),(1342,'N2',3,'2013-10-13 13:42:28'),(1343,'N3',4,'2013-10-04 14:42:28'),(1344,'N1',5,'2013-10-03 15:42:28'),(1345,'N2',6,'2013-10-10 16:42:28'),(1346,'N3',7,'2013-10-02 17:42:28'),(1347,'N1',8,'2013-10-10 18:42:28'),(1348,'N2',9,'2013-10-28 19:42:28'),(1349,'N3',10,'2013-10-22 20:42:28'),(1350,'N1',1,'2013-10-26 21:42:28'),(1351,'N2',2,'2013-10-19 22:42:28'),(1352,'N3',3,'2013-10-19 23:42:28'),(1353,'N1',4,'2013-10-04 00:42:28'),(1354,'N2',5,'2013-10-17 01:42:28'),(1355,'N3',6,'2013-10-05 02:42:28'),(1356,'N1',7,'2013-10-21 03:42:28'),(1357,'N2',8,'2013-10-21 04:42:28'),(1358,'N3',9,'2013-10-03 05:42:28'),(1359,'N1',10,'2013-10-26 06:42:28'),(1360,'N2',1,'2013-10-30 07:42:28'),(1361,'N3',2,'2013-10-03 08:42:28'),(1362,'N1',3,'2013-10-17 09:42:28'),(1363,'N2',4,'2013-10-28 10:42:28'),(1364,'N3',5,'2013-10-08 13:42:28'),(1365,'N1',6,'2013-10-23 14:42:28'),(1366,'N2',7,'2013-10-01 15:42:28'),(1367,'N3',8,'2013-10-16 16:42:28'),(1368,'N1',9,'2013-10-26 17:42:28'),(1369,'N2',10,'2013-10-06 18:42:28'),(1370,'N3',1,'2013-10-23 19:42:28'),(1371,'N1',2,'2013-10-04 20:42:28'),(1372,'N2',3,'2013-10-09 21:42:28'),(1373,'N3',4,'2013-10-28 22:42:28'),(1374,'N1',5,'2013-10-21 23:42:28'),(1375,'N2',6,'2013-10-03 00:42:28'),(1376,'N3',7,'2013-10-25 01:42:28'),(1377,'N1',8,'2013-10-18 02:42:28'),(1378,'N2',9,'2013-10-22 03:42:28'),(1379,'N3',10,'2013-10-28 04:42:28'),(1380,'N1',1,'2013-10-30 05:42:28'),(1381,'N2',2,'2013-10-07 06:42:28'),(1382,'N3',3,'2013-10-14 07:42:28'),(1383,'N1',4,'2013-10-27 08:42:28'),(1384,'N2',5,'2013-10-30 09:42:28'),(1385,'N3',6,'2013-10-29 10:42:28'),(1386,'N1',7,'2013-10-07 13:42:28'),(1387,'N2',8,'2013-10-21 14:42:28'),(1388,'N3',9,'2013-10-06 15:42:28'),(1389,'N1',10,'2013-10-27 16:42:28'),(1390,'N2',1,'2013-10-03 17:42:28'),(1391,'N3',2,'2013-10-25 18:42:28'),(1392,'N1',3,'2013-10-09 19:42:28'),(1393,'N2',4,'2013-10-24 20:42:28'),(1394,'N3',5,'2013-10-09 21:42:28'),(1395,'N1',6,'2013-10-06 22:42:28'),(1396,'N2',7,'2013-10-04 23:42:28'),(1397,'N3',8,'2013-10-06 00:42:28'),(1398,'N1',9,'2013-10-18 01:42:28'),(1399,'N2',10,'2013-10-06 02:42:28'),(1400,'N3',1,'2013-10-08 03:42:28'),(1401,'N1',2,'2013-10-15 04:42:28'),(1402,'N2',3,'2013-10-09 05:42:28'),(1403,'N3',4,'2013-10-20 06:42:28'),(1404,'N1',5,'2013-10-07 07:42:28'),(1405,'N2',6,'2013-10-04 08:42:28'),(1406,'N3',7,'2013-10-29 09:42:28'),(1407,'N1',8,'2013-10-22 10:42:28'),(1408,'N2',9,'2013-10-11 13:42:28'),(1409,'N3',10,'2013-10-28 14:42:28'),(1410,'N1',1,'2013-10-22 15:42:28'),(1411,'N2',2,'2013-10-21 16:42:28'),(1412,'N3',3,'2013-10-06 17:42:28'),(1413,'N1',4,'2013-10-26 18:42:28'),(1414,'N2',5,'2013-10-18 19:42:28'),(1415,'N3',6,'2013-10-01 20:42:28'),(1416,'N1',7,'2013-10-07 21:42:28'),(1417,'N2',8,'2013-10-11 22:42:28'),(1418,'N3',9,'2013-10-27 23:42:28'),(1419,'N1',10,'2013-10-20 00:42:28'),(1420,'N2',1,'2013-10-27 01:42:28'),(1421,'N3',2,'2013-10-15 02:42:28'),(1422,'N1',3,'2013-10-26 03:42:28'),(1423,'N2',4,'2013-10-08 04:42:28'),(1424,'N3',5,'2013-10-17 05:42:28'),(1425,'N1',6,'2013-10-10 06:42:28'),(1426,'N2',7,'2013-10-30 07:42:28'),(1427,'N3',8,'2013-10-26 08:42:28'),(1428,'N1',9,'2013-10-28 09:42:28'),(1429,'N2',10,'2013-10-02 10:42:28'),(1430,'N3',1,'2013-10-08 13:42:28'),(1431,'N1',2,'2013-10-08 14:42:28'),(1432,'N2',3,'2013-10-05 15:42:28'),(1433,'N3',4,'2013-10-11 16:42:28'),(1434,'N1',5,'2013-10-24 17:42:28'),(1435,'N2',6,'2013-10-03 18:42:28'),(1436,'N3',7,'2013-10-28 19:42:28'),(1437,'N1',8,'2013-10-13 20:42:28'),(1438,'N2',9,'2013-10-12 21:42:28'),(1439,'N3',10,'2013-10-14 22:42:28'),(1440,'N1',1,'2013-10-09 23:42:28'),(1441,'N2',2,'2013-10-24 00:42:28'),(1442,'N3',3,'2013-10-22 01:42:28'),(1443,'N1',4,'2013-10-24 02:42:28'),(1444,'N2',5,'2013-10-30 03:42:28'),(1445,'N3',6,'2013-10-28 04:42:28'),(1446,'N1',7,'2013-10-24 05:42:28'),(1447,'N2',8,'2013-10-04 06:42:28'),(1448,'N3',9,'2013-10-13 07:42:28'),(1449,'N1',10,'2013-10-21 08:42:28'),(1450,'N2',1,'2013-10-16 09:42:28'),(1451,'N3',2,'2013-10-03 10:42:28'),(1452,'N1',3,'2013-10-19 13:42:28'),(1453,'N2',4,'2013-10-05 14:42:28'),(1454,'N3',5,'2013-10-11 15:42:28'),(1455,'N1',6,'2013-10-02 16:42:28'),(1456,'N2',7,'2013-10-24 17:42:28'),(1457,'N3',8,'2013-10-01 18:42:28'),(1458,'N1',9,'2013-10-27 19:42:28'),(1459,'N2',10,'2013-10-06 20:42:28'),(1460,'N3',1,'2013-10-15 21:42:28'),(1461,'N1',2,'2013-10-10 22:42:28'),(1462,'N2',3,'2013-10-25 23:42:28'),(1463,'N3',4,'2013-10-22 00:42:28'),(1464,'N1',5,'2013-10-23 01:42:28'),(1465,'N2',6,'2013-10-09 02:42:28'),(1466,'N3',7,'2013-10-21 03:42:28'),(1467,'N1',8,'2013-10-04 04:42:28'),(1468,'N2',9,'2013-10-08 05:42:28'),(1469,'N3',10,'2013-10-13 06:42:28'),(1470,'N1',1,'2013-10-04 07:42:28'),(1471,'N2',2,'2013-10-25 08:42:28'),(1472,'N3',3,'2013-10-03 09:42:28'),(1473,'N1',4,'2013-10-05 10:42:28'),(1474,'N2',5,'2013-10-27 13:42:28'),(1475,'N3',6,'2013-10-02 14:42:28'),(1476,'N1',7,'2013-10-19 15:42:28'),(1477,'N2',8,'2013-10-15 16:42:28'),(1478,'N3',9,'2013-10-15 17:42:28'),(1479,'N1',10,'2013-10-08 18:42:28'),(1480,'N2',1,'2013-10-29 19:42:28'),(1481,'N3',2,'2013-10-26 20:42:28'),(1482,'N1',3,'2013-10-15 21:42:28'),(1483,'N2',4,'2013-10-28 22:42:28'),(1484,'N3',5,'2013-10-28 23:42:28'),(1485,'N1',6,'2013-10-30 00:42:28'),(1486,'N2',7,'2013-10-09 01:42:28'),(1487,'N3',8,'2013-10-24 02:42:28'),(1488,'N1',9,'2013-10-29 03:42:28'),(1489,'N2',10,'2013-10-11 04:42:28'),(1490,'N3',1,'2013-10-04 05:42:28'),(1491,'N1',2,'2013-10-29 06:42:28'),(1492,'N2',3,'2013-10-20 07:42:28'),(1493,'N3',4,'2013-10-11 08:42:28'),(1494,'N1',5,'2013-10-24 09:42:28'),(1495,'N2',6,'2013-10-06 10:42:28'),(1496,'N3',7,'2013-10-05 13:42:28'),(1497,'N1',8,'2013-10-15 14:42:28'),(1498,'N2',9,'2013-10-02 15:42:28'),(1499,'N3',10,'2013-10-15 16:42:28'),(1500,'N1',1,'2013-10-15 17:42:28'),(1501,'N2',2,'2013-10-25 18:42:28'),(1502,'N3',3,'2013-10-16 19:42:28'),(1503,'N1',4,'2013-10-05 20:42:28'),(1504,'N2',5,'2013-10-24 21:42:28'),(1505,'N3',6,'2013-10-26 22:42:28'),(1506,'N1',7,'2013-10-03 23:42:28'),(1507,'N2',8,'2013-10-06 00:42:28'),(1508,'N3',9,'2013-10-13 01:42:28'),(1509,'N1',10,'2013-10-28 02:42:28'),(1510,'N2',1,'2013-10-16 03:42:28'),(1511,'N3',2,'2013-10-22 04:42:28'),(1512,'N1',3,'2013-10-11 05:42:28'),(1513,'N2',4,'2013-10-03 06:42:28'),(1514,'N3',5,'2013-10-22 07:42:28'),(1515,'N1',6,'2013-10-14 08:42:28'),(1516,'N2',7,'2013-10-07 09:42:28'),(1517,'N3',8,'2013-10-15 10:42:28'),(1518,'N1',9,'2013-10-20 13:42:28'),(1519,'N2',10,'2013-10-20 14:42:28'),(1520,'N3',1,'2013-10-08 15:42:28'),(1521,'N1',2,'2013-10-29 16:42:28'),(1522,'N2',3,'2013-10-25 17:42:28'),(1523,'N3',4,'2013-10-15 18:42:28'),(1524,'N1',5,'2013-10-06 19:42:28'),(1525,'N2',6,'2013-10-15 20:42:28'),(1526,'N3',7,'2013-10-29 21:42:28'),(1527,'N1',8,'2013-10-09 22:42:28'),(1528,'N2',9,'2013-10-17 23:42:28'),(1529,'N3',10,'2013-10-15 00:42:28'),(1530,'N1',1,'2013-10-25 01:42:28'),(1531,'N2',2,'2013-10-30 02:42:28'),(1532,'N3',3,'2013-10-03 03:42:28'),(1533,'N1',4,'2013-10-27 04:42:28'),(1534,'N2',5,'2013-10-20 05:42:28'),(1535,'N3',6,'2013-10-18 06:42:28'),(1536,'N1',7,'2013-10-03 07:42:28'),(1537,'N2',8,'2013-10-06 08:42:28'),(1538,'N3',9,'2013-10-16 09:42:28'),(1539,'N1',10,'2013-10-24 10:42:28'),(1540,'N2',1,'2013-10-25 13:42:28'),(1541,'N3',2,'2013-10-15 14:42:28'),(1542,'N1',3,'2013-10-17 15:42:28'),(1543,'N2',4,'2013-10-13 16:42:28'),(1544,'N3',5,'2013-10-23 17:42:28'),(1545,'N1',6,'2013-10-15 18:42:28'),(1546,'N2',7,'2013-10-08 19:42:28'),(1547,'N3',8,'2013-10-18 20:42:28'),(1548,'N1',9,'2013-10-27 21:42:28'),(1549,'N2',10,'2013-10-13 22:42:28'),(1550,'N3',1,'2013-10-03 23:42:28'),(1551,'N1',2,'2013-10-04 00:42:28'),(1552,'N2',3,'2013-10-16 01:42:28'),(1553,'N3',4,'2013-10-14 02:42:28'),(1554,'N1',5,'2013-10-05 03:42:28'),(1555,'N2',6,'2013-10-03 04:42:28'),(1556,'N3',7,'2013-10-18 05:42:28'),(1557,'N1',8,'2013-10-30 06:42:28'),(1558,'N2',9,'2013-10-05 07:42:28'),(1559,'N3',10,'2013-10-21 08:42:28'),(1560,'N1',1,'2013-10-30 09:42:28'),(1561,'N2',2,'2013-10-15 10:42:28'),(1562,'N3',3,'2013-10-29 13:42:28'),(1563,'N1',4,'2013-10-23 14:42:28'),(1564,'N2',5,'2013-10-25 15:42:28'),(1565,'N3',6,'2013-10-20 16:42:28'),(1566,'N1',7,'2013-10-27 17:42:28'),(1567,'N2',8,'2013-10-26 18:42:28'),(1568,'N3',9,'2013-10-23 19:42:28'),(1569,'N1',10,'2013-10-27 20:42:28'),(1570,'N2',1,'2013-10-03 21:42:28'),(1571,'N3',2,'2013-10-22 22:42:28'),(1572,'N1',3,'2013-10-18 23:42:28'),(1573,'N2',4,'2013-10-10 00:42:28'),(1574,'N3',5,'2013-10-23 01:42:28'),(1575,'N1',6,'2013-10-18 02:42:28'),(1576,'N2',7,'2013-10-24 03:42:28'),(1577,'N3',8,'2013-10-27 04:42:28'),(1578,'N1',9,'2013-10-02 05:42:28'),(1579,'N2',10,'2013-10-15 06:42:28'),(1580,'N3',1,'2013-10-18 07:42:28'),(1581,'N1',2,'2013-10-04 08:42:28'),(1582,'N2',3,'2013-10-29 09:42:28'),(1583,'N3',4,'2013-10-16 10:42:28'),(1584,'N1',5,'2013-10-29 13:42:28'),(1585,'N2',6,'2013-10-16 14:42:28'),(1586,'N3',7,'2013-10-21 15:42:28'),(1587,'N1',8,'2013-10-05 16:42:28'),(1588,'N2',9,'2013-10-22 17:42:28'),(1589,'N3',10,'2013-10-03 18:42:28'),(1590,'N1',1,'2013-10-26 19:42:28'),(1591,'N2',2,'2013-10-06 20:42:28'),(1592,'N3',3,'2013-10-22 21:42:28'),(1593,'N1',4,'2013-10-03 22:42:28'),(1594,'N2',5,'2013-10-27 23:42:28'),(1595,'N3',6,'2013-10-27 00:42:28'),(1596,'N1',7,'2013-10-04 01:42:28'),(1597,'N2',8,'2013-10-13 02:42:28'),(1598,'N3',9,'2013-10-30 03:42:28'),(1599,'N1',10,'2013-10-04 04:42:28'),(1600,'N2',1,'2013-10-25 05:42:28'),(1601,'N3',2,'2013-10-25 06:42:28'),(1602,'N1',3,'2013-10-30 07:42:28'),(1603,'N2',4,'2013-10-30 08:42:28'),(1604,'N3',5,'2013-10-30 09:42:28'),(1605,'N1',6,'2013-10-16 10:42:28'),(1606,'N2',7,'2013-10-29 13:42:28'),(1607,'N3',8,'2013-10-18 14:42:28'),(1608,'N1',9,'2013-10-04 15:42:28'),(1609,'N2',10,'2013-10-18 16:42:28'),(1610,'N3',1,'2013-10-28 17:42:28'),(1611,'N1',2,'2013-10-01 18:42:28'),(1612,'N2',3,'2013-10-13 19:42:28'),(1613,'N3',4,'2013-10-02 20:42:28'),(1614,'N1',5,'2013-10-28 21:42:28'),(1615,'N2',6,'2013-10-02 22:42:28'),(1616,'N3',7,'2013-10-06 23:42:28'),(1617,'N1',8,'2013-10-24 00:42:28'),(1618,'N2',9,'2013-10-30 01:42:28'),(1619,'N3',10,'2013-10-14 02:42:28'),(1620,'N1',1,'2013-10-25 03:42:28'),(1621,'N2',2,'2013-10-27 04:42:28'),(1622,'N3',3,'2013-10-19 05:42:28'),(1623,'N1',4,'2013-10-09 06:42:28'),(1624,'N2',5,'2013-10-28 07:42:28'),(1625,'N3',6,'2013-10-23 08:42:28'),(1626,'N1',7,'2013-10-29 09:42:28'),(1627,'N2',8,'2013-10-10 10:42:28'),(1628,'N3',9,'2013-10-13 13:42:28'),(1629,'N1',10,'2013-10-21 14:42:28'),(1630,'N2',1,'2013-10-06 15:42:28'),(1631,'N3',2,'2013-10-27 16:42:28'),(1632,'N1',3,'2013-10-14 17:42:28'),(1633,'N2',4,'2013-10-10 18:42:28'),(1634,'N3',5,'2013-10-05 19:42:28'),(1635,'N1',6,'2013-10-05 20:42:28'),(1636,'N2',7,'2013-10-12 21:42:28'),(1637,'N3',8,'2013-10-14 22:42:28'),(1638,'N1',9,'2013-10-24 23:42:28'),(1639,'N2',10,'2013-10-09 00:42:28'),(1640,'N3',1,'2013-10-24 01:42:28'),(1641,'N1',2,'2013-10-19 02:42:28'),(1642,'N2',3,'2013-10-07 03:42:28'),(1643,'N3',4,'2013-10-28 04:42:28'),(1644,'N1',5,'2013-10-25 05:42:28'),(1645,'N2',6,'2013-10-28 06:42:28'),(1646,'N3',7,'2013-10-03 07:42:28'),(1647,'N1',8,'2013-10-11 08:42:28'),(1648,'N2',9,'2013-10-13 09:42:28'),(1649,'N3',10,'2013-10-11 10:42:28'),(1650,'N1',1,'2013-10-16 13:42:28'),(1651,'N2',2,'2013-10-20 14:42:28'),(1652,'N3',3,'2013-10-20 15:42:28'),(1653,'N1',4,'2013-10-16 16:42:28'),(1654,'N2',5,'2013-10-08 17:42:28'),(1655,'N3',6,'2013-10-06 18:42:28'),(1656,'N1',7,'2013-10-03 19:42:28'),(1657,'N2',8,'2013-10-17 20:42:28'),(1658,'N3',9,'2013-10-16 21:42:28'),(1659,'N1',10,'2013-10-18 22:42:28'),(1660,'N2',1,'2013-10-07 23:42:28'),(1661,'N3',2,'2013-10-13 00:42:28'),(1662,'N1',3,'2013-10-19 01:42:28'),(1663,'N2',4,'2013-10-25 02:42:28'),(1664,'N3',5,'2013-10-07 03:42:28'),(1665,'N1',6,'2013-10-09 04:42:28'),(1666,'N2',7,'2013-10-16 05:42:28'),(1667,'N3',8,'2013-10-29 06:42:28'),(1668,'N1',9,'2013-10-15 07:42:28'),(1669,'N2',10,'2013-10-27 08:42:28'),(1670,'N3',1,'2013-10-13 09:42:28'),(1671,'N1',2,'2013-10-07 10:42:28'),(1672,'N2',3,'2013-10-21 13:42:28'),(1673,'N3',4,'2013-10-07 14:42:28'),(1674,'N1',5,'2013-10-21 15:42:28'),(1675,'N2',6,'2013-10-28 16:42:28'),(1676,'N3',7,'2013-10-15 17:42:28'),(1677,'N1',8,'2013-10-01 18:42:28'),(1678,'N2',9,'2013-10-16 19:42:28'),(1679,'N3',10,'2013-10-08 20:42:28'),(1680,'N1',1,'2013-10-20 21:42:28'),(1681,'N2',2,'2013-10-19 22:42:28'),(1682,'N3',3,'2013-10-17 23:42:28'),(1683,'N1',4,'2013-10-04 00:42:28'),(1684,'N2',5,'2013-10-07 01:42:28'),(1685,'N3',6,'2013-10-11 02:42:28'),(1686,'N1',7,'2013-10-15 03:42:28'),(1687,'N2',8,'2013-10-19 04:42:28'),(1688,'N3',9,'2013-10-11 05:42:28'),(1689,'N1',10,'2013-10-14 06:42:28'),(1690,'N2',1,'2013-10-07 07:42:28'),(1691,'N3',2,'2013-10-26 08:42:28'),(1692,'N1',3,'2013-10-03 09:42:28'),(1693,'N2',4,'2013-10-03 10:42:28'),(1694,'N3',5,'2013-10-06 13:42:28'),(1695,'N1',6,'2013-10-25 14:42:28'),(1696,'N2',7,'2013-10-26 15:42:28'),(1697,'N3',8,'2013-10-03 16:42:28'),(1698,'N1',9,'2013-10-29 17:42:28'),(1699,'N2',10,'2013-10-12 18:42:28'),(1700,'N3',1,'2013-10-23 19:42:28'),(1701,'N1',2,'2013-10-02 20:42:28'),(1702,'N2',3,'2013-10-20 21:42:28'),(1703,'N3',4,'2013-10-16 22:42:28'),(1704,'N1',5,'2013-10-01 23:42:28'),(1705,'N2',6,'2013-10-11 00:42:28'),(1706,'N3',7,'2013-10-27 01:42:28'),(1707,'N1',8,'2013-10-05 02:42:28'),(1708,'N2',9,'2013-10-13 03:42:28'),(1709,'N3',10,'2013-10-10 04:42:28'),(1710,'N1',1,'2013-10-06 05:42:28'),(1711,'N2',2,'2013-10-16 06:42:28'),(1712,'N3',3,'2013-10-30 07:42:28'),(1713,'N1',4,'2013-10-05 08:42:28'),(1714,'N2',5,'2013-10-02 09:42:28'),(1715,'N3',6,'2013-10-22 10:42:28'),(1716,'N1',7,'2013-10-04 13:42:28'),(1717,'N2',8,'2013-10-11 14:42:28'),(1718,'N3',9,'2013-10-29 15:42:28'),(1719,'N1',10,'2013-10-10 16:42:28'),(1720,'N2',1,'2013-10-19 17:42:28'),(1721,'N3',2,'2013-10-05 18:42:28'),(1722,'N1',3,'2013-10-02 19:42:28'),(1723,'N2',4,'2013-10-20 20:42:28'),(1724,'N3',5,'2013-10-18 21:42:28'),(1725,'N1',6,'2013-10-09 22:42:28'),(1726,'N2',7,'2013-10-09 23:42:28'),(1727,'N3',8,'2013-10-09 00:42:28'),(1728,'N1',9,'2013-10-05 01:42:28'),(1729,'N2',10,'2013-10-07 02:42:28'),(1730,'N3',1,'2013-10-07 03:42:28'),(1731,'N1',2,'2013-10-19 04:42:28'),(1732,'N2',3,'2013-10-23 05:42:28'),(1733,'N3',4,'2013-10-23 06:42:28'),(1734,'N1',5,'2013-10-05 07:42:28'),(1735,'N2',6,'2013-10-24 08:42:28'),(1736,'N3',7,'2013-10-14 09:42:28'),(1737,'N1',8,'2013-10-29 10:42:28'),(1738,'N2',9,'2013-10-01 13:42:28'),(1739,'N3',10,'2013-10-28 14:42:28'),(1740,'N1',1,'2013-10-12 15:42:28'),(1741,'N2',2,'2013-10-18 16:42:28'),(1742,'N3',3,'2013-10-27 17:42:28'),(1743,'N1',4,'2013-10-22 18:42:28'),(1744,'N2',5,'2013-10-25 19:42:28'),(1745,'N3',6,'2013-10-06 20:42:28'),(1746,'N1',7,'2013-10-06 21:42:28'),(1747,'N2',8,'2013-10-10 22:42:28'),(1748,'N3',9,'2013-10-01 23:42:28'),(1749,'N1',10,'2013-10-09 00:42:28'),(1750,'N2',1,'2013-10-09 01:42:28'),(1751,'N3',2,'2013-10-12 02:42:28'),(1752,'N1',3,'2013-10-12 03:42:28'),(1753,'N2',4,'2013-10-09 04:42:28'),(1754,'N3',5,'2013-10-14 05:42:28'),(1755,'N1',6,'2013-10-13 06:42:28'),(1756,'N2',7,'2013-10-21 07:42:28'),(1757,'N3',8,'2013-10-03 08:42:28'),(1758,'N1',9,'2013-10-09 09:42:28'),(1759,'N2',10,'2013-10-28 10:42:28'),(1760,'N3',1,'2013-10-19 13:42:28'),(1761,'N1',2,'2013-10-20 14:42:28'),(1762,'N2',3,'2013-10-27 15:42:28'),(1763,'N3',4,'2013-10-16 16:42:28'),(1764,'N1',5,'2013-10-20 17:42:28'),(1765,'N2',6,'2013-10-28 18:42:28'),(1766,'N3',7,'2013-10-05 19:42:28'),(1767,'N1',8,'2013-10-02 20:42:28'),(1768,'N2',9,'2013-10-23 21:42:28'),(1769,'N3',10,'2013-10-22 22:42:28'),(1770,'N1',1,'2013-10-28 23:42:28'),(1771,'N2',2,'2013-10-21 00:42:28'),(1772,'N3',3,'2013-10-24 01:42:28'),(1773,'N1',4,'2013-10-05 02:42:28'),(1774,'N2',5,'2013-10-25 03:42:28'),(1775,'N3',6,'2013-10-18 04:42:28'),(1776,'N1',7,'2013-10-25 05:42:28'),(1777,'N2',8,'2013-10-18 06:42:28'),(1778,'N3',9,'2013-10-23 07:42:28'),(1779,'N1',10,'2013-10-14 08:42:28'),(1780,'N2',1,'2013-10-19 09:42:28'),(1781,'N3',2,'2013-10-05 10:42:28'),(1782,'N1',3,'2013-10-12 13:42:28'),(1783,'N2',4,'2013-10-07 14:42:28'),(1784,'N3',5,'2013-10-25 15:42:28'),(1785,'N1',6,'2013-10-19 16:42:28'),(1786,'N2',7,'2013-10-23 17:42:28'),(1787,'N3',8,'2013-10-27 18:42:28'),(1788,'N1',9,'2013-10-13 19:42:28'),(1789,'N2',10,'2013-10-07 20:42:28'),(1790,'N3',1,'2013-10-13 21:42:28'),(1791,'N1',2,'2013-10-09 22:42:28'),(1792,'N2',3,'2013-10-13 23:42:28'),(1793,'N3',4,'2013-10-28 00:42:28'),(1794,'N1',5,'2013-10-12 01:42:28'),(1795,'N2',6,'2013-10-07 02:42:28'),(1796,'N3',7,'2013-10-08 03:42:28'),(1797,'N1',8,'2013-10-05 04:42:28'),(1798,'N2',9,'2013-10-15 05:42:28'),(1799,'N3',10,'2013-10-13 06:42:28'),(1800,'N1',1,'2013-10-03 07:42:28'),(1801,'N2',2,'2013-10-05 08:42:28'),(1802,'N3',3,'2013-10-10 09:42:28'),(1803,'N1',4,'2013-10-06 10:42:28'),(1804,'N2',5,'2013-10-10 13:42:28'),(1805,'N3',6,'2013-10-04 14:42:28'),(1806,'N1',7,'2013-10-26 15:42:28'),(1807,'N2',8,'2013-10-11 16:42:28'),(1808,'N3',9,'2013-10-21 17:42:28'),(1809,'N1',10,'2013-10-21 18:42:28'),(1810,'N2',1,'2013-10-19 19:42:28'),(1811,'N3',2,'2013-10-13 20:42:28'),(1812,'N1',3,'2013-10-02 21:42:28'),(1813,'N2',4,'2013-10-02 22:42:28'),(1814,'N3',5,'2013-10-05 23:42:28'),(1815,'N1',6,'2013-10-18 00:42:28'),(1816,'N2',7,'2013-10-22 01:42:28'),(1817,'N3',8,'2013-10-21 02:42:28'),(1818,'N1',9,'2013-10-26 03:42:28'),(1819,'N2',10,'2013-10-11 04:42:28'),(1820,'N3',1,'2013-10-05 05:42:28'),(1821,'N1',2,'2013-10-13 06:42:28'),(1822,'N2',3,'2013-10-11 07:42:28'),(1823,'N3',4,'2013-10-18 08:42:28'),(1824,'N1',5,'2013-10-18 09:42:28'),(1825,'N2',6,'2013-10-05 10:42:28'),(1826,'N3',7,'2013-10-05 13:42:28'),(1827,'N1',8,'2013-10-01 14:42:28'),(1828,'N2',9,'2013-10-25 15:42:28'),(1829,'N3',10,'2013-10-14 16:42:28'),(1830,'N1',1,'2013-10-04 17:42:28'),(1831,'N2',2,'2013-10-20 18:42:28'),(1832,'N3',3,'2013-10-14 19:42:28'),(1833,'N1',4,'2013-10-08 20:42:28'),(1834,'N2',5,'2013-10-18 21:42:28'),(1835,'N3',6,'2013-10-22 22:42:28'),(1836,'N1',7,'2013-10-09 23:42:28'),(1837,'N2',8,'2013-10-27 00:42:28'),(1838,'N3',9,'2013-10-16 01:42:28'),(1839,'N1',10,'2013-10-18 02:42:28'),(1840,'N2',1,'2013-10-18 03:42:28'),(1841,'N3',2,'2013-10-17 04:42:28'),(1842,'N1',3,'2013-10-19 05:42:28'),(1843,'N2',4,'2013-10-07 06:42:28'),(1844,'N3',5,'2013-10-28 07:42:28'),(1845,'N1',6,'2013-10-15 08:42:28'),(1846,'N2',7,'2013-10-15 09:42:28'),(1847,'N3',8,'2013-10-24 10:42:28'),(1848,'N1',9,'2013-10-27 13:42:28'),(1849,'N2',10,'2013-10-16 14:42:28'),(1850,'N3',1,'2013-10-07 15:42:28'),(1851,'N1',2,'2013-10-02 16:42:28'),(1852,'N2',3,'2013-10-20 17:42:28'),(1853,'N3',4,'2013-10-04 18:42:28'),(1854,'N1',5,'2013-10-06 19:42:28'),(1855,'N2',6,'2013-10-26 20:42:28'),(1856,'N3',7,'2013-10-22 21:42:28'),(1857,'N1',8,'2013-10-06 22:42:28'),(1858,'N2',9,'2013-10-28 23:42:28'),(1859,'N3',10,'2013-10-19 00:42:28'),(1860,'N1',1,'2013-10-28 01:42:28'),(1861,'N2',2,'2013-10-25 02:42:28'),(1862,'N3',3,'2013-10-04 03:42:28'),(1863,'N1',4,'2013-10-08 04:42:28'),(1864,'N2',5,'2013-10-30 05:42:28'),(1865,'N3',6,'2013-10-23 06:42:28'),(1866,'N1',7,'2013-10-30 07:42:28'),(1867,'N2',8,'2013-10-17 08:42:28'),(1868,'N3',9,'2013-10-07 09:42:28'),(1869,'N1',10,'2013-10-30 10:42:28'),(1870,'N2',1,'2013-10-02 13:42:28'),(1871,'N3',2,'2013-10-09 14:42:28'),(1872,'N1',3,'2013-10-07 15:42:28'),(1873,'N2',4,'2013-10-16 16:42:28'),(1874,'N3',5,'2013-10-18 17:42:28'),(1875,'N1',6,'2013-10-28 18:42:28'),(1876,'N2',7,'2013-10-02 19:42:28'),(1877,'N3',8,'2013-10-26 20:42:28'),(1878,'N1',9,'2013-10-02 21:42:28'),(1879,'N2',10,'2013-10-08 22:42:28'),(1880,'N3',1,'2013-10-14 23:42:28'),(1881,'N1',2,'2013-10-24 00:42:28'),(1882,'N2',3,'2013-10-21 01:42:28'),(1883,'N3',4,'2013-10-07 02:42:28'),(1884,'N1',5,'2013-10-28 03:42:28'),(1885,'N2',6,'2013-10-05 04:42:28'),(1886,'N3',7,'2013-10-16 05:42:28'),(1887,'N1',8,'2013-10-04 06:42:28'),(1888,'N2',9,'2013-10-20 07:42:28'),(1889,'N3',10,'2013-10-30 08:42:28'),(1890,'N1',1,'2013-10-04 09:42:28'),(1891,'N2',2,'2013-10-15 10:42:28'),(1892,'N3',3,'2013-10-17 13:42:28'),(1893,'N1',4,'2013-10-08 14:42:28'),(1894,'N2',5,'2013-10-29 15:42:28'),(1895,'N3',6,'2013-10-06 16:42:28'),(1896,'N1',7,'2013-10-21 17:42:28'),(1897,'N2',8,'2013-10-29 18:42:28'),(1898,'N3',9,'2013-10-24 19:42:28'),(1899,'N1',10,'2013-10-23 20:42:28'),(1900,'N2',1,'2013-10-29 21:42:28'),(1901,'N3',2,'2013-10-21 22:42:28'),(1902,'N1',3,'2013-10-20 23:42:28'),(1903,'N2',4,'2013-10-25 00:42:28'),(1904,'N3',5,'2013-10-04 01:42:28'),(1905,'N1',6,'2013-10-27 02:42:28'),(1906,'N2',7,'2013-10-27 03:42:28'),(1907,'N3',8,'2013-10-03 04:42:28'),(1908,'N1',9,'2013-10-24 05:42:28'),(1909,'N2',10,'2013-10-05 06:42:28'),(1910,'N3',1,'2013-10-08 07:42:28'),(1911,'N1',2,'2013-10-18 08:42:28'),(1912,'N2',3,'2013-10-30 09:42:28'),(1913,'N3',4,'2013-10-04 10:42:28'),(1914,'N1',5,'2013-10-14 13:42:28'),(1915,'N2',6,'2013-10-02 14:42:28'),(1916,'N3',7,'2013-10-25 15:42:28'),(1917,'N1',8,'2013-10-27 16:42:28'),(1918,'N2',9,'2013-10-29 17:42:28'),(1919,'N3',10,'2013-10-16 18:42:29'),(1920,'N1',1,'2013-10-02 19:42:29'),(1921,'N2',2,'2013-10-15 20:42:29'),(1922,'N3',3,'2013-10-20 21:42:29'),(1923,'N1',4,'2013-10-06 22:42:29'),(1924,'N2',5,'2013-10-08 23:42:29'),(1925,'N3',6,'2013-10-17 00:42:29'),(1926,'N1',7,'2013-10-05 01:42:29'),(1927,'N2',8,'2013-10-29 02:42:29'),(1928,'N3',9,'2013-10-04 03:42:29'),(1929,'N1',10,'2013-10-16 04:42:29'),(1930,'N2',1,'2013-10-26 05:42:29'),(1931,'N3',2,'2013-10-20 06:42:29'),(1932,'N1',3,'2013-10-17 07:42:29'),(1933,'N2',4,'2013-10-24 08:42:29'),(1934,'N3',5,'2013-10-11 09:42:29'),(1935,'N1',6,'2013-10-23 10:42:29'),(1936,'N2',7,'2013-10-28 13:42:29'),(1937,'N3',8,'2013-10-03 14:42:29'),(1938,'N1',9,'2013-10-27 15:42:29'),(1939,'N2',10,'2013-10-13 16:42:29'),(1940,'N3',1,'2013-10-18 17:42:29'),(1941,'N1',2,'2013-10-13 18:42:29'),(1942,'N2',3,'2013-10-03 19:42:29'),(1943,'N3',4,'2013-10-29 20:42:29'),(1944,'N1',5,'2013-10-26 21:42:29'),(1945,'N2',6,'2013-10-12 22:42:29'),(1946,'N3',7,'2013-10-07 23:42:29'),(1947,'N1',8,'2013-10-04 00:42:29'),(1948,'N2',9,'2013-10-04 01:42:29'),(1949,'N3',10,'2013-10-22 02:42:29'),(1950,'N1',1,'2013-10-30 03:42:29'),(1951,'N2',2,'2013-10-04 04:42:29'),(1952,'N3',3,'2013-10-21 05:42:29'),(1953,'N1',4,'2013-10-18 06:42:29'),(1954,'N2',5,'2013-10-20 07:42:29'),(1955,'N3',6,'2013-10-28 08:42:29'),(1956,'N1',7,'2013-10-13 09:42:29'),(1957,'N2',8,'2013-10-11 10:42:29'),(1958,'N3',9,'2013-10-22 13:42:29'),(1959,'N1',10,'2013-10-21 14:42:29'),(1960,'N2',1,'2013-10-25 15:42:29'),(1961,'N3',2,'2013-10-23 16:42:29'),(1962,'N1',3,'2013-10-15 17:42:29'),(1963,'N2',4,'2013-10-01 18:42:29'),(1964,'N3',5,'2013-10-07 19:42:29'),(1965,'N1',6,'2013-10-11 20:42:29'),(1966,'N2',7,'2013-10-06 21:42:29'),(1967,'N3',8,'2013-10-07 22:42:29'),(1968,'N1',9,'2013-10-11 23:42:29'),(1969,'N2',10,'2013-10-20 00:42:29'),(1970,'N3',1,'2013-10-23 01:42:29'),(1971,'N1',2,'2013-10-05 02:42:29'),(1972,'N2',3,'2013-10-22 03:42:29'),(1973,'N3',4,'2013-10-03 04:42:29'),(1974,'N1',5,'2013-10-27 05:42:29'),(1975,'N2',6,'2013-10-13 06:42:29'),(1976,'N3',7,'2013-10-18 07:42:29'),(1977,'N1',8,'2013-10-08 08:42:29'),(1978,'N2',9,'2013-10-15 09:42:29'),(1979,'N3',10,'2013-10-26 10:42:29'),(1980,'N1',1,'2013-10-26 13:42:29'),(1981,'N2',2,'2013-10-12 14:42:29'),(1982,'N3',3,'2013-10-18 15:42:29'),(1983,'N1',4,'2013-10-22 16:42:29'),(1984,'N2',5,'2013-10-19 17:42:29'),(1985,'N3',6,'2013-10-24 18:42:29'),(1986,'N1',7,'2013-10-11 19:42:29'),(1987,'N2',8,'2013-10-28 20:42:29'),(1988,'N3',9,'2013-10-29 21:42:29'),(1989,'N1',10,'2013-10-27 22:42:29'),(1990,'N2',1,'2013-10-16 23:42:29'),(1991,'N3',2,'2013-10-16 00:42:29'),(1992,'N1',3,'2013-10-15 01:42:29'),(1993,'N2',4,'2013-10-28 02:42:29'),(1994,'N3',5,'2013-10-12 03:42:29'),(1995,'N1',6,'2013-10-28 04:42:29'),(1996,'N2',7,'2013-10-04 05:42:29'),(1997,'N3',8,'2013-10-08 06:42:29'),(1998,'N1',9,'2013-10-05 07:42:29'),(1999,'N2',10,'2013-10-12 08:42:29'); +/*!40000 ALTER TABLE `dl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `externalMeeting` +-- + +DROP TABLE IF EXISTS `externalMeeting`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `externalMeeting` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `crmuserId` mediumint(9) NOT NULL, + `endtime` bigint(20) DEFAULT NULL, + `starttime` bigint(20) NOT NULL DEFAULT '0', + `title` varchar(128) DEFAULT NULL, + `contactIds` varchar(512) DEFAULT NULL, + `status` mediumint(9) DEFAULT NULL, + `activity_type` mediumint(9) DEFAULT NULL, + `coachId` mediumint(9) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `externalMeeting` +-- + +LOCK TABLES `externalMeeting` WRITE; +/*!40000 ALTER TABLE `externalMeeting` DISABLE KEYS */; +/*!40000 ALTER TABLE `externalMeeting` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `importMetaInfo` +-- + +DROP TABLE IF EXISTS `importMetaInfo`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `importMetaInfo` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `entity_name` varchar(255) DEFAULT NULL, + `importfilename` varchar(255) DEFAULT NULL, + `logfilename` varchar(255) DEFAULT NULL, + `whenadded` datetime DEFAULT NULL, + `modifier` varchar(255) DEFAULT NULL, + `modify_datetime` datetime DEFAULT NULL, + `num_of_total_record` mediumint(9) DEFAULT NULL, + `num_of_imported` mediumint(9) DEFAULT NULL, + `num_of_failed` mediumint(9) DEFAULT NULL, + `status` mediumint(9) DEFAULT NULL, + `result` mediumint(9) DEFAULT NULL, + `num_of_updated` int(11) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `importMetaInfo` +-- + +LOCK TABLES `importMetaInfo` WRITE; +/*!40000 ALTER TABLE `importMetaInfo` DISABLE KEYS */; +/*!40000 ALTER TABLE `importMetaInfo` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `importresult` +-- + +DROP TABLE IF EXISTS `importresult`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `importresult` ( + `id` int(11) NOT NULL, + `val` varchar(45) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `importresult` +-- + +LOCK TABLES `importresult` WRITE; +/*!40000 ALTER TABLE `importresult` DISABLE KEYS */; +INSERT INTO `importresult` VALUES (0,'成功'),(1,'失败'); +/*!40000 ALTER TABLE `importresult` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `importstatus` +-- + +DROP TABLE IF EXISTS `importstatus`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `importstatus` ( + `id` int(11) NOT NULL, + `val` varchar(45) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `importstatus` +-- + +LOCK TABLES `importstatus` WRITE; +/*!40000 ALTER TABLE `importstatus` DISABLE KEYS */; +INSERT INTO `importstatus` VALUES (0,'运行'),(1,'已完成'); +/*!40000 ALTER TABLE `importstatus` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `internalMeeting` +-- + +DROP TABLE IF EXISTS `internalMeeting`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `internalMeeting` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `crmuserId` mediumint(9) NOT NULL, + `endtime` bigint(20) DEFAULT NULL, + `starttime` bigint(20) NOT NULL DEFAULT '0', + `title` varchar(128) DEFAULT NULL, + `contactId` mediumint(9) DEFAULT NULL, + `crmusermanagerId` mediumint(9) DEFAULT NULL, + `status` mediumint(9) DEFAULT NULL, + `activity_type` mediumint(9) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `internalMeeting` +-- + +LOCK TABLES `internalMeeting` WRITE; +/*!40000 ALTER TABLE `internalMeeting` DISABLE KEYS */; +/*!40000 ALTER TABLE `internalMeeting` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `loginhistory` +-- + +DROP TABLE IF EXISTS `loginhistory`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `loginhistory` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `sessionId` varchar(128) DEFAULT NULL, + `loginName` varchar(256) DEFAULT NULL, + `loginTime` datetime DEFAULT NULL, + `logoutTime` datetime DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE, + UNIQUE KEY `sessionId` (`sessionId`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `loginhistory` +-- + +LOCK TABLES `loginhistory` WRITE; +/*!40000 ALTER TABLE `loginhistory` DISABLE KEYS */; +/*!40000 ALTER TABLE `loginhistory` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Temporary table structure for view `parent_position` +-- + +DROP TABLE IF EXISTS `parent_position`; +/*!50001 DROP VIEW IF EXISTS `parent_position`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `parent_position` ( + `id` tinyint NOT NULL, + `name` tinyint NOT NULL, + `code` tinyint NOT NULL, + `reportto` tinyint NOT NULL, + `role` tinyint NOT NULL, + `pl1` tinyint NOT NULL, + `pl2` tinyint NOT NULL, + `pl4` tinyint NOT NULL, + `pl5` tinyint NOT NULL, + `city` tinyint NOT NULL, + `department` tinyint NOT NULL, + `whenadded` tinyint NOT NULL, + `modifier` tinyint NOT NULL, + `modify_datetime` tinyint NOT NULL, + `owner` tinyint NOT NULL, + `level` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; + +-- +-- Temporary table structure for view `parent_user_info` +-- + +DROP TABLE IF EXISTS `parent_user_info`; +/*!50001 DROP VIEW IF EXISTS `parent_user_info`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `parent_user_info` ( + `id` tinyint NOT NULL, + `name` tinyint NOT NULL, + `department` tinyint NOT NULL, + `division` tinyint NOT NULL, + `cellPhone` tinyint NOT NULL, + `email` tinyint NOT NULL, + `employeeNumber` tinyint NOT NULL, + `photo` tinyint NOT NULL, + `jobTitle` tinyint NOT NULL, + `pl1` tinyint NOT NULL, + `pl2` tinyint NOT NULL, + `role` tinyint NOT NULL, + `pl4` tinyint NOT NULL, + `pl5` tinyint NOT NULL, + `sex` tinyint NOT NULL, + `loginName` tinyint NOT NULL, + `password` tinyint NOT NULL, + `sessionKey` tinyint NOT NULL, + `lastLoginTime` tinyint NOT NULL, + `whenadded` tinyint NOT NULL, + `parcel` tinyint NOT NULL, + `modifier` tinyint NOT NULL, + `modify_datetime` tinyint NOT NULL, + `owner` tinyint NOT NULL, + `province` tinyint NOT NULL, + `city` tinyint NOT NULL, + `office_tel` tinyint NOT NULL, + `num_of_signIn` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; + +-- +-- Temporary table structure for view `parent_user_position` +-- + +DROP TABLE IF EXISTS `parent_user_position`; +/*!50001 DROP VIEW IF EXISTS `parent_user_position`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `parent_user_position` ( + `id` tinyint NOT NULL, + `userId` tinyint NOT NULL, + `positionId` tinyint NOT NULL, + `status` tinyint NOT NULL, + `createtime` tinyint NOT NULL, + `isPrimary` tinyint NOT NULL, + `externalId` tinyint NOT NULL, + `whenadded` tinyint NOT NULL, + `modifier` tinyint NOT NULL, + `modify_datetime` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; + +-- +-- Table structure for table `province` +-- + +DROP TABLE IF EXISTS `province`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `province` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `val` varchar(20) DEFAULT NULL, + `externalId` varchar(20) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `province` +-- + +LOCK TABLES `province` WRITE; +/*!40000 ALTER TABLE `province` DISABLE KEYS */; +INSERT INTO `province` VALUES (1,'北京','110000'),(2,'天津','120000'),(3,'河北','130000'),(4,'山西','140000'),(5,'内蒙古','150000'),(6,'辽宁','210000'),(7,'吉林','220000'),(8,'黑龙江','230000'),(9,'上海','310000'),(10,'江苏','320000'),(11,'浙江','330000'),(12,'安徽','340000'),(13,'福建','350000'),(14,'江西','360000'),(15,'山东','370000'),(16,'河南','410000'),(17,'湖北','420000'),(18,'湖南','430000'),(19,'广东','440000'),(20,'广西','450000'),(21,'海南','460000'),(22,'重庆','500000'),(23,'四川','510000'),(24,'贵州','520000'),(25,'云南','530000'),(26,'西藏','540000'),(27,'陕西','610000'),(28,'甘肃','620000'),(29,'青海','630000'),(30,'宁夏','640000'),(31,'新疆','650000'),(32,'台湾','710000'),(33,'香港','810000'),(34,'澳门','820000'); +/*!40000 ALTER TABLE `province` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `province1` +-- + +DROP TABLE IF EXISTS `province1`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `province1` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `code` varchar(6) NOT NULL, + `val` varchar(20) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM AUTO_INCREMENT=35 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `province1` +-- + +LOCK TABLES `province1` WRITE; +/*!40000 ALTER TABLE `province1` DISABLE KEYS */; +INSERT INTO `province1` VALUES (1,'110000','北京市'),(2,'120000','天津市'),(3,'130000','河北省'),(4,'140000','山西省'),(5,'150000','内蒙古'),(6,'210000','辽宁省'),(7,'220000','吉林省'),(8,'230000','黑龙江'),(9,'310000','上海市'),(10,'320000','江苏省'),(11,'330000','浙江省'),(12,'340000','安徽省'),(13,'350000','福建省'),(14,'360000','江西省'),(15,'370000','山东省'),(16,'410000','河南省'),(17,'420000','湖北省'),(18,'430000','湖南省'),(19,'440000','广东省'),(20,'450000','广 西'),(21,'460000','海南省'),(22,'500000','重庆市'),(23,'510000','四川省'),(24,'520000','贵州省'),(25,'530000','云南省'),(26,'540000','西 藏'),(27,'610000','陕西省'),(28,'620000','甘肃省'),(29,'630000','青海省'),(30,'640000','宁 夏'),(31,'650000','新 疆'),(32,'710000','台湾省'),(33,'810000','香 港'),(34,'820000','澳 门'); +/*!40000 ALTER TABLE `province1` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `record_type` +-- + +DROP TABLE IF EXISTS `record_type`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `record_type` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `version` bigint(20) NOT NULL, + `val` varchar(255) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `val` (`val`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `record_type` +-- + +LOCK TABLES `record_type` WRITE; +/*!40000 ALTER TABLE `record_type` DISABLE KEYS */; +INSERT INTO `record_type` VALUES (1,0,'Account'),(2,0,'Contact'),(3,0,'Call'),(4,0,'Coaching'),(5,0,'AccuntTeam'),(6,0,'ContactTeam'); +/*!40000 ALTER TABLE `record_type` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `region_level1_pl` +-- + +DROP TABLE IF EXISTS `region_level1_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `region_level1_pl` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `region_level1_pl` +-- + +LOCK TABLES `region_level1_pl` WRITE; +/*!40000 ALTER TABLE `region_level1_pl` DISABLE KEYS */; +INSERT INTO `region_level1_pl` VALUES (1,'北中国'),(2,'南中国'),(3,'东中国'); +/*!40000 ALTER TABLE `region_level1_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `region_level2_pl` +-- + +DROP TABLE IF EXISTS `region_level2_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `region_level2_pl` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `region_level2_pl` +-- + +LOCK TABLES `region_level2_pl` WRITE; +/*!40000 ALTER TABLE `region_level2_pl` DISABLE KEYS */; +INSERT INTO `region_level2_pl` VALUES (1,'华北'),(2,'西北'),(3,'东北'),(4,'西南'),(5,'华南'),(6,'华中'),(7,'华东'); +/*!40000 ALTER TABLE `region_level2_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `role` +-- + +DROP TABLE IF EXISTS `role`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `role` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + `name` varchar(45) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `role` +-- + +LOCK TABLES `role` WRITE; +/*!40000 ALTER TABLE `role` DISABLE KEYS */; +INSERT INTO `role` VALUES (1,'高级用户','全部'),(2,'主管','只读'),(3,'销售代表','只读'); +/*!40000 ALTER TABLE `role` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `sales_visiting_purpose_pl` +-- + +DROP TABLE IF EXISTS `sales_visiting_purpose_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `sales_visiting_purpose_pl` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `sales_visiting_purpose_pl` +-- + +LOCK TABLES `sales_visiting_purpose_pl` WRITE; +/*!40000 ALTER TABLE `sales_visiting_purpose_pl` DISABLE KEYS */; +INSERT INTO `sales_visiting_purpose_pl` VALUES (1,'会议安排'),(2,'会议跟进'),(3,'交接工作'),(4,'了解竞争'); +/*!40000 ALTER TABLE `sales_visiting_purpose_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `score1_pl` +-- + +DROP TABLE IF EXISTS `score1_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `score1_pl` ( + `id` int(11) NOT NULL DEFAULT '0', + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `score1_pl` +-- + +LOCK TABLES `score1_pl` WRITE; +/*!40000 ALTER TABLE `score1_pl` DISABLE KEYS */; +INSERT INTO `score1_pl` VALUES (0,'0'),(1,'1'),(2,'2'),(3,'3'),(4,'4'),(5,'5'),(6,'6'),(7,'7'),(8,'8'),(9,'9'),(10,'10'),(11,'11'),(12,'12'),(13,'13'),(14,'14'),(15,'15'); +/*!40000 ALTER TABLE `score1_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `score2_pl` +-- + +DROP TABLE IF EXISTS `score2_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `score2_pl` ( + `id` int(11) NOT NULL DEFAULT '0', + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `score2_pl` +-- + +LOCK TABLES `score2_pl` WRITE; +/*!40000 ALTER TABLE `score2_pl` DISABLE KEYS */; +INSERT INTO `score2_pl` VALUES (0,'0'),(1,'1'),(2,'2'),(3,'3'),(4,'4'),(5,'5'),(6,'6'),(7,'7'),(8,'8'),(9,'9'),(10,'10'),(11,'11'),(12,'12'),(13,'13'),(14,'14'),(15,'15'),(16,'16'),(17,'17'),(18,'18'),(19,'19'),(20,'20'); +/*!40000 ALTER TABLE `score2_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `sex_pl` +-- + +DROP TABLE IF EXISTS `sex_pl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `sex_pl` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `sex_pl` +-- + +LOCK TABLES `sex_pl` WRITE; +/*!40000 ALTER TABLE `sex_pl` DISABLE KEYS */; +INSERT INTO `sex_pl` VALUES (1,'男'),(2,'女'); +/*!40000 ALTER TABLE `sex_pl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `test_main` +-- + +DROP TABLE IF EXISTS `test_main`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `test_main` ( + `id` int(11) NOT NULL DEFAULT '0', + `value` varchar(10) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `test_main` +-- + +LOCK TABLES `test_main` WRITE; +/*!40000 ALTER TABLE `test_main` DISABLE KEYS */; +INSERT INTO `test_main` VALUES (1,'ONE'),(2,'TWO'); +/*!40000 ALTER TABLE `test_main` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `test_sub` +-- + +DROP TABLE IF EXISTS `test_sub`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `test_sub` ( + `id` int(11) NOT NULL DEFAULT '0', + `main_id` int(11) DEFAULT NULL, + `value` varchar(10) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `test_sub` +-- + +LOCK TABLES `test_sub` WRITE; +/*!40000 ALTER TABLE `test_sub` DISABLE KEYS */; +INSERT INTO `test_sub` VALUES (1,1,'ONEONE'),(2,2,'TWOTWO'); +/*!40000 ALTER TABLE `test_sub` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `user_position` +-- + +DROP TABLE IF EXISTS `user_position`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `user_position` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `userId` int(32) DEFAULT NULL, + `positionId` int(32) DEFAULT NULL, + `status` int(11) DEFAULT NULL, + `createtime` datetime DEFAULT NULL, + `isPrimary` int(11) DEFAULT NULL, + `externalId` varchar(128) DEFAULT NULL, + `whenadded` datetime DEFAULT NULL, + `modifier` varchar(255) DEFAULT NULL, + `modify_datetime` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `positionId` (`positionId`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `user_position` +-- + +LOCK TABLES `user_position` WRITE; +/*!40000 ALTER TABLE `user_position` DISABLE KEYS */; +INSERT INTO `user_position` VALUES (1,1,1,NULL,NULL,1,NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `user_position` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Temporary table structure for view `user_position_account` +-- + +DROP TABLE IF EXISTS `user_position_account`; +/*!50001 DROP VIEW IF EXISTS `user_position_account`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `user_position_account` ( + `id` tinyint NOT NULL, + `userName` tinyint NOT NULL, + `loginName` tinyint NOT NULL, + `email` tinyint NOT NULL, + `sex` tinyint NOT NULL, + `addTime` tinyint NOT NULL, + `positionName` tinyint NOT NULL, + `positionCode` tinyint NOT NULL, + `reportTo` tinyint NOT NULL, + `reporttto` tinyint NOT NULL, + `role` tinyint NOT NULL, + `regoin1` tinyint NOT NULL, + `regoin2` tinyint NOT NULL, + `city` tinyint NOT NULL, + `accountName` tinyint NOT NULL, + `BDMCode` tinyint NOT NULL, + `adminLevel` tinyint NOT NULL, + `status` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; + +-- +-- Temporary table structure for view `user_position_query` +-- + +DROP TABLE IF EXISTS `user_position_query`; +/*!50001 DROP VIEW IF EXISTS `user_position_query`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE TABLE `user_position_query` ( + `user_id` tinyint NOT NULL, + `position_id` tinyint NOT NULL, + `area` tinyint NOT NULL, + `region` tinyint NOT NULL, + `province` tinyint NOT NULL, + `productLine` tinyint NOT NULL, + `position_level` tinyint NOT NULL, + `position_name` tinyint NOT NULL, + `position_code` tinyint NOT NULL, + `delegatePosition` tinyint NOT NULL, + `delegateName` tinyint NOT NULL, + `manager_position_id` tinyint NOT NULL, + `managerPosition` tinyint NOT NULL, + `manager_position_name` tinyint NOT NULL, + `manager_position_level` tinyint NOT NULL, + `manager_employee_number` tinyint NOT NULL, + `regionManager` tinyint NOT NULL, + `accountName` tinyint NOT NULL, + `BDMcode` tinyint NOT NULL +) ENGINE=MyISAM */; +SET character_set_client = @saved_cs_client; + +-- +-- Table structure for table `userinfo` +-- + +DROP TABLE IF EXISTS `userinfo`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `userinfo` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `department` varchar(255) DEFAULT NULL, + `division` varchar(255) DEFAULT NULL, + `cellPhone` varchar(255) DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `employeeNumber` varchar(255) DEFAULT NULL, + `photo` varchar(255) DEFAULT NULL, + `jobTitle` varchar(255) DEFAULT NULL, + `pl1` mediumint(9) DEFAULT NULL, + `pl2` mediumint(9) DEFAULT NULL, + `role` mediumint(9) DEFAULT NULL, + `pl4` mediumint(9) DEFAULT NULL, + `pl5` mediumint(9) DEFAULT NULL, + `sex` mediumint(9) DEFAULT NULL, + `loginName` varchar(255) DEFAULT NULL, + `password` varchar(255) DEFAULT NULL, + `sessionKey` varchar(255) DEFAULT NULL, + `lastLoginTime` bigint(20) DEFAULT NULL, + `whenadded` datetime DEFAULT NULL, + `parcel` varchar(255) DEFAULT NULL, + `modifier` varchar(255) DEFAULT NULL, + `modify_datetime` datetime DEFAULT NULL, + `owner` varchar(255) DEFAULT NULL, + `province` int(11) DEFAULT NULL, + `city` int(11) DEFAULT NULL, + `office_tel` varchar(255) DEFAULT NULL, + `num_of_signIn` mediumint(9) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE, + UNIQUE KEY `employeeNumber` (`employeeNumber`), + UNIQUE KEY `loginName_UNIQUE` (`loginName`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `userinfo` +-- + +LOCK TABLES `userinfo` WRITE; +/*!40000 ALTER TABLE `userinfo` DISABLE KEYS */; +INSERT INTO `userinfo` VALUES (-1,'无',NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,1,NULL,NULL,1,'dummy','827ccb0eea8a706c4c34a16891f84e7b',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(1,'Admin Nam',NULL,NULL,NULL,'tigerzhou@rexen.com.cn',NULL,NULL,NULL,1,NULL,1,NULL,NULL,1,'admin','827ccb0eea8a706c4c34a16891f84e7b',NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,1,NULL,NULL); +/*!40000 ALTER TABLE `userinfo` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Final view structure for view `activity_alert` +-- + +/*!50001 DROP TABLE IF EXISTS `activity_alert`*/; +/*!50001 DROP VIEW IF EXISTS `activity_alert`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`crm`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `activity_alert` AS select `act`.`id` AS `id`,(case when ((to_days(curdate()) - to_days(date_format(from_unixtime((`act`.`starttime` / 1000)),'%Y-%m-%d'))) = 0) then '今天' when ((to_days(curdate()) - to_days(date_format(from_unixtime((`act`.`starttime` / 1000)),'%Y-%m-%d'))) = 1) then '昨天' when ((to_days(curdate()) - to_days(date_format(from_unixtime((`act`.`starttime` / 1000)),'%Y-%m-%d'))) = 2) then '前天' when (((to_days(curdate()) - to_days(date_format(from_unixtime((`act`.`starttime` / 1000)),'%Y-%m-%d'))) >= 3) and ((to_days(curdate()) - to_days(date_format(from_unixtime((`act`.`starttime` / 1000)),'%Y-%m-%d'))) < 7)) then '三天以前' when ((to_days(curdate()) - to_days(date_format(from_unixtime((`act`.`starttime` / 1000)),'%Y-%m-%d'))) >= 7) then '七天以前' else '错误' end) AS `time`,`act`.`title` AS `title`,`act`.`owner` AS `name`,`act`.`starttime` AS `times` from `activity` `act` where ((`act`.`status` = 1) and ((to_days(curdate()) - to_days(date_format(from_unixtime((`act`.`starttime` / 1000)),'%Y-%m-%d'))) >= 0)) order by `act`.`starttime` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; + +-- +-- Final view structure for view `parent_position` +-- + +/*!50001 DROP TABLE IF EXISTS `parent_position`*/; +/*!50001 DROP VIEW IF EXISTS `parent_position`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`crm`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `parent_position` AS select `crmuser`.`id` AS `id`,`crmuser`.`name` AS `name`,`crmuser`.`code` AS `code`,`crmuser`.`reportto` AS `reportto`,`crmuser`.`role` AS `role`,`crmuser`.`pl1` AS `pl1`,`crmuser`.`pl2` AS `pl2`,`crmuser`.`pl4` AS `pl4`,`crmuser`.`pl5` AS `pl5`,`crmuser`.`city` AS `city`,`crmuser`.`department` AS `department`,`crmuser`.`whenadded` AS `whenadded`,`crmuser`.`modifier` AS `modifier`,`crmuser`.`modify_datetime` AS `modify_datetime`,`crmuser`.`owner` AS `owner`,`crmuser`.`level` AS `level` from `crmuser` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; + +-- +-- Final view structure for view `parent_user_info` +-- + +/*!50001 DROP TABLE IF EXISTS `parent_user_info`*/; +/*!50001 DROP VIEW IF EXISTS `parent_user_info`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`crm`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `parent_user_info` AS select `userinfo`.`id` AS `id`,`userinfo`.`name` AS `name`,`userinfo`.`department` AS `department`,`userinfo`.`division` AS `division`,`userinfo`.`cellPhone` AS `cellPhone`,`userinfo`.`email` AS `email`,`userinfo`.`employeeNumber` AS `employeeNumber`,`userinfo`.`photo` AS `photo`,`userinfo`.`jobTitle` AS `jobTitle`,`userinfo`.`pl1` AS `pl1`,`userinfo`.`pl2` AS `pl2`,`userinfo`.`role` AS `role`,`userinfo`.`pl4` AS `pl4`,`userinfo`.`pl5` AS `pl5`,`userinfo`.`sex` AS `sex`,`userinfo`.`loginName` AS `loginName`,`userinfo`.`password` AS `password`,`userinfo`.`sessionKey` AS `sessionKey`,`userinfo`.`lastLoginTime` AS `lastLoginTime`,`userinfo`.`whenadded` AS `whenadded`,`userinfo`.`parcel` AS `parcel`,`userinfo`.`modifier` AS `modifier`,`userinfo`.`modify_datetime` AS `modify_datetime`,`userinfo`.`owner` AS `owner`,`userinfo`.`province` AS `province`,`userinfo`.`city` AS `city`,`userinfo`.`office_tel` AS `office_tel`,`userinfo`.`num_of_signIn` AS `num_of_signIn` from `userinfo` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; + +-- +-- Final view structure for view `parent_user_position` +-- + +/*!50001 DROP TABLE IF EXISTS `parent_user_position`*/; +/*!50001 DROP VIEW IF EXISTS `parent_user_position`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`crm`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `parent_user_position` AS select `user_position`.`id` AS `id`,`user_position`.`userId` AS `userId`,`user_position`.`positionId` AS `positionId`,`user_position`.`status` AS `status`,`user_position`.`createtime` AS `createtime`,`user_position`.`isPrimary` AS `isPrimary`,`user_position`.`externalId` AS `externalId`,`user_position`.`whenadded` AS `whenadded`,`user_position`.`modifier` AS `modifier`,`user_position`.`modify_datetime` AS `modify_datetime` from `user_position` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; + +-- +-- Final view structure for view `user_position_account` +-- + +/*!50001 DROP TABLE IF EXISTS `user_position_account`*/; +/*!50001 DROP VIEW IF EXISTS `user_position_account`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`crm`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `user_position_account` AS select `ac`.`id` AS `id`,`u`.`name` AS `userName`,`u`.`loginName` AS `loginName`,`u`.`email` AS `email`,`sp`.`val` AS `sex`,`u`.`whenadded` AS `addTime`,`c`.`name` AS `positionName`,`c`.`code` AS `positionCode`,(select `crm`.`name` from `crmuser` `crm` where (`crm`.`id` = `c`.`reportto`)) AS `reportTo`,(select `c1`.`name` from `crmuser` `c1` where (`c1`.`id` = (select `c2`.`reportto` from `crmuser` `c2` where (`c2`.`id` = `c`.`reportto`)))) AS `reporttto`,`r`.`val` AS `role`,`rlp4`.`val` AS `regoin1`,`rlp5`.`val` AS `regoin2`,`ct`.`val` AS `city`,`a`.`name` AS `accountName`,`a`.`bdm_code` AS `BDMCode`,`aalp`.`val` AS `adminLevel`,`asp`.`val` AS `status` from (((((((((((`userinfo` `u` left join `sex_pl` `sp` on((`u`.`sex` = `sp`.`id`))) left join `user_position` `up` on((`u`.`id` = `up`.`userId`))) left join `crmuser` `c` on((`up`.`positionId` = `c`.`id`))) left join `role` `r` on((`c`.`role` = `r`.`id`))) left join `region_level1_pl` `rlp4` on((`c`.`pl4` = `rlp4`.`id`))) left join `region_level1_pl` `rlp5` on((`c`.`pl5` = `rlp5`.`id`))) left join `city` `ct` on((`c`.`city` = `ct`.`id`))) left join `accountcrmuser` `ac` on((`c`.`id` = `ac`.`crmuserId`))) left join `account` `a` on((`ac`.`accountId` = `a`.`id`))) left join `account_status_pl` `asp` on((`a`.`status` = `asp`.`id`))) left join `account_administrativ_level_pl` `aalp` on((`a`.`administrativ_level` = `aalp`.`id`))) where (`up`.`status` = 1) order by `ac`.`id` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; + +-- +-- Final view structure for view `user_position_query` +-- + +/*!50001 DROP TABLE IF EXISTS `user_position_query`*/; +/*!50001 DROP VIEW IF EXISTS `user_position_query`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`crm`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `user_position_query` AS select `user_position`.`userId` AS `user_id`,`user_position`.`positionId` AS `position_id`,`region_level1_pl`.`val` AS `area`,`region_level2_pl`.`val` AS `region`,`province`.`val` AS `province`,`crmuser_pl2`.`val` AS `productLine`,`crmuser`.`level` AS `position_level`,`crmuser`.`name` AS `position_name`,`crmuser`.`code` AS `position_code`,`userinfo`.`employeeNumber` AS `delegatePosition`,`userinfo`.`name` AS `delegateName`,`parent_position`.`id` AS `manager_position_id`,`parent_position`.`code` AS `managerPosition`,`parent_position`.`name` AS `manager_position_name`,`parent_position`.`level` AS `manager_position_level`,`parent_user_info`.`employeeNumber` AS `manager_employee_number`,`parent_user_info`.`name` AS `regionManager`,`account`.`name` AS `accountName`,`account`.`bdm_code` AS `BDMcode` from (((((((((((`user_position` left join `crmuser` on((`user_position`.`positionId` = `crmuser`.`id`))) left join `userinfo` on((`user_position`.`userId` = `userinfo`.`id`))) left join `parent_position` on((`crmuser`.`reportto` = `parent_position`.`id`))) left join `parent_user_position` on((`parent_position`.`id` = `parent_user_position`.`positionId`))) left join `parent_user_info` on((`parent_user_position`.`userId` = `parent_user_info`.`id`))) join `accountcrmuser` on((`user_position`.`positionId` = `accountcrmuser`.`crmuserId`))) join `account` on((`accountcrmuser`.`accountId` = `account`.`id`))) left join `region_level1_pl` on((`crmuser`.`pl4` = `region_level1_pl`.`id`))) left join `region_level2_pl` on((`crmuser`.`pl5` = `region_level2_pl`.`id`))) left join `province` on((`account`.`province` = `province`.`id`))) left join `crmuser_pl2` on((`crmuser_pl2`.`id` = `crmuser`.`pl2`))) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2013-11-26 23:55:19 diff --git a/crm/src/main/db/grant.sql b/crm/src/main/db/grant.sql new file mode 100644 index 0000000..bb4a3fd --- /dev/null +++ b/crm/src/main/db/grant.sql @@ -0,0 +1,4 @@ +GRANT ALL ON crmdb.* TO 'crm' IDENTIFIED BY ''; +GRANT ALL ON crmdb.* TO 'crm'@'localhost' IDENTIFIED BY ''; +GRANT SELECT ON mysql.proc TO 'crm' IDENTIFIED BY ''; +GRANT SELECT ON mysql.proc TO 'crm'@'localhost' IDENTIFIED BY ''; diff --git a/crm/src/main/db/load.sql b/crm/src/main/db/load.sql new file mode 100644 index 0000000..ceb1d92 --- /dev/null +++ b/crm/src/main/db/load.sql @@ -0,0 +1,575 @@ +drop table if exists boolean_pl; +CREATE TABLE boolean_pl +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + val VARCHAR(255), + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; +INSERT INTO boolean_pl (val) VALUES('是'); +INSERT INTO boolean_pl (val) VALUES('否'); + +-- 医院行政级别 +drop table if exists account_administrativ_level_pl; +CREATE TABLE account_administrativ_level_pl +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + val VARCHAR(255), + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; +INSERT INTO account_administrativ_level_pl (val) VALUES('一级'); +INSERT INTO account_administrativ_level_pl (val) VALUES('一级甲等'); +INSERT INTO account_administrativ_level_pl (val) VALUES('一级乙等'); +INSERT INTO account_administrativ_level_pl (val) VALUES('一级丙等'); +INSERT INTO account_administrativ_level_pl (val) VALUES('二级'); +INSERT INTO account_administrativ_level_pl (val) VALUES('二级甲等'); +INSERT INTO account_administrativ_level_pl (val) VALUES('二级乙等'); +INSERT INTO account_administrativ_level_pl (val) VALUES('二级丙等'); +INSERT INTO account_administrativ_level_pl (val) VALUES('三级'); +INSERT INTO account_administrativ_level_pl (val) VALUES('三级甲等'); +INSERT INTO account_administrativ_level_pl (val) VALUES('三级乙等'); +INSERT INTO account_administrativ_level_pl (val) VALUES('三级丙等'); +INSERT INTO account_administrativ_level_pl (val) VALUES('未评级未评等'); + +-- 医院分级 +drop table if exists account_grade_pl; +CREATE TABLE account_grade_pl +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + val VARCHAR(255), + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; +INSERT INTO account_grade_pl (val) VALUES('A'); +INSERT INTO account_grade_pl (val) VALUES('B'); +INSERT INTO account_grade_pl (val) VALUES('C'); +INSERT INTO account_grade_pl (val) VALUES('D'); + + +-- 医院状态 +drop table if exists account_status_pl; +CREATE TABLE account_status_pl +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + val VARCHAR(255), + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; +INSERT INTO account_status_pl (val) VALUES ('无效'); +INSERT INTO account_status_pl (val) VALUES('有效'); + + +drop table if exists account_local_or_army_pl; +CREATE TABLE account_local_or_army_pl +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + val VARCHAR(255), + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; +INSERT INTO account_local_or_army_pl (val) VALUES ('地方医院'); +INSERT INTO account_local_or_army_pl (val) VALUES('部队医院'); + +drop table if exists account_comprehensive_or_specialized_pl; +CREATE TABLE account_comprehensive_or_specialized_pl +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + val VARCHAR(255), + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; +INSERT INTO account_comprehensive_or_specialized_pl (val) VALUES ('综合医院'); +INSERT INTO account_comprehensive_or_specialized_pl (val) VALUES('专科医院'); + + +drop table if exists account_market_classification_pl; +CREATE TABLE account_market_classification_pl +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + val VARCHAR(255), + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; +INSERT INTO account_market_classification_pl (val) VALUES ('战略城市'); +INSERT INTO account_market_classification_pl (val) VALUES('一级城市'); +INSERT INTO account_market_classification_pl (val) VALUES('二级城市'); +INSERT INTO account_market_classification_pl (val) VALUES('三级城市'); +INSERT INTO account_market_classification_pl (val) VALUES('四级城市'); + +drop table if exists account_type_pl; +CREATE TABLE account_type_pl +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + val VARCHAR(255), + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; +INSERT INTO account_type_pl (val) VALUES ('癌痛目标医院'); +INSERT INTO account_type_pl (val) VALUES('慢痛目标医院'); +INSERT INTO account_type_pl (val) VALUES('奥诺美目标医院'); +INSERT INTO account_type_pl (val) VALUES('非目标医院'); + +drop table if exists account_point_pl; +CREATE TABLE account_point_pl +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + val VARCHAR(255), + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; +INSERT INTO account_point_pl (val) VALUES ('癌痛重点医院'); +INSERT INTO account_point_pl (val) VALUES('慢痛重点医院'); +INSERT INTO account_point_pl (val) VALUES('奥诺美重点医院'); +INSERT INTO account_point_pl (val) VALUES('非重点医院'); + + +--activity related picklist +-- 类型 +drop table if exists activity_event_type_pl; +CREATE TABLE activity_event_type_pl +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + val VARCHAR(255), + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; +INSERT INTO activity_event_type_pl (val) VALUES('拜访'); +INSERT INTO activity_event_type_pl (val) VALUES('辅导'); + +-- 活动状态; +drop table if exists activity_status_pl; +CREATE TABLE activity_status_pl +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + val VARCHAR(255), + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; +INSERT INTO activity_status_pl (val) VALUES('计划'); +INSERT INTO activity_status_pl (val) VALUES('完成'); +INSERT INTO activity_status_pl (val) VALUES('取消'); + +drop table if exists activity_activity_types_pl; +CREATE TABLE activity_activity_types_pl +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + val VARCHAR(255), + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; +INSERT INTO activity_activity_types_pl (val) VALUES('专业化拜访'); +INSERT INTO activity_activity_types_pl (val) VALUES('事务性拜访'); + +drop table if exists activity_visiting_purpose_pl; +CREATE TABLE activity_visiting_purpose_pl +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + val VARCHAR(255), + activity_type MEDIUMINT, + parentId MEDIUMINT, + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; +INSERT INTO activity_visiting_purpose_pl (val,activity_type,parentId) VALUES('传递产品知识',1,1); +INSERT INTO activity_visiting_purpose_pl (val,activity_type,parentId) VALUES('处方观念沟通',1,1); +INSERT INTO activity_visiting_purpose_pl (val,activity_type,parentId) VALUES('病例沟通',1,1); +INSERT INTO activity_visiting_purpose_pl (val,activity_type,parentId) VALUES('会议安排',2,2); +INSERT INTO activity_visiting_purpose_pl (val,activity_type,parentId) VALUES('会议跟进',2,2); +INSERT INTO activity_visiting_purpose_pl (val,activity_type,parentId) VALUES('交接工作',2,2); +INSERT INTO activity_visiting_purpose_pl (val,activity_type,parentId) VALUES('了解竞争',2,2); + +-- 拜访目的1 +drop table if exists sales_visiting_purpose_pl; +CREATE TABLE sales_visiting_purpose_pl +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + val VARCHAR(255), + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; +INSERT INTO sales_visiting_purpose_pl (val) VALUES('会议安排'); +INSERT INTO sales_visiting_purpose_pl (val) VALUES('会议跟进'); +INSERT INTO sales_visiting_purpose_pl (val) VALUES('交接工作'); +INSERT INTO sales_visiting_purpose_pl (val) VALUES('了解竞争'); + +-- 拜访目的2 +drop table if exists com_visiting_purpose_pl; +CREATE TABLE com_visiting_purpose_pl +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + val VARCHAR(255), + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; +INSERT INTO com_visiting_purpose_pl (val) VALUES('处方观念沟通'); +INSERT INTO com_visiting_purpose_pl (val) VALUES('病例沟通'); + + +drop table if exists activity_feature_product_pl; +CREATE TABLE activity_feature_product_pl +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + val VARCHAR(255), + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; +INSERT INTO activity_feature_product_pl (val) VALUES('美施康定'); +INSERT INTO activity_feature_product_pl (val) VALUES('奥施康定'); +INSERT INTO activity_feature_product_pl (val) VALUES('奇曼丁'); +INSERT INTO activity_feature_product_pl (val) VALUES('若思本'); +INSERT INTO activity_feature_product_pl (val) VALUES('奥诺美'); + +-- 性别; +drop table if exists sex_pl; +CREATE TABLE sex_pl +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + val VARCHAR(255), + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; +INSERT INTO sex_pl (val) VALUES('男'); +INSERT INTO sex_pl (val) VALUES('女'); +-- 科室 +drop table if exists contact_department_pl; +CREATE TABLE contact_department_pl +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + val VARCHAR(255), + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; +INSERT INTO contact_department_pl (val) VALUES('ICU'); +INSERT INTO contact_department_pl (val) VALUES('保健科'); +INSERT INTO contact_department_pl (val) VALUES('采购科'); +INSERT INTO contact_department_pl (val) VALUES('传染科'); +INSERT INTO contact_department_pl (val) VALUES('创伤外科'); +INSERT INTO contact_department_pl (val) VALUES('儿科'); +INSERT INTO contact_department_pl (val) VALUES('耳鼻喉科'); +INSERT INTO contact_department_pl (val) VALUES('方便门诊'); +INSERT INTO contact_department_pl (val) VALUES('放化疗科'); +INSERT INTO contact_department_pl (val) VALUES('放疗科'); +INSERT INTO contact_department_pl (val) VALUES('放射科'); +INSERT INTO contact_department_pl (val) VALUES('风湿科'); +INSERT INTO contact_department_pl (val) VALUES('妇产科'); +INSERT INTO contact_department_pl (val) VALUES('妇科'); +INSERT INTO contact_department_pl (val) VALUES('肝胆外科'); +INSERT INTO contact_department_pl (val) VALUES('感染科'); +INSERT INTO contact_department_pl (val) VALUES('肛肠科'); +INSERT INTO contact_department_pl (val) VALUES('姑息科'); +INSERT INTO contact_department_pl (val) VALUES('骨科'); +INSERT INTO contact_department_pl (val) VALUES('国际医疗科'); +INSERT INTO contact_department_pl (val) VALUES('核医学科'); +INSERT INTO contact_department_pl (val) VALUES('呼吸内科'); +INSERT INTO contact_department_pl (val) VALUES('护理部'); +INSERT INTO contact_department_pl (val) VALUES('急诊科'); +INSERT INTO contact_department_pl (val) VALUES('介入科'); +INSERT INTO contact_department_pl (val) VALUES('康复科'); +INSERT INTO contact_department_pl (val) VALUES('口腔科'); +INSERT INTO contact_department_pl (val) VALUES('老干科'); +INSERT INTO contact_department_pl (val) VALUES('麻醉科'); +INSERT INTO contact_department_pl (val) VALUES('泌尿外科'); +INSERT INTO contact_department_pl (val) VALUES('脑外科'); +INSERT INTO contact_department_pl (val) VALUES('内分泌科'); +INSERT INTO contact_department_pl (val) VALUES('内科'); +INSERT INTO contact_department_pl (val) VALUES('宁养院'); +INSERT INTO contact_department_pl (val) VALUES('皮肤科'); +INSERT INTO contact_department_pl (val) VALUES('普外科'); +INSERT INTO contact_department_pl (val) VALUES('乳腺外科'); +INSERT INTO contact_department_pl (val) VALUES('烧伤整形科'); +INSERT INTO contact_department_pl (val) VALUES('神经科'); +INSERT INTO contact_department_pl (val) VALUES('神经内科'); +INSERT INTO contact_department_pl (val) VALUES('神经外科'); +INSERT INTO contact_department_pl (val) VALUES('肾内科'); +INSERT INTO contact_department_pl (val) VALUES('生物治疗科'); +INSERT INTO contact_department_pl (val) VALUES('特需科'); +INSERT INTO contact_department_pl (val) VALUES('疼痛科'); +INSERT INTO contact_department_pl (val) VALUES('外科'); +INSERT INTO contact_department_pl (val) VALUES('微创科'); +INSERT INTO contact_department_pl (val) VALUES('胃肠外科'); +INSERT INTO contact_department_pl (val) VALUES('消化科'); +INSERT INTO contact_department_pl (val) VALUES('消化内科'); +INSERT INTO contact_department_pl (val) VALUES('消化外科'); +INSERT INTO contact_department_pl (val) VALUES('心内科'); +INSERT INTO contact_department_pl (val) VALUES('心胸外科'); +INSERT INTO contact_department_pl (val) VALUES('血管外科'); +INSERT INTO contact_department_pl (val) VALUES('血透室'); +INSERT INTO contact_department_pl (val) VALUES('血液科'); +INSERT INTO contact_department_pl (val) VALUES('药剂科'); +INSERT INTO contact_department_pl (val) VALUES('医保办'); +INSERT INTO contact_department_pl (val) VALUES('医务科'); +INSERT INTO contact_department_pl (val) VALUES('整形美容科'); +INSERT INTO contact_department_pl (val) VALUES('质控科'); +INSERT INTO contact_department_pl (val) VALUES('中西医结合科'); +INSERT INTO contact_department_pl (val) VALUES('中医科'); +INSERT INTO contact_department_pl (val) VALUES('肿瘤科'); +INSERT INTO contact_department_pl (val) VALUES('肿瘤内科'); +INSERT INTO contact_department_pl (val) VALUES('肿瘤外科'); +INSERT INTO contact_department_pl (val) VALUES('综合科'); +INSERT INTO contact_department_pl (val) VALUES('其他'); + +-- 行政职务; +drop table if exists contact_duty_pl; +CREATE TABLE contact_duty_pl +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + val VARCHAR(255), + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; + +INSERT INTO contact_duty_pl (val) VALUES('医生'); +INSERT INTO contact_duty_pl (val) VALUES('副主任'); +INSERT INTO contact_duty_pl (val) VALUES('主任'); +INSERT INTO contact_duty_pl (val) VALUES('副院长'); +INSERT INTO contact_duty_pl (val) VALUES('院长'); +INSERT INTO contact_duty_pl (val) VALUES('院长助理'); +INSERT INTO contact_duty_pl (val) VALUES('副书记'); +INSERT INTO contact_duty_pl (val) VALUES('书记'); +INSERT INTO contact_duty_pl (val) VALUES('护士'); +INSERT INTO contact_duty_pl (val) VALUES('护士长'); +INSERT INTO contact_duty_pl (val) VALUES('库管'); +INSERT INTO contact_duty_pl (val) VALUES('采购'); +INSERT INTO contact_duty_pl (val) VALUES('采购科科长'); +INSERT INTO contact_duty_pl (val) VALUES('药师'); +INSERT INTO contact_duty_pl (val) VALUES('药剂科副主任'); +INSERT INTO contact_duty_pl (val) VALUES('药剂科主任'); +INSERT INTO contact_duty_pl (val) VALUES('医务科副科长'); +INSERT INTO contact_duty_pl (val) VALUES('医务科科长'); +INSERT INTO contact_duty_pl (val) VALUES('医保办主任'); +INSERT INTO contact_duty_pl (val) VALUES('科教科主任'); +INSERT INTO contact_duty_pl (val) VALUES('信息科科长'); +INSERT INTO contact_duty_pl (val) VALUES('其他'); + + +-- 专业职务; +drop table if exists contact_job_title_pl; +CREATE TABLE contact_job_title_pl +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + val VARCHAR(255), + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; +INSERT INTO contact_job_title_pl (val) VALUES('住院医师'); +INSERT INTO contact_job_title_pl (val) VALUES('主治医师'); +INSERT INTO contact_job_title_pl (val) VALUES('副主任医师'); +INSERT INTO contact_job_title_pl (val) VALUES('主任医师'); +INSERT INTO contact_job_title_pl (val) VALUES('护士'); +INSERT INTO contact_job_title_pl (val) VALUES('主管护师'); +INSERT INTO contact_job_title_pl (val) VALUES('副主任护士'); +INSERT INTO contact_job_title_pl (val) VALUES('主任护师'); +INSERT INTO contact_job_title_pl (val) VALUES('药师'); +INSERT INTO contact_job_title_pl (val) VALUES('主管药师'); +INSERT INTO contact_job_title_pl (val) VALUES('副主任药师'); +INSERT INTO contact_job_title_pl (val) VALUES('主任药师'); +INSERT INTO contact_job_title_pl (val) VALUES('技师'); +INSERT INTO contact_job_title_pl (val) VALUES('主管技师'); +INSERT INTO contact_job_title_pl (val) VALUES('副主任技师'); +INSERT INTO contact_job_title_pl (val) VALUES('主任技师'); +INSERT INTO contact_job_title_pl (val) VALUES('其他'); + +-- 状态; +drop table if exists contact_status_pl; +CREATE TABLE contact_status_pl +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + val VARCHAR(255), + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; +INSERT INTO contact_status_pl (val) VALUES('无效'); +INSERT INTO contact_status_pl (val) VALUES('有效'); + +-- 级别; +drop table if exists contact_grade_pl; +CREATE TABLE contact_grade_pl +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + val VARCHAR(255), + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; +INSERT INTO contact_grade_pl (val) VALUES('A'); +INSERT INTO contact_grade_pl (val) VALUES('B'); +INSERT INTO contact_grade_pl (val) VALUES('C'); +INSERT INTO contact_grade_pl (val) VALUES('D'); + +drop table if exists contact_market_classification_pl; +CREATE TABLE contact_market_classification_pl +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + val VARCHAR(255), + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; +INSERT INTO contact_market_classification_pl (val) VALUES ('战略城市'); +INSERT INTO contact_market_classification_pl (val) VALUES('一级城市'); +INSERT INTO contact_market_classification_pl (val) VALUES('二级城市'); +INSERT INTO contact_market_classification_pl (val) VALUES('三级城市'); +INSERT INTO contact_market_classification_pl (val) VALUES('四级城市'); + + +drop table if exists contact_generalization_target_pl; +CREATE TABLE contact_generalization_target_pl +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + val VARCHAR(255), + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; +INSERT INTO contact_generalization_target_pl (val) VALUES ('美施康定'); +INSERT INTO contact_generalization_target_pl (val) VALUES('奥施康定'); +INSERT INTO contact_generalization_target_pl (val) VALUES('奇曼丁'); +INSERT INTO contact_generalization_target_pl (val) VALUES('若思本'); +INSERT INTO contact_generalization_target_pl (val) VALUES('奥诺美'); + + +-- pick list for crmuser +-- 状态; +drop table if exists crmuser_pl1; +CREATE TABLE crmuser_pl1 +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + val VARCHAR(255), + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; +INSERT INTO `crmuser_pl1` (val) VALUES ('无效'); +INSERT INTO `crmuser_pl1` (val) VALUES ('有效'); + +-- 产品线; +drop table if exists crmuser_pl2; +CREATE TABLE crmuser_pl2 +( + id MEDIUMINT NOT NULL, + val VARCHAR(255), + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; +-- 产品线; +INSERT INTO crmuser_pl2 (id,val) VALUES(1,'麻药'); +INSERT INTO crmuser_pl2 (id,val) VALUES(2,'慢痛'); +INSERT INTO crmuser_pl2 (id,val) VALUES(3,'奥诺美'); +INSERT INTO crmuser_pl2 (id,val) VALUES(4,'全部'); + + +-- 角色; +drop table if exists role; +CREATE TABLE role +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + val VARCHAR(255), + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; +INSERT INTO `role` (val) VALUES ('管理员'); +INSERT INTO `role` (val) VALUES ('销售经理'); +INSERT INTO `role` (val) VALUES ('销售代表'); + +-- 一级区域; +drop table if exists region_level1_pl; +CREATE TABLE region_level1_pl +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + val VARCHAR(255), + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; + +INSERT INTO region_level1_pl (val) VALUES('北中国'); +INSERT INTO region_level1_pl (val) VALUES('南中国'); +INSERT INTO region_level1_pl (val) VALUES('东中国'); + +-- 二级区域; +drop table if exists region_level2_pl; +CREATE TABLE region_level2_pl +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + val VARCHAR(255), + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; +INSERT INTO region_level2_pl (val) VALUES('华北'); +INSERT INTO region_level2_pl (val) VALUES('西北'); +INSERT INTO region_level2_pl (val) VALUES('东北'); +INSERT INTO region_level2_pl (val) VALUES('西南'); +INSERT INTO region_level2_pl (val) VALUES('华南'); +INSERT INTO region_level2_pl (val) VALUES('华中'); +INSERT INTO region_level2_pl (val) VALUES('华东'); + +-- END of pick list for crmuser + +drop table if exists city; +CREATE TABLE city +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + name VARCHAR(255) NOT NULL, + provinceId VARCHAR(255) NOT NULL, + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; + +drop table if exists province; +CREATE TABLE province +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + name VARCHAR(255) NOT NULL, + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; + + +-- 拜访类型 +INSERT INTO activity_types (val) VALUES('拜访'); +INSERT INTO activity_types (val) VALUES('外部会议'); +INSERT INTO activity_types (val) VALUES('内部会议'); + + +DROP TABLE IF EXISTS `score1_pl`; +CREATE TABLE `score1_pl` ( + `id` int(11) NOT NULL DEFAULT '0', + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO `score1_pl` VALUES (0,'0'),(1,'1'),(2,'2'),(3,'3'),(4,'4'),(5,'5'),(6,'6'),(7,'7'),(8,'8'),(9,'9'),(10,'10'),(11,'11'),(12,'12'),(13,'13'),(14,'14'),(15,'15'); + + +DROP TABLE IF EXISTS `score2_pl`; +CREATE TABLE `score2_pl` ( + `id` int(11) NOT NULL DEFAULT '0', + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO `score2_pl` VALUES (0,'0'),(1,'1'),(2,'2'),(3,'3'),(4,'4'),(5,'5'),(6,'6'),(7,'7'),(8,'8'),(9,'9'),(10,'10'),(11,'11'),(12,'12'),(13,'13'),(14,'14'),(15,'15'),(16,'16'),(17,'17'),(18,'18'),(19,'19'),(20,'20'); + + +DROP TABLE IF EXISTS `crmuser_activited`; +CREATE TABLE `crmdb`.`crmuser_activited` ( + `id` MEDIUMINT(9) NOT NULL AUTO_INCREMENT, + `val` VARCHAR(255) NULL, + PRIMARY KEY (`id`) + )ENGINE=InnoDB; +INSERT INTO `crmdb`.`crmuser_activited` (`id`, `val`) VALUES ('1', '已激活'); +INSERT INTO `crmdb`.`crmuser_activited` (`id`, `val`) VALUES ('2', '未激活'); + + +DROP TABLE IF EXISTS `area`; +DROP TABLE IF EXISTS `city`; +DROP TABLE IF EXISTS `province`; + +DROP TABLE IF EXISTS `area`; +CREATE TABLE `area` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `val` varchar(20) DEFAULT NULL, + `externalId` varchar(20) DEFAULT NULL, + `parentId` int(11) NOT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `area_parentid_cons` FOREIGN KEY (`parentId`) REFERENCES `city` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE InnoDB; + +DROP TABLE IF EXISTS `city`; +CREATE TABLE `city` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `val` varchar(20) DEFAULT NULL, + `externalId` varchar(20) DEFAULT NULL, + `parentId` int(11) NOT NULL, + PRIMARY KEY (`id`), + CONSTRAINT `city_parentid_cons` FOREIGN KEY (`parentId`) REFERENCES `province` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE InnoDB; + +DROP TABLE IF EXISTS `province`; +CREATE TABLE `province` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `val` varchar(20) DEFAULT NULL, + `externalId` varchar(20) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE InnoDB; + + +insert into crmuser (id,name) values(-1,"dummy"); +insert into account (id,name) values(-1,"dummy"); +insert into contact (id,name,accountId) values(-1,"dummy",-1); + + + + + +-- ramdom update table for testing purpose +UPDATE activity SET contactId = FLOOR(78* RAND()+1); +INSERT INTO contactcrmuser (contactId,crmuserId) VALUES(FLOOR(78* RAND()+1),20); +UPDATE crmuser SET loginName = FLOOR(1000000* RAND()+1000); +UPDATE crmuser SET password = FLOOR(1000000* RAND()+1000); +UPDATE crmuser SET sessionKey = FLOOR(1000000* RAND()+1000); + + diff --git a/crm/src/main/db/setup.sql b/crm/src/main/db/setup.sql new file mode 100644 index 0000000..f89b7ba --- /dev/null +++ b/crm/src/main/db/setup.sql @@ -0,0 +1,343 @@ +USE crmdb; + +drop table if exists accountcrmuser; +drop table if exists activitycrmuser; +drop table if exists contactcrmuser; +drop table if exists activity; +drop table if exists contact; +drop table if exists crmuser; +drop table if exists account; + +drop table if exists account; +CREATE TABLE account +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + name VARCHAR(255) NOT NULL, + bdm_code VARCHAR(255), + administrativ_level VARCHAR(255), + grade VARCHAR(255), + hospital_type MEDIUMINT, + local_or_army MEDIUMINT, + comprehensive_or_specialized MEDIUMINT, + key_type MEDIUMINT, + status MEDIUMINT, + duty_officer VARCHAR(255), + num_of_doctors MEDIUMINT, + num_of_assistant_doctors MEDIUMINT, + num_of_staff MEDIUMINT, + num_of_treat_per_year MEDIUMINT, + num_of_outpatient MEDIUMINT, + total_num_of_sickbed MEDIUMINT, + num_of_anesthesia_doctor MEDIUMINT, + num_of_pain_doctor MEDIUMINT, + num_of_surgery_per_year MEDIUMINT, + num_of_surgery_room MEDIUMINT, + num_of_using_opiates_medicine MEDIUMINT, + num_of_using_opiates_injection MEDIUMINT, + date_of_establish DATETIME, + registered_capital MEDIUMINT, + tel VARCHAR(255), + fax VARCHAR(255), + market_classification MEDIUMINT, + province int(11), + city int(11), + districts VARCHAR(255), + address VARCHAR(255), + owner VARCHAR(255), + whenadded DATETIME, + modifier VARCHAR(255), + modify_datetime DATETIME, + responsible_person VARCHAR(255), + UNIQUE INDEX `account_ix_01` (`bdm_code` ASC), + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; + +drop table if exists crmuser; +CREATE TABLE crmuser +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + name VARCHAR(255) NOT NULL, + code varchar(255), + reportto MEDIUMINT, + role MEDIUMINT, + pl1 MEDIUMINT, + pl2 MEDIUMINT, + pl4 MEDIUMINT, + pl5 MEDIUMINT, + city VARCHAR(255), + department VARCHAR(255), + whenadded DATETIME, + modifier VARCHAR(255), + modify_datetime date, + owner VARCHAR(255), + level MEDIUMINT, + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; +insert into crmuser (id,name,code,reportto,role) values +(-1,'无','BJ',0,-1), +(1,'管理员','BJ231011001',-1,1), +(2,'北区地区经理01','BJ131011001',1,2), +(3,'北区代表001','BJ131001001',2,3); + + + +drop table if exists accountcrmuser; +CREATE TABLE accountcrmuser +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + accountId MEDIUMINT NOT NULL, + crmuserId MEDIUMINT NOT NULL, + UNIQUE KEY(accountId,crmuserId), + PRIMARY KEY USING BTREE (id), + CONSTRAINT `account_crmuser_cons` FOREIGN KEY (`accountId`) REFERENCES `account` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `account_crmuser_cons2` FOREIGN KEY (`crmuserId`) REFERENCES `crmuser` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE InnoDB; + +drop table if exists contact; +CREATE TABLE contact +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + name VARCHAR(255) NOT NULL, + accountId MEDIUMINT NOT NULL, + department VARCHAR(255), + sex MEDIUMINT, + native_place VARCHAR(255), + office_tel VARCHAR(255), + office_fax VARCHAR(255), + cellphone VARCHAR(255), + email VARCHAR(255), + status VARCHAR(255), + market_classification MEDIUMINT, + grade MEDIUMINT, + province int(11), + city int(11), + districts VARCHAR(255), + duty MEDIUMINT, + job_title MEDIUMINT, + visiting_target MEDIUMINT, + product_target VARCHAR(255), + owner VARCHAR(255), + whenadded DATETIME, + modifier VARCHAR(255), + modify_datetime DATETIME, + responsible_person VARCHAR(255), + PRIMARY KEY USING BTREE (id), + CONSTRAINT `account_id_cons` FOREIGN KEY (`accountId`) REFERENCES `account` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE InnoDB; + + + +drop table if exists activity; +CREATE TABLE activity +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + name VARCHAR(255), + crmuserId MEDIUMINT NOT NULL, + event_type MEDIUMINT NOT NULL, + endtime BIGINT, + starttime BIGINT NOT NULL DEFAULT 0, + title VARCHAR(128), + participants VARCHAR(512), + activity_type MEDIUMINT, + contactId MEDIUMINT, + coacheeId int(32), + status MEDIUMINT, + visiting_purpose MEDIUMINT, + feature_product MEDIUMINT, + act_endtime DATETIME, + owner VARCHAR(255), + whenadded DATETIME, + modifier VARCHAR(255), + modify_datetime DATETIME, + responsible_person VARCHAR(255), + coach int(32), + location VARCHAR(255), + total_score MEDIUMINT, + planing MEDIUMINT, + openling MEDIUMINT, + enquery_listening MEDIUMINT, + deliverable MEDIUMINT, + objection_handing MEDIUMINT, + summary MEDIUMINT, + PRIMARY KEY USING BTREE (id), + CONSTRAINT `crmuserId_activity_cons` FOREIGN KEY (`crmuserId`) REFERENCES `crmuser` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `contactId_activity_cons` FOREIGN KEY (`contactId`) REFERENCES `contact` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE InnoDB; + +drop table if exists activitycrmuser; +CREATE TABLE activitycrmuser +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + activityId MEDIUMINT NOT NULL, + crmuserId MEDIUMINT NOT NULL, + UNIQUE KEY(activityId,crmuserId), + PRIMARY KEY USING BTREE (id), + CONSTRAINT `crm_activity_cons` FOREIGN KEY (`crmuserId`) REFERENCES `crmuser` (`id`) ON DELETE CASCADE ON UPDATE CASCADE , + CONSTRAINT `crm_activity_cons2` FOREIGN KEY (`activityId`) REFERENCES `activity` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE InnoDB; + + +drop table if exists contactcrmuser; +CREATE TABLE contactcrmuser +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + contactId MEDIUMINT NOT NULL, + crmuserId MEDIUMINT NOT NULL, + UNIQUE KEY(contactId,crmuserId), + PRIMARY KEY USING BTREE (id), + CONSTRAINT `crm_contact_cons1` FOREIGN KEY (`crmuserId`) REFERENCES `crmuser` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `crm_contact_cons2` FOREIGN KEY (`contactId`) REFERENCES `contact` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE InnoDB; + + + +drop table if exists user_position; +create table user_position ( + id mediumint(9) auto_increment, + userId int(32), + positionId int(32), + primary key (id), + unique index user_position_unique (userId,positionId) +)ENGINE InnoDB; + +DROP TABLE IF EXISTS userInfo; +CREATE TABLE userInfo ( + id mediumint(9) NOT NULL AUTO_INCREMENT, + name varchar(255) NOT NULL, + department varchar(255) DEFAULT NULL, + division varchar(255) DEFAULT NULL, + cellPhone varchar(255) DEFAULT NULL, + email varchar(255) DEFAULT NULL, + employeeNumber varchar(255) DEFAULT NULL, + photo varchar(255) DEFAULT NULL, + jobTitle varchar(255) DEFAULT NULL, + pl1 mediumint(9) DEFAULT NULL, + pl2 mediumint(9) DEFAULT NULL, + role mediumint(9) DEFAULT NULL, + pl4 mediumint(9) DEFAULT NULL, + pl5 mediumint(9) DEFAULT NULL, + sex mediumint(9) DEFAULT NULL, + loginName varchar(255) DEFAULT NULL, + password varchar(255) DEFAULT NULL, + sessionKey varchar(255) DEFAULT NULL, + lastLoginTime bigint(20) DEFAULT NULL, + whenadded datetime DEFAULT NULL, + parcel varchar(255) DEFAULT NULL, + modifier varchar(255) DEFAULT NULL, + modify_datetime datetime DEFAULT NULL, + owner varchar(255) DEFAULT NULL, + province int(11), + city int(11), + isActivited mediumint(9) DEFAULT NULL, + ts bigint(20) DEFAULT NULL, + positionId mediumint(9) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE InnoDB; + +INSERT INTO `userInfo` (id,name,loginname,password,role,isActivited,ts,positionId,pl1) VALUES +(-1,'无','dummy','827ccb0eea8a706c4c34a16891f84e7b',1,2,1386766666,-1,1), +(1,'Admin Nam','admin','827ccb0eea8a706c4c34a16891f84e7b',1,2,1386766666,1,1), +(2,'Sales Manager','salesman','827ccb0eea8a706c4c34a16891f84e7b',2,2,1386766666,2,1), +(3,'Sales','sales','827ccb0eea8a706c4c34a16891f84e7b',3,2,1386766666,3,1); + + +drop table if exists externalMeeting; +CREATE TABLE externalMeeting +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + crmuserId MEDIUMINT NOT NULL, + endtime BIGINT, + starttime BIGINT NOT NULL DEFAULT 0, + title VARCHAR(128), + contactIds VARCHAR(512), + status MEDIUMINT, + activity_type MEDIUMINT, + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; +ALTER table externalMeeting ADD coachId MEDIUMINT; + +drop table if exists internalMeeting; +CREATE TABLE internalMeeting +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + crmuserId MEDIUMINT NOT NULL, + endtime BIGINT, + starttime BIGINT NOT NULL DEFAULT 0, + title VARCHAR(128), + contactId MEDIUMINT, + crmusermanagerId MEDIUMINT, + status MEDIUMINT, + activity_type MEDIUMINT, + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; + + +DROP TABLE IF EXISTS `data_exchange_teample`; +DROP TABLE IF EXISTS `data_exchange_operation`; +DROP TABLE IF EXISTS data_exchange_status; +DROP TABLE IF EXISTS `record_type`; + +DROP TABLE IF EXISTS `record_type`; +CREATE TABLE `record_type` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `version` bigint(20) NOT NULL, + `val` varchar(255) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `val` (`val`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; +INSERT INTO `record_type` VALUES (1,0,'Account'),(2,0,'Contact'),(3,0,'Call'),(4,0,'Coaching'),(5,0,'AccuntTeam'),(6,0,'ContactTeam'); + +DROP TABLE IF EXISTS data_exchange_status; +CREATE TABLE data_exchange_status ( + id bigint(20) NOT NULL AUTO_INCREMENT, + version bigint(20) NOT NULL, + val varchar(255) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `val` (`val`) +) ENGINE=InnoDB; +INSERT INTO `data_exchange_status` VALUES (1,0,'Pending'),(2,0,'Abort'),(3,0,'Completed'),(4,0,'Cancelled'); + +DROP TABLE IF EXISTS `data_exchange_operation`; +CREATE TABLE `data_exchange_operation` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `version` bigint(20) NOT NULL, + `val` varchar(255) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `val` (`val`) +) ENGINE=InnoDB; +INSERT INTO `data_exchange_operation` VALUES (1,0,'Import'),(2,0,'Export'); + + +DROP TABLE IF EXISTS `data_exchange_teample`; +CREATE TABLE `data_exchange_teample` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `version` bigint(20) NOT NULL, + `name` varchar(255) NOT NULL, + `operation_id` bigint(20) NOT NULL, + `type_id` bigint(20) NOT NULL, + `template` longtext NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`), + KEY `FK8AE35445D557144C` (`type_id`), + KEY `FK8AE35445199BCB6C` (`operation_id`), + CONSTRAINT `FK8AE35445199BCB6C` FOREIGN KEY (`operation_id`) REFERENCES `data_exchange_operation` (`id`), + CONSTRAINT `FK8AE35445D557144C` FOREIGN KEY (`type_id`) REFERENCES `record_type` (`id`) +) ENGINE=InnoDB; + +INSERT INTO `data_exchange_teample` VALUES (1,1,'Account Full Import Template 1.0',1,1,'\r\n\r\n 1000\r\n Account\r\n BdmCode\r\n account.csv\r\n crm_mysql\r\n \r\n 记录行ID\r\n String\r\n BdmCode\r\n \r\n \r\n \r\n 年诊疗人数\r\n Integer\r\n NumOfTreatPerYear\r\n \r\n\r\n \r\n 成立时间\r\n Date\r\n DateOfEstablish\r\n m/d/yy\r\n \r\n \r\n\r\n \r\n 客户名称\r\n String\r\n Name\r\n \r\n\r\n \r\n 医院行政级别\r\n Lookup\r\n AdministrativLevel\r\n AccountAdministrativLevelPl\r\n Val\r\n Id\r\n \r\n\r\n \r\n 医院分级\r\n Lookup\r\n Grade\r\n AccountGradePl\r\n Val\r\n Id\r\n \r\n\r\n \r\n 医院类型\r\n Lookup\r\n HospitalType\r\n AccountTypePl\r\n Val\r\n Id\r\n \r\n\r\n \r\n 地方军队医院\r\n Lookup\r\n LocalOrArmy\r\n AccountLocalOrArmyPl\r\n Val\r\n Id\r\n \r\n\r\n \r\n 综合专科医院\r\n Lookup\r\n ComprehensiveOrSpecialized\r\n AccountComprehensiveOrSpecializedPl\r\n Val\r\n Id\r\n \r\n\r\n \r\n 重点医院\r\n Lookup\r\n KeyType\r\n AccountPointPl\r\n Val\r\n Id\r\n \r\n\r\n \r\n 状态\r\n Lookup\r\n Status\r\n AccountStatusPl\r\n Val\r\n Id\r\n \r\n\r\n \r\n 法人\r\n String\r\n DutyOfficer\r\n \r\n\r\n \r\n 医生数量\r\n Integer\r\n NumOfDoctors\r\n \r\n\r\n \r\n 助理医师人数\r\n Integer\r\n NumOfAssistantDoctors\r\n \r\n \r\n \r\n 员工总数\r\n Integer\r\n NumOfStaff\r\n \r\n\r\n \r\n 门诊人数\r\n Integer\r\n NumOfOutpatient\r\n \r\n\r\n \r\n 总病床数\r\n Integer\r\n TotalNumOfSickbed\r\n \r\n\r\n \r\n 麻醉科医生数\r\n Integer\r\n NumOfAnesthesiaDoctor\r\n \r\n\r\n \r\n 疼痛学组医生数\r\n Integer\r\n NumOfPainDoctor\r\n \r\n\r\n \r\n 手术量年\r\n Integer\r\n NumOfSurgeryPerYear\r\n \r\n\r\n \r\n 手术间\r\n Integer\r\n NumOfSurgeryRoom\r\n \r\n\r\n \r\n 阿片类用药量\r\n Integer\r\n NumOfUsingOpiatesMedicine\r\n \r\n\r\n \r\n 阿片类注射剂量\r\n Integer\r\n NumOfUsingOpiatesInjection\r\n \r\n\r\n \r\n 注册资金\r\n Integer\r\n RegisteredCapital\r\n \r\n\r\n \r\n 主要电话号码\r\n String\r\n Tel\r\n \r\n\r\n \r\n 主要传真号码\r\n String\r\n Fax\r\n \r\n\r\n \r\n 市场分类\r\n Lookup\r\n MarketClassification\r\n AccountMarketClassificationPl\r\n Val\r\n Id\r\n \r\n\r\n \r\n 医院省份\r\n String\r\n Province\r\n \r\n\r\n \r\n 医院区县\r\n String\r\n Districts\r\n \r\n \r\n \r\n 医院详细地址\r\n String\r\n Address\r\n \r\n'); + + +drop table if exists loginhistory; +CREATE TABLE loginhistory +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + sessionId varchar(128), + loginName varchar(256), + loginTime datetime, + logoutTime datetime, + UNIQUE KEY `sessionId` (`sessionId`), + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; + + + diff --git a/crm/src/main/db/update35.sql b/crm/src/main/db/update35.sql new file mode 100644 index 0000000..4979096 --- /dev/null +++ b/crm/src/main/db/update35.sql @@ -0,0 +1,5 @@ +ALTER TABLE `crmdb`.`role` +ADD COLUMN `name` VARCHAR(45) NULL AFTER `val`; +UPDATE `crmdb`.`role` SET `name`='全部' WHERE `id`='1'; +UPDATE `crmdb`.`role` SET `name`='只读' WHERE `id`='2'; +UPDATE `crmdb`.`role` SET `name`='只读' WHERE `id`='3'; diff --git a/crm/src/main/db/update_1.sql b/crm/src/main/db/update_1.sql new file mode 100644 index 0000000..a5ff31b --- /dev/null +++ b/crm/src/main/db/update_1.sql @@ -0,0 +1,23 @@ + +ALTER table crmuser ADD ts BIGINT; +UPDATE `crmdb`.`crmuser` SET `email`='brenda.yuan@rexen.com.cn', `isActivited`='1', `ts`='1382611111318' WHERE `id`='101'; +UPDATE `crmdb`.`crmuser` SET `isActivited`='1', `ts`='1382615122318' WHERE `id`='99'; +UPDATE `crmdb`.`crmuser` SET `isActivited`='1', `ts`='1382613388598' WHERE `id`='100'; + + +DROP TABLE IF EXISTS `score1_pl`; +CREATE TABLE `score1_pl` ( + `id` int(11) NOT NULL DEFAULT '0', + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO `score1_pl` VALUES (0,'0'),(1,'1'),(2,'2'),(3,'3'),(4,'4'),(5,'5'),(6,'6'),(7,'7'),(8,'8'),(9,'9'),(10,'10'),(11,'11'),(12,'12'),(13,'13'),(14,'14'),(15,'15'); + + +DROP TABLE IF EXISTS `score2_pl`; +CREATE TABLE `score2_pl` ( + `id` int(11) NOT NULL DEFAULT '0', + `val` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO `score2_pl` VALUES (0,'0'),(1,'1'),(2,'2'),(3,'3'),(4,'4'),(5,'5'),(6,'6'),(7,'7'),(8,'8'),(9,'9'),(10,'10'),(11,'11'),(12,'12'),(13,'13'),(14,'14'),(15,'15'),(16,'16'),(17,'17'),(18,'18'),(19,'19'),(20,'20'); \ No newline at end of file diff --git a/crm/src/main/db/update_2.sql b/crm/src/main/db/update_2.sql new file mode 100644 index 0000000..c3d43bd --- /dev/null +++ b/crm/src/main/db/update_2.sql @@ -0,0 +1,47 @@ +use crmdb; + + +ALTER table account modify province int(11) default 1; +ALTER table account modify city int(11) default 1; +update account set province=1,city=1; + +ALTER table contact modify province int(11) default 1; +ALTER table contact modify city int(11) default 1; +update contact set province=1,city=1; + + +DROP TABLE IF EXISTS `area`; +DROP TABLE IF EXISTS `city`; +DROP TABLE IF EXISTS `province`; + + + +CREATE TABLE `province` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `val` varchar(20) DEFAULT NULL, + `externalId` varchar(20) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8; + +CREATE TABLE `city` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `val` varchar(20) DEFAULT NULL, + `externalId` varchar(20) DEFAULT NULL, + `parentId` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `city_parentid_cons` (`parentId`), + CONSTRAINT `city_parentid_cons` FOREIGN KEY (`parentId`) REFERENCES `province` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=344 DEFAULT CHARSET=utf8; + +CREATE TABLE `area` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `val` varchar(20) DEFAULT NULL, + `externalId` varchar(20) DEFAULT NULL, + `parentId` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `area_parentid_cons` (`parentId`), + CONSTRAINT `area_parentid_cons` FOREIGN KEY (`parentId`) REFERENCES `city` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO `province` VALUES (1,'北京市','110000'),(2,'天津市','120000'),(3,'河北省','130000'),(4,'山西省','140000'),(5,'内蒙古','150000'),(6,'辽宁省','210000'),(7,'吉林省','220000'),(8,'黑龙江','230000'),(9,'上海市','310000'),(10,'江苏省','320000'),(11,'浙江省','330000'),(12,'安徽省','340000'),(13,'福建省','350000'),(14,'江西省','360000'),(15,'山东省','370000'),(16,'河南省','410000'),(17,'湖北省','420000'),(18,'湖南省','430000'),(19,'广东省','440000'),(20,'广 西','450000'),(21,'海南省','460000'),(22,'重庆市','500000'),(23,'四川省','510000'),(24,'贵州省','520000'),(25,'云南省','530000'),(26,'西 藏','540000'),(27,'陕西省','610000'),(28,'甘肃省','620000'),(29,'青海省','630000'),(30,'宁 夏','640000'),(31,'新 疆','650000'),(32,'台湾省','710000'),(33,'香 港','810000'),(34,'澳 门','820000'); +INSERT INTO `city` VALUES (1,'北京市','110100',1),(2,'石家庄市','130100',3),(3,'唐山市','130200',3),(4,'秦皇岛市','130300',3),(5,'邯郸市','130400',3),(6,'邢台市','130500',3),(7,'保定市','130600',3),(8,'张家口市','130700',3),(9,'承德市','130800',3),(10,'沧州市','130900',3),(11,'廊坊市','131000',3),(12,'衡水市','131100',3),(13,'太原市','140100',4),(14,'大同市','140200',4),(15,'阳泉市','140300',4),(16,'长治市','140400',4),(17,'晋城市','140500',4),(18,'朔州市','140600',4),(19,'晋中市','140700',4),(20,'运城市','140800',4),(21,'忻州市','140900',4),(22,'临汾市','141000',4),(23,'吕梁市','141100',4),(24,'呼和浩特市','150100',5),(25,'包头市','150200',5),(26,'乌海市','150300',5),(27,'赤峰市','150400',5),(28,'通辽市','150500',5),(29,'鄂尔多斯市','150600',5),(30,'呼伦贝尔市','150700',5),(31,'巴彦淖尔市','150800',5),(32,'乌兰察布市','150900',5),(33,'兴安盟','152200',5),(34,'锡林郭勒盟','152500',5),(35,'阿拉善盟','152900',5),(36,'沈阳市','210100',6),(37,'大连市','210200',6),(38,'鞍山市','210300',6),(39,'抚顺市','210400',6),(40,'本溪市','210500',6),(41,'丹东市','210600',6),(42,'锦州市','210700',6),(43,'营口市','210800',6),(44,'阜新市','210900',6),(45,'辽阳市','211000',6),(46,'盘锦市','211100',6),(47,'铁岭市','211200',6),(48,'朝阳市','211300',6),(49,'葫芦岛市','211400',6),(50,'长春市','220100',7),(51,'吉林市','220200',7),(52,'四平市','220300',7),(53,'辽源市','220400',7),(54,'通化市','220500',7),(55,'白山市','220600',7),(56,'松原市','220700',7),(57,'白城市','220800',7),(58,'延边朝鲜族自治州','222400',7),(59,'哈尔滨市','230100',8),(60,'齐齐哈尔市','230200',8),(61,'鸡西市','230300',8),(62,'鹤岗市','230400',8),(63,'双鸭山市','230500',8),(64,'大庆市','230600',8),(65,'伊春市','230700',8),(66,'佳木斯市','230800',8),(67,'七台河市','230900',8),(68,'牡丹江市','231000',8),(69,'黑河市','231100',8),(70,'绥化市','231200',8),(71,'大兴安岭地区','232700',8),(72,'市辖区','310100',9),(73,'县','310200',9),(74,'南京市','320100',10),(75,'无锡市','320200',10),(76,'徐州市','320300',10),(77,'常州市','320400',10),(78,'苏州市','320500',10),(79,'南通市','320600',10),(80,'连云港市','320700',10),(81,'淮安市','320800',10),(82,'盐城市','320900',10),(83,'扬州市','321000',10),(84,'镇江市','321100',10),(85,'泰州市','321200',10),(86,'宿迁市','321300',10),(87,'杭州市','330100',11),(88,'宁波市','330200',11),(89,'温州市','330300',11),(90,'嘉兴市','330400',11),(91,'湖州市','330500',11),(92,'绍兴市','330600',11),(93,'金华市','330700',11),(94,'衢州市','330800',11),(95,'舟山市','330900',11),(96,'台州市','331000',11),(97,'丽水市','331100',11),(98,'合肥市','340100',12),(99,'芜湖市','340200',12),(100,'蚌埠市','340300',12),(101,'淮南市','340400',12),(102,'马鞍山市','340500',12),(103,'淮北市','340600',12),(104,'铜陵市','340700',12),(105,'安庆市','340800',12),(106,'黄山市','341000',12),(107,'滁州市','341100',12),(108,'阜阳市','341200',12),(109,'宿州市','341300',12),(110,'巢湖市','341400',12),(111,'六安市','341500',12),(112,'亳州市','341600',12),(113,'池州市','341700',12),(114,'宣城市','341800',12),(115,'福州市','350100',13),(116,'厦门市','350200',13),(117,'莆田市','350300',13),(118,'三明市','350400',13),(119,'泉州市','350500',13),(120,'漳州市','350600',13),(121,'南平市','350700',13),(122,'龙岩市','350800',13),(123,'宁德市','350900',13),(124,'南昌市','360100',14),(125,'景德镇市','360200',14),(126,'萍乡市','360300',14),(127,'九江市','360400',14),(128,'新余市','360500',14),(129,'鹰潭市','360600',14),(130,'赣州市','360700',14),(131,'吉安市','360800',14),(132,'宜春市','360900',14),(133,'抚州市','361000',14),(134,'上饶市','361100',14),(135,'济南市','370100',15),(136,'青岛市','370200',15),(137,'淄博市','370300',15),(138,'枣庄市','370400',15),(139,'东营市','370500',15),(140,'烟台市','370600',15),(141,'潍坊市','370700',15),(142,'济宁市','370800',15),(143,'泰安市','370900',15),(144,'威海市','371000',15),(145,'日照市','371100',15),(146,'莱芜市','371200',15),(147,'临沂市','371300',15),(148,'德州市','371400',15),(149,'聊城市','371500',15),(150,'滨州市','371600',15),(151,'荷泽市','371700',15),(152,'郑州市','410100',16),(153,'开封市','410200',16),(154,'洛阳市','410300',16),(155,'平顶山市','410400',16),(156,'安阳市','410500',16),(157,'鹤壁市','410600',16),(158,'新乡市','410700',16),(159,'焦作市','410800',16),(160,'濮阳市','410900',16),(161,'许昌市','411000',16),(162,'漯河市','411100',16),(163,'三门峡市','411200',16),(164,'南阳市','411300',16),(165,'商丘市','411400',16),(166,'信阳市','411500',16),(167,'周口市','411600',16),(168,'驻马店市','411700',16),(169,'武汉市','420100',17),(170,'黄石市','420200',17),(171,'十堰市','420300',17),(172,'宜昌市','420500',17),(173,'襄樊市','420600',17),(174,'鄂州市','420700',17),(175,'荆门市','420800',17),(176,'孝感市','420900',17),(177,'荆州市','421000',17),(178,'黄冈市','421100',17),(179,'咸宁市','421200',17),(180,'随州市','421300',17),(181,'恩施土家族苗族自治州','422800',17),(182,'省直辖行政单位','429000',17),(183,'长沙市','430100',18),(184,'株洲市','430200',18),(185,'湘潭市','430300',18),(186,'衡阳市','430400',18),(187,'邵阳市','430500',18),(188,'岳阳市','430600',18),(189,'常德市','430700',18),(190,'张家界市','430800',18),(191,'益阳市','430900',18),(192,'郴州市','431000',18),(193,'永州市','431100',18),(194,'怀化市','431200',18),(195,'娄底市','431300',18),(196,'湘西土家族苗族自治州','433100',18),(197,'广州市','440100',19),(198,'韶关市','440200',19),(199,'深圳市','440300',19),(200,'珠海市','440400',19),(201,'汕头市','440500',19),(202,'佛山市','440600',19),(203,'江门市','440700',19),(204,'湛江市','440800',19),(205,'茂名市','440900',19),(206,'肇庆市','441200',19),(207,'惠州市','441300',19),(208,'梅州市','441400',19),(209,'汕尾市','441500',19),(210,'河源市','441600',19),(211,'阳江市','441700',19),(212,'清远市','441800',19),(213,'东莞市','441900',19),(214,'中山市','442000',19),(215,'潮州市','445100',19),(216,'揭阳市','445200',19),(217,'云浮市','445300',19),(218,'南宁市','450100',20),(219,'柳州市','450200',20),(220,'桂林市','450300',20),(221,'梧州市','450400',20),(222,'北海市','450500',20),(223,'防城港市','450600',20),(224,'钦州市','450700',20),(225,'贵港市','450800',20),(226,'玉林市','450900',20),(227,'百色市','451000',20),(228,'贺州市','451100',20),(229,'河池市','451200',20),(230,'来宾市','451300',20),(231,'崇左市','451400',20),(232,'海口市','460100',21),(233,'三亚市','460200',21),(234,'省直辖县级行政单位','469000',21),(235,'市辖区','500100',22),(236,'县','500200',22),(237,'市','500300',22),(238,'成都市','510100',23),(239,'自贡市','510300',23),(240,'攀枝花市','510400',23),(241,'泸州市','510500',23),(242,'德阳市','510600',23),(243,'绵阳市','510700',23),(244,'广元市','510800',23),(245,'遂宁市','510900',23),(246,'内江市','511000',23),(247,'乐山市','511100',23),(248,'南充市','511300',23),(249,'眉山市','511400',23),(250,'宜宾市','511500',23),(251,'广安市','511600',23),(252,'达州市','511700',23),(253,'雅安市','511800',23),(254,'巴中市','511900',23),(255,'资阳市','512000',23),(256,'阿坝藏族羌族自治州','513200',23),(257,'甘孜藏族自治州','513300',23),(258,'凉山彝族自治州','513400',23),(259,'贵阳市','520100',24),(260,'六盘水市','520200',24),(261,'遵义市','520300',24),(262,'安顺市','520400',24),(263,'铜仁地区','522200',24),(264,'黔西南布依族苗族自治州','522300',24),(265,'毕节地区','522400',24),(266,'黔东南苗族侗族自治州','522600',24),(267,'黔南布依族苗族自治州','522700',24),(268,'昆明市','530100',25),(269,'曲靖市','530300',25),(270,'玉溪市','530400',25),(271,'保山市','530500',25),(272,'昭通市','530600',25),(273,'丽江市','530700',25),(274,'思茅市','530800',25),(275,'临沧市','530900',25),(276,'楚雄彝族自治州','532300',25),(277,'红河哈尼族彝族自治州','532500',25),(278,'文山壮族苗族自治州','532600',25),(279,'西双版纳傣族自治州','532800',25),(280,'大理白族自治州','532900',25),(281,'德宏傣族景颇族自治州','533100',25),(282,'怒江傈僳族自治州','533300',25),(283,'迪庆藏族自治州','533400',25),(284,'拉萨市','540100',26),(285,'昌都地区','542100',26),(286,'山南地区','542200',26),(287,'日喀则地区','542300',26),(288,'那曲地区','542400',26),(289,'阿里地区','542500',26),(290,'林芝地区','542600',26),(291,'西安市','610100',27),(292,'铜川市','610200',27),(293,'宝鸡市','610300',27),(294,'咸阳市','610400',27),(295,'渭南市','610500',27),(296,'延安市','610600',27),(297,'汉中市','610700',27),(298,'榆林市','610800',27),(299,'安康市','610900',27),(300,'商洛市','611000',27),(301,'兰州市','620100',28),(302,'嘉峪关市','620200',28),(303,'金昌市','620300',28),(304,'白银市','620400',28),(305,'天水市','620500',28),(306,'武威市','620600',28),(307,'张掖市','620700',28),(308,'平凉市','620800',28),(309,'酒泉市','620900',28),(310,'庆阳市','621000',28),(311,'定西市','621100',28),(312,'陇南市','621200',28),(313,'临夏回族自治州','622900',28),(314,'甘南藏族自治州','623000',28),(315,'西宁市','630100',29),(316,'海东地区','632100',29),(317,'海北藏族自治州','632200',29),(318,'黄南藏族自治州','632300',29),(319,'海南藏族自治州','632500',29),(320,'果洛藏族自治州','632600',29),(321,'玉树藏族自治州','632700',29),(322,'海西蒙古族藏族自治州','632800',29),(323,'银川市','640100',30),(324,'石嘴山市','640200',30),(325,'吴忠市','640300',30),(326,'固原市','640400',30),(327,'中卫市','640500',30),(328,'乌鲁木齐市','650100',31),(329,'克拉玛依市','650200',31),(330,'吐鲁番地区','652100',31),(331,'哈密地区','652200',31),(332,'昌吉回族自治州','652300',31),(333,'博尔塔拉蒙古自治州','652700',31),(334,'巴音郭楞蒙古自治州','652800',31),(335,'阿克苏地区','652900',31),(336,'克孜勒苏柯尔克孜自治州','653000',31),(337,'喀什地区','653100',31),(338,'和田地区','653200',31),(339,'伊犁哈萨克自治州','654000',31),(340,'塔城地区','654200',31),(341,'阿勒泰地区','654300',31),(342,'省直辖行政单位','659000',31),(343,'天津',NULL,2); diff --git a/crm/src/main/db/update_20.sql b/crm/src/main/db/update_20.sql new file mode 100644 index 0000000..cc91922 --- /dev/null +++ b/crm/src/main/db/update_20.sql @@ -0,0 +1,116 @@ +use crmdb; +ALTER TABLE `crmdb`.`contact` +ADD COLUMN `contactCode` VARCHAR(255) NULL AFTER `responsible_person`, +ADD UNIQUE INDEX `contactCode_UNIQUE` (`contactCode` ASC); + +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('14', '保健科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('15', '采购科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('16', '传染科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('17', '创伤外科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('18', '儿科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('19', '耳鼻喉科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('20', '方便门诊'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('21', '放化疗科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('22', '放疗科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('23', '放射科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('24', '妇产科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('25', '妇科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('26', '感染科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('27', '肛肠科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('28', '姑息科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('29', '国际医疗科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('30', '核医学科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('31', '呼吸内科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('32', '护理科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('33', '急诊科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('34', '介入科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('35', '康复科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('36', '口腔科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('37', '老干科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('38', '麻醉科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('39', '泌尿外科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('40', '脑外科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('41', '内分泌科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('42', '宁养科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('43', '皮肤科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('44', '普外科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('45', '其他'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('46', '乳腺外科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('47', '烧伤整形科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('48', '神经科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('49', '神经内科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('50', '神经外科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('51', '肾内科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('52', '生物治疗科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('53', '特需科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('54', '疼痛科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('55', '微创科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('56', '胃肠外科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('57', '消化科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('58', '消化内科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('59', '消化外科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('60', '心内科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('61', '心胸外科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('62', '血管外科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('63', '血透科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('64', '药剂科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('65', '医保办'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('66', '医务科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('67', '整形美容科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('68', '质控科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('69', '中西医结合科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('70', '肿瘤科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('71', '肿瘤内科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('72', '肿瘤外科'); +INSERT INTO `crmdb`.`contact_department_pl` (`id`, `val`) VALUES ('73', '综合科'); + + +INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('9', '医生'); +INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('10', '副主任'); +INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('11', '院长助理'); +INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('12', '书记'); +INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('13', '副书记'); +INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('14', '护士'); +INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('15', '护士长'); +INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('16', '库管'); +INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('17', '采购科科长'); +INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('18', '药师'); +INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('19', '药剂科副主任'); +INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('20', '医务科科长'); +INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('21', '医务科副科长'); +INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('22', '医保办主任'); +INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('23', '科教科主任'); +INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('24', '信息卡科长'); +INSERT INTO `crmdb`.`contact_duty_pl` (`id`, `val`) VALUES ('25', '其他'); + +UPDATE `crmdb`.`contact_job_title_pl` SET `val`='主管护士' WHERE `id`='6'; +INSERT INTO `crmdb`.`contact_job_title_pl` (`id`, `val`) VALUES ('9', '副主任护士'); +INSERT INTO `crmdb`.`contact_job_title_pl` (`id`, `val`) VALUES ('10', '主任护师'); +INSERT INTO `crmdb`.`contact_job_title_pl` (`id`, `val`) VALUES ('11', '主管药师'); +INSERT INTO `crmdb`.`contact_job_title_pl` (`id`, `val`) VALUES ('12', '副主任药师'); +INSERT INTO `crmdb`.`contact_job_title_pl` (`id`, `val`) VALUES ('13', '主任药师'); +INSERT INTO `crmdb`.`contact_job_title_pl` (`id`, `val`) VALUES ('14', '主管技师'); +INSERT INTO `crmdb`.`contact_job_title_pl` (`id`, `val`) VALUES ('15', '副主任技师'); +INSERT INTO `crmdb`.`contact_job_title_pl` (`id`, `val`) VALUES ('16', '主任技师'); +INSERT INTO `crmdb`.`contact_job_title_pl` (`id`, `val`) VALUES ('17', '其他'); + + +ALTER TABLE `crmdb`.`userinfo` +ADD COLUMN `office_tel` VARCHAR(255) NULL AFTER `positionId`; + +DROP TABLE IF EXISTS `activity_whethercoach_pl`; +CREATE TABLE `crmdb`.`activity_whethercoach_pl` ( + `id` MEDIUMINT(9) NOT NULL, + `val` VARCHAR(255) NULL, + PRIMARY KEY (`id`) + ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; + +INSERT INTO `crmdb`.`activity_whethercoach_pl` (`id`, `val`) VALUES ('1', '否'); +INSERT INTO `crmdb`.`activity_whethercoach_pl` (`id`, `val`) VALUES ('2', '协防半天'); +INSERT INTO `crmdb`.`activity_whethercoach_pl` (`id`, `val`) VALUES ('3', '协防一天'); + +UPDATE `crmdb`.`activity_event_type_pl` SET `val`='拜访辅导' WHERE `id`='2'; +INSERT INTO `crmdb`.`activity_event_type_pl` (`id`, `val`) VALUES ('3', '科室会辅导'); + +ALTER TABLE `crmdb`.`activity` +ADD COLUMN `whetherCoach` MEDIUMINT(9) NULL AFTER `summary`; \ No newline at end of file diff --git a/crm/src/main/db/update_21.sql b/crm/src/main/db/update_21.sql new file mode 100644 index 0000000..f3f3f18 --- /dev/null +++ b/crm/src/main/db/update_21.sql @@ -0,0 +1,27 @@ +use crmdb; +UPDATE `crmdb`.`activity_whethercoach_pl` SET `val`='协访半天' WHERE `id`='2'; +UPDATE `crmdb`.`activity_whethercoach_pl` SET `val`='协访一天' WHERE `id`='3'; +UPDATE `crmdb`.`crmuser_activited` SET `id`='0', `val`='未激活' WHERE `id`='1'; +UPDATE `crmdb`.`crmuser_activited` SET `id`='1', `val`='已激活' WHERE `id`='2'; +DELETE FROM `crmdb`.`activity_whethercoach_pl` WHERE `id`='1'; +UPDATE `crmdb`.`activity_whethercoach_pl` SET `id`='1' WHERE `id`='2'; +UPDATE `crmdb`.`activity_whethercoach_pl` SET `id`='2' WHERE `id`='3'; +UPDATE `crmdb`.`userinfo` SET `email`='tigerzhou@rexen.com.cn', `sex`='1', `isActivited`='1' WHERE `id`='1'; +UPDATE `crmdb`.`userinfo` SET `email`='alexsong@rexen.com.cn', `sex`='1', `isActivited`='1' WHERE `id`='2'; +UPDATE `crmdb`.`userinfo` SET `email`='feiyunzhou@rexen.com.cn', `sex`='1', `isActivited`='1' WHERE `id`='3'; +UPDATE `crmdb`.`userinfo` SET `sex`='1', `isActivited`='1' WHERE `id`='-1'; +UPDATE `crmdb`.`userinfo` SET `city`='1' WHERE `id`='1'; +UPDATE `crmdb`.`userinfo` SET `city`='1' WHERE `id`='2'; +UPDATE `crmdb`.`userinfo` SET `city`='1' WHERE `id`='3'; +UPDATE `crmdb`.`userinfo` SET `province`='1' WHERE `id`='1'; +UPDATE `crmdb`.`userinfo` SET `province`='1' WHERE `id`='2'; +UPDATE `crmdb`.`userinfo` SET `province`='1' WHERE `id`='3'; + +ALTER TABLE `crmdb`.`activity` +ADD COLUMN `coachTime` MEDIUMINT(9) NULL AFTER `whetherCoach`; + +ALTER TABLE `crmdb`.`contact` +ADD COLUMN `num_of_monthlySurgery` MEDIUMINT(9) NULL AFTER `contactCode`, +ADD COLUMN `num_of_monthlyAnalgesia` MEDIUMINT(9) NULL AFTER `num_of_monthlySurgery`; + + diff --git a/crm/src/main/db/update_22.sql b/crm/src/main/db/update_22.sql new file mode 100644 index 0000000..8befd28 --- /dev/null +++ b/crm/src/main/db/update_22.sql @@ -0,0 +1,125 @@ +use crmdb; + + +drop table if exists activity_score3_pl; +CREATE TABLE `crmdb`.`activity_score3_pl` ( + `id` INT NOT NULL, + `val` VARCHAR(255) NULL, + PRIMARY KEY (`id`) + )ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; + + drop table if exists activity_score4_pl; +CREATE TABLE `crmdb`.`activity_score4_pl` ( + `id` INT NOT NULL, + `val` VARCHAR(25) NULL, + PRIMARY KEY (`id`) + )ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; + + +drop table if exists activity_score5_pl; +CREATE TABLE `crmdb`.`activity_score5_pl` ( +`id` INT NOT NULL, +`val` VARCHAR(255) NULL, +PRIMARY KEY (`id`) +)ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; + +INSERT INTO `crmdb`.`activity_score3_pl` (`id`, `val`) VALUES ('0', '0'); +INSERT INTO `crmdb`.`activity_score3_pl` (`id`, `val`) VALUES ('1', '1'); +INSERT INTO `crmdb`.`activity_score3_pl` (`id`, `val`) VALUES ('2', '2'); +INSERT INTO `crmdb`.`activity_score3_pl` (`id`, `val`) VALUES ('3', '3'); +INSERT INTO `crmdb`.`activity_score3_pl` (`id`, `val`) VALUES ('4', '4'); +INSERT INTO `crmdb`.`activity_score3_pl` (`id`, `val`) VALUES ('5', '5'); +INSERT INTO `crmdb`.`activity_score3_pl` (`id`, `val`) VALUES ('6', '6'); +INSERT INTO `crmdb`.`activity_score3_pl` (`id`, `val`) VALUES ('7', '7'); +INSERT INTO `crmdb`.`activity_score3_pl` (`id`, `val`) VALUES ('8', '8'); +INSERT INTO `crmdb`.`activity_score3_pl` (`id`, `val`) VALUES ('9', '9'); +INSERT INTO `crmdb`.`activity_score3_pl` (`id`, `val`) VALUES ('10', '10'); + +INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('0', '0'); +INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('1', '1'); +INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('2', '2'); +INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('3', '3'); +INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('4', '4'); +INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('5', '5'); +INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('6', '6'); +INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('7', '7'); +INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('8', '8'); +INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('9', '9'); +INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('10', '10'); +INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('11', '11'); +INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('12', '12'); +INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('13', '13'); +INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('14', '14'); +INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('15', '15'); +INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('16', '16'); +INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('17', '17'); +INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('18', '18'); +INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('19', '19'); +INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('20', '20'); +INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('21', '21'); +INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('22', '22'); +INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('23', '23'); +INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('24', '24'); +INSERT INTO `crmdb`.`activity_score4_pl` (`id`, `val`) VALUES ('25', '25'); + +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('0', '0'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('1', '1'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('2', '2'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('3', '3'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('4', '4'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('5', '5'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('6', '6'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('7', '7'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('8', '8'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('9', '9'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('10', '10'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('11', '11'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('12', '12'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('13', '13'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('14', '14'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('15', '15'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('16', '16'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('17', '17'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('18', '18'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('19', '19'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('20', '20'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('21', '21'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('22', '22'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('23', '23'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('24', '24'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('25', '25'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('26', '26'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('27', '27'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('28', '28'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('29', '29'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('30', '30'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('31', '31'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('32', '32'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('33', '33'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('34', '34'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('35', '35'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('36', '36'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('37', '37'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('38', '38'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('39', '39'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('40', '40'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('41', '41'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('42', '42'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('43', '43'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('44', '44'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('45', '45'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('46', '46'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('47', '47'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('48', '48'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('49', '49'); +INSERT INTO `crmdb`.`activity_score5_pl` (`id`, `val`) VALUES ('50', '50'); + + +UPDATE `crmdb`.`crmuser_pl2` SET `id`='3', `val`='奥诺美' WHERE `id`='3'; + INSERT INTO `crmdb`.`crmuser_pl2` (`id`, `val`) VALUES ('4', '全部'); +UPDATE `crmdb`.`activity_visiting_purpose_pl` SET `activity_type`='1', `parentId`='1' WHERE `id`='3'; + +ALTER TABLE `crmdb`.`activity` +ADD COLUMN `accountId` MEDIUMINT(9) NULL AFTER `coachTime`, +ADD COLUMN `department` MEDIUMINT(9) NULL AFTER `accountId`, +ADD COLUMN `whether_coach` VARCHAR(255) NULL AFTER `department`; \ No newline at end of file diff --git a/crm/src/main/db/update_23.sql b/crm/src/main/db/update_23.sql new file mode 100644 index 0000000..d165a13 --- /dev/null +++ b/crm/src/main/db/update_23.sql @@ -0,0 +1,11 @@ +use crmdb; +DROP TABLE IF EXISTS `activity_coachtime_pl`; +CREATE TABLE `crmdb`.`activity_coachtime_pl` ( + `id` INT NOT NULL, + `val` VARCHAR(255) NULL, + PRIMARY KEY (`id`) + )ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; + +INSERT INTO `crmdb`.`activity_coachtime_pl` (`id`, `val`) VALUES ('1', '无'); +INSERT INTO `crmdb`.`activity_coachtime_pl` (`id`, `val`) VALUES ('2', '半天'); +INSERT INTO `crmdb`.`activity_coachtime_pl` (`id`, `val`) VALUES ('3', '全天'); \ No newline at end of file diff --git a/crm/src/main/db/update_24.sql b/crm/src/main/db/update_24.sql new file mode 100644 index 0000000..d4fea0e --- /dev/null +++ b/crm/src/main/db/update_24.sql @@ -0,0 +1,8 @@ +use crmdb; +ALTER TABLE `crmdb`.`userinfo` +ADD COLUMN `num_of_signIn` MEDIUMINT(9) NULL AFTER `office_tel`; + +ALTER TABLE `crmdb`.`user_position` +ADD COLUMN `status` INT NULL DEFAULT NULL AFTER `positionId`, +ADD COLUMN `createtime` DATETIME NULL DEFAULT NULL AFTER `status`, +ADD COLUMN `isPrimary` INT NULL DEFAULT NULL AFTER `createtime`; \ No newline at end of file diff --git a/crm/src/main/db/update_25.sql b/crm/src/main/db/update_25.sql new file mode 100644 index 0000000..349f319 --- /dev/null +++ b/crm/src/main/db/update_25.sql @@ -0,0 +1,13 @@ +use crmdb; +ALTER TABLE `crmdb`.`account` +CHANGE COLUMN `administrativ_level` `administrativ_level` MEDIUMINT(9) NULL DEFAULT NULL , +CHANGE COLUMN `grade` `grade` MEDIUMINT(9) NULL DEFAULT NULL ; + +ALTER TABLE `crmdb`.`contact` +CHANGE COLUMN `department` `department` MEDIUMINT(9) NULL ; + +ALTER TABLE `crmdb`.`crmuser` +CHANGE COLUMN `city` `city` MEDIUMINT(9) NULL DEFAULT NULL ; + +ALTER TABLE `crmdb`.`accountcrmuser` +ADD COLUMN `externalId` VARCHAR(45) NULL AFTER `crmuserId`; \ No newline at end of file diff --git a/crm/src/main/db/update_26.sql b/crm/src/main/db/update_26.sql new file mode 100644 index 0000000..9c55073 --- /dev/null +++ b/crm/src/main/db/update_26.sql @@ -0,0 +1,10 @@ +use crmdb; +ALTER TABLE `crmdb`.`data_exchange_teample` +DROP FOREIGN KEY `FK8AE35445D557144C`, +DROP FOREIGN KEY `FK8AE35445199BCB6C`; +ALTER TABLE `crmdb`.`data_exchange_teample` +DROP COLUMN `type_id`, +DROP COLUMN `operation_id`, +DROP COLUMN `version`, +DROP INDEX `FK8AE35445199BCB6C` , +DROP INDEX `FK8AE35445D557144C` ; \ No newline at end of file diff --git a/crm/src/main/db/update_28.sql b/crm/src/main/db/update_28.sql new file mode 100644 index 0000000..45f1cea --- /dev/null +++ b/crm/src/main/db/update_28.sql @@ -0,0 +1,50 @@ +DROP TABLE IF EXISTS `alert`; +CREATE TABLE `crmdb`.`alert` ( + `id` MEDIUMINT(9) NOT NULL AUTO_INCREMENT, + `name` VARCHAR(255) NOT NULL, + `publishDate` BIGINT(20) NULL, + `expired` BIGINT(20) NULL, + `priority` MEDIUMINT(9) NULL, + `towhom` MEDIUMINT(9) NULL, + `description` LONGTEXT NULL, + `owner` VARCHAR(255) NULL, + `whenadded` DATETIME NULL, + `modifier` VARCHAR(255) NULL, + `modify_datetime` DATETIME NULL, + PRIMARY KEY (`id`) + )ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `alert_priority_pl`; + CREATE TABLE `crmdb`.`alert_priority_pl` ( + `id` MEDIUMINT(9) NOT NULL, + `val` VARCHAR(255) NULL, +PRIMARY KEY (`id`) +)ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS `alert_publicobject_pl`; +CREATE TABLE `crmdb`.`alert_publicobject_pl` ( + `id` MEDIUMINT(9) NOT NULL, + `val` VARCHAR(255) NULL, + PRIMARY KEY (`id`) + )ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8; + +INSERT INTO `crmdb`.`alert_priority_pl` (`id`, `val`) VALUES ('1', '高级'); +INSERT INTO `crmdb`.`alert_priority_pl` (`id`, `val`) VALUES ('2', '中级'); +INSERT INTO `crmdb`.`alert_priority_pl` (`id`, `val`) VALUES ('3', '低级'); + +INSERT INTO `crmdb`.`alert_publicobject_pl` (`id`, `val`) VALUES ('1', '管理员'); +INSERT INTO `crmdb`.`alert_publicobject_pl` (`id`, `val`) VALUES ('2', '主管'); +INSERT INTO `crmdb`.`alert_publicobject_pl` (`id`, `val`) VALUES ('3', '代表'); + +drop view if exists crmdb.activity_alert; +create view crmdb.activity_alert as +SELECT id, +case when to_days(curdate())-to_days(DATE_FORMAT(from_unixtime(act.starttime/1000),'%Y-%m-%d'))=0 THEN '今天' +when to_days(curdate())-to_days(DATE_FORMAT(from_unixtime(act.starttime/1000),'%Y-%m-%d'))=1 THEN '昨天' +when to_days(curdate())-to_days(DATE_FORMAT(from_unixtime(act.starttime/1000),'%Y-%m-%d'))=2 THEN '前天' +when to_days(curdate())-to_days(DATE_FORMAT(from_unixtime(act.starttime/1000),'%Y-%m-%d'))>=3 and to_days(curdate())-to_days(DATE_FORMAT(from_unixtime(act.starttime/1000),'%Y-%m-%d'))<7 THEN '三天以前' +when to_days(curdate())-to_days(DATE_FORMAT(from_unixtime(act.starttime/1000),'%Y-%m-%d'))>=7 THEN '七天以前' +ELSE '错误' END as time, +title +FROM crmdb.activity act where event_type=1 and status=1 order by time + diff --git a/crm/src/main/db/update_29.sql b/crm/src/main/db/update_29.sql new file mode 100644 index 0000000..da59ebe --- /dev/null +++ b/crm/src/main/db/update_29.sql @@ -0,0 +1,33 @@ +use crmdb; +drop view if exists crmdb.user_position_account; +create view user_position_account as +select ac.id as id,u.name as userName,u.loginName as loginName,u.email as email,sp.val as sex,u.whenadded as addTime, +c.name as positionName,c.code as positionCode,(select name from crmuser crm where crm.id=c.reportto) as reportTo,(select name from crmuser c1 where c1.id =(select c2.reportto from crmuser c2 where id=c.reportto)) as reporttto,r.val as role,rlp4.val as regoin1,rlp5.val as regoin2,ct.val as city, +a.name as accountName,a.bdm_code as BDMCode,aalp.val as adminLevel,asp.val as status +from userinfo u +left join sex_pl sp +on u.sex=sp.id +left join user_position up +on u.id=up.userId +left join crmuser c +on up.positionId =c.id +left join role r +on c.role=r.id +left join region_level1_pl rlp4 +on c.pl4=rlp4.id +left join region_level1_pl rlp5 +on c.pl5=rlp5.id +left join city ct +on c.city=ct.id +left join accountcrmuser ac +on c.id=ac.crmuserId +left join account a +on ac.accountId=a.id +left join account_status_pl asp +on a.status =asp.id +left join account_administrativ_level_pl aalp on +a.administrativ_level=aalp.id +where up.status=1 order by id; + +ALTER TABLE `crmdb`.`userinfo` +DROP COLUMN `positionId`; diff --git a/crm/src/main/db/update_3.sql b/crm/src/main/db/update_3.sql new file mode 100644 index 0000000..5970e59 --- /dev/null +++ b/crm/src/main/db/update_3.sql @@ -0,0 +1,5 @@ + +ALTER TABLE `crmdb`.`activity` +CHANGE COLUMN `coach` `coach` MEDIUMINT(9) NULL DEFAULT NULL ; +ALTER TABLE `crmdb`.`activity` +ADD COLUMN `coacheeId` MEDIUMINT(9) NULL AFTER `contactId`; diff --git a/crm/src/main/db/update_31.sql b/crm/src/main/db/update_31.sql new file mode 100644 index 0000000..0367b55 --- /dev/null +++ b/crm/src/main/db/update_31.sql @@ -0,0 +1,34 @@ +UPDATE `crmdb`.`activity_status_pl` SET `val`='未执行' WHERE `id`='3'; + +ALTER TABLE `crmdb`.`activity` +ADD COLUMN `activity_daypart` MEDIUMINT(9) NULL AFTER `whether_coach`; + +drop table if exists activity_daypart_pl; +CREATE TABLE `crmdb`.`activity_daypart_pl` ( + `id` MEDIUMINT(9) NOT NULL AUTO_INCREMENT, + `val` VARCHAR(255) NULL, + PRIMARY KEY (`id`)); + +INSERT INTO `crmdb`.`activity_daypart_pl` (`id`, `val`) VALUES ('1', '上午'); +INSERT INTO `crmdb`.`activity_daypart_pl` (`id`, `val`) VALUES ('2', '下午'); + +-- ALTER TABLE `crmdb`.`activitycrmuser` +-- DROP FOREIGN KEY `crm_activity_cons2`; + +DELETE FROM `crmdb`.`account_administrativ_level_pl` WHERE `id`='2'; +DELETE FROM `crmdb`.`account_administrativ_level_pl` WHERE `id`='3'; +DELETE FROM `crmdb`.`account_administrativ_level_pl` WHERE `id`='4'; +DELETE FROM `crmdb`.`account_administrativ_level_pl` WHERE `id`='6'; +DELETE FROM `crmdb`.`account_administrativ_level_pl` WHERE `id`='7'; +DELETE FROM `crmdb`.`account_administrativ_level_pl` WHERE `id`='8'; +DELETE FROM `crmdb`.`account_administrativ_level_pl` WHERE `id`='10'; +DELETE FROM `crmdb`.`account_administrativ_level_pl` WHERE `id`='11'; +DELETE FROM `crmdb`.`account_administrativ_level_pl` WHERE `id`='12'; + +UPDATE `crmdb`.`account_administrativ_level_pl` SET `val`='未评级' WHERE `id`= '13'; + +drop table `crmdb`.`account_grade_pl`; + +ALTER TABLE `crmdb`.`account` +DROP COLUMN `grade`; + diff --git a/crm/src/main/db/update_32.sql b/crm/src/main/db/update_32.sql new file mode 100644 index 0000000..99fe9d9 --- /dev/null +++ b/crm/src/main/db/update_32.sql @@ -0,0 +1,42 @@ +use crmdb; + +set session old_alter_table =on; +ALTER IGNORE TABLE crmuser ADD UNIQUE (code); +set session old_alter_table =off; + +ALTER table contact ADD externalId varchar(128); +set session old_alter_table =on; +ALTER IGNORE TABLE contact ADD UNIQUE (externalId); +set session old_alter_table =off; + +set session old_alter_table =on; +ALTER IGNORE TABLE userinfo ADD UNIQUE (employeeNumber); +set session old_alter_table =off; + + +DROP TABLE IF EXISTS `area`; +DROP TABLE IF EXISTS `city`; +DROP TABLE IF EXISTS `province`; + +DROP TABLE IF EXISTS `province`; +CREATE TABLE `province` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `val` varchar(20) DEFAULT NULL, + `externalId` varchar(20) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB; +INSERT INTO `province` VALUES (1,'北京','110000'),(2,'天津','120000'),(3,'河北','130000'),(4,'山西','140000'),(5,'内蒙古','150000'),(6,'辽宁','210000'),(7,'吉林','220000'),(8,'黑龙江','230000'),(9,'上海','310000'),(10,'江苏','320000'),(11,'浙江','330000'),(12,'安徽','340000'),(13,'福建','350000'),(14,'江西','360000'),(15,'山东','370000'),(16,'河南','410000'),(17,'湖北','420000'),(18,'湖南','430000'),(19,'广东','440000'),(20,'广西','450000'),(21,'海南','460000'),(22,'重庆','500000'),(23,'四川','510000'),(24,'贵州','520000'),(25,'云南','530000'),(26,'西藏','540000'),(27,'陕西','610000'),(28,'甘肃','620000'),(29,'青海','630000'),(30,'宁夏','640000'),(31,'新疆','650000'),(32,'台湾','710000'),(33,'香港','810000'),(34,'澳门','820000'); + +DROP TABLE IF EXISTS `city`; +CREATE TABLE `city` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `val` varchar(20) DEFAULT NULL, + `externalId` varchar(20) DEFAULT NULL, + `parentId` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `city_parentid_cons` (`parentId`), + CONSTRAINT `city_parentid_cons` FOREIGN KEY (`parentId`) REFERENCES `province` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB; + +INSERT INTO `city` VALUES (1,'北京','110100',1),(2,'石家庄','130100',3),(3,'唐山','130200',3),(4,'秦皇岛','130300',3),(5,'邯郸','130400',3),(6,'邢台','130500',3),(7,'保定','130600',3),(8,'张家口','130700',3),(9,'承德','130800',3),(10,'沧州','130900',3),(11,'廊坊','131000',3),(12,'衡水','131100',3),(13,'太原','140100',4),(14,'大同','140200',4),(15,'阳泉','140300',4),(16,'长治','140400',4),(17,'晋城','140500',4),(18,'朔州','140600',4),(19,'晋中','140700',4),(20,'运城','140800',4),(21,'忻州','140900',4),(22,'临汾','141000',4),(23,'吕梁','141100',4),(24,'呼和浩特','150100',5),(25,'包头','150200',5),(26,'乌海','150300',5),(27,'赤峰','150400',5),(28,'通辽','150500',5),(29,'鄂尔多斯','150600',5),(30,'呼伦贝尔','150700',5),(31,'巴彦淖尔','150800',5),(32,'乌兰察布','150900',5),(33,'兴安盟','152200',5),(34,'锡林郭勒盟','152500',5),(35,'阿拉善盟','152900',5),(36,'沈阳','210100',6),(37,'大连','210200',6),(38,'鞍山','210300',6),(39,'抚顺','210400',6),(40,'本溪','210500',6),(41,'丹东','210600',6),(42,'锦州','210700',6),(43,'营口','210800',6),(44,'阜新','210900',6),(45,'辽阳','211000',6),(46,'盘锦','211100',6),(47,'铁岭','211200',6),(48,'朝阳','211300',6),(49,'葫芦岛','211400',6),(50,'长春','220100',7),(51,'吉林','220200',7),(52,'四平','220300',7),(53,'辽源','220400',7),(54,'通化','220500',7),(55,'白山','220600',7),(56,'松原','220700',7),(57,'白城','220800',7),(58,'延边朝鲜族自治州','222400',7),(59,'哈尔滨','230100',8),(60,'齐齐哈尔','230200',8),(61,'鸡西','230300',8),(62,'鹤岗','230400',8),(63,'双鸭山','230500',8),(64,'大庆','230600',8),(65,'伊春','230700',8),(66,'佳木斯','230800',8),(67,'七台河','230900',8),(68,'牡丹江','231000',8),(69,'黑河','231100',8),(70,'绥化','231200',8),(71,'大兴安岭地区','232700',8),(72,'上海','310100',9),(73,'县','310200',9),(74,'南京','320100',10),(75,'无锡','320200',10),(76,'徐州','320300',10),(77,'常州','320400',10),(78,'苏州','320500',10),(79,'南通','320600',10),(80,'连云港','320700',10),(81,'淮安','320800',10),(82,'盐城','320900',10),(83,'扬州','321000',10),(84,'镇江','321100',10),(85,'泰州','321200',10),(86,'宿迁','321300',10),(87,'杭州','330100',11),(88,'宁波','330200',11),(89,'温州','330300',11),(90,'嘉兴','330400',11),(91,'湖州','330500',11),(92,'绍兴','330600',11),(93,'金华','330700',11),(94,'衢州','330800',11),(95,'舟山','330900',11),(96,'台州','331000',11),(97,'丽水','331100',11),(98,'合肥','340100',12),(99,'芜湖','340200',12),(100,'蚌埠','340300',12),(101,'淮南','340400',12),(102,'马鞍山','340500',12),(103,'淮北','340600',12),(104,'铜陵','340700',12),(105,'安庆','340800',12),(106,'黄山','341000',12),(107,'滁州','341100',12),(108,'阜阳','341200',12),(109,'宿州','341300',12),(110,'巢湖','341400',12),(111,'六安','341500',12),(112,'亳州','341600',12),(113,'池州','341700',12),(114,'宣城','341800',12),(115,'福州','350100',13),(116,'厦门','350200',13),(117,'莆田','350300',13),(118,'三明','350400',13),(119,'泉州','350500',13),(120,'漳州','350600',13),(121,'南平','350700',13),(122,'龙岩','350800',13),(123,'宁德','350900',13),(124,'南昌','360100',14),(125,'景德镇','360200',14),(126,'萍乡','360300',14),(127,'九江','360400',14),(128,'新余','360500',14),(129,'鹰潭','360600',14),(130,'赣州','360700',14),(131,'吉安','360800',14),(132,'宜春','360900',14),(133,'抚州','361000',14),(134,'上饶','361100',14),(135,'济南','370100',15),(136,'青岛','370200',15),(137,'淄博','370300',15),(138,'枣庄','370400',15),(139,'东营','370500',15),(140,'烟台','370600',15),(141,'潍坊','370700',15),(142,'济宁','370800',15),(143,'泰安','370900',15),(144,'威海','371000',15),(145,'日照','371100',15),(146,'莱芜','371200',15),(147,'临沂','371300',15),(148,'德州','371400',15),(149,'聊城','371500',15),(150,'滨州','371600',15),(151,'荷泽','371700',15),(152,'郑州','410100',16),(153,'开封','410200',16),(154,'洛阳','410300',16),(155,'平顶山','410400',16),(156,'安阳','410500',16),(157,'鹤壁','410600',16),(158,'新乡','410700',16),(159,'焦作','410800',16),(160,'濮阳','410900',16),(161,'许昌','411000',16),(162,'漯河','411100',16),(163,'三门峡','411200',16),(164,'南阳','411300',16),(165,'商丘','411400',16),(166,'信阳','411500',16),(167,'周口','411600',16),(168,'驻马店','411700',16),(169,'武汉','420100',17),(170,'黄石','420200',17),(171,'十堰','420300',17),(172,'宜昌','420500',17),(173,'襄樊','420600',17),(174,'鄂州','420700',17),(175,'荆门','420800',17),(176,'孝感','420900',17),(177,'荆州','421000',17),(178,'黄冈','421100',17),(179,'咸宁','421200',17),(180,'随州','421300',17),(181,'恩施土家族苗族自治州','422800',17),(182,'省直辖行政单位','429000',17),(183,'长沙','430100',18),(184,'株洲','430200',18),(185,'湘潭','430300',18),(186,'衡阳','430400',18),(187,'邵阳','430500',18),(188,'岳阳','430600',18),(189,'常德','430700',18),(190,'张家界','430800',18),(191,'益阳','430900',18),(192,'郴州','431000',18),(193,'永州','431100',18),(194,'怀化','431200',18),(195,'娄底','431300',18),(196,'湘西土家族苗族自治州','433100',18),(197,'广州','440100',19),(198,'韶关','440200',19),(199,'深圳','440300',19),(200,'珠海','440400',19),(201,'汕头','440500',19),(202,'佛山','440600',19),(203,'江门','440700',19),(204,'湛江','440800',19),(205,'茂名','440900',19),(206,'肇庆','441200',19),(207,'惠州','441300',19),(208,'梅州','441400',19),(209,'汕尾','441500',19),(210,'河源','441600',19),(211,'阳江','441700',19),(212,'清远','441800',19),(213,'东莞','441900',19),(214,'中山','442000',19),(215,'潮州','445100',19),(216,'揭阳','445200',19),(217,'云浮','445300',19),(218,'南宁','450100',20),(219,'柳州','450200',20),(220,'桂林','450300',20),(221,'梧州','450400',20),(222,'北海','450500',20),(223,'防城港','450600',20),(224,'钦州','450700',20),(225,'贵港','450800',20),(226,'玉林','450900',20),(227,'百色','451000',20),(228,'贺州','451100',20),(229,'河池','451200',20),(230,'来宾','451300',20),(231,'崇左','451400',20),(232,'海口','460100',21),(233,'三亚','460200',21),(234,'省直辖县级行政单位','469000',21),(235,'辖区','500100',22),(236,'县','500200',22),(237,'','500300',22),(238,'成都','510100',23),(239,'自贡','510300',23),(240,'攀枝花','510400',23),(241,'泸州','510500',23),(242,'德阳','510600',23),(243,'绵阳','510700',23),(244,'广元','510800',23),(245,'遂宁','510900',23),(246,'内江','511000',23),(247,'乐山','511100',23),(248,'南充','511300',23),(249,'眉山','511400',23),(250,'宜宾','511500',23),(251,'广安','511600',23),(252,'达州','511700',23),(253,'雅安','511800',23),(254,'巴中','511900',23),(255,'资阳','512000',23),(256,'阿坝藏族羌族自治州','513200',23),(257,'甘孜藏族自治州','513300',23),(258,'凉山彝族自治州','513400',23),(259,'贵阳','520100',24),(260,'六盘水','520200',24),(261,'遵义','520300',24),(262,'安顺','520400',24),(263,'铜仁地区','522200',24),(264,'黔西南布依族苗族自治州','522300',24),(265,'毕节地区','522400',24),(266,'黔东南苗族侗族自治州','522600',24),(267,'黔南布依族苗族自治州','522700',24),(268,'昆明','530100',25),(269,'曲靖','530300',25),(270,'玉溪','530400',25),(271,'保山','530500',25),(272,'昭通','530600',25),(273,'丽江','530700',25),(274,'思茅','530800',25),(275,'临沧','530900',25),(276,'楚雄彝族自治州','532300',25),(277,'红河哈尼族彝族自治州','532500',25),(278,'文山壮族苗族自治州','532600',25),(279,'西双版纳傣族自治州','532800',25),(280,'大理白族自治州','532900',25),(281,'德宏傣族景颇族自治州','533100',25),(282,'怒江傈僳族自治州','533300',25),(283,'迪庆藏族自治州','533400',25),(284,'拉萨','540100',26),(285,'昌都地区','542100',26),(286,'山南地区','542200',26),(287,'日喀则地区','542300',26),(288,'那曲地区','542400',26),(289,'阿里地区','542500',26),(290,'林芝地区','542600',26),(291,'西安','610100',27),(292,'铜川','610200',27),(293,'宝鸡','610300',27),(294,'咸阳','610400',27),(295,'渭南','610500',27),(296,'延安','610600',27),(297,'汉中','610700',27),(298,'榆林','610800',27),(299,'安康','610900',27),(300,'商洛','611000',27),(301,'兰州','620100',28),(302,'嘉峪关','620200',28),(303,'金昌','620300',28),(304,'白银','620400',28),(305,'天水','620500',28),(306,'武威','620600',28),(307,'张掖','620700',28),(308,'平凉','620800',28),(309,'酒泉','620900',28),(310,'庆阳','621000',28),(311,'定西','621100',28),(312,'陇南','621200',28),(313,'临夏回族自治州','622900',28),(314,'甘南藏族自治州','623000',28),(315,'西宁','630100',29),(316,'海东地区','632100',29),(317,'海北藏族自治州','632200',29),(318,'黄南藏族自治州','632300',29),(319,'海南藏族自治州','632500',29),(320,'果洛藏族自治州','632600',29),(321,'玉树藏族自治州','632700',29),(322,'海西蒙古族藏族自治州','632800',29),(323,'银川','640100',30),(324,'石嘴山','640200',30),(325,'吴忠','640300',30),(326,'固原','640400',30),(327,'中卫','640500',30),(328,'乌鲁木齐','650100',31),(329,'克拉玛依','650200',31),(330,'吐鲁番地区','652100',31),(331,'哈密地区','652200',31),(332,'昌吉回族自治州','652300',31),(333,'博尔塔拉蒙古自治州','652700',31),(334,'巴音郭楞蒙古自治州','652800',31),(335,'阿克苏地区','652900',31),(336,'克孜勒苏柯尔克孜自治州','653000',31),(337,'喀什地区','653100',31),(338,'和田地区','653200',31),(339,'伊犁哈萨克自治州','654000',31),(340,'塔城地区','654200',31),(341,'阿勒泰地区','654300',31),(342,'省直辖行政单位','659000',31),(343,'天津',NULL,2); +-- ALTER table userinfo drop positionId; diff --git a/crm/src/main/db/update_33.sql b/crm/src/main/db/update_33.sql new file mode 100644 index 0000000..6f7798d --- /dev/null +++ b/crm/src/main/db/update_33.sql @@ -0,0 +1,47 @@ +drop table if exists importMetaInfo; +CREATE TABLE importMetaInfo +( + id MEDIUMINT NOT NULL AUTO_INCREMENT, + name VARCHAR(255) NOT NULL, + entity_name VARCHAR(255), + importfilename VARCHAR(255), + logfilename VARCHAR(255), + whenadded DATETIME, + modifier VARCHAR(255), + modify_datetime DATETIME, + num_of_total_record MEDIUMINT, + num_of_imported MEDIUMINT, + num_of_failed MEDIUMINT, + status MEDIUMINT, + result MEDIUMINT, + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB; + + + +DROP TABLE IF EXISTS `importstatus`; +CREATE TABLE `crmdb`.`importstatus` ( + `id` INT NOT NULL, + `val` VARCHAR(45), + PRIMARY KEY (`id`) +) ENGINE InnoDB; +INSERT INTO importstatus (id,val) VALUES(0,'运行'); +INSERT INTO importstatus (id,val) VALUES(1,'已完成'); + +DROP TABLE IF EXISTS `importresult`; +CREATE TABLE `crmdb`.`importresult` ( + `id` INT NOT NULL, + `val` VARCHAR(45) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE InnoDB; +INSERT INTO importresult (id,val) VALUES(0,'成功'); +INSERT INTO importresult (id,val) VALUES(1,'失败'); + + +ALTER table user_position add externalId varchar(128); +ALTER table user_position add whenadded DATETIME; +ALTER table user_position add modifier VARCHAR(255); +ALTER table user_position add modify_datetime DATETIME; + + +ALTER TABLE user_position drop KEY user_position_unique; \ No newline at end of file diff --git a/crm/src/main/db/update_34.sql b/crm/src/main/db/update_34.sql new file mode 100644 index 0000000..aae5ef3 --- /dev/null +++ b/crm/src/main/db/update_34.sql @@ -0,0 +1,15 @@ +ALTER TABLE `crmdb`.`userinfo` +DROP COLUMN `ts`, +DROP COLUMN `isActivited`, +ADD UNIQUE INDEX `loginName_UNIQUE` (`loginName` ASC); + + +alter table importMetaInfo add num_of_updated int; + + +-- ALTER table accountcrmuser add externalId varchar(128); +ALTER table accountcrmuser add whenadded DATETIME; +ALTER table accountcrmuser add modifier VARCHAR(255); +ALTER table accountcrmuser add modify_datetime DATETIME; + +insert into user_position (userId,positionId,isPrimary) values(1,1,1); \ No newline at end of file diff --git a/crm/src/main/db/update_35.sql b/crm/src/main/db/update_35.sql new file mode 100644 index 0000000..8f89aab --- /dev/null +++ b/crm/src/main/db/update_35.sql @@ -0,0 +1,4 @@ +-- ALTER TABLE `crmdb`.`userinfo` +-- DROP COLUMN `ts`, +-- DROP COLUMN `isActivited`, +-- ADD UNIQUE INDEX `loginName_UNIQUE` (`loginName` ASC); \ No newline at end of file diff --git a/crm/src/main/db/update_36.sql b/crm/src/main/db/update_36.sql new file mode 100644 index 0000000..147081d --- /dev/null +++ b/crm/src/main/db/update_36.sql @@ -0,0 +1,7 @@ + +use crmdb; + + +set session old_alter_table =on; +ALTER IGNORE TABLE user_position ADD UNIQUE (positionId); +set session old_alter_table =off; diff --git a/crm/src/main/db/update_37.sql b/crm/src/main/db/update_37.sql new file mode 100644 index 0000000..7abe7e6 --- /dev/null +++ b/crm/src/main/db/update_37.sql @@ -0,0 +1,13 @@ +drop view if exists crmdb.activity_alert; +create view crmdb.activity_alert as +SELECT id, +case when to_days(curdate())-to_days(DATE_FORMAT(from_unixtime(act.starttime/1000),'%Y-%m-%d'))=0 THEN '今天' +when to_days(curdate())-to_days(DATE_FORMAT(from_unixtime(act.starttime/1000),'%Y-%m-%d'))=1 THEN '昨天' +when to_days(curdate())-to_days(DATE_FORMAT(from_unixtime(act.starttime/1000),'%Y-%m-%d'))=2 THEN '前天' +when to_days(curdate())-to_days(DATE_FORMAT(from_unixtime(act.starttime/1000),'%Y-%m-%d'))>=3 and to_days(curdate())-to_days(DATE_FORMAT(from_unixtime(act.starttime/1000),'%Y-%m-%d'))<7 THEN '三天以前' +when to_days(curdate())-to_days(DATE_FORMAT(from_unixtime(act.starttime/1000),'%Y-%m-%d'))>=7 THEN '七天以前' +ELSE '错误' END as time, +title, +act.owner as name, +act.starttime as times +FROM crmdb.activity act where status=1 and to_days(curdate())-to_days(DATE_FORMAT(from_unixtime(act.starttime/1000),'%Y-%m-%d'))>=0 order by times \ No newline at end of file diff --git a/crm/src/main/db/update_38.sql b/crm/src/main/db/update_38.sql new file mode 100644 index 0000000..516bab5 --- /dev/null +++ b/crm/src/main/db/update_38.sql @@ -0,0 +1,3 @@ +use crmdb; + +alter table account CHANGE COLUMN date_of_establish date_of_establish varchar(128); \ No newline at end of file diff --git a/crm/src/main/db/update_39.sql b/crm/src/main/db/update_39.sql new file mode 100644 index 0000000..c5c6a02 --- /dev/null +++ b/crm/src/main/db/update_39.sql @@ -0,0 +1,41 @@ +drop view if exists parent_user_info; +drop view if exists parent_user_position; +drop view if exists parent_position; +create view parent_user_info as select * from userinfo; +create view parent_user_position as select * from user_position; +create view parent_position as select * from crmuser; + +drop view if exists user_position_query; + +create view user_position_query as +select user_position.userid user_id, + user_position.positionid position_id, + region_level1_pl.val area, + region_level2_pl.val region, + province.val province, + crmuser_pl2.val productLine, + crmuser.level position_level, + crmuser.name position_name, + crmuser.code position_code, + userinfo.employeenumber delegatePosition, + userinfo.name delegateName, + parent_position.id manager_position_id, + parent_position.code managerPosition, + parent_position.name manager_position_name, + parent_position.level manager_position_level, + parent_user_info.employeenumber manager_employee_number, + parent_user_info.name regionManager, + account.name accountName, + account.bdm_code BDMcode +from user_position +left join crmuser on user_position.positionid = crmuser.id +left join userinfo on user_position.userid = userinfo.id +left join parent_position on crmuser.reportto = parent_position.id +left join parent_user_position on parent_position.id = parent_user_position.positionid +left join parent_user_info on parent_user_position.userid = parent_user_info.id +inner join accountcrmuser on user_position.positionid = accountcrmuser.crmuserid +inner join account on accountcrmuser.accountid = account.id +left join region_level1_pl on crmuser.pl4 = region_level1_pl.id +left join region_level2_pl on crmuser.pl5 = region_level2_pl.id +left join province on account.province = province.id +left join crmuser_pl2 on crmuser_pl2.id = crmuser.pl2 diff --git a/crm/src/main/db/update_4.sql b/crm/src/main/db/update_4.sql new file mode 100644 index 0000000..a00a678 --- /dev/null +++ b/crm/src/main/db/update_4.sql @@ -0,0 +1,19 @@ +use crmdb; + +drop trigger if exists activity_score_insert; +DELIMITER | + +CREATE TRIGGER activity_score_insert BEFORE INSERT ON activity + FOR EACH ROW BEGIN + SET NEW.total_score = (NEW.planing + NEW.openling + NEW.enquery_listening + NEW.deliverable + NEW.objection_handing + NEW.summary); + END; +| + +drop trigger if exists activity_score_update; +CREATE TRIGGER activity_score_update BEFORE UPDATE ON activity + FOR EACH ROW BEGIN + SET NEW.total_score = (NEW.planing + NEW.openling + NEW.enquery_listening + NEW.deliverable + NEW.objection_handing + NEW.summary); + END; +| + +DELIMITER ; \ No newline at end of file diff --git a/crm/src/main/db/update_40.sql b/crm/src/main/db/update_40.sql new file mode 100644 index 0000000..991b60a --- /dev/null +++ b/crm/src/main/db/update_40.sql @@ -0,0 +1,8 @@ +drop table if exists crmuser_level_pl; +CREATE TABLE `crmdb`.`crmuser_level_pl` ( + `id` INT NOT NULL, + `val` VARCHAR(45) NULL, + PRIMARY KEY (`id`)); + INSERT INTO `crmdb`.`crmuser_level_pl` (`id`, `val`) VALUES ('11', '11'); +INSERT INTO `crmdb`.`crmuser_level_pl` (`id`, `val`) VALUES ('21', '21'); +INSERT INTO `crmdb`.`crmuser_level_pl` (`id`, `val`) VALUES ('31', '31'); \ No newline at end of file diff --git a/crm/src/main/db/update_41.sql b/crm/src/main/db/update_41.sql new file mode 100644 index 0000000..d0ee79e --- /dev/null +++ b/crm/src/main/db/update_41.sql @@ -0,0 +1,2 @@ +INSERT INTO `crmdb`.`contact_grade_pl` (`val`) VALUES ('V'); +INSERT INTO `crmdb`.`contact_grade_pl` (`val`) VALUES ('非目标医生'); diff --git a/crm/src/main/db/update_5.sql b/crm/src/main/db/update_5.sql new file mode 100644 index 0000000..693b2bd --- /dev/null +++ b/crm/src/main/db/update_5.sql @@ -0,0 +1,15 @@ +use crmdb; +ALTER TABLE `crmdb`.`crmuser` +CHANGE COLUMN `isActivited` `isActivited` MEDIUMINT(9) NULL DEFAULT NULL ; + +DROP TABLE IF EXISTS `crmuser_activited`; +CREATE TABLE `crmdb`.`crmuser_activited` ( + `id` MEDIUMINT(9) NOT NULL AUTO_INCREMENT, + `val` VARCHAR(255) NULL, + PRIMARY KEY (`id`) + )ENGINE=InnoDB; +INSERT INTO `crmdb`.`crmuser_activited` (`id`, `val`) VALUES ('1', '已激活'); +INSERT INTO `crmdb`.`crmuser_activited` (`id`, `val`) VALUES ('2', '未激活'); + +ALTER TABLE `crmdb`.`account` +ADD UNIQUE INDEX `account_ix_01` (`bdm_code` ASC); \ No newline at end of file diff --git a/crm/src/main/db/update_51.sql b/crm/src/main/db/update_51.sql new file mode 100644 index 0000000..e1da5ce --- /dev/null +++ b/crm/src/main/db/update_51.sql @@ -0,0 +1,16 @@ +DELETE FROM `crmdb`.`activity_coachtime_pl` WHERE `id`='1'; +DROP TABLE `crmdb`.`activity_whethercoach_pl`; +UPDATE `crmdb`.`city` SET `val`='菏泽' WHERE `id`='151'; +UPDATE `crmdb`.`city` SET `val`='重庆' WHERE `id`='235'; +DELETE FROM `crmdb`.`city` WHERE `id`='236'; +INSERT INTO `crmdb`.`city` (`id`, `val`, `parentId`) VALUES ('345', '未知地域', '31'); +INSERT INTO `crmdb`.`city` (`id`, `val`, `parentId`) VALUES ('346', '未知地域', '27'); +INSERT INTO `crmdb`.`city` (`id`, `val`, `parentId`) VALUES ('347', '三河(虚拟)', '1'); + +UPDATE `crmdb`.`region_level2_pl` SET `val`='奥诺美北区' WHERE `id`='1'; +UPDATE `crmdb`.`region_level2_pl` SET `val`='奥诺美东北区' WHERE `id`='2'; +UPDATE `crmdb`.`region_level2_pl` SET `val`='奥诺美东一区' WHERE `id`='3'; +UPDATE `crmdb`.`region_level2_pl` SET `val`='奥诺美东二区' WHERE `id`='4'; +UPDATE `crmdb`.`region_level2_pl` SET `val`='奥诺美西区' WHERE `id`='5'; +UPDATE `crmdb`.`region_level2_pl` SET `val`='奥诺美南区' WHERE `id`='6'; +DELETE FROM `crmdb`.`region_level2_pl` WHERE `id`='7'; \ No newline at end of file diff --git a/crm/src/main/db/update_52.sql b/crm/src/main/db/update_52.sql new file mode 100644 index 0000000..ac3c3ff --- /dev/null +++ b/crm/src/main/db/update_52.sql @@ -0,0 +1,8 @@ +UPDATE `crmdb`.`alert_publicobject_pl` SET `val`='系统管理员' WHERE `id`='1'; +UPDATE `crmdb`.`alert_publicobject_pl` SET `val`='地区经理' WHERE `id`='2'; +UPDATE `crmdb`.`alert_publicobject_pl` SET `val`='销售代表' WHERE `id`='3'; + +DELETE FROM `crmdb`.`contact_grade_pl` WHERE `id`='4'; +UPDATE `crmdb`.`contact_grade_pl` SET `id`='4' WHERE `id`='5'; +UPDATE `crmdb`.`contact_grade_pl` SET `id`='5' WHERE `id`='6'; + diff --git a/crm/src/main/db/update_53.sql b/crm/src/main/db/update_53.sql new file mode 100644 index 0000000..9f503f0 --- /dev/null +++ b/crm/src/main/db/update_53.sql @@ -0,0 +1,51 @@ +DELETE FROM `crmdb`.`crmuser_pl2` WHERE `id`='4'; + +INSERT INTO `crmdb`.`alert_publicobject_pl` (`id`, `val`) VALUES ('4', '所有人'); + +drop view if exists crmdb.call_export; +create view crmdb.call_export as +SELECT act.id as id,act.title as Activity_title,acp.val as Activity_whetherCoach,afpp.val as Activity_feature_product,at.val as Activity_types,act.whenadded as Activity_addTime,act.modify_datetime as Activity_modifyTime,from_unixtime(act.starttime/1000) as Activity_start,from_unixtime(act.endtime/1000) as Activity_end, +u.name as Position_name,rlp1.val as Region_level_1,rlp2.val as Region_level_2,u.code as position_code,r.val as position_role, +c.name as Contact_name,cgp.val as Contact_grade,cdp.val as Contact_department,sp.val as Contact_sex,c.email as Contact_email,cdp2.val as Contact_duty,cjtp.val as Contact_job_title, +a.name as Account_name , a.bdm_code as Account_BDMCode,atl.val as Account_type,aalp.val as Account_administrative_level,aloap.val as local_or_army,acosp.val as comprehensive_or_specialized,app.val as isKey,asp.val as Account_status +FROM crmdb.activity act +left join crmdb.activity_coachtime_pl acp on +act.whetherCoach=acp.id +left join crmdb.activity_feature_product_pl afpp on +act.feature_product=afpp.id +left join crmdb.activity_types at on +act.activity_type=at.id +left join crmdb.crmuser u on +act.crmuserId = u.id +left join crmdb.contact c on +act.contactId = c.id +left join crmdb.contact_grade_pl cgp on +c.grade=cgp.id +left join crmdb.contact_department_pl cdp on +c.department=cdp.id +left join crmdb.sex_pl sp on +c.sex=sp.id +left join crmdb.contact_duty_pl cdp2 on +c.duty=cdp2.id +left join crmdb.contact_job_title_pl cjtp on +c.job_title=cjtp.id +left join crmdb.region_level1_pl rlp1 on +u.pl5=rlp1.id +left join crmdb.region_level2_pl rlp2 on +u.pl4=rlp2.id +left join crmdb.role r on +u.role=r.id +left join crmdb.account a on +c.accountId= a.id +left join crmdb.account_type_pl atl on +a.hospital_type = atl.id +left join crmdb.account_administrativ_level_pl aalp on +a.administrativ_level=aalp.id +left join crmdb.account_local_or_army_pl aloap on +a.local_or_army=aloap.id +left join crmdb.account_comprehensive_or_specialized_pl acosp on +a.comprehensive_or_specialized=acosp.id +left join crmdb.account_point_pl app on +a.key_type=app.id +left join crmdb.account_status_pl asp on +a.status=asp.id order by id \ No newline at end of file diff --git a/crm/src/main/db/update_54.sql b/crm/src/main/db/update_54.sql new file mode 100644 index 0000000..1c02bb6 --- /dev/null +++ b/crm/src/main/db/update_54.sql @@ -0,0 +1,13 @@ +CREATE TABLE `product` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(128) NOT NULL, + `status` int(11) NOT NULL DEFAULT '1', + `parentid` int(11) DEFAULT NULL, + `specification` varchar(512) DEFAULT NULL, + `created_date` datetime DEFAULT NULL, + `modified_date` datetime DEFAULT NULL, + `created_by_user_id` int(11) DEFAULT NULL, + `modfied_by_user_id` int(11) DEFAULT NULL, + `level` int(11) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8; diff --git a/crm/src/main/db/update_55.sql b/crm/src/main/db/update_55.sql new file mode 100644 index 0000000..a4c4ebd --- /dev/null +++ b/crm/src/main/db/update_55.sql @@ -0,0 +1,15 @@ +use crmdb; + +drop table if exists activity_coachtime_pl; +CREATE TABLE activity_coachtime_pl +( + id MEDIUMINT NOT NULL, + val VARCHAR(255), + PRIMARY KEY USING BTREE (id) +) ENGINE InnoDB DEFAULT CHARSET=utf8; +INSERT INTO `crmdb`.`activity_coachtime_pl` (`id`, `val`) VALUES ('1', '半天'); +INSERT INTO `crmdb`.`activity_coachtime_pl` (`id`, `val`) VALUES ('2', '全天'); + + +ALTER table accountcrmuser add owner VARCHAR(255); +ALTER table user_position add owner VARCHAR(255); \ No newline at end of file diff --git a/crm/src/main/db/update_56.sql b/crm/src/main/db/update_56.sql new file mode 100644 index 0000000..0a31884 --- /dev/null +++ b/crm/src/main/db/update_56.sql @@ -0,0 +1,32 @@ +DELETE FROM `crmdb`.`region_level1_pl` WHERE `id`='3'; +DELETE FROM `crmdb`.`region_level1_pl` WHERE `id`='1'; +DELETE FROM `crmdb`.`region_level1_pl` WHERE `id`='2'; +INSERT INTO `crmdb`.`region_level1_pl` (`id`, `val`) VALUES ('1', '中国区'); + +ALTER TABLE `crmdb`.`alert` +ADD COLUMN `alertRegion` MEDIUMINT(9) NULL AFTER `modify_datetime`; + +DROP TABLE IF EXISTS `crmdb`.`alert_region_pl`; +CREATE TABLE `crmdb`.`alert_region_pl` ( + `id` INT NOT NULL, + `val` VARCHAR(255) NULL, + PRIMARY KEY (`id`) + ) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8; + +INSERT INTO `crmdb`.`alert_region_pl` (`id`, `val`) VALUES ('1', '奥诺美北区'); +INSERT INTO `crmdb`.`alert_region_pl` (`id`, `val`) VALUES ('2', '奥诺美东北区'); +INSERT INTO `crmdb`.`alert_region_pl` (`id`, `val`) VALUES ('3', '奥诺美东一区'); +INSERT INTO `crmdb`.`alert_region_pl` (`id`, `val`) VALUES ('4', '奥诺美东二区'); +INSERT INTO `crmdb`.`alert_region_pl` (`id`, `val`) VALUES ('5', '奥诺美西区'); +INSERT INTO `crmdb`.`alert_region_pl` (`id`, `val`) VALUES ('6', '奥诺美南区'); +INSERT INTO `crmdb`.`alert_region_pl` (`id`, `val`) VALUES ('7', '所有区'); + +DELETE FROM `crmdb`.`data_exchange_teample` WHERE `id`='1'; + +INSERT INTO `crmdb`.`data_exchange_teample` (`id`, `name`, `template`) VALUES ('1', 'Account Export Full Template 1.0', '\n\n 1000\n Account\n BdmCode\n account.csv\n crm_mysql\n 100000\n GBK\n \n Id\n Integer\n Id\n \n\n \n Name\n String\n Name\n \n\n\n \n BdmCode\n String\n BdmCode\n \n\n\n \n DutyOfficer\n String\n DutyOfficer\n \n\n \n numofdoctors\n Integer\n numofdoctors\n \n\n \n numofsurgeryroom\n Integer\n numofsurgeryroom\n \n \n numofsurgeryperyear\n Integer\n numofsurgeryperyear\n \n \n numofpaindoctor\n Integer\n numofpaindoctor\n \n \n numofanesthesiadoctor\n Integer\n numofanesthesiadoctor\n \n \n totalnumofsickbed\n Integer\n totalnumofsickbed\n \n \n numofoutpatient\n Integer\n numofoutpatient\n \n \n numoftreatperyear\n Integer\n numoftreatperyear\n \n \n numofstaff\n Integer\n numofstaff\n \n \n numofassistantdoctors\n Integer\n numofassistantdoctors\n \n\n \n registeredcapital\n Integer\n registeredcapital\n \n \n numofusingopiatesinjection\n Integer\n numofusingopiatesinjection\n \n \n numofusingopiatesmedicine\n Integer\n numofusingopiatesmedicine\n \n\n \n dateofestablish\n Date\n dateofestablish\n m/d/yy\n \n\n \n fax\n Integer\n fax\n \n\n \n tel\n Integer\n tel\n \n\n \n districts\n Integer\n districts\n \n \n address\n Integer\n address\n \n \n owner\n Integer\n owner\n \n \n responsibleperson\n Integer\n responsibleperson\n \n\n\n \n whenadded\n Date\n whenadded\n m/d/yy\n \n\n \n modifydatetime\n Date\n modifydatetime\n m/d/yy\n \n\n \n modifier\n String\n modifier\n \n\n \n administrativlevel\n Integer\n administrativlevel\n \n\n\n \n 医院类型\n Lookup\n HospitalType\n AccountTypePl\n Val\n Id\n \n\n \n localorarmy\n Lookup\n localorarmy\n AccountLocalOrArmyPl\n Val\n Id\n \n\n \n comprehensiveorspecialized\n Lookup\n comprehensiveorspecialized\n AccountComprehensiveOrSpecializedPl\n Val\n Id\n \n\n\n \n keytype\n Lookup\n keytype\n AccountPointPl\n Val\n Id\n \n \n status\n Lookup\n status\n AccountStatusPl\n Val\n Id\n \n\n \n marketclassification\n Lookup\n marketclassification\n AccountMarketClassificationPl\n Val\n Id\n \n \n province\n Lookup\n province\n Province\n Val\n Id\n \n \n city\n Lookup\n city\n City\n Val\n Id\n \n\n'); +INSERT INTO `crmdb`.`data_exchange_teample` (`id`, `name`, `template`) VALUES ('2', 'Contact Export Full Template 1.0', '\n\n 1000\n Contact\n contact.csv\n contactCode\n crm_mysql\n GBK\n 100000\n \n contactCode\n String\n contactCode\n \n \n duty\n Lookup\n duty\n ContactDutyPl\n val\n Id\n \n \n grade\n Lookup\n grade\n ContactGradePl\n val\n Id\n \n \n \n \n \n marketclassification\n Lookup\n marketclassification\n ContactMarketClassificationPl\n val\n Id\n \n \n \n jobtitle\n Lookup\n jobtitle\n ContactJobTitlePl\n val\n Id\n \n \n \n accountId\n Lookup\n accountId\n Account\n Name\n Id\n \n \n \n \n \n city\n Lookup\n city\n City\n val\n Id\n \n \n \n sex\n Lookup\n sex\n SexPl\n val\n Id\n \n \n \n \n \n province\n Lookup\n province\n Province\n val\n Id\n \n \n cellphone\n String\n cellphone\n \n \n contactCode\n String\n contactCode\n \n \n 科室\n Lookup\n department\n ContactDepartmentPl\n val\n id\n \n \n districts\n String\n districts\n \n \n email\n String\n email\n \n \n modifier\n String\n modifier\n \n \n name\n String\n name\n \n \n nativeplace\n String\n nativeplace\n \n \n officefax\n String\n officefax\n \n \n officetel\n String\n officetel\n \n \n owner\n String\n owner\n \n \n producttarget\n String\n producttarget\n \n \n responsibleperson\n String\n responsibleperson\n \n \n status\n String\n status\n \n \n modifydatetime\n Date\n modifydatetime\n m/d/yy\n \n \n whenadded\n Date\n whenadded\n m/d/yy\n \n \n \n \n \n \n'); +INSERT INTO `crmdb`.`data_exchange_teample` (`id`, `name`, `template`) VALUES ('3', 'Position Export Full Template 1.0', '\n\n 1000\n Crmuser\n Id\n position.csv\n crm_mysql\n GBK\n 100000\n \n Id\n Integer\n Id\n \n \n Name\n String\n Name\n \n \n code\n String\n code\n \n \n reportto\n Integer\n reportto\n \n \n role\n Lookup\n role\n Role\n Val\n Id\n \n \n pl1\n Lookup\n pl1\n CrmuserPl1\n Val\n Id\n \n \n pl2\n Lookup\n pl2\n CrmuserPl2\n Val\n Id\n \n \n role\n Lookup\n role\n Role\n Val\n Id\n \n \n role\n Lookup\n role\n Role\n Val\n Id\n \n \n 城市\n Lookup\n city\n City\n Val\n Id\n \n \n modifier\n String\n Name\n \n \n department\n String\n Name\n \n\n \n pl4\n Lookup\n pl4\n RegionLevel1Pl\n Val\n Id\n \n \n pl5\n Lookup\n pl5\n RegionLevel2Pl\n Val\n Id\n \n \n whenadded\n Date\n whenadded\n m/d/yy\n \n \n modifydatetime\n Date\n modifydatetime\n m/d/yy\n \n \n owner\n String\n owner\n \n \n level\n Integer\n level\n \n'); +INSERT INTO `crmdb`.`data_exchange_teample` (`id`, `name`, `template`) VALUES ('4', 'Activity Export Full Template 1.0', '\n\n 1000\n Activity\n Id\n Activity.csv\n crm_mysql\n GBK\n 100000\n \n Id\n Integer\n Id\n \n \n Name\n String\n Name\n \n \n eventtype\n Lookup\n eventtype\n ActivityEventTypePl\n val\n Id\n \n \n starttime\n Date\n starttime\n m/d/yy\n \n \n endtime\n Date\n endtime\n m/d/yy\n \n \n title\n String\n title\n \n \n participants\n String\n participants\n \n \n activitytype\n Lookup\n activitytype\n \n ActivityTypes\n val\n Id\n \n\n'); +INSERT INTO `crmdb`.`data_exchange_teample` (`id`, `name`, `template`) VALUES ('5', 'Account Team Export Full Template 1.0', '\n\n 1000\n Accountcrmuser\n account_position.csv\n Id\n crm_mysql\n GBK\n 100000\n \n Id\n Integer\n Id\n \n \n \n accountId\n Lookup\n accountId\n Account\n Name\n Id\n \n \n \n crmuser\n Lookup\n crmuserid\n Crmuser\n name\n Id\n \n'); +INSERT INTO `crmdb`.`data_exchange_teample` (`id`, `name`, `template`) VALUES ('6', 'UserPosition Team Export Full Template 1.0', '\n\n 1000\n UserPosition\n user_position.csv\n ExternalId \n crm_mysql \n GBK\n 100000\n \n Id \n Integer \n Id \n \n positionId \n Integer \n positionId \n \n userId \n Integer \n userId \n \n \n positionid \n Lookup \n positionId \n Crmuser \n Name \n Id \n \n \n userId \n Lookup \n userId \n Userinfo \n name \n Id \n \n \n externalId \n String \n externalId \n \n'); + diff --git a/crm/src/main/db/update_57.sql b/crm/src/main/db/update_57.sql new file mode 100644 index 0000000..17e6698 --- /dev/null +++ b/crm/src/main/db/update_57.sql @@ -0,0 +1,14 @@ +ALTER TABLE `crmdb`.`activity` +ADD COLUMN `activity_coachType` MEDIUMINT(9) NULL AFTER `activity_daypart`; + +DROP TABLE IF EXISTS `crmdb`.`activity_coachtype_pl`; +CREATE TABLE `crmdb`.`activity_coachtype_pl` ( + `id` MEDIUMINT(9) NOT NULL, + `val` VARCHAR(255) NULL, + PRIMARY KEY (`id`) + ) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8; + +INSERT INTO `crmdb`.`activity_coachtype_pl` (`id`, `val`) VALUES ('1', '拜访辅导'); +INSERT INTO `crmdb`.`activity_coachtype_pl` (`id`, `val`) VALUES ('2', '科室会辅导'); +DELETE FROM `crmdb`.`activity_event_type_pl` WHERE `id`='3'; +UPDATE `crmdb`.`activity_event_type_pl` SET `val`='辅导' WHERE `id`='2'; \ No newline at end of file diff --git a/crm/src/main/db/update_58.sql b/crm/src/main/db/update_58.sql new file mode 100644 index 0000000..eaeec28 --- /dev/null +++ b/crm/src/main/db/update_58.sql @@ -0,0 +1,11 @@ +DROP TABLE IF EXISTS `crmdb`.`data_audit`; +CREATE TABLE `crmdb`.`data_audit` ( + `id` INT NOT NULL AUTO_INCREMENT, + `entity_name` VARCHAR(45) NOT NULL, + `record_id` INT NOT NULL, + `modify_time` DATETIME NOT NULL, + `modifier` VARCHAR(45) NOT NULL, + `column_name` VARCHAR(45) NOT NULL, + `old_value` VARCHAR(45) , + `new_value` VARCHAR(45) , + PRIMARY KEY (`id`)); \ No newline at end of file diff --git a/crm/src/main/db/update_59.sql b/crm/src/main/db/update_59.sql new file mode 100644 index 0000000..9057d01 --- /dev/null +++ b/crm/src/main/db/update_59.sql @@ -0,0 +1,44 @@ +use crmdb; +drop table if Exists product; +drop table if Exists productline; +drop table if Exists productcategory; +CREATE TABLE `product` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(128) NOT NULL, + `status` int(11) NOT NULL DEFAULT '1', + `productlineId` int(11) NOT NULL, + `description` varchar(512) DEFAULT NULL, + `whenadded` datetime DEFAULT NULL, + `modify_datetime` datetime DEFAULT NULL, + `owner` varchar(50) DEFAULT NULL, + `modifier` varchar(50) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8; + +CREATE TABLE `productcategory` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(128) NOT NULL, + `status` int(11) NOT NULL DEFAULT '1', + `productId` int(11) NOT NULL, + `description` varchar(512) DEFAULT NULL, + `whenadded` datetime DEFAULT NULL, + `modify_datetime` datetime DEFAULT NULL, + `owner` varchar(50) DEFAULT NULL, + `modifier` varchar(50) DEFAULT NULL, + `productlineId` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=103 DEFAULT CHARSET=utf8; + +CREATE TABLE `productline` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(128) NOT NULL, + `status` int(11) NOT NULL DEFAULT '1', + `description` varchar(512) DEFAULT NULL, + `whenadded` datetime DEFAULT NULL, + `modify_datetime` datetime DEFAULT NULL, + `owner` varchar(50) DEFAULT NULL, + `modifier` varchar(50) DEFAULT NULL, + `val` varchar(45) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8; + diff --git a/crm/src/main/db/update_6.sql b/crm/src/main/db/update_6.sql new file mode 100644 index 0000000..e0752ff --- /dev/null +++ b/crm/src/main/db/update_6.sql @@ -0,0 +1,5 @@ +use crmdb; + +-- ALTER table activity_visiting_purpose_pl change activity_type parentId mediumint(9); +ALTER table activity_visiting_purpose_pl add parentId mediumint(9); +update activity_visiting_purpose_pl set parentId = activity_type; \ No newline at end of file diff --git a/crm/src/main/db/update_60.sql b/crm/src/main/db/update_60.sql new file mode 100644 index 0000000..7b963de --- /dev/null +++ b/crm/src/main/db/update_60.sql @@ -0,0 +1,3 @@ +ALTER TABLE `crmdb`.`activity` +CHANGE COLUMN `endtime` `endtime` DATETIME NULL , +CHANGE COLUMN `starttime` `starttime` DATETIME NOT NULL ; \ No newline at end of file diff --git a/crm/src/main/db/update_61.sql b/crm/src/main/db/update_61.sql new file mode 100644 index 0000000..433a86d --- /dev/null +++ b/crm/src/main/db/update_61.sql @@ -0,0 +1,15 @@ +CREATE TABLE `crmdb`.`accountcrmuser_relation_history` ( + `id` INT NOT NULL AUTO_INCREMENT, + `position_id` INT NOT NULL, + `account_id` INT NOT NULL, + `modify_time` DATE NOT NULL, + `modifier` VARCHAR(45) NOT NULL, + PRIMARY KEY (`id`)); + +CREATE TABLE `crmdb`.`userposition_relation_history` ( + `id` INT NOT NULL AUTO_INCREMENT, + `position_id` INT NOT NULL, + `userinfo_id` INT NOT NULL, + `modify_time` DATE NOT NULL, + `modifier` VARCHAR(45) NOT NULL, + PRIMARY KEY (`id`)); diff --git a/crm/src/main/db/update_62.sql b/crm/src/main/db/update_62.sql new file mode 100644 index 0000000..f5039ce --- /dev/null +++ b/crm/src/main/db/update_62.sql @@ -0,0 +1,3 @@ +ALTER TABLE `crmdb`.`alert` +CHANGE COLUMN `expired` `expired` DATETIME NULL DEFAULT NULL , +CHANGE COLUMN `publishDate` `publishDate` DATETIME NULL DEFAULT NULL ; diff --git a/crm/src/main/db/update_63.sql b/crm/src/main/db/update_63.sql new file mode 100644 index 0000000..e305f40 --- /dev/null +++ b/crm/src/main/db/update_63.sql @@ -0,0 +1,15 @@ +drop view if exists crmdb.activity_alert; +create view crmdb.activity_alert as +select +id, +case +when to_days(curdate())-to_days(DATE_FORMAT(act.starttime,'%Y-%m-%d'))=0 THEN '今天' +when to_days(curdate())-to_days(DATE_FORMAT(act.starttime,'%Y-%m-%d'))=1 THEN '昨天' +when to_days(curdate())-to_days(DATE_FORMAT(act.starttime,'%Y-%m-%d'))=2 THEN '前天' +when to_days(curdate())-to_days(DATE_FORMAT(act.starttime,'%Y-%m-%d'))>=3 and to_days(curdate())-to_days(DATE_FORMAT(act.starttime,'%Y-%m-%d'))<7 THEN '三天以前' +when to_days(curdate())-to_days(DATE_FORMAT(act.starttime,'%Y-%m-%d'))>=7 THEN '七天以前' +ELSE '错误' END as time, +title, +act.owner as name, +act.starttime as times +from activity act where status=1 and to_days(curdate())-to_days(DATE_FORMAT(act.starttime,'%Y-%m-%d'))>=0 order by times \ No newline at end of file diff --git a/crm/src/main/db/update_64.sql b/crm/src/main/db/update_64.sql new file mode 100644 index 0000000..11123b5 --- /dev/null +++ b/crm/src/main/db/update_64.sql @@ -0,0 +1,15 @@ +ALTER TABLE `crmdb`.`alert` +ADD COLUMN `attachment` MEDIUMINT(9) NULL AFTER `alertRegion`; + +CREATE TABLE `crmdb`.`alertattachment` ( + `id` MEDIUMINT(9) NOT NULL, + `fileName` VARCHAR(255) NULL, + `whenadded` DATETIME NULL, + `owner` VARCHAR(255) NULL, + `alertId` MEDIUMINT(9) NULL, + `modify_datetime` DATETIME NULL, + PRIMARY KEY (`id`) + )ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8; + +ALTER TABLE `crmdb`.`data_audit` +CHANGE COLUMN `modify_time` `modify_time` DATETIME NOT NULL ; diff --git a/crm/src/main/db/update_65.sql b/crm/src/main/db/update_65.sql new file mode 100644 index 0000000..c74f2e8 --- /dev/null +++ b/crm/src/main/db/update_65.sql @@ -0,0 +1,35 @@ +drop view if exists user_position_query; +create view user_position_query as select +accountcrmuser.id as id, + `user_position`.`userId` AS `user_id`, + `user_position`.`positionId` AS `position_id`, + `region_level1_pl`.`val` AS `area`, + `region_level2_pl`.`val` AS `region`, + `province`.`val` AS `province`, + `crmuser_pl2`.`val` AS `productLine`, + `crmuser`.`level` AS `position_level`, + `crmuser`.`name` AS `position_name`, + `crmuser`.`code` AS `position_code`, + `userinfo`.`employeeNumber` AS `delegatePosition`, + `userinfo`.`name` AS `delegateName`, + `parent_position`.`id` AS `manager_position_id`, + `parent_position`.`code` AS `managerPosition`, + `parent_position`.`name` AS `manager_position_name`, + `parent_position`.`level` AS `manager_position_level`, + `parent_user_info`.`employeeNumber` AS `manager_employee_number`, + `parent_user_info`.`name` AS `regionManager`, + `account`.`name` AS `accountName`, + `account`.`bdm_code` AS `BDMcode` + from + (((((((((((`user_position` + left join `crmuser` ON ((`user_position`.`positionId` = `crmuser`.`id`))) + left join `userinfo` ON ((`user_position`.`userId` = `userinfo`.`id`))) + left join `parent_position` ON ((`crmuser`.`reportto` = `parent_position`.`id`))) + left join `parent_user_position` ON ((`parent_position`.`id` = `parent_user_position`.`positionId`))) + left join `parent_user_info` ON ((`parent_user_position`.`userId` = `parent_user_info`.`id`))) + join `accountcrmuser` ON ((`user_position`.`positionId` = `accountcrmuser`.`crmuserId`))) + join `account` ON ((`accountcrmuser`.`accountId` = `account`.`id`))) + left join `region_level1_pl` ON ((`crmuser`.`pl4` = `region_level1_pl`.`id`))) + left join `region_level2_pl` ON ((`crmuser`.`pl5` = `region_level2_pl`.`id`))) + left join `province` ON ((`account`.`province` = `province`.`id`))) + left join `crmuser_pl2` ON ((`crmuser_pl2`.`id` = `crmuser`.`pl2`))) \ No newline at end of file diff --git a/crm/src/main/db/update_66.sql b/crm/src/main/db/update_66.sql new file mode 100644 index 0000000..d92785a --- /dev/null +++ b/crm/src/main/db/update_66.sql @@ -0,0 +1,8 @@ +ALTER TABLE `crmdb`.`userposition_relation_history` +CHANGE COLUMN `userinfo_id` `user_id` INT(11) NOT NULL , +CHANGE COLUMN `modify_time` `modify_time` DATETIME NOT NULL ; + + +ALTER TABLE `crmdb`.`accountcrmuser_relation_history` +CHANGE COLUMN `modify_time` `modify_time` DATETIME NOT NULL ; + diff --git a/crm/src/main/db/update_67.sql b/crm/src/main/db/update_67.sql new file mode 100644 index 0000000..970ae93 --- /dev/null +++ b/crm/src/main/db/update_67.sql @@ -0,0 +1,41 @@ +drop VIEW if exists user_position_query; +USE `crmdb`; +CREATE + OR REPLACE ALGORITHM = UNDEFINED + DEFINER = `crm`@`localhost` + SQL SECURITY DEFINER +VIEW `user_position_query` AS + select + `accountcrmuser`.`id` AS `id`, + `user_position`.`userId` AS `user_id`, + `user_position`.`positionId` AS `position_id`, + `region_level1_pl`.`val` AS `area`, + `region_level2_pl`.`val` AS `region`, + `province`.`val` AS `province`, + `productline`.`val` AS `productLine`, + `crmuser`.`level` AS `position_level`, + `crmuser`.`name` AS `position_name`, + `crmuser`.`code` AS `position_code`, + `userinfo`.`employeeNumber` AS `delegatePosition`, + `userinfo`.`name` AS `delegateName`, + `parent_position`.`id` AS `manager_position_id`, + `parent_position`.`code` AS `managerPosition`, + `parent_position`.`name` AS `manager_position_name`, + `parent_position`.`level` AS `manager_position_level`, + `parent_user_info`.`employeeNumber` AS `manager_employee_number`, + `parent_user_info`.`name` AS `regionManager`, + `account`.`name` AS `accountName`, + `account`.`bdm_code` AS `BDMcode` + from + (((((((((((`user_position` + left join `crmuser` ON ((`user_position`.`positionId` = `crmuser`.`id`))) + left join `userinfo` ON ((`user_position`.`userId` = `userinfo`.`id`))) + left join `parent_position` ON ((`crmuser`.`reportto` = `parent_position`.`id`))) + left join `parent_user_position` ON ((`parent_position`.`id` = `parent_user_position`.`positionId`))) + left join `parent_user_info` ON ((`parent_user_position`.`userId` = `parent_user_info`.`id`))) + join `accountcrmuser` ON ((`user_position`.`positionId` = `accountcrmuser`.`crmuserId`))) + join `account` ON ((`accountcrmuser`.`accountId` = `account`.`id`))) + left join `region_level1_pl` ON ((`crmuser`.`pl4` = `region_level1_pl`.`id`))) + left join `region_level2_pl` ON ((`crmuser`.`pl5` = `region_level2_pl`.`id`))) + left join `province` ON ((`account`.`province` = `province`.`id`))) + left join `productline` ON ((`productline`.`id` = `crmuser`.`pl2`))); diff --git a/crm/src/main/db/update_68.sql b/crm/src/main/db/update_68.sql new file mode 100644 index 0000000..184f650 --- /dev/null +++ b/crm/src/main/db/update_68.sql @@ -0,0 +1,22 @@ +drop view if exists activity_alert; +create view activity_alert as + +select `act`.`id` AS `id`, +(case when ((to_days(curdate()) - to_days(date_format(`act`.`starttime`,'%Y-%m-%d'))) = 0) then '今天' +when ((to_days(curdate()) - to_days(date_format(`act`.`starttime`,'%Y-%m-%d'))) = 1) then '昨天' +when ((to_days(curdate()) - to_days(date_format(`act`.`starttime`,'%Y-%m-%d'))) = 2) then '前天' +when (((to_days(curdate()) - to_days(date_format(`act`.`starttime`,'%Y-%m-%d'))) >= 3) and ((to_days(curdate()) - to_days(date_format(`act`.`starttime`,'%Y-%m-%d'))) < 7)) then '三天以前' +when ((to_days(curdate()) - to_days(date_format(`act`.`starttime`,'%Y-%m-%d'))) >= 7) then '七天以前' + else '错误' end) AS `time`, +`act`.`title` AS `title`,`act`.`owner` AS `name`,`act`.`starttime` AS `starttime` ,act.endtime as endtime, +c.name as contact,avpp.val as purpose,act.whenadded as addtime,pl.val as product,acp.val as coachtype +from `activity` `act` +left join contact c on +c.id=act.contactId +left join activity_visiting_purpose_pl avpp on +act.visiting_purpose=avpp.id +left join productline pl on +pl.id=act.feature_product +left join activity_coachtype_pl acp on +acp.id=act.activity_coachType + where ((`act`.`status` = 1) and ((to_days(curdate()) - to_days(date_format(`act`.`starttime`,'%Y-%m-%d'))) >= 0)) order by `starttime` desc; diff --git a/crm/src/main/db/update_69.sql b/crm/src/main/db/update_69.sql new file mode 100644 index 0000000..a247244 --- /dev/null +++ b/crm/src/main/db/update_69.sql @@ -0,0 +1,20 @@ +drop view if exists user_position_account; +create view user_position_account as +select `ac`.`id` AS `id`,`u`.`name` AS `userName`,`u`.`loginName` AS `loginName`,`u`.`email` AS `email`,`sp`.`val` AS `sex`,`u`.`whenadded` AS `addTime`,`c`.`name` AS `positionName`,`c`.`code` AS `positionCode`, +(select `crm`.`name` from `crmuser` `crm` where (`crm`.`id` = `c`.`reportto`)) AS `reportTo`, +(select u.name from userinfo u left join user_position iup on iup.userId=u.id left join crmuser ic on ic.id=iup.positionId where ic.name=(select `crm`.`name` from `crmuser` `crm` where (`crm`.`id` = `c`.`reportto`))) as DSMName, +(select `c1`.`name` from `crmuser` `c1` where (`c1`.`id` = (select `c2`.`reportto` from `crmuser` `c2` where (`c2`.`id` = `c`.`reportto`)))) AS `reporttto`, +(select u.name from userinfo u left join user_position iup on iup.userId=u.id left join crmuser ic on ic.id=iup.positionId where ic.name=(select `c1`.`name` from `crmuser` `c1` where (`c1`.`id` = (select `c2`.`reportto` from `crmuser` `c2` where (`c2`.`id` = `c`.`reportto`))))) as RSMName, +`r`.`val` AS `role`,`rlp4`.`val` AS `regoin1`,`rlp5`.`val` AS `regoin2`,`ct`.`val` AS `city`,`a`.`name` AS `accountName`,`a`.`bdm_code` AS `BDMCode`,`aalp`.`val` AS `adminLevel`,`asp`.`val` AS `status` from (((((((((((`userinfo` `u` +left join `sex_pl` `sp` on((`u`.`sex` = `sp`.`id`))) +left join `user_position` `up` on((`u`.`id` = `up`.`userId`))) +left join `crmuser` `c` on((`up`.`positionId` = `c`.`id`))) +left join `role` `r` on((`c`.`role` = `r`.`id`))) +left join `region_level1_pl` `rlp4` on((`c`.`pl4` = `rlp4`.`id`))) +left join `region_level1_pl` `rlp5` on((`c`.`pl5` = `rlp5`.`id`))) +left join `city` `ct` on((`c`.`city` = `ct`.`id`))) + left join `accountcrmuser` `ac` on((`c`.`id` = `ac`.`crmuserId`))) +left join `account` `a` on((`ac`.`accountId` = `a`.`id`))) +left join `account_status_pl` `asp` on((`a`.`status` = `asp`.`id`))) +left join `account_administrativ_level_pl` `aalp` on((`a`.`administrativ_level` = `aalp`.`id`))) +where up.status = 1 and c.role>2 and ac.id>0 order by `ac`.`id`; diff --git a/crm/src/main/db/update_7.sql b/crm/src/main/db/update_7.sql new file mode 100644 index 0000000..ba1e6a5 --- /dev/null +++ b/crm/src/main/db/update_7.sql @@ -0,0 +1,59 @@ + + + + +DROP TABLE IF EXISTS `userInfo`; +CREATE TABLE `userInfo` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `department` varchar(255) DEFAULT NULL, + `division` varchar(255) DEFAULT NULL, + `cellPhone` varchar(255) DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `employeeNumber` varchar(255) DEFAULT NULL, + `photo` varchar(255) DEFAULT NULL, + `jobTitle` varchar(255) DEFAULT NULL, + `pl1` mediumint(9) DEFAULT NULL, + `pl2` mediumint(9) DEFAULT NULL, + `role` mediumint(9) DEFAULT NULL, + `pl4` mediumint(9) DEFAULT NULL, + `pl5` mediumint(9) DEFAULT NULL, + `sex` mediumint(9) DEFAULT NULL, + `loginName` varchar(255) DEFAULT NULL, + `password` varchar(255) DEFAULT NULL, + `sessionKey` varchar(255) DEFAULT NULL, + `lastLoginTime` bigint(20) DEFAULT NULL, + `whenadded` datetime DEFAULT NULL, + `reportto` mediumint(9) DEFAULT NULL, + `parcel` varchar(255) DEFAULT NULL, + `modifier` varchar(255) DEFAULT NULL, + `modify_datetime` datetime DEFAULT NULL, + `owner` varchar(255) DEFAULT NULL, + `postId` varchar(255) DEFAULT NULL, + `city` varchar(255) DEFAULT NULL, + `isActivited` mediumint(9) DEFAULT NULL, + `ts` bigint(20) DEFAULT NULL, + `positionId` mediumint(9) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=107 DEFAULT CHARSET=utf8; + +INSERT INTO `userInfo` (id,name,loginname,password,role,isActivited,ts,positionId) VALUES +(-1,'无','dummy','827ccb0eea8a706c4c34a16891f84e7b',1,2,1386766666,-1), +(1,'Admin Nam','admin','827ccb0eea8a706c4c34a16891f84e7b',1,2,1386766666,1), +(2,'Sales Manager','salesman','827ccb0eea8a706c4c34a16891f84e7b',2,2,1386766666,2), +(3,'Sales','sales','827ccb0eea8a706c4c34a16891f84e7b',3,2,1386766666,3); + +insert into crmuser (id,name,code,reportto,role) values +(-1,'无','BJ',0,-1), +(1,'管理员','BJ231011001',-1,1), +(2,'北区地区经理01','BJ131011001',1,2), +(3,'北区代表001','BJ131001001',2,3); + + + +ALTER table crmuser ADD level MEDIUMINT; +ALTER table crmuser ADD position_code varchar(255); + + + + diff --git a/crm/src/main/db/update_70.sql b/crm/src/main/db/update_70.sql new file mode 100644 index 0000000..b5a7b34 --- /dev/null +++ b/crm/src/main/db/update_70.sql @@ -0,0 +1,3 @@ +ALTER TABLE `crmdb`.`alertattachment` +CHANGE COLUMN `id` `id` MEDIUMINT(9) NOT NULL AUTO_INCREMENT , +ADD COLUMN `modifier` VARCHAR(255) NULL AFTER `modify_datetime`; \ No newline at end of file diff --git a/crm/src/main/db/update_71.sql b/crm/src/main/db/update_71.sql new file mode 100644 index 0000000..27c0cc2 --- /dev/null +++ b/crm/src/main/db/update_71.sql @@ -0,0 +1,2 @@ +ALTER TABLE `crmdb`.`alertattachment` +ADD COLUMN `srcForFile` VARCHAR(255) NULL AFTER `modifier`; \ No newline at end of file diff --git a/crm/src/main/db/update_72.sql b/crm/src/main/db/update_72.sql new file mode 100644 index 0000000..d8cd489 --- /dev/null +++ b/crm/src/main/db/update_72.sql @@ -0,0 +1,3 @@ +ALTER TABLE `crmdb`.`contact` +ADD COLUMN `initializationdepartment` VARCHAR(128) NULL AFTER `externalId`; +UPDATE `crmdb`.`contact_grade_pl` SET `val`='VIP' WHERE `id`='4'; \ No newline at end of file diff --git a/crm/src/main/db/update_73.sql b/crm/src/main/db/update_73.sql new file mode 100644 index 0000000..217b5a6 --- /dev/null +++ b/crm/src/main/db/update_73.sql @@ -0,0 +1,82 @@ +USE `crmdb`; +drop view if exists activity_alert; +CREATE + OR REPLACE ALGORITHM = UNDEFINED + DEFINER = `crm`@`localhost` + SQL SECURITY DEFINER +VIEW `activity_alert` AS + select + `act`.`id` AS `id`, + (case + when ((to_days(curdate()) - to_days(date_format(`act`.`starttime`, '%Y-%m-%d'))) = 0) then '今天' + when ((to_days(curdate()) - to_days(date_format(`act`.`starttime`, '%Y-%m-%d'))) = 1) then '昨天' + when ((to_days(curdate()) - to_days(date_format(`act`.`starttime`, '%Y-%m-%d'))) = 2) then '前天' + when + (((to_days(curdate()) - to_days(date_format(`act`.`starttime`, '%Y-%m-%d'))) >= 3) + and ((to_days(curdate()) - to_days(date_format(`act`.`starttime`, '%Y-%m-%d'))) < 7)) + then + '三天以前' + when ((to_days(curdate()) - to_days(date_format(`act`.`starttime`, '%Y-%m-%d'))) >= 7) then '七天以前' + else '错误' + end) AS `time`, + `act`.`title` AS `title`, + `act`.`owner` AS `name`, + `act`.`starttime` AS `starttime`, + `act`.`endtime` AS `endtime`, + `c`.`id` AS `contact`, + `avpp`.`val` AS `purpose`, + `act`.`whenadded` AS `addtime`, + `pl`.`val` AS `product`, + `acp`.`val` AS `coachtype` + from + ((((`activity` `act` + left join `contact` `c` ON ((`c`.`id` = `act`.`contactId`))) + left join `activity_visiting_purpose_pl` `avpp` ON ((`act`.`visiting_purpose` = `avpp`.`id`))) + left join `productline` `pl` ON ((`pl`.`id` = `act`.`feature_product`))) + left join `activity_coachtype_pl` `acp` ON ((`acp`.`id` = `act`.`activity_coachType`))) + where + ((`act`.`status` = 1) + and ((to_days(curdate()) - to_days(date_format(`act`.`starttime`, '%Y-%m-%d'))) >= 0)) + order by `act`.`starttime` desc; + + + drop view if exists user_position_query; + CREATE + ALGORITHM = UNDEFINED + DEFINER = `crm`@`localhost` + SQL SECURITY DEFINER +VIEW `user_position_query` AS + select + `accountcrmuser`.`id` AS `id`, + `user_position`.`userId` AS `user_id`, + `user_position`.`positionId` AS `position_id`, + `region_level1_pl`.`val` AS `area`, + `region_level2_pl`.`val` AS `region`, + `province`.`val` AS `province`, + `productline`.`val` AS `productLine`, + `crmuser`.`level` AS `position_level`, + `crmuser`.`name` AS `position_name`, + `crmuser`.`code` AS `position_code`, + `userinfo`.`employeeNumber` AS `delegatePosition`, + `userinfo`.`name` AS `delegateName`, + `parent_position`.`id` AS `manager_position_id`, + `parent_position`.`code` AS `managerPosition`, + `parent_position`.`name` AS `manager_position_name`, + `parent_position`.`level` AS `manager_position_level`, + `parent_user_info`.`employeeNumber` AS `manager_employee_number`, + `parent_user_info`.`name` AS `regionManager`, + `account`.`id` AS `accountName`, + `account`.`bdm_code` AS `BDMcode` + from + (((((((((((`user_position` + left join `crmuser` ON ((`user_position`.`positionId` = `crmuser`.`id`))) + left join `userinfo` ON ((`user_position`.`userId` = `userinfo`.`id`))) + left join `parent_position` ON ((`crmuser`.`reportto` = `parent_position`.`id`))) + left join `parent_user_position` ON ((`parent_position`.`id` = `parent_user_position`.`positionId`))) + left join `parent_user_info` ON ((`parent_user_position`.`userId` = `parent_user_info`.`id`))) + join `accountcrmuser` ON ((`user_position`.`positionId` = `accountcrmuser`.`crmuserId`))) + join `account` ON ((`accountcrmuser`.`accountId` = `account`.`id`))) + left join `region_level1_pl` ON ((`crmuser`.`pl4` = `region_level1_pl`.`id`))) + left join `region_level2_pl` ON ((`crmuser`.`pl5` = `region_level2_pl`.`id`))) + left join `province` ON ((`account`.`province` = `province`.`id`))) + left join `productline` ON ((`productline`.`id` = `crmuser`.`pl2`))) diff --git a/crm/src/main/db/update_8.sql b/crm/src/main/db/update_8.sql new file mode 100644 index 0000000..1b91b40 --- /dev/null +++ b/crm/src/main/db/update_8.sql @@ -0,0 +1,9 @@ + +drop table if exists user_position; +create table user_position ( +id int(64) auto_increment, +userId int(64), +positionId int(64), +primary key (id), +unique index user_position_unique (userId,positionId) +)ENGINE InnoDB; \ No newline at end of file diff --git a/crm/src/main/doc/account_crmuser_import.csv b/crm/src/main/doc/account_crmuser_import.csv new file mode 100644 index 0000000..babebdb --- /dev/null +++ b/crm/src/main/doc/account_crmuser_import.csv @@ -0,0 +1 @@ +BDM,λ,ExternalId 16940,SH131011001,16940SH131011001 16879,SH131011001,16879SH131011001 16836,SH131011001,16836SH131011001 \ No newline at end of file diff --git a/crm/src/main/doc/account_crmuser_import.xml b/crm/src/main/doc/account_crmuser_import.xml new file mode 100644 index 0000000..192c097 --- /dev/null +++ b/crm/src/main/doc/account_crmuser_import.xml @@ -0,0 +1,30 @@ + + + 1000 + Accountcrmuser + account_crmuser_import.csv + ExternalId + crm_mysql + 100000 + + ExternalId + String + ExternalId + + + BDM编码 + Lookup + accountId + Account + BdmCode + Id + + + 岗位编码 + Lookup + crmuserid + Crmuser + Code + Id + + \ No newline at end of file diff --git a/crm/src/main/doc/account_export.xml b/crm/src/main/doc/account_export.xml new file mode 100644 index 0000000..00327ea --- /dev/null +++ b/crm/src/main/doc/account_export.xml @@ -0,0 +1,246 @@ + + + 1000 + Account + BdmCode + account.csv + crm_mysql + 100000 + + Id + Integer + Id + + + + Name + String + Name + + + + + BdmCode + String + BdmCode + + + + + Grade + String + Grade + + + + DutyOfficer + String + DutyOfficer + + + + numofdoctors + Integer + numofdoctors + + + + numofsurgeryroom + Integer + numofsurgeryroom + + + numofsurgeryperyear + Integer + numofsurgeryperyear + + + numofpaindoctor + Integer + numofpaindoctor + + + numofanesthesiadoctor + Integer + numofanesthesiadoctor + + + totalnumofsickbed + Integer + totalnumofsickbed + + + numofoutpatient + Integer + numofoutpatient + + + numoftreatperyear + Integer + numoftreatperyear + + + numofstaff + Integer + numofstaff + + + numofassistantdoctors + Integer + numofassistantdoctors + + + + registeredcapital + Integer + registeredcapital + + + numofusingopiatesinjection + Integer + numofusingopiatesinjection + + + numofusingopiatesmedicine + Integer + numofusingopiatesmedicine + + + + dateofestablish + Date + dateofestablish + m/d/yy + + + + fax + Integer + fax + + + + tel + Integer + tel + + + + districts + Integer + districts + + + address + Integer + address + + + owner + Integer + owner + + + responsibleperson + Integer + responsibleperson + + + + + whenadded + Date + whenadded + m/d/yy + + + + modifydatetime + Date + modifydatetime + m/d/yy + + + + modifier + String + modifier + + + + administrativlevel + String + administrativlevel + + + + + 医院类型 + Lookup + HospitalType + AccountTypePl + Val + Id + + + + localorarmy + Lookup + localorarmy + AccountLocalOrArmyPl + Val + Id + + + + comprehensiveorspecialized + Lookup + comprehensiveorspecialized + AccountComprehensiveOrSpecializedPl + Val + Id + + + + + keytype + Lookup + keytype + AccountPointPl + Val + Id + + + status + Lookup + status + AccountStatusPl + Val + Id + + + + marketclassification + Lookup + marketclassification + AccountMarketClassificationPl + Val + Id + + + province + Lookup + province + Province + Val + Id + + + city + Lookup + city + City + Val + Id + + diff --git a/crm/src/main/doc/account_import.csv b/crm/src/main/doc/account_import.csv new file mode 100644 index 0000000..f408d14 --- /dev/null +++ b/crm/src/main/doc/account_import.csv @@ -0,0 +1 @@ +BDM,׼ҽԺ,ʡ,,,,ҽԺ,طҽԺ,ۺרҽԺ,صҽԺ,״̬,ҽԺּ,г 10071,ѪܲרҽԺ,,,,,ŵĿҽԺ,طҽԺ,ۺҽԺ,ŵصҽԺ,Ч,,սԳ 11139,йһͻְҽԺ,,,ϳ,δ,ĿҽԺ,ҽԺ,רҽԺ,صҽԺ,Ч,,һ 1114,дȾҽԺ,,,,,ʹĿҽԺ,ҽԺ,ۺҽԺ,ŵصҽԺ,Ч,, \ No newline at end of file diff --git a/crm/src/main/doc/account_import.xml b/crm/src/main/doc/account_import.xml new file mode 100644 index 0000000..fc82666 --- /dev/null +++ b/crm/src/main/doc/account_import.xml @@ -0,0 +1,106 @@ + + + 1000 + Account + BdmCode + account_import.csv + crm_mysql + 100000 + + BDM编码 + String + BdmCode + + + 标准医院名 + String + Name + + + 省份 + Lookup + Province + Province + Val + Id + + + 城市 + Lookup + city + City + Val + Id + + + 区县 + String + districts + + + true + 行政级别 + Lookup + AdministrativLevel + AccountAdministrativLevelPl + Val + Id + + + true + 医院分级 + Lookup + Grade + AccountGradePl + Val + Id + + + 医院类型 + Lookup + HospitalType + AccountTypePl + Val + Id + + + 地方军队医院 + Lookup + LocalOrArmy + AccountLocalOrArmyPl + Val + Id + + + 综合专科医院 + Lookup + ComprehensiveOrSpecialized + AccountComprehensiveOrSpecializedPl + Val + Id + + + 重点医院 + Lookup + KeyType + AccountPointPl + Val + Id + + + 状态 + Lookup + Status + AccountStatusPl + Val + Id + + + 市场分类 + Lookup + MarketClassification + AccountMarketClassificationPl + Val + Id + + diff --git a/crm/src/main/doc/account_position_export.xml b/crm/src/main/doc/account_position_export.xml new file mode 100644 index 0000000..876b701 --- /dev/null +++ b/crm/src/main/doc/account_position_export.xml @@ -0,0 +1,32 @@ + + + 1000 + Accountcrmuser + account_position.csv + Id + crm_mysql + 100000 + + Id + Integer + Id + + + + accountId + Lookup + accountId + Account + Name + Id + + + + crmuser + Lookup + crmuserid + Crmuser + name + Id + + \ No newline at end of file diff --git a/crm/src/main/doc/activity_crmuser_export.xml b/crm/src/main/doc/activity_crmuser_export.xml new file mode 100644 index 0000000..33499ae --- /dev/null +++ b/crm/src/main/doc/activity_crmuser_export.xml @@ -0,0 +1,35 @@ + + + 1000 + Activitycrmuser + activity_crmuser.csv + Id + crm_mysql + 100000 + + Id + Integer + Id + + + + activityid + Lookup + activityid + Activity + Name + Id + + + + crmuserid + Lookup + crmuserid + Userinfo + name + Id + + + + + \ No newline at end of file diff --git a/crm/src/main/doc/activity_export.xml b/crm/src/main/doc/activity_export.xml new file mode 100644 index 0000000..364059b --- /dev/null +++ b/crm/src/main/doc/activity_export.xml @@ -0,0 +1,67 @@ + + + 1000 + Activity + Id + Activity.csv + crm_mysql + 100000 + + Id + Integer + Id + + + Name + String + Name + + + + crmuserId + Lookup + crmuserId + Userinfo + Name + Id + + + eventtype + Lookup + eventtype + ActivityEventTypePl + val + Id + + + starttime + Date + starttime + m/d/yy + + + endtime + Date + endtime + m/d/yy + + + title + String + title + + + participants + String + participants + + + activitytype + Lookup + activitytype + + ActivityTypes + val + Id + + diff --git a/crm/src/main/doc/configuration.xml b/crm/src/main/doc/configuration.xml new file mode 100644 index 0000000..94d59d6 --- /dev/null +++ b/crm/src/main/doc/configuration.xml @@ -0,0 +1,37 @@ + + + 1000 + crm_mysql + Account + ExternalId + + false + Id + Integer + Id + + + false + ExternalId + Integer + ExternalId + + + false + StartTime + Date + StartTime + YYYY-MM-DD + + + true + Department + Lookup + DepartmentId + Department + Name + Id + + account.csv + 1000000 + diff --git a/crm/src/main/doc/contact_export.xml b/crm/src/main/doc/contact_export.xml new file mode 100644 index 0000000..349d7f6 --- /dev/null +++ b/crm/src/main/doc/contact_export.xml @@ -0,0 +1,180 @@ + + + 1000 + Contact + contact.csv + contactCode + crm_mysql + 100000 + + contactCode + String + contactCode + + + duty + Lookup + duty + ContactDutyPl + val + Id + + + grade + Lookup + grade + ContactGradePl + val + Id + + + + + + marketclassification + Lookup + marketclassification + ContactMarketClassificationPl + val + Id + + + + jobtitle + Lookup + jobtitle + ContactJobTitlePl + val + Id + + + + accountId + Lookup + accountId + Account + Name + Id + + + + + + city + Lookup + city + City + val + Id + + + + sex + Lookup + sex + SexPl + val + Id + + + + + + province + Lookup + province + Province + val + Id + + + cellphone + String + cellphone + + + contactCode + String + contactCode + + + 科室 + Lookup + department + ContactDepartmentPl + val + id + + + districts + String + districts + + + email + String + email + + + modifier + String + modifier + + + name + String + name + + + nativeplace + String + nativeplace + + + officefax + String + officefax + + + officetel + String + officetel + + + owner + String + owner + + + producttarget + String + producttarget + + + responsibleperson + String + responsibleperson + + + status + String + status + + + modifydatetime + Date + modifydatetime + m/d/yy + + + whenadded + Date + whenadded + m/d/yy + + + + + + + \ No newline at end of file diff --git a/crm/src/main/doc/contact_import.csv b/crm/src/main/doc/contact_import.csv new file mode 100644 index 0000000..2a6d48c --- /dev/null +++ b/crm/src/main/doc/contact_import.csv @@ -0,0 +1 @@ +,ҽּ,¾,ʹ̨,ְ,ְ,Ա,ֻ,BDM,״̬,CRMҽ,ο, ƽ,A,80,80,סԺҽʦ,,,13888888888,20540,Ч,D0000001,, лȻ,A,20,20,ҽʦ,,Ů,13777777777,20540,Ч,D0000002,, ,A,20,20,ҽʦ,ɹ,,13555555555,20151,Ч,D0000003,, \ No newline at end of file diff --git a/crm/src/main/doc/contact_import.xml b/crm/src/main/doc/contact_import.xml new file mode 100644 index 0000000..be95619 --- /dev/null +++ b/crm/src/main/doc/contact_import.xml @@ -0,0 +1,76 @@ + + + 1000 + Contact + contact_import.csv + ContactCode + crm_mysql + 100000 + + + Code + String + ContactCode + + + + 目标医生姓名 + String + name + + + 医生级别 + Lookup + grade + ContactGradePl + val + Id + + + 职称 + Lookup + jobtitle + ContactJobTitlePl + val + Id + + + + 行政职务(如有) + Lookup + duty + ContactDutyPl + val + Id + + + 医院ID + Lookup + accountid + Account + BdmCode + Id + + + 科室 + Lookup + department + ContactDepartmentPl + val + id + + + 性别 + Lookup + sex + SexPl + val + Id + + + + 手机 + String + cellphone + + \ No newline at end of file diff --git a/crm/src/main/doc/crmuser_import.csv b/crm/src/main/doc/crmuser_import.csv new file mode 100644 index 0000000..0cff48d --- /dev/null +++ b/crm/src/main/doc/crmuser_import.csv @@ -0,0 +1 @@ +λ,λ,ϼλ,ɫ,״̬,Ʒ,,һ,, E1131031001,E1131031001,,,Ч,ŵ,31,й,,ŵһ һ01,SH131021001,E1131031001,,Ч,ŵ,21,й,Ϻ,ŵһ һ001,SH131011001,SH131021001,۴,Ч,ŵ,11,й,Ϻ,ŵһ \ No newline at end of file diff --git a/crm/src/main/doc/crmuser_reportto_import.csv b/crm/src/main/doc/crmuser_reportto_import.csv new file mode 100644 index 0000000..0cff48d --- /dev/null +++ b/crm/src/main/doc/crmuser_reportto_import.csv @@ -0,0 +1 @@ +λ,λ,ϼλ,ɫ,״̬,Ʒ,,һ,, E1131031001,E1131031001,,,Ч,ŵ,31,й,,ŵһ һ01,SH131021001,E1131031001,,Ч,ŵ,21,й,Ϻ,ŵһ һ001,SH131011001,SH131021001,۴,Ч,ŵ,11,й,Ϻ,ŵһ \ No newline at end of file diff --git a/crm/src/main/doc/mag.rptdesign b/crm/src/main/doc/mag.rptdesign new file mode 100644 index 0000000..903ef96 --- /dev/null +++ b/crm/src/main/doc/mag.rptdesign @@ -0,0 +1,8302 @@ + + + Eclipse BIRT Designer Version 4.3.1.v201309091055 Build <4.3.1.v20130918-1142> + + + Data Cube - dl_by_dn_date.dl_by_dn_date.x + integer + false + + + Data Cube - dl_by_dn_date.dl_by_dn_date.y + integer + false + + + downloading_mag.downloading_of_magazine.x + integer + false + + + downloading_mag.downloading_of_magazine.y + integer + false + + + downloading_mag.downloading_of_magazine.width + integer + false + + + downloading_mag.downloading_of_magazine.height + integer + false + + + downloading_mag.Group3.NewTabularHierarchy4.x + integer + false + + + downloading_mag.Group3.NewTabularHierarchy4.y + integer + false + + + 135 + 80 + 226 + 46 + 150 + 200 + 12 + 46 + + + queryText + 297 + + + queryTimeOut + 297 + + + rowFetchSize + 297 + + + queryText + 273 + + + queryTimeOut + 273 + + + rowFetchSize + 273 + + + queryText + 275 + + + queryTimeOut + 275 + + + rowFetchSize + 275 + + + in + /templates/blank_report.gif + auto layout + ltr + 96 + + + + + metadataBidiFormatStr + ILYNN + + + disabledMetadataBidiFormatStr + + + contentBidiFormatStr + ILYNN + + + disabledContentBidiFormatStr + + + com.mysql.jdbc.Driver + jdbc:mysql://localhost:3306/analyzerdb + analyzer + New BIRT JDBC Data Source + abc + + + + + + + id + measure + id + id + + + device_id + dimension + device_id + device_id + + + log_time + dimension + log_time + log_time + + + event_type + dimension + event_type + event_type + + + param1 + dimension + param1 + param1 + + + param2 + dimension + param2 + param2 + + + param3 + dimension + param3 + param3 + + + param4 + dimension + param4 + param4 + + + param5 + dimension + param5 + param5 + + + param6 + dimension + param6 + param6 + + + + + + 1 + id + decimal + + + 2 + device_id + string + + + 3 + log_time + date-time + + + 4 + event_type + string + + + 5 + param1 + string + + + 6 + param2 + string + + + 7 + param3 + string + + + 8 + param4 + string + + + 9 + param5 + string + + + 10 + param6 + string + + + + analyzer data source + + + 1 + id + id + decimal + -5 + + + 2 + device_id + device_id + string + 12 + + + 3 + log_time + log_time + date-time + 93 + + + 4 + event_type + event_type + string + 12 + + + 5 + param1 + param1 + string + 12 + + + 6 + param2 + param2 + string + 12 + + + 7 + param3 + param3 + string + 12 + + + 8 + param4 + param4 + string + 12 + + + 9 + param5 + param5 + string + 12 + + + 10 + param6 + param6 + string + 12 + + + + + + 2.0 + + + + + + + id + 1 + + -5 + 20 + 0 + NotNullable + + id + + + + id + + 20 + + + + + + + device_id + 2 + + 12 + 64 + 0 + NotNullable + + device_id + + + + device_id + + 64 + + + + + + + log_time + 3 + + 93 + 19 + 0 + NotNullable + + log_time + + + + log_time + + 19 + + + + + + + event_type + 4 + + 12 + 32 + 0 + Nullable + + event_type + + + + event_type + + 32 + + + + + + + param1 + 5 + + 12 + 64 + 0 + Nullable + + param1 + + + + param1 + + 64 + + + + + + + param2 + 6 + + 12 + 64 + 0 + Nullable + + param2 + + + + param2 + + 64 + + + + + + + param3 + 7 + + 12 + 64 + 0 + Nullable + + param3 + + + + param3 + + 64 + + + + + + + param4 + 8 + + 12 + 64 + 0 + Nullable + + param4 + + + + param4 + + 64 + + + + + + + param5 + 9 + + 12 + 64 + 0 + Nullable + + param5 + + + + param5 + + 64 + + + + + + + param6 + 10 + + 12 + 64 + 0 + Nullable + + param6 + + + + param6 + + 64 + + + + + + + +]]> + + + nulls lowest + + + count(id) + measure + count(id) + count(id) + + + dldt + dimension + dldt + dldt + + + + + + + 1 + count(id) + decimal + + + 2 + dldt + date + + + + analyzer data source + + + 1 + count(id) + count(id) + decimal + -5 + + + 2 + dldt + dldt + date + 12 + + + + + + 2.0 + + + + + + + imei + 1 + + 12 + 32 + 0 + Nullable + + imei + + + + imei + + 32 + + + + + + + dldt + 2 + + 12 + 10 + 0 + Nullable + + dldt + + + + dldt + + 10 + + + + + + + +]]> + + + + + count(device_id) + measure + count(device_id) + count(device_id) + + + dt + dimension + dt + dt + + + + + + + 1 + count(device_id) + decimal + + + 2 + dt + date + + + + analyzer data source + + + 1 + count(device_id) + count(device_id) + decimal + -5 + + + 2 + dt + dt + date + 12 + + + + + + 2.0 + + + + + + + count(device_id) + 1 + + -5 + 21 + 0 + NotNullable + + count(device_id) + + + + count(device_id) + + 21 + + + + + + + dt + 2 + + 12 + 8 + 0 + Nullable + + dt + + + + dt + + 8 + + + + + + + +]]> + + + + + count(id) + measure + count(id) + count(id) + + + dt + dimension + dt + dt + + + + + + + 1 + count(id) + decimal + + + 2 + dt + string + + + + analyzer data source + + + 1 + count(id) + count(id) + decimal + -5 + + + 2 + dt + dt + string + 12 + + + + + + 2.0 + + + + + + + count(id) + 1 + + -5 + 21 + 0 + NotNullable + + count(id) + + + + count(id) + + 21 + + + + + + + dt + 2 + + 12 + 8 + 0 + Nullable + + dt + + + + dt + + 8 + + + + + + + +]]> + + + + + count(id) + measure + count(id) + count(id) + + + dt + dimension + dt + dt + + + + + + + 1 + count(id) + decimal + + + 2 + dt + date + + + + analyzer data source + + + 1 + count(id) + count(id) + decimal + -5 + + + 2 + dt + dt + date + 12 + + + + + + 2.0 + + + + + + + count(id) + 1 + + -5 + 21 + 0 + NotNullable + + count(id) + + + + count(id) + + 21 + + + + + + + dt + 2 + + 12 + 8 + 0 + Nullable + + dt + + + + dt + + 8 + + + + + + + +]]> + + + nulls lowest + + + dt + dimension + dt + dt + + + MagazineName + dimension + MagazineName + MagazineName + + + count(magazine.MagazineId) + measure + count(magazine.MagazineId) + count(magazine.MagazineId) + + + + + + + 1 + dt + date + + + 2 + MagazineName + string + + + 3 + count(magazine.MagazineId) + decimal + + + + analyzer data source + + + 1 + dt + dt + date + 12 + + + 2 + MagazineName + MagazineName + string + 12 + + + 3 + count(magazine.MagazineId) + count(magazine.MagazineId) + decimal + -5 + + + + + + 2.0 + + + + + + + id + 1 + + -5 + 20 + 0 + NotNullable + + id + + + + id + + 20 + + + + + + + device_id + 2 + + 12 + 64 + 0 + NotNullable + + device_id + + + + device_id + + 64 + + + + + + + log_time + 3 + + 93 + 19 + 0 + NotNullable + + log_time + + + + log_time + + 19 + + + + + + + event_type + 4 + + 12 + 32 + 0 + Nullable + + event_type + + + + event_type + + 32 + + + + + + + param1 + 5 + + 12 + 64 + 0 + Nullable + + param1 + + + + param1 + + 64 + + + + + + + param2 + 6 + + 12 + 64 + 0 + Nullable + + param2 + + + + param2 + + 64 + + + + + + + param3 + 7 + + 12 + 64 + 0 + Nullable + + param3 + + + + param3 + + 64 + + + + + + + param4 + 8 + + 12 + 64 + 0 + Nullable + + param4 + + + + param4 + + 64 + + + + + + + param5 + 9 + + 12 + 64 + 0 + Nullable + + param5 + + + + param5 + + 64 + + + + + + + param6 + 10 + + 12 + 64 + 0 + Nullable + + param6 + + + + param6 + + 64 + + + + + + + MagazineId + 11 + + -5 + 20 + 0 + NotNullable + + MagazineId + + + + MagazineId + + 20 + + + + + + + Description + 12 + + 12 + 21845 + 0 + Nullable + + Description + + + + Description + + 21845 + + + + + + + MagazineName + 13 + + 12 + 64 + 0 + Nullable + + MagazineName + + + + MagazineName + + 64 + + + + + + + MagazineCover + 14 + + 12 + 256 + 0 + Nullable + + MagazineCover + + + + MagazineCover + + 256 + + + + + + + AdminId + 15 + + -5 + 20 + 0 + NotNullable + + AdminId + + + + AdminId + + 20 + + + + + + + CreateDate + 16 + + 93 + 19 + 0 + Nullable + + CreateDate + + + + CreateDate + + 19 + + + + + + + CategoryId + 17 + + -5 + 20 + 0 + Nullable + + CategoryId + + + + CategoryId + + 20 + + + + + + + PublishDate + 18 + + 93 + 19 + 0 + Nullable + + PublishDate + + + + PublishDate + + 19 + + + + + + + PressId + 19 + + -5 + 20 + 0 + Nullable + + PressId + + + + PressId + + 20 + + + + + + + +]]> + + + + + param2 + dimension + param2 + param2 + + + log_time + dimension + log_time + log_time + + + ct + measure + ct + ct + + + + + + + 1 + param2 + string + + + 2 + log_time + date-time + + + 3 + ct + decimal + + + + analyzer data source + + + 1 + param2 + param2 + string + 12 + + + 2 + log_time + log_time + date-time + 93 + + + 3 + ct + ct + decimal + -5 + + + + + + 2.0 + + + + + + + id + 1 + + -5 + 20 + 0 + NotNullable + + id + + + + id + + 20 + + + + + + + device_id + 2 + + 12 + 64 + 0 + NotNullable + + device_id + + + + device_id + + 64 + + + + + + + log_time + 3 + + 93 + 19 + 0 + NotNullable + + log_time + + + + log_time + + 19 + + + + + + + event_type + 4 + + 12 + 32 + 0 + Nullable + + event_type + + + + event_type + + 32 + + + + + + + param1 + 5 + + 12 + 64 + 0 + Nullable + + param1 + + + + param1 + + 64 + + + + + + + param2 + 6 + + 12 + 64 + 0 + Nullable + + param2 + + + + param2 + + 64 + + + + + + + param3 + 7 + + 12 + 64 + 0 + Nullable + + param3 + + + + param3 + + 64 + + + + + + + param4 + 8 + + 12 + 64 + 0 + Nullable + + param4 + + + + param4 + + 64 + + + + + + + param5 + 9 + + 12 + 64 + 0 + Nullable + + param5 + + + + param5 + + 64 + + + + + + + param6 + 10 + + 12 + 64 + 0 + Nullable + + param6 + + + + param6 + + 64 + + + + + + + +]]> + + + + + MagazineId + measure + MagazineId + MagazineId + + + MagazineName + dimension + MagazineName + MagazineName + + + + + + 1 + MagazineId + decimal + + + 2 + MagazineName + string + + + + analyzer data source + + + 1 + MagazineId + MagazineId + decimal + -5 + + + 2 + MagazineName + MagazineName + string + 12 + + + + + + 2.0 + + + + + + + MagazineId + 1 + + -5 + 20 + 0 + NotNullable + + MagazineId + + + + MagazineId + + 20 + + + + + + + MagazineName + 2 + + 12 + 64 + 0 + Nullable + + MagazineName + + + + MagazineName + + 64 + + + + + + + +]]> + + + + + count(distinct id) + measure + count(distinct id) + count(distinct id) + + + + + + + 1 + count(distinct id) + decimal + + + + analyzer data source + + + 1 + count(distinct id) + count(distinct id) + decimal + -5 + + + + + + 2.0 + + + + + + + count(distinct id) + 1 + + -5 + 21 + 0 + NotNullable + + count(distinct id) + + + + count(distinct id) + + 21 + + + + + + + +]]> + + + + + + + NewTabularHierarchy + + + + + string + event_type + + + + + + + NewTabularHierarchy1 + + + + + string + device_id + + + + + + + + + + + count + false + dataSetRow["event_type"] + integer + true + + + + + event_data + + + + + NewTabularHierarchy2 + + + + + string + dt + + + + + + + NewTabularHierarchy3 + + + + + string + MagazineName + + + + + + + + + + + sum + false + dataSetRow["count(magazine.MagazineId)"] + decimal + true + + + + + download_spec_magazine_by_date + + + + + true + NewTabularHierarchy5 + + + + + integer + year + + + DateTime + date-time + + + log_time + + + integer + month + + + DateTime + date-time + + + log_time + + + integer + week-of-year + + + DateTime + date-time + + + log_time + + + integer + day-of-month + + + DateTime + date-time + + + log_time + + + + + + + NewTabularHierarchy4 + + + + + string + MagazineName + + + decimal + MagazineId + + + magazineInfo + + + + + + + + + dataSetRow["ct"] + decimal + + + + + downloading_of_magazine + + + + + param2 + MagazineId + + + NewTabularHierarchy4 + + + + + + + + + + + + 0in + + + html + new Date()]]> + + + + + + + 19.927083333333332in + 8.291666666666666in + + 1.0208333333333333in + + + 4.53125in + + + 2.7395833333333335in + + + 0.3958333333333333in + + + 12pt + bold + right + auto + + + + + + 12pt + bold + num_of_device_id + + + count(distinct id) + count(distinct id) + dataSetRow["count(distinct id)"] + decimal + + + count(distinct id) + + + + + + 0.3541666666666667in + + 3 + 1 + + + + + 2.96875in + + 3 + 1 + + + 2.6.1 + Bar Chart + Side-by-side + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + false + + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true + 5 + 5 + + + + 0 + + 255 + 0 + 0 + 0 + + false + + + 0.0 + 0.0 + 0.0 + 0.0 + + + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + false + + + + 0 + + 255 + 0 + 0 + 0 + + false + + + 2.0 + 2.0 + 2.0 + 2.0 + + + + + + + + + Vertical + Top_Bottom + + + 1 + + 255 + 0 + 0 + 0 + + true + + Right + Series + + <Caption> + <Value></Value> + <Font> + <Alignment/> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + <Visible>false</Visible> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>false</Visible> + + Above + + + 0.0 + 0.0 + 212.0 + 130.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true + + Two_Dimensional + Points + 10.0 + + enable.area.alt + false + + + + 'A','B','C','D','E' + + + 5,4,12 + 0 + + + + + + This chart contains no data. + + + Center + Center + + + + + 64 + 127 + 127 + 127 + + + + 128 + 127 + 127 + 127 + + true + + + 10.0 + 10.0 + 10.0 + 10.0 + + false + + + Text + + <Caption> + <Value>X-Axis Title</Value> + <Font> + <Size>14.0</Size> + <Bold>true</Bold> + <Alignment> + <horizontalAlignment>Center</horizontalAlignment> + <verticalAlignment>Center</verticalAlignment> + </Alignment> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>false</Visible> + + Below + + Linear + + <Caption> + <Value>Y-Axis Title</Value> + <Font> + <Size>14.0</Size> + <Bold>true</Bold> + <Alignment> + <horizontalAlignment>Center</horizontalAlignment> + <verticalAlignment>Center</verticalAlignment> + </Alignment> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>false</Visible> + + Left + + + + + Text + + + + + + 255 + 80 + 166 + 218 + + + 255 + 108 + 222 + 228 + + 90.0 + + + 255 + 242 + 88 + 106 + + + 255 + 232 + 172 + 57 + + + 255 + 128 + 255 + 128 + + + 255 + 64 + 128 + 128 + + + 255 + 128 + 128 + 192 + + + 255 + 170 + 85 + 85 + + + 255 + 128 + 128 + 0 + + + 255 + 192 + 192 + 192 + + + 255 + 255 + 255 + 128 + + + 255 + 128 + 192 + 128 + + + 255 + 7 + 146 + 94 + + + 255 + 0 + 128 + 255 + + + 255 + 255 + 128 + 192 + + + 255 + 0 + 255 + 255 + + + 255 + 255 + 128 + 128 + + + 255 + 0 + 128 + 192 + + + 255 + 128 + 128 + 192 + + + 255 + 255 + 0 + 255 + + + 255 + 128 + 64 + 64 + + + 255 + 255 + 128 + 64 + + + 255 + 80 + 240 + 120 + + + 255 + 0 + 64 + 128 + + + 255 + 128 + 0 + 64 + + + 255 + 255 + 0 + 128 + + + 255 + 128 + 128 + 64 + + + 255 + 128 + 128 + 128 + + + 255 + 255 + 128 + 255 + + + 255 + 0 + 64 + 0 + + + 255 + 0 + 0 + 0 + + + 255 + 255 + 255 + 255 + + + 255 + 255 + 128 + 0 + + + + true + + + row["count(id)"] + + Text + Sum + + + Series 1 + + + Orthogonal_Value + + , + + Outside + false + + onmouseover + + Show_Tooltip + + + 200 + + + + + + + 1 + + 255 + 128 + 128 + 128 + + true + + + North + + Rectangle + + + Text + Sum + + + Vertical + + + 1 + + 255 + 0 + 0 + 0 + + true + + + Left + + + + 1 + + 255 + 196 + 196 + 196 + + false + + Across + + + 1 + + 255 + 196 + 196 + 196 + + true + + + + + + 1 + + 255 + 225 + 225 + 225 + + false + + Across + + + 1 + + 255 + 225 + 225 + 225 + + false + + + + 5 + + + Min + + 0.0 + + + true + false + + + + + + + + + 255 + 80 + 166 + 218 + + + 255 + 108 + 222 + 228 + + 90.0 + + + 255 + 242 + 88 + 106 + + + 255 + 232 + 172 + 57 + + + 255 + 128 + 255 + 128 + + + 255 + 64 + 128 + 128 + + + 255 + 128 + 128 + 192 + + + 255 + 170 + 85 + 85 + + + 255 + 128 + 128 + 0 + + + 255 + 192 + 192 + 192 + + + 255 + 255 + 255 + 128 + + + 255 + 128 + 192 + 128 + + + 255 + 7 + 146 + 94 + + + 255 + 0 + 128 + 255 + + + 255 + 255 + 128 + 192 + + + 255 + 0 + 255 + 255 + + + 255 + 255 + 128 + 128 + + + 255 + 0 + 128 + 192 + + + 255 + 128 + 128 + 192 + + + 255 + 255 + 0 + 255 + + + 255 + 128 + 64 + 64 + + + 255 + 255 + 128 + 64 + + + 255 + 80 + 240 + 120 + + + 255 + 0 + 64 + 128 + + + 255 + 128 + 0 + 64 + + + 255 + 255 + 0 + 128 + + + 255 + 128 + 128 + 64 + + + 255 + 128 + 128 + 128 + + + 255 + 255 + 128 + 255 + + + 255 + 0 + 64 + 0 + + + 255 + 0 + 0 + 0 + + + 255 + 255 + 255 + 255 + + + 255 + 255 + 128 + 0 + + + + true + + + row["dldt"] + + + + + Orthogonal_Value + + , + + Outside + false + + + true + Years + Text + Sum + + + Horizontal + + + 1 + + 255 + 0 + 0 + 0 + + true + + + Below + 1 + + + + 1 + + 255 + 196 + 196 + 196 + + false + + Across + + + 1 + + 255 + 196 + 196 + 196 + + true + + + + + + 1 + + 255 + 225 + 225 + 225 + + false + + Across + + + 1 + + 255 + 225 + 225 + 225 + + false + + + + 5 + false + + + Min + + 0.0 + + + true + true + false + + Vertical + 50.0 + + + -20.0 + 45.0 + 0.0 + None + + + false + +]]> + SVG + false + 2.5520833333333335in + 8.104166666666666in + devices_by_date + + + count(id) + dataSetRow["count(id)"] + decimal + + + dldt + dataSetRow["dldt"] + string + + + + + + + 0.3333333333333333in + + 3 + 1 + + + + + 4in + + 3 + 1 + + + 2.6.1 + Bar Chart + Side-by-side + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + false + + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true + 5 + 5 + + + + 0 + + 255 + 0 + 0 + 0 + + false + + + 0.0 + 0.0 + 0.0 + 0.0 + + + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + false + + + + 0 + + 255 + 0 + 0 + 0 + + false + + + 2.0 + 2.0 + 2.0 + 2.0 + + + + + + + + + Vertical + Top_Bottom + + + 1 + + 255 + 0 + 0 + 0 + + true + + Right + Series + + <Caption> + <Value></Value> + <Font> + <Alignment/> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + <Visible>false</Visible> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>false</Visible> + + Above + + + 0.0 + 0.0 + 212.0 + 130.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true + + Two_Dimensional + Points + 10.0 + + enable.area.alt + false + + + + A, B, C + + + 5,4,12 + 0 + + + + + + This chart contains no data. + + + Center + Center + + + + + 64 + 127 + 127 + 127 + + + + 128 + 127 + 127 + 127 + + true + + + 10.0 + 10.0 + 10.0 + 10.0 + + false + + + Text + + <Caption> + <Value>X-Axis Title</Value> + <Font> + <Size>14.0</Size> + <Bold>true</Bold> + <Alignment> + <horizontalAlignment>Center</horizontalAlignment> + <verticalAlignment>Center</verticalAlignment> + </Alignment> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>false</Visible> + + Below + + Linear + + <Caption> + <Value>Y-Axis Title</Value> + <Font> + <Size>14.0</Size> + <Bold>true</Bold> + <Alignment> + <horizontalAlignment>Center</horizontalAlignment> + <verticalAlignment>Center</verticalAlignment> + </Alignment> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>false</Visible> + + Left + + + + + + + + 255 + 80 + 166 + 218 + + + 255 + 108 + 222 + 228 + + 90.0 + + + 255 + 242 + 88 + 106 + + + 255 + 232 + 172 + 57 + + + 255 + 128 + 255 + 128 + + + 255 + 64 + 128 + 128 + + + 255 + 128 + 128 + 192 + + + 255 + 170 + 85 + 85 + + + 255 + 128 + 128 + 0 + + + 255 + 192 + 192 + 192 + + + 255 + 255 + 255 + 128 + + + 255 + 128 + 192 + 128 + + + 255 + 7 + 146 + 94 + + + 255 + 0 + 128 + 255 + + + 255 + 255 + 128 + 192 + + + 255 + 0 + 255 + 255 + + + 255 + 255 + 128 + 128 + + + 255 + 0 + 128 + 192 + + + 255 + 128 + 128 + 192 + + + 255 + 255 + 0 + 255 + + + 255 + 128 + 64 + 64 + + + 255 + 255 + 128 + 64 + + + 255 + 80 + 240 + 120 + + + 255 + 0 + 64 + 128 + + + 255 + 128 + 0 + 64 + + + 255 + 255 + 0 + 128 + + + 255 + 128 + 128 + 64 + + + 255 + 128 + 128 + 128 + + + 255 + 255 + 128 + 255 + + + 255 + 0 + 64 + 0 + + + 255 + 0 + 0 + 0 + + + 255 + 255 + 255 + 255 + + + 255 + 255 + 128 + 0 + + + + true + + + row["count(device_id)"] + + Text + Sum + + + Series 1 + + + Orthogonal_Value + + , + + Outside + false + + onmouseover + + Show_Tooltip + + + 200 + + + + + + + 1 + + 255 + 128 + 128 + 128 + + true + + + North + + Rectangle + + + Text + Sum + + + Vertical + + + 1 + + 255 + 0 + 0 + 0 + + true + + + Left + + + + 1 + + 255 + 196 + 196 + 196 + + false + + Across + + + 1 + + 255 + 196 + 196 + 196 + + true + + + + + + 1 + + 255 + 225 + 225 + 225 + + false + + Across + + + 1 + + 255 + 225 + 225 + 225 + + false + + + + 5 + true + + + Min + + 0.0 + + + true + false + + + + + + + + + 255 + 80 + 166 + 218 + + + 255 + 108 + 222 + 228 + + 90.0 + + + 255 + 242 + 88 + 106 + + + 255 + 232 + 172 + 57 + + + 255 + 128 + 255 + 128 + + + 255 + 64 + 128 + 128 + + + 255 + 128 + 128 + 192 + + + 255 + 170 + 85 + 85 + + + 255 + 128 + 128 + 0 + + + 255 + 192 + 192 + 192 + + + 255 + 255 + 255 + 128 + + + 255 + 128 + 192 + 128 + + + 255 + 7 + 146 + 94 + + + 255 + 0 + 128 + 255 + + + 255 + 255 + 128 + 192 + + + 255 + 0 + 255 + 255 + + + 255 + 255 + 128 + 128 + + + 255 + 0 + 128 + 192 + + + 255 + 128 + 128 + 192 + + + 255 + 255 + 0 + 255 + + + 255 + 128 + 64 + 64 + + + 255 + 255 + 128 + 64 + + + 255 + 80 + 240 + 120 + + + 255 + 0 + 64 + 128 + + + 255 + 128 + 0 + 64 + + + 255 + 255 + 0 + 128 + + + 255 + 128 + 128 + 64 + + + 255 + 128 + 128 + 128 + + + 255 + 255 + 128 + 255 + + + 255 + 0 + 64 + 0 + + + 255 + 0 + 0 + 0 + + + 255 + 255 + 255 + 255 + + + 255 + 255 + 128 + 0 + + + + true + + + row["dt"] + + + + + Orthogonal_Value + + , + + Outside + false + + + true + Text + Sum + + + Horizontal + + + 1 + + 255 + 0 + 0 + 0 + + true + + + Below + + + + 1 + + 255 + 196 + 196 + 196 + + false + + Across + + + 1 + + 255 + 196 + 196 + 196 + + true + + + + + + 1 + + 255 + 225 + 225 + 225 + + false + + Across + + + 1 + + 255 + 225 + 225 + 225 + + false + + + + 5 + + + Min + + 0.0 + + + true + true + false + + Vertical + 50.0 + + + -20.0 + 45.0 + 0.0 + None + + + +]]> + SVG + false + 3.5625in + 8.0625in + active_device_by_date + + + count(device_id) + dataSetRow["count(device_id)"] + decimal + + + dt + dataSetRow["dt"] + string + + + + + + + 0.23958333333333334in + + 3 + 1 + + + + + 3.6041666666666665in + + 3 + 1 + + + 2.6.1 + Bar Chart + Side-by-side + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + false + + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true + 5 + 5 + + + + 0 + + 255 + 0 + 0 + 0 + + false + + + 0.0 + 0.0 + 0.0 + 0.0 + + + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + false + + + + 0 + + 255 + 0 + 0 + 0 + + false + + + 2.0 + 2.0 + 2.0 + 2.0 + + + + + + + + + Vertical + Top_Bottom + + + 1 + + 255 + 0 + 0 + 0 + + true + + Right + Series + + <Caption> + <Value></Value> + <Font> + <Alignment/> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + <Visible>false</Visible> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>false</Visible> + + Above + + + 0.0 + 0.0 + 212.0 + 130.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true + + Two_Dimensional + Points + 10.0 + + enable.area.alt + false + + + + A, B, C + + + 5,4,12 + 0 + + + + + + This chart contains no data. + + + Center + Center + + + + + 64 + 127 + 127 + 127 + + + + 128 + 127 + 127 + 127 + + true + + + 10.0 + 10.0 + 10.0 + 10.0 + + false + + + Text + + <Caption> + <Value>X-Axis Title</Value> + <Font> + <Size>14.0</Size> + <Bold>true</Bold> + <Alignment> + <horizontalAlignment>Center</horizontalAlignment> + <verticalAlignment>Center</verticalAlignment> + </Alignment> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>false</Visible> + + Below + + Linear + + <Caption> + <Value>Y-Axis Title</Value> + <Font> + <Size>14.0</Size> + <Bold>true</Bold> + <Alignment> + <horizontalAlignment>Center</horizontalAlignment> + <verticalAlignment>Center</verticalAlignment> + </Alignment> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>false</Visible> + + Left + + + + + + + + 255 + 80 + 166 + 218 + + + 255 + 108 + 222 + 228 + + 90.0 + + + 255 + 242 + 88 + 106 + + + 255 + 232 + 172 + 57 + + + 255 + 128 + 255 + 128 + + + 255 + 64 + 128 + 128 + + + 255 + 128 + 128 + 192 + + + 255 + 170 + 85 + 85 + + + 255 + 128 + 128 + 0 + + + 255 + 192 + 192 + 192 + + + 255 + 255 + 255 + 128 + + + 255 + 128 + 192 + 128 + + + 255 + 7 + 146 + 94 + + + 255 + 0 + 128 + 255 + + + 255 + 255 + 128 + 192 + + + 255 + 0 + 255 + 255 + + + 255 + 255 + 128 + 128 + + + 255 + 0 + 128 + 192 + + + 255 + 128 + 128 + 192 + + + 255 + 255 + 0 + 255 + + + 255 + 128 + 64 + 64 + + + 255 + 255 + 128 + 64 + + + 255 + 80 + 240 + 120 + + + 255 + 0 + 64 + 128 + + + 255 + 128 + 0 + 64 + + + 255 + 255 + 0 + 128 + + + 255 + 128 + 128 + 64 + + + 255 + 128 + 128 + 128 + + + 255 + 255 + 128 + 255 + + + 255 + 0 + 64 + 0 + + + 255 + 0 + 0 + 0 + + + 255 + 255 + 255 + 255 + + + 255 + 255 + 128 + 0 + + + + true + + + row["count(id)"] + + Text + Sum + + + Series 1 + + + Orthogonal_Value + + , + + Outside + false + + onmouseover + + Show_Tooltip + + + 200 + + + + + + + 1 + + 255 + 128 + 128 + 128 + + true + + + North + + Rectangle + + + Text + Sum + + + Vertical + + + 1 + + 255 + 0 + 0 + 0 + + true + + + Left + + + + 1 + + 255 + 196 + 196 + 196 + + false + + Across + + + 1 + + 255 + 196 + 196 + 196 + + true + + + + + + 1 + + 255 + 225 + 225 + 225 + + false + + Across + + + 1 + + 255 + 225 + 225 + 225 + + false + + + + 5 + + + Min + + 0.0 + + + true + false + + + + + + + + + 255 + 80 + 166 + 218 + + + 255 + 108 + 222 + 228 + + 90.0 + + + 255 + 242 + 88 + 106 + + + 255 + 232 + 172 + 57 + + + 255 + 128 + 255 + 128 + + + 255 + 64 + 128 + 128 + + + 255 + 128 + 128 + 192 + + + 255 + 170 + 85 + 85 + + + 255 + 128 + 128 + 0 + + + 255 + 192 + 192 + 192 + + + 255 + 255 + 255 + 128 + + + 255 + 128 + 192 + 128 + + + 255 + 7 + 146 + 94 + + + 255 + 0 + 128 + 255 + + + 255 + 255 + 128 + 192 + + + 255 + 0 + 255 + 255 + + + 255 + 255 + 128 + 128 + + + 255 + 0 + 128 + 192 + + + 255 + 128 + 128 + 192 + + + 255 + 255 + 0 + 255 + + + 255 + 128 + 64 + 64 + + + 255 + 255 + 128 + 64 + + + 255 + 80 + 240 + 120 + + + 255 + 0 + 64 + 128 + + + 255 + 128 + 0 + 64 + + + 255 + 255 + 0 + 128 + + + 255 + 128 + 128 + 64 + + + 255 + 128 + 128 + 128 + + + 255 + 255 + 128 + 255 + + + 255 + 0 + 64 + 0 + + + 255 + 0 + 0 + 0 + + + 255 + 255 + 255 + 255 + + + 255 + 255 + 128 + 0 + + + + true + + + row["dt"] + + + + + Orthogonal_Value + + , + + Outside + false + + + true + Text + Sum + + + Horizontal + + + 1 + + 255 + 0 + 0 + 0 + + true + + + Below + + + + 1 + + 255 + 196 + 196 + 196 + + false + + Across + + + 1 + + 255 + 196 + 196 + 196 + + true + + + + + + 1 + + 255 + 225 + 225 + 225 + + false + + Across + + + 1 + + 255 + 225 + 225 + 225 + + false + + + + 5 + false + + + Min + + 0.0 + + + true + true + false + + Vertical + 50.0 + + + -20.0 + 45.0 + 0.0 + None + + + +]]> + SVG + false + 3.1666666666666665in + 8.020833333333334in + visiting_by_date + + + count(id) + dataSetRow["count(id)"] + decimal + + + dt + dataSetRow["dt"] + string + + + + + + + 0.23958333333333334in + + 3 + 1 + + + + + 3.8020833333333335in + + 3 + 1 + + + 2.6.1 + Bar Chart + Side-by-side + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + false + + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true + 5 + 5 + + + + 0 + + 255 + 0 + 0 + 0 + + false + + + 0.0 + 0.0 + 0.0 + 0.0 + + + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + false + + + + 0 + + 255 + 0 + 0 + 0 + + false + + + 2.0 + 2.0 + 2.0 + 2.0 + + + + + + + + + Vertical + Top_Bottom + + + 1 + + 255 + 0 + 0 + 0 + + true + + Right + Series + + <Caption> + <Value></Value> + <Font> + <Alignment/> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + <Visible>false</Visible> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>false</Visible> + + Above + + + 0.0 + 0.0 + 212.0 + 130.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true + + Two_Dimensional + Points + 10.0 + + enable.area.alt + false + + + + A, B, C + + + 5,4,12 + 0 + + + + + + This chart contains no data. + + + Center + Center + + + + + 64 + 127 + 127 + 127 + + + + 128 + 127 + 127 + 127 + + true + + + 10.0 + 10.0 + 10.0 + 10.0 + + false + + + Text + + <Caption> + <Value>X-Axis Title</Value> + <Font> + <Size>14.0</Size> + <Bold>true</Bold> + <Alignment> + <horizontalAlignment>Center</horizontalAlignment> + <verticalAlignment>Center</verticalAlignment> + </Alignment> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>false</Visible> + + Below + + Linear + + <Caption> + <Value>Y-Axis Title</Value> + <Font> + <Size>14.0</Size> + <Bold>true</Bold> + <Alignment> + <horizontalAlignment>Center</horizontalAlignment> + <verticalAlignment>Center</verticalAlignment> + </Alignment> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>false</Visible> + + Left + + + + + + + + 255 + 80 + 166 + 218 + + + 255 + 108 + 222 + 228 + + 90.0 + + + 255 + 242 + 88 + 106 + + + 255 + 232 + 172 + 57 + + + 255 + 128 + 255 + 128 + + + 255 + 64 + 128 + 128 + + + 255 + 128 + 128 + 192 + + + 255 + 170 + 85 + 85 + + + 255 + 128 + 128 + 0 + + + 255 + 192 + 192 + 192 + + + 255 + 255 + 255 + 128 + + + 255 + 128 + 192 + 128 + + + 255 + 7 + 146 + 94 + + + 255 + 0 + 128 + 255 + + + 255 + 255 + 128 + 192 + + + 255 + 0 + 255 + 255 + + + 255 + 255 + 128 + 128 + + + 255 + 0 + 128 + 192 + + + 255 + 128 + 128 + 192 + + + 255 + 255 + 0 + 255 + + + 255 + 128 + 64 + 64 + + + 255 + 255 + 128 + 64 + + + 255 + 80 + 240 + 120 + + + 255 + 0 + 64 + 128 + + + 255 + 128 + 0 + 64 + + + 255 + 255 + 0 + 128 + + + 255 + 128 + 128 + 64 + + + 255 + 128 + 128 + 128 + + + 255 + 255 + 128 + 255 + + + 255 + 0 + 64 + 0 + + + 255 + 0 + 0 + 0 + + + 255 + 255 + 255 + 255 + + + 255 + 255 + 128 + 0 + + + + true + + + row["count(id)"] + + Text + Sum + + + Series 1 + + + Orthogonal_Value + + , + + Outside + false + + onmouseover + + Show_Tooltip + + + 200 + + + + Rectangle + + + Text + Sum + + + Vertical + + + 1 + + 255 + 0 + 0 + 0 + + true + + + Left + + + + 1 + + 255 + 196 + 196 + 196 + + false + + Across + + + 1 + + 255 + 196 + 196 + 196 + + true + + + + + + 1 + + 255 + 225 + 225 + 225 + + false + + Across + + + 1 + + 255 + 225 + 225 + 225 + + false + + + + 5 + + + Min + + 0.0 + + + true + false + + + + + + + + + 255 + 80 + 166 + 218 + + + 255 + 108 + 222 + 228 + + 90.0 + + + 255 + 242 + 88 + 106 + + + 255 + 232 + 172 + 57 + + + 255 + 128 + 255 + 128 + + + 255 + 64 + 128 + 128 + + + 255 + 128 + 128 + 192 + + + 255 + 170 + 85 + 85 + + + 255 + 128 + 128 + 0 + + + 255 + 192 + 192 + 192 + + + 255 + 255 + 255 + 128 + + + 255 + 128 + 192 + 128 + + + 255 + 7 + 146 + 94 + + + 255 + 0 + 128 + 255 + + + 255 + 255 + 128 + 192 + + + 255 + 0 + 255 + 255 + + + 255 + 255 + 128 + 128 + + + 255 + 0 + 128 + 192 + + + 255 + 128 + 128 + 192 + + + 255 + 255 + 0 + 255 + + + 255 + 128 + 64 + 64 + + + 255 + 255 + 128 + 64 + + + 255 + 80 + 240 + 120 + + + 255 + 0 + 64 + 128 + + + 255 + 128 + 0 + 64 + + + 255 + 255 + 0 + 128 + + + 255 + 128 + 128 + 64 + + + 255 + 128 + 128 + 128 + + + 255 + 255 + 128 + 255 + + + 255 + 0 + 64 + 0 + + + 255 + 0 + 0 + 0 + + + 255 + 255 + 255 + 255 + + + 255 + 255 + 128 + 0 + + + + true + + + row["dt"] + + + + + Orthogonal_Value + + , + + Outside + false + + + true + Text + Sum + + + Horizontal + + + 1 + + 255 + 0 + 0 + 0 + + true + + + Below + + + + 1 + + 255 + 196 + 196 + 196 + + false + + Across + + + 1 + + 255 + 196 + 196 + 196 + + true + + + + + + 1 + + 255 + 225 + 225 + 225 + + false + + Across + + + 1 + + 255 + 225 + 225 + 225 + + false + + + + 5 + + + Min + + 0.0 + + + true + true + false + + Vertical + 50.0 + + + -20.0 + 45.0 + 0.0 + None + + + +]]> + SVG + false + 3.3541666666666665in + 8.21875in + start_download_by_date + + + count(id) + dataSetRow["count(id)"] + decimal + + + dt + dataSetRow["dt"] + string + + + + + + + 0.3229166666666667in + + 3 + 1 + + + + + 3.46875in + + 3 + 1 + + + 2.6.1 + Bar Chart + Side-by-side + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + false + + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true + 5 + 5 + + + + 0 + + 255 + 0 + 0 + 0 + + false + + + 0.0 + 0.0 + 0.0 + 0.0 + + + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true + + + + 0 + + 255 + 0 + 0 + 0 + + false + + + 2.0 + 2.0 + 2.0 + 2.0 + + + + + + + + + Vertical + Top_Bottom + + + 1 + + 255 + 0 + 0 + 0 + + true + + Right + Series + + <Caption> + <Value></Value> + <Font> + <Alignment/> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + <Visible>false</Visible> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>false</Visible> + + Above + + + 0.0 + 0.0 + 212.0 + 130.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true + + Two_Dimensional + Points + 10.0 + + enable.area.alt + false + + + + A, B, C + + + 5,4,12 + 0 + + + + + + This chart contains no data. + + + Center + Center + + + + + 64 + 127 + 127 + 127 + + + + 128 + 127 + 127 + 127 + + true + + + 10.0 + 10.0 + 10.0 + 10.0 + + false + + + Text + + <Caption> + <Value>X-Axis Title</Value> + <Font> + <Size>14.0</Size> + <Bold>true</Bold> + <Alignment> + <horizontalAlignment>Center</horizontalAlignment> + <verticalAlignment>Center</verticalAlignment> + </Alignment> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>false</Visible> + + Below + + Linear + + <Caption> + <Value>Y-Axis Title</Value> + <Font> + <Size>14.0</Size> + <Bold>true</Bold> + <Alignment> + <horizontalAlignment>Center</horizontalAlignment> + <verticalAlignment>Center</verticalAlignment> + </Alignment> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>false</Visible> + + Left + + + row["MagazineName"] + + Text + + + + + + 255 + 80 + 166 + 218 + + + 255 + 108 + 222 + 228 + + 90.0 + + + + 255 + 242 + 88 + 106 + + + 255 + 255 + 149 + 117 + + 90.0 + + + + 255 + 232 + 172 + 57 + + + 255 + 250 + 209 + 63 + + 90.0 + + + + 255 + 98 + 196 + 117 + + + 255 + 128 + 255 + 128 + + 90.0 + + + + 255 + 64 + 128 + 128 + + + 255 + 103 + 205 + 142 + + 90.0 + + + + 255 + 128 + 128 + 192 + + + 255 + 159 + 189 + 203 + + 90.0 + + + 255 + 170 + 85 + 85 + + + 255 + 128 + 128 + 0 + + + 255 + 192 + 192 + 192 + + + 255 + 255 + 255 + 128 + + + 255 + 128 + 192 + 128 + + + 255 + 7 + 146 + 94 + + + 255 + 0 + 128 + 255 + + + 255 + 255 + 128 + 192 + + + 255 + 0 + 255 + 255 + + + 255 + 255 + 128 + 128 + + + 255 + 0 + 128 + 192 + + + 255 + 128 + 128 + 192 + + + 255 + 255 + 0 + 255 + + + 255 + 128 + 64 + 64 + + + 255 + 255 + 128 + 64 + + + 255 + 80 + 240 + 120 + + + 255 + 0 + 64 + 128 + + + 255 + 128 + 0 + 64 + + + 255 + 255 + 0 + 128 + + + 255 + 128 + 128 + 64 + + + 255 + 128 + 128 + 128 + + + 255 + 255 + 128 + 255 + + + 255 + 0 + 64 + 0 + + + 255 + 0 + 0 + 0 + + + 255 + 255 + 255 + 255 + + + 255 + 255 + 128 + 0 + + + + true + + + row["count(magazine.MagazineId)"] + + Text + Sum + + + Series 1 + + + Orthogonal_Value + + , + + Outside + false + + onmouseover + + Show_Tooltip + + + 200 + + + + Rectangle + + + Text + Sum + + + Vertical + + + 1 + + 255 + 0 + 0 + 0 + + true + + + Left + + + + 1 + + 255 + 196 + 196 + 196 + + false + + Across + + + 1 + + 255 + 196 + 196 + 196 + + true + + + + + + 1 + + 255 + 225 + 225 + 225 + + false + + Across + + + 1 + + 255 + 225 + 225 + 225 + + false + + + + 5 + + + Min + + 0.0 + + + true + false + + + + + + + + 255 + 80 + 166 + 218 + + + 255 + 242 + 88 + 106 + + + 255 + 232 + 172 + 57 + + + 255 + 128 + 255 + 128 + + + 255 + 64 + 128 + 128 + + + 255 + 128 + 128 + 192 + + + 255 + 170 + 85 + 85 + + + 255 + 128 + 128 + 0 + + + 255 + 192 + 192 + 192 + + + 255 + 255 + 255 + 128 + + + 255 + 128 + 192 + 128 + + + 255 + 7 + 146 + 94 + + + 255 + 0 + 128 + 255 + + + 255 + 255 + 128 + 192 + + + 255 + 0 + 255 + 255 + + + 255 + 255 + 128 + 128 + + + 255 + 0 + 128 + 192 + + + 255 + 128 + 128 + 192 + + + 255 + 255 + 0 + 255 + + + 255 + 128 + 64 + 64 + + + 255 + 255 + 128 + 64 + + + 255 + 80 + 240 + 120 + + + 255 + 0 + 64 + 128 + + + 255 + 128 + 0 + 64 + + + 255 + 255 + 0 + 128 + + + 255 + 128 + 128 + 64 + + + 255 + 128 + 128 + 128 + + + 255 + 255 + 128 + 255 + + + 255 + 0 + 64 + 0 + + + 255 + 0 + 0 + 0 + + + 255 + 255 + 255 + 255 + + + 255 + 255 + 128 + 0 + + + + true + + + row["dt"] + + + + + Orthogonal_Value + + , + + Outside + false + + + true + Text + Sum + + + Horizontal + + + 1 + + 255 + 0 + 0 + 0 + + true + + + Below + + + + 1 + + 255 + 196 + 196 + 196 + + false + + Across + + + 1 + + 255 + 196 + 196 + 196 + + true + + + + + + 1 + + 255 + 225 + 225 + 225 + + false + + Across + + + 1 + + 255 + 225 + 225 + 225 + + false + + + + 5 + + + Min + + 0.0 + + + true + true + false + + Vertical + 50.0 + + + -20.0 + 45.0 + 0.0 + None + + + +]]> + SVG + false + 3.1979166666666665in + 8.125in + download_spec_magazine_by_date + + + dt + dataSetRow["dt"] + string + + + MagazineName + dataSetRow["MagazineName"] + string + + + count(magazine.MagazineId) + dataSetRow["count(magazine.MagazineId)"] + decimal + + + + + + + 0.3645833333333333in + + 3 + 1 + + + + + + + report + + + diff --git a/crm/src/main/doc/nb-configuration.xml b/crm/src/main/doc/nb-configuration.xml new file mode 100644 index 0000000..d2aae48 --- /dev/null +++ b/crm/src/main/doc/nb-configuration.xml @@ -0,0 +1,19 @@ + + + + + + none + JDK_1.7 + + diff --git a/crm/src/main/doc/nbactions-release-profile.xml b/crm/src/main/doc/nbactions-release-profile.xml new file mode 100644 index 0000000..6b2c7a8 --- /dev/null +++ b/crm/src/main/doc/nbactions-release-profile.xml @@ -0,0 +1,83 @@ + + + + run + + process-classes + org.codehaus.mojo:exec-maven-plugin:1.2.1:exec + + + Xms2048m -classpath %classpath ${packageClassName} account.xml + java + + + + debug + + process-classes + org.codehaus.mojo:exec-maven-plugin:1.2.1:exec + + + -Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} Xms2048m -classpath %classpath ${packageClassName} account.xml + java + true + + + + profile + + process-classes + org.codehaus.mojo:exec-maven-plugin:1.2.1:exec + + + ${profiler.args} Xms2048m -classpath %classpath ${packageClassName} account.xml + ${profiler.java} + + + + build-with-dependencies + also-make + + install + + + /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home + + + + profile.single.main + + process-classes + org.codehaus.mojo:exec-maven-plugin:1.2.1:exec + + + -classpath %classpath ${packageClassName} + java + ${classPathScope} + /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home + + + + run.single.main + + process-classes + org.codehaus.mojo:exec-maven-plugin:1.2.1:exec + + + -classpath %classpath ${packageClassName} + java + ${classPathScope} + /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home + + + + rebuild + + clean + install + + + /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home + + + diff --git a/crm/src/main/doc/nbactions.xml b/crm/src/main/doc/nbactions.xml new file mode 100644 index 0000000..70b02d3 --- /dev/null +++ b/crm/src/main/doc/nbactions.xml @@ -0,0 +1,40 @@ + + + + run + + process-classes + org.codehaus.mojo:exec-maven-plugin:1.2.1:exec + + + -Xms1024m -classpath %classpath com.rexen.crm.integration.DataImport contact_import.xml + java + /Users/Ralf/NetBeansProjects/dataloader + + + + debug + + process-classes + org.codehaus.mojo:exec-maven-plugin:1.2.1:exec + + + -Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -Xms1024m -classpath %classpath com.rexen.crm.integration.DataImport contact_import.xml + java + true + /Users/Ralf/NetBeansProjects/dataloader + + + + profile + + process-classes + org.codehaus.mojo:exec-maven-plugin:1.2.1:exec + + + ${profiler.args} -Xms1024m -classpath %classpath com.rexen.crm.integration.DataImport contact_import.xml + ${profiler.java} + /Users/Ralf/NetBeansProjects/dataloader + + + diff --git a/crm/src/main/doc/newCrmDB.xlsx b/crm/src/main/doc/newCrmDB.xlsx new file mode 100644 index 0000000..e3e2a9c Binary files /dev/null and b/crm/src/main/doc/newCrmDB.xlsx differ diff --git a/crm/src/main/doc/pom.xml b/crm/src/main/doc/pom.xml new file mode 100644 index 0000000..dba4d7b --- /dev/null +++ b/crm/src/main/doc/pom.xml @@ -0,0 +1,87 @@ + + 4.0.0 + + crm + dataloader + 1.0 + jar + + dataloader + http://maven.apache.org + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.3.2 + + 1.7 + 1.7 + true + + + + + maven-assembly-plugin + + + + dataloader.core.DataLoader + + + + jar-with-dependencies + + + + + make-assembly + package + + single + + + + + + + + + UTF-8 + + + + + org.eclipse.persistence + eclipselink + 2.5.1 + + + log4j + log4j + 1.2.17 + + + org.jumpmind.symmetric + symmetric-csv + 3.5.9 + + + mysql + mysql-connector-java + 5.1.26 + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + config/sun_checks.xml + + + + + diff --git a/crm/src/main/doc/premium.rptdesign b/crm/src/main/doc/premium.rptdesign new file mode 100644 index 0000000..48f188d --- /dev/null +++ b/crm/src/main/doc/premium.rptdesign @@ -0,0 +1,5876 @@ + + + Eclipse BIRT Designer Version 4.3.1.v201309091055 Build <4.3.1.v20130918-1142> + + + queryText + 108 + + + queryTimeOut + 108 + + + rowFetchSize + 108 + + + in + /templates/grouped_listing.gif + org.eclipse.birt.report.designer.ui.cheatsheet.groupedlisting + auto layout + ltr + 96 + + + + + metadataBidiFormatStr + ILYNN + + + disabledMetadataBidiFormatStr + + + contentBidiFormatStr + ILYNN + + + disabledContentBidiFormatStr + + + com.mysql.jdbc.Driver + jdbc:mysql://localhost:3306/analyzerdb + analyzer + + + + + + metadataBidiFormatStr + ILYNN + + + disabledMetadataBidiFormatStr + + + contentBidiFormatStr + ILYNN + + + disabledContentBidiFormatStr + + + com.mysql.jdbc.Driver + jdbc:mysql://localhost:3306/analyzerdb + analyzer + + + + + + + deviceName + dimension + deviceName + deviceName + + + appId + measure + appId + appId + + + dldt + dimension + dldt + dldt + + + id + measure + id + id + + + appName + dimension + appName + appName + + + + + + + 1 + deviceName + string + + + 2 + appId + integer + + + 3 + dldt + date-time + + + 4 + id + integer + + + 5 + appName + string + + + + Data Source + + + 1 + deviceName + deviceName + string + + + 2 + appId + appId + integer + + + 3 + dldt + dldt + date-time + + + 4 + id + id + integer + + + 5 + appName + appName + string + + + '2013-10-01' AND `analyzerdb`.`appinfo`.ID > 104 +]]> + + + 2.0 + + + + + + + deviceName + 1 + + 12 + 255 + 0 + Nullable + + deviceName + + + + deviceName + + 255 + + + + + + + appId + 2 + + 4 + 9 + 0 + Nullable + + appId + + + + appId + + 9 + + + + + + + dldt + 3 + + 93 + 19 + 0 + Nullable + + dldt + + + + dldt + + 19 + + + + + + + id + 4 + + 4 + 9 + 0 + NotNullable + + id + + + + id + + 9 + + + + + + + appName + 5 + + 12 + 255 + 0 + Nullable + + appName + + + + appName + + 255 + + + + + + + +]]> + + + + + COUNT_BY_APP + measure + COUNT_BY_APP + COUNT_BY_APP + + + appName + dimension + appName + appName + + + + + + + 1 + COUNT_BY_APP + decimal + + + 2 + appName + string + + + + Data Source + + + 1 + COUNT_BY_APP + COUNT_BY_APP + decimal + + + 2 + appName + appName + string + + + '2013-10-01' AND `analyzerdb`.`appinfo`.ID > 104 + GROUP BY `analyzerdb`.`appinfo`.APPNAME]]> + + + 2.0 + + + + + + + COUNT_BY_APP + 1 + + -5 + 21 + 0 + NotNullable + + COUNT_BY_APP + + + + COUNT_BY_APP + + 21 + + + + + + + appName + 2 + + 12 + 255 + 0 + Nullable + + appName + + + + appName + + 255 + + + + + + + +]]> + + + + + COUNT(ID) + measure + COUNT(ID) + COUNT(ID) + + + DATE_FORMAT(DLDT, '%Y-%m-%d') + dimension + DATE_FORMAT(DLDT, '%Y-%m-%d') + DATE_FORMAT(DLDT, '%Y-%m-%d') + + + + + + + 1 + COUNT(ID) + decimal + + + 2 + DATE_FORMAT(DLDT, '%Y-%m-%d') + string + + + + Data Source + + + 1 + COUNT(ID) + COUNT(ID) + decimal + + + 2 + DATE_FORMAT(DLDT, '%Y-%m-%d') + DATE_FORMAT(DLDT, '%Y-%m-%d') + string + + + '2013-10-01' AND APPID > 104 + GROUP BY DATE_FORMAT(DLDT, '%Y-%m-%d') +]]> + + + 2.0 + + + + + + + COUNT(ID) + 1 + + -5 + 21 + 0 + NotNullable + + COUNT(ID) + + + + COUNT(ID) + + 21 + + + + + + + DATE_FORMAT(DLDT, '%Y-%m-%d') + 2 + + 12 + 10 + 0 + Nullable + + DATE_FORMAT(DLDT, '%Y-%m-%d') + + + + DATE_FORMAT(DLDT, '%Y-%m-%d') + + 10 + + + + + + + +]]> + + + + + COUNT_BY_DN + measure + COUNT_BY_DN + COUNT_BY_DN + + + deviceName + dimension + DEVICENAME + DEVICENAME + + + + + + + 1 + COUNT_BY_DN + decimal + + + 2 + deviceName + string + + + + Data Source + + + 1 + COUNT_BY_DN + COUNT_BY_DN + decimal + + + 2 + deviceName + deviceName + string + + + '2013-10-01' AND APPID > 104 + GROUP BY DEVICENAME +]]> + + + 2.0 + + + + + + + COUNT_BY_DN + 1 + + -5 + 21 + 0 + NotNullable + + COUNT_BY_DN + + + + COUNT_BY_DN + + 21 + + + + + + + deviceName + 2 + + 12 + 255 + 0 + Nullable + + DEVICENAME + + + + DEVICENAME + + 255 + + + + + + + +]]> + + + + + DATE_FORMAT(DLDT, '%Y-%m-%d') + dimension + DATE_FORMAT(DLDT, '%Y-%m-%d') + DATE_FORMAT(DLDT, '%Y-%m-%d') + + + deviceName + dimension + DEVICENAME + DEVICENAME + + + COUNT(ID) + measure + COUNT(ID) + COUNT(ID) + + + + + + + 1 + DATE_FORMAT(DLDT, '%Y-%m-%d') + string + + + 2 + deviceName + string + + + 3 + COUNT(ID) + decimal + + + + Data Source + + + 1 + DATE_FORMAT(DLDT, '%Y-%m-%d') + DATE_FORMAT(DLDT, '%Y-%m-%d') + string + + + 2 + deviceName + deviceName + string + + + 3 + COUNT(ID) + COUNT(ID) + decimal + + + '2013-10-01' AND APPID > 104 + GROUP BY DATE_FORMAT(DLDT, '%Y-%m-%d'),DEVICENAME +]]> + + + 2.0 + + + + + + + DATE_FORMAT(DLDT, '%Y-%m-%d') + 1 + + 12 + 10 + 0 + Nullable + + DATE_FORMAT(DLDT, '%Y-%m-%d') + + + + DATE_FORMAT(DLDT, '%Y-%m-%d') + + 10 + + + + + + + deviceName + 2 + + 12 + 255 + 0 + Nullable + + DEVICENAME + + + + DEVICENAME + + 255 + + + + + + + COUNT(ID) + 3 + + -5 + 21 + 0 + NotNullable + + COUNT(ID) + + + + COUNT(ID) + + 21 + + + + + + + +]]> + + + + + CT + measure + CT + CT + + + dt + dimension + DT + DT + + + + + + 1 + CT + decimal + + + 2 + dt + date + + + + 109_105_47_77_analyzer + + + 1 + CT + CT + decimal + -5 + + + 2 + dt + dt + date + 91 + + + = '2013-11-01' + GROUP BY DT +]]> + + + 2.0 + + + + + + + CT + 1 + + -5 + 21 + 0 + NotNullable + + CT + + + + CT + + 21 + + + + + + + dt + 2 + + 91 + 10 + 0 + Nullable + + DT + + + + DT + + 10 + + + + + + + +]]> + + + + + COUNT(*) + measure + COUNT(*) + COUNT(*) + + + site + dimension + SITE + SITE + + + page + dimension + PAGE + PAGE + + + trackdatetime + dimension + trackdatetime + trackdatetime + + + + + + 1 + COUNT(*) + decimal + + + 2 + site + string + + + 3 + page + string + + + 4 + trackdatetime + date + + + + 109_105_47_77_analyzer + + + 1 + COUNT(*) + COUNT(*) + decimal + -5 + + + 2 + site + site + string + 12 + + + 3 + page + page + string + 12 + + + 4 + trackdatetime + trackdatetime + date + 91 + + + + + + 2.0 + + + + + + + COUNT(*) + 1 + + -5 + 21 + 0 + NotNullable + + COUNT(*) + + + + COUNT(*) + + 21 + + + + + + + site + 2 + + 12 + 255 + 0 + Nullable + + SITE + + + + SITE + + 255 + + + + + + + page + 3 + + 12 + 255 + 0 + Nullable + + PAGE + + + + PAGE + + 255 + + + + + + + trackdatetime + 4 + + 91 + 10 + 0 + Nullable + + trackdatetime + + + + trackdatetime + + 10 + + + + + + + +]]> + + + + + COUNT_OF_ROW + measure + COUNT_OF_ROW + COUNT_OF_ROW + + + + + + + 1 + COUNT_OF_ROW + decimal + + + + 109_105_47_77_analyzer + + + 1 + COUNT_OF_ROW + COUNT_OF_ROW + decimal + -5 + + + '2013-10-01' AND APPID > 104 +]]> + + + 2.0 + + + + + + + COUNT_OF_ROW + 1 + + -5 + 21 + 0 + NotNullable + + COUNT_OF_ROW + + + + COUNT_OF_ROW + + 21 + + + + + + + +]]> + + + nulls lowest + + + adt + dimension + dt + dt + + + ct + measure + ct + ct + + + + + + + 1 + adt + date + + + 2 + ct + decimal + + + + 109_105_47_77_analyzer + + + 1 + adt + adt + date + 91 + + + 2 + ct + ct + decimal + -5 + + + ='2013-11-01' group by adt) as a +left JOIN ( +SELECT COUNT(ID) as bct, DATE_FORMAT(DLDT, '%Y-%m-%d') +as bdt +FROM `analyzerdb`.`dl` + WHERE DLDT >= '2013-11-01' + AND APPID > 104 + GROUP BY DATE_FORMAT(DLDT, '%Y-%m-%d')) as b + on a.adt=b.bdt) as c;]]> + + + 2.0 + + + + + + + id + 1 + + 4 + 9 + 0 + NotNullable + + id + + + + id + + 9 + + + + + + + dt + 2 + + 91 + 10 + 0 + Nullable + + dt + + + + dt + + 10 + + + + + + + +]]> + + + + + + + + + + 0in + + + 100% + + + + + html + new Date()]]> + + + + + + + + + + 18.34375in + 9.59375in + + 9.59375in + + + 0.23958333333333334in + + + + + + 0.2708333333333333in + + + total_downloading + + + COUNT_OF_ROW + COUNT_OF_ROW + dataSetRow["COUNT_OF_ROW"] + decimal + + + "Total number of download: "+row["COUNT_OF_ROW"] + html + + + + + 0.375in + + + + + + 3.9166666666666665in + + + + 2.6.1 + Bar Chart + Side-by-side + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + false + + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true + 5 + 5 + + + + 0 + + 255 + 0 + 0 + 0 + + false + + + 0.0 + 0.0 + 0.0 + 0.0 + + + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + false + + + + 0 + + 255 + 0 + 0 + 0 + + false + + + 2.0 + 2.0 + 2.0 + 2.0 + + + + + + + + + Vertical + Top_Bottom + + + 1 + + 255 + 0 + 0 + 0 + + true + + Right + Series + + <Caption> + <Value></Value> + <Font> + <Alignment/> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + <Visible>false</Visible> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>false</Visible> + + Above + + + 0.0 + 0.0 + 212.0 + 130.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true + + Two_Dimensional + Points + 10.0 + + enable.area.alt + false + + + + 01/05/2000,02/01/2000,04/12/2000,03/12/2000,02/29/2000 + + + 5,4,12 + 0 + + + + + + This chart contains no data. + + + Center + Center + + + + + 64 + 127 + 127 + 127 + + + + 128 + 127 + 127 + 127 + + true + + + 10.0 + 10.0 + 10.0 + 10.0 + + false + + + DateTime + + <Caption> + <Value>X-Axis Title</Value> + <Font> + <Size>14.0</Size> + <Bold>true</Bold> + <Alignment> + <horizontalAlignment>Center</horizontalAlignment> + <verticalAlignment>Center</verticalAlignment> + </Alignment> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>false</Visible> + + Below + + Linear + + <Caption> + <Value>Y-Axis Title</Value> + <Font> + <Size>14.0</Size> + <Bold>true</Bold> + <Alignment> + <horizontalAlignment>Center</horizontalAlignment> + <verticalAlignment>Center</verticalAlignment> + </Alignment> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>false</Visible> + + Left + + + + + + + + 255 + 80 + 166 + 218 + + + 255 + 108 + 222 + 228 + + 90.0 + + + 255 + 242 + 88 + 106 + + + 255 + 232 + 172 + 57 + + + 255 + 128 + 255 + 128 + + + 255 + 64 + 128 + 128 + + + 255 + 128 + 128 + 192 + + + 255 + 170 + 85 + 85 + + + 255 + 128 + 128 + 0 + + + 255 + 192 + 192 + 192 + + + 255 + 255 + 255 + 128 + + + 255 + 128 + 192 + 128 + + + 255 + 7 + 146 + 94 + + + 255 + 0 + 128 + 255 + + + 255 + 255 + 128 + 192 + + + 255 + 0 + 255 + 255 + + + 255 + 255 + 128 + 128 + + + 255 + 0 + 128 + 192 + + + 255 + 128 + 128 + 192 + + + 255 + 255 + 0 + 255 + + + 255 + 128 + 64 + 64 + + + 255 + 255 + 128 + 64 + + + 255 + 80 + 240 + 120 + + + 255 + 0 + 64 + 128 + + + 255 + 128 + 0 + 64 + + + 255 + 255 + 0 + 128 + + + 255 + 128 + 128 + 64 + + + 255 + 128 + 128 + 128 + + + 255 + 255 + 128 + 255 + + + 255 + 0 + 64 + 0 + + + 255 + 0 + 0 + 0 + + + 255 + 255 + 255 + 255 + + + 255 + 255 + 128 + 0 + + + + true + + + row["COUNT(*)"] + + Text + Sum + + + Series 1 + + + Orthogonal_Value + + , + + Outside + false + + onmouseover + + Show_Tooltip + + + 200 + + + + + + + 1 + + 255 + 128 + 128 + 128 + + true + + + North + + Rectangle + + + Text + Sum + + + Vertical + + + 1 + + 255 + 0 + 0 + 0 + + true + + + Left + + + + 1 + + 255 + 196 + 196 + 196 + + false + + Across + + + 1 + + 255 + 196 + 196 + 196 + + true + + + + + + 1 + + 255 + 225 + 225 + 225 + + false + + Across + + + 1 + + 255 + 225 + 225 + 225 + + false + + + + 5 + + + Min + + 0.0 + + + true + false + + + + + + + + + 255 + 80 + 166 + 218 + + + 255 + 108 + 222 + 228 + + 90.0 + + + 255 + 242 + 88 + 106 + + + 255 + 232 + 172 + 57 + + + 255 + 128 + 255 + 128 + + + 255 + 64 + 128 + 128 + + + 255 + 128 + 128 + 192 + + + 255 + 170 + 85 + 85 + + + 255 + 128 + 128 + 0 + + + 255 + 192 + 192 + 192 + + + 255 + 255 + 255 + 128 + + + 255 + 128 + 192 + 128 + + + 255 + 7 + 146 + 94 + + + 255 + 0 + 128 + 255 + + + 255 + 255 + 128 + 192 + + + 255 + 0 + 255 + 255 + + + 255 + 255 + 128 + 128 + + + 255 + 0 + 128 + 192 + + + 255 + 128 + 128 + 192 + + + 255 + 255 + 0 + 255 + + + 255 + 128 + 64 + 64 + + + 255 + 255 + 128 + 64 + + + 255 + 80 + 240 + 120 + + + 255 + 0 + 64 + 128 + + + 255 + 128 + 0 + 64 + + + 255 + 255 + 0 + 128 + + + 255 + 128 + 128 + 64 + + + 255 + 128 + 128 + 128 + + + 255 + 255 + 128 + 255 + + + 255 + 0 + 64 + 0 + + + 255 + 0 + 0 + 0 + + + 255 + 255 + 255 + 255 + + + 255 + 255 + 128 + 0 + + + + true + + + row["trackdatetime"] + + + + + Orthogonal_Value + + , + + Outside + false + + + true + Days + DateTime + Sum + + + en_US + + Horizontal + + + 1 + + 255 + 0 + 0 + 0 + + true + + + + yyyy-MM-dd + + Below + + + + 1 + + 255 + 196 + 196 + 196 + + false + + Across + + + 1 + + 255 + 196 + 196 + 196 + + true + + + + + + 1 + + 255 + 225 + 225 + 225 + + false + + Across + + + 1 + + 255 + 225 + 225 + 225 + + false + + + + 5 + false + + + Min + + 0.0 + + + true + true + false + + Vertical + 50.0 + + + -20.0 + 45.0 + 0.0 + None + + + false + +]]> + SVG + false + 3.6041666666666665in + 8.135416666666666in + pageview + + + COUNT(*) + dataSetRow["COUNT(*)"] + decimal + + + site + dataSetRow["site"] + string + + + page + dataSetRow["page"] + string + + + trackdatetime + dataSetRow["trackdatetime"] + date + + + + + + + 0.3541666666666667in + + + + + + 4.40625in + + + + 2.6.1 + Pie Chart + Standard + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + false + + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true + 5 + 5 + + + + 0 + + 255 + 0 + 0 + 0 + + false + + + 0.0 + 0.0 + 0.0 + 0.0 + + + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true + + + + 0 + + 255 + 0 + 0 + 0 + + false + + + 2.0 + 2.0 + 2.0 + 2.0 + + + + + + + + + Vertical + Top_Bottom + + + 1 + + 255 + 0 + 0 + 0 + + true + + Right + Categories + + <Caption> + <Value></Value> + <Font> + <Alignment/> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + <Visible>false</Visible> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>false</Visible> + + Above + + + 0.0 + 0.0 + 212.0 + 130.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true + + Two_Dimensional_With_Depth + Points + 10.0 + 0 + + enable.area.alt + false + + + + 'A','B','C','D','E' + + + 6,4,12,8,10 + 0 + + + + + + This chart contains no data. + + + Center + Center + + + + + 64 + 127 + 127 + 127 + + + + 128 + 127 + 127 + 127 + + true + + + 10.0 + 10.0 + 10.0 + 10.0 + + false + + + + + + + + 255 + 80 + 166 + 218 + + + 255 + 242 + 88 + 106 + + + 255 + 232 + 172 + 57 + + + 255 + 128 + 255 + 128 + + + 255 + 64 + 128 + 128 + + + 255 + 128 + 128 + 192 + + + 255 + 170 + 85 + 85 + + + 255 + 128 + 128 + 0 + + + 255 + 192 + 192 + 192 + + + 255 + 255 + 255 + 128 + + + 255 + 128 + 192 + 128 + + + 255 + 7 + 146 + 94 + + + 255 + 0 + 128 + 255 + + + 255 + 255 + 128 + 192 + + + 255 + 0 + 255 + 255 + + + 255 + 255 + 128 + 128 + + + 255 + 0 + 128 + 192 + + + 255 + 128 + 128 + 192 + + + 255 + 255 + 0 + 255 + + + 255 + 128 + 64 + 64 + + + 255 + 255 + 128 + 64 + + + 255 + 80 + 240 + 120 + + + 255 + 0 + 64 + 128 + + + 255 + 128 + 0 + 64 + + + 255 + 255 + 0 + 128 + + + 255 + 128 + 128 + 64 + + + 255 + 128 + 128 + 128 + + + 255 + 255 + 128 + 255 + + + 255 + 0 + 64 + 0 + + + 255 + 0 + 0 + 0 + + + 255 + 255 + 255 + 255 + + + 255 + 255 + 128 + 0 + + + + + + + + + 255 + 80 + 166 + 218 + + + 255 + 242 + 88 + 106 + + + 255 + 232 + 172 + 57 + + + 255 + 128 + 255 + 128 + + + 255 + 64 + 128 + 128 + + + 255 + 128 + 128 + 192 + + + 255 + 170 + 85 + 85 + + + 255 + 128 + 128 + 0 + + + 255 + 192 + 192 + 192 + + + 255 + 255 + 255 + 128 + + + 255 + 128 + 192 + 128 + + + 255 + 7 + 146 + 94 + + + 255 + 0 + 128 + 255 + + + 255 + 255 + 128 + 192 + + + 255 + 0 + 255 + 255 + + + 255 + 255 + 128 + 128 + + + 255 + 0 + 128 + 192 + + + 255 + 128 + 128 + 192 + + + 255 + 255 + 0 + 255 + + + 255 + 128 + 64 + 64 + + + 255 + 255 + 128 + 64 + + + 255 + 80 + 240 + 120 + + + 255 + 0 + 64 + 128 + + + 255 + 128 + 0 + 64 + + + 255 + 255 + 0 + 128 + + + 255 + 128 + 128 + 64 + + + 255 + 128 + 128 + 128 + + + 255 + 255 + 128 + 255 + + + 255 + 0 + 64 + 0 + + + 255 + 0 + 0 + 0 + + + 255 + 255 + 255 + 255 + + + 255 + 255 + 128 + 0 + + + + true + + + row["COUNT_BY_APP"] + + Text + Sum + + + + + Orthogonal_Value + + + Percentile_Orthogonal_Value + + ( + %) + 100.0 + 2 + + + + Base_Value + + + + Outside + false + + onmouseover + + Show_Tooltip + + + 200 + + + + 0 + + <Caption> + <Value></Value> + <Font> + <Size>16.0</Size> + <Bold>true</Bold> + <Alignment/> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>true</Visible> + + Below + + + 1 + true + + 10.0 + + + Text + Sum + + + + true + + + row["appName"] + + + + + Orthogonal_Value + + , + + Outside + false + + + true + Text + Sum + + + +]]> + SVG + false + 4.125in + 8.0625in + dl_by_app + + + COUNT_BY_APP + dataSetRow["COUNT_BY_APP"] + decimal + + + appName + dataSetRow["appName"] + string + + + + + + + + + #808080 + bold + #FFFFFF + 4pt + 2pt + 2pt + auto + + + + + + 3.2083333333333335in + + + + 2.6.1 + Bar Chart + Side-by-side + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + false + + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true + 5 + 5 + + + + 0 + + 255 + 0 + 0 + 0 + + false + + + 0.0 + 0.0 + 0.0 + 0.0 + + + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + false + + + + 0 + + 255 + 0 + 0 + 0 + + false + + + 2.0 + 2.0 + 2.0 + 2.0 + + + + + + + + + Vertical + Top_Bottom + + + 1 + + 255 + 0 + 0 + 0 + + true + + Right + Series + + <Caption> + <Value></Value> + <Font> + <Alignment/> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + <Visible>false</Visible> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>false</Visible> + + Above + + + 0.0 + 0.0 + 212.0 + 130.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true + + Two_Dimensional + Points + 10.0 + + enable.area.alt + false + + + + 01/05/2000,02/01/2000,04/12/2000,03/12/2000,02/29/2000 + + + 5,4,12 + 0 + + + + + + This chart contains no data. + + + Center + Center + + + + + 64 + 127 + 127 + 127 + + + + 128 + 127 + 127 + 127 + + true + + + 10.0 + 10.0 + 10.0 + 10.0 + + false + + + DateTime + + <Caption> + <Value>X-Axis Title</Value> + <Font> + <Size>14.0</Size> + <Bold>true</Bold> + <Alignment> + <horizontalAlignment>Center</horizontalAlignment> + <verticalAlignment>Center</verticalAlignment> + </Alignment> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>false</Visible> + + Below + + Linear + + <Caption> + <Value>Y-Axis Title</Value> + <Font> + <Size>14.0</Size> + <Bold>true</Bold> + <Alignment> + <horizontalAlignment>Center</horizontalAlignment> + <verticalAlignment>Center</verticalAlignment> + </Alignment> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>false</Visible> + + Left + + + + + + + + 255 + 80 + 166 + 218 + + + 255 + 108 + 222 + 228 + + 90.0 + + + 255 + 242 + 88 + 106 + + + 255 + 232 + 172 + 57 + + + 255 + 128 + 255 + 128 + + + 255 + 64 + 128 + 128 + + + 255 + 128 + 128 + 192 + + + 255 + 170 + 85 + 85 + + + 255 + 128 + 128 + 0 + + + 255 + 192 + 192 + 192 + + + 255 + 255 + 255 + 128 + + + 255 + 128 + 192 + 128 + + + 255 + 7 + 146 + 94 + + + 255 + 0 + 128 + 255 + + + 255 + 255 + 128 + 192 + + + 255 + 0 + 255 + 255 + + + 255 + 255 + 128 + 128 + + + 255 + 0 + 128 + 192 + + + 255 + 128 + 128 + 192 + + + 255 + 255 + 0 + 255 + + + 255 + 128 + 64 + 64 + + + 255 + 255 + 128 + 64 + + + 255 + 80 + 240 + 120 + + + 255 + 0 + 64 + 128 + + + 255 + 128 + 0 + 64 + + + 255 + 255 + 0 + 128 + + + 255 + 128 + 128 + 64 + + + 255 + 128 + 128 + 128 + + + 255 + 255 + 128 + 255 + + + 255 + 0 + 64 + 0 + + + 255 + 0 + 0 + 0 + + + 255 + 255 + 255 + 255 + + + 255 + 255 + 128 + 0 + + + + true + + + row["COUNT(ID)"] + + Text + Sum + + + Series 1 + + + Orthogonal_Value + + , + + Outside + false + + onmouseover + + Show_Tooltip + + + 200 + + + + + + + 1 + + 255 + 128 + 128 + 128 + + true + + + North + + Rectangle + + + Text + Sum + + + Vertical + + + 1 + + 255 + 0 + 0 + 0 + + true + + + Left + + + + 1 + + 255 + 196 + 196 + 196 + + false + + Across + + + 1 + + 255 + 196 + 196 + 196 + + true + + + + + + 1 + + 255 + 225 + 225 + 225 + + false + + Across + + + 1 + + 255 + 225 + 225 + 225 + + false + + + + 5 + + + Min + + 0.0 + + + true + false + + + + + + + + + 255 + 80 + 166 + 218 + + + 255 + 108 + 222 + 228 + + 90.0 + + + 255 + 242 + 88 + 106 + + + 255 + 232 + 172 + 57 + + + 255 + 128 + 255 + 128 + + + 255 + 64 + 128 + 128 + + + 255 + 128 + 128 + 192 + + + 255 + 170 + 85 + 85 + + + 255 + 128 + 128 + 0 + + + 255 + 192 + 192 + 192 + + + 255 + 255 + 255 + 128 + + + 255 + 128 + 192 + 128 + + + 255 + 7 + 146 + 94 + + + 255 + 0 + 128 + 255 + + + 255 + 255 + 128 + 192 + + + 255 + 0 + 255 + 255 + + + 255 + 255 + 128 + 128 + + + 255 + 0 + 128 + 192 + + + 255 + 128 + 128 + 192 + + + 255 + 255 + 0 + 255 + + + 255 + 128 + 64 + 64 + + + 255 + 255 + 128 + 64 + + + 255 + 80 + 240 + 120 + + + 255 + 0 + 64 + 128 + + + 255 + 128 + 0 + 64 + + + 255 + 255 + 0 + 128 + + + 255 + 128 + 128 + 64 + + + 255 + 128 + 128 + 128 + + + 255 + 255 + 128 + 255 + + + 255 + 0 + 64 + 0 + + + 255 + 0 + 0 + 0 + + + 255 + 255 + 255 + 255 + + + 255 + 255 + 128 + 0 + + + + true + + + row["DATE_FORMAT(DLDT, '%Y-%m-%d')"] + + + + + Orthogonal_Value + + , + + Outside + false + + + true + Days + DateTime + Sum + + + + Horizontal + + + 1 + + 255 + 0 + 0 + 0 + + true + + + + Y-M-d + + Below + + + + 1 + + 255 + 196 + 196 + 196 + + false + + Across + + + 1 + + 255 + 196 + 196 + 196 + + true + + + + + + 1 + + 255 + 225 + 225 + 225 + + false + + Across + + + 1 + + 255 + 225 + 225 + 225 + + false + + + + 5 + + + Min + + 0.0 + + + true + true + false + + Vertical + 50.0 + + + -20.0 + 45.0 + 0.0 + None + + + +]]> + SVG + false + 3.6in + 8.135416666666666in + dl_by_date + + + COUNT(ID) + dataSetRow["COUNT(ID)"] + decimal + + + DATE_FORMAT(DLDT, '%Y-%m-%d') + dataSetRow["DATE_FORMAT(DLDT, '%Y-%m-%d')"] + date + + + + + + + 0.23958333333333334in + + + + + + 2.4270833333333335in + + + + 2.6.1 + Bar Chart + Side-by-side + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + false + + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true + 5 + 5 + + + + 0 + + 255 + 0 + 0 + 0 + + false + + + 0.0 + 0.0 + 0.0 + 0.0 + + + + + + 0.0 + 0.0 + 0.0 + 0.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true + + + + 0 + + 255 + 0 + 0 + 0 + + false + + + 2.0 + 2.0 + 2.0 + 2.0 + + + + + + + + + Vertical + Top_Bottom + + + 1 + + 255 + 0 + 0 + 0 + + true + + Right + Series + + <Caption> + <Value></Value> + <Font> + <Alignment/> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + <Visible>false</Visible> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>false</Visible> + + Above + + + 0.0 + 0.0 + 212.0 + 130.0 + + + 3.0 + 3.0 + 3.0 + 3.0 + + -1 + -1 + -1 + -1 + + + 1 + + 255 + 0 + 0 + 0 + + false + + true + + Two_Dimensional + Points + 10.0 + + enable.area.alt + false + + + + 01/05/2000,02/01/2000,04/12/2000,03/12/2000,02/29/2000 + + + 5,4,12 + 0 + + + + + + This chart contains no data. + + + Center + Center + + + + + 64 + 127 + 127 + 127 + + + + 128 + 127 + 127 + 127 + + true + + + 10.0 + 10.0 + 10.0 + 10.0 + + false + + + DateTime + + <Caption> + <Value>X-Axis Title</Value> + <Font> + <Size>14.0</Size> + <Bold>true</Bold> + <Alignment> + <horizontalAlignment>Center</horizontalAlignment> + <verticalAlignment>Center</verticalAlignment> + </Alignment> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>false</Visible> + + Below + + Linear + + <Caption> + <Value>Y-Axis Title</Value> + <Font> + <Size>14.0</Size> + <Bold>true</Bold> + <Alignment> + <horizontalAlignment>Center</horizontalAlignment> + <verticalAlignment>Center</verticalAlignment> + </Alignment> + </Font> + </Caption> + <Background xsi:type="attribute:ColorDefinition"> + <Transparency>0</Transparency> + <Red>255</Red> + <Green>255</Green> + <Blue>255</Blue> + </Background> + <Outline> + <Style>Solid</Style> + <Thickness>1</Thickness> + <Color> + <Transparency>255</Transparency> + <Red>0</Red> + <Green>0</Green> + <Blue>0</Blue> + </Color> + </Outline> + <Insets> + <Top>0.0</Top> + <Left>2.0</Left> + <Bottom>0.0</Bottom> + <Right>3.0</Right> + </Insets> + <Visible>false</Visible> + + Left + + + row["deviceName"] + + Text + + + + + + 255 + 80 + 166 + 218 + + + 255 + 108 + 222 + 228 + + 90.0 + + + 255 + 242 + 88 + 106 + + + 255 + 232 + 172 + 57 + + + 255 + 128 + 255 + 128 + + + 255 + 64 + 128 + 128 + + + 255 + 128 + 128 + 192 + + + 255 + 170 + 85 + 85 + + + 255 + 128 + 128 + 0 + + + 255 + 192 + 192 + 192 + + + 255 + 255 + 255 + 128 + + + 255 + 128 + 192 + 128 + + + 255 + 7 + 146 + 94 + + + 255 + 0 + 128 + 255 + + + 255 + 255 + 128 + 192 + + + 255 + 0 + 255 + 255 + + + 255 + 255 + 128 + 128 + + + 255 + 0 + 128 + 192 + + + 255 + 128 + 128 + 192 + + + 255 + 255 + 0 + 255 + + + 255 + 128 + 64 + 64 + + + 255 + 255 + 128 + 64 + + + 255 + 80 + 240 + 120 + + + 255 + 0 + 64 + 128 + + + 255 + 128 + 0 + 64 + + + 255 + 255 + 0 + 128 + + + 255 + 128 + 128 + 64 + + + 255 + 128 + 128 + 128 + + + 255 + 255 + 128 + 255 + + + 255 + 0 + 64 + 0 + + + 255 + 0 + 0 + 0 + + + 255 + 255 + 255 + 255 + + + 255 + 255 + 128 + 0 + + + + true + + + row["COUNT(ID)"] + + Text + Sum + + + Series 1 + + + Orthogonal_Value + + , + + Outside + false + + onmouseover + + Show_Tooltip + + + 200 + + + + Rectangle + + + Text + Sum + + + Vertical + + + 1 + + 255 + 0 + 0 + 0 + + true + + + Left + + + + 1 + + 255 + 196 + 196 + 196 + + false + + Across + + + 1 + + 255 + 196 + 196 + 196 + + true + + + + + + 1 + + 255 + 225 + 225 + 225 + + false + + Across + + + 1 + + 255 + 225 + 225 + 225 + + false + + + + 5 + + + Min + + 0.0 + + + true + false + + + + + + + + 255 + 80 + 166 + 218 + + + 255 + 242 + 88 + 106 + + + 255 + 232 + 172 + 57 + + + 255 + 128 + 255 + 128 + + + 255 + 64 + 128 + 128 + + + 255 + 128 + 128 + 192 + + + 255 + 170 + 85 + 85 + + + 255 + 128 + 128 + 0 + + + 255 + 192 + 192 + 192 + + + 255 + 255 + 255 + 128 + + + 255 + 128 + 192 + 128 + + + 255 + 7 + 146 + 94 + + + 255 + 0 + 128 + 255 + + + 255 + 255 + 128 + 192 + + + 255 + 0 + 255 + 255 + + + 255 + 255 + 128 + 128 + + + 255 + 0 + 128 + 192 + + + 255 + 128 + 128 + 192 + + + 255 + 255 + 0 + 255 + + + 255 + 128 + 64 + 64 + + + 255 + 255 + 128 + 64 + + + 255 + 80 + 240 + 120 + + + 255 + 0 + 64 + 128 + + + 255 + 128 + 0 + 64 + + + 255 + 255 + 0 + 128 + + + 255 + 128 + 128 + 64 + + + 255 + 128 + 128 + 128 + + + 255 + 255 + 128 + 255 + + + 255 + 0 + 64 + 0 + + + 255 + 0 + 0 + 0 + + + 255 + 255 + 255 + 255 + + + 255 + 255 + 128 + 0 + + + + true + + + row["DATE_FORMAT(DLDT, '%Y-%m-%d')"] + + + + + Orthogonal_Value + + , + + Outside + false + + + true + Days + DateTime + Sum + + Ascending + + row["DATE_FORMAT(DLDT, '%Y-%m-%d')"] + + + Horizontal + + + 1 + + 255 + 0 + 0 + 0 + + true + + + + Y-M-dd + + Below + + + + 1 + + 255 + 196 + 196 + 196 + + false + + Across + + + 1 + + 255 + 196 + 196 + 196 + + true + + + + + + 1 + + 255 + 225 + 225 + 225 + + false + + Across + + + 1 + + 255 + 225 + 225 + 225 + + false + + + + 5 + + + Min + + 0.0 + + + true + true + false + + Vertical + 50.0 + + + -20.0 + 45.0 + 0.0 + None + + + +]]> + SVG + false + 3.6in + 8.114583333333334in + dl_by_dn_date + + + DATE_FORMAT(DLDT, '%Y-%m-%d') + dataSetRow["DATE_FORMAT(DLDT, '%Y-%m-%d')"] + date + + + deviceName + dataSetRow["deviceName"] + string + + + COUNT(ID) + dataSetRow["COUNT(ID)"] + decimal + + + + + + + + diff --git a/crm/src/main/doc/user_position_import.csv b/crm/src/main/doc/user_position_import.csv new file mode 100644 index 0000000..99a8756 --- /dev/null +++ b/crm/src/main/doc/user_position_import.csv @@ -0,0 +1 @@ +PositionExternalId,EmployeeNumber,ExternalId,Ƿ E1131031001,101SH218,E1131031001101SH218, NT131031001,101BJ144,NT131031001101BJ144, NE131031001,101LN098,NE131031001101LN098, \ No newline at end of file diff --git a/crm/src/main/doc/userinfo_import.csv b/crm/src/main/doc/userinfo_import.csv new file mode 100644 index 0000000..edb49d8 --- /dev/null +++ b/crm/src/main/doc/userinfo_import.csv @@ -0,0 +1 @@ +,email,employeeNumber,¼,Password,û״̬,Ƿ񼤻 ʢ,sample@mail.com,101SH218,101SH218,12345,Ч,Ѽ ,sample@mail.com,101BJ144,101BJ144,12345,Ч,Ѽ ,sample@qq.com,101LN098,101LN098,12345,Ч,Ѽ \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/AccountPage.html b/crm/src/main/java/com/rex/crm/AccountPage.html new file mode 100755 index 0000000..1ae9b30 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/AccountPage.html @@ -0,0 +1,51 @@ + + + + + +

+
+
+
+
+
+
+
+ +
+ +
+
+
+ data table +
+
+
+
+
+ + + + diff --git a/crm/src/main/java/com/rex/crm/AccountPage.java b/crm/src/main/java/com/rex/crm/AccountPage.java new file mode 100644 index 0000000..51e7e31 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/AccountPage.java @@ -0,0 +1,202 @@ +package com.rex.crm; + +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.model.PropertyModel; +import org.apache.wicket.request.IRequestParameters; +import org.apache.wicket.util.string.StringValue; + +import com.google.common.collect.Lists; +import com.rex.crm.beans.AdvancedSearchFilter; +import com.rex.crm.beans.Choice; +import com.rex.crm.common.Entity; +import com.rex.crm.common.Field; +import com.rex.crm.common.FilterPanel; +import com.rex.crm.common.PageableTablePanel; +import com.rex.crm.common.advancedSearch.AdvancedSearchPage; +import com.rex.crm.common.advancedSearch.AdvancedSearchPanel; +import com.rex.crm.db.DAOImpl; +import com.rexen.crm.beans.UserRole; +import com.rex.crm.util.Configuration; + +/** + * @author Feiyun Zhou + */ +public class AccountPage extends TemplatePage +{ + private static final Logger logger = Logger.getLogger(AccountPage.class); + private String search_target = ""; + + /** + * Constructor + */ + public AccountPage() + { + //PageParameters pp = new PageParameters(); + //IRequestParameters params = this.getRequestCycle().getRequest().getRequestParameters(); + initPage(null, null); + } + + public AccountPage(Map map, List tdata) + { + initPage(map, tdata); + } + + public AccountPage( List tdata) + { + initPage(null, tdata); + } + + private void initPage(final Map filter, List tdata) + { + Map entities = Configuration.getEntityTable(); + final Entity entity = entities.get("account"); + setPageTitle(entity.getDisplay()); + // List mapList = DAOImpl.queryEntityList(entity.getSql(), 0, 1000); + // TODO get userId from request's session + final String positionId = ((SignIn2Session) getSession()).getPositionId(); + final int roleId = ((SignIn2Session) getSession()).getRoleId(); + + Form form = new Form("form") + { + + @Override + protected void onSubmit() + { + String sql = entity.getSql(); + switch (roleId) + { + case 1: + sql = entity.getSqlAdmin(); + break; + case 2: + sql = entity.getSqlManager(); + break; + case 3: + sql = entity.getSql(); + break; + } + + search_target = (search_target == null || search_target.equalsIgnoreCase("*")) ? "" : search_target; + + List searchableFields = entity.getSearchableFields(); + String joint = " like '%" + search_target + "%'"; + String likequery = ""; + for (Field sf : searchableFields) + { + likequery = likequery + " OR " + sf.getName() + joint; + } + sql = sql + " where name like '%" + search_target + "%' " + likequery; + System.out.println(sql); + List datalist = null; + + switch (roleId) + { + case UserRole.USER_ROLE_MANAGER: + datalist = DAOImpl.queryEntityRelationList(sql, positionId, positionId, positionId); + break; + case UserRole.USER_ROLE_SALES: + datalist = DAOImpl.queryEntityRelationList(sql, positionId, positionId); + break; + case UserRole.USER_ROLE_ADMINISTRATOR: + datalist = DAOImpl.queryEntityRelationList(sql); + } + + setResponsePage(new AccountPage(filter, datalist)); + + } + + }; + add(form); + + TextField search_input = new TextField("search_input", new PropertyModel(this, "search_target")); + form.add(search_input); + form.add(new Link("ad_search_link"){ + @Override + public void onClick() { + setResponsePage(new AdvancedSearchPage(entity.getName(),null)); + + } + + } ); +// add(new AdvancedPanel("advancedSearch",entity)); + String sql = entity.getSql(); + switch (roleId) + { + case 1: + sql = entity.getSqlAdmin(); + break; + case 2: + sql = entity.getSqlManager(); + break; + case 3: + sql = entity.getSql(); + break; + } + if (tdata == null || tdata.size() == 0) + { + + if (filter == null) + { +// if(params != null){ +// StringValue ad_search_sql_value = params.getParameterValue("ad_search_sql"); +// if( !ad_search_sql_value.isNull() && !ad_search_sql_value.isEmpty()){ +// sql = sql + " where " + ad_search_sql_value.toString(); +// logger.debug("sql is: " + sql); +// } +// } + switch (roleId) + { + case UserRole.USER_ROLE_ADMINISTRATOR: + tdata = DAOImpl.queryEntityRelationList(sql); + break; + case UserRole.USER_ROLE_MANAGER: + tdata = DAOImpl.queryEntityRelationList(sql, positionId, positionId, positionId); + break; + case UserRole.USER_ROLE_SALES: + tdata = DAOImpl.queryEntityRelationList(sql, positionId, positionId); + } + + } + else + { + List ft = Lists.newArrayList(); + for (String k : filter.keySet()) + { + if (filter.get(k)) + ft.add(k); + } + + switch (roleId) + { + case UserRole.USER_ROLE_ADMINISTRATOR: + tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft); + break; + case UserRole.USER_ROLE_MANAGER: + tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft, positionId, positionId, positionId); + break; + case UserRole.USER_ROLE_SALES: + tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft, positionId,positionId); + } + + } + } + // add(new AdvancedSearchPanel("advancedSearch","account")); + + add(new PageableTablePanel("datalist", entity, tdata, null)); + + List choices = DAOImpl.queryPickList(entity.getFieldByName(entity.getFilterField()).getPicklist()); + + add(new FilterPanel("filterPanel", choices, filter, AccountPage.class,entity)); + + + + + } + +} \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/ActivitedUser.html b/crm/src/main/java/com/rex/crm/ActivitedUser.html new file mode 100644 index 0000000..c77886b --- /dev/null +++ b/crm/src/main/java/com/rex/crm/ActivitedUser.html @@ -0,0 +1,72 @@ + + + + + + + + + + + + +
+
+ +
+
+
+ +
+ 您好 +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+ +
+
+
+
+ + \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/ActivitedUser.java b/crm/src/main/java/com/rex/crm/ActivitedUser.java new file mode 100644 index 0000000..f5e6c1f --- /dev/null +++ b/crm/src/main/java/com/rex/crm/ActivitedUser.java @@ -0,0 +1,90 @@ +package com.rex.crm; + +import java.util.Map; + +import org.apache.log4j.Logger; +import org.apache.wicket.behavior.AttributeAppender; +import org.apache.wicket.markup.html.WebPage; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.PasswordTextField; +import org.apache.wicket.markup.html.list.AbstractItem; +import org.apache.wicket.markup.repeater.RepeatingView; +import org.apache.wicket.model.IModel; +import org.apache.wicket.model.Model; +import org.apache.wicket.util.string.StringValue; + +import com.google.common.collect.Maps; +import com.rex.crm.beans.CRMUser; +import com.rex.crm.beans.UserInfo; +import com.rex.crm.common.ErrorPromptPage; +import com.rex.crm.db.DAOImpl; + +public class ActivitedUser extends WebPage{ + + private static final long serialVersionUID = 7417410502168544421L; + private static final Logger logger = Logger.getLogger(UpdateSignPassword.class); + final Map models = Maps.newHashMap(); + public ActivitedUser(){ + logger.debug("activitedUser"); + String activitedCode = this.getRequest().getRequestParameters().getParameterValue("activitedCode").toString(); + logger.debug("loginName:"+activitedCode); + String [] strs=activitedCode.split("_"); + logger.debug("str:"+strs[0]); + long createTime = Long.parseLong(strs[0]); + int userID =Integer.parseInt(strs[1]); + UserInfo userInfo = DAOImpl.getUserByActivation(userID,createTime); + /*if(userInfo.IsActivited()==0){ + initPage(userID,createTime); + }else{ + setResponsePage(new ErrorPromptPage()); + }*/ + } + public void initPage(final int userID,final long createTime){ + logger.debug("init"); + UserInfo userInfo = DAOImpl.getUserByActivation(userID,createTime);; + final int userId = userInfo.getId(); + final String userLoginName = userInfo.getLoginName(); + //此时获取到对象,接收客户端的数据 + final Label promptLabel = new Label("prompt","操作失败重新输入!"); + Form form = new Form("form"){ + @Override + protected void onSubmit() { + System.out.println("submit"); + String password = models.get("password").getObject() == null? null:String.valueOf(models.get("password").getObject()); + logger.debug("pwd:"+password); + if(DAOImpl.updateCrmUserPassword(userId, password)){ + //修改crmuser的激活状态为已激活 + DAOImpl.updateUserActivited(userId); + //用此用户登录 + SignIn2Session session = getMysession(); + session.setUser(null); + if (session.signIn(userLoginName, password)) + { + setResponsePage(getApplication().getHomePage()); + }else{ + promptLabel.add(new AttributeAppender("style",new Model("display:block;"),";")); + } + }else{ + promptLabel.add(new AttributeAppender("style",new Model("display:block;"),";")); + } + } + }; + add(form); + add(promptLabel); + form.add(new Label("userName",userInfo.getName())); + IModel textModel = new Model(""); + form.add(new Label("loginName",userInfo.getLoginName())); + PasswordTextField password = new PasswordTextField("password",textModel); + models.put("password",textModel); + form.add(password); + IModel textModelPassword = new Model(""); + PasswordTextField newPassword = new PasswordTextField("newPassword",textModel); + models.put("newPassword",textModelPassword); + form.add(newPassword); + } + private SignIn2Session getMysession() + { + return (SignIn2Session)getSession(); + } +} diff --git a/crm/src/main/java/com/rex/crm/ActivityPage.html b/crm/src/main/java/com/rex/crm/ActivityPage.html new file mode 100755 index 0000000..0703701 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/ActivityPage.html @@ -0,0 +1,43 @@ + + + + + + +
+
+
+
+
+
+
+
+
+ +
+
+
+
+ data table +
+
+
+
+ +
+ + diff --git a/crm/src/main/java/com/rex/crm/ActivityPage.java b/crm/src/main/java/com/rex/crm/ActivityPage.java new file mode 100644 index 0000000..f6aed34 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/ActivityPage.java @@ -0,0 +1,164 @@ +package com.rex.crm; + +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang3.tuple.Pair; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.model.PropertyModel; + +import com.google.common.collect.Lists; +import com.rex.crm.beans.Choice; +import com.rex.crm.common.Entity; +import com.rex.crm.common.Field; +import com.rex.crm.common.FilterPanel; +import com.rex.crm.common.PageableTablePanel; +import com.rex.crm.common.advancedSearch.AdvancedSearchPage; +import com.rex.crm.db.DAOImpl; +import com.rexen.crm.beans.UserRole; +import com.rex.crm.util.Configuration; + + +/** + * @author Feiyun Zhou + */ +public class ActivityPage extends TemplatePage +{ + private String search_target = ""; + public ActivityPage(){ + init(null,null); + } + public ActivityPage(final Map filter,List tdata){ + init(filter,tdata); + } + + public ActivityPage(List tdata){ + init(null,tdata); + } + + public void init(final Map filter,List tdata) + { + Map entities = Configuration.getEntityTable(); + final Entity entity = entities.get("activity"); + setPageTitle(entity.getDisplay()); + //List mapList = DAOImpl.queryEntityList(entity.getSql(), 0, 1000); + //TODO get userId from request's session + final String posId = ((SignIn2Session)getSession()).getPositionId(); + final int roleId = ((SignIn2Session)getSession()).getRoleId(); + + + Form form = new Form("form"){ + + @Override + protected void onSubmit() { + + String sql = entity.getSql(); + switch(roleId){ + case UserRole.USER_ROLE_ADMINISTRATOR: + sql = entity.getSqlAdmin(); + break; + case UserRole.USER_ROLE_MANAGER: + sql = entity.getSqlManager(); + break; + case UserRole.USER_ROLE_SALES: + sql = entity.getSql(); + break; + } + + search_target = (search_target==null || search_target.equalsIgnoreCase("*"))? "":search_target; + + //sql = sql + " where title like '%"+search_target+"%'"; + List searchableFields = entity.getSearchableFields(); + String joint = " like '%"+search_target+"%'"; + String likequery = ""; + for(Field sf:searchableFields){ + likequery = likequery + " OR "+ sf.getName() + joint; + } + sql = sql + " where title like '%"+search_target+"%' " + likequery; + List datalist = null; + switch(roleId){ + case UserRole.USER_ROLE_ADMINISTRATOR: + datalist = DAOImpl.queryEntityRelationList(sql); + break; + case UserRole.USER_ROLE_MANAGER: + datalist = DAOImpl.queryEntityRelationList(sql,posId,posId); + break; + case UserRole.USER_ROLE_SALES: + datalist = DAOImpl.queryEntityRelationList(sql,posId); + } + setResponsePage(new ActivityPage(filter,datalist)); + + } + + }; + add(form); + form.add(new Link("ad_search_link"){ + @Override + public void onClick() { + setResponsePage(new AdvancedSearchPage(entity.getName(),null)); + + } + }); + TextField search_input = new TextField("search_input", new PropertyModel(this,"search_target")); + form.add(search_input); + String sql = entity.getSql(); + switch(roleId){ + case UserRole.USER_ROLE_ADMINISTRATOR: + sql = entity.getSqlAdmin(); + break; + case UserRole.USER_ROLE_MANAGER: + sql = entity.getSqlManager(); + break; + case UserRole.USER_ROLE_SALES: + sql = entity.getSql(); + break; + } + + if(tdata == null || tdata.size() == 0){ + + if(filter == null){ + + switch(roleId){ + case UserRole.USER_ROLE_ADMINISTRATOR: + tdata = DAOImpl.queryEntityRelationList(sql); + break; + case UserRole.USER_ROLE_MANAGER: + tdata = DAOImpl.queryEntityRelationList(sql,posId,posId); + break; + case UserRole.USER_ROLE_SALES: + tdata = DAOImpl.queryEntityRelationList(sql, posId); + } + + + }else{ + List ft = Lists.newArrayList(); + for (String k : filter.keySet()) { + if(filter.get(k)) ft.add(k); + } + + switch(roleId){ + case UserRole.USER_ROLE_ADMINISTRATOR: + tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft); + break; + case UserRole.USER_ROLE_MANAGER: + tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft,posId,posId); + break; + case UserRole.USER_ROLE_SALES: + tdata =DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft, posId); + } + + + } + + + } + add(new PageableTablePanel("datalist",entity,tdata,null)); + + + + List choices = DAOImpl.queryPickList(entity.getFieldByName(entity.getFilterField()).getPicklist()); + add(new FilterPanel("filterPanel",choices ,filter,ActivityPage.class,entity)); + } +} \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/ActivitySelectPage.html b/crm/src/main/java/com/rex/crm/ActivitySelectPage.html new file mode 100644 index 0000000..179d8fa --- /dev/null +++ b/crm/src/main/java/com/rex/crm/ActivitySelectPage.html @@ -0,0 +1,15 @@ + + + + + + + + diff --git a/crm/src/main/java/com/rex/crm/ActivitySelectPage.java b/crm/src/main/java/com/rex/crm/ActivitySelectPage.java new file mode 100644 index 0000000..f14d40d --- /dev/null +++ b/crm/src/main/java/com/rex/crm/ActivitySelectPage.java @@ -0,0 +1,59 @@ +package com.rex.crm; + +import java.util.Map; +import java.util.Set; + +import org.apache.wicket.AttributeModifier; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.Button; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.markup.html.list.AbstractItem; +import org.apache.wicket.markup.html.panel.Fragment; +import org.apache.wicket.markup.html.panel.Panel; +import org.apache.wicket.markup.repeater.RepeatingView; +import org.apache.wicket.request.mapper.parameter.PageParameters; +import org.apache.wicket.util.string.StringValue; + +import com.google.common.collect.Maps; +import com.rex.crm.common.CreateDataPage; + +public class ActivitySelectPage extends TemplatePage{ + /** + * Constructor + */ + public ActivitySelectPage(){ + //传参时间和实体名 + StringValue entityName = getRequest().getRequestParameters().getParameterValue("entityName"); + final String createAddress = getRequest().getRequestParameters().getParameterValue("createAddress").toString(); + final String name = entityName.toString(); + Set names = getRequest().getRequestParameters().getParameterNames(); + final Map map = Maps.newHashMap(); + for(String nm:names){ + StringValue sv = getRequest().getRequestParameters().getParameterValue(nm); + map.put(nm, sv.toString()); + } + if(("activity").equals(name)){ + initPage(name,map,createAddress); + }else{ + Form form = new Form("buttonForm"); + form.add(new Button("callCoachBtn") { + @Override + public void onSubmit() { + setResponsePage(new CreateDataPage("coaching", map,createAddress)); + } + }); + form.add(new Link("willCoachBtn") { + @Override + public void onClick() { + setResponsePage(new CreateDataPage("willcoaching", map,createAddress)); + } + }); + add(form); + } + } + public void initPage(final String name,final Map params,String createAddress){ + setResponsePage(new CreateDataPage(name,params,createAddress)); + } +} diff --git a/crm/src/main/java/com/rex/crm/AlertPage.html b/crm/src/main/java/com/rex/crm/AlertPage.html new file mode 100644 index 0000000..bb86255 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/AlertPage.html @@ -0,0 +1,42 @@ + + + + + +
+
+
+
+
+
+
+
+ +
+
+
+
+ data table +
+
+
+
+
+ +
+ + diff --git a/crm/src/main/java/com/rex/crm/AlertPage.java b/crm/src/main/java/com/rex/crm/AlertPage.java new file mode 100644 index 0000000..bb88baf --- /dev/null +++ b/crm/src/main/java/com/rex/crm/AlertPage.java @@ -0,0 +1,157 @@ +package com.rex.crm; + +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang3.tuple.Pair; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.model.PropertyModel; + +import com.google.common.collect.Lists; +import com.rex.crm.admin.AdminTemplatePage; +import com.rex.crm.beans.Choice; +import com.rex.crm.common.Entity; +import com.rex.crm.common.Field; +import com.rex.crm.common.FilterPanel; +import com.rex.crm.common.PageableTablePanel; +import com.rex.crm.common.advancedSearch.AdvancedSearchPage; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.util.Configuration; +import com.rexen.crm.beans.UserRole; + +public class AlertPage extends AdminTemplatePage{ + private String search_target = ""; + public AlertPage(){ + init(null,null); + } + public AlertPage(final Map filter,List tdata){ + init(filter,tdata); + } + + public void init(final Map filter,List tdata) + { + Map entities = Configuration.getEntityTable(); + final Entity entity = entities.get("alert"); + setPageTitle("系统管理-信息发布"); + //List mapList = DAOImpl.queryEntityList(entity.getSql(), 0, 1000); + //TODO get userId from request's session + final String posId = ((SignIn2Session)getSession()).getPositionId(); + final int roleId = ((SignIn2Session)getSession()).getRoleId(); + + + Form form = new Form("form"){ + + @Override + protected void onSubmit() { + + String sql = entity.getSql(); + switch(roleId){ + case UserRole.USER_ROLE_ADMINISTRATOR: + sql = entity.getSqlAdmin(); + break; + case UserRole.USER_ROLE_MANAGER: + sql = entity.getSqlManager(); + break; + case UserRole.USER_ROLE_SALES: + sql = entity.getSql(); + break; + } + search_target = (search_target == null || search_target.equalsIgnoreCase("*")) ? "" : search_target; + + List searchableFields = entity.getSearchableFields(); + String joint = " like '%" + search_target + "%'"; + String likequery = ""; + for (Field sf : searchableFields) + { + likequery = likequery + " OR " + sf.getName() + joint; + } + sql = sql + " where name like '%" + search_target + "%' " + likequery; + System.out.println(sql); + List datalist = null; + switch(roleId){ + case UserRole.USER_ROLE_ADMINISTRATOR: + datalist = DAOImpl.queryEntityRelationList(sql); + break; + case UserRole.USER_ROLE_MANAGER: + datalist = DAOImpl.queryEntityRelationList(sql,posId,posId); + break; + case UserRole.USER_ROLE_SALES: + datalist = DAOImpl.queryEntityRelationList(sql,posId); + } + setResponsePage(new AlertPage(filter,datalist)); + + } + + }; + add(form); + form.add(new Link("ad_search_link"){ + @Override + public void onClick() { + setResponsePage(new AdvancedSearchPage(entity.getName(),null)); + + } + }); + TextField search_input = new TextField("search_input", new PropertyModel(this,"search_target")); + form.add(search_input); + String sql = entity.getSql(); + switch(roleId){ + case UserRole.USER_ROLE_ADMINISTRATOR: + sql = entity.getSqlAdmin(); + break; + case UserRole.USER_ROLE_MANAGER: + sql = entity.getSqlManager(); + break; + case UserRole.USER_ROLE_SALES: + sql = entity.getSql(); + break; + } + + if(tdata == null || tdata.size() == 0){ + + if(filter == null){ + + switch(roleId){ + case UserRole.USER_ROLE_ADMINISTRATOR: + tdata = DAOImpl.queryEntityRelationList(sql); + break; + case UserRole.USER_ROLE_MANAGER: + tdata = DAOImpl.queryEntityRelationList(sql,posId,posId); + break; + case UserRole.USER_ROLE_SALES: + tdata = DAOImpl.queryEntityRelationList(sql, posId); + } + + + }else{ + List ft = Lists.newArrayList(); + for (String k : filter.keySet()) { + if(filter.get(k)) ft.add(k); + } + + switch(roleId){ + case UserRole.USER_ROLE_ADMINISTRATOR: + tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft); + break; + case UserRole.USER_ROLE_MANAGER: + tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft,posId,posId); + break; + case UserRole.USER_ROLE_SALES: + tdata =DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft, posId); + } + + + } + + + } + add(new PageableTablePanel("datalist",entity,tdata,null)); + + + + List choices = DAOImpl.queryPickList(entity.getFieldByName(entity.getFilterField()).getPicklist()); + add(new FilterPanel("filterPanel",choices ,filter,AlertPage.class,entity)); + } +} + diff --git a/crm/src/main/java/com/rex/crm/AreaPage.html b/crm/src/main/java/com/rex/crm/AreaPage.html new file mode 100644 index 0000000..9e91925 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/AreaPage.html @@ -0,0 +1,42 @@ + + + + + + +
+
+
+
+ +
+
+
+
+
+ data table +
+
+
+
+
+ +
+ + diff --git a/crm/src/main/java/com/rex/crm/AreaPage.java b/crm/src/main/java/com/rex/crm/AreaPage.java new file mode 100644 index 0000000..2fa4c83 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/AreaPage.java @@ -0,0 +1,108 @@ +package com.rex.crm; + +import java.util.List; +import java.util.Map; + + + +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.model.PropertyModel; + +import com.google.common.collect.Lists; +import com.rex.crm.common.Entity; +import com.rex.crm.common.Field; +import com.rex.crm.common.PageableTablePanel; +import com.rex.crm.common.advancedSearch.AdvancedSearchPage; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.util.Configuration; +import com.rex.crm.admin.AdminTemplatePage; +/** + * @author Sam sun + */ +public class AreaPage extends AdminTemplatePage{ + private String search_target = ""; + + public AreaPage() + { + initPage(null, null); + } + + public AreaPage(final Map filter, List tdata) + { + initPage(filter, tdata); + } + public void initPage(final Map filter, List tdata) + { + Map entities = Configuration.getEntityTable(); + final Entity entity = entities.get("province"); + setPageTitle("系统管理-区域管理"); + + + Form form = new Form("form") + { + + @Override + protected void onSubmit() + { + String sql = entity.getSql(); + + + search_target = (search_target == null || search_target.equalsIgnoreCase("*")) ? "" : search_target; + + // sql = sql + " AND name like '%"+search_target+"%'"; + List searchableFields = entity.getSearchableFields(); + String joint = " like '%" + search_target + "%'"; + String likequery = ""; + for (Field sf : searchableFields) + { + likequery = likequery + " OR " + sf.getName() + joint; + } + + sql = sql + " where val like '%" + search_target + "%' " + likequery; + List datalist = null; + datalist = DAOImpl.queryEntityRelationList(sql); + setResponsePage(new AreaPage(filter, datalist)); + + } + + }; + add(form); + form.add(new Link("ad_search_link"){ + @Override + public void onClick() { + setResponsePage(new AdvancedSearchPage(entity.getName(),null)); + + } + }); + TextField search_input = new TextField("search_input", new PropertyModel(this, "search_target")); + form.add(search_input); + + String sql = entity.getSql(); + // List mapList = DAOImpl.queryEntityList(entity.getSql(), 0, 1000); + if (tdata == null || tdata.size() == 0) + { + tdata = DAOImpl.queryEntityRelationList(sql); + + if (filter == null) + { + tdata = DAOImpl.queryEntityRelationList(sql); + } + else + { + List ft = Lists.newArrayList(); + for (String k : filter.keySet()) + { + if (filter.get(k)) + ft.add(k); + } + tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft); + } + + } + add(new PageableTablePanel("datalist", entity, tdata, null)); + + + } +} diff --git a/crm/src/main/java/com/rex/crm/AuthenticatedWebPage.java b/crm/src/main/java/com/rex/crm/AuthenticatedWebPage.java new file mode 100755 index 0000000..2ff4df9 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/AuthenticatedWebPage.java @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rex.crm; + +import org.apache.wicket.markup.html.WebPage; + + +/** + * Base class to check access to a page. If user is not logged in, redirect to the log-in page. + * + * @author Jonathan Locke + */ +public class AuthenticatedWebPage extends WebPage +{ +} diff --git a/crm/src/main/java/com/rex/crm/CalendarPage.html b/crm/src/main/java/com/rex/crm/CalendarPage.html new file mode 100755 index 0000000..9d8fe9a --- /dev/null +++ b/crm/src/main/java/com/rex/crm/CalendarPage.html @@ -0,0 +1,25 @@ + + + + + + + + + +
+
+
+ data table +
+
+
+
+ + diff --git a/crm/src/main/java/com/rex/crm/CalendarPage.java b/crm/src/main/java/com/rex/crm/CalendarPage.java new file mode 100644 index 0000000..4a2ead2 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/CalendarPage.java @@ -0,0 +1,44 @@ +package com.rex.crm; + +import java.util.List; +import java.util.Map; + +import javax.servlet.ServletContext; + +import org.apache.wicket.markup.head.IHeaderResponse; +import org.apache.wicket.markup.head.JavaScriptHeaderItem; +import org.apache.wicket.markup.html.internal.HtmlHeaderContainer; +import org.apache.wicket.protocol.http.WebApplication; + +import com.rex.crm.common.CalendarPanel; +import com.rex.crm.common.Entity; +import com.rex.crm.common.TableDataPanel; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.util.Configuration; + + +/** + * @author Feiyun Zhou + */ +public class CalendarPage extends TemplatePage +{ + /** + * Constructor + */ + public CalendarPage() + { + Map entities = Configuration.getEntityTable(); + //Entity entity = entities.get("activity"); + setPageTitle("日历"); + + + add(new CalendarPanel("datalist")); + + + } + + + + + +} \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/CoachScoringPage.html b/crm/src/main/java/com/rex/crm/CoachScoringPage.html new file mode 100644 index 0000000..e312326 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/CoachScoringPage.html @@ -0,0 +1,74 @@ + + + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + +
+
+
+
+
+ + \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/CoachScoringPage.java b/crm/src/main/java/com/rex/crm/CoachScoringPage.java new file mode 100644 index 0000000..8db47f6 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/CoachScoringPage.java @@ -0,0 +1,12 @@ +package com.rex.crm; + +public class CoachScoringPage extends TemplatePage{ + private static final long serialVersionUID = 3655394922203975705L; + + public CoachScoringPage(int activity){ + initPage(activity); + } + public void initPage(int activity){ + + } +} diff --git a/crm/src/main/java/com/rex/crm/CoachingPage.html b/crm/src/main/java/com/rex/crm/CoachingPage.html new file mode 100644 index 0000000..6fb1dad --- /dev/null +++ b/crm/src/main/java/com/rex/crm/CoachingPage.html @@ -0,0 +1,45 @@ + + + + + + +
+
+
+
+
+
+
+
+
+ +
+
+
+
+ data table +
+
+
+
+ +
+ + diff --git a/crm/src/main/java/com/rex/crm/CoachingPage.java b/crm/src/main/java/com/rex/crm/CoachingPage.java new file mode 100644 index 0000000..da07747 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/CoachingPage.java @@ -0,0 +1,165 @@ +package com.rex.crm; + +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang3.tuple.Pair; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.model.PropertyModel; + +import com.google.common.collect.Lists; +import com.rex.crm.beans.Choice; +import com.rex.crm.common.Entity; +import com.rex.crm.common.Field; +import com.rex.crm.common.FilterPanel; +import com.rex.crm.common.PageableTablePanel; +import com.rex.crm.common.advancedSearch.AdvancedSearchPage; +import com.rex.crm.db.DAOImpl; +import com.rexen.crm.beans.UserRole; +import com.rex.crm.util.Configuration; + + +/** + * @author Feiyun Zhou + */ +public class CoachingPage extends TemplatePage +{ + private String search_target = ""; + public CoachingPage(){ + init(null,null); + } + public CoachingPage(final Map filter,List tdata){ + init(filter,tdata); + } + + public CoachingPage(List tdata){ + init(null,tdata); + } + public void init(final Map filter,List tdata) + { + Map entities = Configuration.getEntityTable(); + final Entity entity = entities.get("coaching"); + setPageTitle(entity.getDisplay()); + //List mapList = DAOImpl.queryEntityList(entity.getSql(), 0, 1000); + //TODO get userId from request's session + final String posId = ((SignIn2Session)getSession()).getPositionId(); + final int roleId = ((SignIn2Session)getSession()).getRoleId(); + + + Form form = new Form("form"){ + + @Override + protected void onSubmit() { + + String sql = entity.getSql(); + switch(roleId){ + case UserRole.USER_ROLE_ADMINISTRATOR: + sql = entity.getSqlAdmin(); + break; + case UserRole.USER_ROLE_MANAGER: + sql = entity.getSqlManager(); + break; + case UserRole.USER_ROLE_SALES: + sql = entity.getSql(); + break; + } + + search_target = (search_target==null || search_target.equalsIgnoreCase("*"))? "":search_target; + + //sql = sql + " where title like '%"+search_target+"%'"; + List searchableFields = entity.getSearchableFields(); + String joint = " like '%"+search_target+"%'"; + String likequery = ""; + for(Field sf:searchableFields){ + likequery = likequery + " OR "+ sf.getName() + joint; + } + sql = sql + " where title like '%"+search_target+"%' " + likequery; + System.out.println("sql:"+sql); + List datalist = null; + switch(roleId){ + case UserRole.USER_ROLE_ADMINISTRATOR: + datalist = DAOImpl.queryEntityRelationList(sql); + break; + case UserRole.USER_ROLE_MANAGER: + datalist = DAOImpl.queryEntityRelationList(sql,posId,posId); + break; + case UserRole.USER_ROLE_SALES: + datalist = DAOImpl.queryEntityRelationList(sql,posId); + } + setResponsePage(new CoachingPage(filter,datalist)); + + } + + }; + add(form); + form.add(new Link("ad_search_link"){ + @Override + public void onClick() { + setResponsePage(new AdvancedSearchPage(entity.getName(),null)); + + } + }); + TextField search_input = new TextField("search_input", new PropertyModel(this,"search_target")); + form.add(search_input); + String sql = entity.getSql(); + switch(roleId){ + case UserRole.USER_ROLE_ADMINISTRATOR: + sql = entity.getSqlAdmin(); + break; + case UserRole.USER_ROLE_MANAGER: + sql = entity.getSqlManager(); + break; + case UserRole.USER_ROLE_SALES: + sql = entity.getSql(); + break; + } + + if(tdata == null || tdata.size() == 0){ + + if(filter == null){ + + switch(roleId){ + case UserRole.USER_ROLE_ADMINISTRATOR: + tdata = DAOImpl.queryEntityRelationList(sql); + break; + case UserRole.USER_ROLE_MANAGER: + tdata = DAOImpl.queryEntityRelationList(sql,posId,posId); + break; + case UserRole.USER_ROLE_SALES: + tdata = DAOImpl.queryEntityRelationList(sql, posId); + } + + + }else{ + List ft = Lists.newArrayList(); + for (String k : filter.keySet()) { + if(filter.get(k)) ft.add(k); + } + + switch(roleId){ + case UserRole.USER_ROLE_ADMINISTRATOR: + tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft); + break; + case UserRole.USER_ROLE_MANAGER: + tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft,posId,posId); + break; + case UserRole.USER_ROLE_SALES: + tdata =DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft, posId); + } + + + } + + + } + add(new PageableTablePanel("datalist",entity,tdata,null)); + + + List choices = DAOImpl.queryPickList(entity.getFieldByName(entity.getFilterField()).getPicklist()); + + add(new FilterPanel("filterPanel",choices ,filter,CoachingPage.class,entity)); + + } +} \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/ContactPage.html b/crm/src/main/java/com/rex/crm/ContactPage.html new file mode 100755 index 0000000..4341365 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/ContactPage.html @@ -0,0 +1,50 @@ + + + + + + +
+
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+ data table +
+
+
+
+ +
+ + diff --git a/crm/src/main/java/com/rex/crm/ContactPage.java b/crm/src/main/java/com/rex/crm/ContactPage.java new file mode 100644 index 0000000..2cbb7af --- /dev/null +++ b/crm/src/main/java/com/rex/crm/ContactPage.java @@ -0,0 +1,181 @@ +package com.rex.crm; + +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang3.tuple.Pair; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.model.PropertyModel; + +import com.google.common.collect.Lists; +import com.rex.crm.beans.Choice; +import com.rex.crm.common.Entity; +import com.rex.crm.common.Field; +import com.rex.crm.common.FilterPanel; +import com.rex.crm.common.PageableTablePanel; +import com.rex.crm.common.TableDataPanel; +import com.rex.crm.common.advancedSearch.AdvancedSearchPage; +import com.rex.crm.db.DAOImpl; +import com.rexen.crm.beans.UserRole; +import com.rex.crm.util.Configuration; + + +/** + * @author Feiyun Zhou + */ +public class ContactPage extends TemplatePage +{ + + private String search_target = ""; + /** + * Constructor + */ + public ContactPage() + { + initPage(null,null); + + } + + public ContactPage(Map filter,List tdata) + { + + initPage(filter,tdata); + + } + public ContactPage(List tdata) + { + + initPage(null,tdata); + + } + + public ContactPage(Map map){ + initPage(map,null); + } + + private void initPage(final Map filter,List tdata){ + Map entities = Configuration.getEntityTable(); + final Entity entity = entities.get("contact"); + setPageTitle(entity.getDisplay()); + //List mapList = DAOImpl.queryEntityList(entity.getSql(), 0, 1000); + //TODO get userId from request's session + final String posId = ((SignIn2Session)getSession()).getPositionId(); + final int roleId = ((SignIn2Session)getSession()).getRoleId(); + + Form form = new Form("form"){ + + @Override + protected void onSubmit() { + String sql = entity.getSql(); + switch(roleId){ + case UserRole.USER_ROLE_ADMINISTRATOR: + sql = entity.getSqlAdmin(); + break; + case UserRole.USER_ROLE_MANAGER: + sql = entity.getSqlManager(); + break; + case UserRole.USER_ROLE_SALES: + sql = entity.getSql(); + break; + } + + search_target = (search_target==null || search_target.equalsIgnoreCase("*"))? "":search_target; + + List searchableFields = entity.getSearchableFields(); + String joint = " like '%"+search_target+"%'"; + String likequery = ""; + for(Field sf:searchableFields){ + likequery = likequery + " OR "+ sf.getName() + joint; + } + sql = sql + " where name like '%"+search_target+"%' " + likequery; + System.out.println("TEST:"+sql); + List datalist = null; + + switch(roleId){ + case UserRole.USER_ROLE_ADMINISTRATOR: + datalist = DAOImpl.queryEntityRelationList(sql); + break; + case UserRole.USER_ROLE_MANAGER: + datalist = DAOImpl.queryEntityRelationList(sql, posId); + break; + case UserRole.USER_ROLE_SALES: + datalist = DAOImpl.queryEntityRelationList(sql, posId); + } + setResponsePage(new ContactPage(filter,datalist)); + + } + + }; + add(form); + + TextField search_input = new TextField("search_input", new PropertyModel(this,"search_target")); + form.add(search_input); + form.add(new Link("ad_search_link"){ + @Override + public void onClick() { + setResponsePage(new AdvancedSearchPage(entity.getName(),null)); + + } + +} ); + String sql = entity.getSql(); + switch(roleId){ + case UserRole.USER_ROLE_ADMINISTRATOR: + sql = entity.getSqlAdmin(); + break; + case UserRole.USER_ROLE_MANAGER: + sql = entity.getSqlManager(); + break; + case UserRole.USER_ROLE_SALES: + sql = entity.getSql(); + break; + } + if (tdata == null || tdata.size() == 0) { + + + + if (filter == null) { + + switch(roleId){ + case UserRole.USER_ROLE_ADMINISTRATOR: + tdata = DAOImpl.queryEntityRelationList(sql); + break; + case UserRole.USER_ROLE_MANAGER: + tdata = DAOImpl.queryEntityRelationList(sql, posId); + break; + case UserRole.USER_ROLE_SALES: + tdata = DAOImpl.queryEntityRelationList(sql, posId); + } + + + } else { + + List ft = Lists.newArrayList(); + for (String k : filter.keySet()) { + if (filter.get(k)) + ft.add(k); + } + switch(roleId){ + case UserRole.USER_ROLE_ADMINISTRATOR: + tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft); + break; + case UserRole.USER_ROLE_MANAGER: + tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft, posId); + break; + case UserRole.USER_ROLE_SALES: + tdata =DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft, posId); + } + + } + } + add(new PageableTablePanel("datalist",entity,tdata,null)); + + + List choices = DAOImpl.queryPickList(entity.getFieldByName(entity.getFilterField()).getPicklist()); + + add(new FilterPanel("filterPanel",choices ,filter,ContactPage.class,entity)); + + } +} \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/CreateEventPage.html b/crm/src/main/java/com/rex/crm/CreateEventPage.html new file mode 100755 index 0000000..6c72672 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/CreateEventPage.html @@ -0,0 +1,379 @@ + + + + + + + +
+
+
+ + +
+
+
+ +
+
+
活动类型:
+
+
+
+ +
+ 拜访 +
+
+ 辅导 +
+
+
+
+
+
+
+
活动名称:
+
+
+
+ +
+
+
+ +
+
+
+
拜访类型:
+
+
+
+ +
+
+
+ +
+
+
拜访医生:
+
+
+
+ + + + +
+
+
+ +
+
+
拜访目的:
+
+
+
+ +
+
+
+
+
+
+
主推产品:
+
+
+
+ +
+
+
+
+
+
开始时间:
+
+
+
+
+ +
+
+
+
+
+
+
结束时间:
+
+
+
+
+ +
+
+
+
+ + + +
+
+
+
+ 保存&返回 +
+
+ 取消 +
+
+
+
+
+

提示信息

+
+
+ +
+ + diff --git a/crm/src/main/java/com/rex/crm/CreateEventPage.java b/crm/src/main/java/com/rex/crm/CreateEventPage.java new file mode 100644 index 0000000..7bc483a --- /dev/null +++ b/crm/src/main/java/com/rex/crm/CreateEventPage.java @@ -0,0 +1,377 @@ +package com.rex.crm; + +import java.io.Serializable; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.apache.wicket.AttributeModifier; +import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior; +import org.apache.wicket.behavior.AttributeAppender; +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.DropDownChoice; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.HiddenField; +import org.apache.wicket.markup.html.form.IChoiceRenderer; +import org.apache.wicket.markup.html.form.Radio; +import org.apache.wicket.markup.html.form.RadioGroup; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.link.BookmarkablePageLink; +import org.apache.wicket.markup.html.list.AbstractItem; +import org.apache.wicket.markup.repeater.RepeatingView; +import org.apache.wicket.model.AbstractReadOnlyModel; +import org.apache.wicket.model.IModel; +import org.apache.wicket.model.Model; +import org.apache.wicket.model.PropertyModel; +import org.apache.wicket.request.mapper.parameter.PageParameters; +import org.apache.wicket.util.string.StringValue; + +import com.rex.crm.beans.CRMUser; +import com.rex.crm.beans.Choice; +import com.rex.crm.beans.UserInfo; +import com.rex.crm.common.Entity; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.util.Configuration; + +/** + * @author Feiyun Zhou + */ +public class CreateEventPage extends TemplatePage { + + private static final Logger logger = Logger.getLogger(CreateEventPage.class); + public Date startDate; + protected String endDate; + protected String endTime; + protected String startTime; + protected String contact_select; + protected String hidden_contact_select; + protected String hidden_select_user; + protected Choice visiting_purpose = new Choice(1L, ""); + protected Choice feature_product = new Choice(1L, ""); + protected Choice activity_type = new Choice(1L, ""); + protected Choice selected_event_type = new Choice(1L, "拜访"); + protected String act_title_input = ""; + protected Integer event_type = 1; + protected String selected_user = ""; + protected String status = "计划中"; /*new Choice(1L,"计划中");*/ + protected String location = ""; + protected int total_score; + protected Choice planing = new Choice(0L, ""); + protected Choice openling = new Choice(0L, ""); + protected Choice enquery_listening = new Choice(0L, ""); + protected Choice deliverable = new Choice(0L, ""); + protected Choice objection_handing = new Choice(0L, ""); + protected Choice summary = new Choice(0L, ""); + protected String owner = ""; + protected String whenadded = ""; + protected String crmuserId = ""; + /** + * Constructor + */ + public CreateEventPage() { + initPage(0); + } + + public CreateEventPage(int type) { + initPage(type); + } + + public void initPage(final int type) { + Map entities = Configuration.getEntityTable(); + Entity entity = entities.get("activity"); + setPageTitle(entity.getDisplay()); + final String posId = ((SignIn2Session) getSession()).getPositionId(); + final String user = ((SignIn2Session) getSession()).getUser(); + final String userId = ((SignIn2Session) getSession()).getUserId(); + final int roleId = ((SignIn2Session) getSession()).getRoleId(); + CRMUser crmUser = DAOImpl.getCRMUserInfoById(Integer.parseInt(posId)); + final String crmUserName = crmUser.getName(); + //add prompt + final RepeatingView div = new RepeatingView("promptDiv"); + final AbstractItem divitem = new AbstractItem(div.newChildId()); + final Label promptButton = new Label("promptButton","X"); + divitem.add(promptButton); + final Label promptLabel = new Label("prompt","红色字体字段为必填项,请输入!"); + divitem.add(promptLabel); + div.add(new AttributeAppender("style",new Model("display:none"),";")); + divitem.add(new AttributeAppender("style",new Model("display:none"),";")); + div.add(divitem); + add(div); + //set event type + RadioGroup event_type_group = new RadioGroup("event_type_group", new PropertyModel(this, "event_type")); + final Radio callRadio = new Radio("radio1", new Model(1L)); + event_type_group.add(callRadio); + final Radio coachingRadio = new Radio("radio2", new Model(2L)); + if (roleId == 3) { + coachingRadio.add(new AttributeAppender("disabled", "true")); + } + final AttributeModifier redioModifier = new AttributeModifier("checked","checked"); + //辅导名称拼接字段 + final StringBuffer concahName = new StringBuffer(); + Form form = new Form("form") { + @Override + protected void onSubmit() { + logger.debug("this form was submitted!"); + String sd = getRequest().getPostParameters().getParameterValue("start_date").toString(); + String ed = getRequest().getPostParameters().getParameterValue("end_date").toString(); + String visit_type = String.valueOf(activity_type); + logger.debug("opening:" + String.valueOf(openling.getId())); + SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm"); + String sdt = sd; + String edt = ed; + int contactId = 0; + int coacheeId = 0; + Date startdt = null; + Date enddt = null; + boolean flag = true; + try { + startdt = dateformat.parse(sdt); + enddt = dateformat.parse(edt); + } catch (ParseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + if(event_type==1){ + if (null == hidden_contact_select) { + contactId = 0; + div.add(new AttributeAppender("style",new Model("display:block"),";")); + divitem.add(new AttributeAppender("style",new Model("display:block"),";")); + promptLabel.add(new AttributeAppender("style",new Model("display:block"),";")); + promptButton.add(new AttributeAppender("style",new Model("display:block"),";")); + callRadio.add(redioModifier); + coachingRadio.add(redioModifier.remove("checked")); + flag = false; + } else { + contactId = Integer.parseInt(hidden_contact_select); + } + }else{ + if(null==hidden_select_user){ + coacheeId = 0; + div.add(new AttributeAppender("style",new Model("display:block"),";")); + divitem.add(new AttributeAppender("style",new Model("display:block"),";")); + promptLabel.add(new AttributeAppender("style",new Model("display:block"),";")); + promptButton.add(new AttributeAppender("style",new Model("display:block"),";")); + coachingRadio.add(redioModifier); + callRadio.add(redioModifier.remove("checked")); + flag = false; + }else{ + coacheeId = Integer.parseInt(hidden_select_user); + } + } + if(flag){ + if (null == act_title_input) { + if (event_type == 1) { + concahName.append("拜访:"); + //根据医生Id获取医生对象 + act_title_input = concahName.append(DAOImpl.getContactById(contactId).getName()).toString(); + } else { + concahName.append(crmUserName); + concahName.append(sd); + concahName.append("拜访辅导"); + act_title_input = concahName.toString(); + + } + } + try { + int crmuserId = 0; + String participants = user; + if (event_type == 1) { + //visiting + crmuserId = Integer.parseInt(posId); + } else if (event_type == 2) { + //coaching + crmuserId = Integer.parseInt(posId);; + participants = participants + ", " + selected_user; + contactId = -1; + concahName.append("拜访辅导"); + visiting_purpose = new Choice(8L, ""); + } + System.out.println("拜访类型:"+String.valueOf(visiting_purpose.getId())); + //insert the event, and return the generated id of the event + long generatedkey = DAOImpl.addCalendarEventForCoach(crmuserId, contactId, String.valueOf(activity_type.getId()), + act_title_input, String.valueOf(startdt.getTime() / 1000), + String.valueOf(enddt.getTime() / 1000), 1, user, user, user, + String.valueOf(visiting_purpose.getId()), + String.valueOf(feature_product.getId()), event_type.intValue(), participants, + coacheeId, location, total_score, String.valueOf(planing.getId()), String.valueOf(openling.getId()), String.valueOf(enquery_listening.getId()), String.valueOf(deliverable.getId()), String.valueOf(objection_handing.getId()), String.valueOf(summary.getId())); + logger.debug("generatedkey:" + generatedkey); + if (generatedkey > 0) { + if (event_type == 1) { + //if it is a visiting, we only send this event to the owner; + DAOImpl.insert2UserRelationTable("activity",userId, posId ,String.valueOf(coacheeId),String.valueOf(generatedkey)); + } else if (event_type == 2) { + //if it is a coaching, we need send this event to the manager and sales + //add new record for the manager + logger.debug("key:" + String.valueOf(generatedkey)); + DAOImpl.insert2UserRelationTable("activity",userId, posId,String.valueOf(coacheeId), String.valueOf(generatedkey)); + //add new record for the sales + DAOImpl.insert2UserRelationTable("activity", userId,hidden_select_user,String.valueOf(coacheeId), String.valueOf(generatedkey)); + } + } + } catch (NumberFormatException e) { + e.printStackTrace(); + } catch (Exception e) { + e.printStackTrace(); + } + if (type == 0) { + setResponsePage(PageFactory.createPage("calendar")); + } else { + setResponsePage(new ActivityPage()); + } + } + + } + }; + add(form); + //辅导者 + TextField coach = new TextField("crmuserId", new PropertyModel(this, "crmuserId")); + coach.add(new AttributeModifier("value", crmUser.getName())); + form.add(coach); + //创建人 + TextField owner = new TextField("owner", new PropertyModel(this, "owner")); + owner.add(new AttributeModifier("value", crmUser.getName())); + form.add(owner); + //创建时间 + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式 + TextField whenadded = new TextField("whenadded", new PropertyModel(this, "whenadded")); + whenadded.add(new AttributeModifier("value", df.format(new Date()))); + form.add(whenadded); + //状态默认为计划中 + TextField status = new TextField("status", new PropertyModel(this, "status")); + form.add(status); + //计划地点 + TextField location = new TextField("location", new PropertyModel(this, "location")); + form.add(location); + //分数 + TextField total_score = new TextField("total_score", new PropertyModel(this, "total_score")); + form.add(total_score); + StringValue startdateValue = this.getRequest().getRequestParameters().getParameterValue("startdate"); + + String startdate = null; + long current = System.currentTimeMillis(); + Date current_date_time = new Date(current); + SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm"); + //set default time to current time + if (startdateValue != null && !startdateValue.isEmpty() && !startdateValue.isNull()) { + startdate = startdateValue.toString(); + } else { + startdate = dateformat.format(current_date_time); + } + SimpleDateFormat timeformatter = new SimpleDateFormat("HH:mm"); + WebMarkupContainer start_date_input = new WebMarkupContainer("start_date_input"); + form.add(start_date_input); + start_date_input.add(new AttributeModifier("value", startdate.substring(0, 10) + "T" + timeformatter.format(current_date_time))); + SimpleDateFormat dateformat2 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm"); + Date sDate = current_date_time; + try { + sDate = dateformat2.parse(startdate + "T" + timeformatter.format(current_date_time)); + } catch (ParseException e) { + logger.warn("failed to parse date:", e); + } + Date next_date_time = new Date(sDate.getTime() + 3600 * 1000); + WebMarkupContainer end_date_input = new WebMarkupContainer("end_date_input"); + form.add(end_date_input); + end_date_input.add(new AttributeModifier("value", dateformat.format(next_date_time))); +// PopupSettings popupSettings = new PopupSettings("查找").setLeft(150).setTop(200); + form.add(new BookmarkablePageLink("search_btn", SearchContactPage.class)); + form.add(new HiddenField("hidden_contact_select", new PropertyModel(this, "hidden_contact_select"))); + form.add(new TextField("contact_select", new Model(""))); + PageParameters params = new PageParameters(); + params.set("mid", posId); + form.add(new BookmarkablePageLink("search_user_btn", SelectCRMUserPage.class, params)); + form.add(new HiddenField("hidden_select_user", new PropertyModel(this, "hidden_select_user"))); + form.add(new TextField("selected_user", new PropertyModel(this, "selected_user"))); + IModel visiting_purpose_choices_model = new AbstractReadOnlyModel() { + @Override + public List getObject() { + List choices = new ArrayList(); + return DAOImpl.queryPickListByFilter("activity_visiting_purpose_pl", "activity_type", String.valueOf(activity_type.getId())); + } + }; + //visiting purpose choice + final DropDownChoice visiting_purpose_choice = createDropDownListFromPickList("visiting_purpose_input", "com_visiting_purpose_pl", visiting_purpose_choices_model, new PropertyModel(this, "visiting_purpose")); + visiting_purpose_choice.setOutputMarkupId(true); + form.add(visiting_purpose_choice); + //event type choice + DropDownChoice activity_type_choice = createDropDownListFromPickList("activity_type_input", "activity_activity_types_pl", null, new PropertyModel(this, "activity_type")); + activity_type_choice.setOutputMarkupId(true); + form.add(activity_type_choice); + activity_type_choice.add(new AjaxFormComponentUpdatingBehavior("onchange") { + private static final long serialVersionUID = 1L; + + @Override + protected void onUpdate(AjaxRequestTarget target) { + target.add(visiting_purpose_choice); + } + }); + + event_type_group.add(coachingRadio); + form.add(event_type_group); + form.add(createDropDownListFromPickList("feature_product_input", "activity_feature_product_pl", null, new PropertyModel(this, "feature_product"))); + form.add(createDropDownListFromPickList("planing_input", "score1_pl", null, new PropertyModel(this, "planing"))); + form.add(createDropDownListFromPickList("openling_input", "score1_pl", null, new PropertyModel(this, "openling"))); + form.add(createDropDownListFromPickList("enquery_listening_input", "score1_pl", null, new PropertyModel(this, "enquery_listening"))); + form.add(createDropDownListFromPickList("deliverable_input", "score2_pl", null, new PropertyModel(this, "deliverable"))); + form.add(createDropDownListFromPickList("objection_handing_input", "score1_pl", null, new PropertyModel(this, "objection_handing"))); + form.add(createDropDownListFromPickList("summary_input", "score2_pl", null, new PropertyModel(this, "summary"))); + form.add(new TextField("act_title_input", new PropertyModel(this, "act_title_input"))); + //拜访辅导。辅导者,状态, + } + + private DropDownChoice createDropDownListFromPickList(String markupId, String picklistName, IModel choices, PropertyModel default_model) { + if (choices == null) { + choices = Model.ofList(DAOImpl.queryPickList(picklistName)); + } + return new DropDownChoice(markupId, default_model, choices, + new IChoiceRenderer() { + @Override + public Object getDisplayValue(Choice choice) { + // TODO Auto-generated method stub + return choice.getVal(); + } + + @Override + public String getIdValue(Choice choice, int index) { + // TODO Auto-generated method stub + return String.valueOf(choice.getId()); + } + }); + } + + class SelectOption implements Serializable { + + private int key; + private String value; + + public SelectOption(int key, String value) { + this.key = key; + this.value = value; + } + + public SelectOption() { + } + + public int getKey() { + return key; + } + + public void setKey(int key) { + this.key = key; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + } +} diff --git a/crm/src/main/java/com/rex/crm/DataManagement.html b/crm/src/main/java/com/rex/crm/DataManagement.html new file mode 100644 index 0000000..3ca3587 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/DataManagement.html @@ -0,0 +1,38 @@ + + + + + + +
+ + + + + + + + + + + + + + + + +
+ data table +
+
+ + +
+ + diff --git a/crm/src/main/java/com/rex/crm/DataManagement.java b/crm/src/main/java/com/rex/crm/DataManagement.java new file mode 100644 index 0000000..cbdbd02 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/DataManagement.java @@ -0,0 +1,102 @@ +package com.rex.crm; + +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang3.tuple.Pair; + +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.TextField; + +import org.apache.wicket.model.PropertyModel; + +import com.google.common.collect.Lists; + +import com.rex.crm.common.Entity; + +import com.rex.crm.common.Field; +import com.rex.crm.common.FilterPanel; +import com.rex.crm.common.PageableTablePanel; + +import com.rex.crm.db.DAOImpl; +import com.rexen.crm.beans.UserRole; +import com.rex.crm.util.Configuration; + + +/** + * @author Feiyun Zhou + */ +public class DataManagement extends TemplatePage +{ + private String search_target = ""; + public DataManagement(){ + init(null,null); + } + public DataManagement(final Map filter,List tdata){ + init(filter,tdata); + } + + public void init(final Map filter,List tdata) + { + Map entities = Configuration.getEntityTable(); + final Entity entity = entities.get("data_exchange_teample"); + setPageTitle(entity.getDisplay()); + //List mapList = DAOImpl.queryEntityList(entity.getSql(), 0, 1000); + //TODO get userId from request's session + final String userId = ((SignIn2Session)getSession()).getUserId(); + final int roleId = ((SignIn2Session)getSession()).getRoleId(); + + +// Form form = new Form("form"){ +// +// @Override +// protected void onSubmit() { +// +// String sql = entity.getSql(); +// +// search_target = (search_target==null || search_target.equalsIgnoreCase("*"))? "":search_target; +// +// //sql = sql + " where title like '%"+search_target+"%'"; +// List searchableFields = entity.getSearchableFields(); +// String joint = " like '%"+search_target+"%'"; +// String likequery = ""; +// for(Field sf:searchableFields){ +// likequery = likequery + " OR "+ sf.getName() + joint; +// } +// sql = sql + " where title like '%"+search_target+"%' " + likequery; +// List datalist = null; +// datalist = DAOImpl.queryEntityRelationList(sql); +// setResponsePage(new DataManagement(filter,datalist)); +// } +// +// }; +// add(form); + +// TextField search_input = new TextField("search_input", new PropertyModel(this,"search_target")); +// form.add(search_input); + String sql = entity.getSql(); + if(tdata == null || tdata.size() == 0){ + + if(filter == null){ + tdata = DAOImpl.queryEntityRelationList(sql); + } + else{ + List ft = Lists.newArrayList(); + for (String k : filter.keySet()) { + if(filter.get(k)) ft.add(k); + } + + tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft); + } + + } + add(new PageableTablePanel("datalist",entity,tdata,null)); + + +// //for the side bar +// List>> types = null; +// types = DAOImpl.queryFilters(sql, entity.getFilterField(), entity.getFieldByName(entity.getFilterField()).getPicklist()); +// add(new FilterPanel("filterPanel",types ,filter,DataManagement.class)); + + } +} \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/EventCoachEditorPage.html b/crm/src/main/java/com/rex/crm/EventCoachEditorPage.html new file mode 100644 index 0000000..4fa99bd --- /dev/null +++ b/crm/src/main/java/com/rex/crm/EventCoachEditorPage.html @@ -0,0 +1,276 @@ + + + + + + + +
+
+
+ + +
+
+
+ +
+
+
活动名称:
+
+
+
+ +
+
+
+
+
+
辅导人:
+
+
+
+ +
+
+
+
+
+
被辅导人:
+
+
+
+ +    + +
+
+
+
+
+
访前计划:
+
+
+
+ +
+
+
+
+
+
开场:
+
+
+
+ +
+
+
+
+
+
探询聆听:
+
+
+
+ +
+
+
+
+
+
利益销售:
+
+
+
+ +
+
+
+
+
+
异常处理:
+
+
+
+ +
+
+
+
+
+
缔结:
+
+
+
+ +
+
+
+
+
+
总分:
+
+
+
+  (满分100分) +
+
+
+
+
+
计划地点:
+
+
+
+ +
+
+
+
+
+
状态:
+
+
+
+ +
+
+
+
+
+
创建者:
+
+
+
+ +
+
+
+
+
+
创建时间:
+
+
+
+ +
+
+
+
+
+
修改者:
+
+
+
+ +
+
+
+
+
+
修改时间:
+
+
+
+ +
+
+
+ +
+
+
主推产品:
+
+
+
+ +
+
+
+
+
+
开始时间:
+
+
+
+
+ +
+
+
+
+
+
+
结束时间:
+
+
+
+
+ +
+
+
+
+
+
+
+
+ 保存&返回 +
+
+ 取消 +
+
+
+
+
+

提示信息

+
+
+
+ + \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/EventCoachEditorPage.java b/crm/src/main/java/com/rex/crm/EventCoachEditorPage.java new file mode 100644 index 0000000..71936ae --- /dev/null +++ b/crm/src/main/java/com/rex/crm/EventCoachEditorPage.java @@ -0,0 +1,315 @@ +package com.rex.crm; + +import java.io.Serializable; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.apache.wicket.AttributeModifier; +import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior; +import org.apache.wicket.behavior.AttributeAppender; +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.DropDownChoice; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.HiddenField; +import org.apache.wicket.markup.html.form.IChoiceRenderer; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.link.BookmarkablePageLink; +import org.apache.wicket.markup.html.link.PopupSettings; +import org.apache.wicket.markup.html.list.AbstractItem; +import org.apache.wicket.markup.repeater.RepeatingView; +import org.apache.wicket.model.AbstractReadOnlyModel; +import org.apache.wicket.model.IModel; +import org.apache.wicket.model.Model; +import org.apache.wicket.model.PropertyModel; +import org.apache.wicket.request.mapper.parameter.PageParameters; +import org.apache.wicket.util.string.StringValue; + +import com.rex.crm.beans.CRMUser; +import com.rex.crm.beans.Choice; +import com.rex.crm.beans.UserInfo; +import com.rex.crm.common.Entity; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.util.Configuration; + +public class EventCoachEditorPage extends TemplatePage{ + private static final Logger logger = Logger.getLogger(EventCoachEditorPage.class); + public Date startDate; + protected String endDate; + protected String endTime; + protected String startTime; + protected String crmuserId = ""; + protected String location = ""; + protected int total_score; + protected Choice planing = new Choice(0L,""); + protected Choice openling = new Choice(0L,""); + protected Choice enquery_listening = new Choice(0L,""); + protected Choice deliverable = new Choice(0L,""); + protected Choice objection_handing = new Choice(0L,""); + protected Choice summary = new Choice(0L,""); + protected String owner = ""; + protected String whenadded = ""; + protected String modifier = ""; + protected String modifier_time = ""; + protected String act_name_input = ""; + protected String selected_user = ""; + protected Choice feature_product = new Choice(1L, ""); + protected String status = "计划中"; + protected String hidden_select_user; + /** + * Constructor + */ + public EventCoachEditorPage(final long eventId) { + Map entities = Configuration.getEntityTable(); + Entity entity = entities.get("activity"); + setPageTitle(entity.getDisplay()); + final String posId = ((SignIn2Session) getSession()).getPositionId(); + final String user = ((SignIn2Session) getSession()).getUser(); + CRMUser crmUser = DAOImpl.getCRMUserInfoById(Integer.parseInt(posId)); + Map entity_data = DAOImpl.queryEntityById(entity.getSql_ent(),String.valueOf(eventId)); + //add prompt + final RepeatingView div = new RepeatingView("promptDiv"); + final AbstractItem divitem = new AbstractItem(div.newChildId()); + final Label promptButton = new Label("promptButton","X"); + divitem.add(promptButton); + final Label promptLabel = new Label("prompt","红色输入框为必填项,请输入!"); + divitem.add(promptLabel); + div.add(new AttributeAppender("style",new Model("display:none"),";")); + divitem.add(new AttributeAppender("style",new Model("display:none"),";")); + div.add(divitem); + add(div); + //辅导名称拼接字段 + final String crmuserName = crmUser.getName(); + final StringBuffer concahName = new StringBuffer(); + Form form = new Form("form") { + @Override + protected void onSubmit() { + String sd = getRequest().getPostParameters() + .getParameterValue("start_date").toString(); + String ed = getRequest().getPostParameters() + .getParameterValue("end_date").toString(); + String visit_type = String.valueOf(2); + SimpleDateFormat dateformat = new SimpleDateFormat( + "yyyy-MM-dd'T'HH:mm"); + Date act_endtime = new Date(System.currentTimeMillis()); + String sdt = sd; + String edt = ed; + Date startdt = null; + Date enddt = null; + int coachId = 0; + try { + startdt = dateformat.parse(sdt); + enddt = dateformat.parse(edt); + } catch (ParseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + if(null==act_name_input){ + concahName.append(crmuserName); + concahName.append(sd); + concahName.append("拜访辅导"); + act_name_input = concahName.toString(); + } + if(null==hidden_select_user){ + coachId = 0; + }else{ + coachId = Integer.parseInt(hidden_select_user); + } + boolean flag = true; + //验证字段是否为空如果为空则做页面提示 + if(coachId==0){ + div.add(new AttributeAppender("style",new Model("display:block"),";")); + divitem.add(new AttributeAppender("style",new Model("display:block"),";")); + promptLabel.add(new AttributeAppender("style",new Model("display:block"),";")); + promptButton.add(new AttributeAppender("style",new Model("display:block"),";")); + flag = false; + } + if(flag){ + try { + DAOImpl.updateCalendarEventForCoach(String.valueOf(eventId),hidden_select_user, + String.valueOf(startdt.getTime() / 1000), + String.valueOf(enddt.getTime() / 1000),user,coachId,location,total_score,String.valueOf(planing.getId()),String.valueOf(openling.getId()),String.valueOf(enquery_listening.getId()),String.valueOf(deliverable.getId()),String.valueOf(objection_handing.getId()),String.valueOf(summary.getId()),act_name_input); + + } catch (NumberFormatException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + setResponsePage(PageFactory.createPage("calendar")); + } + } + }; + add(form); + + StringValue startdateValue = this.getRequest().getRequestParameters() + .getParameterValue("startdate"); + + SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm"); + Date startDate = new Date( + ((Number) entity_data.get("starttime")).longValue()); + String startdate = dateformat.format(startDate); + + logger.debug("startdate:" + startdate); + + WebMarkupContainer start_date_input = new WebMarkupContainer( + "start_date_input"); + form.add(start_date_input); + start_date_input.add(new AttributeModifier("value", startdate)); + Date endDate = new Date( + ((Number) entity_data.get("endtime")).longValue()); + WebMarkupContainer end_date_input = new WebMarkupContainer( + "end_date_input"); + form.add(end_date_input); + end_date_input.add(new AttributeModifier("value", dateformat + .format(endDate))); + feature_product.setId(((Number) entity_data.get("feature_product")) + .longValue()); + form.add(createDropDownListFromPickList("feature_product", + "activity_feature_product_pl", null, new PropertyModel(this, + "feature_product"))); + //辅导者 + //获取辅导者对象 + CRMUser crmuser = DAOImpl.getCrmUserById((int) entity_data.get("crmuserId")); + crmuserId = crmuser.getName(); + form.add(new TextField("crmuserId", new PropertyModel(this, + "crmuserId"))); + + + hidden_select_user = String.valueOf(entity_data.get("crmuserId")); + form.add(new HiddenField("hidden_select_user", + new PropertyModel(this, "hidden_select_user"))); + //被辅导者 + int selected_userId = (int)entity_data.get("coacheeId"); + selected_user = DAOImpl.getCrmUserById(selected_userId).getName(); + form.add(new TextField("selected_user" ,new PropertyModel(this,"selected_user"))); + + + PopupSettings popupSettings = new PopupSettings("查找").setHeight(470) + .setWidth(850).setLeft(150).setTop(200); + PageParameters params = new PageParameters(); + params.set("mid", posId); + form.add(new BookmarkablePageLink("search_user_btn", SelectCRMUserPage.class,params ).setPopupSettings(popupSettings)); + //form.add(new HiddenField("hidden_select_user" ,new PropertyModel(this,"hidden_select_user"))); + //地址 + location = (String)entity_data.get("location"); + form.add(new TextField("location", new PropertyModel(this, + "location"))); + //评分一系列分数 + total_score = (int)entity_data.get("total_score"); + form.add(new TextField("total_score", new PropertyModel(this, + "total_score"))); + + planing.setId(((Number) entity_data.get("planing")) + .longValue()); + form.add(createDropDownListFromPickList("planing_input", + "score1_pl", null, new PropertyModel(this, + "planing"))); + openling.setId(((Number) entity_data.get("openling")) + .longValue()); + form.add(createDropDownListFromPickList("openling_input", + "score1_pl", null, new PropertyModel(this, + "openling"))); + enquery_listening.setId(((Number) entity_data.get("enquery_listening")) + .longValue()); + form.add(createDropDownListFromPickList("enquery_listening_input", + "score1_pl", null, new PropertyModel(this, + "enquery_listening"))); + deliverable.setId(((Number) entity_data.get("deliverable")) + .longValue()); + form.add(createDropDownListFromPickList("deliverable_input", + "score2_pl", null, new PropertyModel(this, + "deliverable"))); + objection_handing.setId(((Number) entity_data.get("objection_handing")) + .longValue()); + form.add(createDropDownListFromPickList("objection_handing_input", + "score2_pl", null, new PropertyModel(this, + "objection_handing"))); + summary.setId(((Number) entity_data.get("summary")) + .longValue()); + form.add(createDropDownListFromPickList("summary_input", + "score2_pl", null, new PropertyModel(this, + "summary"))); + owner = (String) entity_data.get("owner"); + form.add(new TextField("owner", new PropertyModel(this, + "owner"))); + Date createTime = (Date)entity_data.get("whenadded"); + whenadded = createTime.toString(); + form.add(new TextField("whenadded", new PropertyModel(this, + "whenadded"))); + act_name_input = (String) entity_data.get("title"); + + form.add(new TextField("act_name_input", new PropertyModel(this, + "act_name_input"))); + TextField modifier = new TextField("modifier", new PropertyModel(this,"modifier")); + modifier.add(new AttributeModifier("value",crmUser.getName())); + form.add(modifier); + //创建时间 + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式 + TextField modifier_time = new TextField("modifier_time", new PropertyModel(this,"modifier_time")); + modifier_time.add(new AttributeModifier("value",df.format(new Date()))); + form.add(modifier_time); + TextField statusField = new TextField("status", new PropertyModel(this,"status")); + form.add(statusField); + } + private DropDownChoice createDropDownListFromPickList(String markupId, + String picklistName, IModel choices, PropertyModel default_model) { + + if (choices == null) { + choices = Model.ofList(DAOImpl.queryPickList(picklistName)); + } + + return new DropDownChoice(markupId, default_model, choices, + new IChoiceRenderer() { + + @Override + public Object getDisplayValue(Choice choice) { + // TODO Auto-generated method stub + return choice.getVal(); + } + + @Override + public String getIdValue(Choice choice, int index) { + // TODO Auto-generated method stub + return String.valueOf(choice.getId()); + } + + }); + } + class SelectOption implements Serializable { + private int key; + private String value; + + public SelectOption(int key, String value) { + this.key = key; + this.value = value; + } + + public SelectOption() { + + } + + public int getKey() { + return key; + } + + public void setKey(int key) { + this.key = key; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + } +} diff --git a/crm/src/main/java/com/rex/crm/EventEditorPage.html b/crm/src/main/java/com/rex/crm/EventEditorPage.html new file mode 100755 index 0000000..9b285bf --- /dev/null +++ b/crm/src/main/java/com/rex/crm/EventEditorPage.html @@ -0,0 +1,149 @@ + + + + + + +
+
+
+ + +
+
+
+
+
活动名称:
+
+
+ +
+
+
+
+
拜访类型:
+
+
+ +
+
+
+
+ + +
拜访医生:
+
+
+ + + +
+
+
+ + +
+
拜访目的:
+
+
+ +
+
+
+ +
+
主推产品:
+
+
+ +
+
+
+
+
开始时间:
+
+
+
+ +
+
+
+
+
+
结束时间:
+
+
+
+ +
+
+
+
+ + + +
+
+
+ 保存&返回 +
+
+ 取消 +
+
+
+
+
+
+

提示信息

+
+
+
+ + diff --git a/crm/src/main/java/com/rex/crm/EventEditorPage.java b/crm/src/main/java/com/rex/crm/EventEditorPage.java new file mode 100644 index 0000000..55cce22 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/EventEditorPage.java @@ -0,0 +1,292 @@ +package com.rex.crm; + +import java.io.Serializable; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Map; + +import javax.servlet.ServletContext; + +import org.apache.log4j.Logger; +import org.apache.wicket.AttributeModifier; +import org.apache.wicket.Component; +import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior; +import org.apache.wicket.behavior.AttributeAppender; +import org.apache.wicket.extensions.markup.html.form.DateTextField; +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.ChoiceRenderer; +import org.apache.wicket.markup.html.form.DropDownChoice; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.HiddenField; +import org.apache.wicket.markup.html.form.IChoiceRenderer; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.link.BookmarkablePageLink; +import org.apache.wicket.markup.html.link.PopupSettings; +import org.apache.wicket.markup.html.list.AbstractItem; +import org.apache.wicket.markup.repeater.RepeatingView; +import org.apache.wicket.model.AbstractReadOnlyModel; +import org.apache.wicket.model.IModel; +import org.apache.wicket.model.Model; +import org.apache.wicket.model.PropertyModel; +import org.apache.wicket.protocol.http.WebApplication; +import org.apache.wicket.util.string.StringValue; +import org.apache.wicket.util.template.PackageTextTemplate; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.rex.crm.beans.Account; +import com.rex.crm.beans.Choice; +import com.rex.crm.beans.Contact; +import com.rex.crm.common.Entity; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.util.Configuration; + +/** + * @author Feiyun Zhou + */ +public class EventEditorPage extends TemplatePage { + + private static final Logger logger = Logger + .getLogger(EventEditorPage.class); + public Date startDate; + protected String endDate; + protected String endTime; + protected String startTime; + protected String hidden_contact_select; + protected String contact_name; + protected Choice visiting_purpose = new Choice(1L, ""); + protected Choice feature_product = new Choice(1L, ""); + ; + protected Choice activity_type = new Choice(1L, ""); + ; + protected String act_title_input = ""; + + /** + * Constructor + */ + public EventEditorPage(final long eventId) { + + Map entities = Configuration.getEntityTable(); + final Entity entity = entities.get("activity"); + setPageTitle(entity.getDisplay()); + //final String posId = ((SignIn2Session) getSession()).getPositionId(); + final String user = ((SignIn2Session) getSession()).getUser(); + + Map entity_data = DAOImpl.queryEntityById(entity.getSql_ent(), + String.valueOf(eventId)); + //add prompt + final RepeatingView div = new RepeatingView("promptDiv"); + final AbstractItem divitem = new AbstractItem(div.newChildId()); + final Label promptButton = new Label("promptButton","X"); + divitem.add(promptButton); + final Label promptLabel = new Label("prompt","红色输入框为必填项,请输入!"); + divitem.add(promptLabel); + div.add(new AttributeAppender("style",new Model("display:none"),";")); + divitem.add(new AttributeAppender("style",new Model("display:none"),";")); + div.add(divitem); + add(div); + Form form = new Form("form") { + @Override + protected void onSubmit() { + logger.debug("the form was submitted!"); + + // logger.debug("startDate:"+ startDate); + String sd = getRequest().getPostParameters() + .getParameterValue("start_date").toString(); + String ed = getRequest().getPostParameters() + .getParameterValue("end_date").toString(); + String visit_type = String.valueOf(activity_type.getId()); + SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm"); + Date act_endtime = new Date(System.currentTimeMillis()); + String sdt = sd; + String edt = ed; + Date startdt = null; + Date enddt = null; + int contactId = 0; + //标识 + boolean flag = true; + try { + startdt = dateformat.parse(sdt); + enddt = dateformat.parse(edt); + } catch (ParseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + logger.debug(String.format("time info %s %s", sd, ed)); + logger.debug("contact id:" + hidden_contact_select); + logger.debug("visit_type:" + visit_type); + logger.debug("usersereaser:" + user); + if(null==hidden_contact_select){ + contactId = 0; + }else{ + contactId = Integer.parseInt(hidden_contact_select); + } + if(contactId==0){ + div.add(new AttributeAppender("style",new Model("display:block"),";")); + divitem.add(new AttributeAppender("style",new Model("display:block"),";")); + promptLabel.add(new AttributeAppender("style",new Model("display:block"),";")); + promptButton.add(new AttributeAppender("style",new Model("display:block"),";")); + flag = false; + } + System.out.println("title:"+act_title_input); + try { + DAOImpl.updateCalendarEvent(String.valueOf(eventId), + hidden_contact_select, visit_type, act_title_input, + String.valueOf(startdt.getTime() / 1000),String.valueOf(enddt.getTime() / 1000), 1, user, + String.valueOf(visiting_purpose.getId()), + String.valueOf(feature_product.getId())); + + } catch (NumberFormatException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + setResponsePage(new EventViewerPage(String.valueOf(eventId))); + } + }; + add(form); + + StringValue startdateValue = this.getRequest().getRequestParameters().getParameterValue("startdate"); + + SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd"); + Date startDate = new Date( ((Number) entity_data.get("starttime")).longValue()); + String startdate = dateformat.format(startDate); + + logger.debug("startdate:" + startdate); + + WebMarkupContainer start_date_input = new WebMarkupContainer("start_date_input"); + // startDate = startdate; + // DateTextField start_date_input = new + // DateTextField("start_date_input", new + // PropertyModel(this,"startDate")); + form.add(start_date_input); + SimpleDateFormat timeformatter = new SimpleDateFormat("HH:mm"); + start_date_input.add(new AttributeModifier("value", startdate + "T" + timeformatter.format(startDate))); + + Date endDate = new Date(((Number) entity_data.get("endtime")).longValue()); + WebMarkupContainer end_date_input = new WebMarkupContainer("end_date_input"); + form.add(end_date_input); + end_date_input.add(new AttributeModifier("value", dateformat.format(endDate) + "T" + timeformatter.format(endDate))); + + PopupSettings popupSettings = new PopupSettings("查找").setHeight(470) + .setWidth(850).setLeft(150).setTop(200); + form.add(new BookmarkablePageLink("search_btn", + SearchContactPage.class).setPopupSettings(popupSettings)); + + hidden_contact_select = String.valueOf(entity_data.get("contactId")); + form.add(new HiddenField("hidden_contact_select", + new PropertyModel(this, "hidden_contact_select"))); + contact_name = String.valueOf(entity_data.get("cn")); + form.add(new TextField("contact_select", new PropertyModel( + this, "contact_name"))); + + IModel visiting_purpose_choices_model = new AbstractReadOnlyModel() { + @Override + public List getObject() { + List choices = new ArrayList(); + return DAOImpl.queryPickListByFilter( + "activity_visiting_purpose_pl", "activity_type", + String.valueOf(activity_type.getId())); + } + }; + + // visiting purpose choice + visiting_purpose.setId(((Number) entity_data.get("visiting_purpose")) + .longValue()); + final DropDownChoice visiting_purpose_choice = createDropDownListFromPickList( + "visiting_purpose_input", "com_visiting_purpose_pl", + visiting_purpose_choices_model, new PropertyModel(this, + "visiting_purpose")); + visiting_purpose_choice.setOutputMarkupId(true); + form.add(visiting_purpose_choice); + + // event type choice + activity_type.setId(((Number) entity_data.get("act_type")).longValue()); + DropDownChoice activity_type_choice = createDropDownListFromPickList( + "activity_type_input", "activity_activity_types_pl", null, + new PropertyModel(this, "activity_type")); + activity_type_choice.setOutputMarkupId(true); + form.add(activity_type_choice); + + activity_type_choice.add(new AjaxFormComponentUpdatingBehavior( + "onchange") { + private static final long serialVersionUID = 1L; + + @Override + protected void onUpdate(AjaxRequestTarget target) { + target.add(visiting_purpose_choice); + } + }); + + feature_product.setId(((Number) entity_data.get("feature_product")) + .longValue()); + form.add(createDropDownListFromPickList("feature_product_input", + "activity_feature_product_pl", null, new PropertyModel(this, + "feature_product"))); + act_title_input = (String) entity_data.get("title"); + form.add(new TextField("act_title_input", new PropertyModel(this, + "act_title_input"))); + + } + + private DropDownChoice createDropDownListFromPickList(String markupId, + String picklistName, IModel choices, PropertyModel default_model) { + + if (choices == null) { + choices = Model.ofList(DAOImpl.queryPickList(picklistName)); + } + + return new DropDownChoice(markupId, default_model, choices, + new IChoiceRenderer() { + @Override + public Object getDisplayValue(Choice choice) { + // TODO Auto-generated method stub + return choice.getVal(); + } + + @Override + public String getIdValue(Choice choice, int index) { + // TODO Auto-generated method stub + return String.valueOf(choice.getId()); + } + }); + } + + class SelectOption implements Serializable { + + private int key; + private String value; + + public SelectOption(int key, String value) { + this.key = key; + this.value = value; + } + + public SelectOption() { + } + + public int getKey() { + return key; + } + + public void setKey(int key) { + this.key = key; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + } +} diff --git a/crm/src/main/java/com/rex/crm/EventViewerPage.html b/crm/src/main/java/com/rex/crm/EventViewerPage.html new file mode 100755 index 0000000..2238443 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/EventViewerPage.html @@ -0,0 +1,94 @@ + + + + + + + +
+
+
+
+
+ + +
+
+
+ 返回 +
+
+ 编辑 +
+
+ +
+
+
+
+ 删除 +
+ +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+ + diff --git a/crm/src/main/java/com/rex/crm/EventViewerPage.java b/crm/src/main/java/com/rex/crm/EventViewerPage.java new file mode 100644 index 0000000..a1cfdca --- /dev/null +++ b/crm/src/main/java/com/rex/crm/EventViewerPage.java @@ -0,0 +1,308 @@ +package com.rex.crm; + +import java.io.Serializable; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import java.util.Map; + +import javax.servlet.ServletContext; + +import org.apache.log4j.Logger; +import org.apache.wicket.AttributeModifier; +import org.apache.wicket.extensions.markup.html.form.DateTextField; +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.ChoiceRenderer; +import org.apache.wicket.markup.html.form.DropDownChoice; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.HiddenField; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.model.Model; +import org.apache.wicket.model.PropertyModel; +import org.apache.wicket.protocol.http.WebApplication; +import org.apache.wicket.util.string.StringValue; +import org.apache.wicket.util.template.PackageTextTemplate; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.rex.crm.beans.Account; +import com.rex.crm.beans.CalendarEvent; +import com.rex.crm.beans.Contact; +import com.rex.crm.common.EditDataPage; +import com.rex.crm.common.Entity; +import com.rex.crm.common.EntityDetailPanel; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.util.Configuration; + + +/** + * @author Feiyun Zhou + */ +public class EventViewerPage extends TemplatePage +{ + + private static final Logger logger = Logger.getLogger(EventViewerPage.class); + public Date startDate; + protected String endDate; + protected String endTime; + protected String startTime; + protected String hidden_contact_select; + /** + * Constructor + */ + public EventViewerPage() + { + System.out.println("无参数"); + Map entities = Configuration.getEntityTable(); + Entity entity = entities.get("activity"); + setPageTitle(entity.getDisplay()); + final String posId = ((SignIn2Session)getSession()).getPositionId(); + final int roleId = ((SignIn2Session)getSession()).getRoleId(); + StringValue eventIdValue = this.getRequest().getRequestParameters().getParameterValue("eventid"); + //final long eventId + long eid = 0; + if(!eventIdValue.isEmpty() && !eventIdValue.isNull()){ + eid = eventIdValue.toLong(); + } + final long eventId = eid; + System.out.println("eventID:"+eventId); + Map map = DAOImpl.queryEntityById(entity.getSql_ent(), String.valueOf(eventId)); + //if the complete and edit button visible; + boolean write_btn_visible = true; + //get the event status + int status = 2; + if(map != null){ + Object st = map.get("act_status"); + status = ((Number)st).intValue(); + } + + if(status == 1){ + write_btn_visible =true; + }else{ + write_btn_visible =false; + } + + if (map != null) { + int eventType = ((Number) map.get("event_type")).intValue(); + logger.debug("eventType:"+eventType); + if (eventType == 2 && roleId == 3) { + // for the sales rep, no permission to edit the coaching event + write_btn_visible = false; + } + } + + Form form = new Form("form"){ + @Override + protected void onSubmit() + { + //update status of calenderEvent mark it to be completed + Date act_end_datetime = new Date(); + DAOImpl.updateStatusOfCalendarEvent((int)eventId, 2,act_end_datetime); + setResponsePage(PageFactory.createPage("calendar")); + + } + }; + add(form); + int eventType = 0; + if(map != null){ + eventType = ((Number) map.get("event_type")).intValue(); + logger.debug("eventType:"+eventType); + } + final int event_type = eventType; + System.out.println("event_type:"+eventType); + Link edit_event_btn = new Link("edit_event_btn") { + @Override + public void onClick() { + //判断活动类型 + if(event_type==1){ + setResponsePage(new EventEditorPage(eventId)); + }else{ + setResponsePage(new EventCoachEditorPage(eventId)); + } + + } + }; + edit_event_btn.setVisible(write_btn_visible); + form.addOrReplace(edit_event_btn); + + Link delete_event_btn = new Link("delete_event_btn") { + + @Override + public void onClick() { + DAOImpl.deleteRecord( String.valueOf(eventId), "activity"); + setResponsePage(PageFactory.createPage("calendar")); + } + }; + delete_event_btn.setVisible(write_btn_visible); + form.addOrReplace(delete_event_btn); + if(map!= null){ + //获取当前时间 + Date currentDate = new Date(); + logger.debug("currentDate:"+currentDate);; + //获取开始时间 + Date startDate = new Date(((Number)map.get("starttime")).longValue()); + logger.debug("startDate:"+startDate); + //如果两个时间比较大于0则开始时间大于当前时间 + if(startDate.compareTo(currentDate)>0){ + logger.debug("计划时间晚于当前时间"); + write_btn_visible = false; + } + } + WebMarkupContainer complete_btn = new WebMarkupContainer("complete_btn"); + complete_btn.setVisible(write_btn_visible); + form.add(complete_btn); + + // List events = DAOImpl.getEventsByUserId(Integer.parseInt(uid)); + logger.debug("eventID is:"+ eventId); + + //add(new Label("name",String.valueOf(map.get("name")))); + add(new EntityDetailPanel("detailed",entity,map,String.valueOf(eventId),1,"calendar")); + } + + public EventViewerPage(String id) + { + System.out.println("id:"+id); + Map entities = Configuration.getEntityTable(); + final Entity entity = entities.get("activity"); + setPageTitle(entity.getDisplay()); + final int roleId = ((SignIn2Session)getSession()).getRoleId(); + final int eventId = Integer.parseInt(id); + logger.debug("entity"+entity); + Map map = DAOImpl.queryEntityById(entity.getSql_ent(), String.valueOf(eventId)); + logger.debug("entity.getSql_ent()"+entity.getSql_ent()); + //if the complete and edit button visible; + boolean write_btn_visible = true; + //get the event status + int status = 2; + + if(map != null){ + Object st = map.get("act_status"); + status = ((Number)st).intValue(); + } + + if(status == 1){ + write_btn_visible =true; + }else{ + write_btn_visible =false; + } + + if (map != null) { + int eventType = ((Number) map.get("event_type")).intValue(); + if (eventType == 2 && roleId == 3) { + // for the sales rep, no permission to edit the coaching event + write_btn_visible = false; + } + }// logger.debug("roleId" + roleId); + + Form form = new Form("form"){ + @Override + protected void onSubmit() + { + //update status of calenderEvent mark it to be completed + Date act_end_datetime = new Date(); + DAOImpl.updateStatusOfCalendarEvent((int)eventId, 2,act_end_datetime); + if(entity.getName().equals("activity")){ + setResponsePage(new ActivityPage()); + }else{ + setResponsePage(PageFactory.createPage("calendar")); + } + } + }; + add(form); + int eventType = 0; + if(map != null){ + eventType = ((Number) map.get("event_type")).intValue(); + logger.debug("eventType:"+eventType); + } + final int event_type = eventType; + System.out.println("event_type:"+eventType); + Link edit_event_btn = new Link("edit_event_btn") { + + @Override + public void onClick() { + if(event_type==1){ + setResponsePage(new EventEditorPage(eventId)); + }else{ + setResponsePage(new EventCoachEditorPage(eventId)); + } + } + }; + edit_event_btn.setVisible(write_btn_visible); + form.addOrReplace(edit_event_btn); + + Link delete_event_btn = new Link("delete_event_btn") { + + @Override + public void onClick() { + + DAOImpl.deleteRecord( String.valueOf(eventId), "activity"); + if(entity.getName().equals("activity")){ + setResponsePage(new ActivityPage()); + }else{ + setResponsePage(PageFactory.createPage("calendar")); + } + } + }; + delete_event_btn.setVisible(write_btn_visible); + form.addOrReplace(delete_event_btn); + if(map!= null){ + //获取当前时间 + Date currentDate = new Date(); + logger.debug("currentDate:"+currentDate);; + //获取开始时间 + Date startDate = new Date(((Number)map.get("starttime")).longValue()); + logger.debug("startDate:"+startDate); + //如果两个时间比较大于0则开始时间大于当前时间 + if(startDate.compareTo(currentDate)>0){ + logger.debug("计划时间晚于当前时间"); + write_btn_visible = false; + } + } + WebMarkupContainer complete_btn = new WebMarkupContainer("complete_btn"); + complete_btn.setVisible(write_btn_visible); + form.add(complete_btn); + + // List events = DAOImpl.getEventsByUserId(Integer.parseInt(uid)); + logger.debug("eventID is:"+ eventId); + + //add(new Label("name",String.valueOf(map.get("name")))); + add(new EntityDetailPanel("detailed",entity,map,String.valueOf(eventId),1,"calendar")); + + + } + + class SelectOption implements Serializable{ + private int key; + private String value; + + public SelectOption(int key, String value) { + this.key = key; + this.value = value; + } + public SelectOption() { + + } + + public int getKey() { + return key; + } + + public void setKey(int key) { + this.key = key; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + } +} + + + diff --git a/crm/src/main/java/com/rex/crm/FolderResource.java b/crm/src/main/java/com/rex/crm/FolderResource.java new file mode 100644 index 0000000..bbe2d5a --- /dev/null +++ b/crm/src/main/java/com/rex/crm/FolderResource.java @@ -0,0 +1,38 @@ +package com.rex.crm; + +import java.io.File; +import java.io.IOException; + +import org.apache.log4j.Logger; +import org.apache.wicket.request.mapper.parameter.PageParameters; +import org.apache.wicket.request.resource.IResource; +import org.apache.wicket.request.resource.ResourceStreamResource; +import org.apache.wicket.util.resource.FileResourceStream; +import org.apache.wicket.util.resource.IResourceStream; + +public class FolderResource implements IResource { + private static final Logger logger = Logger.getLogger(FolderResource.class); + private final File rootFolder; + + public FolderResource(File rootFolder) { + this.rootFolder = rootFolder; + } + + @Override + public void respond(Attributes attributes) { + PageParameters parameters = attributes.getParameters(); + logger.debug(parameters.getNamedKeys()); + String fileName = parameters.get(0).toString(); + File file = new File(rootFolder, fileName); + try { + logger.debug("file:"+file.getCanonicalPath()); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + FileResourceStream fileResourceStream = new FileResourceStream(file); + ResourceStreamResource resource = new ResourceStreamResource(fileResourceStream); + resource.respond(attributes); + + } +} \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/HomePage.html b/crm/src/main/java/com/rex/crm/HomePage.html new file mode 100644 index 0000000..f302ad6 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/HomePage.html @@ -0,0 +1,79 @@ + + + + + + +
+
+
+ +
+
全局搜索
+ +
+ + + +
+
快速创建
+ +
+ +
+
+ +
+
+
+
+ data table +
+
+
+
+ + + +
+
+
+
+ data table +
+
+
+
+ +
+ + + +
+ + \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/HomePage.java b/crm/src/main/java/com/rex/crm/HomePage.java new file mode 100644 index 0000000..9bcd19f --- /dev/null +++ b/crm/src/main/java/com/rex/crm/HomePage.java @@ -0,0 +1,335 @@ +package com.rex.crm; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.wicket.AttributeModifier; +import org.apache.wicket.behavior.AttributeAppender; +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.ChoiceRenderer; +import org.apache.wicket.markup.html.form.DropDownChoice; +import org.apache.wicket.markup.html.form.IChoiceRenderer; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.link.BookmarkablePageLink; +import org.apache.wicket.model.IModel; +import org.apache.wicket.model.Model; +import org.apache.wicket.request.mapper.parameter.PageParameters; + +import com.rex.crm.beans.CRMUser; +import com.rex.crm.beans.Choice; +import com.rex.crm.common.CreateDataPage; +import com.rex.crm.common.Entity; +import com.rex.crm.common.Field; +import com.rex.crm.common.PageableTablePanel; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.db.DBHelper; +import com.rex.crm.reporter.ReportingTablePanel; +import com.rex.crm.reporter.VisitingReporter; +import com.rex.crm.util.Configuration; +import com.rexen.crm.beans.UserRole; + +import java.sql.Connection; + +import org.apache.commons.dbutils.QueryRunner; +import org.apache.commons.dbutils.handlers.MapHandler; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.model.PropertyModel; + +public class HomePage extends TemplatePage { + private static final long serialVersionUID = 1L; + private String search_target = "";//add + private final Map models = Maps.newHashMap(); + public static long getNumOfAccountOfUser(String userId) { + long size = 0; + Connection conn = null; + String sql = "select count(distinct account.id) as num_of_account from " + + "accountcrmuser,account where accountcrmuser.crmuserId=? AND account.id=accountcrmuser.accountId"; + try { + QueryRunner run = new QueryRunner(); + conn = DBHelper.getConnection(); + Map map = run.query(conn, sql, new MapHandler(), userId); + size = (long) map.get("num_of_account"); + } catch (Exception e) { + + } finally { + DBHelper.closeConnection(conn); + } + + return size; + } + + + public HomePage() { + super(); + setPageTitle("主页"); + + final String posId = ((SignIn2Session)getSession()).getPositionId(); + final int roleId = ((SignIn2Session)getSession()).getRoleId(); + + // 业务概览注释 +// add(new Label("num_of_account_cell",DAOImpl.getNumOfAccountOfUser(posId))); +// add(new Label("num_of_contact_cell",DAOImpl.getNumOfContactOfUser(posId))); +// add(new Label("num_of_activity_cell",DAOImpl.getNumOfActivityOfUser(posId))); +// +// BookmarkablePageLink contact_link = new BookmarkablePageLink("contact_link", ContactPage.class); +// add(contact_link); +// BookmarkablePageLink account_link = new BookmarkablePageLink("account_link", AccountPage.class); +// add(account_link); +// BookmarkablePageLink activity_link = new BookmarkablePageLink("activity_link", CalendarPage.class); +// add(activity_link); +// + + + //quick creation bar + PageParameters param = new PageParameters(); + param.add("entityName", "contact"); + BookmarkablePageLink contact_create_link = new BookmarkablePageLink("contact_create_link", CreateDataPage.class,param ); + add(contact_create_link); + + WebMarkupContainer userInfo_create_li = new WebMarkupContainer("userInfo_create_li"); + param = new PageParameters(); + param.set("entityName", "userinfo"); + BookmarkablePageLink userInfo_create_link = new BookmarkablePageLink("userInfo_create_link", CreateDataPage.class,param); + userInfo_create_li.setVisible(false); + userInfo_create_li.add(userInfo_create_link); + add(userInfo_create_li); + + if(roleId == 1){ + userInfo_create_li.setVisible(true); + } + + /* param = new PageParameters(); + param.add("entityName", "activity"); + BookmarkablePageLink activity_create_link = new BookmarkablePageLink("activity_create_link", CreateDataPage.class,param); + add(activity_create_link);*/ + + + WebMarkupContainer activity_create_li = new WebMarkupContainer("activity_create_li"); + param = new PageParameters(); + param.set("en", "contact"); + param.set("excludeName", "activity"); + param.set("target",-1); + BookmarkablePageLink activity_create_link = new BookmarkablePageLink("activity_create_link", SelectActivityContactPage.class,param); + activity_create_li.setVisible(false); + activity_create_li.add(activity_create_link); + add(activity_create_li); + + if(roleId == 3){ + activity_create_li.setVisible(true); + } + + + WebMarkupContainer coaching_create_li = new WebMarkupContainer("coaching_create_li"); + param = new PageParameters(); + param.add("entityName", "coaching"); + BookmarkablePageLink coaching_create_link = new BookmarkablePageLink("coaching_create_link", ActivitySelectPage.class,param); + coaching_create_li.setVisible(false); + coaching_create_li.add(coaching_create_link); + add(coaching_create_li); + + if(roleId == 2){ + coaching_create_li.setVisible(true); + } + + WebMarkupContainer account_create_li = new WebMarkupContainer("account_create_li"); + param = new PageParameters(); + param.add("entityName", "account"); + BookmarkablePageLink account_create_link = new BookmarkablePageLink("account_create_link", CreateDataPage.class,param); + account_create_li.setVisible(false); + account_create_li.add(account_create_link); + add(account_create_li); + + if(roleId == 1){ + account_create_li.setVisible(true); + } + + WebMarkupContainer position_create_li = new WebMarkupContainer("position_create_li"); + param = new PageParameters(); + param.add("entityName", "crmuser"); + BookmarkablePageLink position_create_link = new BookmarkablePageLink("position_create_link", CreateDataPage.class,param); + position_create_li.setVisible(false); + position_create_li.add(position_create_link); + add(position_create_li); + + if(roleId == 1){ + position_create_li.setVisible(true); + } + + + + + Map entities = Configuration.getEntityTable(); + final Entity entity = entities.get("alert"); + final String positionId = ((SignIn2Session) getSession()).getPositionId(); + List entitys = Configuration.getEntities(); + + + IModel selected_model = new Model(new Choice(0l,"account")); + List entityChoice = new ArrayList(); + final Map entityList = new HashMap(); + for(Entity entityName :entitys){ + if(entityName.isGlobalsearch()){ + Choice choice =new Choice(); + choice.setVal(entityName.getDisplay()); + choice.setName(entityName.getName()); + entityChoice.add(choice); + entityList.put(String.valueOf(entityName.getName()), entityName); + } + } + TextField search_input = new TextField("search_input", new PropertyModel(this, "search_target")); + DropDownChoice search_select = new DropDownChoice("search_select",selected_model,entityChoice, new IChoiceRenderer() { + @Override + public Object getDisplayValue(Choice choice) { + // TODO Auto-generated method stub + return choice.getVal(); + } + @Override + public String getIdValue(Choice choice, int index) { + // TODO Auto-generated method stub + return String.valueOf(choice.getName()); + } + + + }); + models.put("entityName", selected_model); + search_select.setNullValid(false); + + Form form = new Form("form") + { + + @Override + protected void onSubmit() + { + String entityName = String.valueOf(((Choice) models.get("entityName").getObject()).getName()); + Entity en = entityList.get(entityName); + String sql = en.getSql(); + switch (roleId) + { + case UserRole.USER_ROLE_MANAGER: + sql = en.getSqlManager(); + break; + case UserRole.USER_ROLE_SALES: + sql = en.getSql(); + break; + case UserRole.USER_ROLE_ADMINISTRATOR: + sql = en.getSqlAdmin(); + System.err.print(sql); + } + search_target = (search_target == null || search_target.equalsIgnoreCase("*")) ? "" : search_target; + + List searchableFields = en.getSearchableFields(); + String joint = " like '%" + search_target + "%'"; + String likequery = ""; + for (Field sf : searchableFields) + { + likequery = likequery + " OR " + sf.getName() + joint; + } + if(en.getName().equalsIgnoreCase("coaching")||en.getName().equalsIgnoreCase("activity")||en.getName().equalsIgnoreCase("willcoaching")){ + sql = sql + " where title like '%" + search_target + "%' " + likequery; + } else{ + sql = sql + " where name like '%" + search_target + "%' " + likequery; + } + System.out.println(sql); + List datalist = null; + + switch (roleId) + { + case UserRole.USER_ROLE_MANAGER: + + if(en.getName().equalsIgnoreCase("account")){ + datalist = DAOImpl.queryEntityRelationList(sql, positionId, positionId,positionId); + }else if(en.getName().equalsIgnoreCase("contact")){ + datalist = DAOImpl.queryEntityRelationList(sql,positionId); + }else if(en.getName().equalsIgnoreCase("coaching")||en.getName().equalsIgnoreCase("activity")||en.getName().equalsIgnoreCase("willcoaching")){ + datalist = DAOImpl.queryEntityRelationList(sql,positionId,positionId); + } + break; + case UserRole.USER_ROLE_SALES: + if(en.getName().equalsIgnoreCase("account")){ + datalist = DAOImpl.queryEntityRelationList(sql, positionId,positionId); + }else if(en.getName().equalsIgnoreCase("coaching")||en.getName().equalsIgnoreCase("activity") + ||en.getName().equalsIgnoreCase("willcoaching")||en.getName().equalsIgnoreCase("contact")){ + datalist = DAOImpl.queryEntityRelationList(sql,positionId); + } + break; + case UserRole.USER_ROLE_ADMINISTRATOR: + datalist = DAOImpl.queryEntityRelationList(sql); + System.err.print(sql); + } + + if(entityName.equals("account")){ + setResponsePage(new AccountPage(datalist)); + }else if(entityName.equals("contact")){ + setResponsePage(new ContactPage(datalist)); + }else if(entityName.equals("activity")){ + setResponsePage(new ActivityPage(datalist)); + }else if(entityName.equals("coaching")){ + setResponsePage(new CoachingPage(datalist)); + }else if(entityName.equals("willcoaching")){ + setResponsePage(new CoachingPage(datalist)); + } + + } + + }; +// ChoiceRenderer choiceRenderer = new ChoiceRenderer("name","URL"); + + add(form); + form.add(search_select); + form.add(search_input); + + + String sql = ""; + + switch (roleId) + { + case 1: + sql = "SELECT * from alert where expired > now() and publishDate < now() ORDER BY whenadded DESC"; + break; + case 2: + sql = entity.getSqlManager(); + break; + case 3: + sql = entity.getSql(); + break; + } + List tdata = null; + //获取登录用户的positonID,从而获取crmuser获取大区 + if(((SignIn2Session)getSession()).getRoleId()!=1){ + CRMUser user = DAOImpl.getCrmUserById(((SignIn2Session)getSession()).getPositionId()); + tdata = DAOImpl.queryEntityRelationList(sql,String.valueOf(user.getPl5())); + }else{ + tdata = DAOImpl.queryEntityRelationList(sql); + } + add(new PageableTablePanel("datalist", entity, tdata, null)); + System.out.println("ds:"+((SignIn2Session)getSession()).getRoleId()); + + if(((SignIn2Session)getSession()).getRoleId()==3){ + final Entity entityAct = entities.get("todolist"); + String userName = ((SignIn2Session) getSession()).getUser(); + String sql2="SELECT * FROM crmdb.activity_alert where name='"+userName+"'"; + List tdataAct = DAOImpl.queryEntityRelationList(sql2); + //Entity Fordetail = entities.get("activity"); + add(new PageableTablePanel("datalistAct", entityAct, tdataAct, null)); + }else if(((SignIn2Session)getSession()).getRoleId()==2){ + final Entity entityAct = entities.get("todolistcoach"); + String userName = ((SignIn2Session) getSession()).getUser(); + String sql2="SELECT * FROM crmdb.activity_alert where name='"+userName+"'"; + List tdataAct = DAOImpl.queryEntityRelationList(sql2); + //Entity Fordetail = entities.get("activity"); + add(new PageableTablePanel("datalistAct", entityAct, tdataAct, null)); + } + else{ + WebMarkupContainer container_label = new WebMarkupContainer("datalistAct"); + container_label.setVisible(false); + add( container_label); + } + + } +} diff --git a/crm/src/main/java/com/rex/crm/NullPosition.html b/crm/src/main/java/com/rex/crm/NullPosition.html new file mode 100644 index 0000000..89f7933 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/NullPosition.html @@ -0,0 +1,11 @@ + + + 登出 + + + +

您暂时没有岗位,请联系管理员为您分配岗位!

+

再见!

+ 回主页 + + diff --git a/crm/src/main/java/com/rex/crm/NullPosition.java b/crm/src/main/java/com/rex/crm/NullPosition.java new file mode 100644 index 0000000..ad8527b --- /dev/null +++ b/crm/src/main/java/com/rex/crm/NullPosition.java @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rex.crm; + +import org.apache.wicket.markup.html.WebPage; +import org.apache.wicket.request.mapper.parameter.PageParameters; + +public class NullPosition extends WebPage +{ + public NullPosition(final PageParameters parameters) + { + + getSession().invalidate(); + } +} diff --git a/crm/src/main/java/com/rex/crm/PageFactory.java b/crm/src/main/java/com/rex/crm/PageFactory.java new file mode 100644 index 0000000..cfcc8ec --- /dev/null +++ b/crm/src/main/java/com/rex/crm/PageFactory.java @@ -0,0 +1,55 @@ +package com.rex.crm; + +import org.apache.wicket.Page; + +import com.rex.crm.admin.PositionPage; +import com.rex.crm.admin.ProductPage; +import com.rex.crm.admin.ProductTreePage; +import com.rex.crm.admin.UserPage; +import com.rex.crm.common.EntityDetailPage; + +public class PageFactory { + + public static Page createPage(String name){ + if(name.equalsIgnoreCase("account")){ + return new AccountPage(); + }else if(name.equalsIgnoreCase("contact")){ + return new ContactPage(); + }else if(name.equalsIgnoreCase("calendar")){ + return new CalendarPage(); + }else if(name.equalsIgnoreCase("activity")){ + return new ActivityPage(); + }else if(name.equalsIgnoreCase("crmuser")){ + return new PositionPage(); + }else if(name.equalsIgnoreCase("coaching")||name.equalsIgnoreCase("willCoaching")){ + return new CoachingPage(); + }else if(name.equalsIgnoreCase("userInfo")){ + return new UserPage(); + }else if(name.equalsIgnoreCase("alert")){ + return new AlertPage(); + }else if(name.equalsIgnoreCase("productline")||name.equalsIgnoreCase("product")||name.equalsIgnoreCase("productcategory")){ + return new ProductPage(); + }else if(name.equalsIgnoreCase("province")||name.equalsIgnoreCase("city")){ + return new AreaPage(); + } + else{ + return new HomePage(); + } + } + public static Page createPageToDetail(String EntityName,String id){ + return new EntityDetailPage(EntityName,id); + } + public static Page createPageTree(String EntityName,String id){ + + return new ProductTreePage(id,EntityName); + } + + /** + * @param args + */ + public static void main(String[] args) { + // TODO Auto-generated method stub + + } + +} diff --git a/crm/src/main/java/com/rex/crm/SearchCRMUserPage.html b/crm/src/main/java/com/rex/crm/SearchCRMUserPage.html new file mode 100755 index 0000000..4e8227b --- /dev/null +++ b/crm/src/main/java/com/rex/crm/SearchCRMUserPage.html @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + +
+
+ + + +
+
+ + +
+ 全选 + +
+
+
+
+ +
+
+
+
+
+ +
+
+
+ + +
+
+
+
+ + diff --git a/crm/src/main/java/com/rex/crm/SearchCRMUserPage.java b/crm/src/main/java/com/rex/crm/SearchCRMUserPage.java new file mode 100755 index 0000000..d1098cf --- /dev/null +++ b/crm/src/main/java/com/rex/crm/SearchCRMUserPage.java @@ -0,0 +1,226 @@ +package com.rex.crm; + +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.ajax.markup.html.form.AjaxButton; +import org.apache.wicket.behavior.AttributeAppender; +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.WebPage; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.Check; +import org.apache.wicket.markup.html.form.CheckGroup; +import org.apache.wicket.markup.html.form.CheckGroupSelector; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.list.AbstractItem; +import org.apache.wicket.markup.repeater.RepeatingView; +import org.apache.wicket.model.Model; +import org.apache.wicket.model.PropertyModel; +import org.apache.wicket.request.mapper.parameter.PageParameters; +import org.apache.wicket.util.string.StringValue; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.rex.crm.beans.Contact; +import com.rex.crm.common.EntityDetailPage; +import com.rex.crm.common.Field; +import com.rex.crm.common.NewDataFormPanel; +import com.rex.crm.db.DAOImpl; +import org.apache.wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigator; +import org.apache.wicket.markup.html.list.ListItem; +import org.apache.wicket.markup.html.list.PageableListView; + +/** + * + * + * @author Feiyun + */ +public class SearchCRMUserPage extends WebPage { + + private static final Logger logger = Logger.getLogger(SearchCRMUserPage.class); + private String search_target; + List selectedUserIds = Lists.newArrayList(); + private String entityId; + private String uid; +// private String entityName; + private int type = 0; + + /** + * Constructor + * + * @param parameters Page parameters (ignored since this is the home page) + */ + public SearchCRMUserPage() { + StringValue value = this.getRequest().getRequestParameters().getParameterValue("cid"); + StringValue entityname = getRequest().getRequestParameters().getParameterValue("entityname"); + StringValue postId = this.getRequest().getRequestParameters().getParameterValue("positionId"); + + if (value != null) { + entityId = value.toString(); + } + if(postId != null){ + uid = postId.toString(); + } + initPage(entityname.toString(), null, entityId,uid, type); + } + public SearchCRMUserPage(String entityName, final String entityId, String uid, int type) { + //logger.debug("sdfsfsdfdsf:"+entityName); + this.entityId = entityId; + this.type = type; + this.uid=uid; + initPage(entityName, null, entityId,uid, type); + } + + public SearchCRMUserPage(List maplist, String entityName, final String entityId, String uid,int type) { + this.entityId = entityId; + this.type = type; + this.uid = uid; + initPage(entityName, maplist, entityId,uid, type); + } + + public void initPage(final String entityname, List list, final String entityId, final String uid, final int type) { + Form form = new Form("form") { + @SuppressWarnings("unchecked") + @Override + protected void onSubmit() { + logger.debug("the form was submitted!"); + List maplist = null; + + if (entityname.equals("account") || entityname.equals("contact")) { + maplist = DAOImpl.searchCRMUser(search_target); + }else if(entityname.equals("userinfo")){ + maplist = DAOImpl.searchUserPosition(uid,search_target); + }else { + if (type == 0||type==4) { + maplist = DAOImpl.searchCRMAccount(search_target); + }else if (type == 1) { + maplist = DAOImpl.searchCRMContact(search_target); + }else if(type == 2){ + maplist = DAOImpl.searchUser(search_target); + } else{ + maplist = DAOImpl.searchCRMUser(search_target); + } + } + + + setResponsePage(new SearchCRMUserPage(maplist, entityname, entityId,uid, type)); + + } + }; + form.add(new TextField("search_input", new PropertyModel(this, "search_target"))); + add(form); + + + + + Form users_sbumission_form = new Form("users_sbumission_form"); + + users_sbumission_form.add(new AjaxButton("ajax-button", users_sbumission_form) + { + @Override + protected void onSubmit(AjaxRequestTarget target, Form form) + { + logger.debug("seletedUserIds:" + selectedUserIds); + for (String positionId : selectedUserIds) { + try { + DAOImpl.insertRelationOfEntityIDCRMUserID(entityname, entityId,positionId ,type); + + } catch (Exception e) { + + } + } + + target.appendJavaScript(" window.opener.location.href='./EntityDetailPage?entityName="+entityname+"&id="+entityId+"'; window.close();"); + } + + @Override + protected void onError(AjaxRequestTarget target, Form form) + { + // repaint the feedback panel so errors are shown + //target.add(feedback); + } + }); + + final int roleId = ((SignIn2Session) getSession()).getRoleId(); + add(users_sbumission_form); + CheckGroup group = new CheckGroup("group", new PropertyModel(this, "selectedUserIds")); + if (roleId == 1) { + CheckGroupSelector chks = new CheckGroupSelector("checkboxs"); + group.add(chks); + WebMarkupContainer container_label = new WebMarkupContainer("checkboxs_label"); + group.add(container_label); + container_label.add(new AttributeAppender("for", new Model(chks.getMarkupId()), " ")); + } else { + WebMarkupContainer container = new WebMarkupContainer("checkboxs"); + container.setVisible(false); + group.add(container); + } + users_sbumission_form.add(group); + + + + + // RepeatingView dataRowRepeater = new RepeatingView("dataRowRepeater"); + // group.add(dataRowRepeater); + + + + + + + //初始化的时候查不出数据 + if (list == null) { + list=DAOImpl.queryEntityRelationList("Select * from account where 1=0"); + } + + final Map tableData = Maps.newHashMap(); + List ids = Lists.newArrayList(); + for (Map map : (List) list) { + String key = String.valueOf(map.get("id")); + ids.add(key); + tableData.put(key, map); + } + + final PageableListView listview = new PageableListView("dataRowRepeater", ids, 20) { + + @Override + protected void populateItem(ListItem item) { + String key = item.getDefaultModelObjectAsString(); + Map map = tableData.get(key); + + + + int positionId = ((Number) map.get("id")).intValue(); + String name = (String) map.get("name"); + String cellPhone = (String) map.get("cellPhone"); + String email = (String) map.get("email"); + // AbstractItem item = new AbstractItem(dataRowRepeater.newChildId()); + // dataRowRepeater.add(item); + Check chk = new Check("checkbox", new Model(String.valueOf(positionId))); + item.add(chk); + WebMarkupContainer container_label = new WebMarkupContainer("checkboxs_label"); + item.add(container_label); + container_label.add(new AttributeAppender("for", new Model(chk.getMarkupId()), " ")); + item.add(new Label("name", name)); + item.add(new Label("cellPhone", cellPhone)); + item.add(new Label("email", email)); + + } + }; + group.add(listview); + AjaxPagingNavigator nav =new AjaxPagingNavigator("navigator", listview); + nav.setOutputMarkupId(true); + + group.setOutputMarkupId(true); + group.setRenderBodyOnly(false); + + group.add(nav); + + group.setVersioned(false); + + + } +} diff --git a/crm/src/main/java/com/rex/crm/SearchContactPage.html b/crm/src/main/java/com/rex/crm/SearchContactPage.html new file mode 100755 index 0000000..5775464 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/SearchContactPage.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ +
+
+
+
+ + diff --git a/crm/src/main/java/com/rex/crm/SearchContactPage.java b/crm/src/main/java/com/rex/crm/SearchContactPage.java new file mode 100755 index 0000000..2ea217a --- /dev/null +++ b/crm/src/main/java/com/rex/crm/SearchContactPage.java @@ -0,0 +1,85 @@ +package com.rex.crm; + +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.apache.wicket.behavior.AttributeAppender; +import org.apache.wicket.markup.html.WebPage; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.list.AbstractItem; +import org.apache.wicket.markup.repeater.RepeatingView; +import org.apache.wicket.model.Model; +import org.apache.wicket.model.PropertyModel; +import org.apache.wicket.request.mapper.parameter.PageParameters; + +import com.google.common.collect.Lists; +import com.rex.crm.beans.Contact; +import com.rex.crm.common.NewDataFormPanel; +import com.rex.crm.db.DAOImpl; + +/** + * + * + * @author Feiyun + */ +public class SearchContactPage extends WebPage { + private static final Logger logger = Logger.getLogger(SearchContactPage.class); + + private String search_target; + + /** + * Constructor + * + * @param parameters + * Page parameters (ignored since this is the home page) + */ + public SearchContactPage() { + initPage(null); + } + + public SearchContactPage(List maplist) { + initPage(maplist); + } + + public void initPage(List list) { + final String posId = ((SignIn2Session) getSession()).getPositionId(); + Form form = new Form("form") { + @Override + protected void onSubmit() { + logger.debug("the form was submitted!"); + // new PropertyModel(this, "selected") + List maplist = DAOImpl.searchContact(posId, search_target); + setResponsePage(new SearchContactPage(maplist)); + + } + }; + form.add(new TextField("search_input", new PropertyModel(this, "search_target"))); + add(form); + + RepeatingView dataRowRepeater = new RepeatingView("dataRowRepeater"); + add(dataRowRepeater); + + if (list != null) { + for (Map map : list) { + int cid = ((Number) map.get("cid")).intValue(); + String cname = (String) map.get("cname"); + String aname = (String) map.get("aname"); + System.out.println(cname); + AbstractItem item = new AbstractItem(dataRowRepeater.newChildId()); + dataRowRepeater.add(item); + Label cap = new Label("cname_span", new Model(cname)); + item.add(new AttributeAppender("data-cid",new Model(cid))); + item.add(new AttributeAppender("data-cname",new Model(cname))); + item.add(new AttributeAppender("data-aname",new Model(aname))); + //item.add(new AttributeAppender("data-cname", new Model(cname))); + item.add(cap); + item.add(new Label("aname_span", new Model(aname))); + + + } + } + } +} diff --git a/crm/src/main/java/com/rex/crm/SelectActivityContactPage.html b/crm/src/main/java/com/rex/crm/SelectActivityContactPage.html new file mode 100644 index 0000000..5189bb4 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/SelectActivityContactPage.html @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
    +
  • + +
  • +
  • + +
  • +
+
+
+
+
+
+ + diff --git a/crm/src/main/java/com/rex/crm/SelectActivityContactPage.java b/crm/src/main/java/com/rex/crm/SelectActivityContactPage.java new file mode 100644 index 0000000..425cd56 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/SelectActivityContactPage.java @@ -0,0 +1,240 @@ +package com.rex.crm; + +import com.google.common.collect.Lists; +import java.text.SimpleDateFormat; +import java.util.Collections; +import java.util.Comparator; +import java.util.Date; +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.apache.wicket.behavior.AttributeAppender; +import org.apache.wicket.markup.html.WebPage; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.markup.html.list.AbstractItem; +import org.apache.wicket.markup.repeater.RepeatingView; +import org.apache.wicket.model.Model; +import org.apache.wicket.model.PropertyModel; + +import com.google.common.collect.Maps; +import com.rex.crm.common.CreateDataPage; +import com.rex.crm.common.Entity; +import com.rex.crm.common.Field; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.util.Configuration; +import org.apache.wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigator; +import org.apache.wicket.markup.html.list.ListItem; +import org.apache.wicket.markup.html.list.PageableListView; + +public class SelectActivityContactPage extends WebPage { + private static final Logger logger = Logger.getLogger(SelectActivityContactPage.class); + + private static String search_target; + final String posId = ((SignIn2Session) getSession()).getPositionId(); + final String userId = ((SignIn2Session) getSession()).getUserId(); + final int roleId = ((SignIn2Session) getSession()).getRoleId(); + final Map entities = Configuration.getEntityTable(); + Entity entity = null; + public SelectActivityContactPage(){ + String relationTableName = getRequest().getRequestParameters().getParameterValue("en").toString(); + String tragetEntity = getRequest().getRequestParameters().getParameterValue("excludeName").toString(); + final String excludeId = getRequest().getRequestParameters().getParameterValue("eid").toString(); + String target = getRequest().getRequestParameters().getParameterValue("target").toString(); + entity = entities.get(relationTableName); + + List maplist = selectConatct(tragetEntity,roleId,posId,entity,entities ); + initPage(maplist,relationTableName,tragetEntity,excludeId,target); + // setResponsePage(new SelectActivityContactPage(,"contact",tragetEntity,excludeId,target)); + } + public SelectActivityContactPage(List list,final String relationTableName,final String tragetEntity,final String excludeId,final String target){ + initPage(list,relationTableName,tragetEntity,excludeId,target); + } + public void initPage(List list,final String relationTableName,final String tragetEntity,final String excludeId,final String target) { + final Entity entity = entities.get(relationTableName); + Form form = new Form("form") { + @Override + protected void onSubmit() { + List maplist = selectConatct(tragetEntity,roleId,posId,entity,entities ); + setResponsePage(new SelectActivityContactPage(maplist,relationTableName,tragetEntity,excludeId,target)); + } + }; + form.add(new TextField("search_input", new PropertyModel(this, "search_target"))); + add(form); + + + final List searchableFields = entity.getSearchableFields(); + + final Map tableData = Maps.newHashMap(); + List ids = Lists.newArrayList(); + for (Map map : (List) list) { + String key = String.valueOf(map.get("id")); + ids.add(key); + tableData.put(key, map); + } + + + final PageableListView listview = new PageableListView("dataRowRepeater", ids, 20) { + + @Override + protected void populateItem(ListItem item) { + String key = item.getDefaultModelObjectAsString(); + Map map = tableData.get(key); + final int uid = ((Number) map.get("id")).intValue(); + String name = (String) map.get("name"); + + item.add(new AttributeAppender("data-id",new Model(uid))); + item.add(new AttributeAppender("data-name",new Model(name))); + item.add(new AttributeAppender("data-ename",relationTableName)); + + //item.add(new AttributeAppender("data-cname", new Model(cname))); + Label cap = new Label("name_span", new Model(name)); + Link link = new Link("createJump"){ + @Override + public void onClick() { + Map map = DAOImpl.queryEntityById(entity.getSql_ent(), String.valueOf(uid)); + Entity entity = entities.get("contact"); + List paramFields = entity.getParamFields(); + Map params = Maps.newHashMap(); + for(Field f:paramFields){ + params.put("contact"+"."+f.getName(), map.get(f.getName())); + } + setResponsePage(new CreateDataPage("activity",params)); + } + + }; + link.add(cap); + //link.add(new AttributeAppender("html",new Model(name),"")); + item.add(link); + + + RepeatingView column_repeater = new RepeatingView("column_repeater"); + item.add(column_repeater); + for(Field f:searchableFields){ + Object obj = map.get(f.getName()); + if(!f.getName().equalsIgnoreCase("name") && obj != null){ + AbstractItem column_item = new AbstractItem(column_repeater.newChildId()); + column_repeater.add(column_item); + + String celldata =String.valueOf(obj); + column_item.add(new Label("celldata",""+f.getDisplay()+": "+celldata).setEscapeModelStrings(false)); + } + } + + + + Object obj = map.get("num_of_visiting"); + if (obj != null) { + AbstractItem column_item = new AbstractItem(column_repeater.newChildId()); + column_repeater.add(column_item); + String num_of_visiting = String.valueOf(obj); + column_item.add(new Label("celldata", num_of_visiting + "(拜访次数)")); + } + + + + } + }; + + add(listview); + AjaxPagingNavigator nav =new AjaxPagingNavigator("navigator", listview); + nav.setOutputMarkupId(true); + + add(nav); + setVersioned(false); + + } + + public static List selectConatct(final String tragetEntity,int roleId,String posId,Entity entity,Map entities ){ + List maplist = null; + if (tragetEntity.equalsIgnoreCase("activity")) { + + String sql = assembleSearchingSQL(roleId, entity); + + switch (roleId) { + case 2:{ + maplist = DAOImpl.queryEntityRelationList(sql, posId, posId); + + break; + } + case 3:{ + maplist = DAOImpl.queryEntityRelationList(sql, posId); + Entity activityEnt = entities.get("activity"); + String actSQL = activityEnt.getSql(); + actSQL = "select contactName,count(contactName) as ct from ("+ actSQL + ") as bact where status=2 group by contactName"; + logger.debug("number_of_act:"+actSQL); + + List num_of_act_per_contact = DAOImpl.queryEntityRelationList(actSQL, posId); + + Map activity_contact_map = Maps.newHashMap(); + for(Map map:num_of_act_per_contact){ + activity_contact_map.put(String.valueOf(map.get("contactName")),map); + } + + + // Map contact_map = Maps.newHashMap(); + for(Map map:maplist){ + String contactId = String.valueOf(map.get("id")); + if(activity_contact_map.containsKey(contactId)){ + map.put("num_of_visiting", activity_contact_map.get(contactId).get("ct")); + } + } + + //sorting + //Collections.s` + Collections.sort(maplist,new Comparator(){ + + @Override + public int compare(Map o1, Map o2) { + Object obj1 = o1.get("num_of_visiting"); + Object obj2 = o2.get("num_of_visiting"); + if(obj1 == null || obj2 == null) return 0; + + long v1 = (long)o1.get("num_of_visiting"); + long v2 = (long)o2.get("num_of_visiting"); + + return (int)(v2-v1); + + } + + }); + + + break; + } + case 1: + maplist = DAOImpl.queryEntityRelationList(sql); + } + } + return maplist; + } + private static String assembleSearchingSQL(final int roleId, final Entity entity) { + String sql = entity.getSql(); + switch(roleId){ + case 1: + sql = entity.getSqlAdmin(); + break; + case 2: + sql = entity.getSqlManager(); + break; + case 3: + sql = entity.getSql(); + break; + } + + search_target = (search_target==null || search_target.equalsIgnoreCase("*"))? "":search_target; + + List searchableFields = entity.getSearchableFields(); + String joint = " like '%"+search_target+"%'"; + String likequery = ""; + for(Field sf:searchableFields){ + likequery = likequery + " OR "+ sf.getName() + joint; + } + + sql = sql + " where name like '%"+search_target+"%' " + likequery ; + return sql; + } +} diff --git a/crm/src/main/java/com/rex/crm/SelectCRMUserPage.html b/crm/src/main/java/com/rex/crm/SelectCRMUserPage.html new file mode 100755 index 0000000..3958bca --- /dev/null +++ b/crm/src/main/java/com/rex/crm/SelectCRMUserPage.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ +
+
+
+
+
+
+ + diff --git a/crm/src/main/java/com/rex/crm/SelectCRMUserPage.java b/crm/src/main/java/com/rex/crm/SelectCRMUserPage.java new file mode 100755 index 0000000..fd003ab --- /dev/null +++ b/crm/src/main/java/com/rex/crm/SelectCRMUserPage.java @@ -0,0 +1,93 @@ +package com.rex.crm; + +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.apache.wicket.behavior.AttributeAppender; +import org.apache.wicket.markup.html.WebPage; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.list.AbstractItem; +import org.apache.wicket.markup.repeater.RepeatingView; +import org.apache.wicket.model.Model; +import org.apache.wicket.model.PropertyModel; +import org.apache.wicket.request.mapper.parameter.PageParameters; +import org.apache.wicket.util.string.StringValue; + +import com.google.common.collect.Lists; +import com.rex.crm.beans.Contact; +import com.rex.crm.common.NewDataFormPanel; +import com.rex.crm.db.DAOImpl; + +/** + * + * + * @author Feiyun + */ +public class SelectCRMUserPage extends WebPage { + private static final Logger logger = Logger.getLogger(SelectCRMUserPage.class); + + private String search_target; + + /** + * Constructor + * + * @param parameters + * Page parameters (ignored since this is the home page) + */ + public SelectCRMUserPage() { + StringValue mid = getRequest().getRequestParameters().getParameterValue("mid"); + //.getPageParameters().get("mid"); + logger.debug("mid:"+mid); + initPage(null,mid.toString()); + } + + public SelectCRMUserPage(List maplist,String managerId) { + initPage(maplist,managerId); + } + + public void initPage(List list,final String managerId) { + // final String userId = ((SignIn2Session) getSession()).getUserId(); + Form form = new Form("form") { + @Override + protected void onSubmit() { + logger.debug("the form was submitted!"); + // new PropertyModel(this, "selected") + //List maplist = DAOImpl.searchCRMUser(managerId, search_target); + List maplist = DAOImpl.searchCRMUserOfManager(managerId,search_target); + setResponsePage(new SelectCRMUserPage(maplist,managerId)); + + } + }; + form.add(new TextField("search_input", new PropertyModel(this, "search_target"))); + add(form); + + RepeatingView dataRowRepeater = new RepeatingView("dataRowRepeater"); + add(dataRowRepeater); + + if (list != null) { + for (Map map : list) { + int uid = ((Number) map.get("id")).intValue(); + String name = (String) map.get("name"); + String cellPhone = (String) map.get("cellPhone"); + String jobTitle = (String) map.get("jobTitle"); + String email = (String) map.get("email"); + AbstractItem item = new AbstractItem(dataRowRepeater.newChildId()); + dataRowRepeater.add(item); + Label cap = new Label("name_span", new Model(name)); + item.add(new AttributeAppender("data-uid",new Model(uid))); + item.add(new AttributeAppender("data-uname",new Model(name))); + + //item.add(new AttributeAppender("data-cname", new Model(cname))); + item.add(cap); + item.add(new Label("cellPhone_span", cellPhone)); + item.add(new Label("email_span", email)); + item.add(new Label("jobTitle_span", jobTitle)); + + + } + } + } +} diff --git a/crm/src/main/java/com/rex/crm/SelectEntryPage.html b/crm/src/main/java/com/rex/crm/SelectEntryPage.html new file mode 100755 index 0000000..28b5f86 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/SelectEntryPage.html @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
    +
  • + +
  • +
  • + +
  • +
+
+
+
+
+
+ + diff --git a/crm/src/main/java/com/rex/crm/SelectEntryPage.java b/crm/src/main/java/com/rex/crm/SelectEntryPage.java new file mode 100755 index 0000000..903adfd --- /dev/null +++ b/crm/src/main/java/com/rex/crm/SelectEntryPage.java @@ -0,0 +1,365 @@ +package com.rex.crm; + +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.apache.log4j.Logger; +import org.apache.wicket.behavior.AttributeAppender; +import org.apache.wicket.markup.html.WebPage; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.list.AbstractItem; +import org.apache.wicket.markup.repeater.RepeatingView; +import org.apache.wicket.model.Model; +import org.apache.wicket.model.PropertyModel; +import org.apache.wicket.request.mapper.parameter.PageParameters; +import org.apache.wicket.util.string.StringValue; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import com.rex.crm.beans.Contact; +import com.rex.crm.common.Entity; +import com.rex.crm.common.Field; +import com.rex.crm.common.NewDataFormPanel; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.util.Configuration; +import org.apache.wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigator; +import org.apache.wicket.markup.html.list.ListItem; +import org.apache.wicket.markup.html.list.PageableListView; + +/** + * + * + * @author Feiyun + */ +public class SelectEntryPage extends WebPage { + private static final Logger logger = Logger.getLogger(SelectEntryPage.class); + + private String search_target; + + + /** + * Constructor + * + * @param parameters + * Page parameters (ignored since this is the home page) + */ + public SelectEntryPage() { + String relationTableName = getRequest().getRequestParameters().getParameterValue("en").toString(); + String tragetEntity = getRequest().getRequestParameters().getParameterValue("excludeName").toString(); + final String excludeId = getRequest().getRequestParameters().getParameterValue("eid").toString(); + String target = getRequest().getRequestParameters().getParameterValue("target").toString(); + initPage(null,relationTableName,tragetEntity,excludeId,target); + } + + public SelectEntryPage(List maplist,String relationTableName,String tragetEntity,String excludeId,String target) { + initPage(maplist,relationTableName,tragetEntity,excludeId,target); + } + + public void initPage(List list,final String relationTableName,final String tragetEntity,final String excludeId,final String target) { + final String posId = ((SignIn2Session) getSession()).getPositionId(); + final String userId = ((SignIn2Session) getSession()).getUserId(); + final int roleId = ((SignIn2Session) getSession()).getRoleId(); + final Map entities = Configuration.getEntityTable(); + final Entity entity = entities.get(relationTableName); + Form form = new Form("form") { + @Override + protected void onSubmit() { + List maplist = null; + if(relationTableName.equalsIgnoreCase("account")){ + + String sql = assembleSearchingSQL(roleId, entity); + + switch (roleId) { + case 2: + maplist = DAOImpl.queryEntityRelationList(sql, posId, posId, posId); + break; + case 3: + maplist = DAOImpl.queryEntityRelationList(sql, posId, posId); + break; + case 1: + sql = "select * from ("+ sql + ") as bact where status=1 "; + maplist = DAOImpl.queryEntityRelationList(sql); + } + + + }else if(relationTableName.equalsIgnoreCase("contact")){ + + if (tragetEntity.equalsIgnoreCase("activity")) { + + String sql = assembleSearchingSQL(roleId, entity); + + switch (roleId) { + case 2:{ + maplist = DAOImpl.queryEntityRelationList(sql, posId, posId); + + break; + } + case 3:{ + maplist = DAOImpl.queryEntityRelationList(sql, posId); + + Entity activityEnt = entities.get("activity"); + String actSQL = activityEnt.getSql(); + actSQL = "select contactName,count(contactName) as ct from ("+ actSQL + ") as bact where status=2 group by contactName"; + logger.debug("number_of_act:"+actSQL); + + List num_of_act_per_contact = DAOImpl.queryEntityRelationList(actSQL, posId); + + Map activity_contact_map = Maps.newHashMap(); + for(Map map:num_of_act_per_contact){ + activity_contact_map.put(String.valueOf(map.get("contactName")),map); + } + + + // Map contact_map = Maps.newHashMap(); + for(Map map:maplist){ + String contactId = String.valueOf(map.get("id")); + if(activity_contact_map.containsKey(contactId)){ + map.put("num_of_visiting", activity_contact_map.get(contactId).get("ct")); + } + } + + //sorting + //Collections.s` + Collections.sort(maplist,new Comparator(){ + + @Override + public int compare(Map o1, Map o2) { + Object obj1 = o1.get("num_of_visiting"); + Object obj2 = o2.get("num_of_visiting"); + if(obj1 == null || obj2 == null) return 0; + + long v1 = (long)o1.get("num_of_visiting"); + long v2 = (long)o2.get("num_of_visiting"); + + return (int)(v2-v1); + + } + + }); + + + break; + } + case 1: + maplist = DAOImpl.queryEntityRelationList(sql); + + } + }else if (tragetEntity.equalsIgnoreCase("crmuser")) { + // maplist = DAOImpl.searchCRMUser(search_target); + maplist = DAOImpl.searchManager(search_target, excludeId); + Map dummy = Maps.newHashMap(); + dummy.put("id", -1); + dummy.put("name", "无"); + maplist.add(dummy); + + } else if (tragetEntity.equalsIgnoreCase("userInfo")) { + // maplist = DAOImpl.searchCRMUser(search_target); + maplist = DAOImpl.searchCRMUser(search_target); + Map dummy = Maps.newHashMap(); + dummy.put("id", -1); + dummy.put("name", "无"); + maplist.add(dummy); + + } else if (tragetEntity.equalsIgnoreCase("contact")) { + // maplist = DAOImpl.searchCRMUser(search_target); + maplist = DAOImpl.searchMergeContact(search_target); + Map dummy = Maps.newHashMap(); + dummy.put("id", -1); + dummy.put("name", "无"); + maplist.add(dummy); + + } + } else if(relationTableName.equalsIgnoreCase("crmuser")){ + //maplist = DAOImpl.searchCRMUser(search_target); + if (tragetEntity.equalsIgnoreCase("crmuser")){ + maplist = DAOImpl.searchManager(search_target,excludeId); + }else if(tragetEntity.equalsIgnoreCase("coaching")||tragetEntity.equalsIgnoreCase("willcoaching")){ + String sql = assembleSearchingSQL(roleId, entity); + if(roleId==1){ + maplist = DAOImpl.queryEntityRelationList(sql); + Map dummy = Maps.newHashMap(); + dummy.put("id", -1); + dummy.put("name", "无"); + maplist.add(dummy); + }else if(roleId == 2){ + + // sql = entity.getSqlManagerCoaching(); + sql = "select * from (select crmuser.id as id, crmuser.name as name, crmuser.code ,userinfo.name as userInfoName from crmuser,userinfo,user_position where crmuser.id=user_position.positionId" + + " and user_position.userId=userInfo.id and crmuser.reportto=?) as aquery"; + logger.debug("sql XXXXX:" + sql); + maplist = DAOImpl.queryEntityRelationList(sql,posId); + }else if(roleId == 3){ + maplist = DAOImpl.queryEntityRelationList(sql,posId); + Map dummy = Maps.newHashMap(); + dummy.put("id", -1); + dummy.put("name", "无"); + maplist.add(dummy); + } + }else if(tragetEntity.equalsIgnoreCase("userInfo")){ + if(target.equalsIgnoreCase("-1")){ + maplist = DAOImpl.searchPositionCRMUser(search_target); + }else { + maplist = DAOImpl.searchCRMUser(search_target); + } + Map dummy = Maps.newHashMap(); + dummy.put("id", -1); + dummy.put("name", "无"); + maplist.add(dummy); + }else if(tragetEntity.equalsIgnoreCase("user_position")){ + + maplist = DAOImpl.searchPositionCRMUser(search_target); + Map dummy = Maps.newHashMap(); + dummy.put("id", -1); + dummy.put("name", "无"); + maplist.add(dummy); + + } + }else if (relationTableName.equalsIgnoreCase("userinfo")) { + String sql = assembleSearchingSQL(roleId, entity); +// if(){ + maplist = DAOImpl.queryEntityRelationList(sql); +// } +// maplist = DAOImpl.queryEntityRelationList(sql,userId); + Map dummy = Maps.newHashMap(); + dummy.put("id", -1); + dummy.put("name", "无"); + maplist.add(dummy); + + }else if (relationTableName.equalsIgnoreCase("productline")) { + String sql = assembleSearchingSQL(roleId, entity); + maplist = DAOImpl.queryEntityRelationList(sql); + + }else if (relationTableName.equalsIgnoreCase("product")) { + String sql = assembleSearchingSQL(roleId, entity); + maplist = DAOImpl.queryEntityRelationList(sql); + + } + else if (relationTableName.equalsIgnoreCase("province")) { + String sql = assembleSearchingSQL(roleId, entity); + logger.debug("d;"+sql); + maplist = DAOImpl.queryEntityRelationList(sql); + + }else if(relationTableName.equalsIgnoreCase("alert")){ + String sql = "select * from alert"; + maplist = DAOImpl.queryEntityRelationList(sql); + } + //this.setResponsePage(cls, parameters) + + setResponsePage(new SelectEntryPage(maplist,relationTableName,tragetEntity,excludeId,target)); + + } + }; + form.add(new TextField("search_input", new PropertyModel(this, "search_target"))); + add(form); + + + // RepeatingView dataRowRepeater = new RepeatingView("dataRowRepeater"); + // add(dataRowRepeater); + + final List searchableFields = entity.getSearchableFields(); + + //初始化的时候查不出数据 + if (list == null) { + list=DAOImpl.queryEntityRelationList("Select * from account where 1=0"); + } + + final Map tableData = Maps.newHashMap(); + List ids = Lists.newArrayList(); + for (Map map : (List) list) { + String key = String.valueOf(map.get("id")); + ids.add(key); + tableData.put(key, map); + } + + + + + final PageableListView listview = new PageableListView("dataRowRepeater", ids, 20) { + + @Override + protected void populateItem(ListItem item) { + String key = item.getDefaultModelObjectAsString(); + Map map = tableData.get(key); + int uid = ((Number) map.get("id")).intValue(); + String name = (String) map.get("name"); + + item.add(new AttributeAppender("data-id",new Model(uid))); + item.add(new AttributeAppender("data-name",new Model(name))); + item.add(new AttributeAppender("data-ename",relationTableName)); + + //item.add(new AttributeAppender("data-cname", new Model(cname))); + Label cap = new Label("name_span", new Model(name)); + item.add(cap); + + + RepeatingView column_repeater = new RepeatingView("column_repeater"); + item.add(column_repeater); + for(Field f:searchableFields){ + Object obj = map.get(f.getName()); + if(!f.getName().equalsIgnoreCase("name") && obj != null){ + AbstractItem column_item = new AbstractItem(column_repeater.newChildId()); + column_repeater.add(column_item); + + String celldata =String.valueOf(obj); + column_item.add(new Label("celldata",""+f.getDisplay()+": "+celldata).setEscapeModelStrings(false)); + } + } + + + + Object obj = map.get("num_of_visiting"); + if (obj != null) { + AbstractItem column_item = new AbstractItem(column_repeater.newChildId()); + column_repeater.add(column_item); + String num_of_visiting = String.valueOf(obj); + column_item.add(new Label("celldata", num_of_visiting + "(拜访次数)")); + } + } + }; + + add(listview); + //PagingNavigator nav = new PagingNavigator("navigator", listview); + AjaxPagingNavigator nav =new AjaxPagingNavigator("navigator", listview); + nav.setOutputMarkupId(true); + + add(nav); + setVersioned(false); + + } + + private String assembleSearchingSQL(final int roleId, final Entity entity) { + String sql = entity.getSql(); + switch(roleId){ + case 1: + sql = entity.getSqlAdmin(); + break; + case 2: + sql = entity.getSqlManager(); + break; + case 3: + sql = entity.getSql(); + break; + } + + search_target = (search_target==null || search_target.equalsIgnoreCase("*"))? "":search_target; + + List searchableFields = entity.getSearchableFields(); + String joint = " like '%"+search_target+"%'"; + String likequery = ""; + for(Field sf:searchableFields){ + likequery = likequery + " OR "+ sf.getName() + joint; + } + if(entity.getName().toString().equals("province")){ + sql = sql + " where val like '%"+search_target+"%' " + likequery ; + }else{ + sql = sql + " where name like '%"+search_target+"%' " + likequery ; + } + return sql; + } +} diff --git a/crm/src/main/java/com/rex/crm/SelectPositionPage.html b/crm/src/main/java/com/rex/crm/SelectPositionPage.html new file mode 100644 index 0000000..314e368 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/SelectPositionPage.html @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + 选择岗位 + + + + + + + + diff --git a/crm/src/main/java/com/rex/crm/SelectPositionPage.java b/crm/src/main/java/com/rex/crm/SelectPositionPage.java new file mode 100644 index 0000000..48e26c8 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/SelectPositionPage.java @@ -0,0 +1,61 @@ +package com.rex.crm; + +import java.util.List; + +import org.apache.wicket.AttributeModifier; +import org.apache.wicket.MarkupContainer; +import org.apache.wicket.markup.html.WebPage; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.markup.html.list.AbstractItem; +import org.apache.wicket.markup.html.panel.Fragment; +import org.apache.wicket.markup.repeater.RepeatingView; +import org.apache.wicket.model.Model; + +import com.rex.crm.beans.CRMUser; +import com.rex.crm.beans.UserPosition; +import com.rex.crm.db.DAOImpl; + +public class SelectPositionPage extends WebPage{ + /** + * Constructor + */ + public SelectPositionPage(List list){ + //遍历数组,添加按钮 + RepeatingView dataRowRepeater = new RepeatingView("dataRowRepeater"); + AbstractItem item = new AbstractItem(dataRowRepeater.newChildId()); + dataRowRepeater.add(item); + RepeatingView columnRepeater = new RepeatingView("columnRepeater"); + SignIn2Session session = (SignIn2Session)getSession(); + for(UserPosition position:list){ + //根据岗位ID获取岗位名称 + CRMUser user = DAOImpl.getCRMUserInfoById(position.getPositionId()); + if(user.getPl1()==2){ + continue; + } + AbstractItem columnitem = new AbstractItem(columnRepeater.newChildId(), new Model()); + ButtonFragment btnFragment = new ButtonFragment("celldatafield","buttonFragment",this,user.getName(),String.valueOf(position.getPositionId()),user.getRole()); + columnitem.add(btnFragment); + columnRepeater.add(columnitem); + } + item.add(columnRepeater); + add(dataRowRepeater); + } + private class ButtonFragment extends Fragment { + + public ButtonFragment(String id, String markupId,MarkupContainer markupProvider,String value,final String positionId,final int roleId){ + super(id, markupId, markupProvider); + Link link = new Link("button"){ + @Override + public void onClick() { + SignIn2Session session = (SignIn2Session) getSession(); + session.setPositionId(positionId); + session.setRoleId(roleId); + setResponsePage(getApplication().getHomePage()); + } + }; + link.add(new Label("positionName",value)); + add(link); + } + } +} diff --git a/crm/src/main/java/com/rex/crm/SettingKeyUserInfoPage.html b/crm/src/main/java/com/rex/crm/SettingKeyUserInfoPage.html new file mode 100644 index 0000000..8ffa1ff --- /dev/null +++ b/crm/src/main/java/com/rex/crm/SettingKeyUserInfoPage.html @@ -0,0 +1,87 @@ + + + + + + + + + + + + +
+
+
+
+
您好,欢迎使用crm,进入系统之前您需要修改以下信息
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+ +
+
+
+
+
+ + \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/SettingKeyUserInfoPage.java b/crm/src/main/java/com/rex/crm/SettingKeyUserInfoPage.java new file mode 100644 index 0000000..178f93d --- /dev/null +++ b/crm/src/main/java/com/rex/crm/SettingKeyUserInfoPage.java @@ -0,0 +1,79 @@ +package com.rex.crm; + + +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.apache.wicket.AttributeModifier; +import org.apache.wicket.behavior.AttributeAppender; +import org.apache.wicket.markup.html.WebPage; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.PasswordTextField; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.model.IModel; +import org.apache.wicket.model.Model; + +import com.google.common.collect.Maps; +import com.rex.crm.beans.UserInfo; +import com.rex.crm.beans.UserPosition; +import com.rex.crm.db.DAOImpl; + +public class SettingKeyUserInfoPage extends WebPage{ + private static final long serialVersionUID = -3798004593574047292L; + private static final Logger logger = Logger.getLogger(SettingKeyUserInfoPage.class); + final Map models = Maps.newHashMap(); + + public SettingKeyUserInfoPage(UserInfo userInfo){ + final int userId = userInfo.getId(); + final int numOfSign = userInfo.getNum_of_signIn(); + Form form = new Form("form"){ + @Override + protected void onSubmit() { + String phone = models.get("phone").getObject() == null ? null : String.valueOf(models.get("phone").getObject()); + String email = models.get("email").getObject() == null ? null : String.valueOf(models.get("email").getObject()); + String password = models.get("newPassword").getObject() == null ? null : String.valueOf(models.get("newPassword").getObject()); + //修改用户关键信息,并增加登录次数 + if(DAOImpl.updateKeyUserInfoMessage(phone, email, password,userId)){ + List positions = DAOImpl.getPositionsByUserId(userId); + if(positions.size()>1){ + setResponsePage(new SelectPositionPage(positions)); + }else { + setResponsePage(getApplication().getHomePage()); + } + DAOImpl.addSignInNumber(userId,numOfSign+1); + } + } + }; + //根据id获取对象 + //Userinfo + Model textModel = new Model(""); + TextField phone = new TextField("phone", textModel); + phone.add(new AttributeAppender("class","required-field")); + phone.add(new AttributeModifier("pattern", new Model("^((\\d{11})|^((\\d{7,8})|(\\d{4}|\\d{3})-(\\d{7,8})|(\\d{4}|\\d{3})-(\\d{7,8})-(\\d{4}|\\d{3}|\\d{2}|\\d{1})|(\\d{7,8})-(\\d{4}|\\d{3}|\\d{2}|\\d{1}))$)"))); + models.put("phone",textModel); + Model emailModel = new Model(""); + TextField email = new TextField("email", emailModel); + email.add(new AttributeAppender("class","required-field")); + email.add(new AttributeModifier("type", new Model("email"))); + models.put("email", emailModel); + IModel newPasswordModel = new Model(""); + PasswordTextField newPassword = new PasswordTextField("newPassword", newPasswordModel); + newPassword.add(new AttributeAppender("value", "")); + newPassword.add(new AttributeAppender("class","required-field")); + models.put("newPassword", newPasswordModel); + IModel checkNewPasswordModel = new Model(""); + PasswordTextField checkPassword = new PasswordTextField("checkNewPassword", checkNewPasswordModel); + checkPassword.add(new AttributeAppender("value", "")); + checkPassword.add(new AttributeAppender("class","required-field")); + models.put("checkNewPassword", checkNewPasswordModel); + form.add(new Label("userName",userInfo.getName())); + form.add(phone); + form.add(email); + form.add(newPassword); + form.add(checkPassword); + add(form); + } + +} diff --git a/crm/src/main/java/com/rex/crm/SignIn.html b/crm/src/main/java/com/rex/crm/SignIn.html new file mode 100755 index 0000000..9d84ed4 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/SignIn.html @@ -0,0 +1,58 @@ + + + + + sign In + + + + + + + + + + + + + +
+ + +
+
+ +
+ + diff --git a/crm/src/main/java/com/rex/crm/SignIn.java b/crm/src/main/java/com/rex/crm/SignIn.java new file mode 100755 index 0000000..c9434ab --- /dev/null +++ b/crm/src/main/java/com/rex/crm/SignIn.java @@ -0,0 +1,170 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rex.crm; + +import java.util.List; + +import org.apache.wicket.markup.html.WebPage; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.PasswordTextField; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.panel.FeedbackPanel; +import org.apache.wicket.model.PropertyModel; +import org.apache.wicket.util.value.ValueMap; + +import com.rex.crm.beans.CRMUser; +import com.rex.crm.beans.UserInfo; +import com.rex.crm.beans.UserPosition; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.userlog.LogInOut; +import com.rex.crm.util.CRMUtility; + + +/** + * Simple example of a sign in page. It is based on auth-role's SignInPanel which already provides + * all what is necessary. + * + * @author Jonathan Locke + */ +public final class SignIn extends WebPage +{ + /** + * Construct + */ + public SignIn() + { + //create feedback panel and add to page + add(new FeedbackPanel("feedback")); + //add sign-in form to page + add(new SignInForm("signInForm")); + + } + public final class SignInForm extends Form + { + private static final String USERNAME ="username"; + private static final String PASSWORD = "password"; + private final ValueMap properties = new ValueMap(); + /** + * Constructor + * + * @param id + * id of the form component + */ + public SignInForm(final String id) + { + super(id); + add(new TextField(USERNAME,new PropertyModel(properties,USERNAME))); + add(new PasswordTextField(PASSWORD,new PropertyModel(properties,PASSWORD))); + } + /** + * sign + */ + @SuppressWarnings("unused") + public final void onSubmit() + { + //get session info + SignIn2Session session = getMysession(); + //clear session user + session.setUser(null); + //判断用户是否激活密码是否存在 + + if("".equals(getUsername())||"".equals(getPassword())){ + String errmsg = getString("loginError", null, "用户名和密码不能为空!"); + error(errmsg); + }else{ + UserInfo user = DAOImpl.getUserByLoginName(getUsername()); + if(null!=user){ + // Sign the user in + + if (session.signIn(getUsername(),getPassword())) + { + + UserPosition userPosition = DAOImpl.getActivityPositionInfoByUserId(Integer.parseInt(session.getUserId())); + if(userPosition == null){ + String errmsg = getString("loginError", null, "无有效岗位!"); + // Register the error message with the feedback panel + error(errmsg); + return; + } + CRMUser crmuser = DAOImpl.getCRMUserInfoById(userPosition.getPositionId()); + if(crmuser.getPl1()==2){ + String errmsg = getString("loginError", null, "岗位已失效!"); + // Register the error message with the feedback panel + error(errmsg); + return; + } + session.setPositionId(String.valueOf(userPosition.getPositionId())); + session.setLevel(crmuser.getLevel()); + session.setRoleId(crmuser.getRole()); + + //statistic log + LogInOut loginout = new LogInOut(); + loginout.setLoginName(session.getUser()); + loginout.setLogints(System.currentTimeMillis()); + loginout.setSessionId(session.getId()); + CRMUtility.printStat(CRMUtility.STAT_LOG_IN_OUT,loginout,LogInOut.class); + + + + if(user.getNum_of_signIn()==0){ + setResponsePage(new SettingKeyUserInfoPage(user)); + }else{ + //根据userId查找用户岗位。如果岗位有多个则选择岗位 + List positions = DAOImpl.getPositionsByUserId(user.getId()); + if(positions.size()>1){ + setResponsePage(new SelectPositionPage(positions)); + }else { + if(session.getPositionId().equals(-1)){ + setResponsePage(new NullPosition(null)); + } + setResponsePage(getApplication().getHomePage()); + } + DAOImpl.addSignInNumber(user.getId(),user.getNum_of_signIn()+1); + } + } + else + { + // Get the error message from the properties file associated with the Component + String errmsg = getString("loginError", null, "用户名或密码错误!"); + // Register the error message with the feedback panel + error(errmsg); + } + + }else{ + String errmsg = getString("loginError", null, "用户名不存在!"); + error(errmsg); + } + } + } + /** + * @return + */ + private String getUsername() + { + return properties.getString(USERNAME); + } + private String getPassword() + { + return properties.getString(PASSWORD); + } + private SignIn2Session getMysession() + { + return (SignIn2Session)getSession(); + } + + } +} diff --git a/crm/src/main/java/com/rex/crm/SignIn2Session.java b/crm/src/main/java/com/rex/crm/SignIn2Session.java new file mode 100755 index 0000000..7cd71d7 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/SignIn2Session.java @@ -0,0 +1,135 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rex.crm; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; + +import org.apache.wicket.authroles.authentication.AuthenticatedWebSession; +import org.apache.wicket.authroles.authorization.strategies.role.Roles; +import org.apache.wicket.request.Request; + +import com.rex.crm.beans.CRMUser; +import com.rex.crm.beans.UserInfo; +import com.rex.crm.beans.UserPosition; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.db.model.Crmuser; + +/** + * Session class for signin example. Holds and authenticates users. + * + * @author Jonathan Locke + */ +public final class SignIn2Session extends AuthenticatedWebSession +{ + /** Trivial user representation */ + private String user; + private String userId; + private int roleId; + private String positionId; + private int level; + + /** + * Constructor + * + * @param request + * The current request object + */ + protected SignIn2Session(Request request) + { + super(request); + + } + /** + * Checks the given username and password, returning a User object if if the username and + * password identify a valid user. + * + * @param username + * The username + * @param password + * The password + * @return True if the user was authenticated + */ + @Override + public final boolean authenticate(final String username, final String password) + { + if (user == null) + { + + UserInfo userinfo = DAOImpl.login(username, password); + + if(userinfo!=null && userinfo.getId() != 0){ + user = userinfo.getName(); + userId = String.valueOf(userinfo.getId()); + + } + } + return user != null; + } + /** + * @see org.apache.wicket.authentication.AuthenticatedWebSession#getRoles() + */ + @Override + public Roles getRoles() + { + if (isSignedIn()) + { + // If the user is signed in, they have these roles + return new Roles(Roles.ADMIN); + } + return null; + } + /** + * @return User + */ + public String getUser() + { + return user; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public int getRoleId() { + return roleId; + } + + public void setRoleId(int roleId) { + this.roleId = roleId; + } + + public void setUser(String user) { + this.user = user; + } + public String getPositionId() { + return positionId; + } + public void setPositionId(String positionId) { + this.positionId = positionId; + } + public int getLevel() { + return level; + } + public void setLevel(int level) { + this.level = level; + } +} diff --git a/crm/src/main/java/com/rex/crm/SignOut.html b/crm/src/main/java/com/rex/crm/SignOut.html new file mode 100755 index 0000000..e6b6dd8 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/SignOut.html @@ -0,0 +1,11 @@ + + + 登出 + + + + +

再见!

+ 回主页 + + diff --git a/crm/src/main/java/com/rex/crm/SignOut.java b/crm/src/main/java/com/rex/crm/SignOut.java new file mode 100755 index 0000000..38dcdba --- /dev/null +++ b/crm/src/main/java/com/rex/crm/SignOut.java @@ -0,0 +1,39 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rex.crm; + +import org.apache.wicket.markup.html.WebPage; +import org.apache.wicket.request.mapper.parameter.PageParameters; + +/** + * Simple logout page. + * + * @author Jonathan Locke + */ +public class SignOut extends WebPage +{ + /** + * Constructor + * + * @param parameters + * Page parameters (ignored since this is the home page) + */ + public SignOut(final PageParameters parameters) + { + getSession().invalidate(); + } +} diff --git a/crm/src/main/java/com/rex/crm/TemplatePage.html b/crm/src/main/java/com/rex/crm/TemplatePage.html new file mode 100755 index 0000000..17d745c --- /dev/null +++ b/crm/src/main/java/com/rex/crm/TemplatePage.html @@ -0,0 +1,140 @@ + + + + + + + + title + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+
+
+
+
+ +
+ + diff --git a/crm/src/main/java/com/rex/crm/TemplatePage.java b/crm/src/main/java/com/rex/crm/TemplatePage.java new file mode 100755 index 0000000..6cfa7da --- /dev/null +++ b/crm/src/main/java/com/rex/crm/TemplatePage.java @@ -0,0 +1,401 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rex.crm; + +import java.io.BufferedReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletRequest; + +import org.apache.log4j.Logger; +import org.apache.wicket.Component; +import org.apache.wicket.behavior.AbstractAjaxBehavior; +import org.apache.wicket.markup.head.IHeaderResponse; +import org.apache.wicket.markup.head.JavaScriptHeaderItem; +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.link.BookmarkablePageLink; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.markup.html.list.ListItem; +import org.apache.wicket.markup.html.list.ListView; +import org.apache.wicket.model.IModel; +import org.apache.wicket.model.Model; +import org.apache.wicket.model.PropertyModel; +import org.apache.wicket.protocol.http.WebApplication; +import org.apache.wicket.request.cycle.RequestCycle; +import org.apache.wicket.request.handler.TextRequestHandler; +import org.apache.wicket.request.http.WebRequest; +import org.apache.wicket.util.template.PackageTextTemplate; +import org.apache.wicket.behavior.AttributeAppender; + +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Lists; +import com.google.gson.Gson; +import com.rex.crm.admin.AdminTreePage; +import com.rex.crm.admin.DataImportPage; +import com.rex.crm.admin.DownloadPage; +import com.rex.crm.admin.ImportLogPage; +import com.rex.crm.admin.MergePage; +import com.rex.crm.admin.PositionPage; +import com.rex.crm.admin.PositionTreePage; +import com.rex.crm.admin.ProductPage; +import com.rex.crm.admin.ProductTreePage; +import com.rex.crm.admin.ReportPage; +import com.rex.crm.admin.UploadPage; +import com.rex.crm.admin.UserPage; +import com.rex.crm.admin.UserPositionPage; +import com.rex.crm.ajax.DataProvider; +import com.rex.crm.ajax.FunctionClass; +import com.rex.crm.ajax.FunctionInvoker; +import com.rex.crm.beans.UserInfo; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.userlog.LogInOut; +import com.rex.crm.util.CRMUtility; + +/** + * + * @author Feiyun Zhou + */ +public abstract class TemplatePage extends AuthenticatedWebPage { + /** title of the current page. */ + private String pageTitle = "TemplatePageTest"; + private static final Logger logger = Logger.getLogger(TemplatePage.class); + + protected static ImmutableMap pageMenuMap; + + static{ + //TODO Load them from configuration + ImmutableMap.Builder builder = new ImmutableMap.Builder(); + MenuItem item = new MenuItem(); + item.setCaption("主页"); + item.setDestination(HomePage.class); + item.setId("navitem-homepage"); + builder.put("home", item); + + item = new MenuItem(); + item.setCaption("医院"); + item.setDestination(AccountPage.class); + item.setId("navitem-account"); + builder.put("account", item); + + item = new MenuItem(); + item.setCaption("医生"); + item.setDestination(ContactPage.class); + item.setId("navitem-contact"); + builder.put("contact", item); + + item = new MenuItem(); + item.setCaption("日历"); + item.setDestination(CalendarPage.class); + item.setId("navitem-calendar"); + builder.put("calendar", item); + + + item = new MenuItem(); + item.setCaption("拜访"); + item.setDestination(ActivityPage.class); + item.setId("navitem-activity"); + builder.put("activity", item); + + item = new MenuItem(); + item.setCaption("辅导"); + item.setDestination(CoachingPage.class); + item.setId("navitem-coaching"); + builder.put("coaching", item); + + pageMenuMap = builder.build(); + + } + /** + * Constructor + */ + public TemplatePage() { + + final int roleId = ((SignIn2Session) getSession()).getRoleId(); + add(new Label("title", new PropertyModel(this, "pageTitle"))); + UserInfo user = DAOImpl.getUserInfoById(Integer.parseInt(((SignIn2Session) getSession()).getUserId())); + + //TODO get function work with real id + List menulist = DAOImpl.getMenuByRole(roleId); + + //populate menu items. TODO componentize it. pass arg: menuList + ArrayList menu = Lists.newArrayList(); + for(String key:menulist){ + menu.add(pageMenuMap.get(key)); + } + + //@SuppressWarnings("unchecked") + ListView lv = new ListView("menu", menu) { + @Override + protected void populateItem(ListItem item) { + MenuItem menuitem = (MenuItem) item.getModelObject(); + BookmarkablePageLink link = new BookmarkablePageLink("link", menuitem.getDestination()); + link.add(new Label("caption", menuitem.getCaption()).setEscapeModelStrings(false)); + item.add(link); + item.add(new AttributeAppender("id", Model.of(menuitem.getId()))); + // item.add(new SimpleAttributeModifier("class", "my-css-class")); + + } + }; + add(lv); + + add(new Link("signout_link"){ + + @Override + public void onClick() { + SignIn2Session session = (SignIn2Session) getSession(); + LogInOut loginout = new LogInOut(); + loginout.setLoginName(session.getUser()); + loginout.setLogints(System.currentTimeMillis()); + loginout.setSessionId(session.getId()); + CRMUtility.printStat(CRMUtility.STAT_LOG_IN_OUT,loginout,LogInOut.class); + session.invalidate(); + this.setResponsePage(SignIn.class); + } + + }); + + + BookmarkablePageLink user_settings_link = new BookmarkablePageLink("user_settings_link",UserDeatialInfo.class); + add(user_settings_link); + user_settings_link.add(new Label("loginName",user.getName())); + + + WebMarkupContainer admin_menu = new WebMarkupContainer("admin_menu"); + add(admin_menu); + BookmarkablePageLink adminTreePage = new BookmarkablePageLink("adminTreePage",AdminTreePage.class ); + admin_menu.add(adminTreePage); + +// BookmarkablePageLink positionTreePage = new BookmarkablePageLink("positionTreePage",PositionTreePage.class ); +// admin_menu.add(positionTreePage); + + BookmarkablePageLink productTreePage = new BookmarkablePageLink("productTreePage",ProductTreePage.class ); + admin_menu.add(productTreePage); + + BookmarkablePageLink positionPage = new BookmarkablePageLink("positionPage",PositionPage.class ); + admin_menu.add(positionPage); + +// BookmarkablePageLink reportPage = new BookmarkablePageLink("reportPage",ReportPage.class ); +// admin_menu.add(reportPage); + +// BookmarkablePageLink downloadPage = new BookmarkablePageLink("downloadPage",DownloadPage.class ); +// admin_menu.add(downloadPage); + + BookmarkablePageLink userPage = new BookmarkablePageLink("userPage",UserPage.class ); + admin_menu.add(userPage); + + BookmarkablePageLink userPositionPage = new BookmarkablePageLink("userPositionPage",UserPositionPage.class ); + admin_menu.add(userPositionPage); + +// BookmarkablePageLink productPage = new BookmarkablePageLink("productPage",ProductPage.class ); +// admin_menu.add(productPage); + + BookmarkablePageLink dataImportPage = new BookmarkablePageLink("dataImportPage",DataImportPage.class ); + admin_menu.add(dataImportPage); + BookmarkablePageLink alertPage = new BookmarkablePageLink("alertPage",AlertPage.class ); + admin_menu.add(alertPage); + + BookmarkablePageLink areaPage = new BookmarkablePageLink("areaPage",AreaPage.class ); + admin_menu.add(areaPage); +// +// BookmarkablePageLink applicationPage = new BookmarkablePageLink("applicationPage",AreaPage.class ); +// admin_menu.add(applicationPage); +// +// BookmarkablePageLink flowPage = new BookmarkablePageLink("flowPage",AreaPage.class ); +// admin_menu.add(flowPage); +// +// BookmarkablePageLink jurisdictionPage = new BookmarkablePageLink("jurisdictionPage",AreaPage.class ); +// admin_menu.add(jurisdictionPage); +// +// BookmarkablePageLink contentPage = new BookmarkablePageLink("contentPage",AreaPage.class ); +// admin_menu.add(contentPage); +// +// BookmarkablePageLink integrationPage = new BookmarkablePageLink("integrationPage",AreaPage.class ); +// admin_menu.add(integrationPage); + + BookmarkablePageLink importLogPage = new BookmarkablePageLink("importLog",ImportLogPage.class ); + admin_menu.add(importLogPage); + +// BookmarkablePageLink merge_data = new BookmarkablePageLink("merge_data",MergePage.class ); +// admin_menu.add(merge_data); + + admin_menu.setVisible(false); + if(roleId == 1) admin_menu.setVisible(true); + + //end of populate menu items + + AbstractAjaxBehavior ajaxBehaviour = new AbstractAjaxBehavior() { + private static final long serialVersionUID = 1L; + + @Override + public void onRequest() { + RequestCycle requestCycle = RequestCycle.get(); + readRequestData(requestCycle); + } + + private void readRequestData(final RequestCycle requestCycle) { + WebRequest wr = (WebRequest) requestCycle.getRequest(); + + HttpServletRequest hsr = (HttpServletRequest) wr + .getContainerRequest(); + String response = "{}"; + try { + BufferedReader br = hsr.getReader(); + + String jsonString = br.readLine(); + if ((jsonString == null) || jsonString.isEmpty()) { + logger.debug(" no json found"); + } else { + logger.debug(" json is :" + jsonString); + } + FunctionClass method = new Gson().fromJson(jsonString, + FunctionClass.class); + + FunctionInvoker invoker = new FunctionInvoker( + DataProvider.class); + System.out.println(" method:" + method); + response = (String) invoker.invoke(method.getF(), + method.getP()); + System.out.println("response:"+response); + + br.close(); + } catch (Exception e) { + e.printStackTrace(); + } + + requestCycle.replaceAllRequestHandlers(new TextRequestHandler( + "application/json", "UTF-8", response)); + + } + + @Override + public void renderHead(Component component, IHeaderResponse response) { + super.renderHead(component, response); + + final String posId = ((SignIn2Session)getSession()).getPositionId(); + String callbackUrl = getCallbackUrl().toString(); + + Map map = new HashMap<>(); + map.put("userInfo",DataProvider.getCRMUserInfoById(new String[]{posId})); + map.put("ajaxURL", callbackUrl); + //map.put("allUsers", DataProvider.getAllCRMUsers(new String[0])); + //map.put("allAccounts", DataProvider.getAllAccounts(new String[0])); + map.put("context_name",getRootContext()); + + PackageTextTemplate ptt = new PackageTextTemplate(getClass(),"template.js"); + //System.out.println(ptt.asString(map)); + response.render(JavaScriptHeaderItem.forScript(ptt.asString(map), null)); + try { + ptt.close(); + } catch (IOException e) { + e.printStackTrace(); + } + + } + }; + add(ajaxBehaviour); + + } + + public static String getRootContext(){ + + String rootContext = ""; + + WebApplication webApplication = WebApplication.get(); + + if(webApplication!=null){ + ServletContext servletContext = webApplication.getServletContext(); + if(servletContext!=null){ + rootContext = servletContext.getServletContextName(); + }else{ + //do nothing + } + }else{ + //do nothing + } + + return rootContext; + + } + + /** + * Gets the title. + * + * @return title + */ + public final String getPageTitle() { + return pageTitle; + } + + /** + * Sets the title. + * + * @param title + * title + */ + public final void setPageTitle(String title) { + pageTitle = title; + } +} + +class MenuItem implements IModel { + /** the caption of the menu item */ + private String caption; + /** the (bookmarkable) page the menu item links to */ + private Class destination; + private String id; + + public String getCaption() { + return caption; + } + public void setCaption(String caption) { + this.caption = caption; + } + public Class getDestination() { + return destination; + } + public void setDestination(Class destination) { + this.destination = destination; + } + @Override + public void detach() { + // TODO Auto-generated method stub + + } + @Override + public Object getObject() { + // TODO Auto-generated method stub + return this; + } + @Override + public void setObject( Object item) { + this.caption = ((MenuItem)item).getCaption(); + this.destination = ((MenuItem)item).getDestination(); + + } + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } +} \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/UpdateSignPassword.html b/crm/src/main/java/com/rex/crm/UpdateSignPassword.html new file mode 100644 index 0000000..3bb82ff --- /dev/null +++ b/crm/src/main/java/com/rex/crm/UpdateSignPassword.html @@ -0,0 +1,55 @@ + + + + + +
+
+ + +
+
+ + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + +
+
+
+
+
+ + \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/UpdateSignPassword.java b/crm/src/main/java/com/rex/crm/UpdateSignPassword.java new file mode 100644 index 0000000..070e48a --- /dev/null +++ b/crm/src/main/java/com/rex/crm/UpdateSignPassword.java @@ -0,0 +1,105 @@ +package com.rex.crm; + +import java.util.Map; + +import org.apache.commons.codec.digest.DigestUtils; +import org.apache.log4j.Logger; +import org.apache.wicket.behavior.AttributeAppender; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.PasswordTextField; +import org.apache.wicket.markup.html.list.AbstractItem; +import org.apache.wicket.markup.repeater.RepeatingView; +import org.apache.wicket.model.IModel; +import org.apache.wicket.model.Model; + +import com.google.common.collect.Maps; +import com.rex.crm.beans.CRMUser; +import com.rex.crm.beans.UserInfo; +import com.rex.crm.db.DAOImpl; + +public class UpdateSignPassword extends UserInfoSettingPage { + + private static final long serialVersionUID = -317099683219015628L; + private static final Logger logger = Logger.getLogger(UpdateSignPassword.class); + final Map models = Maps.newHashMap(); + + public UpdateSignPassword() { + initPage(); + setPageTitle("修改密码"); + } + + public void initPage() { + //获取到登录对象,将用户名传入页面,然后如何获取 + final int userId = Integer.parseInt(((SignIn2Session) getSession()).getUserId()); + UserInfo user = DAOImpl.getUserInfoById(userId); + //add prompt + final RepeatingView errordiv = new RepeatingView("errorpromptDiv"); + final AbstractItem errorgroup = new AbstractItem(errordiv.newChildId()); + final Label errorpromptButton = new Label("errorpromptButton","X"); + errorgroup.add(errorpromptButton); + final Label errorpromptLabel = new Label("errorprompt","提示:旧密码输入错误!"); + errorgroup.add(errorpromptLabel); + errordiv.add(new AttributeAppender("style",new Model("display:none"),";")); + errorgroup.add(new AttributeAppender("style",new Model("display:none"),";")); + errordiv.add(errorgroup); + add(errordiv); + //add prompt + final RepeatingView div = new RepeatingView("promptDiv"); + final AbstractItem group = new AbstractItem(div.newChildId()); + final Label promptButton = new Label("promptButton","X"); + group.add(promptButton); + final Label promptLabel = new Label("prompt","提示:操作已成功!"); + group.add(promptLabel); + div.add(new AttributeAppender("style",new Model("display:none"),";")); + group.add(new AttributeAppender("style",new Model("display:none"),";")); + div.add(group); + add(div); + Form form = new Form("form") { + @Override + protected void onSubmit() { + //首先获取form表单数据。验证旧密码是否正确。然后修改密码 + String oldPassword = models.get("oldPassword").getObject() == null ? null : String.valueOf(models.get("oldPassword").getObject()); + String newPassword = models.get("newPassword").getObject() == null ? null : String.valueOf(models.get("newPassword").getObject()); + UserInfo crmUser = DAOImpl.getUserInfoById(Integer.parseInt(((SignIn2Session) getSession()).getUserId())); + logger.debug("oldPwd:" + oldPassword); + logger.debug("old:" + DigestUtils.md5Hex(oldPassword)); + logger.debug("password:" + crmUser.getPassword()); + //判断旧密码是否正确,修改密码 + if (DigestUtils.md5Hex(oldPassword).equals(crmUser.getPassword())) { + logger.debug("true"); + //修改密码 + if (DAOImpl.updateCrmUserPassword(userId, newPassword)) { + div.add(new AttributeAppender("style",new Model("display:block"),";")); + group.add(new AttributeAppender("style",new Model("display:block"),";")); + promptLabel.add(new AttributeAppender("style",new Model("display:block"),";")); + promptButton.add(new AttributeAppender("style",new Model("display:block"),";")); + } + } else { + logger.debug("false"); + errordiv.add(new AttributeAppender("style",new Model("display:block"),";")); + errorgroup.add(new AttributeAppender("style",new Model("display:block"),";")); + errorpromptLabel.add(new AttributeAppender("style",new Model("display:block"),";")); + errorpromptButton.add(new AttributeAppender("style",new Model("display:block"),";")); + } + } + }; + add(form); + form.add(new Label("userName", user.getName())); + IModel textModel = new Model(""); + PasswordTextField oldPassword = new PasswordTextField("oldPassword", textModel); + oldPassword.add(new AttributeAppender("value", "")); + models.put("oldPassword", textModel); + IModel newPasswordModel = new Model(""); + PasswordTextField newPassword = new PasswordTextField("newPassword", newPasswordModel); + newPassword.add(new AttributeAppender("value", "")); + models.put("newPassword", newPasswordModel); + IModel checkNewPasswordModel = new Model(""); + PasswordTextField checkPassword = new PasswordTextField("checkNewPassword", checkNewPasswordModel); + checkPassword.add(new AttributeAppender("value", "")); + models.put("checkNewPassword", checkNewPasswordModel); + form.add(oldPassword); + form.add(newPassword); + form.add(checkPassword); + } +} diff --git a/crm/src/main/java/com/rex/crm/UserDeatialInfo.html b/crm/src/main/java/com/rex/crm/UserDeatialInfo.html new file mode 100644 index 0000000..9365f26 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/UserDeatialInfo.html @@ -0,0 +1,63 @@ + + + + + +
+
+ + +
+
+ + +
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+ + + + + + + + + +
+ + \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/UserDeatialInfo.java b/crm/src/main/java/com/rex/crm/UserDeatialInfo.java new file mode 100644 index 0000000..04c80c6 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/UserDeatialInfo.java @@ -0,0 +1,279 @@ +package com.rex.crm; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.apache.wicket.AttributeModifier; +import org.apache.wicket.MarkupContainer; +import org.apache.wicket.behavior.AttributeAppender; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.DropDownChoice; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.IChoiceRenderer; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.list.AbstractItem; +import org.apache.wicket.markup.html.panel.Fragment; +import org.apache.wicket.markup.repeater.RepeatingView; +import org.apache.wicket.model.IModel; +import org.apache.wicket.model.Model; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.rex.crm.beans.CRMUser; +import com.rex.crm.beans.Choice; +import com.rex.crm.beans.UserInfo; +import com.rex.crm.common.Entity; +import com.rex.crm.common.Field; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.util.CRMUtility; +import com.rex.crm.util.Configuration; + +public class UserDeatialInfo extends UserInfoSettingPage { + + private static final long serialVersionUID = 7459440666591284026L; + private static final Logger logger = Logger.getLogger(UserDeatialInfo.class); + final Map fieldNameToModel = Maps.newHashMap(); + final Map models = Maps.newHashMap(); + //设置显示行数 + private int number_of_column = 1; + + /** + * Contract + */ + public UserDeatialInfo() { + logger.debug("init userManager"); + setPageTitle("个人信息"); + initPage(""); + } + public UserDeatialInfo(String result){ + logger.debug("init userManager"); + setPageTitle("个人信息"); + initPage(result); + } + private void initPage(String result) { + logger.debug("sessionID:" + ((SignIn2Session) getSession()).getUserId()); + int userId = Integer.parseInt(((SignIn2Session) getSession()).getUserId()); + Entity entity = Configuration.getEntityByName("userinfo"); + String primaryKeyName = entity.getPrimaryKeyName(); + //get crmUser + UserInfo user = DAOImpl.getUserInfoById(userId); + //add prompt + final RepeatingView div = new RepeatingView("promptDiv"); + final AbstractItem group = new AbstractItem(div.newChildId()); + final Label promptButton = new Label("promptButton","X"); + group.add(promptButton); + final Label promptLabel = new Label("prompt","提示:操作已成功!"); + group.add(promptLabel); + if("".equals(result)||"failure".equals(result)){ + div.add(new AttributeAppender("style",new Model("display:none"),";")); + group.add(new AttributeAppender("style",new Model("display:none"),";")); + } + div.add(group); + add(div); + //add prompt + final RepeatingView errordiv = new RepeatingView("alertDiv"); + final AbstractItem errorgroup = new AbstractItem(div.newChildId()); + final Label errorpromptButton = new Label("alertButton","X"); + errorgroup.add(errorpromptButton); + final Label errorpromptLabel = new Label("alert","提示:用户登录名已存在!"); + errorgroup.add(errorpromptLabel); + if("".equals(result)||"success".equals(result)){ + errordiv.add(new AttributeAppender("style",new Model("display:none"),";")); + errorgroup.add(new AttributeAppender("style",new Model("display:none"),";")); + } + errordiv.add(errorgroup); + add(errordiv); + final List fieldNames = Lists.newArrayList(); + //得到基本信息信息 + RepeatingView fieldGroupRepeater = new RepeatingView("fieldGroupRepeater"); + add(fieldGroupRepeater); + List groupfields = new ArrayList(); + List fields = entity.getFields(); + for (Field f : fields) { + if (f.isBaseInfo() == true) { + groupfields.add(f); + } + } + AbstractItem groupitem = new AbstractItem(fieldGroupRepeater.newChildId()); + fieldGroupRepeater.add(groupitem); + RepeatingView dataRowRepeater = new RepeatingView("dataRowRepeater"); + groupitem.add(dataRowRepeater); + int numOfField = 0; + List visibleFields = Lists.newArrayList(); + for (Field f : groupfields) { + if (!f.isVisible()) { + continue; + } + numOfField++; + visibleFields.add(f); + } + logger.debug("numOfField:" + numOfField); + int num_of_row = (numOfField / number_of_column); + for (int i = 0; i < num_of_row; i++) { + AbstractItem item = new AbstractItem(dataRowRepeater.newChildId()); + dataRowRepeater.add(item); + //添加了一行 + RepeatingView columnRepeater = new RepeatingView("columnRepeater"); + item.add(columnRepeater); + //行内添加两列元素 + for (int j = 0; j < 2 * number_of_column; j++) { + AbstractItem columnitem = new AbstractItem(columnRepeater.newChildId(), new Model(String.valueOf(primaryKeyName))); + Field currentField = visibleFields.get(i * number_of_column + j / 2); + if (j % 2 == 0) { + columnitem.add(new TextFragment("editdata", "textFragment", this, currentField.getDisplay() + ":")); + if (currentField.isRequired()) { + columnitem.add(new AttributeAppender("class", new Model("tag"), " ")).add(new AttributeAppender("style", new Model("color:red"), ";")); + }else{ + columnitem.add(new AttributeAppender("class", new Model("tag"), " ")); + } + fieldNames.add(currentField.getName()); + } else { + String fieldName = null; + if (currentField.getName().equals("name")) { + fieldName = user.getName(); + } else if (currentField.getName().equalsIgnoreCase("cellPhone")) { + fieldName = user.getCellPhone(); + } else if (currentField.getName().equals("loginName")) { + fieldName = user.getLoginName(); + } else if (currentField.getName().equals("sex")) { + fieldName = "" + user.getSex(); + } else if (currentField.getName().equals("office_tel")){ + fieldName = "" + user.getOffice_tel(); + }else { + fieldName = user.getEmail(); + } + if (currentField.getName().equals("sex")) { + List pickList = DAOImpl.queryPickList(currentField.getPicklist()); + Map list = Maps.newHashMap(); + List ids = Lists.newArrayList(); + for (Choice p : pickList) { + list.put(p.getId(), p.getVal()); + ids.add(p.getId()); + } + IModel choiceModel = new Model(Long.parseLong("" + user.getSex())); + models.put(currentField.getName(), choiceModel); + fieldNameToModel.put(currentField.getName(), choiceModel); + columnitem.add(new DropDownChoiceFragment("editdata", "dropDownFragment", this, ids, list, choiceModel)); + } else { + IModel textModel = new Model(""); + models.put(CRMUtility.formatValue(currentField.getFormatter(), String.valueOf(fieldName)), textModel); + fieldNameToModel.put(currentField.getName(), textModel); + columnitem.add(new TextInputFragment("editdata", "textInputFragment", this, textModel, fieldName, currentField)); + } + } + columnRepeater.add(columnitem); + } + } + //add user photo + //create edit userForm + + Form form = new Form("form") { + @Override + protected void onSubmit() { + logger.debug("the form was submitted!"); + String userName = ""; + String cellPhone = ""; + String email = ""; + String photo = ""; + String loginName = ""; + String office = ""; + int sex = 0; + for (String k : fieldNameToModel.keySet()) { + logger.debug("k" + k); + String value = fieldNameToModel.get(k).getObject() == null ? null : String.valueOf(fieldNameToModel.get(k).getObject()); + if (k.equals("name")) { + userName = value; + } else if (k.equals("cellPhone")) { + cellPhone = value; + } else if (k.equals("photo")) { + photo = value; + } else if (k.equals("sex")) { + sex = Integer.parseInt(value); + } else if (k.equals("loginName")) { + loginName = value; + } else if(k.equals("email")){ + email = value; + }else if(k.equals("office_tel")){ + office = value; + } + } + int userId = Integer.parseInt(((SignIn2Session) getSession()).getUserId()); + UserInfo userinfo = DAOImpl.getUserInfoById(userId); + List loginNames =DAOImpl.getLoginNames(String.valueOf(userId)); + if(loginNames.contains(loginName)){ + errordiv.add(new AttributeAppender("style",new Model("display:block"),";")); + errorgroup.add(new AttributeAppender("style",new Model("display:block"),";")); + errorpromptLabel.add(new AttributeAppender("style",new Model("display:block"),";")); + errorpromptButton.add(new AttributeAppender("style",new Model("display:block"),";")); + setResponsePage(new UserDeatialInfo("failure")); + }else{ + if(DAOImpl.updateStatusOfInternalMeeting(userId, userName, cellPhone, email, photo, sex, loginName,office)){ + div.add(new AttributeAppender("style",new Model("display:block"),";")); + group.add(new AttributeAppender("style",new Model("display:block"),";")); + promptLabel.add(new AttributeAppender("style",new Model("display:block"),";")); + promptButton.add(new AttributeAppender("style",new Model("display:block"),";")); + setResponsePage(new UserDeatialInfo("success")); + }; + } + } + }; + form.add(fieldGroupRepeater); + add(form); + } + + private class TextInputFragment extends Fragment { + + public TextInputFragment(String id, String markupId, + MarkupContainer markupProvider, IModel model, String value, Field currentField) { + super(id, markupId, markupProvider); + TextField text = new TextField("input", model); + text.add(new AttributeModifier("value", new Model(value))); + if (!currentField.isEditable()) { + text.add(new AttributeAppender("disabled", new Model("disabled"), ";")); + } + if (currentField.isRequired()) { + //text.add(new AttributeModifier("required", new Model("required"))); + text.add(new AttributeAppender("class",new Model("required-field")," ")); + } + if (currentField.getDataType().equals("tel") || currentField.getDataType().equals("fax")) { + text.add(new AttributeModifier("pattern", new Model("^((\\d{11})|^((\\d{7,8})|(\\d{4}|\\d{3})-(\\d{7,8})|(\\d{4}|\\d{3})-(\\d{7,8})-(\\d{4}|\\d{3}|\\d{2}|\\d{1})|(\\d{7,8})-(\\d{4}|\\d{3}|\\d{2}|\\d{1}))$)"))); + } + text.add(new AttributeModifier("type", new Model(currentField.getDataType()))); + text.add(new AttributeModifier("id", new Model(currentField.getName()))); + add(text); + } + } + + private class TextFragment extends Fragment { + + public TextFragment(String id, String markupId, + MarkupContainer markupProvider, String label) { + super(id, markupId, markupProvider); + add(new Label("celldata", label)); + } + } + + private class DropDownChoiceFragment extends Fragment { + + public DropDownChoiceFragment(String id, String markupId, + MarkupContainer markupProvider, final List ids, + final Map list, IModel model) { + super(id, markupId, markupProvider); + add(new DropDownChoice("dropDownInput", model, ids, + new IChoiceRenderer() { + @Override + public Object getDisplayValue(Long id) { + // TODO Auto-generated method stub + return list.get(id); + } + + @Override + public String getIdValue(Long id, int index) { + return String.valueOf(id); + } + })); + } + } +} diff --git a/crm/src/main/java/com/rex/crm/UserInfoSettingPage.html b/crm/src/main/java/com/rex/crm/UserInfoSettingPage.html new file mode 100644 index 0000000..20f30f8 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/UserInfoSettingPage.html @@ -0,0 +1,26 @@ + + + + + +
+
+
+ +
+
+ +
+
+
+
+ + diff --git a/crm/src/main/java/com/rex/crm/UserInfoSettingPage.java b/crm/src/main/java/com/rex/crm/UserInfoSettingPage.java new file mode 100644 index 0000000..2059ee4 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/UserInfoSettingPage.java @@ -0,0 +1,65 @@ +package com.rex.crm; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.wicket.behavior.AttributeAppender; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.link.BookmarkablePageLink; +import org.apache.wicket.markup.html.list.ListItem; +import org.apache.wicket.markup.html.list.ListView; +import org.apache.wicket.model.Model; + +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Lists; +/** + * + * @author brenda.yuan + * + */ +public class UserInfoSettingPage extends TemplatePage{ + + private static final long serialVersionUID = 1L; + protected static ImmutableMap pageMenuMap; + static{ + //TODO Load them from configuration + ImmutableMap.Builder builder = new ImmutableMap.Builder(); + + MenuItem item = new MenuItem(); + item.setCaption("个人信息"); + item.setDestination(UserDeatialInfo.class); + item.setId("navitem-userdetailInfo"); + builder.put("userDetailInfo", item); + + item = new MenuItem(); + item.setCaption("修改密码"); + item.setDestination(UpdateSignPassword.class); + item.setId("navitem-updateSignPassword"); + builder.put("updateSignPassword", item); + + pageMenuMap = builder.build(); + } + public UserInfoSettingPage(){ + setPageTitle("账号管理"); + List menulist = Lists.newArrayList(); + menulist.add("userDetailInfo"); + menulist.add("updateSignPassword"); + ArrayList menu = Lists.newArrayList(); + for(String key:menulist){ + menu.add(pageMenuMap.get(key)); + } + ListView lv = new ListView("userMenu", menu) { + @Override + protected void populateItem(ListItem item) { + MenuItem menuitem = (MenuItem) item.getModelObject(); + BookmarkablePageLink link = new BookmarkablePageLink("link", menuitem.getDestination()); + link.add(new Label("caption", menuitem.getCaption()).setEscapeModelStrings(false)); + item.add(link); + item.add(new AttributeAppender("id", Model.of(menuitem.getId()))); + // item.add(new SimpleAttributeModifier("class", "my-css-class")); + + } + }; + add(lv); + } +} diff --git a/crm/src/main/java/com/rex/crm/WicketApplication.java b/crm/src/main/java/com/rex/crm/WicketApplication.java new file mode 100644 index 0000000..89c32ca --- /dev/null +++ b/crm/src/main/java/com/rex/crm/WicketApplication.java @@ -0,0 +1,131 @@ +package com.rex.crm; + +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.Executors; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +import org.apache.wicket.Component; +import org.apache.wicket.RestartResponseAtInterceptPageException; +import org.apache.wicket.RuntimeConfigurationType; +import org.apache.wicket.Session; +import org.apache.wicket.authorization.Action; +import org.apache.wicket.authorization.IAuthorizationStrategy; +import org.apache.wicket.markup.html.WebPage; +import org.apache.wicket.protocol.http.WebApplication; +import org.apache.wicket.request.Request; +import org.apache.wicket.request.Response; +import org.apache.wicket.request.component.IRequestableComponent; +import org.apache.wicket.request.resource.SharedResourceReference; +import org.apache.wicket.util.file.File; + +import com.rex.crm.admin.AdminTreePage; +import com.rex.crm.common.CreateDataPage; +import com.rex.crm.common.EditDataPage; +import com.rex.crm.common.EntityDetailPage; +import com.rex.crm.util.CRMUtility; + +/** + * Application object for your web application. If you want to run this application without deploying, run the Start class. + * + * @see com.rex.Start#main(String[]) + */ +public class WicketApplication extends WebApplication +{ + + + + @Override + public RuntimeConfigurationType getConfigurationType() { + // TODO Auto-generated method stub + return RuntimeConfigurationType.DEPLOYMENT; + } + + /** + * @see org.apache.wicket.Application#getHomePage() + */ + @Override + public Class getHomePage() + { + return HomePage.class; + } + + @Override + public Session newSession(Request request, Response response) + { + return new SignIn2Session(request); + } + /** + * @see org.apache.wicket.Application#init() + */ + @Override + public void init() + { + super.init(); + + getRequestCycleSettings().setResponseRequestEncoding("UTF-8"); + getMarkupSettings().setDefaultMarkupEncoding("UTF-8"); + // add your configuration here + getSharedResources().add("image", new FolderResource(new File(getServletContext().getRealPath("image")))); + mountResource("/image", new SharedResourceReference("image")); + + mountPage("/mount/searchContactPage", SearchContactPage.class); + mountPage("/mount/createEventPage", CreateEventPage.class); + mountPage("/mount/eventViewer",EventViewerPage.class); + mountPage("/mount/searchCRMUser", SearchCRMUserPage.class); + mountPage("/mount/ActivitedUser", ActivitedUser.class); + mountPage("/mount/CreateDataPage", CreateDataPage.class); + mountPage("/mount/ActivitySelectPage",ActivitySelectPage.class); + mountPage("/mount/EntityDetailPage",EntityDetailPage.class); + mountPage("/mount/AdminTreePage",AdminTreePage.class); + mountPage("/mount/AccountPage",AccountPage.class); + + // Register the authorization strategy + getSecuritySettings().setAuthorizationStrategy(new IAuthorizationStrategy() + { + public boolean isActionAuthorized(Component component, Action action) + { + // authorize everything + return true; + } + + public boolean isInstantiationAuthorized( + Class componentClass) + { + // Check if the new Page requires authentication (implements the marker interface) + if (AuthenticatedWebPage.class.isAssignableFrom(componentClass)) + { + // Is user signed in? + if (((SignIn2Session)Session.get()).isSignedIn()) + { + // okay to proceed + return true; + } + + // Intercept the request, but remember the target for later. + // Invoke Component.continueToOriginalDestination() after successful logon to + // continue with the target remembered. + throw new RestartResponseAtInterceptPageException(SignIn.class); + } + + // okay to proceed + return true; + } + }); + + + + + } + + @Override + protected void onDestroy() { + CRMUtility.getThreadPoolExecutor().shutdown(); + super.onDestroy(); + } + + + + +} diff --git a/crm/src/main/java/com/rex/crm/admin/AdminTemplatePage.html b/crm/src/main/java/com/rex/crm/admin/AdminTemplatePage.html new file mode 100755 index 0000000..c9c9b88 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/admin/AdminTemplatePage.html @@ -0,0 +1,28 @@ + + + + + +
+ + + +
+
+ +
+
+ + diff --git a/crm/src/main/java/com/rex/crm/admin/AdminTemplatePage.java b/crm/src/main/java/com/rex/crm/admin/AdminTemplatePage.java new file mode 100644 index 0000000..691d7bd --- /dev/null +++ b/crm/src/main/java/com/rex/crm/admin/AdminTemplatePage.java @@ -0,0 +1,46 @@ +package com.rex.crm.admin; + +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang3.tuple.Pair; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.CheckBox; +import org.apache.wicket.markup.html.form.CheckGroup; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.link.BookmarkablePageLink; +import org.apache.wicket.markup.html.list.ListItem; +import org.apache.wicket.markup.html.list.ListView; +import org.apache.wicket.model.IModel; +import org.apache.wicket.model.Model; +import org.apache.wicket.model.PropertyModel; + +import com.google.common.base.Joiner; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.rex.crm.TemplatePage; +import com.rex.crm.common.Entity; +import com.rex.crm.common.Field; +import com.rex.crm.common.FilterPanel; +import com.rex.crm.common.PageableTablePanel; +import com.rex.crm.db.DAOImpl; +import com.rexen.crm.beans.UserRole; +import com.rex.crm.util.Configuration; + +/** + * @author Feiyun Zhou + */ +public class AdminTemplatePage extends TemplatePage +{ + private String search_target = ""; + + /** + * Constructor + */ + public AdminTemplatePage() + { + this.setPageTitle("系统管理"); + } + +} \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/admin/AdminTreePage.html b/crm/src/main/java/com/rex/crm/admin/AdminTreePage.html new file mode 100755 index 0000000..6846780 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/admin/AdminTreePage.html @@ -0,0 +1,45 @@ + + + + + + +
+
+
+
岗位树 +
+
+
+
+ +
+
+
+
+ data table +
+
+
+
+ +
+
+ + diff --git a/crm/src/main/java/com/rex/crm/admin/AdminTreePage.java b/crm/src/main/java/com/rex/crm/admin/AdminTreePage.java new file mode 100644 index 0000000..9e4a62b --- /dev/null +++ b/crm/src/main/java/com/rex/crm/admin/AdminTreePage.java @@ -0,0 +1,111 @@ +package com.rex.crm.admin; + +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.wicket.markup.head.IHeaderResponse; +import org.apache.wicket.markup.head.JavaScriptHeaderItem; +import org.apache.wicket.markup.html.panel.EmptyPanel; +import org.apache.wicket.request.mapper.parameter.PageParameters; +import org.apache.wicket.util.string.StringValue; +import org.apache.wicket.util.template.PackageTextTemplate; + +import com.google.gson.Gson; +import com.rex.crm.common.AccountPositionPanel; +import com.rex.crm.common.Entity; +import com.rex.crm.common.EntityDetailContainerPanel; +import com.rex.crm.common.PageableTablePanel; +import com.rex.crm.common.tree.Node; +import com.rex.crm.common.tree.TreeFactory; +import com.rex.crm.common.tree.TreePanel; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.util.Configuration; + +/** + * @author Feiyun Zhou + */ +public class AdminTreePage extends AdminTemplatePage +{ + + private String search_target = ""; + + /** + * Constructor + */ + public AdminTreePage() + { + setPageTitle("系统管理-岗位树"); + StringValue positionId = getRequest().getRequestParameters().getParameterValue("positionId"); + if (positionId.isEmpty() || positionId.isNull()) + { + initPage(null); + } + else + { + initPage(positionId.toString()); + } + + urlFor(AdminTreePage.class, null); + + } + + public AdminTreePage(String reportto) { + setPageTitle("系统管理-岗位树"); + initPage(reportto); + urlFor(AdminTreePage.class, null); + + } + + private void initPage(final String positionId) + { + Gson gson = new Gson(); + String result = gson.toJson(TreeFactory.createPositionTree(), Node.class); + add(new TreePanel("treePanel", result)); + Map entities = Configuration.getEntityTable(); + if (positionId != null) + { + if (positionId.equals("-1")) + { + List tdata = DAOImpl.queryEntityRelationList("select * from user_position_query"); + add(new PageableTablePanel("datalist", entities.get("user_position_query"), tdata, null)); + + }else{ + PageParameters pp = new PageParameters(); + pp.add("positionId", positionId); + EntityDetailContainerPanel panel = new EntityDetailContainerPanel("datalist", "crmuser", positionId, this.getClass(), pp); + add(panel); + } + } + else + { + add(new EmptyPanel("datalist")); + } + } + + @Override + public void renderHead(IHeaderResponse response) + { + super.renderHead(response); + StringValue act_key = getRequest().getRequestParameters().getParameterValue("positionId"); + Map map = new HashMap<>(); + + map.put("act_key", act_key.toString()); + PackageTextTemplate ptt = new PackageTextTemplate(getClass(), "adminpage.js"); + //OnDomReadyHeaderItem onDomReadyHeaderItem = OnDomReadyHeaderItem.forScript( ptt.asString( map ) ); + //response.render(onDomReadyHeaderItem); + System.out.println(ptt.asString(map)); + response.render(JavaScriptHeaderItem.forScript(ptt.asString(map), null)); + + try + { + ptt.close(); + } + catch (IOException e) + { + e.printStackTrace(); + } + } + +} diff --git a/crm/src/main/java/com/rex/crm/admin/DataImportPage.html b/crm/src/main/java/com/rex/crm/admin/DataImportPage.html new file mode 100644 index 0000000..d73e704 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/admin/DataImportPage.html @@ -0,0 +1,64 @@ + + + + + +
+
+
+ + +

+ +

+    + 查看日志 +

+ +
+
+
+
+ +

模板

+ +

+

注意事项

+
导入顺序
+

数据导入功能主要用于系统数据的初始化,以及大批量数据的更改与调整;在数据初始化时候,数据初始化的顺序一次为

+
    +
  1. 岗位信息、医院信息、用户信息
  2. +
  3. 医生信息、岗位汇报关系、岗位与用户的对应关系、医院与岗位对应关系
  4. +
+
导入逻辑
+
    +
  1. 医院信息导入:以BDM编码为标识,通过BDM编码进行新增与更新操作
  2. +
  3. 岗位信息导入:以岗位编码为标识,通过岗位编码进行新增与更新操作
  4. +
  5. 用户信息导入:以用户员工号为标识,通过员工号进行新增与更新操作
  6. +
  7. 医生信息导入:以医生CRM编码为标识,通过CRM编码进行新增与更新操作,在导入医生的时候,如果指定了医院的BDM编码,那么医生与医院的对应关系也 将被导入;如果在医生导入的CSV文件中,没有BDM编码,那么这条医生记录将不会被导入到系统中
  8. + +
  9. 岗位汇报关系导入:以岗位编码为标识,通过岗位编码进行更新岗位的汇报关 系,前提必要条件是所有的岗位信息必须存在
  10. +
  11. 岗位与用户的对应关系导入:按照岗位编码为标识,通过岗位编码进行新增与 更新操作,目前不保留岗位与用户对应信息的历史;未来系统将支持岗位与用户对 应关 系历史
  12. +
  13. 医院与岗位对应关系导入:以岗位编码与BDM编码联合为标识,进行新增操作, 目前只支持全量的导入,既在导入过程中,系统将删除所有的岗位与医院对应关 系;在后续的开发过程当中,我们会开发一个架构调整模块来专门支持在各个岗位 节点的新增,更新,删除操作
  14. +
+
+
+ +
+ + + diff --git a/crm/src/main/java/com/rex/crm/admin/DataImportPage.java b/crm/src/main/java/com/rex/crm/admin/DataImportPage.java new file mode 100644 index 0000000..7a22241 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/admin/DataImportPage.java @@ -0,0 +1,194 @@ +package com.rex.crm.admin; + +import java.io.IOException; +import java.nio.charset.Charset; +import java.util.List; + +import org.apache.log4j.Logger; +import org.apache.wicket.markup.html.form.DropDownChoice; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.IChoiceRenderer; +import org.apache.wicket.markup.html.form.upload.FileUpload; +import org.apache.wicket.markup.html.form.upload.FileUploadField; +import org.apache.wicket.markup.html.link.BookmarkablePageLink; +import org.apache.wicket.markup.html.link.DownloadLink; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.model.IModel; +import org.apache.wicket.model.Model; +import org.apache.wicket.model.PropertyModel; +import org.apache.wicket.util.file.File; + +import com.google.common.base.Charsets; +import com.google.common.collect.Lists; +import com.google.common.io.Files; +import com.rex.crm.admin.AdminTemplatePage; +import com.rex.crm.beans.Choice; +import com.rex.crm.dataport.DataImporter; +import com.rex.crm.dataport.ImportDataWizard; +import com.rex.crm.util.CRMUtility; +import com.rexen.crm.integration.DataImportDelegate; + +/** + * @author Feiyun Zhou + */ +public class DataImportPage extends AdminTemplatePage +{ + private static final Logger logger = Logger.getLogger(ImportDataWizard.class); + private static final List choiceList = Lists.newArrayList(); + static { + choiceList.add(new Choice(0L, "导入医院")); + choiceList.add(new Choice(1L, "导入医生")); + choiceList.add(new Choice(2L, "导入岗位")); + choiceList.add(new Choice(3L, "导入岗位汇报关系")); + choiceList.add(new Choice(4L, "导入用户")); + choiceList.add(new Choice(5L, "导入岗位和医院关系")); + choiceList.add(new Choice(6L, "导入用户和岗位关系")); + } + private FileUploadField fileUploadField; + private Choice selected_entity = choiceList.get(0); + BookmarkablePageLink view_log_btn ; + + public DataImportPage() + { + setPageTitle("系统管理-数据导入"); + init(); + } + + public void init() + { + fileUploadField = new FileUploadField("fileUpload"); + + Form form = new Form("form"){ + + protected void onSubmit() + { + if(selected_entity ==null) return; + logger.debug("selected_entity:"+ selected_entity.getId()); + + //DataImportDelegate da = new DataImportDelegate(); + FileUpload fileupload = fileUploadField.getFileUpload(); + String outputfolder = CRMUtility.readFileAttribure("uploadpath"); + + java.io.File tmpDir = null; + tmpDir = Files.createTempDir(); + if (fileupload != null) + { + + + try + { + + + String gbk_tmpFileName = tmpDir.getAbsolutePath() + File.separator+ "gbk_"+fileupload.getClientFileName(); + String utf8_tmpFileName = tmpDir.getAbsolutePath() + File.separator+ "utf8_"+fileupload.getClientFileName(); + fileupload.writeTo(new File(gbk_tmpFileName)); + fileupload.closeStreams(); + String file_content = Files.toString(new File(gbk_tmpFileName), Charset.forName("gbk")); + Files.write(file_content, new File(utf8_tmpFileName), Charsets.UTF_8); + logger.debug("UTF8 format file:"+ utf8_tmpFileName); + + logger.debug("selected_entity:"+selected_entity.getVal()); + String entityName = ""; + int entityId = (int)selected_entity.getId(); + switch(entityId){ + case 0: + entityName = "account"; + break; + case 1: + entityName = "contact"; + break; + case 2: + entityName = "crmuser"; + break; + case 3: + entityName = "crmuser"; + break; + case 4: + entityName = "userinfo"; + break; + case 5: + entityName = "accountcrmuser"; + break; + case 6: + entityName = "user_position"; + break; + + } + + if(entityName.isEmpty()) { + logger.debug("entity name is null"); + return; + } + + + DataImporter.importDataOnBackground(entityName, utf8_tmpFileName); + //da.load(template, FileName.toString()); + //this.setResponsePage(ImportLogPage.class); + view_log_btn.setVisible(true); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + } + }; + + add(form); + form.add(fileUploadField); + form.setMultiPart(true); + IModel choices = Model.ofList(choiceList); + + DropDownChoice dropdown = createDropDownListFromPickList("entityName", choices, new PropertyModel(this,"selected_entity")); + form.add(dropdown); + + view_log_btn = new BookmarkablePageLink("view_log_btn",ImportLogPage.class ); + form.add(view_log_btn); + view_log_btn.setVisible(false); + + File account_template = new File(DataImportPage.class.getResource("/templates/account.csv").getPath()); + add(new DownloadLink("account_template", account_template,"1医院模板.csv")); + + File contact_template = new File(DataImportPage.class.getResource("/templates/contact.csv").getPath()); + add(new DownloadLink("contact_template", contact_template,"2医生模板.csv")); + + File user_template = new File(DataImportPage.class.getResource("/templates/userinfo.csv").getPath()); + add(new DownloadLink("user_template", user_template,"5用户模板.csv")); + + File crmuser_template = new File(DataImportPage.class.getResource("/templates/crmuser.csv").getPath()); + add(new DownloadLink("crmuser_template", crmuser_template,"3岗位模板.csv")); + + File crmuser_report_template = new File(DataImportPage.class.getResource("/templates/crmuser_reportto.csv").getPath()); + add(new DownloadLink("crmuser_report_template", crmuser_report_template,"4岗位汇报关系模板.csv")); + + File accountcrmuser_template = new File(DataImportPage.class.getResource("/templates/accountcrmuser.csv").getPath()); + add(new DownloadLink("accountcrmuser_template", accountcrmuser_template,"6岗位和医院关系模板.csv ")); + + File user_position_template= new File(DataImportPage.class.getResource("/templates/user_position.csv").getPath()); + add(new DownloadLink("user_position_template", user_position_template,"7用户和岗位关系模板.csv")); + + } + + + private DropDownChoice createDropDownListFromPickList(String markupId,IModel choices,IModel default_model) { + + DropDownChoice choice = new DropDownChoice(markupId, default_model, choices, + new IChoiceRenderer() { + @Override + public Object getDisplayValue(Choice choice) { + // TODO Auto-generated method stub + return choice.getVal(); + } + @Override + public String getIdValue(Choice choice, int index) { + // TODO Auto-generated method stub + return String.valueOf(choice.getId()); + } + + + }); + + choice.setNullValid(true); + return choice; + } +} \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/admin/DownloadPage.html b/crm/src/main/java/com/rex/crm/admin/DownloadPage.html new file mode 100644 index 0000000..e0b5ace --- /dev/null +++ b/crm/src/main/java/com/rex/crm/admin/DownloadPage.html @@ -0,0 +1,27 @@ + + + + + + + +
+
+ +
+ + + diff --git a/crm/src/main/java/com/rex/crm/admin/DownloadPage.java b/crm/src/main/java/com/rex/crm/admin/DownloadPage.java new file mode 100644 index 0000000..25a4649 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/admin/DownloadPage.java @@ -0,0 +1,154 @@ +package com.rex.crm.admin; + +import java.util.Map; + +import javax.servlet.http.HttpServletResponse; + +import org.apache.wicket.markup.html.link.Link; +import com.rex.crm.SignIn2Session; +import com.rexen.crm.integration.DataExportDelegate; +import com.rex.crm.common.Entity; +import com.rex.crm.util.Configuration; + + +/** + * @author Feiyun Zhou + */ +public class DownloadPage extends AdminTemplatePage{ + + public DownloadPage(){ + setPageTitle("系统管理-下载数据"); + init(); + } + + public void init() + { + final int roleId = ((SignIn2Session)getSession()).getRoleId(); + Map entities = Configuration.getEntityTable(); + final Entity entity = entities.get("downLoad"); +// setPageTitle(entity.getDisplay()); + //List mapList = DAOImpl.queryEntityList(entity.getSql(), 0, 1000); + //TODO get userId from request's session + + add(new Link("account") { + + @Override + public void onClick() { + DataExportDelegate dataExport = new DataExportDelegate(); +// String template = DAOImpl.selectTemplate(); + String teample = "Account Export Full Template 1.0"; + HttpServletResponse response = (HttpServletResponse)getRequestCycle().getResponse().getContainerResponse(); + try + { + dataExport.export(teample, response); + } + catch (Exception e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + setResponsePage(new DownloadPage()); + } + }); + add(new Link("contact") { + + @Override + public void onClick() { + DataExportDelegate dataExport = new DataExportDelegate(); +// String template = DAOImpl.selectTemplate(); + String teample = "Contact Export Full Template 1.0"; + HttpServletResponse response = (HttpServletResponse)getRequestCycle().getResponse().getContainerResponse(); + try + { + dataExport.export(teample, response); + } + catch (Exception e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + setResponsePage(new DownloadPage()); + } + }); + add(new Link("position") { + + @Override + public void onClick() { + DataExportDelegate dataExport = new DataExportDelegate(); +// String template = DAOImpl.selectTemplate(); + String teample = "Position Export Full Template 1.0"; + HttpServletResponse response = (HttpServletResponse)getRequestCycle().getResponse().getContainerResponse(); + try + { + dataExport.export(teample, response); + } + catch (Exception e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + setResponsePage(new DownloadPage()); + } + }); + add(new Link("activity") { + + @Override + public void onClick() { + DataExportDelegate dataExport = new DataExportDelegate(); +// String template = DAOImpl.selectTemplate(); + String teample = "Activity Export Full Template 1.0"; + HttpServletResponse response = (HttpServletResponse)getRequestCycle().getResponse().getContainerResponse(); + try + { + dataExport.export(teample, response); + } + catch (Exception e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + setResponsePage(new DownloadPage()); + } + }); + add(new Link("accountCrmuser") { + + @Override + public void onClick() { + DataExportDelegate dataExport = new DataExportDelegate(); +// String template = DAOImpl.selectTemplate(); + String teample = "Account Team Export Full Template 1.0"; + HttpServletResponse response = (HttpServletResponse)getRequestCycle().getResponse().getContainerResponse(); + try + { + dataExport.export(teample, response); + } + catch (Exception e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + setResponsePage(new DownloadPage()); + } + }); + add(new Link("userPosition") { + + @Override + public void onClick() { + DataExportDelegate dataExport = new DataExportDelegate(); +// String template = DAOImpl.selectTemplate(); + String teample = "UserPosition Team Export Full Template 1.0"; + HttpServletResponse response = (HttpServletResponse)getRequestCycle().getResponse().getContainerResponse(); + try + { + dataExport.export(teample, response); + } + catch (Exception e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + setResponsePage(new DownloadPage()); + } + }); + } +} \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/admin/ImportLogPage.html b/crm/src/main/java/com/rex/crm/admin/ImportLogPage.html new file mode 100644 index 0000000..eb366de --- /dev/null +++ b/crm/src/main/java/com/rex/crm/admin/ImportLogPage.html @@ -0,0 +1,36 @@ + + + + + + +
+ + + + + +
+
+ +
+
+ 刷新   + 导入   +

+ data table +

+
+
+
+
+ +
+ + diff --git a/crm/src/main/java/com/rex/crm/admin/ImportLogPage.java b/crm/src/main/java/com/rex/crm/admin/ImportLogPage.java new file mode 100644 index 0000000..e2d7e9f --- /dev/null +++ b/crm/src/main/java/com/rex/crm/admin/ImportLogPage.java @@ -0,0 +1,111 @@ +package com.rex.crm.admin; + +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang3.tuple.Pair; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.form.upload.FileUpload; +import org.apache.wicket.markup.html.form.upload.FileUploadField; +import org.apache.wicket.markup.html.link.BookmarkablePageLink; +import org.apache.wicket.model.PropertyModel; +import org.apache.wicket.util.file.File; + +import com.google.common.collect.Lists; +import com.rex.crm.SignIn2Session; +import com.rex.crm.common.Entity; +import com.rex.crm.common.Field; +import com.rex.crm.common.FilterPanel; +import com.rex.crm.common.PageableTablePanel; +import com.rex.crm.dataport.ImportDataWizard; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.util.CRMUtility; +import com.rex.crm.util.Configuration; +import com.rexen.crm.beans.UserRole; +import com.rexen.crm.integration.DataImportDelegate; + +/** + * @author Feiyun Zhou + */ +public class ImportLogPage extends AdminTemplatePage { + private String search_target = ""; + + public ImportLogPage() { + initPage(null, null); + } + + public void initPage(final Map filter, List tdata) { + final Entity entity = Configuration.getEntityByName("importlog"); + final int roleId = ((SignIn2Session) getSession()).getRoleId(); + final String positionId = ((SignIn2Session) getSession()).getPositionId(); + setPageTitle("系统管理-导入日志"); + + String sql = entity.getSql(); + switch (roleId) { + case UserRole.USER_ROLE_ADMINISTRATOR: + sql = entity.getSqlAdmin(); + break; + case UserRole.USER_ROLE_MANAGER: + sql = entity.getSqlManager(); + break; + case UserRole.USER_ROLE_SALES: + sql = entity.getSql(); + break; + } + // List mapList = DAOImpl.queryEntityList(entity.getSql(), 0, 1000); + if (tdata == null || tdata.size() == 0) { + switch (roleId) { + case UserRole.USER_ROLE_ADMINISTRATOR: + tdata = DAOImpl.queryEntityRelationList(sql); + break; + case UserRole.USER_ROLE_MANAGER: + tdata = DAOImpl.queryEntityRelationList(sql, positionId, positionId); + break; + case UserRole.USER_ROLE_SALES: + tdata = DAOImpl.queryEntityRelationList(sql, positionId); + break; + } + + if (filter == null) { + switch (roleId) { + case UserRole.USER_ROLE_ADMINISTRATOR: + tdata = DAOImpl.queryEntityRelationList(sql); + break; + case UserRole.USER_ROLE_MANAGER: + tdata = DAOImpl.queryEntityRelationList(sql, positionId, positionId); + break; + case UserRole.USER_ROLE_SALES: + tdata = DAOImpl.queryEntityRelationList(sql, positionId); + break; + } + + } else { + List ft = Lists.newArrayList(); + for (String k : filter.keySet()) { + if (filter.get(k)) + ft.add(k); + } + + switch (roleId) { + case UserRole.USER_ROLE_ADMINISTRATOR: + tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft); + break; + case UserRole.USER_ROLE_MANAGER: + tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft, positionId, positionId); + break; + case UserRole.USER_ROLE_SALES: + tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft, positionId); + break; + } + + } + + } + add(new PageableTablePanel("datalist", entity, tdata, null)); + + add(new BookmarkablePageLink("refresh_btn", ImportLogPage.class)); + add(new BookmarkablePageLink("import_btn", DataImportPage.class)); + + } +} \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/admin/MergePage.html b/crm/src/main/java/com/rex/crm/admin/MergePage.html new file mode 100755 index 0000000..fdbe584 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/admin/MergePage.html @@ -0,0 +1,62 @@ + + + + + +
+
+
+
+ + + + + + + + + + + + + + + + + +
字段名称被合并目标合并目标合并结果
+
+ +
+
+ +
+ + + + + + +
+ + 查找 +    +
+
+ +
+ + diff --git a/crm/src/main/java/com/rex/crm/admin/MergePage.java b/crm/src/main/java/com/rex/crm/admin/MergePage.java new file mode 100644 index 0000000..d87976f --- /dev/null +++ b/crm/src/main/java/com/rex/crm/admin/MergePage.java @@ -0,0 +1,279 @@ +package com.rex.crm.admin; + +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.apache.wicket.AttributeModifier; +import org.apache.wicket.MarkupContainer; +import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior; +import org.apache.wicket.behavior.AttributeAppender; +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.DropDownChoice; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.HiddenField; +import org.apache.wicket.markup.html.form.IChoiceRenderer; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.link.BookmarkablePageLink; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.markup.html.link.PopupSettings; +import org.apache.wicket.markup.html.list.AbstractItem; +import org.apache.wicket.markup.html.panel.Fragment; +import org.apache.wicket.markup.repeater.RepeatingView; +import org.apache.wicket.model.IModel; +import org.apache.wicket.model.Model; +import org.apache.wicket.model.PropertyModel; +import org.apache.wicket.request.IRequestParameters; +import org.apache.wicket.request.mapper.parameter.PageParameters; +import org.apache.wicket.util.string.StringValue; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.rex.crm.beans.AdvancedSearchFilter; +import com.rex.crm.beans.Choice; +import com.rex.crm.common.EditDataFormPanel; +import com.rex.crm.common.Entity; +import com.rex.crm.common.EntityDetailPage; +import com.rex.crm.common.Field; +import com.rex.crm.common.FilterPanel; +import com.rex.crm.common.PageableTablePanel; +import com.rex.crm.common.advancedSearch.AdvancedSearchPage; +import com.rex.crm.common.advancedSearch.AdvancedSearchPanel; +import com.rex.crm.db.DAOImpl; +import com.rexen.crm.beans.UserRole; +import com.rex.crm.util.CRMUtility; +import com.rex.crm.util.Configuration; +import com.rex.crm.SelectEntryPage; +import com.rex.crm.SignIn2Session; + +/** + * @author Feiyun Zhou + */ +public class MergePage extends AdminTemplatePage { + private static final Logger logger = Logger.getLogger(MergePage.class); + private String search_target = ""; + private Map> fieldName_model = Maps.newHashMap(); + /** + * Constructor + */ + public MergePage() { + // PageParameters pp = new PageParameters(); + // IRequestParameters params = + // this.getRequestCycle().getRequest().getRequestParameters(); + String entityId_a = getRequest().getRequestParameters().getParameterValue("entityIda").toString(); + String entityId_b = getRequest().getRequestParameters().getParameterValue("entityIdb").toString(); + String entityName = getRequest().getRequestParameters().getParameterValue("entityName").toString(); + initPage(entityName, entityId_a, entityId_b); + } + public MergePage(String entityName,String entityId_f,String entityId_s) { + initPage(entityName, entityId_f, entityId_s); + } + + private void initPage(final String entityName, final String entityId_A, final String entityId_B) { + + final int roleId = ((SignIn2Session) getSession()).getRoleId(); + final Entity entity = Configuration.getEntityByName(entityName); + final String user = ((SignIn2Session) getSession()).getUser(); + final Map datalistA = DAOImpl.queryEntityById(entity.getSql_ent(), entityId_A); + Map datalistB = null; + if(entityId_B != null){ + datalistB = DAOImpl.queryEntityById(entity.getSql_ent(), entityId_B); + } + final Map datalistC = datalistB; + Form form = new Form("form"){ + + @Override + protected void onSubmit() { + List names = Lists.newArrayList(); + List values = Lists.newArrayList(); + logger.debug("fieldName_model:::"+fieldName_model); + for(String fieldName: fieldName_model.keySet()){ + IModel model = fieldName_model.get(fieldName); + Choice choice = model.getObject(); + if (choice != null) { + names.add(fieldName); + + Field field = entity.getFieldByName(fieldName); + + if (field.getPicklist() != null) { + values.add(choice.getKey()); + } else if(field.getDataType().equalsIgnoreCase("number")) { + values.add(choice.getKey()); + }else{ + values.add("'"+ choice.getKey() + "'"); + } + } + + } + logger.debug("names:"+names); + logger.debug("values:"+values); + try { + EditDataFormPanel.recordValueChanges(datalistC, entity, entityId_B, user, values, names, + entityName); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + DAOImpl.updateRecord(entityId_B, entityName, names, values); + DAOImpl.updateRecordStatus(entityId_A, entityName); + if(entityName.equalsIgnoreCase("contact")){ + DAOImpl.updateActivityCountactById(entityId_B,entityId_A); + } else{ + DAOImpl.updateAccountCountactById(entityId_B,entityId_A); + } + setResponsePage(new EntityDetailPage(entityName, entityId_B)); + } + + }; + add(form); + + RepeatingView row_repeater = new RepeatingView("row_repeater"); + form.add(row_repeater); + form.add(new Label("entityIda",entityId_A)); + form.add(new Label("entityName",entityName)); + int i = 0; + for (Field field : entity.getFields()) { + if(!field.isShow()||field.isPrimaryKey()) continue; + AbstractItem item = new AbstractItem(row_repeater.newChildId()); + row_repeater.add(item); + String field_name = field.getDisplay(); + item.add(new Label("field_name", field_name)); + String value_a = getFieldDisplayValueFromMap(datalistA, field); + String value_b = null; + String raw_value_b =null; + if(datalistB!=null){ + value_b = getFieldDisplayValueFromMap(datalistB, field); + raw_value_b = getFieldRawValueFromMap(datalistB,field); + } + String raw_value_a = getFieldRawValueFromMap(datalistA,field); + + + //add field_value_a + item.add(new Label("field_value_a",value_a)); + + //add field_value_b + if(value_b!=null||i>0){ + item.add(new Label("field_value_b",value_b)); + } else { + item.add(new RelationTableSearchFragment("field_value_b","relationTableSearchFragment", this, entity.getName(), entity.getName(), entity.getName(), null, entityId_A)); + } + + if ((!value_a.isEmpty() && !value_a.isEmpty())&&(!value_a.equalsIgnoreCase(value_b)) ) { + + if (field.getFieldType() != null && field.getFieldType().equalsIgnoreCase("auto")) { + + item.add(new Label("value_picker", value_b)); + } else { + // add the picker + List choices = Lists.newArrayList(); + Choice choice = new Choice(); + choice.setKey(raw_value_a); + choice.setVal(value_a); + choices.add(choice); + + choice = new Choice(); + choice.setKey(raw_value_b); + choice.setVal(value_b); + choices.add(choice); + + IModel model = new Model(); + fieldName_model.put(field.getName(), model); + IModel chocies_model = Model.ofList(choices); + item.add(new DropDownChoiceFragment("value_picker", "dropDownFragment", this, chocies_model, model)); + } + } else { + item.add(new WebMarkupContainer("value_picker")); + } + i++; + } + + } + + private class DropDownChoiceFragment extends Fragment { + public DropDownChoiceFragment(String id, String markupId, MarkupContainer markupProvider, IModel choices,IModel default_model) { + super(id, markupId, markupProvider); + DropDownChoice dropDownInput = createDropDownListFromPickList("dropDownInput",choices,default_model); + add(dropDownInput); + + } + + } + + private DropDownChoice createDropDownListFromPickList(String markupId,IModel choices,IModel default_model) { + + DropDownChoice choice = new DropDownChoice(markupId, default_model, choices, + new IChoiceRenderer() { + @Override + public Object getDisplayValue(Choice choice) { + // TODO Auto-generated method stub + return choice.getVal(); + } + @Override + public String getIdValue(Choice choice, int index) { + // TODO Auto-generated method stub + return choice.getKey(); + } + + + }); + + choice.setNullValid(true); + return choice; + } + + + private class RelationTableSearchFragment extends Fragment { + public RelationTableSearchFragment(String id, String markupId, MarkupContainer markupProvider, final String entityName, String excludeEntityName ,final String value, IModel model, final String eid) { + super(id, markupId, markupProvider); + + PageParameters params = new PageParameters(); + params.set("en", entityName); + params.set("excludeName", excludeEntityName); +// params.set("target", (long) model.getObject()); + params.set("eid", eid); + + PopupSettings popupSettings = new PopupSettings("查找"); + add(new BookmarkablePageLink("search_btn", SelectEntryPage.class, params).setPopupSettings(popupSettings)); + HiddenField hidden = new HiddenField("selected_id_hidden", model); + hidden.add(new AttributeAppender("id", entityName + "_id")); + add(hidden); + TextField text = new TextField("selected_value_input", new Model(value)); + text.add(new AttributeAppender("id", entityName + "_name")); + add(text); + } + } + + private String getFieldRawValueFromMap(Map data, Field field){ + Object rawvalue = data.get(field.getName()); + rawvalue = (rawvalue == null) ? "" : rawvalue; + String value = CRMUtility.formatValue(field.getFormatter(), String.valueOf(rawvalue)); + value = (value == null) ? "" : value; + + return value; + } + private String getFieldDisplayValueFromMap(Map data, Field field) { + String value = null; + + if (field.getPicklist() != null) { + + value = CRMUtility.formatValue(field.getFormatter(), DAOImpl.queryPickListByIdCached(field.getPicklist(), String.valueOf(data.get(field.getName())))); + value = (value == null) ? "" : value; + + } else if (field.getRelationTable() != null) { + value = CRMUtility.formatValue(field.getFormatter(), DAOImpl.queryCachedRelationDataById(field.getRelationTable(), String.valueOf(data.get(field.getName())))); + value = (value == null) ? "" : value; + + } else { + Object rawvalue = data.get(field.getName()); + rawvalue = (rawvalue == null) ? "" : rawvalue; + value = CRMUtility.formatValue(field.getFormatter(), String.valueOf(rawvalue)); + value = (value == null) ? "" : value; + } + + return value; + + } + +} \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/admin/PositionPage.html b/crm/src/main/java/com/rex/crm/admin/PositionPage.html new file mode 100644 index 0000000..f047203 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/admin/PositionPage.html @@ -0,0 +1,47 @@ + + + + + + +
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+ data table +
+
+
+
+
+ +
+ + diff --git a/crm/src/main/java/com/rex/crm/admin/PositionPage.java b/crm/src/main/java/com/rex/crm/admin/PositionPage.java new file mode 100644 index 0000000..b99b754 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/admin/PositionPage.java @@ -0,0 +1,195 @@ +package com.rex.crm.admin; + +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang3.tuple.Pair; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.model.PropertyModel; + +import com.google.common.collect.Lists; +import com.rex.crm.beans.Choice; +import com.rex.crm.common.Entity; +import com.rex.crm.common.Field; +import com.rex.crm.common.FilterPanel; +import com.rex.crm.common.PageableTablePanel; +import com.rex.crm.common.TableDataPanel; +import com.rex.crm.common.advancedSearch.AdvancedSearchPage; +import com.rex.crm.db.DAOImpl; +import com.rexen.crm.beans.UserRole; +import com.rex.crm.util.Configuration; +import com.rex.crm.SignIn2Session; + +/** + * @author Feiyun Zhou + */ +public class PositionPage extends AdminTemplatePage +{ + private String search_target = ""; + + /** + * Constructor + */ + public PositionPage() + { + initPage(null, null); + } + + public PositionPage(final Map filter, List tdata) + { + initPage(filter, tdata); + } + + public void initPage(final Map filter, List tdata) + { + Map entities = Configuration.getEntityTable(); + final Entity entity = entities.get("crmuser"); + final int roleId = ((SignIn2Session) getSession()).getRoleId(); + final String positionId = ((SignIn2Session) getSession()).getPositionId(); + setPageTitle("系统管理-岗位列表"); + + + Form form = new Form("form") + { + + @Override + protected void onSubmit() + { + String sql = entity.getSql(); + switch (roleId) + { + case UserRole.USER_ROLE_ADMINISTRATOR: + sql = entity.getSqlAdmin(); + break; + case UserRole.USER_ROLE_MANAGER: + sql = entity.getSqlManager(); + break; + case UserRole.USER_ROLE_SALES: + sql = entity.getSql(); + break; + } + + search_target = (search_target == null || search_target.equalsIgnoreCase("*")) ? "" : search_target; + + // sql = sql + " AND name like '%"+search_target+"%'"; + List searchableFields = entity.getSearchableFields(); + String joint = " like '%" + search_target + "%'"; + String likequery = ""; + for (Field sf : searchableFields) + { + likequery = likequery + " OR " + sf.getName() + joint; + } + + sql = sql + " where name like '%" + search_target + "%' " + likequery; + List datalist = null; + switch (roleId) + { + case UserRole.USER_ROLE_ADMINISTRATOR: + datalist = DAOImpl.queryEntityRelationList(sql); + break; + case UserRole.USER_ROLE_MANAGER: + datalist = DAOImpl.queryEntityRelationList(sql,positionId,positionId); + break; + case UserRole.USER_ROLE_SALES: + datalist = DAOImpl.queryEntityRelationList(sql, positionId); + break; + } + +// List datalist = DAOImpl.queryEntityRelationList(sql, "dummy"); + setResponsePage(new PositionPage(filter, datalist)); + + } + + }; + add(form); + form.add(new Link("ad_search_link"){ + @Override + public void onClick() { + setResponsePage(new AdvancedSearchPage(entity.getName(),null)); + + } + + }); + TextField search_input = new TextField("search_input", new PropertyModel(this, "search_target")); + form.add(search_input); + + String sql = entity.getSql(); + switch (roleId) + { + case UserRole.USER_ROLE_ADMINISTRATOR: + sql = entity.getSqlAdmin(); + break; + case UserRole.USER_ROLE_MANAGER: + sql = entity.getSqlManager(); + break; + case UserRole.USER_ROLE_SALES: + sql = entity.getSql(); + break; + } + // List mapList = DAOImpl.queryEntityList(entity.getSql(), 0, 1000); + if (tdata == null || tdata.size() == 0) + { + switch (roleId) + { + case UserRole.USER_ROLE_ADMINISTRATOR: + tdata = DAOImpl.queryEntityRelationList(sql); + break; + case UserRole.USER_ROLE_MANAGER: + tdata = DAOImpl.queryEntityRelationList(sql,positionId,positionId); + break; + case UserRole.USER_ROLE_SALES: + tdata = DAOImpl.queryEntityRelationList(sql, positionId); + break; + } + + if (filter == null) + { + switch (roleId) + { + case UserRole.USER_ROLE_ADMINISTRATOR: + tdata = DAOImpl.queryEntityRelationList(sql); + break; + case UserRole.USER_ROLE_MANAGER: + tdata = DAOImpl.queryEntityRelationList(sql,positionId,positionId); + break; + case UserRole.USER_ROLE_SALES: + tdata = DAOImpl.queryEntityRelationList(sql, positionId); + break; + } + + } + else + { + List ft = Lists.newArrayList(); + for (String k : filter.keySet()) + { + if (filter.get(k)) + ft.add(k); + } + + + switch (roleId) + { + case UserRole.USER_ROLE_ADMINISTRATOR: + tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft); + break; + case UserRole.USER_ROLE_MANAGER: + tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft, positionId,positionId); + break; + case UserRole.USER_ROLE_SALES: + tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft, positionId); + break; + } + + } + + } + add(new PageableTablePanel("datalist", entity, tdata, null)); + + List choices = DAOImpl.queryPickList(entity.getFieldByName(entity.getFilterField()).getPicklist()); + add(new FilterPanel("filterPanel", choices, filter, PositionPage.class,entity)); + + } +} \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/admin/PositionTreePage.html b/crm/src/main/java/com/rex/crm/admin/PositionTreePage.html new file mode 100644 index 0000000..6af19db --- /dev/null +++ b/crm/src/main/java/com/rex/crm/admin/PositionTreePage.html @@ -0,0 +1,44 @@ + + + + + +
+
+
+
区域管理 +
+
+
+
+ +
+
+
+
+ data table +
+
+
+
+ +
+
+ + diff --git a/crm/src/main/java/com/rex/crm/admin/PositionTreePage.java b/crm/src/main/java/com/rex/crm/admin/PositionTreePage.java new file mode 100644 index 0000000..1f9d956 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/admin/PositionTreePage.java @@ -0,0 +1,142 @@ +package com.rex.crm.admin; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.commons.beanutils.converters.IntegerArrayConverter; +import org.apache.commons.lang3.tuple.Pair; +import org.apache.wicket.markup.head.IHeaderResponse; +import org.apache.wicket.markup.head.JavaScriptHeaderItem; +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.CheckBox; +import org.apache.wicket.markup.html.form.CheckGroup; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.list.ListItem; +import org.apache.wicket.markup.html.list.ListView; +import org.apache.wicket.markup.html.panel.EmptyPanel; +import org.apache.wicket.model.IModel; +import org.apache.wicket.model.Model; +import org.apache.wicket.model.PropertyModel; +import org.apache.wicket.util.string.StringValue; +import org.apache.wicket.util.template.PackageTextTemplate; + +import com.google.common.base.Joiner; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.gson.Gson; +import com.rex.crm.beans.CRMUser; +import com.rex.crm.common.AccountPositionPanel; +import com.rex.crm.common.Entity; +import com.rex.crm.common.EntityDetailContainerPanel; +import com.rex.crm.common.Field; +import com.rex.crm.common.FilterPanel; +import com.rex.crm.common.PageableTablePanel; +import com.rex.crm.common.tree.Node; +import com.rex.crm.common.tree.TreeFactory; +import com.rex.crm.common.tree.TreePanel; +import com.rex.crm.db.DAOImpl; +import com.rexen.crm.beans.UserRole; +import com.rex.crm.util.Configuration; + +/** + * @author Feiyun Zhou + */ +public class PositionTreePage extends AdminTemplatePage +{ + + private String search_target = ""; + + /** + * Constructor + */ + public PositionTreePage() + { + setPageTitle("系统管理-区域管理"); + StringValue positionId = getRequest().getRequestParameters() + .getParameterValue("positionId"); + + int level = 0; + if (!positionId.isNull() && !positionId.isEmpty()) + { + level = DAOImpl.getLevelByPositionId(positionId.toInt()); + } + if (positionId.isEmpty() || positionId.isNull()) + { + initPage(null, 0); + } + else + { + initPage(positionId.toString(), level); + } + + urlFor(PositionTreePage.class, null); + + } + + public PositionTreePage(String id, String level) + { + setPageTitle("系统管理-区域管理"); + int lev = Integer.parseInt(level); + initPage(id, lev); + } + + private void initPage(final String positionId, int level) + { + Gson gson = new Gson(); + String result = gson.toJson(TreeFactory.createAccountPositionTree(),Node.class); + add(new TreePanel("treePanel", result)); + Map entities = Configuration.getEntityTable(); + + if (positionId != null) + { + if (positionId.equals("-1")) + { + List tdata = DAOImpl.queryEntityRelationList("select * from user_position_query"); + add(new PageableTablePanel("datalist", entities.get("user_position_query"), tdata, null)); + } + else + { + AccountPositionPanel panel = new AccountPositionPanel("datalist", + "crmuser", positionId, level); + add(panel); + } + } + else + { + add(new EmptyPanel("datalist")); + } + } + + @Override + public void renderHead(IHeaderResponse response) + { + super.renderHead(response); + StringValue act_key = getRequest().getRequestParameters() + .getParameterValue("positionId"); + Map map = new HashMap<>(); + + map.put("act_key", act_key.toString()); + PackageTextTemplate ptt = new PackageTextTemplate(getClass(), + "adminpage.js"); + // OnDomReadyHeaderItem onDomReadyHeaderItem = + // OnDomReadyHeaderItem.forScript( ptt.asString( map ) ); + // response.render(onDomReadyHeaderItem); + System.out.println(ptt.asString(map)); + response.render(JavaScriptHeaderItem.forScript(ptt.asString(map), null)); + + try + { + ptt.close(); + } + catch (IOException e) + { + e.printStackTrace(); + } + } + +} diff --git a/crm/src/main/java/com/rex/crm/admin/ProductPage.html b/crm/src/main/java/com/rex/crm/admin/ProductPage.html new file mode 100644 index 0000000..e9e16ca --- /dev/null +++ b/crm/src/main/java/com/rex/crm/admin/ProductPage.html @@ -0,0 +1,42 @@ + + + + + + +
+
+
+
+ +
+
+
+
+
+ data table +
+
+
+
+
+ +
+ + diff --git a/crm/src/main/java/com/rex/crm/admin/ProductPage.java b/crm/src/main/java/com/rex/crm/admin/ProductPage.java new file mode 100644 index 0000000..17c76f2 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/admin/ProductPage.java @@ -0,0 +1,121 @@ +package com.rex.crm.admin; + +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang3.tuple.Pair; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.model.PropertyModel; + +import com.google.common.collect.Lists; +import com.rex.crm.common.Entity; +import com.rex.crm.common.Field; +import com.rex.crm.common.FilterPanel; +import com.rex.crm.common.PageableTablePanel; +import com.rex.crm.common.TableDataPanel; +import com.rex.crm.common.advancedSearch.AdvancedSearchPage; +import com.rex.crm.db.DAOImpl; +import com.rexen.crm.beans.UserRole; +import com.rex.crm.util.Configuration; +import com.rex.crm.SignIn2Session; + +/** + * @author Feiyun Zhou + */ +public class ProductPage extends AdminTemplatePage +{ + private String search_target = ""; + + /** + * Constructor + */ + public ProductPage() + { + initPage(null, null); + } + + public ProductPage(final Map filter, List tdata) + { + initPage(filter, tdata); + } + + public void initPage(final Map filter, List tdata) + { + setPageTitle("系统管理-产品管理"); + Map entities = Configuration.getEntityTable(); + final Entity entity = entities.get("productline"); + final int roleId = ((SignIn2Session) getSession()).getRoleId(); + final String positionId = ((SignIn2Session) getSession()).getPositionId(); + + + Form form = new Form("form") + { + + @Override + protected void onSubmit() + { + String sql = entity.getSql(); + + + search_target = (search_target == null || search_target.equalsIgnoreCase("*")) ? "" : search_target; + + // sql = sql + " AND name like '%"+search_target+"%'"; + List searchableFields = entity.getSearchableFields(); + String joint = " like '%" + search_target + "%'"; + String likequery = ""; + for (Field sf : searchableFields) + { + likequery = likequery + " OR " + sf.getName() + joint; + } + + sql = sql + " where name like '%" + search_target + "%' " + likequery; + List datalist = null; + datalist = DAOImpl.queryEntityRelationList(sql); + +// List datalist = DAOImpl.queryEntityRelationList(sql, "dummy"); + setResponsePage(new ProductPage(filter, datalist)); + + } + + }; + add(form); + form.add(new Link("ad_search_link"){ + @Override + public void onClick() { + setResponsePage(new AdvancedSearchPage(entity.getName(),null)); + + } + + }); + TextField search_input = new TextField("search_input", new PropertyModel(this, "search_target")); + form.add(search_input); + + String sql = entity.getSql(); + // List mapList = DAOImpl.queryEntityList(entity.getSql(), 0, 1000); + if (tdata == null || tdata.size() == 0) + { + tdata = DAOImpl.queryEntityRelationList(sql); + + if (filter == null) + { + tdata = DAOImpl.queryEntityRelationList(sql); + } + else + { + List ft = Lists.newArrayList(); + for (String k : filter.keySet()) + { + if (filter.get(k)) + ft.add(k); + } + tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft); + } + + } + add(new PageableTablePanel("datalist", entity, tdata, null)); + + + } +} \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/admin/ProductTreePage.html b/crm/src/main/java/com/rex/crm/admin/ProductTreePage.html new file mode 100644 index 0000000..7025702 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/admin/ProductTreePage.html @@ -0,0 +1,45 @@ + + + + + + +
+
+
+
产品树 +
+
+
+
+ +
+
+
+
+ data table +
+
+
+
+ +
+
+ + diff --git a/crm/src/main/java/com/rex/crm/admin/ProductTreePage.java b/crm/src/main/java/com/rex/crm/admin/ProductTreePage.java new file mode 100644 index 0000000..0ea5d34 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/admin/ProductTreePage.java @@ -0,0 +1,104 @@ +package com.rex.crm.admin; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import org.apache.wicket.markup.head.IHeaderResponse; +import org.apache.wicket.markup.head.JavaScriptHeaderItem; +import org.apache.wicket.markup.html.panel.EmptyPanel; +import org.apache.wicket.request.mapper.parameter.PageParameters; +import org.apache.wicket.util.string.StringValue; +import org.apache.wicket.util.template.PackageTextTemplate; + +import com.google.gson.Gson; +import com.rex.crm.common.Entity; +import com.rex.crm.common.EntityDetailContainerPanel; +import com.rex.crm.common.EntityDetailPage; +import com.rex.crm.common.PageableTablePanel; +import com.rex.crm.common.tree.Node; +import com.rex.crm.common.tree.ProductTreePanel; +import com.rex.crm.common.tree.TreeFactory; +import com.rex.crm.common.tree.TreePanel; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.util.Configuration; +import java.util.List; +/** + * @author Feiyun Zhou + */ +public class ProductTreePage extends AdminTemplatePage +{ + private String search_target = ""; + + /** + * Constructor + */ + public ProductTreePage() + { + setPageTitle("系统管理-产品树"); + StringValue positionId = getRequest().getRequestParameters().getParameterValue("positionId"); + StringValue entityName = getRequest().getRequestParameters().getParameterValue("entityName"); + +// System.out.println("StringValue:"+positionId); +// System.out.println("entityName:"+entityName); + + if(positionId.isEmpty() || positionId.isNull()){ + initPage(null,null); + }else{ + initPage(positionId.toString(),entityName.toString()); + } + + urlFor(ProductTreePage.class, null); + + } + + public ProductTreePage(final String id, final String entityName){ + initPage(id,entityName); + } + + private void initPage(final String positionId,final String entityName){ + Gson gson = new Gson(); + String result = gson.toJson(TreeFactory.createProductTree(),Node.class); + add(new ProductTreePanel("treePanel",result)); + + if(positionId !=null){ + PageParameters pp = new PageParameters(); + pp.add("positionId", -1); + if(positionId.equals("-1")){ + Map entities = Configuration.getEntityTable(); + final Entity entity = entities.get("productline"); + List tdata = DAOImpl.queryEntityRelationList(entity.getSql()); + add(new PageableTablePanel("datalist", entity, tdata, null)); + //setResponsePage(new ProductPage()); + }else{ + EntityDetailContainerPanel panel = new EntityDetailContainerPanel("datalist",entityName,positionId,this.getClass(),pp); + add(panel); + } + }else{ + add(new EmptyPanel("datalist")); + } + + } + //监听请求 Ajax + // 级联 + @Override + public void renderHead(IHeaderResponse response) { + super.renderHead(response); + StringValue act_key = getRequest().getRequestParameters().getParameterValue("positionId"); + Map map = new HashMap<>(); + + map.put("act_key", act_key.toString()); + PackageTextTemplate ptt = new PackageTextTemplate( getClass(), "adminpage.js" ); + //OnDomReadyHeaderItem onDomReadyHeaderItem = OnDomReadyHeaderItem.forScript( ptt.asString( map ) ); + //response.render(onDomReadyHeaderItem); + System.out.println(ptt.asString(map)); + response.render(JavaScriptHeaderItem.forScript(ptt.asString(map),null)); + + try { + ptt.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + +} \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/admin/ReportPage.html b/crm/src/main/java/com/rex/crm/admin/ReportPage.html new file mode 100644 index 0000000..200decd --- /dev/null +++ b/crm/src/main/java/com/rex/crm/admin/ReportPage.html @@ -0,0 +1,46 @@ + + + + + + +
+ + + + + +
+
+
+ +
+
+
+
+
+ data table +
+
+
+
+
+ +
+ + diff --git a/crm/src/main/java/com/rex/crm/admin/ReportPage.java b/crm/src/main/java/com/rex/crm/admin/ReportPage.java new file mode 100644 index 0000000..53af842 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/admin/ReportPage.java @@ -0,0 +1,185 @@ +package com.rex.crm.admin; + +import java.util.List; +import java.util.Map; +import java.util.logging.Logger; + +import org.apache.commons.lang3.tuple.Pair; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.model.PropertyModel; + +import com.google.common.collect.Lists; +import com.rex.crm.common.Entity; +import com.rex.crm.common.Field; +import com.rex.crm.common.FilterPanel; +import com.rex.crm.common.PageableTablePanel; +import com.rex.crm.db.DAOImpl; +import com.rexen.crm.beans.UserRole; +import com.rex.crm.util.Configuration; +import com.rex.crm.AccountPage; +import com.rex.crm.SignIn2Session; + +/** + * @author Feiyun Zhou + */ +public class ReportPage extends AdminTemplatePage +{ + private String search_target = ""; + + /** + * Constructor + */ + public ReportPage() + { + initPage(null, null); + } + + public ReportPage(final Map filter, List tdata) + { + initPage(filter, tdata); + } + + public void initPage(final Map filter, List tdata) + { + Map entities = Configuration.getEntityTable(); + //final Entity entity = entities.get("callreport"); + final Entity entity = entities.get("user_position_account"); + + final int roleId = ((SignIn2Session) getSession()).getRoleId(); + final String userId = ((SignIn2Session) getSession()).getUserId(); + setPageTitle("系统管理-报表"); + + + Form form = new Form("form") + { + + @Override + protected void onSubmit() + { + String sql = entity.getSql(); + switch (roleId) + { + case UserRole.USER_ROLE_ADMINISTRATOR: + sql = entity.getSqlAdmin(); + break; + case UserRole.USER_ROLE_MANAGER: + sql = entity.getSqlManager(); + break; + case UserRole.USER_ROLE_SALES: + sql = entity.getSql(); + break; + } + + search_target = (search_target == null || search_target.equalsIgnoreCase("*")) ? "" : search_target; + + // sql = sql + " AND name like '%"+search_target+"%'"; + List searchableFields = entity.getSearchableFields(); + String joint = " like '%" + search_target + "%'"; + String likequery = ""; + for (Field sf : searchableFields) + { + likequery = likequery + " OR " + sf.getName() + joint; + } + + sql = sql + " where userName like '%" + search_target + "%' " + likequery; + List datalist = null; + switch (roleId) + { + case UserRole.USER_ROLE_ADMINISTRATOR: + datalist = DAOImpl.queryEntityRelationList(sql); + break; + case UserRole.USER_ROLE_MANAGER: + datalist = DAOImpl.queryEntityRelationList(sql,userId); + break; + case UserRole.USER_ROLE_SALES: + datalist = DAOImpl.queryEntityRelationList(sql, userId); + break; + } + +// List datalist = DAOImpl.queryEntityRelationList(sql, "dummy"); + // setResponsePage(new UserPage(filter, datalist)); + setResponsePage(new ReportPage(filter, datalist)); + + } + + }; + add(form); + + TextField search_input = new TextField("search_input", new PropertyModel(this, "search_target")); + form.add(search_input); + + String sql = entity.getSql(); + switch (roleId) + { + case UserRole.USER_ROLE_ADMINISTRATOR: + sql = entity.getSqlAdmin(); + break; + case UserRole.USER_ROLE_MANAGER: + sql = entity.getSqlManager(); + break; + case UserRole.USER_ROLE_SALES: + sql = entity.getSql(); + break; + } + // List mapList = DAOImpl.queryEntityList(entity.getSql(), 0, 1000); + if (tdata == null || tdata.size() == 0) + { + switch (roleId) + { + case UserRole.USER_ROLE_ADMINISTRATOR: + tdata = DAOImpl.queryEntityRelationList(sql); + break; + case UserRole.USER_ROLE_MANAGER: + tdata = DAOImpl.queryEntityRelationList(sql, userId); + break; + case UserRole.USER_ROLE_SALES: + tdata = DAOImpl.queryEntityRelationList(sql, userId); + break; + } + + if (filter == null) + { + switch (roleId) + { + case UserRole.USER_ROLE_ADMINISTRATOR: + tdata = DAOImpl.queryEntityRelationList(sql); + break; + case UserRole.USER_ROLE_MANAGER: + tdata = DAOImpl.queryEntityRelationList(sql, userId ); + break; + case UserRole.USER_ROLE_SALES: + tdata = DAOImpl.queryEntityRelationList(sql, userId); + break; + } + + } + else + { + List ft = Lists.newArrayList(); + for (String k : filter.keySet()) + { + if (filter.get(k)) + ft.add(k); + } + + + switch (roleId) + { + case UserRole.USER_ROLE_ADMINISTRATOR: + tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft); + break; + case UserRole.USER_ROLE_MANAGER: + tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft, userId); + break; + case UserRole.USER_ROLE_SALES: + tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft, userId); + break; + } + + } + } + add(new PageableTablePanel("datalist", entity, tdata, null)); + + } +} \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/admin/UploadPage.html b/crm/src/main/java/com/rex/crm/admin/UploadPage.html new file mode 100644 index 0000000..7262ff6 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/admin/UploadPage.html @@ -0,0 +1,31 @@ + + + + + + +
+
+ +
上传医院
+
上传医生
+
上传岗位
+
上传用户
+
上传医院团队
+
上传岗位用户关系
+
+
+
+
+
+ +
+ + + diff --git a/crm/src/main/java/com/rex/crm/admin/UploadPage.java b/crm/src/main/java/com/rex/crm/admin/UploadPage.java new file mode 100644 index 0000000..86e27a4 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/admin/UploadPage.java @@ -0,0 +1,152 @@ +package com.rex.crm.admin; + +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.upload.FileUpload; +import org.apache.wicket.markup.html.form.upload.FileUploadField; +import org.apache.wicket.util.file.File; + +import com.rex.crm.util.CRMUtility; +import com.rexen.crm.integration.DataImportDelegate; + +/** + * @author Feiyun Zhou + */ +public class UploadPage extends AdminTemplatePage +{ + + public UploadPage() + { + init(); + } + + public void init() + { + + final FileUploadField account = new FileUploadField("account"); + + final FileUploadField contact = new FileUploadField("contact"); + + final FileUploadField position = new FileUploadField("position"); + + final FileUploadField user = new FileUploadField("user"); + + final FileUploadField accountTeam = new FileUploadField("accountTeam"); + + final FileUploadField userPosition = new FileUploadField("userPosition"); + +// final FileUploadField userInfo = new FileUploadField("userInfo"); + Form form = new Form("form") + { + @Override + protected void onSubmit() + { + DataImportDelegate da = new DataImportDelegate(); + FileUpload accountFileUpload = account.getFileUpload(); + CRMUtility util = new CRMUtility(); + StringBuffer FileName = new StringBuffer(util.readFileAttribure("uploadpath")); + + if (accountFileUpload != null) + { + String template = "Account Full Import Template 1.0"; + FileName.append(accountFileUpload.getClientFileName()); + try + { + accountFileUpload.writeTo(new File(FileName.toString())); + da.load(template, FileName.toString()); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + FileUpload contactFileUpload = contact.getFileUpload(); + if (contactFileUpload != null) + { + FileName.append(contactFileUpload.getClientFileName()); + String template = "Contact Import Template 1.0"; + try + { + contactFileUpload.writeTo(new File(FileName.toString())); + da.load(template, FileName.toString()); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + FileUpload positionFileUpload = position.getFileUpload(); + if (positionFileUpload != null) + { + FileName.append(positionFileUpload.getClientFileName()); + String template = "Position Import Template 1.0"; + try + { + positionFileUpload.writeTo(new File(FileName.toString())); + da.load(template, FileName.toString()); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + FileUpload accountTeamyFileUpload = accountTeam.getFileUpload(); + if (accountTeamyFileUpload != null) + { + FileName.append(accountTeamyFileUpload.getClientFileName()); + String template = "Account Team Import Template 1.0"; + try + { + accountTeamyFileUpload.writeTo(new File(FileName.toString())); + da.load(template, FileName.toString()); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + + FileUpload userFileUpload = user.getFileUpload(); + if (userFileUpload != null) + { + String userFileName = "d:\\" + userFileUpload.getClientFileName(); + String template = "UserInfo Import Template 1.0"; + try + { + userFileUpload.writeTo(new File(userFileName)); + da.load(template, userFileName); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + + FileUpload userPositionFileUpload = userPosition.getFileUpload(); + if (userPositionFileUpload != null) + { + FileName.append(userPositionFileUpload.getClientFileName()); + String template = "UsrePosition Import Template 1.0"; + try + { + userPositionFileUpload.writeTo(new File(FileName.toString())); + da.load(template, FileName.toString()); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + } + }; + add(form); + form.add(account); + form.add(contact); + form.add(position); + form.add(accountTeam); + form.add(user); + form.add(userPosition); + form.setMultiPart(true); + + + } +} \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/admin/UserPage.html b/crm/src/main/java/com/rex/crm/admin/UserPage.html new file mode 100755 index 0000000..597e828 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/admin/UserPage.html @@ -0,0 +1,47 @@ + + + + + + +
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+ data table +
+
+
+
+
+ +
+ + diff --git a/crm/src/main/java/com/rex/crm/admin/UserPage.java b/crm/src/main/java/com/rex/crm/admin/UserPage.java new file mode 100644 index 0000000..2e233ab --- /dev/null +++ b/crm/src/main/java/com/rex/crm/admin/UserPage.java @@ -0,0 +1,197 @@ +package com.rex.crm.admin; + +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang3.tuple.Pair; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.model.PropertyModel; + +import com.google.common.collect.Lists; +import com.rex.crm.beans.Choice; +import com.rex.crm.common.Entity; +import com.rex.crm.common.Field; +import com.rex.crm.common.FilterPanel; +import com.rex.crm.common.PageableTablePanel; +import com.rex.crm.common.advancedSearch.AdvancedSearchPage; +import com.rex.crm.db.DAOImpl; +import com.rexen.crm.beans.UserRole; +import com.rex.crm.util.Configuration; +import com.rex.crm.SignIn2Session; + +/** + * @author Feiyun Zhou + */ +public class UserPage extends AdminTemplatePage +{ + private String search_target = ""; + + /** + * Constructor + */ + public UserPage() + { + setPageTitle("系统管理-用户管理"); + initPage(null, null); + } + + public UserPage(final Map filter, List tdata) + { + setPageTitle("系统管理-用户管理"); + initPage(filter, tdata); + } + + public void initPage(final Map filter, List tdata) + { + Map entities = Configuration.getEntityTable(); + final Entity entity = entities.get("userinfo"); + final int roleId = ((SignIn2Session) getSession()).getRoleId(); + final String userId = ((SignIn2Session) getSession()).getUserId(); + setPageTitle(entity.getDisplay()); + + + Form form = new Form("form") + { + + @Override + protected void onSubmit() + { + String sql = entity.getSql(); + switch (roleId) + { + case UserRole.USER_ROLE_ADMINISTRATOR: + sql = entity.getSqlAdmin(); + break; + case UserRole.USER_ROLE_MANAGER: + sql = entity.getSqlManager(); + break; + case UserRole.USER_ROLE_SALES: + sql = entity.getSql(); + break; + } + + search_target = (search_target == null || search_target.equalsIgnoreCase("*")) ? "" : search_target; + + // sql = sql + " AND name like '%"+search_target+"%'"; + List searchableFields = entity.getSearchableFields(); + String joint = " like '%" + search_target + "%'"; + String likequery = ""; + for (Field sf : searchableFields) + { + likequery = likequery + " OR " + sf.getName() + joint; + } + + sql = sql + " where name like '%" + search_target + "%' " + likequery; + List datalist = null; + switch (roleId) + { + case UserRole.USER_ROLE_ADMINISTRATOR: + datalist = DAOImpl.queryEntityRelationList(sql); + break; + case UserRole.USER_ROLE_MANAGER: + datalist = DAOImpl.queryEntityRelationList(sql,userId,userId); + break; + case UserRole.USER_ROLE_SALES: + datalist = DAOImpl.queryEntityRelationList(sql, userId); + break; + } + +// List datalist = DAOImpl.queryEntityRelationList(sql, "dummy"); + setResponsePage(new UserPage(filter, datalist)); + + } + + }; + add(form); + form.add(new Link("ad_search_link"){ + @Override + public void onClick() { + setResponsePage(new AdvancedSearchPage(entity.getName(),null)); + + } + + }); + TextField search_input = new TextField("search_input", new PropertyModel(this, "search_target")); + form.add(search_input); + + String sql = entity.getSql(); + switch (roleId) + { + case UserRole.USER_ROLE_ADMINISTRATOR: + sql = entity.getSqlAdmin(); + break; + case UserRole.USER_ROLE_MANAGER: + sql = entity.getSqlManager(); + break; + case UserRole.USER_ROLE_SALES: + sql = entity.getSql(); + break; + } + // List mapList = DAOImpl.queryEntityList(entity.getSql(), 0, 1000); + if (tdata == null || tdata.size() == 0) + { + switch (roleId) + { + case UserRole.USER_ROLE_ADMINISTRATOR: + tdata = DAOImpl.queryEntityRelationList(sql); + break; + case UserRole.USER_ROLE_MANAGER: + tdata = DAOImpl.queryEntityRelationList(sql, userId,userId); + break; + case UserRole.USER_ROLE_SALES: + tdata = DAOImpl.queryEntityRelationList(sql, userId); + break; + } + + if (filter == null) + { + switch (roleId) + { + case UserRole.USER_ROLE_ADMINISTRATOR: + tdata = DAOImpl.queryEntityRelationList(sql); + break; + case UserRole.USER_ROLE_MANAGER: + tdata = DAOImpl.queryEntityRelationList(sql, userId,userId); + break; + case UserRole.USER_ROLE_SALES: + tdata = DAOImpl.queryEntityRelationList(sql, userId); + break; + } + + } + else + { + List ft = Lists.newArrayList(); + for (String k : filter.keySet()) + { + if (filter.get(k)) + ft.add(k); + } + + + switch (roleId) + { + case UserRole.USER_ROLE_ADMINISTRATOR: + tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft); + break; + case UserRole.USER_ROLE_MANAGER: + tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft, userId,userId); + break; + case UserRole.USER_ROLE_SALES: + tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft, userId); + break; + } + + } + + } + add(new PageableTablePanel("datalist", entity, tdata, null)); + + // for the side bar + List choices = DAOImpl.queryPickList(entity.getFieldByName(entity.getFilterField()).getPicklist()); + add(new FilterPanel("filterPanel", choices, filter, UserPage.class,entity)); + + } +} \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/admin/UserPositionPage.html b/crm/src/main/java/com/rex/crm/admin/UserPositionPage.html new file mode 100644 index 0000000..d28d23a --- /dev/null +++ b/crm/src/main/java/com/rex/crm/admin/UserPositionPage.html @@ -0,0 +1,50 @@ + + + + + + +
+
+ + + +
+
+
+
+ +
+
+
+
+
+ data table +
+
+
+
+
+ +
+ + diff --git a/crm/src/main/java/com/rex/crm/admin/UserPositionPage.java b/crm/src/main/java/com/rex/crm/admin/UserPositionPage.java new file mode 100644 index 0000000..607149d --- /dev/null +++ b/crm/src/main/java/com/rex/crm/admin/UserPositionPage.java @@ -0,0 +1,195 @@ +package com.rex.crm.admin; + +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang3.tuple.Pair; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.model.PropertyModel; + +import com.google.common.collect.Lists; +import com.rex.crm.beans.Choice; +import com.rex.crm.common.Entity; +import com.rex.crm.common.Field; +import com.rex.crm.common.FilterPanel; +import com.rex.crm.common.PageableTablePanel; +import com.rex.crm.common.TableDataPanel; +import com.rex.crm.common.advancedSearch.AdvancedSearchPage; +import com.rex.crm.db.DAOImpl; +import com.rexen.crm.beans.UserRole; +import com.rex.crm.util.Configuration; +import com.rex.crm.SignIn2Session; + +/** + * @author Feiyun Zhou + */ +public class UserPositionPage extends AdminTemplatePage +{ + private String search_target = ""; + + /** + * Constructor + */ + public UserPositionPage() + { + initPage(null, null); + } + + public UserPositionPage(final Map filter, List tdata) + { + initPage(filter, tdata); + } + + public void initPage(final Map filter, List tdata) + { + Map entities = Configuration.getEntityTable(); + final Entity entity = entities.get("user_position"); + final int roleId = ((SignIn2Session) getSession()).getRoleId(); + final String positionId = ((SignIn2Session) getSession()).getPositionId(); + setPageTitle("系统管理-岗位关系"); + + + Form form = new Form("form") + { + + @Override + protected void onSubmit() + { + String sql = entity.getSql(); + switch (roleId) + { + case UserRole.USER_ROLE_ADMINISTRATOR: + sql = entity.getSql(); + break; + case UserRole.USER_ROLE_MANAGER: + sql = entity.getSql(); + break; + case UserRole.USER_ROLE_SALES: + sql = entity.getSql(); + break; + } + + search_target = (search_target == null || search_target.equalsIgnoreCase("*")) ? "" : search_target; + + // sql = sql + " AND name like '%"+search_target+"%'"; + List searchableFields = entity.getSearchableFields(); + String joint = " like '%" + search_target + "%'"; + String likequery = ""; + for (Field sf : searchableFields) + { + likequery = likequery + " OR " + sf.getName() + joint; + } + + sql = sql + " where name like '%" + search_target + "%' " + likequery; + List datalist = null; + switch (roleId) + { + case UserRole.USER_ROLE_ADMINISTRATOR: + datalist = DAOImpl.queryEntityRelationList(sql); + break; + case UserRole.USER_ROLE_MANAGER: + datalist = DAOImpl.queryEntityRelationList(sql,positionId,positionId); + break; + case UserRole.USER_ROLE_SALES: + datalist = DAOImpl.queryEntityRelationList(sql, positionId); + break; + } + +// List datalist = DAOImpl.queryEntityRelationList(sql, "dummy"); + setResponsePage(new UserPositionPage(filter, datalist)); + + } + + }; + add(form); + form.add(new Link("ad_search_link"){ + @Override + public void onClick() { + setResponsePage(new AdvancedSearchPage(entity.getName(),null)); + + } + + }); + TextField search_input = new TextField("search_input", new PropertyModel(this, "search_target")); + form.add(search_input); + + String sql = entity.getSql(); + switch (roleId) + { + case UserRole.USER_ROLE_ADMINISTRATOR: + sql = entity.getSql(); + break; + case UserRole.USER_ROLE_MANAGER: + sql = entity.getSql(); + break; + case UserRole.USER_ROLE_SALES: + sql = entity.getSql(); + break; + } + // List mapList = DAOImpl.queryEntityList(entity.getSql(), 0, 1000); + if (tdata == null || tdata.size() == 0) + { + switch (roleId) + { + case UserRole.USER_ROLE_ADMINISTRATOR: + tdata = DAOImpl.queryEntityRelationList(sql); + break; + case UserRole.USER_ROLE_MANAGER: + tdata = DAOImpl.queryEntityRelationList(sql,positionId,positionId); + break; + case UserRole.USER_ROLE_SALES: + tdata = DAOImpl.queryEntityRelationList(sql, positionId); + break; + } + + if (filter == null) + { + switch (roleId) + { + case UserRole.USER_ROLE_ADMINISTRATOR: + tdata = DAOImpl.queryEntityRelationList(sql); + break; + case UserRole.USER_ROLE_MANAGER: + tdata = DAOImpl.queryEntityRelationList(sql,positionId,positionId); + break; + case UserRole.USER_ROLE_SALES: + tdata = DAOImpl.queryEntityRelationList(sql, positionId); + break; + } + + } + else + { + List ft = Lists.newArrayList(); + for (String k : filter.keySet()) + { + if (filter.get(k)) + ft.add(k); + } + + + switch (roleId) + { + case UserRole.USER_ROLE_ADMINISTRATOR: + tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft); + break; + case UserRole.USER_ROLE_MANAGER: + tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft, positionId,positionId); + break; + case UserRole.USER_ROLE_SALES: + tdata = DAOImpl.queryEntityWithFilter(sql, entity.getFilterField(), ft, positionId); + break; + } + + } + + } + add(new PageableTablePanel("datalist", entity, tdata, null)); + +// List choices = DAOImpl.queryPickList(entity.getFieldByName(entity.getFilterField()).getPicklist()); +// add(new FilterPanel("filterPanel", choices, filter, PositionPage.class,entity)); + + } +} \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/admin/adminpage.js b/crm/src/main/java/com/rex/crm/admin/adminpage.js new file mode 100644 index 0000000..d7a7311 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/admin/adminpage.js @@ -0,0 +1,2 @@ +var act_key='${act_key}'; + diff --git a/crm/src/main/java/com/rex/crm/ajax/ColumnDescription.java b/crm/src/main/java/com/rex/crm/ajax/ColumnDescription.java new file mode 100644 index 0000000..84ef706 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/ajax/ColumnDescription.java @@ -0,0 +1,17 @@ +package com.rex.crm.ajax; + +import com.google.gson.JsonObject; + +/** + * + * @author Feiyun + */ +public class ColumnDescription { + public JsonObject columnDes; + + + public ColumnDescription(String title){ + columnDes = new JsonObject(); + columnDes.addProperty("sTitle", title); + } +} diff --git a/crm/src/main/java/com/rex/crm/ajax/DataProvider.java b/crm/src/main/java/com/rex/crm/ajax/DataProvider.java new file mode 100644 index 0000000..b7bb270 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/ajax/DataProvider.java @@ -0,0 +1,993 @@ +package com.rex.crm.ajax; + +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang3.tuple.Pair; +import org.apache.log4j.Logger; +import org.apache.velocity.Template; +import org.apache.velocity.VelocityContext; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableListMultimap; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMultiset; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.LinkedHashMultimap; +import com.google.common.collect.ListMultimap; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Multimap; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonElement; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import com.google.gson.JsonPrimitive; +import com.rex.crm.SignIn2Session; +import com.rex.crm.beans.Account; +import com.rex.crm.beans.CRMUser; +import com.rex.crm.beans.CalendarEvent; +import com.rex.crm.beans.City; +import com.rex.crm.beans.Contact; +import com.rex.crm.beans.Province; +import com.rex.crm.beans.Resp; +import com.rex.crm.beans.UserInfo; +import com.rex.crm.common.Entity; +import com.rex.crm.common.Field; +import com.rex.crm.db.DAOImpl; +import com.rexen.crm.beans.UserRole; +import com.rex.crm.html.Node; +import com.rex.crm.util.CRMUtility; +import com.rex.crm.util.Configuration; + +/** + * + * @author Feiyun + */ +public class DataProvider { + private static final Logger logger = Logger.getLogger(DataProvider.class); + + + public DataProvider() { + } + + public static String getAllCRMUsers(String[] args) { + List users = DAOImpl.getAllCRMUsers(); + Gson gson = new GsonBuilder().create(); + String result = gson.toJson(users.toArray(new CRMUser[0]), CRMUser[].class); + return result; + } + + public static String getAllAccounts(String[] args) { + List accounts = DAOImpl.getAllAccounts(); + Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create(); + String result = gson.toJson(accounts.toArray(new Account[0]), Account[].class); + return result; + } + + public static String addUserOfTeam(String[] args) { + int accountId = Integer.parseInt(args[0]); + int userId = Integer.parseInt(args[1]); + Gson gson = new GsonBuilder().create(); + Resp resp = new Resp(); + resp.setCode(0); + try { + DAOImpl.insertRelationOfAccountIDCRMUserID(accountId, userId); + } catch (Exception e) { + resp.setCode(1); + resp.setMessage(e.getMessage()); + } + return gson.toJson(resp, Resp.class); + } + + public static String getAccountDetailsById(String[] args) { + Account account = DAOImpl.getAccountById(Integer.parseInt(args[0])); + Gson gson = new Gson(); + String result = gson.toJson(account, Account.class); + // System.out.println(result); + return result; + } + + private static Node createCityNode(City city) { + Node node = new Node(); + if (city != null) { + node.setTitle(city.getName()); + node.setKey(String.valueOf(city.getId())); + node.setFolder(true); + } + return node; + } + + private static Node createCityNode(String cityId) { + Node node = new Node(); + ImmutableMap cities = DAOImpl.getCityTable(); + City city = cities.get(cityId); + return createCityNode(city); + } + + private static Node createAccountNode(String accountId) { + Account account = DAOImpl.getAccountById(Integer.parseInt(accountId)); + return createAccountNode(account); + } + + private static Node createAccountNode(Account account) { + Node node = new Node(); + if (account != null) { + node.setTitle(account.getName()); + node.setKey(String.valueOf(account.getId())); + } + return node; + } + + private static Node createProvinceNode(int provinceId) { + Node node = new Node(); + Province prv = DAOImpl.getProvinceById(provinceId); + if (prv != null) { + node.setTitle(prv.getName()); + node.setKey(String.valueOf(prv.getId())); + node.setFolder(true); + } + return node; + } + + private static Node createUserNode(CRMUser crmUser) { + Node node = new Node(); + if (crmUser != null) { + node.setTitle(crmUser.getName()); + node.setKey(String.valueOf(crmUser.getId())); + } + return node; + } + + /*** + * create a tree like this province1------>city1----->crmuser1 | + * |---->crmuser2 | |---->crmuser3 |---->city2 + * + * @return + */ + public static String categorizeCRMUserByProvinceAndCity() { + // prepare for data + List allusers = DAOImpl.getAllCRMUsers(); + ImmutableMap cityTable = DAOImpl.getCityTable(); + // classify accounts by city Ids, that is to say, find mapping + // cityId->[account1,account2,account3...] + ImmutableListMultimap usersByCityId = CRMUtility.categorizeCRMUsersByCityIds(allusers); + ImmutableMultiset cityIds = usersByCityId.keys(); + + // filter cities using city Ids, we find cities by using the provided + // city Ids + Map filteredCityTable = CRMUtility.filterCitiesWithIds(cityTable, cityIds); + + // categorize the mappings provinceId->cities, that is to say find + // mapping provinceId->[city1,city2,city3...] + ImmutableListMultimap citiesByProvinceId = CRMUtility.categorizeCitiesByProvinceIds(Lists.newArrayList(filteredCityTable.values())); + + ImmutableSet provinceIds = citiesByProvinceId.keySet(); + // crate province nodes + Node[] provinceNodes = new Node[provinceIds.size()]; + int i = 0; + for (int pid : provinceIds) { + provinceNodes[i] = createProvinceNode(pid); + provinceNodes[i].setFolder(true); + ImmutableList cities = citiesByProvinceId.get(pid); + provinceNodes[i].setChildren(new Node[cities.size()]); + for (int j = 0; j < cities.size(); j++) { + Node cityNode = createCityNode(cities.get(j)); + cityNode.setFolder(true); + provinceNodes[i].getChildren()[j] = cityNode; + ImmutableList users = usersByCityId.get(cities.get(j).getId()); + cityNode.setChildren(new Node[users.size()]); + for (int k = 0; k < users.size(); k++) { + Node userNode = createUserNode(users.get(k)); + userNode.setType("usr"); + cityNode.getChildren()[k] = userNode; + } + + } + i++; + } + + Gson gson = new Gson(); + String result = gson.toJson(provinceNodes, Node[].class); + logger.debug("result of categorizeCRMUserByProvinceAndCity:" + result); + return result; + } + + /*** + * create a tree like this province1------>city1----->account1 | + * |---->account2 | |---->account3 |---->city2 + * + * @return + */ + public static String categorizeAccountsByProvinceAndCity() { + // prepare for data + List allAccounts = DAOImpl.getAllAccounts(); + ImmutableMap cityTable = DAOImpl.getCityTable(); + + // classify accounts by city Ids, that is to say, find mapping + // cityId->[account1,account2,account3...] + ImmutableListMultimap accountsByCityId = CRMUtility.categorizeAccountsByCityIds(allAccounts); + ImmutableMultiset cityIds = accountsByCityId.keys(); + + // filter cities using city Ids, we find cities by using the provided + // city Ids + Map filteredCityTable = CRMUtility.filterCitiesWithIds(cityTable, cityIds); + + // categorize the mappings provinceId->cities, that is to say find + // mapping provinceId->[city1,city2,city3...] + ImmutableListMultimap citiesByProvinceId = CRMUtility.categorizeCitiesByProvinceIds(Lists.newArrayList(filteredCityTable.values())); + + ImmutableSet provinceIds = citiesByProvinceId.keySet(); + // crate province nodes + Node[] provinceNodes = new Node[provinceIds.size()]; + int i = 0; + for (int pid : provinceIds) { + provinceNodes[i] = createProvinceNode(pid); + provinceNodes[i].setFolder(true); + ImmutableList cities = citiesByProvinceId.get(pid); + provinceNodes[i].setChildren(new Node[cities.size()]); + for (int j = 0; j < cities.size(); j++) { + Node cityNode = createCityNode(cities.get(j)); + cityNode.setFolder(true); + provinceNodes[i].getChildren()[j] = cityNode; + ImmutableList acccounts = accountsByCityId.get(cities.get(j).getId()); + cityNode.setChildren(new Node[acccounts.size()]); + for (int k = 0; k < acccounts.size(); k++) { + Node accountNode = createAccountNode(acccounts.get(k)); + accountNode.setType("act"); + cityNode.getChildren()[k] = accountNode; + } + + } + i++; + } + + Gson gson = new Gson(); + String result = gson.toJson(provinceNodes, Node[].class); + return result; + } + + // public static String getRegionDataStringify(){ + // List regionData = DAOImpl.getAllRegionData(""); + // Node[] root = new Node[regionData.size()]; + // int i=0; + // for(Province p:regionData){ + // root[i] = new Node(); + // root[i].setTitle(p.getName()); + // root[i].setType("prv"); + // root[i].setFolder(true); + // City[] cities = p.getCities(); + // Node[] cityNodes = new Node[cities.length]; + // root[i].setChildren(cityNodes); + // int j=0; + // for(City c: cities){ + // cityNodes[j] = new Node(); + // cityNodes[j].setTitle(c.getName()); + // cityNodes[j].setType("cty"); + // Account[] accounts = c.getAccounts(); + // if(accounts!=null && accounts.length != 0){ + // cityNodes[j].setFolder(true); + // Node[] acctNodes = new Node[accounts.length]; + // cityNodes[j].setChildren(acctNodes); + // int k=0; + // for(Account a:accounts){ + // acctNodes[k] = new Node(); + // acctNodes[k].setTitle(a.getName()); + // acctNodes[k].setType("act"); + // acctNodes[k].setKey(String.valueOf(a.getId())); + // k++; + // } + // } + // j++; + // } + // i++; + // } + // + // Gson gson = new Gson(); + // String result = gson.toJson(root,Node[].class); + // return result; + // } + + public static String getCRMUserInfoById(String[] args) { + CRMUser user = DAOImpl.getCRMUserInfoById(Integer.parseInt(args[0])); + Gson gson = new Gson(); + String result = gson.toJson(user, CRMUser.class); + return result; + } + + public static String getUsersByAccountId(String[] accountId) { + List users = DAOImpl.getUsersByAccountId(Integer.parseInt(accountId[0])); + CRMUser[] userarry = users.toArray(new CRMUser[0]); + Gson gson = new Gson(); + String jsonString = gson.toJson(userarry, CRMUser[].class); + return jsonString; + } + + public static String getAccountsByUserId(String[] userId) { + List accounts = DAOImpl.getAccountsByUserId(Integer.parseInt(userId[0])); + Account[] accountarry = accounts.toArray(new Account[0]); + Gson gson = new Gson(); + String jsonString = gson.toJson(accountarry, Account[].class); + return jsonString; + } + + @SuppressWarnings("all") + public String getAccountsByUserIdHtmlOutput(String[] userId) { + List accounts = DAOImpl.getAccountsByUserId(Integer.parseInt(userId[0])); + + ArrayList list = new ArrayList(); + for (Account acct : accounts) { + list.add(acct.toMap()); + } + + VelocityContext context = new VelocityContext(); + context.put("accountList", list); + Template t = Configuration.getVelocityEngine().getTemplate("accountsTableVM.html", "UTF-8"); + StringWriter writer = new StringWriter(); + t.merge(context, writer); + + Gson gson = new Gson(); + logger.debug(writer.toString()); + String jsonString = gson.toJson(writer.toString(), String.class); + return jsonString; + } + + @SuppressWarnings("all") + public String getUsersByAccountIdHtmlOutput(String[] accountId) { + List users = DAOImpl.getUsersByAccountId(Integer.parseInt(accountId[0])); + + ArrayList list = new ArrayList(); + for (CRMUser acct : users) { + list.add(acct.toMap()); + } + + VelocityContext context = new VelocityContext(); + context.put("list", list); + Template t = Configuration.getVelocityEngine().getTemplate("crmUserTableVM.html", "UTF-8"); + StringWriter writer = new StringWriter(); + t.merge(context, writer); + + Gson gson = new Gson(); + String jsonString = gson.toJson(writer.toString(), String.class); + return jsonString; + } + + public static String getAccountDetailsByIdHtmlOutput(String[] args) { + Account account = DAOImpl.getAccountById(Integer.parseInt(args[0])); + VelocityContext context = new VelocityContext(); + context.put("data", account.toMap()); + Template t = Configuration.getVelocityEngine().getTemplate("accountInfoListVM.html", "UTF-8"); + StringWriter writer = new StringWriter(); + t.merge(context, writer); + + Gson gson = new Gson(); + String result = gson.toJson(writer.toString(), String.class); + // System.out.println(result); + return result; + } + + public static String getCRMUserInfoByIdHtmlOutput(String[] args) { + CRMUser user = DAOImpl.getCRMUserInfoById(Integer.parseInt(args[0])); + System.out.println("AAA:" + user); + VelocityContext context = new VelocityContext(); + context.put("data", user.toMap()); + Template t = Configuration.getVelocityEngine().getTemplate("userInfoVM.html", "UTF-8"); + StringWriter writer = new StringWriter(); + t.merge(context, writer); + + Gson gson = new Gson(); + String result = gson.toJson(writer.toString(), String.class); + return result; + } + + public static String getEventsByUserId(String[] userId) { + List events = DAOImpl.getEventsByUserId(Integer.parseInt(userId[0])); + Gson gson = new Gson(); + String jsonString = gson.toJson(events.toArray(new CalendarEvent[0]), CalendarEvent[].class); + return jsonString; + } + + public static String ping(String[] args) { + return "ok"; + } + + + public static String getContactIdsOfAccountIdByUserId(String[] args){ + String id= args[0]; + Map entities = Configuration.getEntityTable(); + Entity entity = entities.get("contact"); + List mapList = DAOImpl.queryEntityRelationList(entity.getSql(), id); + List> pairs = Lists.newArrayList(); + + for (Map map : (List) mapList) { + Pair pair = Pair.of(Integer.parseInt(String.valueOf(map.get("id"))), Integer.parseInt(String.valueOf(map.get("accountId")))); + pairs.add(pair); + } + + ImmutableListMultimap> entityIdsByExternalId = CRMUtility.categorizeEntitiesByExternalId(pairs); + + JsonObject jsTableData = new JsonObject(); + + Gson gson = new Gson(); + // Multimap multiMap = getEntityListByIdOfUserId(entity.getSql(),userId); + for(Integer key:entityIdsByExternalId.keySet()){ + ImmutableList> collection = entityIdsByExternalId.get(key); + JsonArray js_rows = new JsonArray(); + for(Pair p:collection){ + js_rows.add( new JsonPrimitive(p.getLeft())); + } + jsTableData.add(String.valueOf(key), js_rows); + } + + return jsTableData.toString(); + + } + + + public static String getActivityIdsOfContactIdByUserId(String[] args){ + String id= args[0]; + Map entities = Configuration.getEntityTable(); + Entity entity = entities.get("activity"); + List mapList = DAOImpl.queryEntityRelationList(entity.getSql(), id); + List> pairs = Lists.newArrayList(); + + for (Map map : (List) mapList) { + Pair pair = Pair.of(Integer.parseInt(String.valueOf(map.get("id"))), Integer.parseInt(String.valueOf(map.get("contactId")))); + pairs.add(pair); + } + + ImmutableListMultimap> entityIdsByExternalId = CRMUtility.categorizeEntitiesByExternalId(pairs); + + JsonObject jsTableData = new JsonObject(); + + Gson gson = new Gson(); + // Multimap multiMap = getEntityListByIdOfUserId(entity.getSql(),userId); + for(Integer key:entityIdsByExternalId.keySet()){ + ImmutableList> collection = entityIdsByExternalId.get(key); + JsonArray js_rows = new JsonArray(); + for(Pair p:collection){ + js_rows.add( new JsonPrimitive(p.getLeft())); + } + jsTableData.add(String.valueOf(key), js_rows); + } + return jsTableData.toString(); + + } + + + + public static String queryContactsByUserId(String[] args) { + String id = args[0]; + Map entities = Configuration.getEntityTable(); + Entity entity = entities.get("contact"); + List mapList = DAOImpl.queryEntityRelationList(entity.getSql(), id); + List contacts = Lists.newArrayList(); + + for (Map map : (List) mapList) { + Contact ct = new Contact(); + ct.setId(Integer.parseInt(String.valueOf(map.get("id")))); + ct.setName(String.valueOf(map.get("name"))); + ct.setAccountId(Integer.parseInt(String.valueOf(map.get("accountId")))); + contacts.add(ct); + } + + ImmutableListMultimap accountId2ContactsMap = CRMUtility.categorizeContactsByAccountId(contacts); + + Gson gson = new Gson(); + + JsonObject ja = new JsonObject(); + + ImmutableSet keys = accountId2ContactsMap.keySet(); + + for (Integer key : keys) { + List cts = accountId2ContactsMap.get(key); + + if (cts != null && cts.size() != 0) { + ja.add(String.valueOf(key), gson.toJsonTree(cts)); + + } + } + + return ja.toString(); + } + + public static String getContactData(String[] args) { + String id = args[0]; + // String sql = + // "select * from (select a.name as contactName,a.id,b.name as accountName from contact as a,account as b where a.accountId = b.id) as c"; + + Map entities = Configuration.getEntityTable(); + Entity entity = entities.get("contact"); + List list = DAOImpl.queryEntityRelationList(entity.getSql(), id); + + List contacts = Lists.newArrayList(); + for (Map map : (List) list) { + String contactName = String.valueOf(map.get("name")); + String contactId = String.valueOf(map.get("id")); + + Contact contact = new Contact(); + contact.setId(Integer.parseInt(contactId)); + contact.setName(contactName); + contacts.add(contact); + } + + Gson gson = new Gson(); + String jsonString = gson.toJson(contacts.toArray(new Contact[0]), Contact[].class); + return jsonString; + } + + + public static String queryAccountsOfUser(String[] args) { + String uid = args[0]; + String sql = "select * from (select b.id as id,b.name from contact as a,account as b where a.accountId = b.id AND ? is not NULL) as c group by name"; + + Map entities = Configuration.getEntityTable(); + Entity entity = entities.get("account"); + List list = DAOImpl.queryEntityRelationList(sql, uid); + + List accounts = Lists.newArrayList(); + for (Map map : (List) list) { + String name = String.valueOf(map.get("name")); + String id = String.valueOf(map.get("id")); + + Account acct = new Account(); + acct.setId(Integer.parseInt(id)); + acct.setName(name); + accounts.add(acct); + } + + Gson gson = new Gson(); + String jsonString = gson.toJson(accounts.toArray(new Account[0]), Account[].class); + return jsonString; + } + + public String getAccountTable(String[] args) { + DataTable dt = new DataTable(); + Map entities = Configuration.getEntityTable(); + Entity entity = entities.get("account"); + + List fields = entity.getFields(); + for (Field f : fields) { + if (!f.isVisible()) + continue; + ColumnDescription cd1 = new ColumnDescription(f.getDisplay()); + dt.addColumn(cd1); + } + + + String userId = args[0]; + List mapList = DAOImpl.queryEntityRelationList(entity.getSql(), userId); + for (Map map : (List) mapList) { + TableRow tr = new TableRow(); + for (Field f : fields) { + if (!f.isVisible()) + continue; + String fieldValue = ""; + if (f.getPicklist() != null) { + fieldValue = DAOImpl.queryPickListById(f.getPicklist(), String.valueOf(map.get(f.getName()))); + }else if(f.getRelationTable() != null){ + fieldValue = DAOImpl.queryCachedRelationDataById(f.getRelationTable(), String.valueOf(map.get(f.getName()))); + } else { + fieldValue = String.valueOf(map.get(f.getName())); + } + + tr.addCell(fieldValue); + } + + dt.addRow(tr); + } + return dt.stringify(); + + } + + public String getContactTable(String[] args) { + String userId = args[0]; + DataTable dt = new DataTable(); + Map entities = Configuration.getEntityTable(); + Entity entity = entities.get("contact"); + + List fields = entity.getFields(); + for (Field f : fields) { + if (!f.isVisible()) + continue; + ColumnDescription cd1 = new ColumnDescription(f.getDisplay()); + dt.addColumn(cd1); + } + //dt.addColumn(new ColumnDescription("拜访操作")); + + List mapList = DAOImpl.queryEntityRelationList(entity.getSql(), userId); + for (Map map : (List) mapList) { + TableRow tr = new TableRow(); + for (Field f : fields) { + if (!f.isVisible()) + continue; + String fieldValue = ""; + if (f.getPicklist() != null) { + fieldValue = DAOImpl.queryPickListById(f.getPicklist(), String.valueOf(map.get(f.getName()))); + }else if(f.getRelationTable() !=null){ + fieldValue = DAOImpl.queryCachedRelationDataById(f.getRelationTable(), String.valueOf(map.get(f.getName()))); + } else { + fieldValue = String.valueOf(map.get(f.getName())); + } + + tr.addCell(fieldValue); + } + + //String id = String.valueOf(map.get("id")); + //String accountId = String.valueOf(map.get("accountId")); + + //tr.addCell("拜访"); + + dt.addRow(tr); + } + return dt.stringify(); + } + + private String getEntityTable(String entityName, String userId) { + DataTable dt = new DataTable(); + Map entities = Configuration.getEntityTable(); + Entity entity = entities.get(entityName); + + List fields = entity.getFields(); + for (Field f : fields) { + if (!f.isVisible()) + continue; + ColumnDescription cd1 = new ColumnDescription(f.getDisplay()); + dt.addColumn(cd1); + } + + List mapList = DAOImpl.queryEntityRelationList(entity.getSql(), userId); + for (Map map : (List) mapList) { + TableRow tr = new TableRow(); + for (Field f : fields) { + if (!f.isVisible()) + continue; + String fieldValue = ""; + if (f.getPicklist() != null) { + fieldValue = DAOImpl.queryPickListById(f.getPicklist(), String.valueOf(map.get(f.getName()))); + }else if(f.getRelationTable() != null){ + fieldValue = DAOImpl.queryCachedRelationDataById(f.getRelationTable(), String.valueOf(map.get(f.getName()))); + } else { + fieldValue = String.valueOf(map.get(f.getName())); + } + + tr.addCell(fieldValue); + } + + dt.addRow(tr); + } + return dt.stringify(); + } + + public static String addCalendarEvent(String[] args) { + Resp resp = new Resp(); + int crmuserId = Integer.parseInt(args[0]); + int contactId = Integer.parseInt(args[1]); + String type = args[2]; + String title = args[3]; + String start = args[4]; + String end = args[5]; + int status = Integer.parseInt(args[6]); + String owner = args[7]; + String modifier = args[8]; + String responsible_person = args[9]; + resp.setCode(0); + Date modify_datetime =new Date(System.currentTimeMillis()); + logger.debug("time:"+start+" :"+end); + try { + CRMUser userInfo = DAOImpl.getCRMUserInfoById(crmuserId); + DAOImpl.addCalendarEvent(crmuserId, contactId, type, title, start, end, status, + owner, modifier, responsible_person, null, null, 1,userInfo.getName()); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + resp.setCode(-1); + resp.setMessage(e.getMessage()); + } + + Gson gson = new Gson(); + String jsonString = gson.toJson(resp, Resp.class); + return jsonString; + + } + + public static String addMeeting(String[] args){ + Gson gson = new Gson(); + String para = args[0]; + logger.debug(para); + JsonElement jelement = new JsonParser().parse(para); + + JsonObject jobject = jelement.getAsJsonObject(); + int crmuserId = jobject.getAsJsonPrimitive("crmUserId").getAsInt(); + int[] contactIds = gson.fromJson(jobject.getAsJsonArray("contactIds"),int[].class); + String title = jobject.getAsJsonPrimitive("title").getAsString(); + long start = jobject.getAsJsonPrimitive("startt").getAsLong(); + long end = jobject.getAsJsonPrimitive("endt").getAsLong(); + int status = jobject.getAsJsonPrimitive("status").getAsInt(); + String meeting_type = jobject.getAsJsonPrimitive("activity_type").getAsString(); + JsonPrimitive coachObj = jobject.getAsJsonPrimitive("coachId"); + String coachId = "0"; + if (coachObj !=null){ + coachId = jobject.getAsJsonPrimitive("coachId").getAsString(); + } + + Resp resp = new Resp(); + + resp.setCode(0); + logger.debug("time:"+start+" :"+end); + try { + DAOImpl.addExternalMeeting(crmuserId, contactIds, title, start, end, status,meeting_type,coachId); + + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + resp.setCode(-1); + resp.setMessage(e.getMessage()); + } + + + String jsonString = gson.toJson(resp, Resp.class); + return jsonString; + + + + } + + public static String updateStatusOfCalendarEvent(String[] args){ + Resp resp = new Resp(); + resp.setCode(0); + int eventId = Integer.parseInt(args[0]); + int status = Integer.parseInt(args[1]); + + try { + DAOImpl.updateStatusOfCalendarEvent(eventId, status, new Date()); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + resp.setCode(-1); + resp.setMessage(e.getMessage()); + } + + Gson gson = new Gson(); + String jsonString = gson.toJson(resp, Resp.class); + return jsonString; + } + + + public static String updateStatusOfExternalMeetingRemotely(String[] args){ + Resp resp = new Resp(); + resp.setCode(0); + int eventId = Integer.parseInt(args[0]); + int status = Integer.parseInt(args[1]); + + try { + DAOImpl.updateStatusOfExternalMeeting(eventId, status); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + resp.setCode(-1); + resp.setMessage(e.getMessage()); + } + + Gson gson = new Gson(); + String jsonString = gson.toJson(resp, Resp.class); + return jsonString; + } + + public static String updateStatusOfInternalMeetingRemotely(String[] args){ + Resp resp = new Resp(); + resp.setCode(0); + int eventId = Integer.parseInt(args[0]); + int status = Integer.parseInt(args[1]); + + try { + DAOImpl.updateStatusOfInternalMeeting(eventId, status); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + resp.setCode(-1); + resp.setMessage(e.getMessage()); + } + + Gson gson = new Gson(); + String jsonString = gson.toJson(resp, Resp.class); + return jsonString; + } + + + public static String getActivitiesTableDataByUserId(String[] args){ + String id = args[0]; + Map entities = Configuration.getEntityTable(); + Entity entity = entities.get("activity"); + CRMUser user = DAOImpl.getCrmUserById(Integer.parseInt(id)); + int roleId = user.getRole(); + String sql = null; + switch(roleId){ + case UserRole.USER_ROLE_ADMINISTRATOR: + sql = entity.getSqlCalendar(); + break; + case UserRole.USER_ROLE_MANAGER: + sql = entity.getSqlManagerCalendar(); + break; + case UserRole.USER_ROLE_SALES: + sql = entity.getSqlCalendar(); + break; + } + Multimap multiMap = null; + switch(roleId){ + case UserRole.USER_ROLE_ADMINISTRATOR: + multiMap = getEntityListByIdOfUserId(sql,id); + break; + case UserRole.USER_ROLE_MANAGER: + multiMap = getEntityListByIdOfUserId(sql,id); + break; + case UserRole.USER_ROLE_SALES: + multiMap = getEntityListByIdOfUserId(sql, id); + } + return getIndexTable(entity,multiMap,id); + } + + public static String queryRemoteCoachingEventsByUserId(String[] args){ + String id = args[0]; + Map entities = Configuration.getEntityTable(); + Entity entity = entities.get("activity"); + String sql = "select * from (select activity.*,activity.activity_type as"+ + "act_type,activity.status as act_status, activity.contactId as"+ + "contactName, contact.accountId as accountName from activity,"+ + "contact where contact.id= activity.contactId AND crmuserId=?) as aActivity"; + Multimap multiMap = getEntityListByIdOfUserId(sql,id); + + return getIndexTable(entity,multiMap,id); + } + + + public static String getVisitedContactsTableByUserId(String[] args){ + String id = args[0]; + Map entities = Configuration.getEntityTable(); + Entity entity = entities.get("contact"); + Multimap multiMap = getEntityListByIdOfUserId("select contact.* from activity,contact where crmuserId= ? AND contact.id=activity.contactId group by id",id); + + return getIndexTable(entity,multiMap,id); + } + + public static String getExternalMeetingTableDataByUserId(String[] args){ + String id = args[0]; + Map entities = Configuration.getEntityTable(); + Entity entity = entities.get("externalMeeting"); + Multimap multiMap = getEntityListByIdOfUserId(entity.getSql(),id); + + return getIndexTable(entity,multiMap,id); + } + + public static String getAccountIndexTable(String[] args){ + String id = args[0]; + Map entities = Configuration.getEntityTable(); + Entity entity = entities.get("account"); + Multimap multiMap = getEntityListByIdOfUserId(entity.getSql(),id); + return getIndexTable(entity,multiMap,id); + } + + public static String getContactIndexTable(String[] args){ + String id = args[0]; + Map entities = Configuration.getEntityTable(); + Entity entity = entities.get("contact"); + Multimap multiMap = getEntityListByIdOfUserId(entity.getSql(),id); + + return getIndexTable(entity,multiMap,id); + } + + + public static String getCRMUserIndexTable(String[] args){ + String id = args[0]; + Map entities = Configuration.getEntityTable(); + Entity entity = entities.get("crmuser"); + Multimap multiMap = getEntityListByIdOfUserId(entity.getSql(),id); + + return getIndexTable(entity,multiMap,id); + } + + public static String getCoachIndexTable(String[] args){ + String id = args[0]; + Map entities = Configuration.getEntityTable(); + Entity entity = entities.get("coach"); + Multimap multiMap = getEntityListByIdOfUserId(entity.getSql(),id); + + return getIndexTable(entity,multiMap,id); + } + + + public static String getIndexTable(Entity entity, Multimap multiMap, String userId){ + Map entities = Configuration.getEntityTable(); + //Entity entity = entities.get(entityName); + List fields = entity.getFields(); + + JsonObject jo = new JsonObject(); + + JsonArray js_cols = new JsonArray(); + jo.add("cols", js_cols); + for(Field f:fields){ + //if(!f.isVisible() && !f.isPrimaryKey()) continue; + JsonObject js_field = new JsonObject(); + js_field.addProperty("display", f.getDisplay()); + js_field.addProperty("isVisible", f.isVisible()); + js_field.addProperty("priority", f.getPriority()); + js_field.addProperty("name", f.getName()); + js_cols.add(js_field); + } + + JsonObject jsTableData = new JsonObject(); + jo.add("tData", jsTableData); + Gson gson = new Gson(); + // Multimap multiMap = getEntityListByIdOfUserId(entity.getSql(),userId); + for(Integer key:multiMap.keySet()){ + Collection collection = multiMap.get(key); + JsonArray js_rows = new JsonArray(); + for(Map map:collection){ + JsonArray js_row = new JsonArray(); + js_rows.add(js_row); + for(Field f:fields){ + //if(!f.isVisible() && !f.isPrimaryKey()) continue; + + String fieldValue = ""; + if (f.getPicklist() != null) { + fieldValue = DAOImpl.queryPickListByIdCached(f.getPicklist(), String.valueOf(map.get(f.getName()))); + } else if(f.getRelationTable() != null){ + fieldValue = DAOImpl.queryCachedRelationDataById(f.getRelationTable(), String.valueOf(map.get(f.getName()))); + } else { + fieldValue = String.valueOf(map.get(f.getName())); + } + JsonPrimitive jp = new JsonPrimitive(fieldValue); + js_row.add(jp); + } + } + jsTableData.add(String.valueOf(key), js_rows); + } + + + return jo.toString(); + } + + public static String login(String[] args){ + String loginName = args[0]; + String password = args[1]; + UserInfo user = DAOImpl.login(loginName,password); + if(user != null){ + Gson gson = new Gson(); + return gson.toJson(user, UserInfo.class); + }else{ + return "{}"; + } + + + } + + private static Multimap getEntityListByIdOfUserId(String sql, String... ids){ + Multimap multimap = LinkedHashMultimap.create(); + List maplist = DAOImpl.queryEntityRelationList(sql, ids); + + for(Map map:(List)maplist){ + Integer id = Integer.parseInt(String.valueOf(map.get("id"))); + multimap.put(id, map); + } + return multimap; + } + + + public static String getInferiorsByManagerId(String[] args){ + String managerId = args[0]; + + List inferiors = DAOImpl.getInferiorsByManagerId(managerId); + + CRMUser[] array = inferiors.toArray(new CRMUser[0]); + Gson gson = new Gson(); + String jsonString = gson.toJson(array, CRMUser[].class); + return jsonString; + + } +} diff --git a/crm/src/main/java/com/rex/crm/ajax/DataProviderServlet.java b/crm/src/main/java/com/rex/crm/ajax/DataProviderServlet.java new file mode 100644 index 0000000..cdef05a --- /dev/null +++ b/crm/src/main/java/com/rex/crm/ajax/DataProviderServlet.java @@ -0,0 +1,112 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rex.crm.ajax; + +import com.google.gson.Gson; +import com.rex.crm.db.DAOImpl; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintWriter; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * + * @author Feiyun + */ +public class DataProviderServlet extends HttpServlet { + + /** + * Processes requests for both HTTP GET and POST methods. + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + protected void processRequest(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + response.setContentType("text/html;charset=UTF-8"); + PrintWriter out = response.getWriter(); + Gson gson = new Gson(); + try { + BufferedReader br = request.getReader(); + + String jsonString = br.readLine(); + if ((jsonString == null) || jsonString.isEmpty()) { + System.out.println(" no json found"); + } else { + System.out.println(" json is :" + jsonString); + } + FunctionClass method = new Gson().fromJson(jsonString, FunctionClass.class); +// if(method.getS() == null){ +// response.setStatus(HttpServletResponse.SC_FORBIDDEN); +// out.write("session information not provided"); +// return; +// } +// +// String sessionId = method.getS().getId(); +// String sessionKey = method.getS().getKey(); +// System.out.println("TTTTTTTTT:"+DAOImpl.isSessionValid(sessionId,sessionKey)); +// if(sessionId == null || sessionKey == null || !DAOImpl.isSessionValid(sessionId,sessionKey)){ +// response.setStatus(HttpServletResponse.SC_FORBIDDEN); +// out.write("session is not valid"); +// return; +// } +// + + FunctionInvoker invoker = new FunctionInvoker(DataProvider.class); + System.out.println(" method:" + method); + String repTxt = (String) invoker.invoke(method.getF(), method.getP()); + + br.close(); + + + out.write(repTxt); + } catch (Exception e) { + e.printStackTrace(); + } finally { + out.close(); + } + } + + // + /** + * Handles the HTTP GET method. + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + processRequest(request, response); + } + + /** + * Handles the HTTP POST method. + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + processRequest(request, response); + } + + /** + * Returns a short description of the servlet. + * @return a String containing servlet description + */ + @Override + public String getServletInfo() { + return "Short description"; + }// +} diff --git a/crm/src/main/java/com/rex/crm/ajax/DataTable.java b/crm/src/main/java/com/rex/crm/ajax/DataTable.java new file mode 100644 index 0000000..63076ea --- /dev/null +++ b/crm/src/main/java/com/rex/crm/ajax/DataTable.java @@ -0,0 +1,77 @@ + +package com.rex.crm.ajax; + +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author Feiyun Zhou + */ +public class DataTable { + + private List columnsDes = new ArrayList<>(); + private List tableRows = new ArrayList<>(); + + public void addRow(TableRow row) { + tableRows.add(row); + } + + public void addColumn(ColumnDescription column) { + columnsDes.add(column); + } + + protected String stringify() { + JsonObject jo = new JsonObject(); + + //populate table data + JsonArray data = new JsonArray(); + for (TableRow row : tableRows) { + data.add(row.row); + } + jo.add("aaData", data); + + //populate column descritons + JsonArray columns = new JsonArray(); + for (ColumnDescription col : columnsDes) { + columns.add(col.columnDes); + } + + jo.add("aoColumns", columns); + jo.addProperty("sPaginationType", "bootstrap"); + //jo.addProperty("sDom", "<'row-fluid'<'span8'l><'span4'f>r>t<'row-fluid'<'span8'i><'span4'p>>"); + jo.addProperty("sDom", "<'row-fluid'<'span12'f>r>t<'row-fluid'<'span12'p>>"); + jo.add("oLanguage", getChineseConfig()); + jo.addProperty("bSort", false); + + return jo.toString(); + } + /** + * Get the language configuration for the jQuery dataTable + * @return + */ + private static JsonObject getChineseConfig(){ + JsonObject jo = new JsonObject(); + + jo.addProperty("sProcessing", "正在处理中..."); + jo.addProperty("sLengthMenu", "每页显示_MENU_条记录"); + jo.addProperty("sZeroRecords", "没有数据"); + jo.addProperty("sInfo", "此页显示从第_START_条记录到第_END_记录,总共_TOTAL_条记录"); + jo.addProperty("sInfoEmpty", "0页"); + jo.addProperty("sInfoFiltered", ""); + jo.addProperty("sInfoPostFix", ""); + jo.addProperty("sSearch", "查找"); + jo.addProperty("sUrl", ""); + + JsonObject page = new JsonObject(); + page.addProperty("sFirst", "第一页"); + page.addProperty("sPrevious", "上一页"); + page.addProperty("sNext", "下一页"); + page.addProperty("sLast", "最后一页"); + jo.add("oPaginate", page); + + return jo; + } +} diff --git a/crm/src/main/java/com/rex/crm/ajax/FunctionClass.java b/crm/src/main/java/com/rex/crm/ajax/FunctionClass.java new file mode 100644 index 0000000..2c34349 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/ajax/FunctionClass.java @@ -0,0 +1,70 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rex.crm.ajax; + +import java.util.List; + +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; + +/** + * + * @author Feiyun + */ +public class FunctionClass { + private String f; + private String[] p; + private SessionInfo s; + private JsonElement cp;//complex parameters in form of json + + public String getF() { + return f; + } + + public String[] getP() { + return p; + } + + public void setF(String f){ + this.f = f; + } + + public void setP(String[] p){ + this.p = p; + } + + public String toString() { + StringBuffer sb = new StringBuffer(); + if (p != null) { + for (String pa : p) { + sb.append("," + pa); + } + + if(s!=null){ + sb.append(" session id:"+s.getId()); + sb.append(" session key:"+s.getKey()); + } + } + return String.format("function:%s params:%s", f,sb); + } + + public SessionInfo getS() { + return s; + } + + public void setS(SessionInfo s) { + this.s = s; + } + + public JsonElement getCp() { + return cp; + } + + public void setCp(JsonElement cp) { + this.cp = cp; + } + + +} diff --git a/crm/src/main/java/com/rex/crm/ajax/FunctionInvoker.java b/crm/src/main/java/com/rex/crm/ajax/FunctionInvoker.java new file mode 100644 index 0000000..b02ad2a --- /dev/null +++ b/crm/src/main/java/com/rex/crm/ajax/FunctionInvoker.java @@ -0,0 +1,18 @@ +package com.rex.crm.ajax; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +public class FunctionInvoker { + private Class cls; + public FunctionInvoker(Class cls){ + this.cls = cls; + } + + public Object invoke(String func,String[] params) throws InstantiationException, IllegalAccessException, SecurityException, NoSuchMethodException, IllegalArgumentException, InvocationTargetException{ + Object instance = cls.newInstance(); + Method method = cls.getDeclaredMethod(func, new Class[]{String[].class}); + Object result = method.invoke(instance, new Object[]{params}); + return result; + } +} diff --git a/crm/src/main/java/com/rex/crm/ajax/SessionInfo.java b/crm/src/main/java/com/rex/crm/ajax/SessionInfo.java new file mode 100644 index 0000000..55ce94a --- /dev/null +++ b/crm/src/main/java/com/rex/crm/ajax/SessionInfo.java @@ -0,0 +1,22 @@ +package com.rex.crm.ajax; + +public class SessionInfo { + + private String id; + private String key; + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + public String getKey() { + return key; + } + public void setKey(String key) { + this.key = key; + } + + + +} diff --git a/crm/src/main/java/com/rex/crm/ajax/TableRow.java b/crm/src/main/java/com/rex/crm/ajax/TableRow.java new file mode 100644 index 0000000..b8c8b1c --- /dev/null +++ b/crm/src/main/java/com/rex/crm/ajax/TableRow.java @@ -0,0 +1,22 @@ +package com.rex.crm.ajax; + +import com.google.gson.JsonArray; +import com.google.gson.JsonPrimitive; + +/** + * + * @author Feiyun + */ +public class TableRow { + public JsonArray row = new JsonArray(); + + public void addCell(String str){ + JsonPrimitive jp = new JsonPrimitive(str); + row.add(jp); + } + + public void addCell(Number num){ + JsonPrimitive jp = new JsonPrimitive(num); + row.add(jp); + } +} diff --git a/crm/src/main/java/com/rex/crm/beans/Account.java b/crm/src/main/java/com/rex/crm/beans/Account.java new file mode 100644 index 0000000..9163dfe --- /dev/null +++ b/crm/src/main/java/com/rex/crm/beans/Account.java @@ -0,0 +1,179 @@ +package com.rex.crm.beans; + +import java.io.Serializable; +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.common.base.Joiner; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.annotations.Expose; + +public class Account implements Serializable { + @Expose + private int id; + @Expose + private String name; + @Expose + private String tele; + @Expose + private String level; + @Expose + private String classification; + @Expose + private boolean isKeyAccount; + @Expose + private String status; + @Expose + private String address; + private Contact[] contacts; + private CRMUser[] team; + @Expose + private int cityId; + private String photo; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getTele() { + return tele; + } + + public void setTele(String tele) { + this.tele = tele; + } + + public String getLevel() { + return level; + } + + public void setLevel(String level) { + this.level = level; + } + + public String getClassification() { + return classification; + } + + public void setClassification(String classification) { + this.classification = classification; + } + + public boolean isKeyAccount() { + return isKeyAccount; + } + + public void setKeyAccount(boolean isKeyAccount) { + this.isKeyAccount = isKeyAccount; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + @Override + public String toString() { + Gson gson = new GsonBuilder().create(); + return gson.toJson(this, Account.class).toString(); + } + + public String htmlOutput(){ + StringBuffer sb= new StringBuffer(); + sb.append("名称:").append(this.name).append("\n"); + sb.append("电话:").append(this.tele).append("\n"); + sb.append("类型:").append(this.classification).append("\n"); + sb.append("地址:").append(this.address).append("\n"); + return sb.toString(); + } + + public Contact[] getContacts() { + return contacts; + } + + public void setContacts(Contact[] contacts) { + this.contacts = contacts; + } + + public CRMUser[] getTeam() { + return team; + } + + public void setTeam(CRMUser[] team) { + this.team = team; + } + + public int getCityId() { + return cityId; + } + + public void setCityId(int cityId) { + this.cityId = cityId; + } + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + @SuppressWarnings("all") + public Map toMap(){ + Map map = new HashMap(); + map.put("name", getName()); + map.put("address", getAddress()); + map.put("classification", getClassification()); + map.put("id", getId()); + map.put("tele", getTele()); + map.put("photo", photo); + return map; + } + + public static Map getMappingOfField2ColumnName(){ + Map list = new HashMap(); + list.put("name", "名称"); + list.put("address", "地址"); + list.put("classification", "类型"); + list.put("tele", "电话"); + return list; + } + + public static List getFieldNames(){ + List list = new ArrayList(); + Field[] fields = Account.class.getDeclaredFields(); + for(Field f:fields){ + list.add(f.getName()); + } + return list; + } +} diff --git a/crm/src/main/java/com/rex/crm/beans/AccountCRMUserRelation.java b/crm/src/main/java/com/rex/crm/beans/AccountCRMUserRelation.java new file mode 100644 index 0000000..4957e98 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/beans/AccountCRMUserRelation.java @@ -0,0 +1,32 @@ +package com.rex.crm.beans; + +public class AccountCRMUserRelation { + private int accountId; + private int crmuserId; + private int id; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getAccountId() { + return accountId; + } + + public void setAccountId(int accountId) { + this.accountId = accountId; + } + + public int getCrmuserId() { + return crmuserId; + } + + public void setCrmuserId(int crmuserId) { + this.crmuserId = crmuserId; + } + +} diff --git a/crm/src/main/java/com/rex/crm/beans/AdvancedSearchField.java b/crm/src/main/java/com/rex/crm/beans/AdvancedSearchField.java new file mode 100644 index 0000000..9804cd2 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/beans/AdvancedSearchField.java @@ -0,0 +1,37 @@ +package com.rex.crm.beans; + +import java.io.Serializable; + +public class AdvancedSearchField implements Serializable { + + private String type; + private String id; + private String label; + private AdvancedSearchField[] list; + + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + public String getLabel() { + return label; + } + public void setLabel(String label) { + this.label = label; + } + public AdvancedSearchField[] getList() { + return list; + } + public void setList(AdvancedSearchField[] list) { + this.list = list; + } + +} diff --git a/crm/src/main/java/com/rex/crm/beans/AdvancedSearchFilter.java b/crm/src/main/java/com/rex/crm/beans/AdvancedSearchFilter.java new file mode 100644 index 0000000..0099b00 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/beans/AdvancedSearchFilter.java @@ -0,0 +1,37 @@ +package com.rex.crm.beans; + +import java.io.Serializable; + +public class AdvancedSearchFilter implements Serializable { + + private FilterMeta field; + private FilterMeta value; + private FilterMeta operator; + + + public FilterMeta getField() { + return field; + } + public void setField(FilterMeta field) { + this.field = field; + } + public FilterMeta getValue() { + return value; + } + public void setValue(FilterMeta value) { + this.value = value; + } + public FilterMeta getOperator() { + return operator; + } + public void setOperator(FilterMeta operator) { + this.operator = operator; + } + + + +} + + + + diff --git a/crm/src/main/java/com/rex/crm/beans/CRMUser.java b/crm/src/main/java/com/rex/crm/beans/CRMUser.java new file mode 100644 index 0000000..adc62e3 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/beans/CRMUser.java @@ -0,0 +1,290 @@ +package com.rex.crm.beans; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +public class CRMUser { + private int id; + private String name; + private String cellPhone; + private String company; + private String businessUnit; + private String department; + private String division; + private String employeeNumber; + private String jobTitle; + private String email; + private int cityId; + private String photo; + private String password; + private String loginName; + private String sessionKey; + private long lastLoginTime; + private int role; + private int reportto; + private int sex; + private int isActivited; + private long ts; + private int pl1; + private int level; + private String code; + private String userInfoName; + private int pl5; + public String getUserInfoName() { + return userInfoName; + } + + public void setUserInfoName(String userInfoName) { + this.userInfoName = userInfoName; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getCellPhone() { + return cellPhone; + } + + public void setCellPhone(String cellPhone) { + this.cellPhone = cellPhone; + } + + public String getCompany() { + return company; + } + + public void setCompany(String company) { + this.company = company; + } + + public String getBusinessUnit() { + return businessUnit; + } + + public void setBusinessUnit(String businessUnit) { + this.businessUnit = businessUnit; + } + + public String getDepartment() { + return department; + } + + public void setDepartment(String department) { + this.department = department; + } + + public String getDivision() { + return division; + } + + public void setDivision(String division) { + this.division = division; + } + + public String getEmployeeNumber() { + return employeeNumber; + } + + public void setEmployeeNumber(String emplyeeNumber) { + this.employeeNumber = emplyeeNumber; + } + + public String getJobTitle() { + return jobTitle; + } + + public void setJobTitle(String jobTitle) { + this.jobTitle = jobTitle; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getCityId() { + return cityId; + } + + public void setCityId(int cityId) { + this.cityId = cityId; + } + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public int getIsActivited() { + return isActivited; + } + + public void setIsActivited(int isActivited) { + this.isActivited = isActivited; + } + + @Override + public String toString() { + Gson gson = new GsonBuilder().create(); + return gson.toJson(this, CRMUser.class).toString(); + } + + @SuppressWarnings("all") + public Map toMap(){ + Map map = new HashMap(); + map.put("cellPhone", cellPhone); + map.put("division", division); + map.put("department", department); + map.put("email", email); + map.put("jobTitle", jobTitle); + map.put("name", name); + map.put("id", id); + map.put("photo", photo); + map.put("isActivited","isActivited"); + return map; + } + + + public static Map getMappingOfField2ColumnName(){ + Map list = new HashMap(); + list.put("name", "名称"); + list.put("cellPhone", "电话"); + list.put("email", "邮箱"); + list.put("jobTitle", "职位"); + list.put("division", "部门"); + return list; + } + + public static List getFieldNames(){ + List list = new ArrayList(); + Field[] fields = CRMUser.class.getDeclaredFields(); + for(Field f:fields){ + list.add(f.getName()); + } + return list; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getLoginName() { + return loginName; + } + + public void setLoginName(String loginName) { + this.loginName = loginName; + } + + public String getSessionKey() { + return sessionKey; + } + + public void setSessionKey(String sessionKey) { + this.sessionKey = sessionKey; + } + + public long getLastLoginTime() { + return lastLoginTime; + } + + public void setLastLoginTime(long lastLoginTime) { + this.lastLoginTime = lastLoginTime; + } + + public int getRole() { + return role; + } + + public void setRole(int role) { + this.role = role; + } + + public int getReportto() { + return reportto; + } + + public void setReportto(int reportto) { + this.reportto = reportto; + } + + public int getSex() { + return sex; + } + + public void setSex(int sex) { + this.sex = sex; + } + + public long getTs() { + return ts; + } + + public void setTs(long ts) { + this.ts = ts; + } + + public int getPl1() { + return pl1; + } + + public void setPl1(int pl1) { + this.pl1 = pl1; + } + + public int getLevel() { + return level; + } + + public void setLevel(int level) { + this.level = level; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public int getPl5() { + return pl5; + } + + public void setPl5(int pl5) { + this.pl5 = pl5; + } + + + +} diff --git a/crm/src/main/java/com/rex/crm/beans/CalendarEvent.java b/crm/src/main/java/com/rex/crm/beans/CalendarEvent.java new file mode 100644 index 0000000..6f298d9 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/beans/CalendarEvent.java @@ -0,0 +1,169 @@ +package com.rex.crm.beans; + + +import java.util.Date; + +import javax.xml.crypto.Data; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +public class CalendarEvent { + private int id; + private String title; + private boolean allDay = false; + private String start; + private String end; + private long starttime; + private long endtime; + private int crmUserId; + private int activity_type; + private int contactId; + private int status; + private String contactIds; + private int coachId; + private String modifier; + private String owner; + private String responsible_person; + private Date modify_datetime; + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getOwner() { + return owner; + } + public void setModifier(String modifier) { + this.modifier = modifier; + } + + public String getModifier() { + return modifier; + } + public void setResponsible_person(String responsible_person) { + this.responsible_person = responsible_person; + } + + public String getResponsible_person() { + return responsible_person; + } + public Date getModify_datetime() { + return modify_datetime; + } + + public void setModify_datetime(Date modify_datetime) { + this.modify_datetime = modify_datetime; + } + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public boolean isAllDay() { + return allDay; + } + + public void setAllDay(boolean allDay) { + this.allDay = allDay; + } + + @Override + public String toString() { + Gson gson = new GsonBuilder().create(); + return gson.toJson(this, CalendarEvent.class).toString(); + + } + + public int getCrmUserId() { + return crmUserId; + } + + public void setCrmUserId(int crmUserId) { + this.crmUserId = crmUserId; + } + + public String getStart() { + return start; + } + + public void setStart(String start) { + this.start = start; + } + + public String getEnd() { + return end; + } + + public void setEnd(String end) { + this.end = end; + } + + public long getStarttime() { + return starttime; + } + + public void setStarttime(long starttime) { + this.starttime = starttime; + } + + public long getEndtime() { + return endtime; + } + + public void setEndtime(long endtime) { + this.endtime = endtime; + } + + public int getActivity_type() { + return activity_type; + } + + public void setActivity_type(int activity_type) { + this.activity_type = activity_type; + } + + public int getContactId() { + return contactId; + } + + public void setContactId(int contactId) { + this.contactId = contactId; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public String getContactIds() { + return contactIds; + } + + public void setContactIds(String contactIds) { + this.contactIds = contactIds; + } + + public int getCrmUserManagerId() { + return coachId; + } + + public void setCrmUserManagerId(int crmUserManagerId) { + this.coachId = crmUserManagerId; + } + +} diff --git a/crm/src/main/java/com/rex/crm/beans/Choice.java b/crm/src/main/java/com/rex/crm/beans/Choice.java new file mode 100644 index 0000000..f19e0a1 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/beans/Choice.java @@ -0,0 +1,48 @@ +package com.rex.crm.beans; + +import java.io.Serializable; + +public class Choice implements Serializable { + private long id; + private String key; + private String val; + private String name; + + public Choice(){ + + } + public Choice(Long id, String val){ + this.id = id; + this.val = val; + } + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getVal() { + return val; + } + + public void setVal(String val) { + this.val = val; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + public String getKey() { + return key; + } + public void setKey(String key) { + this.key = key; + } + +} diff --git a/crm/src/main/java/com/rex/crm/beans/City.java b/crm/src/main/java/com/rex/crm/beans/City.java new file mode 100644 index 0000000..d16465c --- /dev/null +++ b/crm/src/main/java/com/rex/crm/beans/City.java @@ -0,0 +1,53 @@ +package com.rex.crm.beans; + +import java.io.Serializable; +import java.util.List; + +import com.google.common.base.Joiner; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +public class City implements Serializable { + + private static final long serialVersionUID = 943058094848141611L; + + private String name; + private Account[] accounts; + private int id; + private int provinceId; + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + public Account[] getAccounts() { + return accounts; + } + public void setAccounts(Account[] accounts) { + this.accounts = accounts; + } + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + public int getProvinceId() { + return provinceId; + } + public void setProvinceId(int provinceId) { + this.provinceId = provinceId; + } + @Override + public String toString() { + Gson gson = new GsonBuilder().create(); + return gson.toJson(this, City.class).toString(); + + } + + + +} diff --git a/crm/src/main/java/com/rex/crm/beans/Contact.java b/crm/src/main/java/com/rex/crm/beans/Contact.java new file mode 100644 index 0000000..80d91a7 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/beans/Contact.java @@ -0,0 +1,123 @@ +package com.rex.crm.beans; + +import java.io.Serializable; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +public class Contact implements Serializable { + private int id; + private String name; + private String duty; + private String title; + private String branch; + private String department; + private String gender; + private String birth; + private String tel_work; + private String mobilephone; + private String accountBelongTo; + private int accountId; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDuty() { + return duty; + } + + public void setDuty(String duty) { + this.duty = duty; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getBranch() { + return branch; + } + + public void setBranch(String branch) { + this.branch = branch; + } + + public String getDepartment() { + return department; + } + + public void setDepartment(String department) { + this.department = department; + } + + public String getGender() { + return gender; + } + + public void setGender(String gender) { + this.gender = gender; + } + + public String getBirth() { + return birth; + } + + public void setBirth(String birth) { + this.birth = birth; + } + + public String getTel_work() { + return tel_work; + } + + public void setTel_work(String tel_work) { + this.tel_work = tel_work; + } + + public String getMobilephone() { + return mobilephone; + } + + public void setMobilephone(String mobilephone) { + this.mobilephone = mobilephone; + } + + public String getAccountBelongTo() { + return accountBelongTo; + } + + public void setAccountBelongTo(String accountBelongTo) { + this.accountBelongTo = accountBelongTo; + } + + public int getAccountId() { + return accountId; + } + + public void setAccountId(int accountId) { + this.accountId = accountId; + } + + @Override + public String toString() { + Gson gson = new GsonBuilder().create(); + return gson.toJson(this, Contact.class).toString(); + } +} diff --git a/crm/src/main/java/com/rex/crm/beans/FilterMeta.java b/crm/src/main/java/com/rex/crm/beans/FilterMeta.java new file mode 100644 index 0000000..be2e396 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/beans/FilterMeta.java @@ -0,0 +1,22 @@ +package com.rex.crm.beans; + +import java.io.Serializable; + + +public class FilterMeta implements Serializable { + private String label; + private String value; + + public String getLabel() { + return label; + } + public void setLabel(String label) { + this.label = label; + } + public String getValue() { + return value; + } + public void setValue(String value) { + this.value = value; + } +} diff --git a/crm/src/main/java/com/rex/crm/beans/Product.java b/crm/src/main/java/com/rex/crm/beans/Product.java new file mode 100644 index 0000000..3b8b716 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/beans/Product.java @@ -0,0 +1,61 @@ +package com.rex.crm.beans; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +public class Product { + private int id; + private String name; + + @Override + public String toString() { + Gson gson = new GsonBuilder().create(); + return gson.toJson(this, Product.class).toString(); + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @SuppressWarnings("all") + public Map toMap(){ + Map map = new HashMap(); + map.put("name", name); + return map; + } + + + public static Map getMappingOfField2ColumnName(){ + Map list = new HashMap(); + list.put("name", "名称"); + return list; + } + + public static List getFieldNames(){ + List list = new ArrayList(); + Field[] fields = Product.class.getDeclaredFields(); + for(Field f:fields){ + list.add(f.getName()); + } + return list; + } + +} diff --git a/crm/src/main/java/com/rex/crm/beans/ProductLine.java b/crm/src/main/java/com/rex/crm/beans/ProductLine.java new file mode 100644 index 0000000..b8030ee --- /dev/null +++ b/crm/src/main/java/com/rex/crm/beans/ProductLine.java @@ -0,0 +1,64 @@ +package com.rex.crm.beans; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +public class ProductLine { + private int id; + private String val; + + @Override + public String toString() { + Gson gson = new GsonBuilder().create(); + return gson.toJson(this, ProductLine.class).toString(); + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getVal() { + return val; + } + + public void setVal(String val) { + this.val = val; + } + + @SuppressWarnings("all") + public Map toMap(){ + Map map = new HashMap(); + map.put("val", val); + return map; + } + + + public static Map getMappingOfField2ColumnName(){ + Map list = new HashMap(); + list.put("val", "名称"); + return list; + } + + public static List getFieldNames(){ + List list = new ArrayList(); + Field[] fields = CRMUser.class.getDeclaredFields(); + for(Field f:fields){ + list.add(f.getName()); + } + return list; + } + + + + +} diff --git a/crm/src/main/java/com/rex/crm/beans/Productcategory.java b/crm/src/main/java/com/rex/crm/beans/Productcategory.java new file mode 100644 index 0000000..c6e45e1 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/beans/Productcategory.java @@ -0,0 +1,61 @@ +package com.rex.crm.beans; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +public class Productcategory { + private int id; + private String name; + + @Override + public String toString() { + Gson gson = new GsonBuilder().create(); + return gson.toJson(this, Product.class).toString(); + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @SuppressWarnings("all") + public Map toMap(){ + Map map = new HashMap(); + map.put("name", name); + return map; + } + + + public static Map getMappingOfField2ColumnName(){ + Map list = new HashMap(); + list.put("name", "名称"); + return list; + } + + public static List getFieldNames(){ + List list = new ArrayList(); + Field[] fields = Product.class.getDeclaredFields(); + for(Field f:fields){ + list.add(f.getName()); + } + return list; + } + +} diff --git a/crm/src/main/java/com/rex/crm/beans/Province.java b/crm/src/main/java/com/rex/crm/beans/Province.java new file mode 100644 index 0000000..baf8c0b --- /dev/null +++ b/crm/src/main/java/com/rex/crm/beans/Province.java @@ -0,0 +1,43 @@ +package com.rex.crm.beans; + +import java.io.Serializable; +import java.util.List; + +import com.google.common.base.Joiner; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +public class Province implements Serializable { + + private static final long serialVersionUID = -4347708252049971152L; + + private String name; + private City[] cities; + private int id; + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public City[] getCities() { + return cities; + } + public void setCities(City[] cities) { + this.cities = cities; + } + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + @Override + public String toString() { + Gson gson = new GsonBuilder().create(); + return gson.toJson(this, Province.class).toString(); + } + + +} diff --git a/crm/src/main/java/com/rex/crm/beans/Resp.java b/crm/src/main/java/com/rex/crm/beans/Resp.java new file mode 100644 index 0000000..11bc03a --- /dev/null +++ b/crm/src/main/java/com/rex/crm/beans/Resp.java @@ -0,0 +1,20 @@ +package com.rex.crm.beans; + +public class Resp { + private int code; + private String message; + + public int getCode() { + return code; + } + public void setCode(int code) { + this.code = code; + } + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + +} diff --git a/crm/src/main/java/com/rex/crm/beans/UserInfo.java b/crm/src/main/java/com/rex/crm/beans/UserInfo.java new file mode 100644 index 0000000..eba4a21 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/beans/UserInfo.java @@ -0,0 +1,279 @@ +package com.rex.crm.beans; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +public class UserInfo { + private int id; + private String name; + private String cellPhone; + private String company; + private String businessUnit; + private String department; + private String division; + private String employeeNumber; + private String jobTitle; + private String email; + private int cityId; + private String photo; + private String password; + private String loginName; + private String sessionKey; + private long lastLoginTime; + private int role; + private int reportto; + private int sex; + private int pl1; + private int level; + private String position_code; + private int positionId; + private String office_tel; + private int num_of_signIn; + public int getPositionId() + { + return positionId; + } + public void setPositionId(int positionId) + { + this.positionId = positionId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getCellPhone() { + return cellPhone; + } + + public void setCellPhone(String cellPhone) { + this.cellPhone = cellPhone; + } + + public String getCompany() { + return company; + } + + public void setCompany(String company) { + this.company = company; + } + + public String getBusinessUnit() { + return businessUnit; + } + + public void setBusinessUnit(String businessUnit) { + this.businessUnit = businessUnit; + } + + public String getDepartment() { + return department; + } + + public void setDepartment(String department) { + this.department = department; + } + + public String getDivision() { + return division; + } + + public void setDivision(String division) { + this.division = division; + } + + public String getEmployeeNumber() { + return employeeNumber; + } + + public void setEmployeeNumber(String emplyeeNumber) { + this.employeeNumber = emplyeeNumber; + } + + public String getJobTitle() { + return jobTitle; + } + + public void setJobTitle(String jobTitle) { + this.jobTitle = jobTitle; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getCityId() { + return cityId; + } + + public void setCityId(int cityId) { + this.cityId = cityId; + } + + public String getPhoto() { + return photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + @Override + public String toString() { + Gson gson = new GsonBuilder().create(); + return gson.toJson(this, CRMUser.class).toString(); + } + + @SuppressWarnings("all") + public Map toMap(){ + Map map = new HashMap(); + map.put("cellPhone", cellPhone); + map.put("division", division); + map.put("department", department); + map.put("email", email); + map.put("jobTitle", jobTitle); + map.put("name", name); + map.put("id", id); + map.put("photo", photo); + map.put("isActivited","isActivited"); + return map; + } + + + public static Map getMappingOfField2ColumnName(){ + Map list = new HashMap(); + list.put("name", "名称"); + list.put("cellPhone", "电话"); + list.put("email", "邮箱"); + list.put("jobTitle", "职位"); + list.put("division", "部门"); + return list; + } + + public static List getFieldNames(){ + List list = new ArrayList(); + Field[] fields = CRMUser.class.getDeclaredFields(); + for(Field f:fields){ + list.add(f.getName()); + } + return list; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getLoginName() { + return loginName; + } + + public void setLoginName(String loginName) { + this.loginName = loginName; + } + + public String getSessionKey() { + return sessionKey; + } + + public void setSessionKey(String sessionKey) { + this.sessionKey = sessionKey; + } + + public long getLastLoginTime() { + return lastLoginTime; + } + + public void setLastLoginTime(long lastLoginTime) { + this.lastLoginTime = lastLoginTime; + } + + public int getRole() { + return role; + } + + public void setRole(int role) { + this.role = role; + } + + public int getReportto() { + return reportto; + } + + public void setReportto(int reportto) { + this.reportto = reportto; + } + + public int getSex() { + return sex; + } + + public void setSex(int sex) { + this.sex = sex; + } + + + public int getPl1() { + return pl1; + } + + public void setPl1(int pl1) { + this.pl1 = pl1; + } + + public int getLevel() { + return level; + } + + public void setLevel(int level) { + this.level = level; + } + + public String getPosition_code() { + return position_code; + } + + public void setPosition_code(String position_code) { + this.position_code = position_code; + } + public String getOffice_tel() { + return office_tel; + } + public void setOffice_tel(String office_tel) { + this.office_tel = office_tel; + } + public int getNum_of_signIn() { + return num_of_signIn; + } + public void setNum_of_signIn(int num_of_signIn) { + this.num_of_signIn = num_of_signIn; + } + + + +} diff --git a/crm/src/main/java/com/rex/crm/beans/UserPosition.java b/crm/src/main/java/com/rex/crm/beans/UserPosition.java new file mode 100644 index 0000000..e0a5463 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/beans/UserPosition.java @@ -0,0 +1,33 @@ +package com.rex.crm.beans; + +public class UserPosition { + private int id; + private int userId; + private int positionId; + private int isPrimary; + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + public int getUserId() { + return userId; + } + public void setUserId(int userId) { + this.userId = userId; + } + public int getPositionId() { + return positionId; + } + public void setPositionId(int positionId) { + this.positionId = positionId; + } + public int getIsPrimary() { + return isPrimary; + } + public void setIsPrimary(int isPrimary) { + this.isPrimary = isPrimary; + } + +} diff --git a/crm/src/main/java/com/rex/crm/common/AccountPositionPanel.html b/crm/src/main/java/com/rex/crm/common/AccountPositionPanel.html new file mode 100644 index 0000000..30667f8 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/AccountPositionPanel.html @@ -0,0 +1,69 @@ + + + +
+
+
+
+
+ +
+
+ 添加 +
+
+ 删除 +
+
+
+
+ + + + + + + + + + + + + + + + +
+
+
+ + + +
+
+
+
+ + +
\ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/common/AccountPositionPanel.java b/crm/src/main/java/com/rex/crm/common/AccountPositionPanel.java new file mode 100644 index 0000000..f118bfc --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/AccountPositionPanel.java @@ -0,0 +1,344 @@ +package com.rex.crm.common; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.List; +import java.util.Map; + +import javax.mail.Session; + +import org.apache.log4j.Logger; +import org.apache.wicket.MarkupContainer; +import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.markup.ComponentTag; +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.Check; +import org.apache.wicket.markup.html.form.CheckGroup; +import org.apache.wicket.markup.html.form.CheckGroupSelector; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.SubmitLink; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.markup.html.list.AbstractItem; +import org.apache.wicket.markup.html.list.ListItem; +import org.apache.wicket.markup.html.list.PageableListView; +import org.apache.wicket.markup.html.panel.Fragment; +import org.apache.wicket.markup.html.panel.Panel; +import org.apache.wicket.markup.repeater.RepeatingView; +import org.apache.wicket.model.IModel; +import org.apache.wicket.model.Model; +import org.apache.wicket.model.PropertyModel; +import org.apache.wicket.request.mapper.parameter.PageParameters; +import org.apache.wicket.ajax.markup.html.AjaxLink; +import org.apache.wicket.behavior.AttributeAppender; +import org.apache.wicket.behavior.Behavior; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.rex.crm.SearchCRMUserPage; +import com.rex.crm.SignIn2Session; +import com.rex.crm.admin.PositionTreePage; +import com.rex.crm.beans.Account; +import com.rex.crm.beans.CRMUser; +import com.rex.crm.beans.UserInfo; +import com.rex.crm.common.tree.Node; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.util.CRMUtility; +import com.rex.crm.util.Configuration; +import org.apache.wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigator; + +public class AccountPositionPanel extends Panel { + private static final long serialVersionUID = 2501105233172820074L; + private static final Logger logger = Logger.getLogger(AccountPositionPanel.class); + private String etId; + private String currentEntityName; + List selectedRowIds = Lists.newArrayList(); + + public AccountPositionPanel(String id,final String en,final String entityId,final int level) { + super(id); + etId = entityId; + currentEntityName = en; + final int roleId = ((SignIn2Session)getSession()).getRoleId(); + final String userId = ((SignIn2Session)getSession()).getUserId(); + //team sql + String teamSql = ""; + teamSql = "select * from user_position_query where " + getCondition(Integer.parseInt(entityId)); + List mapList = DAOImpl.queryEntityRelationList(teamSql); + Entity entity=null ; + entity = Configuration.getEntityByName("regionManage"); + add(new Label("title","区域管理 ")); + + final List fields = entity.getFields(); + final String entityName = entity.getName(); + Form form = new Form("form"); + add(form); + if(roleId != 1){ + WebMarkupContainer con = new WebMarkupContainer("remove_team_member_click"); + add(con); + con.setVisible(false); + //con.add(new AttributeAppender("style", new Model("display:none;"), ";")); + + }else{ + + add(new SubmitLink("remove_team_member_click",form){ + @Override + public void onSubmit(){ + + try{ + delete(Integer.parseInt(entityId)); + }catch(Exception e){ + + } + PageParameters param = new PageParameters(); + param.add("positionId", entityId); + param.add("level",String.valueOf(level)); + setResponsePage(PositionTreePage.class,param ); + + } + }); + } + + //add button submission + if(roleId != 1){ + WebMarkupContainer con = new WebMarkupContainer("add_users_link"); + add(con); + con.setVisible(false); + }else{ + add(new Link("add_users_link"){ + + @Override + public void onClick() { + this.setResponsePage(new SearchCRMUserPage(currentEntityName,entityId,userId,0)); + } + + }); + + } + + //set column name + RepeatingView columnNameRepeater = new RepeatingView("columnNameRepeater"); + form.add(columnNameRepeater); + int count=0; + for(Field f:entity.getFields()){ + if (!f.isVisible()|| f.getPriority() >1) + continue; + AbstractItem item = new AbstractItem(columnNameRepeater.newChildId()); + if(count==0){ + item.add(new AttributeAppender("class", new Model("table-first-link"), " ")); + count++; + } + columnNameRepeater.add(item); + item.add(new Label("columnName", f.getDisplay())); + } + + + final Map tableData = Maps.newHashMap(); + List ids = Lists.newArrayList(); + for (Map map : (List) mapList) { + String key = String.valueOf(map.get("id")); + ids.add(key); + tableData.put(key, map); + } + + + final PageableListView listview = new PageableListView("dataRowRepeater", ids, 15) { + + @Override + protected void populateItem(ListItem item) { + String key = item.getDefaultModelObjectAsString(); + RepeatingView columnRepeater = new RepeatingView("columnRepeater"); + Map map = tableData.get(key); + item.add(columnRepeater); + final String realId = String.valueOf(map.get("id")); + final String rowId = String.valueOf(map.get("rid")); + for (Field f : fields) { + if (!f.isVisible() || f.getPriority() >1) + continue; + AbstractItem columnitem = new AbstractItem(columnRepeater.newChildId(), new Model() { + @Override + public Serializable getObject() { + Param p = new Param(); + p.setId(rowId); + p.setExtraId(realId); + p.setEntityName(entityName); + return p; + + } + }); + if (f.isDetailLink()) { + String value = CRMUtility.formatValue(f.getFormatter(), String.valueOf(map.get(f.getName()))); + if(value.equals("null")||value.equals("")||value.equals("dummy")){ + value = "无"; + } + columnitem.add(new AttributeAppender("class", new Model("table-first-link"), " ")); + columnitem.add(new DetailLinkFragment("celldata","detailFragment",this,value)); + } else { + if (f.getPicklist() != null) { + // get option from picklist + String value = CRMUtility.formatValue(f.getFormatter(), DAOImpl.queryPickListByIdCached(f.getPicklist(), String.valueOf(map.get(f.getName())))); + if(value.equals("null")||value.equals("")||value.equals("dummy")){ + value = "无"; + } + columnitem.add(new Label("celldata", value)); + } else if(f.getRelationTable() != null){ + String value = CRMUtility.formatValue(f.getFormatter(), DAOImpl.queryCachedRelationDataById(f.getRelationTable(), String.valueOf(map.get(f.getName())))); + if(value.equals("null")||value.equals("")||value.equals("dummy")){ + value = "无"; + } + columnitem.add(new Label("celldata", value)); + }else { + String value = CRMUtility.formatValue(f.getFormatter(), String.valueOf(map.get(f.getName()))); + if(value.equals("null")||value.equals("")||value.equals("dummy")){ + value = "无"; + } + columnitem.add(new Label("celldata", value)); + } + } + columnRepeater.add(columnitem); + } + + } + }; + form.add(listview); + //PagingNavigator nav = new PagingNavigator("navigator", listview); + AjaxPagingNavigator nav =new AjaxPagingNavigator("navigator", listview); + nav.setOutputMarkupId(true); + + form.add(nav); + form.setVersioned(false); + add(new NewDataFormPanel("formPanel",entity,null)); + } + + public AccountPositionPanel(String id, IModel model) { + super(id, model); + } + + private class DetailLinkFragment extends Fragment + { + public DetailLinkFragment(String id, String markupId, MarkupContainer markupProvider,String caption) + { + super(id, markupId, markupProvider); + add(new Link("detailclick") + { + + @Override + public void onClick() + { + Param p = (Param)getParent().getParent().getDefaultModelObject(); + setResponsePage(new EntityDetailPage(p.getEntityName(),p.getExtraId())); + + } + }.add(new Label("caption", new Model(caption)))); + } + } + + private class checkboxFragment extends Fragment { + + public checkboxFragment(String id, String markupId, MarkupContainer markupProvider,Model Imodel) + { + super(id, markupId, markupProvider); + // TODO Auto-generated constructor stub + add(new Check("checkbox",Imodel)); + } + + } + + private int queryPositionLevel(int positionId) + { + int level = 100; + + Map position = DAOImpl.queryEntityById("select * from crmuser where id = ?", String.valueOf(positionId)); + if(position.size() > 0) + { + level = (int) position.get("level"); + } + + return level; + } + + private ArrayList queryPositionByParent(int positionId) + { + List list = DAOImpl.searchCRMUserByManager(String.valueOf(positionId), ""); + ArrayList ids = new ArrayList<>(); + for(Object o : list) + { + Map map = (Map) o; + ids.add(Integer.valueOf((Integer)map.get("id"))); + } + + return ids; + } + + private void delete(int positionId) + { + int level = queryPositionLevel(positionId); + + if(level == 11) + { + DAOImpl.deleteAccountTeamWithPositionId(positionId); + } + else if(level > 1) + { + ArrayList ids = queryPositionByParent(positionId); + for(int id : ids) + { + delete(id); + } + } + } + + private ArrayList queryPosition(int positionId) + { + ArrayList ids = new ArrayList<>(); + + int level = queryPositionLevel(positionId); + + if(level == 11) + { + ids.add(positionId); + } + else if(level > 11) + { + for(int id : queryPositionByParent(positionId)) + { + level = queryPositionLevel(positionId); + + if(level == 11) + { + ids.add(level); + } + else if(level > 11) + { + ids.addAll(queryPosition(id)); + } + } + } + + return ids; + } + + private String getCondition(int positionId) + { + ArrayList ids = queryPosition(positionId); + StringBuilder sb = new StringBuilder(); + if(ids != null && ids.size() > 0) + { + sb = new StringBuilder(); + sb.append("position_id in("); + sb.append(ids.get(0)); + ids.remove(0); + + for(int id : ids) + { + sb.append(","); + sb.append(id); + } + + sb.append(")"); + } + + + return sb.toString(); + } +} diff --git a/crm/src/main/java/com/rex/crm/common/AddEntityPage.html b/crm/src/main/java/com/rex/crm/common/AddEntityPage.html new file mode 100755 index 0000000..a361052 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/AddEntityPage.html @@ -0,0 +1,48 @@ + + + + + +
+
+ + +
+ +
+ + + +
+
+ 我的 +
+
    +
  • +
    +
    +
    + ^_^ +
    + +
    +
    +
  • +
+
+
+ +
+
+
+ + +
+
+
+ + diff --git a/crm/src/main/java/com/rex/crm/common/AddEntityPage.java b/crm/src/main/java/com/rex/crm/common/AddEntityPage.java new file mode 100644 index 0000000..22a090b --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/AddEntityPage.java @@ -0,0 +1,76 @@ +package com.rex.crm.common; + +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.apache.wicket.Component; +import org.apache.wicket.behavior.AbstractAjaxBehavior; +import org.apache.wicket.behavior.AttributeAppender; +import org.apache.wicket.markup.head.IHeaderResponse; +import org.apache.wicket.markup.head.OnDomReadyHeaderItem; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.list.AbstractItem; +import org.apache.wicket.markup.repeater.RepeatingView; +import org.apache.wicket.model.Model; + +import com.rex.crm.TemplatePage; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.util.CRMUtility; +import com.rex.crm.util.Configuration; + +public class AddEntityPage extends TemplatePage { + private static final Logger logger = Logger.getLogger(AddEntityPage.class); + private static final long serialVersionUID = -2613412283023068638L; + + private static int NUM_OF_COLUMN = 2; + + public AddEntityPage(final String entityName, String id){ + this.setPageTitle("详细信息"); + + Map entities = Configuration.getEntityTable(); + Entity entity = entities.get(entityName); + + + long lid = Long.parseLong(id); + Map map = DAOImpl.getEntityData(entity.getName(), entity.getFieldNames(), lid); + + add(new Label("name",String.valueOf(map.get("name")))); + add(new EntityDetailPanel("detailed",entity,map,id,3,entityName)); + + //set relations data + List relations = Configuration.getRelationsByName(entityName); + + RepeatingView relationRepeater = new RepeatingView("relationRepeater"); + add(relationRepeater); + + for(Relation r:relations){ + AbstractItem item = new AbstractItem(relationRepeater.newChildId()); + relationRepeater.add(item); + logger.debug(r.getSql()); + logger.debug("parms:"+id); + List list = DAOImpl.queryEntityRelationList(r.getSql(), id); + item.add(new RelationDataPanel("relationPanel",r,entityName,list,String.valueOf(lid),null)); + + } + + add(new AbstractAjaxBehavior(){ + + @Override + public void onRequest() { + } + + @Override + public void renderHead(Component component, IHeaderResponse response) { + super.renderHead(component, response); + response.render(OnDomReadyHeaderItem.forScript("$(\"#navitem-"+entityName+"\").addClass(\"active\");")); + } + + }); + + + } + +} diff --git a/crm/src/main/java/com/rex/crm/common/CRUDPanel.html b/crm/src/main/java/com/rex/crm/common/CRUDPanel.html new file mode 100644 index 0000000..f9d4aa0 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/CRUDPanel.html @@ -0,0 +1,54 @@ + + + + +
+
+
+
+
+
+
+
+
+
+ +
+ + + 新建 + + + + 删除 + + + + 编辑 + + + 重置密码 + + + 完成 + + + 下载 + + + 未执行 + + + 合并 + + + 失效 + + +
\ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/common/CRUDPanel.java b/crm/src/main/java/com/rex/crm/common/CRUDPanel.java new file mode 100644 index 0000000..2739c8a --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/CRUDPanel.java @@ -0,0 +1,231 @@ +package com.rex.crm.common; + +import java.util.Calendar; +import java.util.Date; +import java.util.EnumSet; +import java.util.Map; + +import org.apache.wicket.behavior.AttributeAppender; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.markup.html.panel.Fragment; +import org.apache.wicket.markup.html.panel.Panel; +import org.apache.wicket.model.Model; + +import com.rex.crm.db.DAOImpl; +import com.rex.crm.db.model.Activity; +import com.rex.crm.util.Configuration; + +public class CRUDPanel extends Panel { + private static final long serialVersionUID = 2501105233172820074L; + + public enum Permissions { + ADD, DEL, EDIT,NONE,RESETPWD,DONE,DOWNLOAD,UPLOAD,noExecute,MERGE,INEFFECTIVE; + + } + + public CRUDPanel(final String id, final String entityName, + final String entityId,EnumSet userPerms, final ICRUDActionListener listener) { + super(id); + Map entities = Configuration.getEntityTable(); + final Entity entity = entities.get(entityName); + + if (userPerms == null || userPerms.size() == 0) { + add(new Fragment("addCon","emptyFragment",this)); + add(new Fragment("delCon","emptyFragment",this)); + add(new Fragment("editCon","emptyFragment",this)); + add(new Fragment("resetPwdCon","emptyFragment",this)); + add(new Fragment("doneCon","emptyFragment",this)); + add(new Fragment("downloadCon","emptyFragment",this)); + add(new Fragment("noExecuteCon","emptyFragment",this)); + add(new Fragment("mergeCon","emptyFragment",this)); + add(new Fragment("ineffectiveCon","emptyFragment",this)); + } else { + + if (userPerms.contains(Permissions.ADD)) { + Fragment addfrag = new Fragment("addCon","addFragment",this); + addfrag.add(new Link("create_new_data_btn") { + + @Override + public void onClick() { + + listener.create(); + } + }); + add(addfrag); + }else{ + add(new Fragment("addCon","emptyFragment",this)); + } + + if (userPerms.contains(Permissions.DEL)) { + Fragment delfrag = new Fragment("delCon","delFragment",this); + delfrag.add(new Link("del_data_btn") { + + @Override + public void onClick() { + + listener.delete(); + + } + }); + add(delfrag); + }else{ + add(new Fragment("delCon","emptyFragment",this)); + } + + if (userPerms.contains(Permissions.EDIT)) { + Fragment editfrag = new Fragment("editCon","editFragment",this); + Link link = new Link("edit_data_btn") { + + @Override + public void onClick() { + listener.update(); + //setResponsePage(new EditDataPage(entity.getName(),entityId)); + } + }; + editfrag.addOrReplace(link); + //根据entityId获取对象,获取开始时间,然后判断时间是否未来时则隐藏 + if(entityName.equals("activity")||entityName.equals("coaching")||entityName.equals("willcoaching")){ + Activity activity = DAOImpl.getActivityById(Integer.parseInt(entityId)); + Date newDate = new Date(); + Calendar cal = Calendar.getInstance(); + cal.setTime(newDate); + cal.set(Calendar.DATE,cal.get(Calendar.DATE)-7); + newDate = cal.getTime(); + Date startTime =activity.getStarttime(); + if(startTime.compareTo(newDate)<0){ + editfrag.add(new AttributeAppender("class",new Model("hiddenStyle")," ")); + }else if(activity.getStatus()==3||activity.getStatus()==2){ + editfrag.add(new AttributeAppender("class",new Model("hiddenStyle")," ")); + } + } + addOrReplace(editfrag); + }else{ + addOrReplace(new Fragment("editCon","emptyFragment",this)); + } + //判断如果entityName为crmuser,则添加重置密码按钮 + if (userPerms.contains(Permissions.RESETPWD)) { + if(entityName.equals("userinfo")){ + Fragment editfrag = new Fragment("resetPwdCon","resetPwdFragment",this); + editfrag.add(new Link("resetPwd_data_btn") { + @Override + public void onClick() { + int userId = Integer.parseInt(entityId); + //重置密码设置密码为null,发送邮件设置 + listener.resetPassword(userId); + } + }); + add(editfrag); + }else{ + add(new Fragment("resetPwdCon","emptyFragment",this)); + } + }else{ + add(new Fragment("resetPwdCon","emptyFragment",this)); + } + if (userPerms.contains(Permissions.DONE)) { + Fragment addfrag = new Fragment("doneCon","doneFragment",this); + Link link = new Link("done_data_btn") { + + @Override + public void onClick() { + + listener.doneBtn(); + } + }; + addfrag.add(link); + //根据entityId获取对象,获取开始时间,然后判断时间是否未来时则隐藏 + if(entityName.equals("activity")||entityName.equals("coaching")||entityName.equals("willcoaching")){ + Activity activity = DAOImpl.getActivityById(Integer.parseInt(entityId)); + Date newDate = new Date(); + Date startTime = activity.getStarttime(); + if(startTime.compareTo(newDate)>=0){ + addfrag.add(new AttributeAppender("class",new Model("hiddenStyle")," ")); + }else if(activity.getStatus()==3){ + addfrag.add(new AttributeAppender("class",new Model("hiddenStyle")," ")); + } + } + add(addfrag); + }else{ + add(new Fragment("doneCon","emptyFragment",this)); + } + + if (userPerms.contains(Permissions.DOWNLOAD)) { + //downLoad_account_btn + Fragment downLoadfrag = new Fragment("downloadCon","downLoadFragment",this); + downLoadfrag.add(new Link("downLoad_account_btn") { + + @Override + public void onClick() { + + try + { + listener.downLoadBtn(); + } + catch (Exception e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + add(downLoadfrag); + }else{ + add(new Fragment("downloadCon","emptyFragment",this)); + } + if (userPerms.contains(Permissions.noExecute)) { + Fragment addfrag = new Fragment("noExecuteCon","noExecuteFragment",this); + Link link = new Link("noExecute_data_btn") { + + @Override + public void onClick() { + listener.noExecute(entityName, Integer.parseInt(entityId)); + } + }; + addfrag.add(link); + add(addfrag); + //根据entityId获取对象,获取开始时间,然后判断时间是否未来时则隐藏 + if(entityName.equals("activity")||entityName.equals("coaching")||entityName.equals("willcoaching")){ + Activity activity = DAOImpl.getActivityById(Integer.parseInt(entityId)); + if(activity.getStatus()!=1){ + addfrag.add(new AttributeAppender("class",new Model("hiddenStyle")," ")); + } + } + }else{ + add(new Fragment("noExecuteCon","emptyFragment",this)); + } + + + + if (userPerms.contains(Permissions.MERGE)) { + Fragment addfrag = new Fragment("mergeCon","mergeFragment",this); + Link link = new Link("merge_data_btn") { + + @Override + public void onClick() { + listener.merge(); + } + }; + addfrag.add(link); + add(addfrag); + }else{ + add(new Fragment("mergeCon","emptyFragment",this)); + } + + if (userPerms.contains(Permissions.INEFFECTIVE)) { + Fragment addfrag = new Fragment("ineffectiveCon","ineffectiveFragment",this); + Link link = new Link("ineffective_data_btn") { + + @Override + public void onClick() { + listener.ineffective(); + } + }; + addfrag.add(link); + add(addfrag); + }else{ + add(new Fragment("ineffectiveCon","emptyFragment",this)); + } + + } + } + +} diff --git a/crm/src/main/java/com/rex/crm/common/CalendarPanel.html b/crm/src/main/java/com/rex/crm/common/CalendarPanel.html new file mode 100644 index 0000000..d8126e4 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/CalendarPanel.html @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + +
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+ +
+ + 计划 + 完成 + +
+ 未执行 + +
+
+
+
\ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/common/CalendarPanel.java b/crm/src/main/java/com/rex/crm/common/CalendarPanel.java new file mode 100644 index 0000000..ecfea17 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/CalendarPanel.java @@ -0,0 +1,93 @@ +package com.rex.crm.common; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +import javax.servlet.ServletContext; + +import org.apache.log4j.Logger; +import org.apache.wicket.core.request.handler.PageProvider; +import org.apache.wicket.core.request.handler.RenderPageRequestHandler; +import org.apache.wicket.markup.head.IHeaderResponse; +import org.apache.wicket.markup.head.JavaScriptHeaderItem; +import org.apache.wicket.markup.html.WebPage; +import org.apache.wicket.markup.html.panel.Panel; +import org.apache.wicket.model.IModel; +import org.apache.wicket.protocol.http.WebApplication; +import org.apache.wicket.request.mapper.parameter.PageParameters; +import org.apache.wicket.util.string.StringValue; +import org.apache.wicket.util.template.PackageTextTemplate; + +import com.google.common.collect.Maps; +import com.rex.crm.ActivitySelectPage; +import com.rex.crm.CreateEventPage; +import com.rex.crm.EventViewerPage; +import com.rex.crm.SignIn2Session; + + + +public class CalendarPanel extends Panel { + private static final long serialVersionUID = 2501105233172820074L; + private static final Logger logger = Logger.getLogger(CalendarPanel.class); + + public CalendarPanel(String id) { + super(id); + } + @Override + public void renderHead(IHeaderResponse response) { + super.renderHead(response); + Map map = new HashMap<>(); + //TODO get userID from session + final String posId = ((SignIn2Session)getSession()).getPositionId(); + final int roleId = ((SignIn2Session)getSession()).getRoleId(); + map.put("user_event_data", com.rex.crm.ajax.DataProvider.getEventsByUserId(new String[]{posId})); + WebPage page = new ActivitySelectPage(); + CharSequence pageUrl = getRequestCycle().urlFor(new RenderPageRequestHandler(new PageProvider(page))); + String url = pageUrl.toString(); + url = url.substring(0, url.indexOf("?")+1); + map.put("create_event_page_url", url); + CharSequence viewPageUrl = getRequestCycle().urlFor(new RenderPageRequestHandler(new PageProvider(new EntityDetailPage()))); + url = viewPageUrl.toString(); + url = url.substring(0, url.indexOf("?")+1); + map.put("event_view_page_url", url); + // map.put("context_name",getRootContext()); + + PackageTextTemplate ptt = new PackageTextTemplate(getClass(),"calendar.js"); + //logger.debug(ptt.asString(map)); + response.render(JavaScriptHeaderItem.forScript(ptt.asString(map), null)); + try { + ptt.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + + public CalendarPanel(String id, IModel model) { + super(id, model); + } + + + public static String getRootContext(){ + + String rootContext = ""; + + WebApplication webApplication = WebApplication.get(); + if(webApplication!=null){ + ServletContext servletContext = webApplication.getServletContext(); + if(servletContext!=null){ + rootContext = servletContext.getServletContextName(); + }else{ + //do nothing + } + }else{ + //do nothing + } + + return rootContext; + + } + +} diff --git a/crm/src/main/java/com/rex/crm/common/CreateDataPage.html b/crm/src/main/java/com/rex/crm/common/CreateDataPage.html new file mode 100755 index 0000000..9478765 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/CreateDataPage.html @@ -0,0 +1,20 @@ + + + + + +
+
+ + +
+
+
+ + diff --git a/crm/src/main/java/com/rex/crm/common/CreateDataPage.java b/crm/src/main/java/com/rex/crm/common/CreateDataPage.java new file mode 100644 index 0000000..089e11c --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/CreateDataPage.java @@ -0,0 +1,70 @@ +package com.rex.crm.common; + +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +import org.apache.log4j.Logger; +import org.apache.wicket.Component; +import org.apache.wicket.behavior.AbstractAjaxBehavior; +import org.apache.wicket.markup.head.IHeaderResponse; +import org.apache.wicket.markup.head.OnDomReadyHeaderItem; +import org.apache.wicket.util.string.StringValue; + +import com.google.common.collect.Maps; +import com.rex.crm.TemplatePage; +import com.rex.crm.util.Configuration; + +public class CreateDataPage extends TemplatePage { + private static final Logger logger = Logger.getLogger(CreateDataPage.class); + private static final long serialVersionUID = -2613412283023068638L; + + private static int NUM_OF_COLUMN = 2; + + public CreateDataPage(){ + + StringValue entityName = getRequest().getRequestParameters().getParameterValue("entityName"); + String name = entityName.toString(); + Set names = getRequest().getRequestParameters().getParameterNames(); + Map map = Maps.newHashMap(); + for(String nm:names){ + StringValue sv = getRequest().getRequestParameters().getParameterValue(nm); + map.put(nm, sv.toString()); + } + logger.debug("param-map:"+ map); + initPage(name,map,null); + } + + public CreateDataPage(String entityName,final Map params){ + initPage(entityName,params,null); + } + + public CreateDataPage(String entityName,final Map params,String createAddress){ + initPage(entityName,params,createAddress); + } + private void initPage(String entityName,Map params,String createAddress){ + //this.getRequest(). + this.setPageTitle("创建"); + //this.getPageParameters().get + Map entities = Configuration.getEntityTable(); + //if (entityName == null) entityName="contact"; + final Entity entity = entities.get(entityName); + if(null!=entity){ + add(new NewDataFormPanel("formPanel",entity,params,createAddress)); + add(new AbstractAjaxBehavior(){ + + @Override + public void onRequest() { + } + + @Override + public void renderHead(Component component, IHeaderResponse response) { + super.renderHead(component, response); + response.render(OnDomReadyHeaderItem.forScript("$(\"#navitem-"+entity.getName()+"\").addClass(\"active\");")); + } + + }); + } + } + +} diff --git a/crm/src/main/java/com/rex/crm/common/DefaultCRUDActionListener.java b/crm/src/main/java/com/rex/crm/common/DefaultCRUDActionListener.java new file mode 100644 index 0000000..3a5abef --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/DefaultCRUDActionListener.java @@ -0,0 +1,37 @@ +package com.rex.crm.common; + +import java.io.Serializable; + +public abstract class DefaultCRUDActionListener implements ICRUDActionListener, Serializable { + + @Override + public void create() { + + } + + @Override + public void delete() { + + } + + @Override + public void update() { + + } + @Override + public void resetPassword(int userId){ + + } + @Override + public void doneBtn() { + + } + @Override + public void downLoadBtn() throws Exception{ + + } + @Override + public void noExecute(String entityName,int entityId) { + + } +} diff --git a/crm/src/main/java/com/rex/crm/common/EditDataFormPanel.html b/crm/src/main/java/com/rex/crm/common/EditDataFormPanel.html new file mode 100644 index 0000000..412e5c4 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/EditDataFormPanel.html @@ -0,0 +1,206 @@ + + + +
+
+
+
+ + + + + +
+
+ +
+
+
+
+
+
+ + +
+
+
+
+
+
+
+ +
+
+
+ + +
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + 查找 + +    +
+
+
diff --git a/crm/src/main/java/com/rex/crm/common/EditDataFormPanel.java b/crm/src/main/java/com/rex/crm/common/EditDataFormPanel.java new file mode 100644 index 0000000..5d88b3d --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/EditDataFormPanel.java @@ -0,0 +1,918 @@ +package com.rex.crm.common; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Calendar; +import java.util.Collection; +import java.util.Date; +import java.util.EnumSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Properties; + +import org.apache.log4j.Logger; +import org.apache.wicket.AttributeModifier; +import org.apache.wicket.Component; +import org.apache.wicket.MarkupContainer; +import org.apache.wicket.Page; +import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior; +import org.apache.wicket.behavior.AbstractAjaxBehavior; +import org.apache.wicket.behavior.AttributeAppender; +import org.apache.wicket.markup.head.IHeaderResponse; +import org.apache.wicket.markup.head.OnDomReadyHeaderItem; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.Button; +import org.apache.wicket.markup.html.form.DropDownChoice; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.HiddenField; +import org.apache.wicket.markup.html.form.IChoiceRenderer; +import org.apache.wicket.markup.html.form.RadioChoice; +import org.apache.wicket.markup.html.form.TextArea; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.form.upload.FileUpload; +import org.apache.wicket.markup.html.form.upload.FileUploadField; +import org.apache.wicket.markup.html.link.BookmarkablePageLink; +import org.apache.wicket.markup.html.link.PopupSettings; +import org.apache.wicket.markup.html.list.AbstractItem; +import org.apache.wicket.markup.html.panel.Fragment; +import org.apache.wicket.markup.html.panel.Panel; +import org.apache.wicket.markup.repeater.RepeatingView; +import org.apache.wicket.model.AbstractReadOnlyModel; +import org.apache.wicket.model.IModel; +import org.apache.wicket.model.Model; +import org.apache.wicket.request.mapper.parameter.PageParameters; +import org.apache.wicket.util.file.File; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.io.Files; +import com.rex.crm.SelectEntryPage; +import com.rex.crm.SignIn2Session; +import com.rex.crm.beans.Choice; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.util.CRMUtility; +import com.rex.crm.util.Configuration; + +public class EditDataFormPanel extends Panel { + private static final Logger logger = Logger.getLogger(EditDataFormPanel.class); + private static final long serialVersionUID = -2613412283023068638L; + private Map> fieldGroupMap = Maps.newHashMap(); + private static int NUM_OF_COLUMN = 1; + private Map parentModels = Maps.newHashMap(); + private Map childDropDownComponent = Maps.newHashMap(); + private List fileFields = Lists.newArrayList(); + private static FileUploadField fileUploadField= new FileUploadField("fileUplode"); + private static String alertFileName = ""; + /** + * + * @param id + * @param schema + * @param data + * @param entityId + * @param relationIds + */ + public EditDataFormPanel(String id, final Entity schema, final Map data,final String entityId ,final Class previousPageClass,final PageParameters prePageParams) { + super(id); + if(schema.getName().equals("activity")||schema.getName().equals("coaching")||schema.getName().equals("willcoaching")){ + add(new Label("name",String.valueOf(data.get("title")))); + }else if(schema.getName().equals("province")||schema.getName().equals("city")){ + add(new Label("name",String.valueOf(data.get("val")))); + }else if(schema.getName().equals("alertattachment")){ + add(new Label("name",String.valueOf(data.get("fileName")))); + }else{ + add(new Label("name",String.valueOf(data.get("name")))); + } + //final Map models = Maps.newHashMap(); + final Map fieldNameToModel = Maps.newLinkedHashMap(); + final Map modifyNameToModel = Maps.newLinkedHashMap(); + final String posId = ((SignIn2Session) getSession()).getPositionId(); + final String userName = ((SignIn2Session) getSession()).getUser(); + final String userId = ((SignIn2Session) getSession()).getUserId(); + final int roleId = ((SignIn2Session) getSession()).getRoleId(); + String primaryKeyName = schema.getPrimaryKeyName(); + List fields = schema.getFields();// 得到所有fields + final List fieldNames = Lists.newArrayList(); + //add prompt + final RepeatingView div = new RepeatingView("promptDiv"); + final AbstractItem group = new AbstractItem(div.newChildId()); + final Label promptButton = new Label("promptButton","X"); + group.add(promptButton); + final Label promptLabel = new Label("prompt","提示:用户登录名已存在!"); + group.add(promptLabel); + final Label promptLabelForAccount = new Label("promptForAccount", "提示:医院BDM编码已存在!"); + group.add(promptLabelForAccount); + final Label promptForCrmuser = new Label("promptForCrmuser", "提示:岗位编码已存在!"); + group.add(promptForCrmuser); + final Label promptFordate = new Label("promptFordate", "提示:时间格式不正确!"); + group.add(promptFordate); + div.add(new AttributeAppender("style",new Model("display:none"),";")); + group.add(new AttributeAppender("style",new Model("display:none"),";")); + div.add(group); + add(div); + // List fn = schema.getFieldNames(); + for (Field f : fields) { + if (fieldGroupMap.get(f.getFieldGroup()) != null) { + fieldGroupMap.get(f.getFieldGroup()).add(f);// 以fieldgroup为条件查询,并将其添加入新的集合中 + } else { + List fs = Lists.newArrayList(); + fs.add(f); + fieldGroupMap.put(f.getFieldGroup(), fs); + } + } + List groupNames = Configuration.getSortedFieldGroupNames();// 得到分组信息 + RepeatingView fieldGroupRepeater = new RepeatingView("fieldGroupRepeater"); + add(fieldGroupRepeater); + for (String gn : groupNames) { + logger.info("gn = "+gn+ "groupNames = "+groupNames); + + List groupfields = fieldGroupMap.get(gn); + + if (groupfields == null || gn.equalsIgnoreCase("附加信息")) continue; + AbstractItem groupitem = new AbstractItem(fieldGroupRepeater.newChildId()); + fieldGroupRepeater.add(groupitem); + RepeatingView dataRowRepeater = new RepeatingView("dataRowRepeater"); + groupitem.add(dataRowRepeater); + int numOfField = 0; + List visibleFields = Lists.newArrayList(); + for (Field f : groupfields) { + if (!f.isVisible() || !f.isEditable() || (f.getFieldType()!=null && f.getFieldType().equalsIgnoreCase("auto"))) continue; + numOfField++; + visibleFields.add(f); + } + groupitem.add(new Label("groupname", gn)); + + int num_of_row = (numOfField / NUM_OF_COLUMN) + 1; + + for (int i = 0; i < num_of_row; i++) { + //logger.debug("for i = " + i + ",dataRowRepeater.newChildId() = " + dataRowRepeater.newChildId() + ",value = " + dataRowRepeater.get(dataRowRepeater.newChildId())); + AbstractItem item = new AbstractItem(dataRowRepeater.newChildId()); + dataRowRepeater.add(item); + RepeatingView columnRepeater = new RepeatingView("columnRepeater"); + item.add(columnRepeater); + + for (int j = 0; j < 2 * NUM_OF_COLUMN; j++) { + + AbstractItem columnitem = new AbstractItem(columnRepeater.newChildId(), new Model(String.valueOf(data.get(primaryKeyName)))); + + if ((i * NUM_OF_COLUMN + j / 2) >= visibleFields.size()) { + if ((i * NUM_OF_COLUMN + j / 2) >= visibleFields.size()) { + continue; + } + columnitem.add(new LayoutFragment("editdata", "layoutFragment", this, " ")); + columnRepeater.add(columnitem); + continue; + } + final Field currentField = visibleFields.get(i * NUM_OF_COLUMN + j / 2); + System.out.println("num "+i * NUM_OF_COLUMN + j / 2); + System.out.println("currentFieldcurrentField "+currentField.getName()); + if (currentField.getPicklist() != null) { + if (j % 2 == 0) { + TextFragment textField = new TextFragment("editdata", "textFragment", this, currentField.getDisplay() + ":"); + textField.add(new AttributeAppender("style", new Model("font-weight:bold;"), ";")); + if(currentField.getPriority()==5){ + String message = CRMUtility.getToolTipById(String.valueOf(currentField.getTooltip())); + textField.add(new AttributeModifier("data-content",message)); + textField.add(new AttributeAppender("class",new Model("icon-question-sign")," ")); + textField.add(new AttributeModifier("title",currentField.getDisplay())); + textField.add(new AttributeAppender("class",new Model("tooltip-test")," ")); + } + columnitem.add(textField); + if (currentField.isRequired()) { + columnitem.add(new AttributeAppender("class", new Model("tag"), " ")).add(new AttributeAppender("style", new Model("color:red"), ";")); + } else { + columnitem.add(new AttributeAppender("class", new Model("tag"), " ")); + } + fieldNames.add(currentField.getName()); + } else { + + // it is a cascading picklist + if (currentField.getParentNode() != null || currentField.getChildNode() != null) { + String value = "-1"; + if(data.get(currentField.getName()) != null){ + value = data.get(currentField.getName()).toString(); + } + + IModel selected_model = new Model(new Choice(Long.parseLong(value), "")); + IModel> choices_models = null; + + if (currentField.getChildNode() != null && currentField.getParentNode() == null) { + choices_models = Model.ofList(DAOImpl.queryPickList(currentField.getPicklist())); + } + + if (currentField.getParentNode() != null) { + choices_models = new AbstractReadOnlyModel>() { + List choices; + + @Override + public List getObject() { + IModel pm = parentModels.get(currentField.getParentNode()); + if (pm != null && pm.getObject() !=null && pm.getObject() instanceof Choice) { + choices = DAOImpl.queryPickListByFilter(currentField.getPicklist(), "parentId", String.valueOf(((Choice) pm.getObject()).getId())); + + } else { + choices = Lists.newArrayList(); + } + return choices; + } + + @Override + public void detach() { + choices = null; + // System.out.println("detached"); + } + + }; + } + + DropDownChoiceFragment selector = new DropDownChoiceFragment("editdata", "dropDownFragment", this, choices_models, selected_model, schema, currentField); + columnitem.add(selector); + selector.setOutputMarkupId(true); + + if (currentField.getParentNode() != null) { + + childDropDownComponent.put(currentField.getName(), selector); + } + + modifyNameToModel.put(currentField.getDisplay(), selected_model); + fieldNameToModel.put(currentField.getName(), selected_model); + columnitem.add(selector); + + } else { + + List pickList = DAOImpl.queryPickList(currentField.getPicklist()); + Map list = Maps.newHashMap(); + List ids = Lists.newArrayList(); + for (Choice p : pickList) { + list.put(p.getId(), p.getVal()); + ids.add(p.getId()); + } + + String value = "-1"; + if(data.get(currentField.getName())!=null){ + value = data.get(currentField.getName()).toString(); + } + IModel choiceModel = new Model(Long.parseLong(value)); + + modifyNameToModel.put(currentField.getDisplay(), choiceModel); + fieldNameToModel.put(currentField.getName(), choiceModel); + if(roleId!=1){ + String val = ""; +// if(currentField.getName().equals("department")&&schema.getName().equals("contact")){ +// val = DAOImpl.getTargetById("val",value,"contact_department_pl"); +// TextFragment textField = new TextFragment("editdata", "textFragment", this,val); +// textField.add(new AttributeAppender("class",new Model("folatLeft")," ")); +// columnitem.add(textField); +// +// } + if(currentField.getName().equals("grade")&&schema.getName().equals("contact")){ + val = DAOImpl.getTargetById("val",value,"contact_grade_pl"); + TextFragment textField = new TextFragment("editdata", "textFragment", this,val); + textField.add(new AttributeAppender("class",new Model("folatLeft")," ")); + columnitem.add(textField); + }else{ + columnitem.add(new DropDownChoiceFragment("editdata", "dropDownFragment", this, ids, list, choiceModel,currentField)); + } + + }else{ + columnitem.add(new DropDownChoiceFragment("editdata", "dropDownFragment", this, ids, list, choiceModel,currentField)); + } + } + } + } else if (currentField.getRelationTable() != null) { + if (j % 2 == 0) { + columnitem.add(new TextFragment("editdata", "textFragment", this, currentField.getDisplay() + ":").add(new AttributeAppender("style", new Model("font-weight:bold;"), ";"))); + if (currentField.isRequired()) { + columnitem.add(new AttributeAppender("class", new Model("tag"), " ")).add(new AttributeAppender("style", new Model("color:red"), ";")); + } else { + columnitem.add(new AttributeAppender("class", new Model("tag"), " ")); + } + fieldNames.add(currentField.getName()); + } else { + long foreignKey = 1L; + + if(data.get(currentField.getName())!=null){ + foreignKey = ((Number)data.get(currentField.getName())).longValue(); + }else{ + foreignKey = -1L; // + } + IModel choiceModel = new Model(foreignKey); + String fn = ""; + if (currentField.getAlias() != null) { + fn = currentField.getAlias(); + } else { + fn = currentField.getName(); + } + final Entity ent = Configuration.getEntityByName(currentField.getRelationTable()); + Map et = DAOImpl.queryEntityById(ent.getSql_ent(), String.valueOf(foreignKey)); + String value = ""; + if (et != null && et.get("name") != null) { + value = (String) et.get("name"); + } + modifyNameToModel.put(currentField.getDisplay(), choiceModel); + fieldNameToModel.put(fn, choiceModel); + columnitem.add(new RelationTableSearchFragment("editdata", "relationTableSearchFragment", this, currentField.getRelationTable(), schema.getName(), value, choiceModel, entityId)); + } + } else if (currentField.getDataType().equals("radio")){ + if (j % 2 == 0) { + columnitem.add(new TextFragment("editdata", "textFragment", this, currentField.getDisplay() + ":").add(new AttributeAppender("style", new Model("font-weight:bold"), ";"))); + if (currentField.isRequired()) { + columnitem.add(new AttributeAppender("class", new Model("tag"), " ")).add(new AttributeAppender("style", new Model("color:red"), ";")); + }else{ + columnitem.add(new AttributeAppender("class", new Model("tag"), " ")); + } + } else { + String value = (String) data.get(currentField.getName()); + IModel textModel = new Model(value); + RadioChoiceFragment RadioChoice = new RadioChoiceFragment("editdata", "radioChoiceFragment", this,textModel,value,currentField); + modifyNameToModel.put(currentField.getDisplay(), textModel); + fieldNameToModel.put(currentField.getName(),textModel); + columnitem.add(RadioChoice); + } + } else { + if (j % 2 == 0) { + columnitem + .add(new TextFragment("editdata", "textFragment", this, currentField.getDisplay() + ":").add(new AttributeAppender("style", new Model("font-weight:bold;"), ";"))); + if (currentField.isRequired()) { + columnitem.add(new AttributeAppender("class", new Model("tag"), " ")).add(new AttributeAppender("style", new Model("color:red"), ";")); + } else { + columnitem.add(new AttributeAppender("class", new Model("tag"), " ")); + } + fieldNames.add(currentField.getName()); + } else { + + Object rawvalue = data.get(currentField.getName()); + rawvalue = (rawvalue == null) ? "" : rawvalue; + String value = CRMUtility.formatValue(currentField.getFormatter(), String.valueOf(rawvalue)); + value = (value == null) ? "" : value; + if (currentField.getDataType().equalsIgnoreCase("textarea")) { + IModel textModel = new Model(value); + modifyNameToModel.put(currentField.getDisplay(), textModel); + fieldNameToModel.put(currentField.getName(), textModel); + columnitem.add(new Textarea("editdata", "textAreaFragment", this, textModel,currentField)); + }else if(currentField.getDataType().equals("bjgtextarea")){ + IModel textModel = new Model(value); + modifyNameToModel.put(currentField.getDisplay(), textModel); + fieldNameToModel.put(currentField.getName(), textModel); + columnitem.add(new BigtextareaFrag("editdata", "bjgtextAreaFragment", this, textModel,currentField)); + }else if(currentField.getDataType().equalsIgnoreCase("file")){ + alertFileName = value; + IModel textModel = new Model(value); + fieldNameToModel.put(currentField.getName(), textModel); + columnitem.add(new FileUploadFragment("editdata", "fileUplodeFragment", this, textModel)); + } else if(currentField.getDataType().equals("datetime-local")){ + + SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm"); + value = dateformat.format(rawvalue); + IModel textModel = new Model(value); + //textModel = new Model(date_value); + modifyNameToModel.put(currentField.getDisplay(), textModel); + fieldNameToModel.put(currentField.getName(), textModel); + TextInputFragment textInput = new TextInputFragment("editdata", "textInputFragment", this, textModel,value, currentField); + columnitem.add(textInput); + + }else { + IModel textModel = new Model(""); + if(schema.getName().equals("contact")&¤tField.getName().equals("name")&&roleId!=1){ + IModel textValue = new Model(value); + fieldNameToModel.put(currentField.getName(), textValue); + TextFragment text = new TextFragment("editdata", "textFragment", this,value); + text.add(new AttributeAppender("class",new Model("folatLeft")," ")); + columnitem.add(text); + }else{ + fieldNameToModel.put(currentField.getName(), textModel); + TextInputFragment textInput = new TextInputFragment("editdata", "textInputFragment", this, textModel, value, currentField); + columnitem.add(textInput); + } + } + } + } + columnRepeater.add(columnitem); + } + }// end of set the detailed info + }// end of groupNames loop + Form form = new Form("form"); + form.add(new Button("save"){ + @Override + public void onSubmit() { + try { + if(!saveEntity(fieldNameToModel,modifyNameToModel,data,schema,entityId,userName)){ + div.add(new AttributeAppender("style",new Model("display:block"),";")); + group.add(new AttributeAppender("style",new Model("display:block"),";")); + if(schema.getName().equals("account")){ + promptLabel.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptLabelForAccount.add(new AttributeAppender("style", new Model("display:block"), ";")); + promptForCrmuser.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptFordate.add(new AttributeAppender("style", new Model("display:none"), ";")); + }else if (schema.getName().equals("userinfo")){ + promptLabel.add(new AttributeAppender("style", new Model("display:block"), ";")); + promptLabelForAccount.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptForCrmuser.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptFordate.add(new AttributeAppender("style", new Model("display:none"), ";")); + }else if(schema.getName().equals("crmuser")){ + promptLabel.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptLabelForAccount.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptForCrmuser.add(new AttributeAppender("style", new Model("display:block"), ";")); + promptFordate.add(new AttributeAppender("style", new Model("display:none"), ";")); + }else if(schema.getName().equals("activity")||schema.getName().equals("coaching")||schema.getName().equalsIgnoreCase("willcoaching")){ + promptLabel.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptLabelForAccount.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptForCrmuser.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptFordate.add(new AttributeAppender("style", new Model("display:block"), ";")); + } + promptButton.add(new AttributeAppender("style",new Model("display:block"),";")); + }else{ + if(!prePageParams.isEmpty()){ + System.out.println("prePageParams:"+prePageParams); + setResponsePage(previousPageClass,prePageParams); + }else{ + System.out.println("prePageParamsisEmpty"); + setResponsePage(new EntityDetailPage(schema.getName(),entityId)); + } + } + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }); + Button button = new Button("saveAndNew"){ + @Override + public void onSubmit() { + try { + if(!saveEntity(fieldNameToModel,modifyNameToModel,data,schema,entityId,userName)){ + div.add(new AttributeAppender("style",new Model("display:block"),";")); + group.add(new AttributeAppender("style",new Model("display:block"),";")); + if(schema.getName().equals("account")){ + promptLabel.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptLabelForAccount.add(new AttributeAppender("style", new Model("display:block"), ";")); + promptForCrmuser.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptFordate.add(new AttributeAppender("style", new Model("display:none"), ";")); + }else if (schema.getName().equals("userinfo")){ + promptLabel.add(new AttributeAppender("style", new Model("display:block"), ";")); + promptLabelForAccount.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptForCrmuser.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptFordate.add(new AttributeAppender("style", new Model("display:none"), ";")); + }else if(schema.getName().equals("crmuser")){ + promptLabel.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptLabelForAccount.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptForCrmuser.add(new AttributeAppender("style", new Model("display:block"), ";")); + promptFordate.add(new AttributeAppender("style", new Model("display:none"), ";")); + }else if(schema.getName().equals("activity")||schema.getName().equals("coaching")||schema.getName().equalsIgnoreCase("willcoaching")){ + promptLabel.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptLabelForAccount.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptForCrmuser.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptFordate.add(new AttributeAppender("style", new Model("display:block"), ";")); + } + promptButton.add(new AttributeAppender("style",new Model("display:block"),";")); + }else{ + setResponsePage(new CreateDataPage(schema.getName(),null)); + } + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + }; + form.add(fieldGroupRepeater); + form.add(button); + add(form); + // set navigation bar active + add(new AbstractAjaxBehavior() { + @Override + public void onRequest() { + } + @Override + public void renderHead(Component component, IHeaderResponse response) { + super.renderHead(component, response); + response.render(OnDomReadyHeaderItem.forScript("$(\"#navitem-" + + schema.getName() + "\").addClass(\"active\");")); + } + }); + } + public EditDataFormPanel(String id, IModel model) { + super(id, model); + } + + @SuppressWarnings("null") + public boolean saveEntity(Map fieldNameToModel,Map modifyNameToModel, final Map data,Entity schema,String entityId,String userName ) throws Exception{ + logger.debug("the form was submitted!"); + logger.debug(fieldNameToModel); + String fileName = ""; + if(schema.getName().equals("alertattachment")){ + FileUpload fileupload = fileUploadField.getFileUpload(); + String outputfolder = CRMUtility.readFileAttribure("fileUpdatePath"); + java.io.File tmpDir = null; + tmpDir = Files.createTempDir(); + if (fileupload != null) + { + String tmpFileName = outputfolder+ fileupload.getClientFileName(); + fileName = fileupload.getClientFileName(); + try { + fileupload.writeTo(new File(tmpFileName)); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + }else{ + fileName = alertFileName; + } + } + + List values = Lists.newArrayList(); + List names = Lists.newArrayList(); + //List modifyNames = Lists.newArrayList(); + SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm"); + int total_score = 0; + Long daypart = 0l; + String productlineId="-1"; + String loginName = ""; + StringBuffer endDate = new StringBuffer(); + if(schema.getName().equals("activity")){ + daypart = (Long) fieldNameToModel.get("activity_daypart").getObject(); + } + if(schema.getName().equals("userinfo")){ + loginName = fieldNameToModel.get("loginName").getObject().toString(); + } + for (String k : fieldNameToModel.keySet()) { + + names.add(k); + Field field = schema.getFieldByName(k); + IModel currentModel = fieldNameToModel.get(k); + if(field.getPriority()==5){ + total_score+=Integer.parseInt(fieldNameToModel.get(k).getObject().toString()); + } + //判断filed是否能为空,若为空则给出提示,不执行保存事件,若不为空在执行保存事件 + Object obj = currentModel.getObject() ; + String value = null; + String modifyValue = null; + if(obj!=null){ + if (obj instanceof String) { + if (field.getDataType().equalsIgnoreCase("datetime-local")) { + // if the filed has formatter, we guess the + // field saved in data base is in long + Date date = new Date(); + String dateTime = String.valueOf(fieldNameToModel.get(k).getObject()); + if(schema.getName().equals("activity")){ + if(k.equals("starttime")){ + if(daypart==1){ + dateTime = dateTime.split("T")[0].concat("T08:00"); + endDate.append(dateTime.split("T")[0].concat("T11:30")); + }else{ + dateTime = dateTime.split("T")[0].concat("T13:00"); + endDate.append(dateTime.split("T")[0].concat("T18:00")); + } + } + } + value = String.valueOf("'"+dateTime+"'"); + + } else { + value = "'" + (String)obj + "'"; + } + + } else if (obj instanceof Choice) { + value = String.valueOf(((Choice) obj).getId()); + } else { + if(field.getDataType().equals("file")){ + value = "'"+fileName+"'"; + }else{ + value = String.valueOf(obj) ; + } + } + }else{ + if(field.getPicklist()!=null||field.getDataType().equalsIgnoreCase("number")){ + value = "0"; + }else{ + value = "'"+fileName+"'"; + } + } + values.add(value); + if(field.getName().toString().equals("productlineId")&&schema.getName().equals("product")){ + productlineId=value; + } + if(field.getName().toString().equals("productId")&&schema.getName().equals("productcategory")){ + productlineId=DAOImpl.getTargetById("productlineId",value,"product"); + } + } + + + List autoFields = schema.getAutoFields(); + for(Field f:autoFields){ + + if(f.getName().equalsIgnoreCase("modify_datetime")){ + names.add(f.getName()); + + values.add("'"+dateformat.format(new Date())+"'"); + } + + if(f.getName().equalsIgnoreCase("modifier")){ + names.add(f.getName()); + values.add("'"+userName+"'"); + } + } + + String table_name = schema.getName(); + if(table_name.equalsIgnoreCase("coaching")||table_name.equalsIgnoreCase("willcoaching")){ + table_name = "activity"; + names.add("total_score"); + values.add("'"+total_score+"'"); + }else if(schema.getName().equals("activity")){ + values.add("'"+endDate+"'"); + names.add("endtime"); + } + if(!table_name.equalsIgnoreCase("userinfo")){ + if(table_name.equalsIgnoreCase("product")){ + DAOImpl.updateProductCategoryWhenEditProduct(entityId, productlineId); + } + if(table_name.equalsIgnoreCase("productcategory")){ + + DAOImpl.updateProductlineWhenEditcategory(entityId, productlineId); + } + if(DAOImpl.updateRecord(entityId,table_name,names,values)){ + recordValueChanges(data, schema, entityId, userName, values, names,table_name); + return true; + } else{ + return false; + } + }else{ + List loginNames =DAOImpl.getLoginNames(entityId); + if(loginNames.contains(loginName)){ + return false; + }else{ + DAOImpl.updateRecord(entityId,table_name,names,values); + recordValueChanges(data, schema, entityId, userName, values,names, table_name); + return true; + } + } + } +public static void recordValueChanges(final Map data, Entity schema, + String entityId, String userName, List values, + List names, String table_name) throws Exception { + String valuebefore; + for(int i=0;i("search_btn", SelectEntryPage.class, params).setPopupSettings(popupSettings)); + HiddenField hidden = new HiddenField("selected_id_hidden", model); + hidden.add(new AttributeAppender("id", entityName + "_id")); + add(hidden); + TextField text = new TextField("selected_value_input", new Model(value)); + text.add(new AttributeAppender("id", entityName + "_name")); + add(text); + } + } + + private class DropDownChoiceFragment extends Fragment { + public DropDownChoiceFragment(String id, String markupId, MarkupContainer markupProvider, final List ids, final Map list, IModel model,Field currentField) { + super(id, markupId, markupProvider); + DropDownChoice dropDown = (new DropDownChoice("dropDownInput", model, ids, new IChoiceRenderer() { + @Override + public Object getDisplayValue(Long id) { + // TODO Auto-generated method stub + return list.get(id); + } + + @Override + public String getIdValue(Long id, int index) { + return String.valueOf(id); + } + })); + if(currentField.getPriority()==5){ + dropDown.setNullValid(false); + }else{ + dropDown.setNullValid(true); + } + if (currentField.isRequired()) { + //text.add(new AttributeModifier("required", new Model("required"))); + dropDown.add(new AttributeAppender("class",new Model("required-pickList")," ")); + } + if(currentField.getName().equals("activity_daypart")){ + dropDown.add(new AttributeModifier("id","daypart")); + dropDown.setNullValid(true); + } + add(dropDown); + + } + + public DropDownChoiceFragment(String id, String markupId,MarkupContainer markupProvider, + IModel choices,IModel default_model,final Entity entity, final Field currentField){ + super(id, markupId, markupProvider); + DropDownChoice dropDown = createDropDownListFromPickList("dropDownInput",choices,default_model); + add(dropDown); + + if(currentField.getChildNode()!=null){ + parentModels.put(currentField.getName(), default_model); + //childDropDownComponent.put(field.get("child-pl"), null); + + dropDown.add(new AjaxFormComponentUpdatingBehavior("onchange"){ + + @Override + protected void onUpdate(AjaxRequestTarget target) { + target.add(childDropDownComponent.get( currentField.getChildNode())); + if( entity.getFieldByName(currentField.getChildNode()).getChildNode() != null ){ + + parentModels.get(entity.getFieldByName(currentField.getChildNode()).getName()).setObject(new Choice(-1L,"")); + target.add(childDropDownComponent.get(entity.getFieldByName(currentField.getChildNode()).getChildNode())); + // target. + } + + } + + }); + } + if(entity.getName().equals("activity")||entity.getName().equals("coaching")||entity.getName().equals("willcoaching")){ + dropDown.add(new AttributeAppender("class",new Model("required-pickList")," ")); + } + if(currentField.getPriority()==5){ + dropDown.setNullValid(false); + }else{ + dropDown.setNullValid(true); + } + } + } + private DropDownChoice createDropDownListFromPickList(String markupId,IModel choices,IModel default_model) { + + DropDownChoice choice = new DropDownChoice(markupId, default_model, choices, + new IChoiceRenderer() { + @Override + public Object getDisplayValue(Choice choice) { + // TODO Auto-generated method stub + return choice.getVal(); + } + @Override + public String getIdValue(Choice choice, int index) { + // TODO Auto-generated method stub + return String.valueOf(choice.getId()); + } + + + }); + + choice.setNullValid(true); + return choice; + } + private class RadioChoiceFragment extends Fragment{ + public RadioChoiceFragment(String id, String markupId,MarkupContainer markupProvider, IModel model,String value,final Field currentField){ + super(id, markupId, markupProvider); + List lsVisible = Arrays.asList(new String[]{"否", "是"}); + RadioChoice raVisible = new RadioChoice("radioChoiceinput", model, lsVisible).setSuffix(" "); + raVisible.setModelValue(new String[]{"0", "1"}); + model.setObject(value); + add(raVisible); + } + } + private class Textarea extends Fragment { + + public Textarea(String id, String markupId, MarkupContainer markupProvider, IModel value,Field currentField) { + super(id, markupId, markupProvider); + // TODO Auto-generated constructor stub + TextArea textArea = new TextArea("address", value); + if (currentField.isRequired()) { + textArea.add(new AttributeAppender("class",new Model("required-field")," ")); + } + add(textArea); + } + + } + + private class BigtextareaFrag extends Fragment { + + public BigtextareaFrag(String id, String markupId, MarkupContainer markupProvider, IModel model, Field currentField) { + super(id, markupId, markupProvider); + // TODO Auto-generated constructor stub + TextArea textArea = new TextArea("description", model); + add(textArea); + if (currentField.isRequired()) { + textArea.add(new AttributeAppender("class",new Model("required-field")," ")); + } + } + } + + private class TextInputFragment extends Fragment { + public TextInputFragment(String id, String markupId, MarkupContainer markupProvider, IModel model, String value, Field currentField) { + super(id, markupId, markupProvider); + TextField text = new TextField("input", model); + text.add(new AttributeModifier("value", new Model(value))); + add(text); + text.add(new AttributeAppender("type", new Model(currentField.getDataType()), ";")); + if (currentField.getDataType().equals("tel") || currentField.getDataType().equalsIgnoreCase("fax")) { + text.add(new AttributeModifier("pattern", new Model( + "^((\\d{11})|^((\\d{7,8})|(\\d{4}|\\d{3})-(\\d{7,8})|(\\d{4}|\\d{3})-(\\d{7,8})-(\\d{4}|\\d{3}|\\d{2}|\\d{1})|(\\d{7,8})-(\\d{4}|\\d{3}|\\d{2}|\\d{1}))$)"))); + } + if (currentField.isRequired()) { + //text.add(new AttributeModifier("required", new Model("required"))); + text.add(new AttributeAppender("class",new Model("required-field")," ")); + } + if(currentField.getDataType().equals("datetime-local")){ + text.add(new AttributeModifier("id",currentField.getName())); + } + + } + } + +} diff --git a/crm/src/main/java/com/rex/crm/common/EditDataPage.html b/crm/src/main/java/com/rex/crm/common/EditDataPage.html new file mode 100644 index 0000000..09e319f --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/EditDataPage.html @@ -0,0 +1,28 @@ + + + + + +
+
+ + +
+ +
+ + +
+
+
+ +
+
+
+ + diff --git a/crm/src/main/java/com/rex/crm/common/EditDataPage.java b/crm/src/main/java/com/rex/crm/common/EditDataPage.java new file mode 100644 index 0000000..c04aa3d --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/EditDataPage.java @@ -0,0 +1,54 @@ +package com.rex.crm.common; + +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.apache.wicket.Component; +import org.apache.wicket.Page; +import org.apache.wicket.behavior.AbstractAjaxBehavior; +import org.apache.wicket.markup.head.IHeaderResponse; +import org.apache.wicket.markup.head.OnDomReadyHeaderItem; +import org.apache.wicket.request.mapper.parameter.PageParameters; + +import com.rex.crm.TemplatePage; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.util.Configuration; + +public class EditDataPage extends TemplatePage { + private static final Logger logger = Logger.getLogger(EntityDetailPage.class); + private static final long serialVersionUID = -2613412283023068638L; + + private static int NUM_OF_COLUMN = 3; + + public EditDataPage(final String entityName, String id,final Class previousPageClass, final PageParameters prePageParams){ + this.setPageTitle("编辑"); + + Map entities = Configuration.getEntityTable(); + Entity entity = entities.get(entityName); + List currentFields = entity.getFields(); + long lid = Long.parseLong(id); + // Map map = DAOImpl.getEntityData(entity.getName(), entity.getFieldNames(), lid); + Map map = DAOImpl.queryEntityById(entity.getSql_ent(), String.valueOf(lid)); + + add(new EditDataFormPanel("detailed",entity,map,id,previousPageClass,prePageParams)); + + //set relations data + add(new AbstractAjaxBehavior(){ + + @Override + public void onRequest() { + } + + @Override + public void renderHead(Component component, IHeaderResponse response) { + super.renderHead(component, response); + response.render(OnDomReadyHeaderItem.forScript("$(\"#navitem-"+entityName+"\").addClass(\"active\");")); + } + + }); + + + } + +} diff --git a/crm/src/main/java/com/rex/crm/common/Entity.java b/crm/src/main/java/com/rex/crm/common/Entity.java new file mode 100644 index 0000000..0b95bea --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/Entity.java @@ -0,0 +1,362 @@ +package com.rex.crm.common; + +import java.io.Serializable; +import java.util.List; + +import com.google.common.collect.Lists; +import com.google.gson.GsonBuilder; +import com.google.gson.annotations.Expose; + +public class Entity implements Serializable +{ + @Expose + private String name; + @Expose + private String display; + @Expose + private List fields; + @Expose + private String sql; + @Expose + private String filterField; + @Expose + private String sql_ent; + @Expose + private String sqlAdmin; //for the admin to query all data + @Expose + private String sqlManager; + @Expose + private String sqlCoaching; + @Expose + private String sqlAdminCoaching; //for the admin to query all data + @Expose + private String sqlManagerCoaching; + @Expose + private String sqlManagerCalendar; + @Expose + private String sqlCalendar; + @Expose + private String sqlAdminCalendar; + @Expose + private String externalField; + @Expose + private boolean globalsearch; + + public boolean isGlobalsearch() { + return globalsearch; +} + +public void setGlobalsearch(boolean globalsearch) { + this.globalsearch = globalsearch; +} + +public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public String getDisplay() + { + return display; + } + + public void setDisplay(String display) + { + this.display = display; + } + + public List getFields() + { + return fields; + } + + public void setFields(List fields) + { + this.fields = fields; + } + + @Override + public String toString() + { + GsonBuilder gb = new GsonBuilder(); + StringBuffer sb = new StringBuffer(); + sb.append(gb.excludeFieldsWithoutExposeAnnotation().create().toJson(this)); + return sb.toString(); + } + + public List getFieldNames() + { + List fd = Lists.newArrayList(); + if (fields != null) + { + for (Field f : fields) + { + fd.add(f.getName()); + } + } + return fd; + } + + public String getPrimaryKeyName() + { + if (fields != null) + { + for (Field f : fields) + { + if (f.isPrimaryKey()) + { + return f.getName(); + } + } + } + return null; + } + + public List getSearchableFields() + { + List res = Lists.newArrayList(); + if (fields != null) + { + for (Field f : fields) + { + if (f.isSearchable()) + { + res.add(f); + } + } + } + return res; + } + + public List getParamFields() + { + List res = Lists.newArrayList(); + if (fields != null) + { + for (Field f : fields) + { + if (f.isParam()) + { + res.add(f); + } + } + } + return res; + } + + public List getAutoFields() + { + List res = Lists.newArrayList(); + if (fields != null) + { + for (Field f : fields) + { + if (f.getFieldType() != null && f.getFieldType().equalsIgnoreCase("auto")) + { + res.add(f); + } + } + } + return res; + } + + public List getImportFields() + { + List res = Lists.newArrayList(); + if (fields != null) + { + for (Field f : fields) + { + if (f.getImport_field_name() != null) + { + res.add(f); + } + } + } + return res; + } + + public List getForeignKeyFields() + { + List res = Lists.newArrayList(); + if (fields != null) + { + for (Field f : fields) + { + if (f.getRelationTable()!= null) + { + res.add(f); + } + } + } + return res; + } + + public List getImportForeignKeyFields() + { + List res = Lists.newArrayList(); + if (fields != null) + { + for (Field f : fields) + { + if (f.getRelationTable()!= null && f.getImport_field_name()!=null) + { + res.add(f); + } + } + } + return res; + } + + public List getDisplayNames() + { + List fd = Lists.newArrayList(); + if (fields != null) + { + for (Field f : fields) + { + fd.add(f.getDisplay()); + } + } + return fd; + } + + public String getSql() + { + return sql; + } + + public void setSql(String sql) + { + this.sql = sql; + } + + public String getFilterField() + { + return filterField; + } + + public void setFilterField(String filterField) + { + this.filterField = filterField; + } + + public Field getFieldByName(String name) + { + if (fields != null) + { + for (Field f : fields) + { + if (f.getName().equalsIgnoreCase(name)) + { + return f; + } + } + } + + return null; + } + + public String getSql_ent() + { + return sql_ent; + } + + public void setSql_ent(String sql_ent) + { + this.sql_ent = sql_ent; + } + + public String getSqlAdmin() + { + return sqlAdmin; + } + + public void setSqlAdmin(String sqlAdmin) + { + this.sqlAdmin = sqlAdmin; + } + + public String getSqlManager() + { + return sqlManager; + } + + public void setSqlManager(String sqlManager) + { + this.sqlManager = sqlManager; + } + + public void setSqlManagerCalendar(String sqlManagerCalendar) + { + this.sqlManagerCalendar = sqlManagerCalendar; + } + + public String getSqlManagerCalendar() + { + return sqlManagerCalendar; + } + + public void setSqlAdminCalendar(String sqlAdminCalendar) + { + this.sqlAdminCalendar = sqlAdminCalendar; + } + + public String getSqlAdminCalendar() + { + return sqlAdminCalendar; + } + + public void setSqlCalendar(String sqlCalendar) + { + this.sqlCalendar = sqlCalendar; + } + + public String getSqlCalendar() + { + return sqlCalendar; + } + + public String getSqlCoaching() + { + return sqlCoaching; + } + + public void setSqlCoaching(String sqlCoaching) + { + this.sqlCoaching = sqlCoaching; + } + + public String getSqlAdminCoaching() + { + return sqlAdminCoaching; + } + + public void setSqlAdminCoaching(String sqlAdminCoaching) + { + this.sqlAdminCoaching = sqlAdminCoaching; + } + + public String getSqlManagerCoaching() + { + return sqlManagerCoaching; + } + + public void setSqlManagerCoaching(String sqlManagerCoaching) + { + this.sqlManagerCoaching = sqlManagerCoaching; + } + +public String getExternalField() { + return externalField; +} + +public void setExternalField(String externalField) { + this.externalField = externalField; +} +} diff --git a/crm/src/main/java/com/rex/crm/common/EntityDetailContainerPanel.html b/crm/src/main/java/com/rex/crm/common/EntityDetailContainerPanel.html new file mode 100755 index 0000000..13a1393 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/EntityDetailContainerPanel.html @@ -0,0 +1,78 @@ + + +
+
+
+ + +
+ +
+
+ 鎴戠殑 +
+
[operation bar]
+
+
+
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+ +
+ + +
+
+
diff --git a/crm/src/main/java/com/rex/crm/common/EntityDetailContainerPanel.java b/crm/src/main/java/com/rex/crm/common/EntityDetailContainerPanel.java new file mode 100644 index 0000000..c03bfb4 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/EntityDetailContainerPanel.java @@ -0,0 +1,305 @@ +package com.rex.crm.common; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.EnumSet; +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.apache.wicket.Component; +import org.apache.wicket.Page; +import org.apache.wicket.behavior.AbstractAjaxBehavior; +import org.apache.wicket.behavior.AttributeAppender; +import org.apache.wicket.markup.head.IHeaderResponse; +import org.apache.wicket.markup.head.OnDomReadyHeaderItem; +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.list.AbstractItem; +import org.apache.wicket.markup.html.panel.EmptyPanel; +import org.apache.wicket.markup.html.panel.Panel; +import org.apache.wicket.markup.repeater.RepeatingView; +import org.apache.wicket.model.Model; +import org.apache.wicket.request.mapper.parameter.PageParameters; + +import com.google.common.collect.Maps; +import com.rex.crm.AccountPage; +import com.rex.crm.ActivityPage; +import com.rex.crm.CoachingPage; +import com.rex.crm.ContactPage; +import com.rex.crm.SignIn2Session; +import com.rex.crm.TemplatePage; +import com.rex.crm.admin.AdminTreePage; +import com.rex.crm.admin.PositionPage; +import com.rex.crm.admin.ProductPage; +import com.rex.crm.admin.ProductTreePage; +import com.rex.crm.admin.UserPage; +import com.rex.crm.beans.AccountCRMUserRelation; +import com.rex.crm.beans.CRMUser; +import com.rex.crm.beans.UserInfo; +import com.rex.crm.beans.UserPosition; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.util.CRMUtility; +import com.rex.crm.util.Configuration; +import com.rex.crm.util.SendEmail; + +public class EntityDetailContainerPanel extends Panel { + private static final Logger logger = Logger.getLogger(EntityDetailContainerPanel.class); + private static final long serialVersionUID = -2613412283023068638L; + private final String user = ((SignIn2Session)getSession()).getUser(); + private static int NUM_OF_COLUMN = 3; + public EntityDetailContainerPanel(String id){ + super(id); + + } + public EntityDetailContainerPanel(String panelId, final String entityName, final String id,final Class previousPageClass, final PageParameters prePageParams){ + this(panelId); + initPage(entityName,id,previousPageClass,prePageParams); + } + public void initPage(final String entityName, final String id ,final Class previousPageClass, final PageParameters prePageParams){ + + final int roleId = ((SignIn2Session)getSession()).getRoleId(); + Map entities = Configuration.getEntityTable(); + Entity entity = entities.get(entityName); + final RepeatingView div = new RepeatingView("promptDiv"); + final AbstractItem groupitem = new AbstractItem(div.newChildId()); + final Label promptButton = new Label("promptButton","X"); + groupitem.add(promptButton); + final Label promptLabel = new Label("prompt","提示:操作已成功!"); + groupitem.add(promptLabel); + div.add(new AttributeAppender("style",new Model("display:none"),";")); + groupitem.add(new AttributeAppender("style",new Model("display:none"),";")); + div.add(groupitem); + add(div); + /*final Label promptButton = new Label("promptButton","X"); + final Label promptLabel = new Label("prompt","提示:操作已成功!"); + add(promptButton); + add(promptLabel);*/ + + long lid = Long.parseLong(id); + System.out.println("*entityName:"+entityName); + System.out.println("*id:"+id); + // Map map = DAOImpl.getEntityData(entity.getName(), entity.getFieldNames(), lid); + Map map = DAOImpl.queryEntityById(entity.getSql_ent(), String.valueOf(lid)); + if(entity.getName().equals("activity")||entity.getName().equals("coaching")||entity.getName().equals("willcoaching")){ + add(new Label("name",String.valueOf(map.get("title")))); + }else{ + add(new Label("name",String.valueOf(map.get("name")))); + } + + add(new EntityDetailPanel("detailed",entity,map,id,3,entityName)); + + + + if(entityName.equalsIgnoreCase("productLine")||entityName.equalsIgnoreCase("product")||entityName.equalsIgnoreCase("productSpecification")){ + List relations = Configuration.getRelationsByName(entityName); + + RepeatingView relationRepeater = new RepeatingView("relationRepeater"); + add(relationRepeater); + + List paramFields = entity.getParamFields(); + Map params = Maps.newHashMap(); + for(Field f:paramFields){ + params.put(entityName+"."+f.getName(), map.get(f.getName())); + } + + + for(Relation r:relations){ + AbstractItem item = new AbstractItem(relationRepeater.newChildId()); + relationRepeater.add(item); + logger.debug(r.getSql()); + logger.debug("parms:"+id); + List list = DAOImpl.queryEntityRelationList(r.getSql(), id); + item.add(new RelationDataPanel("relationPanel",r,entityName,list,String.valueOf(lid),params)); + } + }else{ + WebMarkupContainer con =new WebMarkupContainer("relationRepeater"); + add(con); + con.add(new EmptyPanel("relationPanel")); + con.setVisible(false); + + } + + + + if(entityName.equalsIgnoreCase("account")){ + add(new TeamManPanel("teamPanel",entityName,String.valueOf(lid),0)); + add(new EmptyPanel("teamPanel2")); + add(new EmptyPanel("teamPanel4")); + add(new EmptyPanel("teamPanel5")); + }else if(entityName.equalsIgnoreCase("crmuser")){ + add(new EmptyPanel("teamPanel")); + add(new TeamManPanel("teamPanel2",entityName,String.valueOf(lid),2)); + add(new TeamManPanel("teamPanel4",entityName,String.valueOf(lid),3)); + add(new TeamManPanel("teamPanel5",entityName,String.valueOf(lid),4)); + } + else{ + add(new EmptyPanel("teamPanel")); + add(new EmptyPanel("teamPanel2")); + add(new EmptyPanel("teamPanel4")); + add(new EmptyPanel("teamPanel5")); + } + + add(new AbstractAjaxBehavior(){ + + @Override + public void onRequest() { + } + + @Override + public void renderHead(Component component, IHeaderResponse response) { + super.renderHead(component, response); + response.render(OnDomReadyHeaderItem.forScript("$(\"#navitem-"+entityName+"\").addClass(\"active\");")); + } + + }); + + // final Page this_page = previousePage; + ICRUDActionListener actionListener = new DefaultCRUDActionListener(){ + + @Override + public void delete() { + if(entityName.equals("account")){ + DAOImpl.deleteRecord(id, entityName); + setResponsePage(new AccountPage()); + }else if(entityName.equals("contact")){ + DAOImpl.deleteRecord(id, entityName); + setResponsePage(new ContactPage()); + }else if(entityName.equals("activity")) { + DAOImpl.deleteRecord(id, entityName); + + setResponsePage(new ActivityPage()); + }else if(entityName.equals("coaching")) { + DAOImpl.deleteRecord(id, entityName); + setResponsePage(new CoachingPage()); + }else if(entityName.equalsIgnoreCase("userInfo")){ + if(DAOImpl.deleteRecord(id, entityName)>0){ + DAOImpl.updateCrmUserReport(id, "-1"); + } + setResponsePage(new UserPage()); + }else if(entityName.equals("crmuser")) { + String reportto = String.valueOf(DAOImpl.getReporttoIdById(id)); + DAOImpl.deleteRecord(id, entityName); + if(reportto !=null ){ + setResponsePage(new AdminTreePage(reportto)); + } else{ + setResponsePage(new AdminTreePage()); + } +// setResponsePage(new PositionPage()); + }else if(entityName.equals("productcategory")){ + DAOImpl.deleteRecord(id, entityName); + setResponsePage(new ProductTreePage()); + }else if(entityName.equals("product")){ + DAOImpl.deleteProductRecord(id, entityName); + setResponsePage(new ProductTreePage()); + }else if(entityName.equals("productline")){ + DAOImpl.deleteProductLineRecord(id, entityName); + setResponsePage(new ProductTreePage()); + } + } + + @Override + public void update() { + if(entityName.equals("product")||entityName.equals("productline")||entityName.equals("procuctcategory")){ + prePageParams.add("entityName", entityName); + } + setResponsePage(new EditDataPage(entityName,id,previousPageClass,prePageParams)); + System.out.println("EntityDetailContainerPanel:"+prePageParams); + } + @Override + public void doneBtn(){ + final SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date time = new Date(); + String d = dateformat.format(time); + DAOImpl.doneRecord(id, entityName, d); + } + @Override + public void resetPassword(int userId){ + if(DAOImpl.resetUserPassword(userId)>0){ + //获取对象 + UserInfo crmuser = DAOImpl.getUserInfoById(userId); + //发送邮件,判断成功与否 + if(SendEmail.sendMail(String.valueOf(crmuser.getId()),crmuser.getEmail())){ + div.add(new AttributeAppender("style",new Model("display:block"),";")); + groupitem.add(new AttributeAppender("style",new Model("display:block"),";")); + promptLabel.add(new AttributeAppender("style",new Model("display:block"),";")); + promptButton.add(new AttributeAppender("style",new Model("display:block"),";")); + }; + /*if(sendMail(crmuser.getLoginName(),crmuser.getEmail())){ + //promptLabel.add(new AttributeAppender("style",new Model("display:block"),";")); + setResponsePage(new UserPage()); + };*/ + }; + } + + @Override + public void downLoadBtn() throws Exception + { + // TODO Auto-generated method stub + + } + + @Override + public void merge() { + // TODO Auto-generated method stub + + } + + @Override + public void ineffective() { + // TODO Auto-generated method stub + List users = new ArrayList(); + + if(entityName.equalsIgnoreCase("userinfo")){ + UserPosition userInfo = DAOImpl.getUserPositionById(Integer.parseInt(id)); + DAOImpl.updateUserInfoPositionByUserId(entityName,id); + DAOImpl.removeEntityFromTeam("user_position",String.valueOf(id)); + DAOImpl.insertRealtionHestory("user_position",user,userInfo.getPositionId(),Integer.parseInt(id)); + }else if(entityName.equalsIgnoreCase("crmuser")) + try { + { + DAOImpl.updateUserInfoPositionByUserId(entityName,id); + users = DAOImpl.getUsersByPositionId(id); + List crmusers = DAOImpl.getPositionByReporttoId(id); + DAOImpl.updateCrmUserReport(id, "-1"); + CRMUser reporttoCrmuser = DAOImpl.getCrmUserById(id); + for(CRMUser crmuser :crmusers){ + DAOImpl.insertAudit("crmuser","上级岗位",reporttoCrmuser.getName(),"admin",String.valueOf(crmuser.getId()),user); + } + List acrs = DAOImpl.getAccountsByPositionId(Integer.parseInt(id)); + for(AccountCRMUserRelation acr : acrs){ + DAOImpl.removeEntityFromTeam("accountcrmuser",String.valueOf(acr.getId())); + DAOImpl.insertRealtionHestory("accountcrmuser",user,acr.getCrmuserId(),acr.getAccountId()); + } + for(UserPosition userinfo : users){ + DAOImpl.removeEntityFromTeam("user_position",String.valueOf(userinfo.getId())); + DAOImpl.insertRealtionHestory("user_position",user,userinfo.getPositionId(),userinfo.getUserId()); + } + } + } catch (NumberFormatException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + else if(entityName.equalsIgnoreCase("account")){ + List acrs = DAOImpl.getAccountsByAccountId((Integer.parseInt(id))); + for(AccountCRMUserRelation acr : acrs){ + DAOImpl.removeEntityFromTeam("accountcrmuser",String.valueOf(acr.getId())); + DAOImpl.insertRealtionHestory("accountcrmuser",user,acr.getCrmuserId(),acr.getAccountId()); + } + } + setResponsePage(new AdminTreePage()); + } + + }; + + + add(new CRUDPanel("operationBar",entity.getName(),id, CRMUtility.getPermissionForEntity(roleId, entity.getName()),actionListener)); + + } + +} diff --git a/crm/src/main/java/com/rex/crm/common/EntityDetailPage.html b/crm/src/main/java/com/rex/crm/common/EntityDetailPage.html new file mode 100755 index 0000000..eef1c77 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/EntityDetailPage.html @@ -0,0 +1,82 @@ + + + + + +
+
+
+ + +
+ +
+
+ 我的 +
+
[operation bar]
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+ + +
+
+
+ + diff --git a/crm/src/main/java/com/rex/crm/common/EntityDetailPage.java b/crm/src/main/java/com/rex/crm/common/EntityDetailPage.java new file mode 100644 index 0000000..76aa0a8 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/EntityDetailPage.java @@ -0,0 +1,412 @@ +package com.rex.crm.common; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.EnumSet; +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.apache.wicket.Component; +import org.apache.wicket.Page; +import org.apache.wicket.behavior.AbstractAjaxBehavior; +import org.apache.wicket.behavior.AttributeAppender; +import org.apache.wicket.markup.head.IHeaderResponse; +import org.apache.wicket.markup.head.OnDomReadyHeaderItem; +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.list.AbstractItem; +import org.apache.wicket.markup.html.panel.EmptyPanel; +import org.apache.wicket.markup.repeater.RepeatingView; +import org.apache.wicket.model.Model; +import org.apache.wicket.request.mapper.parameter.PageParameters; + +import com.google.common.collect.Maps; +import com.rex.crm.AccountPage; +import com.rex.crm.ActivityPage; +import com.rex.crm.AlertPage; +import com.rex.crm.AreaPage; +import com.rex.crm.CalendarPage; +import com.rex.crm.CoachingPage; +import com.rex.crm.ContactPage; +import com.rex.crm.SignIn2Session; +import com.rex.crm.TemplatePage; +import com.rex.crm.admin.PositionPage; +import com.rex.crm.admin.ProductPage; +import com.rex.crm.admin.UserPage; +import com.rex.crm.admin.UserPositionPage; +import com.rex.crm.beans.AccountCRMUserRelation; +import com.rex.crm.beans.CRMUser; +import com.rex.crm.beans.UserInfo; +import com.rex.crm.beans.UserPosition; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.db.model.Activity; +import com.rex.crm.util.CRMUtility; +import com.rex.crm.util.Configuration; +import com.rex.crm.util.SendEmail; + +public class EntityDetailPage extends TemplatePage { + private static final Logger logger = Logger.getLogger(EntityDetailPage.class); + + private static final long serialVersionUID = -2613412283023068638L; + private final String user = ((SignIn2Session)getSession()).getUser(); + private final int roleId = ((SignIn2Session)getSession()).getRoleId(); + private final String positionId = ((SignIn2Session)getSession()).getPositionId(); + private static int NUM_OF_COLUMN = 3; + + public EntityDetailPage(){ + String entityId = this.getRequest().getRequestParameters().getParameterValue("id").toString(); + String nameForEntity = this.getRequest().getRequestParameters().getParameterValue("entityName").toString(); + String fromPage = this.getRequest().getRequestParameters().getParameterValue("formPage").toString(); + if(null==entityId&&null==nameForEntity){ + RepeatingView div = new RepeatingView("promptDiv"); + AbstractItem groupitem = new AbstractItem(div.newChildId()); + Label promptButton = new Label("promptButton","X"); + groupitem.add(promptButton); + final Label promptLabel = new Label("prompt","提示:操作已成功!"); + groupitem.add(promptLabel); + div.add(new AttributeAppender("style",new Model("display:none"),";")); + groupitem.add(new AttributeAppender("style",new Model("display:none"),";")); + div.add(groupitem); + add(div); + add(new Label("name","null")); + WebMarkupContainer operationBar = new WebMarkupContainer("operationBar"); + add(operationBar); + WebMarkupContainer detailed = new WebMarkupContainer("detailed"); + add(detailed); + WebMarkupContainer teamPanel = new WebMarkupContainer("teamPanel"); + add(teamPanel); + WebMarkupContainer teamPanel2 = new WebMarkupContainer("teamPanel2"); + add(teamPanel2); + WebMarkupContainer teamPanel3 = new WebMarkupContainer("teamPanel3"); + add(teamPanel3); + WebMarkupContainer teamPanel4 = new WebMarkupContainer("teamPanel4"); + add(teamPanel4); + RepeatingView relationRepeater = new RepeatingView("relationRepeater"); + AbstractItem relationItem = new AbstractItem(relationRepeater.newChildId()); + relationItem.add(new Label("relationPanel","")); + add(relationRepeater); + }else{ + initPage(nameForEntity.toString(),entityId.toString(),fromPage); + } + + } + public EntityDetailPage(final String entityName, final String id){ + initPage(entityName,id,null); + } + public void initPage(final String entityName, final String id,final String fromPage){ + //check the permission + + if(entityName.equalsIgnoreCase("account") || entityName.equalsIgnoreCase("contact")){ + boolean allowed = DAOImpl.isAllow2ReadEntity(entityName, id, positionId); + if(roleId !=1){ + if(!allowed){ + logger.info("The entity is not allowed to read"); + + redirectToInterceptPage(new NoPermissionPage()); + } + } + + } + + + this.setPageTitle("详细信息"); + final int roleId = ((SignIn2Session)getSession()).getRoleId(); + Map entities = Configuration.getEntityTable(); + final Entity entity = entities.get(entityName); + final RepeatingView div = new RepeatingView("promptDiv"); + final AbstractItem groupitem = new AbstractItem(div.newChildId()); + final Label promptButton = new Label("promptButton","X"); + groupitem.add(promptButton); + final Label promptLabel = new Label("prompt","提示:操作已成功!"); + groupitem.add(promptLabel); + div.add(new AttributeAppender("style",new Model("display:none"),";")); + groupitem.add(new AttributeAppender("style",new Model("display:none"),";")); + div.add(groupitem); + add(div); + long lid = Long.parseLong(id); + Map map = DAOImpl.queryEntityById(entity.getSql_ent(), String.valueOf(lid)); + if(entity.getName().equals("activity")||entity.getName().equals("coaching")||entity.getName().equals("willcoaching")){ + add(new Label("name",String.valueOf(map.get("title")))); + }else if(entity.getName().equals("crmuser")){ + add(new Label("name",String.valueOf(map.get("code")))); + }else if(entity.getName().equals("user_position")){ + add(new Label("name",String.valueOf(map.get("userId")))); + }else if(entity.getName().equals("province")||entity.getName().equals("city")){ + add(new Label("name",String.valueOf(map.get("val")))); + }else if(entity.getName().equalsIgnoreCase("alertattachment")){ + add(new Label("name",String.valueOf(map.get("fileName")))); + }else{ + add(new Label("name",String.valueOf(map.get("name")))); + } + + add(new EntityDetailPanel("detailed",entity,map,id,3,entityName)); + + + //set relations data + List relations = Configuration.getRelationsByName(entityName); + + RepeatingView relationRepeater = new RepeatingView("relationRepeater"); + add(relationRepeater); + + List paramFields = entity.getParamFields(); + final Map params = Maps.newHashMap(); + for(Field f:paramFields){ + params.put(entityName+"."+f.getName(), map.get(f.getName())); + } + for(Relation r:relations){ + if((r.getName().equalsIgnoreCase("accountcrmuserrelationhistory")||r.getName().equalsIgnoreCase("userposition_relation_history"))&&roleId!=1){ + continue; + } + AbstractItem item = new AbstractItem(relationRepeater.newChildId()); + relationRepeater.add(item); + logger.debug(r.getSql()); + logger.debug("parms:"+id); + String sql = r.getSql(); + List list = null; + + if(entityName.equalsIgnoreCase("contact")&&r.getTo().equalsIgnoreCase("activity")){ + if(roleId == 1){ + sql = r.getSql(); + list = DAOImpl.queryEntityRelationList(sql, id); + }else if(roleId ==2){ + sql = r.getSql_manager(); + list = DAOImpl.queryEntityRelationList(sql, id,positionId); + }else{ + sql = r.getSql_admin(); + list = DAOImpl.queryEntityRelationList(sql, id,positionId); + } + }else{ + list = DAOImpl.queryEntityRelationList(r.getSql(), id); + } + item.add(new RelationDataPanel("relationPanel",r,entityName,list,String.valueOf(lid),params)); + } + if(entityName.equalsIgnoreCase("account")){ + add(new TeamManPanel("teamPanel",entityName,String.valueOf(lid),0)); + add(new EmptyPanel("teamPanel2")); + add(new EmptyPanel("teamPanel3")); + add(new EmptyPanel("teamPanel4")); + }else if(entityName.equalsIgnoreCase("crmuser")){ + add(new TeamManPanel("teamPanel",entityName,String.valueOf(lid),0)); + add(new EmptyPanel("teamPanel2")); + add(new TeamManPanel("teamPanel3",entityName,String.valueOf(lid),2)); + add(new TeamManPanel("teamPanel4",entityName,String.valueOf(lid),3)); + }else if(entityName.equalsIgnoreCase("userInfo")){ + add(new EmptyPanel("teamPanel")); + add(new EmptyPanel("teamPanel2")); + add(new TeamManPanel("teamPanel3",entityName,String.valueOf(lid),2)); + add(new EmptyPanel("teamPanel4")); + } + else{ + add(new EmptyPanel("teamPanel")); + add(new EmptyPanel("teamPanel2")); + add(new EmptyPanel("teamPanel3")); + add(new EmptyPanel("teamPanel4")); + } + + add(new AbstractAjaxBehavior(){ + + @Override + public void onRequest() { + } + + @Override + public void renderHead(Component component, IHeaderResponse response) { + super.renderHead(component, response); + response.render(OnDomReadyHeaderItem.forScript("$(\"#navitem-"+entityName+"\").addClass(\"active\");")); + } + + }); + + final Page this_page =this; + ICRUDActionListener actionListener = new DefaultCRUDActionListener(){ + + @Override + public void delete() { + if(entityName.equals("account")){ + DAOImpl.deleteRecord(id, entityName); + setResponsePage(new AccountPage()); + }else if(entityName.equals("contact")){ + DAOImpl.deleteRecord(id, entityName); + setResponsePage(new ContactPage()); + }else if(entityName.equals("activity")) { + if("calendar".equals(fromPage)){ + DAOImpl.deleteRecord(id, entityName); + setResponsePage(new CalendarPage()); + }else{ + DAOImpl.deleteRecord(id, entityName); + setResponsePage(new ActivityPage()); + } + }else if(entityName.equals("coaching")||entityName.equals("willcoaching")) { + if("calendar".equals(fromPage)){ + DAOImpl.deleteRecord(id, entityName); + setResponsePage(new CalendarPage()); + }else{ + DAOImpl.deleteRecord(id, entityName); + setResponsePage(new CoachingPage()); + } + }else if(entityName.equalsIgnoreCase("userInfo")){ + if(DAOImpl.deleteRecord(id, entityName)>0){ + DAOImpl.updateCrmUserReport(id, "-1"); + } + setResponsePage(new UserPage()); + }else if(entityName.equals("crmuser")) { + DAOImpl.deleteRecord(id, entityName); + setResponsePage(new PositionPage()); + }else if(entityName.equals("alert")||entityName.equals("alertattachment")){ + DAOImpl.deleteRecord(id, entityName); + setResponsePage(new AlertPage()); + }else if(entityName.equals("user_position")){ + DAOImpl.deleteRecord(id, entityName); + setResponsePage(new UserPositionPage()); + }else if(entityName.equals("productcategory")){ + DAOImpl.deleteRecord(id, entityName); + setResponsePage(new ProductPage()); + }else if(entityName.equals("product")){ + DAOImpl.deleteProductRecord(id, entityName); + setResponsePage(new ProductPage()); + }else if(entityName.equals("productline")){ + DAOImpl.deleteProductLineRecord(id, entityName); + setResponsePage(new ProductPage()); + }else if(entityName.equals("province")){ + DAOImpl.deleteRecordFather(id,entityName,"city","parentId"); + setResponsePage(new AreaPage()); + }else if(entityName.equals("city")){ + DAOImpl.deleteRecord(id, entityName); + setResponsePage(new AreaPage()); + } + } + + @Override + public void update() { + if(entityName.equals("activity")||entityName.equals("coaching")||entityName.equals("willcoaching")){ + //根据id获取对象如果是计划状态则进行操作 + Activity activity =DAOImpl.getActivityById(Integer.parseInt(id)); + if(activity.getStatus()==1){ + PageParameters pp = new PageParameters(); + pp.add("id", id); + pp.add("entityName", entityName); + setResponsePage(new EditDataPage(entityName,id,this_page.getClass(),pp)); + } + }else{ + PageParameters pp = new PageParameters(); + pp.add("id", id); + pp.add("entityName", entityName); + setResponsePage(new EditDataPage(entityName,id,this_page.getClass(),pp)); + } + + } + @Override + public void doneBtn(){ + //根据id获取对象如果是计划状态则进行操作 + Activity activity =DAOImpl.getActivityById(Integer.parseInt(id)); + if(activity.getStatus()==1){ + final SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date time = new Date(); + String d = dateformat.format(time); + DAOImpl.doneRecord(id, entityName, d); + setResponsePage(new EntityDetailPage(entityName,id)); + } + } + @Override + public void resetPassword(int userId){ + if(DAOImpl.resetUserPassword(userId)>0){ + /* //获取对象 + UserInfo crmuser = DAOImpl.getUserInfoById(userId); + //发送邮件,判断成功与否 + if(SendEmail.sendMail(String.valueOf(crmuser.getTs())+"_"+crmuser.getId(),crmuser.getEmail())){*/ + div.add(new AttributeAppender("style",new Model("display:block"),";")); + groupitem.add(new AttributeAppender("style",new Model("display:block"),";")); + promptLabel.add(new AttributeAppender("style",new Model("display:block"),";")); + promptButton.add(new AttributeAppender("style",new Model("display:block"),";")); + }; + /*if(sendMail(crmuser.getLoginName(),crmuser.getEmail())){ + //promptLabel.add(new AttributeAppender("style",new Model("display:block"),";")); + setResponsePage(new UserPage()); + }; + };*/ + } + + @Override + public void downLoadBtn() throws Exception + { + // TODO Auto-generated method stub + + } + @Override + public void noExecute(String entityName,int entityId){ + //修改活动状态为未执行 + //根据id获取对象如果是计划状态则进行操作 + Activity activity =DAOImpl.getActivityById(Integer.parseInt(id)); + if(activity.getStatus()==1){ + if(DAOImpl.updateActivityStatusById(entityId)){ + setResponsePage(new EntityDetailPage(entityName,String.valueOf(entityId))); + }; + } + } + + @Override + public void merge() { + // TODO Auto-generated method stub + setResponsePage(new com.rex.crm.admin.MergePage(entityName,String.valueOf(id),null)); + } + + @Override + public void ineffective() { + // TODO Auto-generated method stub + List users = new ArrayList(); + + if(entityName.equalsIgnoreCase("userinfo")){ + users = DAOImpl.getPositionsByUserId(Integer.parseInt(id)); + DAOImpl.updateUserInfoPositionByUserId(entityName,id); + for(UserPosition userinfo : users){ + DAOImpl.removeEntityFromTeam("user_position",String.valueOf(userinfo.getId())); + DAOImpl.insertRealtionHestory("user_position",user,userinfo.getPositionId(),Integer.parseInt(id)); + } + }else if(entityName.equalsIgnoreCase("crmuser")) + try { + { + DAOImpl.updateUserInfoPositionByUserId(entityName,id); + users = DAOImpl.getUsersByPositionId(id); + List crmusers = DAOImpl.getPositionByReporttoId(id); + DAOImpl.updateCrmUserReport(id, "-1"); + CRMUser reporttoCrmuser = DAOImpl.getCrmUserById(id); + for(CRMUser crmuser :crmusers){ + DAOImpl.insertAudit("crmuser","上级岗位",reporttoCrmuser.getName(),"admin",String.valueOf(crmuser.getId()),user); + } + List acrs = DAOImpl.getAccountsByPositionId(Integer.parseInt(id)); + for(AccountCRMUserRelation acr : acrs){ + DAOImpl.removeEntityFromTeam("accountcrmuser",String.valueOf(acr.getId())); + DAOImpl.insertRealtionHestory("accountcrmuser",user,acr.getCrmuserId(),acr.getAccountId()); + } + for(UserPosition userinfo : users){ + DAOImpl.removeEntityFromTeam("user_position",String.valueOf(userinfo.getId())); + DAOImpl.insertRealtionHestory("user_position",user,userinfo.getPositionId(),userinfo.getUserId()); + } + } + } catch (NumberFormatException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + else if(entityName.equalsIgnoreCase("account")){ + List acrs = DAOImpl.getAccountsByAccountId((Integer.parseInt(id))); + for(AccountCRMUserRelation acr : acrs){ + DAOImpl.removeEntityFromTeam("accountcrmuser",String.valueOf(acr.getId())); + DAOImpl.insertRealtionHestory("accountcrmuser",user,acr.getCrmuserId(),acr.getAccountId()); + } + } + setResponsePage(new EntityDetailPage(entityName,id)); + } + + }; + + + add(new CRUDPanel("operationBar",entity.getName(),id, CRMUtility.getPermissionForEntity(roleId, entity.getName()),actionListener)); + } + +} diff --git a/crm/src/main/java/com/rex/crm/common/EntityDetailPanel.html b/crm/src/main/java/com/rex/crm/common/EntityDetailPanel.html new file mode 100755 index 0000000..599a29e --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/EntityDetailPanel.html @@ -0,0 +1,62 @@ + + + +
+
+
+
+ +
+
+

+ + +

+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+ +
+
+
+
+ + + +
diff --git a/crm/src/main/java/com/rex/crm/common/EntityDetailPanel.java b/crm/src/main/java/com/rex/crm/common/EntityDetailPanel.java new file mode 100644 index 0000000..ada2216 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/EntityDetailPanel.java @@ -0,0 +1,224 @@ +package com.rex.crm.common; + +import java.awt.Button; +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.apache.wicket.AttributeModifier; +import org.apache.wicket.Component; +import org.apache.wicket.MarkupContainer; +import org.apache.wicket.behavior.AbstractAjaxBehavior; +import org.apache.wicket.behavior.AttributeAppender; +import org.apache.wicket.markup.head.IHeaderResponse; +import org.apache.wicket.markup.head.OnDomReadyHeaderItem; +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.link.DownloadLink; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.markup.html.list.AbstractItem; +import org.apache.wicket.markup.html.panel.Fragment; +import org.apache.wicket.markup.html.panel.Panel; +import org.apache.wicket.markup.repeater.RepeatingView; +import org.apache.wicket.model.Model; +import org.apache.wicket.util.file.File; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.io.Files; +import com.rex.crm.SignIn2Session; +import com.rex.crm.TemplatePage; +import com.rex.crm.admin.DataImportPage; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.util.CRMUtility; +import com.rex.crm.util.Configuration; + +public class EntityDetailPanel extends Panel { + + private static final Logger logger = Logger.getLogger(EntityDetailPanel.class); + private static final long serialVersionUID = -2613412283023068638L; + private Map> fieldGroupMap = Maps.newHashMap(); + private int number_of_column = 1; + + public EntityDetailPanel(String id, final Entity schema, final Map data, String entityId, int number_of_column, final String pageName) { + super(id); +// this.number_of_column = number_of_column; + // TODO Get permission info of user from database. + // add(new + // CRUDPanel("operationBar",EnumSet.of(CRUDPanel.Permissions.DEL,CRUDPanel.Permissions.EDIT))); + + + // TODO Get the table definition from database or configuration + final int roleId = ((SignIn2Session)getSession()).getRoleId(); + String primaryKeyName = schema.getPrimaryKeyName(); + List fields = schema.getFields();//得到所有fields + for (Field f : fields) { + if (fieldGroupMap.get(f.getFieldGroup()) != null) { + fieldGroupMap.get(f.getFieldGroup()).add(f);//以fieldgroup为条件查询,并将其添加入新的集合钟 + } else { + List fs = Lists.newArrayList(); + fs.add(f); + fieldGroupMap.put(f.getFieldGroup(), fs); + } + } + List groupNames = Configuration.getSortedFieldGroupNames();//得到分组信息 + RepeatingView fieldGroupRepeater = new RepeatingView("fieldGroupRepeater"); + add(fieldGroupRepeater); + int gNum = 0; + for (String gn : groupNames) { + List groupfields = fieldGroupMap.get(gn); + if (groupfields == null) { + continue; + } + AbstractItem groupitem = new AbstractItem(fieldGroupRepeater.newChildId()); + fieldGroupRepeater.add(groupitem); + WebMarkupContainer container = new WebMarkupContainer("divButton"); + groupitem.add(container); + container.add(new Label("groupname", gn)); + container.add(new AttributeModifier("href", "#collapse" + (gNum))); + WebMarkupContainer panel_body_div = new WebMarkupContainer("panel_body_div"); + panel_body_div.add(new AttributeModifier("id", "collapse" + (gNum))); + if(gNum == 0){ + panel_body_div.add(new AttributeAppender("class", new Model("in")," ")); + } + groupitem.add(panel_body_div); + RepeatingView divRepeater = new RepeatingView("divRepeater"); + panel_body_div.add(divRepeater); + AbstractItem div = new AbstractItem(divRepeater.newChildId()); + divRepeater.add(div); + gNum++; + RepeatingView dataRowRepeater = new RepeatingView("dataRowRepeater"); + div.add(dataRowRepeater); + int numOfField = 0; + List visibleFields = Lists.newArrayList(); + + for (Field f : groupfields) { + if (!f.isVisible()||!f.isShow()) { + continue; + } + + numOfField++; + visibleFields.add(f); + } + + + + int num_of_row = (numOfField / this.number_of_column) + 1; + + for (int i = 0; i < num_of_row; i++) { + AbstractItem item = new AbstractItem(dataRowRepeater.newChildId()); + item.add(new AttributeAppender("class", new Model(" "+i))); + dataRowRepeater.add(item); + RepeatingView columnRepeater = new RepeatingView("columnRepeater"); + item.add(columnRepeater); + if (data == null) { + continue; + } + for (int j = 0; j < 2 * this.number_of_column; j++) { + AbstractItem columnitem = new AbstractItem(columnRepeater.newChildId(), new Model(String.valueOf(data.get(primaryKeyName)))); + + if ((i * this.number_of_column + j / 2) >= visibleFields.size()) { + if ((i * this.number_of_column + j / 2) >= visibleFields.size()) { + continue; + } + columnitem.add(new Label("celldata", " ").setEscapeModelStrings(false)); + columnRepeater.add(columnitem); + continue; + } + Field currentField = visibleFields.get(i * this.number_of_column + j / 2); + if (currentField.getPicklist() != null) { + + if (j % 2 == 0) { + columnitem.add(new Label("celldata", currentField.getDisplay() + ":").add(new AttributeAppender("style", new Model("font-weight:bold;"), ";"))); + columnitem.add(new AttributeAppender("class", new Model("tag"), " ")); + } else { + String value = CRMUtility.formatValue(currentField.getFormatter(), DAOImpl.queryPickListByIdCached(currentField.getPicklist(), String.valueOf(data.get(currentField.getName())))); + value = (value == null) ? "" : value; + Label label = (Label) new Label("celldata",value).setEscapeModelStrings(false); + label.add(new AttributeAppender("id",new Model(currentField.getName()),";")); + columnitem.add(label); + } + } else if (currentField.getRelationTable() != null) { + if (j % 2 == 0) { + columnitem.add(new Label("celldata", currentField.getDisplay() + ":").add(new AttributeAppender("style", new Model("font-weight:bold;"), ";"))); + columnitem.add(new AttributeAppender("class", new Model("tag"), " ")); + } else { + String value = CRMUtility.formatValue(currentField.getFormatter(), DAOImpl.queryCachedRelationDataById(currentField.getRelationTable(), String.valueOf(data.get(currentField.getName())))); + value = (value == null) ? "" : value; + if (roleId==1) { + columnitem.add(new DetailLinkFragment("celldata", "detailFragment", this,value,currentField.getRelationTable(),String.valueOf(data.get(currentField.getName())))); + }else{ + if(!currentField.getRelationTable().equalsIgnoreCase("crmuser")){ + columnitem.add(new DetailLinkFragment("celldata", "detailFragment", this,value,currentField.getRelationTable(),String.valueOf(data.get(currentField.getName())))); + }else{ + columnitem.add(new Label("celldata", value).setEscapeModelStrings(false)); + } + } + + } + }else { + if (j % 2 == 0) { + columnitem.add(new Label("celldata", currentField.getDisplay() + ":").add(new AttributeAppender("style", new Model("font-weight:bold;"), ";"))); + columnitem.add(new AttributeAppender("class", new Model("tag"), " ")); + } else { + Object rawvalue = data.get(currentField.getName()); + rawvalue = (rawvalue == null) ? "" : rawvalue; + String value = CRMUtility.formatValue(currentField.getFormatter(), String.valueOf(rawvalue)); + value = (value == null) ? "" : value; + + if (currentField.getDataType().equalsIgnoreCase("bjgtextarea")){ + Label label = new Label("celldata", value); + label.setEscapeModelStrings(false); + label.add(new AttributeAppender("class",new Model("labelWidth")," ")); + columnitem.add(label); + }else if(currentField.getDataType().equalsIgnoreCase("file")){ + columnitem.add(new DownloadLinkFragment("celldata", "detailFragment", this,value,String.valueOf(data.get(currentField.getName())),String.valueOf(data.get("srcForFile")))); + }else{ + columnitem.add(new Label("celldata", value).setEscapeModelStrings(false)); + } + } + } + columnRepeater.add(columnitem); + } + }// end of set the detailed info + }// end of groupNames loop + add(new AbstractAjaxBehavior() { + @Override + public void onRequest() { + } + + @Override + public void renderHead(Component component, IHeaderResponse response) { + super.renderHead(component, response); + response.render(OnDomReadyHeaderItem.forScript("$(\"#navitem-" + pageName + "\").addClass(\"active\");")); + } + }); + } + private class DownloadLinkFragment extends Fragment{ + public DownloadLinkFragment(String id, String markupId, MarkupContainer markupProvider,String name, final String eid,String srcFile){ + super(id, markupId, markupProvider); + java.io.File tmpDir = null; + tmpDir = Files.createTempDir(); + String tmpFileName = CRMUtility.readFileAttribure("uploadpath")+srcFile; + System.out.println("tmpFileName:"+tmpFileName); + File contact_template = new File(tmpFileName); + add(new DownloadLink("detailclick",contact_template,eid).add(new Label("caption", new Model(eid)))); + } + } + private class DetailLinkFragment extends Fragment { + + public DetailLinkFragment(String id, String markupId, MarkupContainer markupProvider, String name,final String entityName ,final String eid) { + super(id, markupId, markupProvider); +// final String str = DAOImpl.queryEntityByName(caption); + add(new Link("detailclick") { + @Override + public void onClick() { + + setResponsePage(new EntityDetailPage(entityName, eid)); + } + }.add(new Label("caption", new Model(name)))); + } + } +} diff --git a/crm/src/main/java/com/rex/crm/common/ErrorPromptPage.html b/crm/src/main/java/com/rex/crm/common/ErrorPromptPage.html new file mode 100644 index 0000000..88b6d03 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/ErrorPromptPage.html @@ -0,0 +1,12 @@ + + + + +Insert title here + + +
+

+
+ + \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/common/ErrorPromptPage.java b/crm/src/main/java/com/rex/crm/common/ErrorPromptPage.java new file mode 100644 index 0000000..007721a --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/ErrorPromptPage.java @@ -0,0 +1,11 @@ +package com.rex.crm.common; + +import org.apache.wicket.markup.html.WebPage; +import org.apache.wicket.markup.html.basic.Label; + +public class ErrorPromptPage extends WebPage{ + public ErrorPromptPage(){ + add(new Label("prompt","此链接已失效!")); + } + +} diff --git a/crm/src/main/java/com/rex/crm/common/Field.java b/crm/src/main/java/com/rex/crm/common/Field.java new file mode 100644 index 0000000..02e610f --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/Field.java @@ -0,0 +1,350 @@ +package com.rex.crm.common; + +import java.io.Serializable; + +import com.google.gson.GsonBuilder; +import com.google.gson.annotations.Expose; + +public class Field implements Serializable +{ + + @Expose + private boolean isPrimaryKey; + @Expose + private String id; + @Expose + private boolean isRequired; + @Expose + private String display; + private String dataType; + @Expose + private String name; + @Expose + private boolean isDetailLink; + @Expose + private boolean isVisible; + @Expose + private String picklist = null; + @Expose + private boolean isEditable; + @Expose + private boolean isParam; + @Expose + private boolean isSearchable; + @Expose + private boolean isShow; + @Expose + private String formatter; + @Expose + private int priority; + @Expose + private String relationTable = null; + @Expose + private String fieldGroup = "基本信息"; + @Expose + private String alias = null; + @Expose + private boolean isBaseInfo = false; + @Expose + private String default_value = null; + @Expose + private String default_value_type = null; + @Expose + private String childNode; + @Expose + private String parentNode; + @Expose + private String fieldType; + @Expose + private int tooltip; + @Expose + private boolean isExistsDefaultValue; + + @Expose + private String import_field_name; + @Expose + private String import_external_foreignkey_field_name; + + public boolean isRequired() + { + return isRequired; + } + + public void setRequired(boolean isRequired) + { + this.isRequired = isRequired; + } + + public boolean isPrimaryKey() + { + return isPrimaryKey; + } + + public void setPrimaryKey(boolean isPrimaryKey) + { + this.isPrimaryKey = isPrimaryKey; + } + + public String getId() + { + return id; + } + + public void setId(String id) + { + this.id = id; + } + + public String getDisplay() + { + return display; + } + + public void setDisplay(String display) + { + this.display = display; + } + + public String getDataType() + { + return dataType; + } + + public void setDataType(String dataType) + { + this.dataType = dataType; + } + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public boolean isShow() { + return isShow; + } + + public void setShow(boolean isShow) { + this.isShow = isShow; + } + + @Override + public String toString() + { + GsonBuilder gb = new GsonBuilder(); + + return gb.excludeFieldsWithoutExposeAnnotation().create().toJson(this); + } + + public boolean isDetailLink() + { + return isDetailLink; + } + + public void setDetailLink(boolean isDetailLink) + { + this.isDetailLink = isDetailLink; + } + + public boolean isVisible() + { + return isVisible; + } + + public void setVisible(boolean isVisible) + { + this.isVisible = isVisible; + } + + public String getPicklist() + { + return picklist; + } + + public void setPicklist(String picklist) + { + this.picklist = picklist; + } + + public boolean isEditable() + { + return isEditable; + } + + public void setEditable(boolean isEditable) + { + this.isEditable = isEditable; + } + + public String getFormatter() + { + return formatter; + } + + public void setFormatter(String formatter) + { + this.formatter = formatter; + } + + public int getPriority() + { + return priority; + } + + public void setPriority(int priority) + { + this.priority = priority; + } + + public String getRelationTable() + { + return relationTable; + } + + public void setRelationTable(String relationTable) + { + this.relationTable = relationTable; + } + + public String getAlias() + { + return alias; + } + + public void setAlias(String alias) + { + this.alias = alias; + } + + public String getFieldGroup() + { + return fieldGroup; + } + + public void setFieldGroup(String fieldGroup) + { + this.fieldGroup = fieldGroup; + } + + public boolean isBaseInfo() + { + return isBaseInfo; + } + + public void setBaseInfo(boolean isBaseInfo) + { + this.isBaseInfo = isBaseInfo; + } + + public boolean isSearchable() + { + return isSearchable; + } + + public void setSearchable(boolean isSearchable) + { + this.isSearchable = isSearchable; + } + + public String getDefault_value() + { + return default_value; + } + + public void setDefault_value(String default_value) + { + this.default_value = default_value; + } + + public String getDefault_value_type() + { + return default_value_type; + } + + public void setDefault_value_type(String default_value_type) + { + this.default_value_type = default_value_type; + } + + public String getImport_external_foreignkey_field_name() { + return import_external_foreignkey_field_name; +} + +public void setImport_external_foreignkey_field_name(String import_external_foreignkey_field_name) { + this.import_external_foreignkey_field_name = import_external_foreignkey_field_name; +} + +public boolean isParam() + { + return isParam; + } + + public void setParam(boolean isParam) + { + this.isParam = isParam; + } + + public String getChildNode() + { + return childNode; + } + + public void setChildNode(String childNode) + { + this.childNode = childNode; + } + + public String getParentNode() + { + return parentNode; + } + + public void setParentNode(String parentNode) + { + this.parentNode = parentNode; + } + + public String getFieldType() + { + + return fieldType; + } + + public void setFieldType(String fieldType) + { + this.fieldType = fieldType; + } + + public int getTooltip() + { + return tooltip; + } + + public void setTooltip(int tooltip) + { + this.tooltip = tooltip; + } + + public boolean isExistsDefaultValue() + { + return isExistsDefaultValue; + } + + public void setExistsDefaultValue(boolean isExistsDefaultValue) + { + this.isExistsDefaultValue = isExistsDefaultValue; + } + +public String getImport_field_name() { + return import_field_name; +} + +public void setImport_field_name(String import_field_name) { + this.import_field_name = import_field_name; +} +} diff --git a/crm/src/main/java/com/rex/crm/common/FilterPanel.html b/crm/src/main/java/com/rex/crm/common/FilterPanel.html new file mode 100644 index 0000000..4fee36b --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/FilterPanel.html @@ -0,0 +1,38 @@ + + + + +
+
+
+
过滤
+
+
+ + + + + + + + + +
+ + +
+
+
+ +
+
+
+
\ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/common/FilterPanel.java b/crm/src/main/java/com/rex/crm/common/FilterPanel.java new file mode 100644 index 0000000..8ccd307 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/FilterPanel.java @@ -0,0 +1,149 @@ +package com.rex.crm.common; + +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang.ObjectUtils.Null; +import org.apache.commons.lang3.tuple.Pair; +import org.apache.log4j.Logger; +import org.apache.wicket.Page; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.CheckBox; +import org.apache.wicket.markup.html.form.CheckGroup; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.list.ListItem; +import org.apache.wicket.markup.html.list.ListView; +import org.apache.wicket.markup.html.panel.Panel; +import org.apache.wicket.model.IModel; +import org.apache.wicket.model.Model; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.rex.crm.beans.Choice; + +import org.apache.wicket.behavior.AttributeAppender; +import org.apache.wicket.markup.html.WebMarkupContainer; + +public class FilterPanel extends Panel { + private static final Logger logger = Logger.getLogger(FilterPanel.class); + private static final long serialVersionUID = 2501105233172820074L; + + + public FilterPanel(String id,List choices ,Map filter,final Class responsePage,Entity entity) { + super(id); + + Form form = new Form("side_bar_form"); + add(form); + CheckGroup group= new CheckGroup("group",new ArrayList()); + form.add(group); + //query from DAO and prepare data for query locally + //final List>> types = DAOImpl.getNumberOfTypeOfAccount(userId); + List ids = Lists.newArrayList(); + long total = 0; + final Map choiceMap = Maps.newHashMap(); + for(Choice choice:choices){ + ids.add(String.valueOf(choice.getId())); + choiceMap.put(String.valueOf(choice.getId()),choice.getVal()); + + } + if(entity.getName().equals("account")||entity.getName().equals("contact")){ + ids.add("-1"); + choiceMap.put("-1", "无"); + } + final Map models = Maps.newHashMap(); + //prepare models for the checkbox + + if (filter == null) { + for(Choice choice:choices){ + models.put(String.valueOf(choice.getId()), Model.of(Boolean.TRUE)); + } + models.put("-1", Model.of(Boolean.TRUE)); + } else { + for (String k : filter.keySet()) { + models.put(k, Model.of(filter.get(k))); + + } + } + + + + ListView listview = new ListView("rowRepeater",ids) { + + /** + * + */ + private static final long serialVersionUID = 1L; + + @Override + protected void populateItem(ListItem item) { + final String key = item.getModelObject(); + String value = String.valueOf(choiceMap.get(key)); + // String num = String.valueOf(numberMap.get(key).get("sum")); + CheckBox chk=new CheckBox("type", models.get(key)){ + @Override + protected void onSelectionChanged(Boolean newSelection) { + super.onSelectionChanged(newSelection); + Map map = Maps.newHashMap(); + for(String s:models.keySet()){ + //System.out.println(s+":"+models.get(s)); + map.put(s, (boolean)models.get(s).getObject()); + } + + Page page = null; + try { + page = (Page)responsePage.newInstance(); + Constructor cons = responsePage.getDeclaredConstructor(new Class[]{Map.class,List.class}); + //Constructor cons = responsePage.getDeclaredConstructor(Map.class,null); + page = (Page)cons.newInstance(new Object[]{map, Lists.newArrayList()}); + // page = (Page)cons.newInstance(map,null); + + } catch (InstantiationException e) { + logger.error(e); + + } catch (IllegalAccessException e) { + logger.error(e); + } catch (NoSuchMethodException e) { + logger.error(e); + } catch (SecurityException e) { + logger.error(e); + } catch (IllegalArgumentException e) { + logger.error(e); + } catch (InvocationTargetException e) { + logger.error(e); + } + // setResponsePage(new AccountPage(map)); + setResponsePage(page); + } + + @Override + protected boolean wantOnSelectionChangedNotifications() { + return true; + } + }; + // WebMarkupContainer container_label = new WebMarkupContainer("checkbox_label"); + // item.add(container_label); + // chk.setMarkupId("check"+key); + + // container_label.add(new AttributeAppender("for", new Model(chk.getMarkupId()), " ")); + item.add(chk); + item.add(new Label("name", new Model(value))); + item.add(new Label("num", new Model(0)).setVisible(false)); + } + + + }; + + group.add(listview); + // group.add(new Label("total",String.valueOf(total))); + + } + + + + + +} diff --git a/crm/src/main/java/com/rex/crm/common/ICRUDActionListener.java b/crm/src/main/java/com/rex/crm/common/ICRUDActionListener.java new file mode 100644 index 0000000..d0f05ad --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/ICRUDActionListener.java @@ -0,0 +1,15 @@ +package com.rex.crm.common; + +public interface ICRUDActionListener { + + public void create(); + public void update(); + public void delete(); + public void resetPassword(int userId); + public void doneBtn() ; + public void downLoadBtn() throws Exception; + public void noExecute(String entityName,int entityId); + public void merge(); + public void ineffective(); +} + diff --git a/crm/src/main/java/com/rex/crm/common/IFormatter.java b/crm/src/main/java/com/rex/crm/common/IFormatter.java new file mode 100644 index 0000000..88f23e2 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/IFormatter.java @@ -0,0 +1,6 @@ +package com.rex.crm.common; + +public interface IFormatter { + + public String format(String value); +} diff --git a/crm/src/main/java/com/rex/crm/common/MergePage.html b/crm/src/main/java/com/rex/crm/common/MergePage.html new file mode 100644 index 0000000..06446c7 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/MergePage.html @@ -0,0 +1,47 @@ + + + + + +
+
+
+ + +
+ +
+
+ 我的 +
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+ + +
+
+
+ + \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/common/MergePage.java b/crm/src/main/java/com/rex/crm/common/MergePage.java new file mode 100644 index 0000000..8b5a4f8 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/MergePage.java @@ -0,0 +1,248 @@ +package com.rex.crm.common; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.EnumSet; +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.apache.wicket.Component; +import org.apache.wicket.Page; +import org.apache.wicket.behavior.AbstractAjaxBehavior; +import org.apache.wicket.behavior.AttributeAppender; +import org.apache.wicket.markup.head.IHeaderResponse; +import org.apache.wicket.markup.head.OnDomReadyHeaderItem; +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.list.AbstractItem; +import org.apache.wicket.markup.html.panel.EmptyPanel; +import org.apache.wicket.markup.repeater.RepeatingView; +import org.apache.wicket.model.Model; +import org.apache.wicket.request.mapper.parameter.PageParameters; + +import com.google.common.collect.Maps; +import com.rex.crm.AccountPage; +import com.rex.crm.ActivityPage; +import com.rex.crm.AlertPage; +import com.rex.crm.AreaPage; +import com.rex.crm.CoachingPage; +import com.rex.crm.ContactPage; +import com.rex.crm.SignIn2Session; +import com.rex.crm.TemplatePage; +import com.rex.crm.admin.PositionPage; +import com.rex.crm.admin.ProductPage; +import com.rex.crm.admin.UserPage; +import com.rex.crm.admin.UserPositionPage; +import com.rex.crm.beans.CRMUser; +import com.rex.crm.beans.UserInfo; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.db.model.Activity; +import com.rex.crm.util.CRMUtility; +import com.rex.crm.util.Configuration; +import com.rex.crm.util.SendEmail; + +public class MergePage extends TemplatePage { + private static final Logger logger = Logger.getLogger(EntityDetailPage.class); + private static final long serialVersionUID = -2613412283023068638L; + + private static int NUM_OF_COLUMN = 3; + public MergePage(){ + String entityId = this.getRequest().getRequestParameters().getParameterValue("id").toString(); + String nameForEntity = this.getRequest().getRequestParameters().getParameterValue("entityName").toString(); + if(null==entityId&&null==nameForEntity){ + RepeatingView div = new RepeatingView("promptDiv"); + AbstractItem groupitem = new AbstractItem(div.newChildId()); + Label promptButton = new Label("promptButton","X"); + groupitem.add(promptButton); + final Label promptLabel = new Label("prompt","提示:操作已成功!"); + groupitem.add(promptLabel); + div.add(new AttributeAppender("style",new Model("display:none"),";")); + groupitem.add(new AttributeAppender("style",new Model("display:none"),";")); + div.add(groupitem); + add(div); + add(new Label("name","null")); + RepeatingView relationRepeater = new RepeatingView("relationRepeater"); + AbstractItem relationItem = new AbstractItem(relationRepeater.newChildId()); + relationItem.add(new Label("relationPanel","")); + add(relationRepeater); + }else{ + initPage(nameForEntity.toString(),entityId.toString()); + } + + } + public MergePage(final String entityName, final String id){ + initPage(entityName,id); + } + public void initPage(final String entityName, final String id){ + this.setPageTitle("详细信息"); + final int roleId = ((SignIn2Session)getSession()).getRoleId(); + Map entities = Configuration.getEntityTable(); + Entity entity = entities.get(entityName); + final RepeatingView div = new RepeatingView("promptDiv"); + final AbstractItem groupitem = new AbstractItem(div.newChildId()); + final Label promptButton = new Label("promptButton","X"); + groupitem.add(promptButton); + final Label promptLabel = new Label("prompt","提示:操作已成功!"); + groupitem.add(promptLabel); + div.add(new AttributeAppender("style",new Model("display:none"),";")); + groupitem.add(new AttributeAppender("style",new Model("display:none"),";")); + div.add(groupitem); + add(div); + long lid = Long.parseLong(id); + Map map = DAOImpl.queryEntityById(entity.getSql_ent(), String.valueOf(lid)); + add(new Label("name",String.valueOf(map.get("name")))); + + add(new EntityDetailPanel("detailed",entity,map,id,3,entityName)); + + + //set relations data + List relations = Configuration.getRelationsByName(entityName); + + RepeatingView relationRepeater = new RepeatingView("relationRepeater"); + add(relationRepeater); + + List paramFields = entity.getParamFields(); + Map params = Maps.newHashMap(); + for(Field f:paramFields){ + params.put(entityName+"."+f.getName(), map.get(f.getName())); + } + for(Relation r:relations){ + AbstractItem item = new AbstractItem(relationRepeater.newChildId()); + relationRepeater.add(item); + logger.debug(r.getSql()); + logger.debug("parms:"+id); + List list = DAOImpl.queryEntityRelationList(r.getSql(), id); + item.add(new RelationDataPanel("relationPanel",r,entityName,list,String.valueOf(lid),params)); + + } + + add(new AbstractAjaxBehavior(){ + + @Override + public void onRequest() { + } + + @Override + public void renderHead(Component component, IHeaderResponse response) { + super.renderHead(component, response); + response.render(OnDomReadyHeaderItem.forScript("$(\"#navitem-"+entityName+"\").addClass(\"active\");")); + } + + }); + + final Page this_page =this; + ICRUDActionListener actionListener = new DefaultCRUDActionListener(){ + + @Override + public void delete() { + if(entityName.equals("account")){ + DAOImpl.deleteRecord(id, entityName); + setResponsePage(new AccountPage()); + }else if(entityName.equals("contact")){ + DAOImpl.deleteRecord(id, entityName); + setResponsePage(new ContactPage()); + }else if(entityName.equalsIgnoreCase("userInfo")){ + if(DAOImpl.deleteRecord(id, entityName)>0){ + DAOImpl.updateCrmUserReport(id, "-1"); + } + setResponsePage(new UserPage()); + }else if(entityName.equals("crmuser")) { + DAOImpl.deleteRecord(id, entityName); + setResponsePage(new PositionPage()); + }else if(entityName.equals("province")){ + DAOImpl.deleteRecordFather(id,entityName,"city","parentId"); + setResponsePage(new AreaPage()); + }else if(entityName.equals("city")){ + DAOImpl.deleteRecord(id, entityName); + setResponsePage(new AreaPage()); + } + } + + @Override + public void update() { + if(entityName.equals("activity")||entityName.equals("coaching")||entityName.equals("willcoaching")){ + //根据id获取对象如果是计划状态则进行操作 + Activity activity =DAOImpl.getActivityById(Integer.parseInt(id)); + if(activity.getStatus()==1){ + PageParameters pp = new PageParameters(); + pp.add("id", id); + pp.add("entityName", entityName); + setResponsePage(new EditDataPage(entityName,id,this_page.getClass(),pp)); + } + }else{ + PageParameters pp = new PageParameters(); + pp.add("id", id); + pp.add("entityName", entityName); + setResponsePage(new EditDataPage(entityName,id,this_page.getClass(),pp)); + } + + } + @Override + public void doneBtn(){ + //根据id获取对象如果是计划状态则进行操作 + Activity activity =DAOImpl.getActivityById(Integer.parseInt(id)); + if(activity.getStatus()==1){ + final SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date time = new Date(); + String d = dateformat.format(time); + DAOImpl.doneRecord(id, entityName, d); + setResponsePage(new EntityDetailPage(entityName,id)); + } + } + @Override + public void resetPassword(int userId){ + if(DAOImpl.resetUserPassword(userId)>0){ + /* //获取对象 + UserInfo crmuser = DAOImpl.getUserInfoById(userId); + //发送邮件,判断成功与否 + if(SendEmail.sendMail(String.valueOf(crmuser.getTs())+"_"+crmuser.getId(),crmuser.getEmail())){*/ + div.add(new AttributeAppender("style",new Model("display:block"),";")); + groupitem.add(new AttributeAppender("style",new Model("display:block"),";")); + promptLabel.add(new AttributeAppender("style",new Model("display:block"),";")); + promptButton.add(new AttributeAppender("style",new Model("display:block"),";")); + }; + /*if(sendMail(crmuser.getLoginName(),crmuser.getEmail())){ + //promptLabel.add(new AttributeAppender("style",new Model("display:block"),";")); + setResponsePage(new UserPage()); + }; + };*/ + } + + @Override + public void downLoadBtn() throws Exception + { + // TODO Auto-generated method stub + + } + @Override + public void noExecute(String entityName,int entityId){ + //修改活动状态为未执行 + //根据id获取对象如果是计划状态则进行操作 + Activity activity =DAOImpl.getActivityById(Integer.parseInt(id)); + if(activity.getStatus()==1){ + if(DAOImpl.updateActivityStatusById(entityId)){ + setResponsePage(new EntityDetailPage(entityName,String.valueOf(entityId))); + }; + } + } + + @Override + public void merge() { + // TODO Auto-generated method stub + + } + + @Override + public void ineffective() { + // TODO Auto-generated method stub + + } + }; + + + } + +} diff --git a/crm/src/main/java/com/rex/crm/common/NewDataFormPanel.html b/crm/src/main/java/com/rex/crm/common/NewDataFormPanel.html new file mode 100644 index 0000000..42a5272 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/NewDataFormPanel.html @@ -0,0 +1,193 @@ + + + +
+
+ + + + + +
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+ + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + 查找 + + +    +
+
+
\ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/common/NewDataFormPanel.java b/crm/src/main/java/com/rex/crm/common/NewDataFormPanel.java new file mode 100644 index 0000000..bb252cf --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/NewDataFormPanel.java @@ -0,0 +1,1039 @@ +package com.rex.crm.common; + +import com.google.common.base.Joiner; + +import java.io.IOException; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Arrays; +import java.util.Date; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Properties; + +import org.apache.log4j.Logger; +import org.apache.wicket.AttributeModifier; +import org.apache.wicket.MarkupContainer; +import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior; +import org.apache.wicket.behavior.AttributeAppender; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.Button; +import org.apache.wicket.markup.html.form.DropDownChoice; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.HiddenField; +import org.apache.wicket.markup.html.form.IChoiceRenderer; +import org.apache.wicket.markup.html.form.RadioChoice; +import org.apache.wicket.markup.html.form.TextArea; +import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.form.upload.FileUpload; +import org.apache.wicket.markup.html.form.upload.FileUploadField; +import org.apache.wicket.markup.html.link.BookmarkablePageLink; +import org.apache.wicket.markup.html.list.AbstractItem; +import org.apache.wicket.markup.html.panel.Fragment; +import org.apache.wicket.markup.html.panel.Panel; +import org.apache.wicket.markup.repeater.RepeatingView; +import org.apache.wicket.model.AbstractReadOnlyModel; +import org.apache.wicket.model.IModel; +import org.apache.wicket.model.Model; +import org.apache.wicket.request.mapper.parameter.PageParameters; +import org.apache.wicket.util.file.File; + +import com.google.common.base.Splitter; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.io.Files; +import com.rex.crm.CalendarPage; +import com.rex.crm.PageFactory; +import com.rex.crm.SelectEntryPage; +import com.rex.crm.SignIn2Session; +import com.rex.crm.beans.CRMUser; +import com.rex.crm.beans.Choice; +import com.rex.crm.beans.UserInfo; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.util.CRMUtility; +import com.rex.crm.util.Configuration; + +public class NewDataFormPanel extends Panel +{ + + private static final Logger logger = Logger + .getLogger(NewDataFormPanel.class); + private Properties server = new Properties(); + private String email = ""; + private int port = 25; + private static String NewRecordId = "-1"; + private Map> addFieldGroupMap = Maps.newHashMap(); + private static int NUM_OF_COLUMN = 1; + private Map parentModels = Maps.newHashMap(); + private Map childDropDownComponent = Maps.newHashMap(); + private List fileFields = Lists.newArrayList(); + private static Map paramsForProduct; + private static FileUploadField fileUploadField= new FileUploadField("fileUplode"); + public NewDataFormPanel(String id, final Entity entity, final Map params) + { + super(id); + initPage(id, entity, params, null); + } + + public NewDataFormPanel(String id, final Entity entity, final Map params, String createAddress) + { + super(id); + initPage(id, entity, params, createAddress); + } + + public void initPage(final String id, final Entity entity, final Map params, final String createAddress) + { + final Map models = Maps.newHashMap(); + final String userName = ((SignIn2Session) getSession()).getUser(); + final String posId = ((SignIn2Session) getSession()).getPositionId(); + final String userId = ((SignIn2Session) getSession()).getUserId(); +// final String userId = ((SignIn2Session) getSession()).getUserId(); + List fields = entity.getFields(); + for (Field f : fields) + { + if (addFieldGroupMap.get(f.getFieldGroup()) != null) + { + addFieldGroupMap.get(f.getFieldGroup()).add(f); + } + else + { + List fs = Lists.newArrayList(); + fs.add(f); + addFieldGroupMap.put(f.getFieldGroup(), fs); + } + + } + //add prompt + final RepeatingView div = new RepeatingView("promptDiv"); + final AbstractItem group = new AbstractItem(div.newChildId()); + final Label promptButton = new Label("promptButton", "X"); + group.add(promptButton); + final Label promptLabel = new Label("prompt", "提示:用户登录名已存在!"); + group.add(promptLabel); + final Label promptLabelForAccount = new Label("promptForAccount", "提示:医院BDM编码已存在!"); + group.add(promptLabelForAccount); + final Label promptForCrmuser = new Label("promptForCrmuser", "提示:岗位编码已存在!"); + group.add(promptForCrmuser); + final Label promptFordate = new Label("promptFordate", "提示:时间格式不正确!"); + group.add(promptFordate); + div.add(new AttributeAppender("style", new Model("display:none"), ";")); + group.add(new AttributeAppender("style", new Model("display:none"), ";")); + div.add(group); + add(div); + List groupNames = Configuration.getSortedFieldGroupNames(); + RepeatingView fieldGroupRepeater = new RepeatingView("fieldGroupRepeater"); + add(fieldGroupRepeater); + paramsForProduct=params; + //System.out.println("paramsForProduct:"+paramsForProduct); + for (String gn : groupNames) + { + List groupfields = addFieldGroupMap.get(gn); + if (groupfields == null || gn.equalsIgnoreCase("附加信息")) + { + continue; + } + RepeatingView dataRowRepeater = new RepeatingView("dataRowRepeater"); + AbstractItem groupitem = new AbstractItem(fieldGroupRepeater.newChildId()); + groupitem.setOutputMarkupId(true); + fieldGroupRepeater.add(groupitem); + groupitem.add(dataRowRepeater); + int numOfField = 0; + List visibleFields = Lists.newArrayList(); + for (Field f : groupfields) + { + if (!f.isVisible() || !f.isEditable() || (f.getFieldType() != null && f.getFieldType().equalsIgnoreCase("auto"))) + { + continue; + } + numOfField++; + visibleFields.add(f); + } + groupitem.add(new Label("groupname", gn)); + int num_of_row = (numOfField / NUM_OF_COLUMN) + 1; + for (int i = 0; i < num_of_row; i++) + { + AbstractItem item = new AbstractItem(dataRowRepeater.newChildId()); + dataRowRepeater.add(item); + RepeatingView columnRepeater = new RepeatingView("columnRepeater"); + item.add(columnRepeater); + for (int j = 0; j < 2 * NUM_OF_COLUMN; j++) + { + AbstractItem columnitem = new AbstractItem(columnRepeater.newChildId(), new Model()); + if ((i * NUM_OF_COLUMN + j / 2) >= visibleFields.size()) + { + if ((i * NUM_OF_COLUMN + j / 2) >= visibleFields.size()) + { + continue; + } + columnitem.add(new LayoutFragment("celldatafield", "layoutFragment", this, " ").setEscapeModelStrings(false)); + columnRepeater.add(columnitem); + + continue; + } + final Field currentField = visibleFields.get(i * NUM_OF_COLUMN + j / 2); + if (currentField.getPicklist() != null) + { + if (j % 2 == 0) + { + TextFragment textField = new TextFragment("celldatafield", "textFragment", this, currentField.getDisplay() + ":"); + textField.add(new AttributeAppender("style", new Model("font-weight:bold;"), ";")); + if (currentField.getPriority() == 5) + { + String message = CRMUtility.getToolTipById(String.valueOf(currentField.getTooltip())); + textField.add(new AttributeModifier("data-content", message)); + textField.add(new AttributeAppender("class", new Model("icon-question-sign"), " ")); + textField.add(new AttributeModifier("title", currentField.getDisplay())); + textField.add(new AttributeAppender("class", new Model("tooltip-test"), " ")); + } + columnitem.add(textField); + if (currentField.isRequired()) + { + columnitem.add(new AttributeAppender("class", new Model("tag"), " ")).add(new AttributeAppender("style", new Model("color:red"), ";")); + } + else + { + columnitem.add(new AttributeAppender("class", new Model("tag"), " ")); + } + } + else + { + long default_key = 1L; + if (currentField.isExistsDefaultValue()) + { + // default_key = 0L; + } + + if (currentField.getDefault_value_type() != null && currentField.getDefault_value_type().equalsIgnoreCase("var")) + { + if (params != null) + { + if (entity.getName().toString().equals("city")) + { + Iterable splits = Splitter.on(",").split(currentField.getDefault_value()); + Iterator it = splits.iterator();; + String choiceId = it.next(); + String choiceValue = it.next(); + if (choiceId != null && params.get(choiceId.trim()) != null && params.get(choiceValue.trim()) != null) + { + default_key = Long.parseLong((params.get(choiceId.trim()).toString())); + } + } + else + { + String choiceId = currentField.getDefault_value(); + if (choiceId != null && params.get(choiceId.trim()) != null) + { + default_key = Long.parseLong(String.valueOf(params.get(choiceId.trim()))); + } + } + } + } + else if (currentField.getDefault_value_type() != null && currentField.getDefault_value_type().equalsIgnoreCase("val")) + { + default_key = Long.parseLong(currentField.getDefault_value()); + } + logger.debug("default_key:" + default_key + " name:" + currentField.getName()); + + if (currentField.getParentNode() != null || currentField.getChildNode() != null) + { + IModel selected_model = new Model(new Choice(default_key, "")); + IModel> choices_models = null; + if (currentField.getChildNode() != null && currentField.getParentNode() == null) + { + choices_models = Model.ofList(DAOImpl.queryPickList(currentField.getPicklist())); + } + + if (currentField.getParentNode() != null) + { + choices_models = new AbstractReadOnlyModel>() + { + List choices; + + @Override + public List getObject() + { + IModel pm = parentModels.get(currentField.getParentNode()); + if (pm != null) + { + choices = DAOImpl.queryPickListByFilter(currentField.getPicklist(), "parentId", String.valueOf(((Choice) pm.getObject()).getId())); + + } + else + { + choices = Lists.newArrayList(); + } + return choices; + } + + @Override + public void detach() + { + choices = null; + } + + }; + } + + DropDownChoiceFragment selector = new DropDownChoiceFragment("celldatafield", "dropDownFragment", this, choices_models, selected_model, entity, currentField); + columnitem.add(selector); + selector.setOutputMarkupId(true); + if (currentField.getParentNode() != null) + { + childDropDownComponent.put(currentField.getName(), selector); + } + + models.put(currentField.getName(), selected_model); + columnitem.add(selector); + } + else + { + List pickList = DAOImpl.queryPickList(currentField.getPicklist()); + Map list = Maps.newHashMap(); + List ids = Lists.newArrayList(); + for (Choice p : pickList) + { + if (currentField.getName().equals("product")) + { + list.put(p.getId(), p.getName()); + ids.add(p.getId()); + } + else + { + list.put(p.getId(), p.getVal()); + ids.add(p.getId()); + } + } + IModel choiceModel = new Model(default_key); + models.put(currentField.getName(), choiceModel); + columnitem.add(new DropDownChoiceFragment("celldatafield", "dropDownFragment", this, ids, list, choiceModel, entity, currentField)); + } + + } + } + else if (currentField.getDataType().equals("radio")) + { + if (j % 2 == 0) + { + columnitem.add(new TextFragment("celldatafield", "textFragment", this, currentField.getDisplay() + ":").add(new AttributeAppender("style", new Model("font-weight:bold"), ";"))); + if (currentField.isRequired()) + { + columnitem.add(new AttributeAppender("class", new Model("tag"), " ")).add(new AttributeAppender("style", new Model("color:red"), ";")); + } + else + { + columnitem.add(new AttributeAppender("class", new Model("tag"), " ")); + } + } + else + { + //new Radio("radio"); + Model visibleModel = new Model(); + List lsVisible = Arrays.asList(new String[] + { + "否", "是" + }); + RadioChoice raVisible = new RadioChoice("celldatafield", visibleModel, lsVisible).setSuffix(" "); + raVisible.setModelValue(new String[] + { + "0", "1" + }); + visibleModel.setObject("否"); + models.put(currentField.getName(), visibleModel); + columnitem.add(raVisible); + } + } + else if (currentField.getRelationTable() != null) + { + if (j % 2 == 0) + { + columnitem.add(new TextFragment("celldatafield", "textFragment", this, currentField.getDisplay() + ":").add(new AttributeAppender("style", new Model("font-weight:bold"), ";"))); + if (currentField.isRequired()) + { + columnitem.add(new AttributeAppender("class", new Model("tag"), " ")).add(new AttributeAppender("style", new Model("color:red"), ";")); + } + else + { + columnitem.add(new AttributeAppender("class", new Model("tag"), " ")); + } + } + else + { + long foreignKey = -1L; + String defaultValue = ""; + if (currentField.getDefault_value_type() != null && currentField.getDefault_value_type().equalsIgnoreCase("var")) + { + if (params != null) + { + Iterable splits = Splitter.on(",").split(currentField.getDefault_value()); + Iterator it = splits.iterator();; + String choiceId = it.next(); + String choiceValue = it.next(); + if (choiceId != null && params.get(choiceId.trim()) != null && params.get(choiceValue.trim()) != null) + { + foreignKey = Long.parseLong(String.valueOf(params.get(choiceId.trim()))); + defaultValue = String.valueOf(params.get(choiceValue.trim())); + } + } + } + IModel choiceModel = new Model(foreignKey); + String fn = ""; + if (currentField.getAlias() != null) + { + fn = currentField.getAlias(); + } + else + { + fn = currentField.getName(); + } + models.put(fn, choiceModel); + columnitem.add(new RelationTableSearchFragment("celldatafield", "relationTableSearchFragment", this, currentField.getRelationTable(), entity.getName(), defaultValue, choiceModel)); + } + } + else + { + if (j % 2 == 0) + { + columnitem.add(new TextFragment("celldatafield", "textFragment", this, currentField.getDisplay() + ":").add(new AttributeAppender("style", new Model("font-weight:bold;"), ";"))); + if (currentField.isRequired()) + { + columnitem.add(new AttributeAppender("class", new Model("tag"), " ")).add(new AttributeAppender("style", new Model("color:red"), ";")); + } + else + { + columnitem.add(new AttributeAppender("class", new Model("tag"), " ")); + } + } + else + { + //set default value + String defaultValue = ""; + + if (currentField.getDefault_value_type() != null && currentField.getDefault_value_type().equalsIgnoreCase("var")) + { + + if (params != null) + { + Object obj = params.get(currentField.getDefault_value()); + defaultValue = String.valueOf(obj); + + } + } + else if (currentField.getDefault_value_type() != null && currentField.getDefault_value_type().equalsIgnoreCase("val")) + { + + defaultValue = currentField.getDefault_value(); + } + //set the default Model + IModel defaultModel = new Model(defaultValue); + if (currentField.getDataType().equalsIgnoreCase("textarea")) + { + + columnitem.add(new TextareaFrag("celldatafield", "textAreaFragment", this, defaultModel, currentField)); + } + else if (currentField.getDataType().equalsIgnoreCase("bjgtextarea")) + { + columnitem.add(new BigtextareaFrag("celldatafield", "bjgtextAreaFragment", this, defaultModel, currentField)); + } + else if (currentField.getDataType().equalsIgnoreCase("file")) + { + models.put(currentField.getName(), defaultModel); + columnitem.add(new FileUploadFragment("celldatafield", "fileUplodeFragment", this, defaultModel)); + } + else if (currentField.getDataType().equals("datetime-local")) + { + if (defaultValue.isEmpty()||"null".equals(defaultValue)) + { + Date date = new Date(); + SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm"); + String date_value = dateformat.format(date); + defaultModel = new Model(date_value); + } + columnitem.add(new TextInputFragment("celldatafield", "textInputFragment", this, defaultModel, currentField)); + } + else + { + columnitem.add(new TextInputFragment("celldatafield", "textInputFragment", this, defaultModel, currentField)); + } + + models.put(currentField.getName(), defaultModel); + } + } + columnRepeater.add(columnitem); + } + } + } + + Form form = new Form("form"); + form.add(new Button("save") + { + @Override + public void onSubmit() + { + logger.debug(models); + Long entityId = saveEntity(models, entity, userId, userName, posId); + if (entityId<0) + { + div.add(new AttributeAppender("style", new Model("display:block"), ";")); + group.add(new AttributeAppender("style", new Model("display:block"), ";")); + if(entity.getName().equals("account")){ + promptLabel.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptLabelForAccount.add(new AttributeAppender("style", new Model("display:block"), ";")); + promptForCrmuser.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptFordate.add(new AttributeAppender("style", new Model("display:none"), ";")); + }else if (entity.getName().equals("userinfo")){ + promptLabel.add(new AttributeAppender("style", new Model("display:block"), ";")); + promptLabelForAccount.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptForCrmuser.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptFordate.add(new AttributeAppender("style", new Model("display:none"), ";")); + }else if(entity.getName().equals("crmuser")){ + promptLabel.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptLabelForAccount.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptForCrmuser.add(new AttributeAppender("style", new Model("display:block"), ";")); + promptFordate.add(new AttributeAppender("style", new Model("display:none"), ";")); + }else if(entity.getName().equals("activity")||entity.getName().equals("coaching")||entity.getName().equalsIgnoreCase("willcoaching")){ + promptLabel.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptLabelForAccount.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptForCrmuser.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptFordate.add(new AttributeAppender("style", new Model("display:block"), ";")); + } + promptButton.add(new AttributeAppender("style", new Model("display:block"), ";")); + } + else + { + if (null == createAddress) + { + String entityName=entity.getName().toString(); + if (entityName.equals("province") || entityName.equals("city")) + { + setResponsePage(PageFactory.createPageToDetail(entity.getName(), NewRecordId)); + }else if(entityName.equals("productline") || entityName.equals("product")||entityName.equals("productcategory")){ + setResponsePage(PageFactory.createPageTree(entity.getName(),NewRecordId)) ; + }else if(entityName.equalsIgnoreCase("alertattachment")){ + setResponsePage(new EntityDetailPage("alert",String.valueOf(params.get("alert.id")))); + }else{ + setResponsePage(new EntityDetailPage(entityName,String.valueOf(entityId))); + } + } + else + { + setResponsePage(new CalendarPage()); + } + } + } + }); + form.add(fieldGroupRepeater); + Button btn = new Button("saveAndNew") + { + @Override + public void onSubmit() + { + Long entityId = saveEntity(models, entity, userId, userName, posId); + if (entityId<0) + { + div.add(new AttributeAppender("style", new Model("display:block"), ";")); + group.add(new AttributeAppender("style", new Model("display:block"), ";")); + if(entity.getName().equals("account")){ + promptLabel.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptLabelForAccount.add(new AttributeAppender("style", new Model("display:block"), ";")); + promptForCrmuser.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptFordate.add(new AttributeAppender("style", new Model("display:none"), ";")); + }else if (entity.getName().equals("userinfo")){ + promptLabel.add(new AttributeAppender("style", new Model("display:block"), ";")); + promptLabelForAccount.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptForCrmuser.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptFordate.add(new AttributeAppender("style", new Model("display:none"), ";")); + }else if(entity.getName().equals("crmuser")){ + promptLabel.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptLabelForAccount.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptForCrmuser.add(new AttributeAppender("style", new Model("display:block"), ";")); + promptFordate.add(new AttributeAppender("style", new Model("display:none"), ";")); + }else if(entity.getName().equals("activity")||entity.getName().equals("coaching")||entity.getName().equalsIgnoreCase("willcoaching")){ + promptLabel.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptLabelForAccount.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptForCrmuser.add(new AttributeAppender("style", new Model("display:none"), ";")); + promptFordate.add(new AttributeAppender("style", new Model("display:block"), ";")); + } + promptButton.add(new AttributeAppender("style", new Model("display:block"), ";")); + } + else + { + setResponsePage(new CreateDataPage(entity.getName(), paramsForProduct)); + } + } + }; + if (null != createAddress) + { + btn.add(new AttributeAppender("class", new Model("hiddenStyle"), " ")); + } + form.add(btn); + form.setMultiPart(true); + add(form); + } + + public static long saveEntity(Map models, Entity entity, String userId, String userName, String posId) + { + logger.debug("the form was submitted!"); + logger.debug(models); + String fileName = ""; + String srcForFile = ""; + if(entity.getName().equals("alertattachment")){ + FileUpload fileupload = fileUploadField.getFileUpload(); + String outputfolder = CRMUtility.readFileAttribure("uploadpath"); + + java.io.File tmpDir = null; + tmpDir = Files.createTempDir(); + if (fileupload != null) + { + + fileName = fileupload.getClientFileName(); + srcForFile = fileName.split("\\.")[0] +System.currentTimeMillis()+"."+fileName.split("\\.")[1]; + String tmpFileName = outputfolder +srcForFile; + try { + fileupload.writeTo(new File(tmpFileName)); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + List fieldNames = Lists.newArrayList(); + List values = Lists.newArrayList(); + int total_score = 0; + String productlineId = "0"; + StringBuffer endDate = new StringBuffer(); + SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm"); + //找出title属性,判断实体名称,先声明 + Long daypart = 0l; + StringBuffer title = new StringBuffer(); + if (entity.getName().equals("activity")) + { + daypart = (Long) models.get("activity_daypart").getObject(); + } + String loginName = ""; + if (entity.getName().equals("userinfo")) + { + loginName = models.get("loginName").getObject().toString(); + } + for (String key : models.keySet()) + { + fieldNames.add(key); + logger.debug("currentFieldkey:" + key); + Field field = entity.getFieldByName(key); + logger.debug("currentField:" + field); + if (field.getPriority() == 5) + { + total_score += Integer.parseInt(models.get(key).getObject().toString()); + } + if (key.equals("productId") && entity.getName().toString().equals("productcategory")) + { + productlineId = DAOImpl.getTargetById("productlineId", String.valueOf(models.get(key).getObject()), "product"); + } + if (models.get(key).getObject() instanceof String) + { + if (field.getDataType().equalsIgnoreCase("datetime-local") ) + { + //if the filed has formatter, we guess the field saved in data base is in long + Date date = new Date(); + String dateTime = String.valueOf(models.get(key).getObject()); + if (entity.getName().equals("activity")) + { + if (key.equals("starttime")) + { + if (daypart == 1) + { + dateTime = dateTime.split("T")[0].concat("T08:00"); + endDate.append(dateTime.split("T")[0].concat("T11:30")); + } + else + { + dateTime = dateTime.split("T")[0].concat("T13:00"); + endDate.append(dateTime.split("T")[0].concat("T18:00")); + } + } + } + values.add("'"+String.valueOf(dateTime)+"'"); + + }else{ + values.add("'" + (String) models.get(key).getObject() + "'"); + } + + } + else if (models.get(key).getObject() instanceof Choice) + { + values.add(String.valueOf(((Choice) models.get(key).getObject()).getId())); + } + else + { + if (field.getName().equals("title")) + { + if (null == (String) models.get(key).getObject()) + { + if (entity.getName().equals("activity")) + { + title.append("拜访:"); + String callName = DAOImpl.queryRelationDataById("contact", models.get("contactId").getObject().toString()); + title.append(callName); + } + if (entity.getName().equals("coaching") || entity.getName().equals("willcoaching")) + { + title.append("辅导:"); + //获取 + CRMUser crmuser = DAOImpl.getCrmUserById(Integer.parseInt(models.get("coacheeId").getObject().toString())); + UserInfo userInfo = DAOImpl.getUserInfoByCrmuserId(crmuser.getId()); + String coacheeName = userInfo.getName(); + title.append(coacheeName); + } + values.add("'" + title.toString() + "'"); + } + else + { + values.add("'" + (String) models.get(key).getObject() + "'"); + } + }else if(key.equals("fileName")){ + values.add("'"+fileName+"'"); + } + else + { + values.add(String.valueOf(models.get(key).getObject())); + } + } + + } + //modify_datetime whenadded response_person + List autoFields = entity.getAutoFields(); + for (Field f : autoFields) + { + if (f.getName().equalsIgnoreCase("modify_datetime") || f.getName().equalsIgnoreCase("whenadded")) + { + values.add("'" + dateformat.format(new Date()) + "'"); + } + + if (f.getName().equalsIgnoreCase("owner") || f.getName().equalsIgnoreCase("modifier") + || f.getName().equalsIgnoreCase("responsible_person")) + { + values.add("'" + userName + "'"); + } + if (f.getName().equalsIgnoreCase("crmuserID")) + { + values.add("'" + posId + "'"); + } + if(f.getName().equals("srcForFile")){ + values.add("'"+srcForFile+"'"); + } + fieldNames.add(f.getName()); + + } + if (entity.getName().equals("willcoaching") || entity.getName().equals("coaching")) + { + values.add("" + total_score + ""); + fieldNames.add("total_score"); + } + else if (entity.getName().equals("activity")) + { + values.add("'" +endDate + "'"); + fieldNames.add("endtime"); + } + if (entity.getName().equals("productcategory")) + { + values.add(productlineId); + fieldNames.add("productlineId"); + } + //if entity is crmuser add loginName + if ("userinfo".equals(entity.getName())) + { + long crmuserkey = -1; + List loginNames = DAOImpl.getAllLoginNames(); + if (loginNames.contains(loginName)) + { + return crmuserkey; + } + else + { + crmuserkey = DAOImpl.createNewCrmUser(entity.getName(), fieldNames, values, posId); + return crmuserkey; + } + /*if (crmuserkey >0 ) { + UserInfo userinfo = DAOImpl.getUserById((int)crmuserkey); + // CRMUser crmuser = DAOImpl.getCrmUserById((int)crmuserkey); + //此时需发送邮件 + long crmUserCode = userinfo.getTs(); + String sendEmail = String.valueOf(models.get("email").getObject()); + //创建激活码 getUserByuserCode + //传递邮箱地址,用户code. + SendEmail.sendMail(String.valueOf(crmUserCode) + "_"+ userinfo.getId(), sendEmail); + }*/ + } + else + { + long generatedId =-1; + generatedId = DAOImpl.createNewRecord(entity.getName(), fieldNames, values, posId); + if (generatedId > 0) + { + if (entity.getName().equals("coaching") || entity.getName().equals("willcoaching")) + { + NewRecordId = DAOImpl.getCreateRecordByEntity("activity"); + DAOImpl.insert2UserRelationTable(entity.getName(), userId, posId, models.get("coacheeId").getObject().toString(), + String.valueOf(generatedId)); + } + else + { + NewRecordId = DAOImpl.getCreateRecordByEntity(entity.getName()); + DAOImpl.insert2UserRelationTable(entity.getName(), userId, posId, "string", + String.valueOf(generatedId)); + } + + } + return generatedId; + } + } + + public NewDataFormPanel(String id, IModel model) + { + super(id, model); + } + + private class TextFragment extends Fragment + { + + public TextFragment(String id, String markupId, + MarkupContainer markupProvider, String label) + { + super(id, markupId, markupProvider); + add(new Label("celldata", label)); + // TODO Auto-generated constructor stub + } + } + + private class LayoutFragment extends Fragment + { + + public LayoutFragment(String id, String markupId, + MarkupContainer markupProvider, String label) + { + super(id, markupId, markupProvider); + add(new Label("add", label)); + // TODO Auto-generated constructor stub + } + } + + private class DropDownChoiceFragment extends Fragment + { + + public DropDownChoiceFragment(String id, String markupId, + MarkupContainer markupProvider, final List ids, + final Map list, IModel model, final Entity entity, final Field currentField) + { + super(id, markupId, markupProvider); + DropDownChoice dropDownChoice = (new DropDownChoice("dropDownInput", model, ids, + new IChoiceRenderer() + { + @Override + public Object getDisplayValue(Long id) + { + // TODO Auto-generated method stub + return list.get(id); + } + + @Override + public String getIdValue(Long id, int index) + { + return String.valueOf(id); + } + })); + if (currentField.getPriority() == 5) + { + dropDownChoice.setNullValid(false); + } + else + { + dropDownChoice.setNullValid(true); + } + if (entity.getName().equals("activity") || entity.getName().equals("coaching") || entity.getName().equals("willcoaching")) + { + dropDownChoice.add(new AttributeAppender("class", new Model("required-pickList"), " ")); + } + if (currentField.getName().equals("activity_daypart")) + { + dropDownChoice.add(new AttributeModifier("id", "daypart")); + dropDownChoice.setNullValid(true); + } + add(dropDownChoice); + } + + public DropDownChoiceFragment(String id, String markupId, MarkupContainer markupProvider, + IModel choices, IModel default_model, final Entity entity, final Field currentField) + { + super(id, markupId, markupProvider); + DropDownChoice dropDown = createDropDownListFromPickList("dropDownInput", choices, default_model); + if (currentField.getName().equals("activity_type")) + { + dropDown.setNullValid(false); + } + else + { + dropDown.setNullValid(true); + } + add(dropDown); + + if (currentField.getChildNode() != null) + { + parentModels.put(currentField.getName(), default_model); + dropDown.add(new AjaxFormComponentUpdatingBehavior("onchange") + { + + @Override + protected void onUpdate(AjaxRequestTarget target) + { + target.add(childDropDownComponent.get(currentField.getChildNode())); + if (entity.getFieldByName(currentField.getChildNode()).getChildNode() != null) + { + + parentModels.get(entity.getFieldByName(currentField.getChildNode()).getName()).setObject(new Choice(-1L, "")); + target.add(childDropDownComponent.get(entity.getFieldByName(currentField.getChildNode()).getChildNode())); + // target. + } + } + }); + } + if (entity.getName().equals("activity") || entity.getName().equals("coaching") || entity.getName().equals("willcoaching")) + { + dropDown.add(new AttributeAppender("class", new Model("required-pickList"), " ")); + } + } + } + + private DropDownChoice createDropDownListFromPickList(String markupId, IModel choices, IModel default_model) + { + return new DropDownChoice(markupId, default_model, choices, + new IChoiceRenderer() + { + @Override + public Object getDisplayValue(Choice choice) + { + // TODO Auto-generated method stub + return choice.getVal(); + } + + @Override + public String getIdValue(Choice choice, int index) + { + // TODO Auto-generated method stub + return String.valueOf(choice.getId()); + } + + }); + } + + private class TextareaFrag extends Fragment + { + + public TextareaFrag(String id, String markupId, MarkupContainer markupProvider, IModel model, Field currentField) + { + super(id, markupId, markupProvider); + // TODO Auto-generated constructor stub + TextArea textArea = new TextArea("address", model); + add(textArea); + if (currentField.isRequired()) + { + textArea.add(new AttributeAppender("class", new Model("required-field"), " ")); + } + /*if(currentField.getName().equals("description")){ + textArea.add(new AttributeAppender("") + }*/ + } + } + + private class BigtextareaFrag extends Fragment + { + + public BigtextareaFrag(String id, String markupId, MarkupContainer markupProvider, IModel model, Field currentField) + { + super(id, markupId, markupProvider); + // TODO Auto-generated constructor stub + TextArea textArea = new TextArea("description", model); + add(textArea); + if (currentField.isRequired()) + { + textArea.add(new AttributeAppender("class", new Model("required-field"), " ")); + } + /*if(currentField.getName().equals("description")){ + textArea.add(new AttributeAppender("") + }*/ + } + } + + private class RelationTableSearchFragment extends Fragment + { + + public RelationTableSearchFragment(String id, String markupId, + MarkupContainer markupProvider, final String relationEntity, String entityName, final String defaultValue, final IModel defaultModel) + { + super(id, markupId, markupProvider); + PageParameters params = new PageParameters(); + params.set("en", relationEntity); + params.set("excludeName", entityName); + params.set("target", (Long) defaultModel.getObject()); + add(new BookmarkablePageLink("search_btn", SelectEntryPage.class, params)); + HiddenField hidden = new HiddenField("selected_id_hidden", defaultModel); + hidden.add(new AttributeModifier("id", relationEntity + "_id")); + add(hidden); + TextField text = new TextField("selected_value_input", new Model(defaultValue)); + text.add(new AttributeModifier("id", relationEntity + "_name")); + add(text); + } + } + + private class FileUploadFragment extends Fragment + { + + public FileUploadFragment(String id, String markupId, MarkupContainer markupProvider, IModel model) + { + super(id, markupId, markupProvider); + // TODO Auto-generated constructor stub + fileUploadField = new FileUploadField("fileUplode", model); + add(fileUploadField); + fileFields.add(fileUploadField); + } + } + + private class TextInputFragment extends Fragment + { + + public TextInputFragment(String id, String markupId, + MarkupContainer markupProvider, IModel model, Field currentField) + { + super(id, markupId, markupProvider); + TextField text = new TextField("input", model); + + if (currentField.getDataType().equals("tel") || currentField.getDataType().equals("fax")) + { + text.add(new AttributeModifier("pattern", new Model("^((\\d{11})|^((\\d{7,8})|(\\d{4}|\\d{3})-(\\d{7,8})|(\\d{4}|\\d{3})-(\\d{7,8})-(\\d{4}|\\d{3}|\\d{2}|\\d{1})|(\\d{7,8})-(\\d{4}|\\d{3}|\\d{2}|\\d{1}))$)"))); + } + if (currentField.isRequired()) + { + text.add(new AttributeAppender("class", new Model("required-field"), " ")); + } + if (currentField.getName().equals("title")) + { + text.add(new AttributeModifier("placeholder", "系统可自动生成")); + } + if (currentField.getDataType().equals("datetime-local")) + { + text.add(new AttributeModifier("value", new Model((String) model.getObject()))); + + } + if (currentField.getDataType().equalsIgnoreCase("number")) + { + text.add(new AttributeModifier("value", new Model("0"))); + } + add(text); + text.add(new AttributeModifier("type", new Model(currentField.getDataType()))); + + text.add(new AttributeModifier("id", new Model(currentField.getName()))); + + } + } + +} diff --git a/crm/src/main/java/com/rex/crm/common/NoPermissionPage.html b/crm/src/main/java/com/rex/crm/common/NoPermissionPage.html new file mode 100644 index 0000000..501cffe --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/NoPermissionPage.html @@ -0,0 +1,21 @@ + + + + + +
+ + +
+
+ + diff --git a/crm/src/main/java/com/rex/crm/common/NoPermissionPage.java b/crm/src/main/java/com/rex/crm/common/NoPermissionPage.java new file mode 100644 index 0000000..eb5fc64 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/NoPermissionPage.java @@ -0,0 +1,27 @@ +package com.rex.crm.common; + +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.apache.wicket.Component; +import org.apache.wicket.Page; +import org.apache.wicket.behavior.AbstractAjaxBehavior; +import org.apache.wicket.markup.head.IHeaderResponse; +import org.apache.wicket.markup.head.OnDomReadyHeaderItem; +import org.apache.wicket.request.mapper.parameter.PageParameters; + +import com.rex.crm.TemplatePage; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.util.Configuration; + +public class NoPermissionPage extends TemplatePage { + private static final Logger logger = Logger.getLogger(NoPermissionPage.class); + private static final long serialVersionUID = -2613412283023068638L; + + public NoPermissionPage(){ + this.setPageTitle("无权限读取"); + + } + +} diff --git a/crm/src/main/java/com/rex/crm/common/PageableTablePanel.html b/crm/src/main/java/com/rex/crm/common/PageableTablePanel.html new file mode 100644 index 0000000..88eed75 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/PageableTablePanel.html @@ -0,0 +1,69 @@ + + +
+
+ + 我的 + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + + + + + + + +
\ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/common/PageableTablePanel.java b/crm/src/main/java/com/rex/crm/common/PageableTablePanel.java new file mode 100644 index 0000000..b864f35 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/PageableTablePanel.java @@ -0,0 +1,380 @@ +package com.rex.crm.common; + +import java.io.File; +import java.io.IOException; +import java.io.Serializable; +import java.lang.reflect.InvocationTargetException; +import java.net.HttpRetryException; +import java.nio.charset.Charset; +import java.util.List; +import java.util.Map; + +import javax.servlet.http.HttpServletResponse; +import javax.xml.bind.JAXBException; + +import org.apache.log4j.Logger; +import org.apache.wicket.MarkupContainer; +import org.apache.wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigator; +import org.apache.wicket.behavior.AttributeAppender; +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.link.DownloadLink; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.markup.html.list.AbstractItem; +import org.apache.wicket.markup.html.list.ListItem; +import org.apache.wicket.markup.html.list.PageableListView; +import org.apache.wicket.markup.html.navigation.paging.PagingNavigator; +import org.apache.wicket.markup.html.panel.Fragment; +import org.apache.wicket.markup.html.panel.Panel; +import org.apache.wicket.markup.repeater.RepeatingView; +import org.apache.wicket.model.AbstractReadOnlyModel; +import org.apache.wicket.model.IModel; +import org.apache.wicket.model.Model; +import org.apache.wicket.request.IRequestCycle; +import org.apache.wicket.request.handler.resource.ResourceStreamRequestHandler; +import org.apache.wicket.request.resource.ContentDisposition; +import org.apache.wicket.util.encoding.UrlEncoder; +import org.apache.wicket.util.file.Files; +import org.apache.wicket.util.resource.FileResourceStream; +import org.apache.wicket.util.resource.IResourceStream; + +import com.google.common.base.Charsets; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.rex.crm.AccountPage; +import com.rex.crm.ActivitySelectPage; +import com.rex.crm.SignIn2Session; +//import com.rex.crm.common.EntityDetailPanel.DetailLinkFragment; +import com.rex.crm.dataport.DataExporter; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.db.model.Activity; +import com.rex.crm.util.CRMUtility; +import com.rexen.crm.integration.DataAccessObject; +import com.rexen.crm.integration.DataExport; +import com.rexen.crm.integration.DataExportDelegate; + +public class PageableTablePanel extends Panel { + private static final long serialVersionUID = 2501105233172820074L; + private static final Logger logger = Logger.getLogger(PageableTablePanel.class); + + public PageableTablePanel(String id, final Entity entity, final List mapList,final Map params) { + super(id); + + add(new Label("table_title",entity.getDisplay())); + // TODO Get the table definition from database or configuration + final String primaryKeyName = entity.getPrimaryKeyName(); + final List fields = entity.getFields(); + final List fn = entity.getFieldNames(); + final String entityName = entity.getName(); + final int roleId = ((SignIn2Session)getSession()).getRoleId(); + + // RepeatingView dataRowRepeater = new RepeatingView("dataRowRepeater"); + // add(dataRowRepeater); + + final Map tableData = Maps.newHashMap(); + List ids = Lists.newArrayList(); + for (Map map : (List) mapList) { + String key = String.valueOf(map.get("id")); + ids.add(key); + tableData.put(key, map); + } + + final WebMarkupContainer datacontainer = new WebMarkupContainer("data"); + datacontainer.setOutputMarkupId(true); + add(datacontainer); + + // set column name + RepeatingView columnNameRepeater = new RepeatingView("columnNameRepeater"); + datacontainer.add(columnNameRepeater); + int count=0; + for (Field f : entity.getFields()) { + if (!f.isVisible()|| f.getPriority() >1) + continue; + AbstractItem item = new AbstractItem(columnNameRepeater.newChildId()); + if(count==0){ + item.add(new AttributeAppender("class", new Model("table-first-link"), " ")); + count++; + } + columnNameRepeater.add(item); + item.add(new Label("columnName", f.getDisplay())); + } + // end of set column name + final PageableListView listview = new PageableListView("dataRowRepeater", ids, 15) { + + @Override + protected void populateItem(ListItem item) { + String key = item.getDefaultModelObjectAsString(); + RepeatingView columnRepeater = new RepeatingView("columnRepeater"); + Map map = tableData.get(key); + item.add(columnRepeater); + final String rowId = String.valueOf(map.get(primaryKeyName)); + for (Field f : fields) { + if (!f.isVisible() || f.getPriority() >1) + continue; + AbstractItem columnitem = new AbstractItem(columnRepeater.newChildId(), new Model() { + @Override + public Serializable getObject() { + Param p = new Param(); + p.setId(rowId); + p.setEntityName(entityName); + return p; + } + + }); + if (f.isDetailLink()) { + + String value = CRMUtility.formatValue(f.getFormatter(), String.valueOf(map.get(f.getName()))); + if(value.equals("null")||value.isEmpty()){ + value = "无"; + } + columnitem.add(new DetailLinkFragment("celldata", "detailFragment", this.getParent().getParent(), value,entity)); + columnitem.add(new AttributeAppender("class", new Model("table-first-link"), " ")); +// columnitem.add(new ButtonFragment("celldata","buttonFragment",this,"鍒犻櫎")); + } else { + if (f.getPicklist() != null) { + // get option from picklist + String value = CRMUtility.formatValue(f.getFormatter(), DAOImpl.queryPickListByIdCached(f.getPicklist(), String.valueOf(map.get(f.getName())))); + if(value.equals("null")||value.isEmpty()){ + value = "无"; + } + columnitem.add(new Label("celldata", value)); + } else if(f.getRelationTable() != null){ + String value = CRMUtility.formatValue(f.getFormatter(), DAOImpl.queryCachedRelationDataById(f.getRelationTable(), String.valueOf(map.get(f.getName())))); + if(value.equals("null")||value.isEmpty()){ + value = "无"; + } + if (roleId==1 ) { + if(!value.equals("无")){ + columnitem.add(new DetailLinkFragment("celldata", "detailFragment", this.getParent().getParent(),value,f.getRelationTable(),String.valueOf(map.get(f.getName())))); + }else{ + columnitem.add(new Label("celldata", value)); + } + + }else{ + if(!f.getRelationTable().equalsIgnoreCase("crmuser")){ + if(!value.equals("无")){ + columnitem.add(new DetailLinkFragment("celldata", "detailFragment", this.getParent().getParent(),value,f.getRelationTable(),String.valueOf(map.get(f.getName())))); + }else{ + columnitem.add(new Label("celldata", value)); + } + }else{ + columnitem.add(new Label("celldata", value)); + } + } + + }else { + + String value = CRMUtility.formatValue(f.getFormatter(), String.valueOf(map.get(f.getName()))); + final String filepath = CRMUtility.formatValue(f.getFormatter(), String.valueOf(map.get(f.getName()))); + + if(f.getDataType().equalsIgnoreCase("downloadlink")){ + columnitem.add(new DownloadLinkFragment("celldata", "downloadlinkFragment", this.getParent().getParent(), value)); + + }else{ + if(value.equals("null")||value.isEmpty()){ + value = "无"; + } + columnitem.add(new Label("celldata", value)); + } + } + } + columnRepeater.add(columnitem); + } + + } + }; + + datacontainer.add(listview); + //PagingNavigator nav = new PagingNavigator("navigator", listview); + AjaxPagingNavigator nav =new AjaxPagingNavigator("navigator", listview); + nav.setOutputMarkupId(true); + + datacontainer.add(nav); + datacontainer.setVersioned(false); + + ICRUDActionListener actionListener = new DefaultCRUDActionListener(){ + @Override + public void create() { + if(entity.getName().equals("coaching")){ + setResponsePage(new ActivitySelectPage()); + }else{ + setResponsePage(new CreateDataPage(entity.getName(),params)); + } + } + @Override + + public void downLoadBtn() throws Exception { + String exported_filename = null; + try { + exported_filename = DataExporter.export(entity.getName(), mapList); + } catch (Exception e) { + logger.debug("failed to export file for " + entity.getName(), e); + } + if (exported_filename != null) { + + final File file = new File(exported_filename); + String filename=""; + if(entity.getName().equalsIgnoreCase("crmuser")){ + filename="岗位信息"; + }else if(entity.getName().equalsIgnoreCase("account")){ + filename="医院"; + }else if(entity.getName().equalsIgnoreCase("contact")){ + filename="医生"; + }else if(entity.getName().equalsIgnoreCase("userinfo")){ + filename="用户"; + }else if(entity.getName().equalsIgnoreCase("activity")){ + filename="活动"; + } + + String display_fileName = UrlEncoder.QUERY_INSTANCE.encode("导出_"+filename+".zip", Charset.forName("UTF-8")); + + IResourceStream resourceStream = new FileResourceStream(new org.apache.wicket.util.file.File(file)); + getRequestCycle().scheduleRequestHandlerAfterCurrent(new ResourceStreamRequestHandler(resourceStream) { + @Override + public void respond(IRequestCycle requestCycle) { + super.respond(requestCycle); + Files.remove(file); + } + }.setFileName(display_fileName).setContentDisposition(ContentDisposition.ATTACHMENT)); + + } else { + logger.debug("Failed to export file for:" + entity.getName()); + + } + + + } + @Override + public void merge() { + // TODO Auto-generated method stub + setResponsePage(new MergePage()); + + } + @Override + public void ineffective() { + // TODO Auto-generated method stub + + } + }; + + add(new CRUDPanel("operationBar",entity.getName(),null, CRMUtility.getPermissionOfEntityList(roleId,entity.getName()),actionListener)); + + //add(new NewDataFormPanel("formPanel",entity,null)); + + } + + public PageableTablePanel(String id, IModel model) { + super(id, model); + } + + + private class DownloadLinkFragment extends Fragment { + public DownloadLinkFragment( String id, String markupId, MarkupContainer markupProvider,final String filename) { + super(id, markupId, markupProvider); + final File tempFile = new File(filename); + DownloadLink downloadlink = new DownloadLink("downloadlink", + new AbstractReadOnlyModel(){ + + @Override + public File getObject() { + + + return tempFile; + } + + },tempFile.getName()); + downloadlink.add(new Label("fn",tempFile.getName())); + + add(downloadlink); + + } + + } + + private class DetailLinkFragment extends Fragment { + + public DetailLinkFragment(String id, String markupId, MarkupContainer markupProvider, String name,final String entityName ,final String eid) { + super(id, markupId, markupProvider); +// final String str = DAOImpl.queryEntityByName(caption); + add(new Link("detailclick") { + @Override + public void onClick() { + + setResponsePage(new EntityDetailPage(entityName, eid)); + } + }.add(new Label("caption", new Model(name)))); + } + public DetailLinkFragment( String id, String markupId, MarkupContainer markupProvider, String caption, final Entity entity) { + super(id, markupId, markupProvider); + add(new Link("detailclick") { + + @Override + public void onClick() { + Param p = (Param) getParent().getParent().getDefaultModelObject(); + System.out.println(p + " id:" + p.getId() + " name:" + p.getEntityName()); + String entityName = p.getEntityName(); + if(entity.getName().equals("coaching")){ + Activity coaching = DAOImpl.getActivityById(Integer.parseInt(p.getId())); + if(coaching.getActivity_coachType()==2){ + entityName = "willcoaching"; + } + }else if(entityName.equals("todolist") ){ + entityName = "activity"; + }else if(entityName.equals("todolistcoach") ){ + entityName = "coaching"; + } + setResponsePage(new EntityDetailPage(entityName, p.getId())); + } + }.add(new Label("caption", new Model(caption)))); + } + } + +// private class DetailLinkFragment extends Fragment { +// /** +// * Construct. +// * +// * @param id +// * The component Id +// * @param markupId +// * The id in the markup +// * @param markupProvider +// * The markup provider +// */ +// public DetailLinkFragment( String id, String markupId, MarkupContainer markupProvider, String caption, final Entity entity) { +// super(id, markupId, markupProvider); +// add(new Link("detailclick") { +// +// @Override +// public void onClick() { +// Param p = (Param) getParent().getParent().getDefaultModelObject(); +// System.out.println(p + " id:" + p.getId() + " name:" + p.getEntityName()); +// String entityName = p.getEntityName(); +// if(entity.getName().equals("coaching")){ +// Activity coaching = DAOImpl.getActivityById(Integer.parseInt(p.getId())); +// if(coaching.getActivity_coachType()==2){ +// entityName = "willcoaching"; +// } +// }else if(entityName.equals("todolist") ){ +// entityName = "activity"; +// }else if(entityName.equals("todolistcoach") ){ +// entityName = "coaching"; +// } +// setResponsePage(new EntityDetailPage(entityName, p.getId())); +// } +// }.add(new Label("caption", new Model(caption)))); +// } +// +// } + private class ButtonFragment extends Fragment{ + + public ButtonFragment(String id, String markupId, + MarkupContainer markupProvider, String delmas) { + super(id, markupId, markupProvider); + // TODO Auto-generated constructor stub + + } + + + + } +} diff --git a/crm/src/main/java/com/rex/crm/common/Param.java b/crm/src/main/java/com/rex/crm/common/Param.java new file mode 100644 index 0000000..a218339 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/Param.java @@ -0,0 +1,34 @@ +package com.rex.crm.common; + +import java.io.Serializable; + +public class Param implements Serializable{ + private String id; + private String entityName; + private String extraId; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getEntityName() { + return entityName; + } + + public void setEntityName(String entityName) { + this.entityName = entityName; + } + + public String getExtraId() { + return extraId; + } + + public void setExtraId(String extraId) { + this.extraId = extraId; + } + +} diff --git a/crm/src/main/java/com/rex/crm/common/Reaction.java b/crm/src/main/java/com/rex/crm/common/Reaction.java new file mode 100644 index 0000000..ea53749 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/Reaction.java @@ -0,0 +1,39 @@ +package com.rex.crm.common; + +public class Reaction { + + private String name; + private String url; + private String display; + private String paramName; + + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public String getUrl() { + return url; + } + public void setUrl(String url) { + this.url = url; + } + public String getDisplay() { + return display; + } + public void setDisplay(String display) { + this.display = display; + } + public String getParamName() { + return paramName; + } + public void setParamName(String paramName) { + this.paramName = paramName; + } + + + + +} diff --git a/crm/src/main/java/com/rex/crm/common/Relation.java b/crm/src/main/java/com/rex/crm/common/Relation.java new file mode 100644 index 0000000..8701d77 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/Relation.java @@ -0,0 +1,90 @@ +package com.rex.crm.common; + +import java.io.Serializable; +import java.util.List; + +import com.google.gson.Gson; + +public class Relation implements Serializable{ + private String name; + private String display; + private String from; + private String to; + private String sql; + private String sql_admin; + private String sql_manager; + private List reactions; + + public String getSql_admin() { + return sql_admin; + } + + public void setSql_admin(String sql_admin) { + this.sql_admin = sql_admin; + } + + public String getSql_manager() { + return sql_manager; + } + + public void setSql_manager(String sql_manager) { + this.sql_manager = sql_manager; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDisplay() { + return display; + } + + public void setDisplay(String display) { + this.display = display; + } + + + public String getSql() { + return sql; + } + + public void setSql(String sql) { + this.sql = sql; + } + + public String getFrom() { + return from; + } + + public void setFrom(String from) { + this.from = from; + } + + public String getTo() { + return to; + } + + public void setTo(String to) { + this.to = to; + } + + @Override + public String toString() { + Gson gson = new Gson(); + return gson.toJson(this, Relation.class); + } + + public List getReactions() { + return reactions; + } + + public void setReactions(List reactions) { + this.reactions = reactions; + } + + +} diff --git a/crm/src/main/java/com/rex/crm/common/RelationDataPanel.html b/crm/src/main/java/com/rex/crm/common/RelationDataPanel.html new file mode 100644 index 0000000..d949a9a --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/RelationDataPanel.html @@ -0,0 +1,19 @@ + + +
+ + +    + +
+
+ +
+
\ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/common/RelationDataPanel.java b/crm/src/main/java/com/rex/crm/common/RelationDataPanel.java new file mode 100644 index 0000000..06b2776 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/RelationDataPanel.java @@ -0,0 +1,77 @@ +package com.rex.crm.common; + +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import javax.mail.Session; + +import org.apache.wicket.behavior.AttributeAppender; +import org.apache.wicket.markup.ComponentTag; +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.link.BookmarkablePageLink; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.markup.html.list.AbstractItem; +import org.apache.wicket.markup.html.panel.Panel; +import org.apache.wicket.markup.repeater.RepeatingView; +import org.apache.wicket.model.Model; +import org.apache.wicket.request.mapper.parameter.PageParameters; + +import com.google.common.collect.Maps; +import com.rex.crm.SearchCRMUserPage; +import com.rex.crm.SearchContactPage; +import com.rex.crm.SignIn2Session; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.util.Configuration; + + + +public class RelationDataPanel extends Panel { + + + public RelationDataPanel( String id, Relation relation, String entityName,List list,final String entityId,final Map params) { + super(id); + + + WebMarkupContainer divC = new WebMarkupContainer("collapseDiv"); + divC.setOutputMarkupId(true); + add(divC); + + final String collapseId = divC.getMarkupId(); + Entity entity = Configuration.getEntityByName(relation.getTo()); + divC.add(new PageableTablePanel("tableData",entity,list,params)); + + + RepeatingView btn_repeater = new RepeatingView("btn_repeater"); + add(btn_repeater); + + List reactions = relation.getReactions(); + if(reactions!=null){ + + for(Reaction act:reactions){ + AbstractItem item = new AbstractItem(btn_repeater.newChildId()); + btn_repeater.add(item); + final PageParameters pars = new PageParameters(); +// pars.set("entityName", relation.getTo()); + pars.set("cid", entityId); + pars.set("entityname",entityName); + //System.out.println("PPPPPP:"+act.getParamName()); + if(act.getParamName()!=null && !act.getParamName().isEmpty()){ + pars.set(act.getParamName(),entityId); + } +// if(roleId == 3){ +// WebMarkupContainer con = new WebMarkupContainer("actionlink"); +// con.add(new AttributeAppender("class", "")); +// con.add(new WebMarkupContainer("cap")); +// item.add(con); +// }else{ + BookmarkablePageLink link = new BookmarkablePageLink("actionlink", SearchCRMUserPage.class,pars); + link.add(new Label("cap",act.getDisplay())); + item.add(link); +// } + } + } + } + +} diff --git a/crm/src/main/java/com/rex/crm/common/TableDataPanel.html b/crm/src/main/java/com/rex/crm/common/TableDataPanel.html new file mode 100644 index 0000000..641d3c1 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/TableDataPanel.html @@ -0,0 +1,62 @@ + + + +
+
+ +
+ +
我的
+
+ [operation bar] +
+
+ + + + + + + + + + + + +
+ + + +
+
+
+
+ + +
\ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/common/TableDataPanel.java b/crm/src/main/java/com/rex/crm/common/TableDataPanel.java new file mode 100644 index 0000000..0c59c56 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/TableDataPanel.java @@ -0,0 +1,169 @@ +package com.rex.crm.common; + +import java.io.Serializable; +import java.util.EnumSet; +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.apache.wicket.MarkupContainer; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.markup.html.list.AbstractItem; +import org.apache.wicket.markup.html.panel.Fragment; +import org.apache.wicket.markup.html.panel.Panel; +import org.apache.wicket.markup.repeater.RepeatingView; +import org.apache.wicket.model.IModel; +import org.apache.wicket.model.Model; + +import com.rex.crm.CreateEventPage; +import com.rex.crm.beans.Account; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.util.CRMUtility; +import com.rex.crm.util.Configuration; + +public class TableDataPanel extends Panel { + private static final long serialVersionUID = 2501105233172820074L; + private static final Logger logger = Logger.getLogger(TableDataPanel.class); + + public TableDataPanel(String id,final Entity entity, List mapList) { + super(id); + + //TODO Get the table definition from database or configuration + String primaryKeyName = entity.getPrimaryKeyName(); + List fields = entity.getFields(); + List fn = entity.getFieldNames(); + final String entityName = entity.getName(); + + //set column name + RepeatingView columnNameRepeater = new RepeatingView("columnNameRepeater"); + add(columnNameRepeater); + for(Field f:entity.getFields()){ + if(!f.isVisible()) continue; + AbstractItem item = new AbstractItem(columnNameRepeater.newChildId()); + columnNameRepeater.add(item); + item.add(new Label("columnName",f.getDisplay())); + } + //end of set column name + + RepeatingView dataRowRepeater = new RepeatingView("dataRowRepeater"); + add(dataRowRepeater); + + for (int i = 0; i < mapList.size(); i++) + { + Map map = (Map)mapList.get(i); + AbstractItem item = new AbstractItem(dataRowRepeater.newChildId()); + dataRowRepeater.add(item); + RepeatingView columnRepeater = new RepeatingView("columnRepeater"); + item.add(columnRepeater); + final String rowId = String.valueOf(map.get(primaryKeyName)); + for(Field f:fields){ + if(!f.isVisible()) continue; + //AbstractItem columnitem = new AbstractItem(columnRepeater.newChildId(), new Model(String.valueOf(map.get(primaryKeyName)))); + AbstractItem columnitem = new AbstractItem(columnRepeater.newChildId(), new Model(){ + + @Override + public Serializable getObject() { + Param p = new Param(); + p.setId(rowId); + p.setEntityName(entityName); + return p; + } + + }); + if(f.isDetailLink()){ + String value = CRMUtility.formatValue(f.getFormatter(),String.valueOf(map.get(f.getName()))); + columnitem.add(new DetailLinkFragment("celldata","detailFragment",this,value)); + }else{ + if(f.getPicklist()!=null){ + //get option from picklist + String value = CRMUtility.formatValue(f.getFormatter(),DAOImpl.queryPickListByIdCached(f.getPicklist(), String.valueOf(map.get(f.getName())))); + columnitem.add(new Label("celldata",value)); + + }else if(f.getRelationTable() != null){ + String value = CRMUtility.formatValue(f.getFormatter(),DAOImpl.queryCachedRelationDataById(f.getRelationTable(), String.valueOf(map.get(f.getName())))); + columnitem.add(new Label("celldata",value)); + }else{ + String value = CRMUtility.formatValue(f.getFormatter(),String.valueOf(map.get(f.getName()))); + columnitem.add(new Label("celldata",value)); + } + } + //columnitem.add(new Label("celldata",String.valueOf(fn.get(j).getClass().cast(map.get(fn.get(j)))))); + columnRepeater.add(columnitem); + } + } + + ICRUDActionListener actionListener = new DefaultCRUDActionListener(){ + @Override + public void create() { + if(entity.getName().equals("activity")){ + setResponsePage(new CreateEventPage(1)); + }else{ + setResponsePage(new CreateDataPage(entity.getName(),null)); + } + } + + @Override + public void merge() { + // TODO Auto-generated method stub + + } + + @Override + public void ineffective() { + // TODO Auto-generated method stub + + } + + + }; + + add(new CRUDPanel("operationBar",entityName,null,EnumSet.of(CRUDPanel.Permissions.ADD),actionListener)); + + + add(new NewDataFormPanel("formPanel",entity,null)); + + } + + + public TableDataPanel(String id, IModel model) { + super(id, model); + } + + + private class DetailLinkFragment extends Fragment + { + /** + * Construct. + * + * @param id + * The component Id + * @param markupId + * The id in the markup + * @param markupProvider + * The markup provider + */ + public DetailLinkFragment(String id, String markupId, MarkupContainer markupProvider,String caption) + { + super(id, markupId, markupProvider); + add(new Link("detailclick") + { + + @Override + public void onClick() + { + //System.out.println(getParent().getId()); + // System.out.println("this link is clicked!"+this.getParent().getParent().getDefaultModelObject()); + //Account selected = (Account)getParent().getDefaultModelObject(); + Param p = (Param)getParent().getParent().getDefaultModelObject(); + logger.debug(p+ " id:"+p.getId() + " name:"+p.getEntityName()); + setResponsePage(new EntityDetailPage(p.getEntityName(),p.getId())); + + //setResponsePage(new AccountDetailPage(id)); + } + }.add(new Label("caption", new Model(caption)))); + } + } + + +} diff --git a/crm/src/main/java/com/rex/crm/common/TeamManPanel.html b/crm/src/main/java/com/rex/crm/common/TeamManPanel.html new file mode 100644 index 0000000..c628ef1 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/TeamManPanel.html @@ -0,0 +1,84 @@ + + + +
+
+
+
+
+ +
+
+ 添加 +
+
+ 删除 +
+ + + +
+
+
+ + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +
+
+
+ + + +
+
+
+
+ + +
\ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/common/TeamManPanel.java b/crm/src/main/java/com/rex/crm/common/TeamManPanel.java new file mode 100644 index 0000000..a7d8042 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/TeamManPanel.java @@ -0,0 +1,616 @@ +package com.rex.crm.common; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.List; +import java.util.Map; + +import javax.mail.Session; + +import org.apache.log4j.Logger; +import org.apache.wicket.MarkupContainer; +import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.markup.ComponentTag; +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.Check; +import org.apache.wicket.markup.html.form.CheckGroup; +import org.apache.wicket.markup.html.form.CheckGroupSelector; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.form.SubmitLink; +import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.markup.html.list.AbstractItem; +import org.apache.wicket.markup.html.list.ListItem; +import org.apache.wicket.markup.html.list.PageableListView; +import org.apache.wicket.markup.html.panel.Fragment; +import org.apache.wicket.markup.html.panel.Panel; +import org.apache.wicket.markup.repeater.RepeatingView; +import org.apache.wicket.model.IModel; +import org.apache.wicket.model.Model; +import org.apache.wicket.model.PropertyModel; +import org.apache.wicket.request.mapper.parameter.PageParameters; +import org.apache.wicket.ajax.markup.html.AjaxLink; +import org.apache.wicket.behavior.AttributeAppender; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.rex.crm.SearchCRMUserPage; +import com.rex.crm.SignIn2Session; +import com.rex.crm.admin.AdminTreePage; +import com.rex.crm.admin.PositionTreePage; +import com.rex.crm.beans.Account; +import com.rex.crm.beans.AccountCRMUserRelation; +import com.rex.crm.beans.CRMUser; +import com.rex.crm.beans.UserPosition; +//import com.rex.crm.common.EntityDetailPanel.DetailLinkFragment; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.db.model.Activity; +import com.rex.crm.util.CRMUtility; +import com.rex.crm.util.Configuration; + +import org.apache.wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigator; + +public class TeamManPanel extends Panel { + private static final long serialVersionUID = 2501105233172820074L; + private static final Logger logger = Logger.getLogger(TeamManPanel.class); + private String etId; + private String currentEntityName; + List selectedRowIds = Lists.newArrayList(); + public List fieldsd; + public TeamManPanel(String id,final String en,final String entityId,final int type) { + super(id); + etId = entityId; + currentEntityName = en; + final int roleId = ((SignIn2Session)getSession()).getRoleId(); + final String userId = ((SignIn2Session)getSession()).getUserId(); + final String user = ((SignIn2Session)getSession()).getUser(); + final String positionId = ((SignIn2Session)getSession()).getPositionId(); + //team sql + String teamSql = ""; + if(en.equalsIgnoreCase("account")){ + if(type == 0){ + //for the 岗位列表 + if(roleId==1){ + teamSql = "select * from (select crmuser . *, accountcrmuser.id as rid,userinfo.name as userInfoName , role.name as permission from crmuser left join accountcrmuser ON crmuser.id = accountcrmuser.crmuserId left join user_position on user_position.positionId = accountcrmuser.crmuserId inner join userinfo on userinfo.id = user_position.userId left join role on crmuser.role = role.id where accountcrmuser.accountId = ?) as atable"; + }else if(roleId==2){ + teamSql = "select * from (select crmuser . *, accountcrmuser.id as rid,userinfo.name as userInfoName , role.name as permission from crmuser left join accountcrmuser ON crmuser.id = accountcrmuser.crmuserId left join user_position on user_position.positionId = accountcrmuser.crmuserId inner join userinfo on userinfo.id = user_position.userId left join role on crmuser.role = role.id where accountcrmuser.accountId = ? and crmuser.reportto = "+positionId+") as atable"; + }else{ + teamSql = "select * from (select crmuser . *, accountcrmuser.id as rid,userinfo.name as userInfoName , role.name as permission from crmuser left join accountcrmuser ON crmuser.id = accountcrmuser.crmuserId left join user_position on user_position.positionId = accountcrmuser.crmuserId inner join userinfo on userinfo.id = user_position.userId left join role on crmuser.role = role.id where accountcrmuser.accountId = ? and crmuser.id ="+positionId+") as atable"; + } + + } +// else if (type == 1){ +// //for the 用户列表 +// teamSql = "select * from userinfo inner join (select a.id as aid, b.id as rid from crmuser as a inner join accountcrmuser as b ON a.id = b.crmuserId where b.accountId = ?) as c on userinfo.positionId = c.aid"; +// } + }else if(en.equalsIgnoreCase("contact")){ + if(type == 0){ + //for the 岗位列表 + teamSql = "select * from (select a . *, b.id as rid,c.name as userInfoName from crmuser as a left join contactcrmuser as b ON a.id = b.crmuserId inner join userinfo as c on c.positionId = b.crmuserId where b.contactId = ?) as atable"; + } +// else if (type == 1){ +// //for the 用户列表 +// teamSql = "select * from userinfo inner join (select a.id as aid, b.id as rid from crmuser as a inner join contactcrmuser as b ON a.id = b.crmuserId where b.contactId = ?) as c on userinfo.positionId = c.aid"; +// } + }else if(en.equalsIgnoreCase("userInfo")){ + if(type == 0){ + //for the 岗位列表 + // teamSql = "select * from (select user_position.status,crmuser.name as positionId,userInfo.name as userId from user_position left join crmuser on user_position.positionId = crmuser.id left join userInfo on userInfo.id = user_position.userId where userId = ?) as atable"; + + // teamSql = "select * from (select user_position.status,crmuser.name as positionId,userInfo.name as userId " + + // "from user_position left join crmuser on user_position.positionId = crmuser.id left join userInfo on userInfo.id = user_position.userId where userId = ?) as atable"; + + teamSql = "select * from (select a.*,b.id as rid from account as a left join accountcrmuser as b on a.id=b.accountId left join user_position on user_position.positionId = b.crmuserId left join userinfo on userinfo.id = user_position.id where b.crmuserId=?) as atable"; + } + else if (type == 2){ +// //for the 用户岗位 + teamSql = "select * from (select user_position.* ,user_position.id as rid,userinfo.name as name from userinfo inner join user_position on user_position.userId = userinfo.id inner join crmuser on crmuser.id = user_position.positionId where userinfo.id = ? ) as atable"; + } + }else if(en.equalsIgnoreCase("crmuser")){ + if(type == 0){ + //for the 医院列表 + teamSql = "select * from (select a.*,b.id as rid from account as a left join accountcrmuser as b on a.id=b.accountId where b.crmuserId=? ) as atable"; + }else if(type == 1){ + //for the 医生列表 + teamSql = "select * from (select contact . * from contact left join accountcrmuser on accountcrmuser.accountId=contact.accountId where accountcrmuser.crmuserId = ?) as atable"; + } + else if (type == 2){ + //for the 用户列表 + teamSql = "select * from (select userinfo.*,user_position.id as rid ,userinfo.name as username ,user_position.status as status , crmuser.name as positionId,role.val as crmuserRole from user_position left join userInfo on userInfo.id = user_position.userId left join crmuser on crmuser.id = user_position.positionId left join role on role.id = crmuser.role where user_position.positionId = ? order by user_position.whenadded DESC limit 1 ) as atable"; + //+ "select * from (select userinfo.*,user_position.status as status from user_position left join userInfo on userInfo.id = user_position.userId where user_position.positionId = ? ) as atable"; + } + else if (type == 3){ + //for the 下属岗位 + teamSql = "select * from (select crmuser.*,crmuser.id as rid ,userInfo.name as userInfoName ,role.name as permission from crmuser left join user_position on user_position.positionId = crmuser.id left join userInfo on userInfo.id = user_position.userId left join role on crmuser.role = role.name where reportto = ? ) as atable"; + }else if (type == 4){ + //for the 区域管理 teamSql = "select regionManage。* from user_position_query where " + getCondition(Integer.parseInt(entityId)); + teamSql = "select user_position_query.* from user_position_query where " + getCondition(Integer.parseInt(entityId)); + } + } + List mapList = new ArrayList(); + if(type ==4){ + mapList = DAOImpl.queryEntityRelationList(teamSql); + } else { + mapList = DAOImpl.queryEntityRelationList(teamSql, entityId); + } + Entity entity=null ; + if(en.equalsIgnoreCase("account")||en.equalsIgnoreCase("contact")){ + if(type == 0){ + entity = Configuration.getEntityByName("crmuser"); + add(new Label("title","岗位")); + }else if(type == 1){ + entity = Configuration.getEntityByName("userinfo"); + add(new Label("title","用户")); + } + } + else if(en.equalsIgnoreCase("userInfo")){ + entity = Configuration.getEntityByName("user_position"); + add(new Label("title"," 用户岗位关系")); + } + else{ + if(type == 0){ + entity = Configuration.getEntityByName("account"); + add(new Label("title","医院")); + }else if(type == 1){ + entity = Configuration.getEntityByName("contact"); + add(new Label("title","医生")); + } + else if (type == 2){ + entity = Configuration.getEntityByName("userInfo"); + add(new Label("title","用户")); + } + else if (type == 3){ + entity = Configuration.getEntityByName("crmuser"); + add(new Label("title","下属岗位")); + }else if (type == 4){ + entity = Configuration.getEntityByName("regionManage"); + add(new Label("title","区域管理")); + } + } + + List fields = entity.getFields(); + + final String entityName = entity.getName(); + Form form = new Form("form"); + add(form); + if(roleId != 1){ + WebMarkupContainer con = new WebMarkupContainer("remove_team_member_click"); + add(con); + con.setVisible(false); + //con.add(new AttributeAppender("style", new Model("display:none;"), ";")); + + }else{ + + add(new SubmitLink("remove_team_member_click",form){ + @Override + public void onSubmit(){ + String teamtable = ""; + if(currentEntityName.equalsIgnoreCase("account")){ + teamtable = "accountcrmuser"; + }else if(currentEntityName.equalsIgnoreCase("contact")){ + teamtable = "contactcrmuser"; + }else if(currentEntityName.equalsIgnoreCase("crmuser")){ + if(type == 0){ + teamtable = "accountcrmuser"; + }else if(type == 1){ + teamtable = "contactcrmuser"; + }else if(type == 2){ + teamtable = "user_position"; + }else if(type ==4){ + try{ + delete(Integer.parseInt(entityId)); + }catch(Exception e){ + } + }else { + teamtable = "crmuser"; + } + }else if(currentEntityName.equalsIgnoreCase("userinfo")){ + teamtable = "user_position"; + } + + for(String rid:selectedRowIds){ + try{ + int positionId = 0; + int otherId = 0; + String fromtable = teamtable; + if(teamtable.equalsIgnoreCase("accountcrmuser")){ + AccountCRMUserRelation acr = DAOImpl.getAccountsByAccountCrmuserId(Integer.parseInt(rid)); + positionId = acr.getCrmuserId(); + otherId = acr.getAccountId(); + fromtable = teamtable; + }else if(teamtable.equalsIgnoreCase("user_position")){ + UserPosition up = DAOImpl.getUserPositionById(Integer.parseInt(rid)); + positionId = up.getPositionId(); + otherId = up.getUserId(); + fromtable = "userinfo"; + } + if((type==3)&&fromtable.equalsIgnoreCase("crmuser")){ + CRMUser userinfo = DAOImpl.getCrmUserById(entityId); + DAOImpl.updateCrmUserReportById(rid, String.valueOf(userinfo.getReportto())); + CRMUser reporttouser = DAOImpl.getCrmUserById(userinfo.getReportto()); + DAOImpl.insertAudit(entityName, "上级岗位", userinfo.getName(),reporttouser.getName(), rid, user); + }else{ + DAOImpl.removeEntityFromTeam(teamtable,rid); + DAOImpl.insertRealtionHestory(fromtable,user,positionId,otherId); + } + + }catch(Exception e){ + + } + } + if(type == 4){ + PageParameters param = new PageParameters(); + param.add("positionId", entityId); + setResponsePage(AdminTreePage.class,param ); + }else{ + if(selectedRowIds.size()>0){ + setResponsePage(new EntityDetailPage(currentEntityName,etId)); + } + } + + + } + }); + } + //add button submission + if(roleId != 1){ + WebMarkupContainer con = new WebMarkupContainer("add_users_link"); + add(con); + con.setVisible(false); + }else{ + add(new Link("add_users_link"){ + + @Override + public void onClick() { + this.setResponsePage(new SearchCRMUserPage(currentEntityName,entityId,userId,type)); + } + + }); + + } +// //add edit button +// +// if(roleId != 1||!currentEntityName.equalsIgnoreCase("userinfo")){ +// WebMarkupContainer con = new WebMarkupContainer("edit_team_member_click"); +// add(con); +// con.setVisible(false); +// }else{ +// add(new Link("edit_team_member_click"){ +// @Override +// public void onClick() { +// PageParameters pp = new PageParameters(); +// pp.add("id", entityId); +// pp.add("entityName", "userinfo"); +// setResponsePage(new EditDataPage(entityName,entityId,EntityDetailPage.class,pp)); +// } +// }); +// } + + + + CheckGroup group = new CheckGroup("group",new PropertyModel(this,"selectedRowIds")); + form.add(group); + if(roleId == 1){ + if(type!=4){ + CheckGroupSelector chks = new CheckGroupSelector("checkboxs"); + group.add(chks); + WebMarkupContainer container_label = new WebMarkupContainer("checkboxs_label"); + group.add(container_label); + container_label.add(new AttributeAppender("for", new Model(chks.getMarkupId()), " ")); + }else{ + WebMarkupContainer container = new WebMarkupContainer("checkboxs"); + container.setVisible(false); + WebMarkupContainer container_label = new WebMarkupContainer("checkboxs_label"); + container_label.setVisible(false); + group.add(container); + group.add(container_label); + } + }else{ + WebMarkupContainer container = new WebMarkupContainer("checkboxs"); + container.setVisible(false); + WebMarkupContainer container_label = new WebMarkupContainer("checkboxs_label"); + container_label.setVisible(false); + group.add(container); + group.add(container_label); + } + //set column name + RepeatingView columnNameRepeater = new RepeatingView("columnNameRepeater"); + group.add(columnNameRepeater); + int count=0; + for(Field f:entity.getFields()){ + if (!f.isVisible()|| f.getPriority() >1) + continue; + AbstractItem item = new AbstractItem(columnNameRepeater.newChildId()); + if(count==0){ + item.add(new AttributeAppender("class", new Model("table-first-link"), " ")); + count++; + } + columnNameRepeater.add(item); + item.add(new Label("columnName", f.getDisplay())); + } + + + + + + + final Map tableData = Maps.newHashMap(); + List ids = Lists.newArrayList(); + for (Map map : (List) mapList) { + String key = String.valueOf(map.get("id")); + ids.add(key); + tableData.put(key, map); + } + fieldsd=fields; + final PageableListView listview = new PageableListView("dataRowRepeater", ids, 10) { + + + @Override + protected void populateItem(ListItem item) { + String key = item.getDefaultModelObjectAsString(); + RepeatingView columnRepeater = new RepeatingView("columnRepeater"); + Map map = tableData.get(key); + item.add(columnRepeater); + final String realId = String.valueOf(map.get("id")); + final String rowId = String.valueOf(map.get("rid")); + for (Field f : fieldsd) { + if (!f.isVisible() || f.getPriority() >1) + continue; + AbstractItem columnitem = new AbstractItem(columnRepeater.newChildId(), new Model() { + @Override + public Serializable getObject() { + Param p = new Param(); + p.setId(rowId); + p.setExtraId(realId); + p.setEntityName(entityName); + return p; + } + }); + if (f.isDetailLink()) { + String value = CRMUtility.formatValue(f.getFormatter(), String.valueOf(map.get(f.getName()))); + if(value.equals("null")||value.equals("")||value.equals("dummy")){ + value = "无"; + } + columnitem.add(new AttributeAppender("class", new Model("table-first-link"), " ")); + // columnitem.add(new Label("celldata", value)); + columnitem.add(new DetailLinkFragment("celldata","detailFragment",this.getParent().getParent().getParent(),value)); +// columnitem.add(new DetailLinkFragment("celldata", "detailFragment", this.getParent().getParent().getParent(),value,f.getRelationTable(),String.valueOf(map.get(f.getName())))); + } else { + if (f.getPicklist() != null) { + // get option from picklist + String value = CRMUtility.formatValue(f.getFormatter(), DAOImpl.queryPickListByIdCached(f.getPicklist(), String.valueOf(map.get(f.getName())))); + if(value.equals("null")||value.equals("")||value.equals("dummy")){ + value = "无"; + } + columnitem.add(new Label("celldata", value)); + } else if(f.getRelationTable() != null){ + System.out.println("hrere"); + String value = CRMUtility.formatValue(f.getFormatter(), DAOImpl.queryCachedRelationDataById(f.getRelationTable(), String.valueOf(map.get(f.getName())))); + if(value.equals("null")||value.equals("")||value.equals("dummy")){ + value = "无"; + } + if (roleId==1) { + columnitem.add(new DetailLinkFragment("celldata", "detailFragment", this.getParent().getParent().getParent(),value,f.getRelationTable(),String.valueOf(map.get(f.getName())))); + }else{ + if(!f.getRelationTable().equalsIgnoreCase("crmuser")){ + columnitem.add(new DetailLinkFragment("celldata", "detailFragment", this.getParent().getParent().getParent(),value,f.getRelationTable(),String.valueOf(map.get(f.getName())))); + }else{ + columnitem.add(new Label("celldata", value)).setEscapeModelStrings(false); + } + } + + }else { + String value = CRMUtility.formatValue(f.getFormatter(), String.valueOf(map.get(f.getName()))); + if(value.equals("null")||value.equals("")||value.equals("dummy")){ + value = "无"; + } + columnitem.add(new Label("celldata", value)); + } + } + columnRepeater.add(columnitem); + } + WebMarkupContainer container_label = new WebMarkupContainer("checkbox_label"); +// if(type!=4){ + item.add(container_label); +// }else{ +// container_label.setVisible(false); +// item.add(container_label); +// } + + if(roleId == 1){ + if(type!=4){ + Check chk = new Check("checkbox", new Model(String.valueOf(rowId))); + container_label.add(new AttributeAppender("for", new Model(chk.getMarkupId()), " ")); + item.add(chk); + }else{ + WebMarkupContainer container = new WebMarkupContainer("checkbox"); + container.setVisible(false); + item.add(container); + } + }else{ + WebMarkupContainer container = new WebMarkupContainer("checkbox"); + container.setVisible(false); + item.add(container); + } + + + } + + }; + group.add(listview); + //PagingNavigator nav = new PagingNavigator("navigator", listview); + AjaxPagingNavigator nav =new AjaxPagingNavigator("navigator", listview); + nav.setOutputMarkupId(true); + + group.setOutputMarkupId(true); + group.setRenderBodyOnly(false); + + group.add(nav); + + group.setVersioned(false); + + + + add(new NewDataFormPanel("formPanel",entity,null)); + } + + public TeamManPanel(String id, IModel model) { + super(id, model); + } + +// private class DetailLinkFragment extends Fragment +// { +// public DetailLinkFragment(String id, String markupId, MarkupContainer markupProvider,String caption) +// { +// super(id, markupId, markupProvider); +// +// add(new Link("detailclick") +// { +// @Override +// public void onClick() +// { +// Param p = (Param)getParent().getParent().getDefaultModelObject(); +// logger.debug(p+ " id:"+p.getId() + " name:"+p.getEntityName()); +// setResponsePage(new EntityDetailPage(p.getEntityName(),p.getExtraId())); +// +// //setResponsePage(new AccountDetailPage(id)); +// } +// }.add(new Label("caption", new Model(caption)))); +// } +// } + + private class DetailLinkFragment extends Fragment { + + public DetailLinkFragment(String id, String markupId, MarkupContainer markupProvider, String name,final String entityName ,final String eid) { + super(id, markupId, markupProvider); +// final String str = DAOImpl.queryEntityByName(caption); + add(new Link("detailclick") { + @Override + public void onClick() { + + setResponsePage(new EntityDetailPage(entityName, eid)); + } + }.add(new Label("caption", new Model(name)))); + } + public DetailLinkFragment( String id, String markupId, MarkupContainer markupProvider, String caption) { + super(id, markupId, markupProvider); + add(new Link("detailclick") { + + @Override + public void onClick() { + Param p = (Param)getParent().getParent().getDefaultModelObject(); + setResponsePage(new EntityDetailPage(p.getEntityName(),p.getExtraId())); + } + }.add(new Label("caption", new Model(caption)))); + } + } + + + private class checkboxFragment extends Fragment { + + public checkboxFragment(String id, String markupId, MarkupContainer markupProvider,Model Imodel) + { + super(id, markupId, markupProvider); + // TODO Auto-generated constructor stub + add(new Check("checkbox",Imodel)); + } + + } + private ArrayList queryPosition(int positionId) + { + ArrayList ids = new ArrayList<>(); + + int level = queryPositionLevel(positionId); + + if(level == 11) + { + ids.add(positionId); + } + else if(level > 11) + { + for(int id : queryPositionByParent(positionId)) + { + level = queryPositionLevel(positionId); + + if(level == 11) + { + ids.add(level); + } + else if(level > 11) + { + ids.addAll(queryPosition(id)); + } + } + } + + return ids; + } + + private String getCondition(int positionId) + { + ArrayList ids = queryPosition(positionId); + StringBuilder sb = new StringBuilder(); + if(ids != null && ids.size() > 0) + { + sb = new StringBuilder(); + sb.append("position_id in("); + sb.append(ids.get(0)); + ids.remove(0); + + for(int id : ids) + { + sb.append(","); + sb.append(id); + } + + sb.append(")"); + } + + + return sb.toString(); + } + private int queryPositionLevel(int positionId) + { + int level = 100; + + Map position = DAOImpl.queryEntityById("select * from crmuser where id = ?", String.valueOf(positionId)); + if(position.size() > 0) + { + level = (int) position.get("level"); + } + + return level; + } + + private ArrayList queryPositionByParent(int positionId) + { + List list = DAOImpl.searchCRMUserByManager(String.valueOf(positionId), ""); + ArrayList ids = new ArrayList<>(); + for(Object o : list) + { + Map map = (Map) o; + ids.add(Integer.valueOf((Integer)map.get("id"))); + } + + return ids; + } + private void delete(int positionId) + { + int level = queryPositionLevel(positionId); + + if(level == 11) + { + DAOImpl.deleteAccountTeamWithPositionId(positionId); + } + else if(level > 1) + { + ArrayList ids = queryPositionByParent(positionId); + for(int id : ids) + { + delete(id); + } + } + } + +} diff --git a/crm/src/main/java/com/rex/crm/common/TimestampFormatter.java b/crm/src/main/java/com/rex/crm/common/TimestampFormatter.java new file mode 100644 index 0000000..945f9ef --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/TimestampFormatter.java @@ -0,0 +1,15 @@ +package com.rex.crm.common; + +import java.text.SimpleDateFormat; +import java.util.Date; + +public class TimestampFormatter implements IFormatter { + + @Override + public String format(String value) { + long timestamp = Long.parseLong(value); + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + return format.format(new Date(timestamp)); + } + +} diff --git a/crm/src/main/java/com/rex/crm/common/advancedSearch/AdvancedSearchPage.html b/crm/src/main/java/com/rex/crm/common/advancedSearch/AdvancedSearchPage.html new file mode 100755 index 0000000..99ee864 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/advancedSearch/AdvancedSearchPage.html @@ -0,0 +1,28 @@ + + + + + +
+
+
+
+ + advane search +
+
+ data +
+
+
+ +
+
+ + diff --git a/crm/src/main/java/com/rex/crm/common/advancedSearch/AdvancedSearchPage.java b/crm/src/main/java/com/rex/crm/common/advancedSearch/AdvancedSearchPage.java new file mode 100644 index 0000000..55550cb --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/advancedSearch/AdvancedSearchPage.java @@ -0,0 +1,88 @@ +package com.rex.crm.common.advancedSearch; + +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.apache.wicket.markup.html.basic.Label; + +import com.google.common.base.CharMatcher; +import com.google.common.collect.Lists; +import com.rex.crm.TemplatePage; +import com.rex.crm.beans.AdvancedSearchFilter; +import com.rex.crm.common.Entity; +import com.rex.crm.common.PageableTablePanel; +import com.rex.crm.common.advancedSearch.AdvancedSearchPanel; +import com.rex.crm.db.DAOImpl; +import com.rexen.crm.beans.UserRole; +import com.rex.crm.util.Configuration; +import com.rex.crm.SignIn2Session; + +/** + * @author Feiyun Zhou + */ +public class AdvancedSearchPage extends TemplatePage { + + private static final Logger logger = Logger.getLogger(AdvancedSearchPage.class); + private String search_target = ""; + + /** + * Constructor + */ + public AdvancedSearchPage() { + // PageParameters pp = new PageParameters(); + // IRequestParameters params = + // this.getRequestCycle().getRequest().getRequestParameters(); + initPage(null, null); + } + + public AdvancedSearchPage(String entityName,AdvancedSearchFilter[] filters) { + initPage(entityName,filters); + } + + private void initPage(String entityName, AdvancedSearchFilter[] filters) { + final Entity entity = Configuration.getEntityByName(entityName); + setPageTitle(entity.getDisplay()); + final String positionId = ((SignIn2Session) getSession()).getPositionId(); + final int roleId = ((SignIn2Session) getSession()).getRoleId(); + + String sql = entity.getSql(); + switch (roleId) { + case 1: + sql = entity.getSqlAdmin(); + break; + case 2: + sql = entity.getSqlManager(); + break; + case 3: + sql = entity.getSql(); + break; + } + + add(new Label("table_title",entityName)); + AdvancedSearchPanel searchPanel = new AdvancedSearchPanel("advancedSearch", entityName, filters); + add(searchPanel); + + List tdata = Lists.newArrayList(); + if (filters != null) { + String appendSql = searchPanel.buildFilterSQL(entity, filters); + if(!"".equals(appendSql)){ + sql = sql + " where " + appendSql; + } + int num_of_question_marks = CharMatcher.is('?').countIn(sql); + String[] params = new String[num_of_question_marks]; + for(int i=0;i + + + + + + + + + +
+ +
+
+ +
+ +
+
+ +
+ +
+ +
+
+
+ +
+
+
+

+

+ \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/common/advancedSearch/AdvancedSearchPanel.java b/crm/src/main/java/com/rex/crm/common/advancedSearch/AdvancedSearchPanel.java new file mode 100644 index 0000000..fcbf7b5 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/advancedSearch/AdvancedSearchPanel.java @@ -0,0 +1,417 @@ +package com.rex.crm.common.advancedSearch; + +import java.io.BufferedReader; +import java.io.IOException; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletRequest; + +import org.apache.log4j.Logger; +import org.apache.wicket.Component; +import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.ajax.json.JSONException; +import org.apache.wicket.ajax.json.JSONObject; +import org.apache.wicket.ajax.markup.html.AjaxLink; +import org.apache.wicket.behavior.AbstractAjaxBehavior; +import org.apache.wicket.core.request.handler.PageProvider; +import org.apache.wicket.core.request.handler.RenderPageRequestHandler; +import org.apache.wicket.markup.head.IHeaderResponse; +import org.apache.wicket.markup.head.JavaScriptHeaderItem; +import org.apache.wicket.markup.html.WebPage; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.panel.Panel; +import org.apache.wicket.model.IModel; +import org.apache.wicket.protocol.http.WebApplication; +import org.apache.wicket.request.IRequestParameters; +import org.apache.wicket.request.cycle.RequestCycle; +import org.apache.wicket.request.handler.TextRequestHandler; +import org.apache.wicket.request.http.WebRequest; +import org.apache.wicket.request.mapper.parameter.PageParameters; +import org.apache.wicket.util.string.StringValue; +import org.apache.wicket.util.template.PackageTextTemplate; + +import com.google.common.base.Joiner; +import com.google.common.base.Splitter; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonPrimitive; +import com.rex.crm.AccountPage; +import com.rex.crm.ActivityPage; +import com.rex.crm.ActivitySelectPage; +import com.rex.crm.CoachingPage; +import com.rex.crm.ContactPage; +import com.rex.crm.CreateEventPage; +import com.rex.crm.EventViewerPage; +import com.rex.crm.SignIn2Session; +import com.rex.crm.admin.PositionPage; +import com.rex.crm.admin.UserPage; +import com.rex.crm.ajax.DataProvider; +import com.rex.crm.ajax.FunctionClass; +import com.rex.crm.ajax.FunctionInvoker; +import com.rex.crm.beans.AdvancedSearchField; +import com.rex.crm.beans.AdvancedSearchFilter; +import com.rex.crm.beans.Choice; +import com.rex.crm.beans.FilterMeta; +import com.rex.crm.common.Entity; +import com.rex.crm.common.Field; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.util.CRMUtility; +import com.rex.crm.util.Configuration; + + + +public class AdvancedSearchPanel extends Panel { + private static final long serialVersionUID = 2501105233172820074L; + private static final Logger logger = Logger.getLogger(AdvancedSearchPanel.class); + + private static Map operator2NameMap = Maps.newHashMap(); + static{ + operator2NameMap.put("eq", "="); + operator2NameMap.put("ne", "!="); + operator2NameMap.put("sw", "前缀为"); + operator2NameMap.put("ct", "包含"); + operator2NameMap.put("fw", "后缀为"); + operator2NameMap.put("in", "属于"); + operator2NameMap.put("null", "为空"); + operator2NameMap.put("nn", "不为空"); + operator2NameMap.put("gt", "大于"); + operator2NameMap.put("lt", "小于"); + operator2NameMap.put("bw", "介于之间"); + operator2NameMap.put("all", "所有"); + } + // private String entityName; + + + public AdvancedSearchPanel(String id,final String entityName,final AdvancedSearchFilter[] filters) { + super(id); + + // this.entityName = entityName; + final Entity entity = Configuration.getEntityByName(entityName); + final String target_url ; + if(entity.getName().equalsIgnoreCase("account")){ + target_url = urlFor(AccountPage.class, null).toString(); + }else if(entity.getName().equalsIgnoreCase("contact")){ + target_url = urlFor(ContactPage.class, null).toString(); + }else if(entity.getName().equalsIgnoreCase("userinfo")){ + target_url = urlFor(UserPage.class, null).toString(); + }else if(entity.getName().equalsIgnoreCase("crmuser")){ + target_url = urlFor(PositionPage.class, null).toString(); + }else if(entity.getName().equalsIgnoreCase("activity")){ + target_url = urlFor(ActivityPage.class, null).toString(); + }else if(entity.getName().equalsIgnoreCase("coaching")||entity.getName().equalsIgnoreCase("willcoaching")){ + target_url = urlFor(CoachingPage.class, null).toString(); + }else{ + target_url = urlFor(AccountPage.class, null).toString(); + } + + + Form form = new Form("form"){ + + @Override + protected void onSubmit() { + IRequestParameters parameters = getRequestCycle().getRequest().getPostParameters(); + if(!parameters.getParameterValue("elem").isNull() && ! parameters.getParameterValue("elem").isEmpty()){ + int num_of_elem = parameters.getParameterValue("elem").toInt(); + AdvancedSearchFilter[] filters = new AdvancedSearchFilter[num_of_elem]; + for(int i=0;i splits = Splitter.on(",").split(value); + List labelList = Lists.newArrayList(); + Iterator it = splits.iterator(); + while(it.hasNext()){ + String id = it.next(); + String val = DAOImpl.queryPickListByIdCached(field.getPicklist(), id); + labelList.add(val); + } + label = Joiner.on(",").join(labelList); + } + meta.setValue(value); + meta.setLabel(label); + filters[i].setValue(meta); + } + + + // String filter_sql = buildFilterSQL(entity,filters); + // logger.debug("filter string is:"+filter_sql); + + //PageParameters params = new PageParameters(); + // params.add("ad_search_sql", filter_sql); + setResponsePage(new AdvancedSearchPage(entityName,filters)); + } + + } + + + }; + add(form); + + AbstractAjaxBehavior ajaxBehaviour = new AbstractAjaxBehavior() { + + @Override + public void onRequest() { + RequestCycle requestCycle = RequestCycle.get(); + readRequestData(requestCycle); + } + + private void readRequestData(final RequestCycle requestCycle) { + WebRequest wr = (WebRequest) requestCycle.getRequest(); + + HttpServletRequest hsr = (HttpServletRequest) wr.getContainerRequest(); + String response = "{}"; + String filterString = ""; + try { + BufferedReader br = hsr.getReader(); + + String jsonString = br.readLine(); + if ((jsonString == null) || jsonString.isEmpty()) { + logger.debug(" no json found"); + } else { + logger.debug(" json is :" + jsonString); + } + Gson gson = new Gson(); + AdvancedSearchFilter[] filters = gson.fromJson(jsonString, AdvancedSearchFilter[].class); + filterString = buildFilterSQL(entity, filters); + + br.close(); + } catch (Exception e) { + e.printStackTrace(); + } + + PageParameters parameters = new PageParameters(); + parameters.add("ad_search_sql", filterString); + + String responseStr = target_url + "?ad_search_sql="+ filterString; + logger.debug(responseStr); + + JsonPrimitive jp = new JsonPrimitive(responseStr); + + logger.debug(jp.toString()); + requestCycle.scheduleRequestHandlerAfterCurrent(new TextRequestHandler( "application/json", "UTF-8", jp.toString())); + //requestCycle.replaceAllRequestHandlers(); + // requestCycle.setResponsePage(AccountPage.class, parameters ); + + } + + + + + @Override + public void renderHead(Component component, IHeaderResponse response) { + super.renderHead(component, response); + + + String callbackUrl = getCallbackUrl().toString(); + + Map map = new HashMap<>(); + map.put("ad_search_ajax_url", callbackUrl); + //map.put("target_url", target_url); + PackageTextTemplate ptt = new PackageTextTemplate(getClass(),"advancedSearch.js"); + + + + List fields = Lists.newArrayList(); + for(Field f:entity.getFields()){ + if(!f.isVisible()||f.getName().equals("crmuserName")||f.getName().equals("coacheeName")) continue; + fields.add(f); + } + + + AdvancedSearchField[] advancedFields = new AdvancedSearchField[fields.size()]; + int i = 0; + for(Field f:fields){ + advancedFields[i] = new AdvancedSearchField(); + if (f.getPicklist() != null) { + + List list = DAOImpl.queryPickList(f.getPicklist()); + AdvancedSearchField[] pickList = null; + if(f.getName().equals("department")){ + pickList = new AdvancedSearchField[list.size()+1]; + }else{ + pickList = new AdvancedSearchField[list.size()]; + } + int j = 0; + for(Choice choice:list){ + pickList[j] = new AdvancedSearchField(); + pickList[j].setId(String.valueOf(choice.getId())); + pickList[j].setLabel(choice.getVal()); + j++; + } + if(f.getName().equals("department")){ + pickList[j] = new AdvancedSearchField(); + pickList[j].setId("null"); + pickList[j].setLabel("为空"); + j++; + } + advancedFields[i].setList(pickList); + advancedFields[i].setType("lov"); + + }else if(f.getDataType().equals("datetime-local")||f.getName().equals("whenadded")||f.getName().equals("modify_datetime")||f.getName().equals("act_endtime")){ + advancedFields[i].setType("time"); + }else{ + advancedFields[i].setType(f.getDataType()); + } + advancedFields[i].setId(f.getName()); + advancedFields[i].setLabel(f.getDisplay()); + + i++; + } + + Gson gson = new Gson(); + map.put("search_fields", gson.toJson(advancedFields, AdvancedSearchField[].class)); + String default_search_filters = "[]"; + if(filters!=null){ + default_search_filters = gson.toJson(filters,AdvancedSearchFilter[].class); + } + map.put("default_search_filters", default_search_filters); + + // PackageTextTemplate ptt = new PackageTextTemplate(getClass(),"advancedSearch.js"); + + //System.out.println(ptt.asString(map)); + response.render(JavaScriptHeaderItem.forScript(ptt.asString(map), null)); + try { + ptt.close(); + } catch (IOException e) { + e.printStackTrace(); + } + + } + + }; + + add(ajaxBehaviour); + + // add(new PageableTablePanel("datalist", entityName, tdata, null)); + + } + + + + + public AdvancedSearchPanel(String id, IModel model) { + super(id, model); + } + + + public String buildFilterSQL(final Entity entity, AdvancedSearchFilter[] filters) { + String filterString; + List combinedFilters = Lists.newArrayList(); + if(filters.length>0){ + for(int i =0;i "+ filters[i].getValue().getValue()); + }else if(filters[i].getOperator().getValue().equalsIgnoreCase("lt")){ + combinedFilters.add(filters[i].getField().getValue() +" < "+ filters[i].getValue().getValue()); + }else if(filters[i].getOperator().getValue().equalsIgnoreCase("ne")){ + combinedFilters.add(filters[i].getField().getValue() +" != "+ filters[i].getValue().getValue()); + }else if(filters[i].getOperator().getValue().equalsIgnoreCase("null")){ + combinedFilters.add(filters[i].getField().getValue() +" is null "); + }else if(filters[i].getOperator().getValue().equalsIgnoreCase("nn")){ + combinedFilters.add(filters[i].getField().getValue() +" is not null "); + } + } + }else if(field.getDataType().equals("datetime-local")||field.getName().equals("whenadded")||field.getName().equals("modify_datetime")||field.getName().equals("act_endtime")){ + if(filters[i].getOperator().getValue().equalsIgnoreCase("eq")){ + combinedFilters.add(filters[i].getField().getValue() +" = '"+ filters[i].getValue().getValue()+"'"); + }else if(filters[i].getOperator().getValue().equalsIgnoreCase("gt")){ + combinedFilters.add(filters[i].getField().getValue() +" > '"+ filters[i].getValue().getValue()+"'"); + }else if(filters[i].getOperator().getValue().equalsIgnoreCase("lt")){ + combinedFilters.add(filters[i].getField().getValue() +" < '"+ filters[i].getValue().getValue()+"'"); + }else if(filters[i].getOperator().getValue().equalsIgnoreCase("ne")){ + combinedFilters.add(filters[i].getField().getValue() +" != '"+ filters[i].getValue().getValue()+"'"); + }else if(filters[i].getOperator().getValue().equalsIgnoreCase("bw")){ + combinedFilters.add(filters[i].getField().getValue() +" between '"+filters[i].getValue().getValue()+"' and '"+filters[i].getValue().getValue()+"'"); + }else if(filters[i].getOperator().getValue().equalsIgnoreCase("null")){ + combinedFilters.add(filters[i].getField().getValue() +" is null "); + }else if(filters[i].getOperator().getValue().equalsIgnoreCase("nn")){ + combinedFilters.add(filters[i].getField().getValue() +" is not null "); + } + }else if(null!=field.getRelationTable()){ + if(filters[i].getOperator().getValue().equalsIgnoreCase("eq")){ + combinedFilters.add(filters[i].getField().getValue() +" = (select "+field.getRelationTable()+".id from "+field.getRelationTable()+" where "+field.getRelationTable()+".name = '"+ filters[i].getValue().getValue()+"')"); + }else if(filters[i].getOperator().getValue().equalsIgnoreCase("ne")){ + combinedFilters.add(filters[i].getField().getValue() +" != (select "+field.getRelationTable()+".id from "+field.getRelationTable()+" where "+field.getRelationTable()+".name = '"+ filters[i].getValue().getValue()+"')"); + }else if(filters[i].getOperator().getValue().equalsIgnoreCase("ct")){ + combinedFilters.add(filters[i].getField().getValue() +" in (select "+field.getRelationTable()+".id from "+field.getRelationTable()+" where "+field.getRelationTable()+".name like '%"+ filters[i].getValue().getValue()+"%')"); + }else if(filters[i].getOperator().getValue().equalsIgnoreCase("null")){ + combinedFilters.add(filters[i].getField().getValue() +" in (select "+field.getRelationTable()+".id from "+field.getRelationTable()+" where "+field.getRelationTable()+".name is null ) "); + }else if(filters[i].getOperator().getValue().equalsIgnoreCase("nn")){ + combinedFilters.add(filters[i].getField().getValue() +" in (select "+field.getRelationTable()+".id from "+field.getRelationTable()+" where "+field.getRelationTable()+".name is not null )"); + } + }else{ + if(filters[i].getOperator().getValue().equalsIgnoreCase("eq")){ + combinedFilters.add(filters[i].getField().getValue() +" = '"+ filters[i].getValue().getValue()+"'"); + }else if(filters[i].getOperator().getValue().equalsIgnoreCase("ne")){ + combinedFilters.add(filters[i].getField().getValue() +" != '"+ filters[i].getValue().getValue()+"'"); + }else if(filters[i].getOperator().getValue().equalsIgnoreCase("ct")){ + combinedFilters.add(filters[i].getField().getValue() +" like '%"+ filters[i].getValue().getValue()+"%'"); + }else if(filters[i].getOperator().getValue().equalsIgnoreCase("null")){ + combinedFilters.add(filters[i].getField().getValue() +" is null "); + }else if(filters[i].getOperator().getValue().equalsIgnoreCase("nn")){ + combinedFilters.add(filters[i].getField().getValue() +" is not null "); + } + } + } + } + filterString = Joiner.on(" AND ").join(combinedFilters); + return filterString; + } + + + +} diff --git a/crm/src/main/java/com/rex/crm/common/advancedSearch/advancedSearch.js b/crm/src/main/java/com/rex/crm/common/advancedSearch/advancedSearch.js new file mode 100644 index 0000000..2e7e955 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/advancedSearch/advancedSearch.js @@ -0,0 +1,3 @@ +var search_fields = '${search_fields}'; +var ad_search_ajax_url = '${ad_search_ajax_url}'; +var default_search_filters = '${default_search_filters}'; diff --git a/crm/src/main/java/com/rex/crm/common/calendar.js b/crm/src/main/java/com/rex/crm/common/calendar.js new file mode 100644 index 0000000..43a23c3 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/calendar.js @@ -0,0 +1,4 @@ +var user_event_data = '${user_event_data}'; +var context_name='${context_name}'; +var create_event_page_url = '${create_event_page_url}'; +var event_view_page_url = '${event_view_page_url}'; diff --git a/crm/src/main/java/com/rex/crm/common/tree/Node.java b/crm/src/main/java/com/rex/crm/common/tree/Node.java new file mode 100644 index 0000000..1e4ced7 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/tree/Node.java @@ -0,0 +1,49 @@ +package com.rex.crm.common.tree; + +public class Node { + private String title; + private boolean isFolder; + private Node[] children; + private String type; + private String key; + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public boolean isFolder() { + return isFolder; + } + + public void setFolder(boolean isFolder) { + this.isFolder = isFolder; + } + + public Node[] getChildren() { + return children; + } + + public void setChildren(Node[] children) { + this.children = children; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } +} diff --git a/crm/src/main/java/com/rex/crm/common/tree/ProductTreePanel.html b/crm/src/main/java/com/rex/crm/common/tree/ProductTreePanel.html new file mode 100644 index 0000000..14d3d18 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/tree/ProductTreePanel.html @@ -0,0 +1,73 @@ + + + + + +

+
+ + +
+
+ diff --git a/crm/src/main/java/com/rex/crm/common/tree/ProductTreePanel.java b/crm/src/main/java/com/rex/crm/common/tree/ProductTreePanel.java new file mode 100644 index 0000000..fc72cdb --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/tree/ProductTreePanel.java @@ -0,0 +1,86 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rex.crm.common.tree; + +import java.io.BufferedReader; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.wicket.AttributeModifier; +import org.apache.wicket.Component; +import org.apache.wicket.ajax.AbstractDefaultAjaxBehavior; +import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.ajax.attributes.AjaxCallListener; +import org.apache.wicket.ajax.attributes.AjaxRequestAttributes; +import org.apache.wicket.behavior.AbstractAjaxBehavior; +import org.apache.wicket.markup.head.IHeaderResponse; +import org.apache.wicket.markup.head.JavaScriptHeaderItem; +import org.apache.wicket.markup.html.panel.Panel; +import org.apache.wicket.model.IModel; +import org.apache.wicket.request.cycle.RequestCycle; +import org.apache.wicket.request.handler.TextRequestHandler; +import org.apache.wicket.request.http.WebRequest; +import org.apache.wicket.util.template.PackageTextTemplate; + +import com.google.gson.Gson; + +/** + * Concrete, extending panel. + * + * @author Feiyun Zhou + */ +public class ProductTreePanel extends Panel +{ + String jsonTreeData; + public ProductTreePanel(String id,String jsonTreeData) + { + super(id); + this.jsonTreeData = jsonTreeData; + + + } + + public ProductTreePanel(String id, IModel model) + { + super(id, model); + } + + @Override + public void renderHead(IHeaderResponse response) { + super.renderHead(response); + + Map map = new HashMap<>(); + map.put("regionData", jsonTreeData); + CharSequence pageUrl = urlFor(this.getPage().getClass(),null); + map.put("pageUrl", pageUrl.toString()); + PackageTextTemplate ptt = new PackageTextTemplate( getClass(), "treepanel.js" ); + //OnDomReadyHeaderItem onDomReadyHeaderItem = OnDomReadyHeaderItem.forScript( ptt.asString( map ) ); + //response.render(onDomReadyHeaderItem); + System.out.println(ptt.asString(map)); + response.render(JavaScriptHeaderItem.forScript(ptt.asString(map),null)); + + try { + ptt.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + +} diff --git a/crm/src/main/java/com/rex/crm/common/tree/TreeFactory.java b/crm/src/main/java/com/rex/crm/common/tree/TreeFactory.java new file mode 100644 index 0000000..1115f38 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/tree/TreeFactory.java @@ -0,0 +1,188 @@ +package com.rex.crm.common.tree; + +import java.util.ArrayList; +import java.util.List; + +import com.google.common.base.Splitter; +import com.rex.crm.beans.CRMUser; +import com.rex.crm.beans.Product; +import com.rex.crm.beans.ProductLine; +import com.rex.crm.beans.Productcategory; +import com.rex.crm.beans.UserInfo; +import com.rex.crm.db.DAOImpl; + +public class TreeFactory { + + + + private static void appendChildren(Node node){ + + if(node != null){ + String nodeId = node.getKey(); + // String[] splits = nodeId.split("_"); + + List crmusers = DAOImpl.getInferiorsByManagerId(nodeId); + if(crmusers !=null && crmusers.size()>0){ + Node[] children = new Node[crmusers.size()]; + node.setFolder(true); + node.setChildren(children); + int i = 0; + for(CRMUser user:crmusers){ + Node nd = new Node(); + children[i++] = nd; + nd.setKey(String.valueOf(user.getId())); + + String title = user.getName(); + nd.setTitle(title); + nd.setType("crmuser"); + //System.out.println(user.getCode()+":"+user.getId()); + appendChildren(nd); + } + }else{ + node.setFolder(false); + + + } + + } + + } + + private static void appendProductChildren(Node node){ + + if(node != null){ + String nodeId = node.getKey(); + List products = DAOImpl.getProductByLineId(nodeId); + if(products !=null && products.size()>0){ + Node[] children = new Node[products.size()]; + node.setFolder(true); + node.setChildren(children); + int i = 0; + for(Product product:products){ + Node nd = new Node(); + children[i++] = nd; + nd.setKey(String.valueOf(product.getId())); + String title = product.getName(); + nd.setTitle(title); + nd.setType("product"); + // System.out.println("newnd:"+nd); + // System.out.println("newn:"+nd.getKey()); + appendProductCategoryChildren(nd); + //appendProductChildren(nd); + } + }else{ + node.setFolder(false); + } + + } + + } + private static void appendProductCategoryChildren(Node node){ + + if(node != null){ + String nodeId = node.getKey(); + // System.out.println("appendProductCategoryChildren:"+nodeId); + List products = DAOImpl.getCategoryByLineId(nodeId); + if(products !=null && products.size()>0){ + Node[] children = new Node[products.size()]; + node.setFolder(true); + node.setChildren(children); + int i = 0; + for(Productcategory product:products){ + Node nd = new Node(); + children[i++] = nd; + nd.setKey(String.valueOf(product.getId())); + String title = product.getName(); + nd.setTitle(title); + nd.setType("productcategory"); + } + }else{ + node.setFolder(false); + } + + } + + } + + public static Node createPositionTree(){ + Node root = new Node(); + root.setTitle("ROOT"); + root.setFolder(true); + root.setKey("-1"); + List crmusers = DAOImpl.getCRMUserWithoutSuperior(); + + if(crmusers !=null && crmusers.size()>0){ + Node[] children = new Node[crmusers.size()]; + root.setChildren(children); + root.setFolder(true); + int i = 0; + for(CRMUser user:crmusers){ + Node nd = new Node(); + children[i++] = nd; + nd.setKey(String.valueOf(user.getId())); + nd.setTitle(user.getName()); + nd.setType("crmuser"); + appendChildren(nd); + } + }else{ + root.setFolder(false); + } + return root; + } + + public static Node createAccountPositionTree(){ + Node root = new Node(); + root.setTitle("中国区"); + root.setFolder(true); + root.setKey("-1"); + List crmusers = DAOImpl.getCRMUserWithoutSuperior(); + + if(crmusers !=null && crmusers.size()>0){ + Node[] children = new Node[crmusers.size()]; + root.setChildren(children); + root.setFolder(true); + int i = 0; + for(CRMUser user:crmusers){ + Node nd = new Node(); + children[i++] = nd; + nd.setKey(String.valueOf(user.getId())); + nd.setTitle(user.getCode()); + nd.setType("crmuser"); + appendChildren(nd); + } + }else{ + root.setFolder(false); + } + return root; + } + + public static Node createProductTree(){ + Node root = new Node(); + root.setTitle("产品线"); + root.setFolder(true); + root.setKey("-1"); + List productLines = DAOImpl.getProductLineWithoutSuperior(); + + if(productLines !=null && productLines.size()>0){ + Node[] children = new Node[productLines.size()]; + root.setChildren(children); + root.setFolder(true); + int i = 0; + for(Product productLine:productLines){ + Node nd = new Node(); + children[i++] = nd; + nd.setKey(String.valueOf(productLine.getId())); + nd.setTitle(productLine.getName()); + nd.setType("productline"); + appendProductChildren(nd); + // System.out.println("nd:"+nd); + // System.out.println("node.getKey():"+nd.getKey()); + } + + }else{ + root.setFolder(false); + } + return root; + } + +} diff --git a/crm/src/main/java/com/rex/crm/common/tree/TreePanel.html b/crm/src/main/java/com/rex/crm/common/tree/TreePanel.html new file mode 100755 index 0000000..21ee492 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/tree/TreePanel.html @@ -0,0 +1,73 @@ + + + + + +
+
+ + +
+
+
diff --git a/crm/src/main/java/com/rex/crm/common/tree/TreePanel.java b/crm/src/main/java/com/rex/crm/common/tree/TreePanel.java new file mode 100644 index 0000000..4894e2b --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/tree/TreePanel.java @@ -0,0 +1,86 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rex.crm.common.tree; + +import java.io.BufferedReader; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.wicket.AttributeModifier; +import org.apache.wicket.Component; +import org.apache.wicket.ajax.AbstractDefaultAjaxBehavior; +import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.ajax.attributes.AjaxCallListener; +import org.apache.wicket.ajax.attributes.AjaxRequestAttributes; +import org.apache.wicket.behavior.AbstractAjaxBehavior; +import org.apache.wicket.markup.head.IHeaderResponse; +import org.apache.wicket.markup.head.JavaScriptHeaderItem; +import org.apache.wicket.markup.html.panel.Panel; +import org.apache.wicket.model.IModel; +import org.apache.wicket.request.cycle.RequestCycle; +import org.apache.wicket.request.handler.TextRequestHandler; +import org.apache.wicket.request.http.WebRequest; +import org.apache.wicket.util.template.PackageTextTemplate; + +import com.google.gson.Gson; + +/** + * Concrete, extending panel. + * + * @author Feiyun Zhou + */ +public class TreePanel extends Panel +{ + String jsonTreeData; + public TreePanel(String id,String jsonTreeData) + { + super(id); + this.jsonTreeData = jsonTreeData; + + + } + + public TreePanel(String id, IModel model) + { + super(id, model); + } + + @Override + public void renderHead(IHeaderResponse response) { + super.renderHead(response); + + Map map = new HashMap<>(); + map.put("regionData", jsonTreeData); + CharSequence pageUrl = urlFor(this.getPage().getClass(),null); + map.put("pageUrl", pageUrl.toString()); + PackageTextTemplate ptt = new PackageTextTemplate( getClass(), "treepanel.js" ); + //OnDomReadyHeaderItem onDomReadyHeaderItem = OnDomReadyHeaderItem.forScript( ptt.asString( map ) ); + //response.render(onDomReadyHeaderItem); + System.out.println(ptt.asString(map)); + response.render(JavaScriptHeaderItem.forScript(ptt.asString(map),null)); + + try { + ptt.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + +} diff --git a/crm/src/main/java/com/rex/crm/common/tree/treepanel.js b/crm/src/main/java/com/rex/crm/common/tree/treepanel.js new file mode 100644 index 0000000..66034d2 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/common/tree/treepanel.js @@ -0,0 +1,3 @@ +var regionData = '${regionData}'; +var pageUrl='${pageUrl}'; + diff --git a/crm/src/main/java/com/rex/crm/dataport/DataExporter.java b/crm/src/main/java/com/rex/crm/dataport/DataExporter.java new file mode 100644 index 0000000..8242efb --- /dev/null +++ b/crm/src/main/java/com/rex/crm/dataport/DataExporter.java @@ -0,0 +1,114 @@ +package com.rex.crm.dataport; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.charset.Charset; +import java.util.List; +import java.util.Map; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +import org.jumpmind.symmetric.csv.CsvWriter; + +import com.google.common.base.Charsets; +import com.google.common.collect.Lists; +import com.rex.crm.common.Entity; +import com.rex.crm.common.Field; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.util.CRMUtility; +import com.rex.crm.util.Configuration; + +public class DataExporter { + + + + public static String export(final String entityName, final List mapList) throws IOException{ + final Entity entity = Configuration.getEntityByName(entityName); + if (mapList != null && entity !=null) { + + final List fields = entity.getFields(); + final List validFields = Lists.newArrayList(); + File tmpFile = File.createTempFile("crm_exported_file_", ".zip"); + FileOutputStream fos = new FileOutputStream(tmpFile); + ZipOutputStream zos = new ZipOutputStream(fos); + ZipEntry ze= new ZipEntry(entityName+"_export.csv"); + zos.putNextEntry(ze); + + CsvWriter writer = new CsvWriter(zos, ',',Charset.forName("GBK")); + try{ + List heads = Lists.newArrayList(); + + for (Field f : fields) { + if (!f.isVisible()) continue; + validFields.add(f); + heads.add(f.getDisplay()); + } + + String[] tests = heads.toArray(new String[0]); + writer.writeRecord(tests); + + for (Map map : (List) mapList) { + String key = String.valueOf(map.get("id")); + + List record = Lists.newArrayList(); + for (Field f : validFields) { + if (f.getPicklist() != null) { + // get option from picklist + String value = CRMUtility.formatValue(f.getFormatter(), DAOImpl.queryPickListByIdCached(f.getPicklist(), String.valueOf(map.get(f.getName())))); + if(value.equals("null")||value.isEmpty()){ + value = ""; + } + record.add(value); + } else if(f.getRelationTable() != null){ + String value = CRMUtility.formatValue(f.getFormatter(), DAOImpl.queryCachedRelationDataById(f.getRelationTable(), String.valueOf(map.get(f.getName())))); + if(value.equals("null")||value.isEmpty()){ + value = ""; + } + + record.add(value); + }else { + String value = CRMUtility.formatValue(f.getFormatter(), String.valueOf(map.get(f.getName()))); + + if(f.getDataType().equalsIgnoreCase("downloadlink")){ + record.add(""); + }else{ + if(value.equals("null")||value.isEmpty()){ + value = ""; + } + record.add(value); + } + } + } + writer.writeRecord(record.toArray(new String[0])); + + } + writer.flush(); + + }finally{ + + zos.closeEntry(); + zos.close(); + fos.close(); + writer.close(); + + } + + return tmpFile.getAbsolutePath(); + } + return null; + + } + /** + * @param args + * @throws IOException + */ + public static void main(String[] args) throws IOException { + + final Entity entity = Configuration.getEntityByName("crmuser"); + List mapList = DAOImpl.queryEntityRelationList(entity.getSqlAdmin()); + System.out.println("filename:"+DataExporter.export("crmuser", mapList )); + + } + +} diff --git a/crm/src/main/java/com/rex/crm/dataport/DataImporter.java b/crm/src/main/java/com/rex/crm/dataport/DataImporter.java new file mode 100644 index 0000000..197f50e --- /dev/null +++ b/crm/src/main/java/com/rex/crm/dataport/DataImporter.java @@ -0,0 +1,309 @@ +package com.rex.crm.dataport; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.IOException; +import java.nio.charset.Charset; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.Executors; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +import javax.xml.bind.JAXBException; + +import org.apache.commons.codec.digest.DigestUtils; +import org.apache.log4j.Logger; +import org.jumpmind.symmetric.csv.CsvReader; + +import com.google.common.base.Joiner; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.io.Files; +import com.rex.crm.WicketApplication; +import com.rex.crm.beans.Choice; +import com.rex.crm.common.Entity; +import com.rex.crm.common.Field; +import com.rex.crm.db.DAOImpl; +import com.rex.crm.util.CRMUtility; +import com.rex.crm.util.Configuration; + +public class DataImporter { + + private static final Logger logger = Logger.getLogger(DataImporter.class); + + public static ImportMeta _importData(String entityName,String filename) throws IOException{ + if(entityName.equalsIgnoreCase("user_position")){ + DAOImpl.deleteAllRecords(entityName); + } + // String tmpDir = CRMUtility.createTempDirectory().getAbsolutePath(); + ImportMeta importMeta = new ImportMeta(); + + int num_of_total_record = 0; + int num_of_imported = 0; + int num_of_failed = 0; + int num_of_updated = 0; + int result = 0; + File logfile = File.createTempFile("crm_error_", "_file.log"); + importMeta.setLogfilename(logfile.getAbsolutePath()); + importMeta.setEntityName(entityName); + importMeta.setImportfilename(filename); + + + BufferedWriter error_writter = com.google.common.io.Files.newWriter(logfile, Charset.forName("utf-8")); +// BufferedWriter update_error_writter = com.google.common.io.Files.newWriter(new File(tmpDir+"/update_error.txt"), Charset.forName("utf-8")); +// BufferedWriter success_insert_writter = com.google.common.io.Files.newWriter(new File(tmpDir+"/success_insert.txt"), Charset.forName("utf-8")); +// BufferedWriter success_update_writter = com.google.common.io.Files.newWriter(new File(tmpDir+"/success_update.txt"), Charset.forName("utf-8")); + List inserts_list = Lists.newArrayList(); + logger.debug("logger:"+logfile.getAbsolutePath()); + try{ + Entity entity = Configuration.getEntityByName(entityName); + List importfields = entity.getImportFields(); + Map fieldMap = Maps.newHashMap(); + + for(Field f:importfields){ + fieldMap.put(f.getName(), f); + } + + List relationfields = entity.getImportForeignKeyFields(); + + CsvReader reader = new CsvReader(filename, ',', Charset.forName("UTF-8")); + reader.readHeaders(); + String[] headers = reader.getHeaders(); + //reader.getHeaders(); + + Map> picklistMap = Maps.newHashMap(); + + + Map> relationTableCache = Maps.newHashMap(); + if (relationfields.size() > 0) { + for(Field field:relationfields){ + String relationTable = field.getRelationTable(); + String forignkeyFieldName = field.getImport_external_foreignkey_field_name(); + List pairs = DAOImpl.queryExternalIds(relationTable, forignkeyFieldName); + Map map = Maps.newHashMap(); + for(Choice choice:pairs){ + map.put(choice.getVal(), String.valueOf(choice.getId())) ; + } + relationTableCache.put(relationTable, map); + } + } + int line = 0; + boolean flag = true; + while(reader.readRecord()){ + line++; + num_of_total_record++; + ArrayList fieldNames = Lists.newArrayList(); + ArrayList fieldValues = Lists.newArrayList(); + flag = true; + for(Field f:importfields){ + + //if(relationfields.contains(f)) continue; + + if(reader.get(f.getImport_field_name()) != null){ + String value = reader.get(f.getImport_field_name()); + //if it is a pick list, we need lookup pick value to return the ID + if(f.getPicklist() !=null){ + String picklistTable = f.getPicklist(); + + //create map for 'value to id' + if(!picklistMap.containsKey(picklistTable)){ + List picklist = DAOImpl.queryPickList(picklistTable); + Map value2id = Maps.newHashMap(); + for(Choice choice:picklist){ + value2id.put(choice.getVal(), String.valueOf(choice.getId())); + } + picklistMap.put(picklistTable, value2id); + } + + Map value2idMap = picklistMap.get(picklistTable); + + if(value2idMap.containsKey(value)){ + fieldNames.add(f.getName()); + fieldValues.add(value2idMap.get(value)); + }else{ + logger.debug("failed to get matched value"); + error_writter.write(f.getImport_field_name()+ " 未查到值:"+value +" "+ reader.getRawRecord()+"\n"); + num_of_failed++; + result = 1; + flag = false; + break; + } + + }else if(f.getRelationTable()!=null){ + + String relationTable = f.getRelationTable(); + Map externalId2idMap = relationTableCache.get(relationTable); + String id = externalId2idMap.get(value); + logger.debug("line:"+line); + if(id == null){ + logger.debug(relationTable+"中没有此外部ID:"+value); + error_writter.write(relationTable+"中没有此外部ID:"+value +" === " +reader.getRawRecord()+"\n"); + + if(entityName.equalsIgnoreCase("accountcrmuser")|| entityName.equalsIgnoreCase("contact")){ + num_of_failed++; + result = 1; + flag = false; + break; + } + + }else{ + fieldNames.add(f.getName()); + fieldValues.add(id); + logger.debug("added:"+f.getName() + "=" +id); + } + + + }else{ + fieldNames.add(f.getName()); + + if(f.getDataType().equalsIgnoreCase("password")){ + value = DigestUtils.md5Hex("12345"); + fieldValues.add("'"+value+"'"); + }else if(f.getDataType().equalsIgnoreCase("number")){ + fieldValues.add(value); + }else{ + fieldValues.add("'"+value+"'"); + } + } + } + } + + // fieldNames.add("externalId"); + if (fieldNames.size() > 0 && flag) { + + SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm"); + fieldNames.add("modify_datetime"); + fieldValues.add("'"+dateformat.format(new Date())+"'"); + fieldNames.add("modifier"); + fieldValues.add("'数据导入模块'"); + + if(entityName.equalsIgnoreCase("user_position")){ + fieldNames.add("isPrimary"); + fieldValues.add("1"); + } + + long id = DAOImpl.importRecord(entityName, fieldNames, fieldValues); + // failed insert record, we guess we need update record + //boolean flag = false; + if (id < 0) { + + // we query the record if it exist, if it exist, we think it + // duplicated so upated it + Field externalField = entity.getFieldByName(entity.getExternalField()); + String externalId = reader.get(externalField.getImport_field_name()); + Map data = DAOImpl.queryRecordByField(entity.getName(), externalField.getName(), externalId); + if (data != null && externalId != null) { + int updates = DAOImpl.updateRecord4Import(entityName, fieldNames, fieldValues, externalField.getName(), externalId); + if(updates > 0){ + //success_update_writter.write(reader.getRawRecord()+"\n"); + inserts_list.add(reader.getValues()); + //num_of_imported++; + num_of_updated++; + }else{ + error_writter.write("更新错误:"+reader.getRawRecord()+ "\n"); + num_of_failed++; + result = 1; + } + } + }else{ + //success_insert_writter.write(reader.getRawRecord()+"\n"); + inserts_list.add(reader.getValues()); + num_of_imported++; + } + } + } + + + }finally{ + //insert_error_writter.close(); + // update_error_writter.close(); + // success_insert_writter.close(); + error_writter.close(); + logger.debug("logger:"+logfile.getAbsolutePath()); + } + + + importMeta.setNum_of_failed(num_of_failed); + importMeta.setNum_of_imported(num_of_imported); + importMeta.setNum_of_total_record(num_of_total_record); + importMeta.setNum_of_updated(num_of_updated); + importMeta.setResult(result); + return importMeta; + + } + + public static void importDataOnBackground(final String entityName, final String filename) throws IOException{ + + //Get the ThreadFactory implementation to use + + + DataImporter importer = new DataImporter(); + DataImporter.WorkerThread thread = importer.new WorkerThread(entityName,filename); + CRMUtility.getThreadPoolExecutor().execute(thread); + + } + + public static void importDataOnSync(final String entityName, final String filename) throws IOException{ + + //Get the ThreadFactory implementation to use + + + DataImporter importer = new DataImporter(); + DataImporter.WorkerThread worker = importer.new WorkerThread(entityName,filename); + worker.processCommand(); + //CRMUtility.getThreadPoolExecutor().execute(thread); + + } + + public static void main(String args[]) throws JAXBException, IOException, Exception { + DataImporter importer = new DataImporter(); + //importer.importPositionData("crmuser","/Users/feiyunzhou/git/tiger/tigerp/crm/src/main/doc/crmuser_import.csv"); + importer.importDataOnBackground("user_position","/Users/feiyunzhou/git/tiger/tigerp/crm/src/main/doc/user_position_import.csv"); + //importer.importDataOnBackground("userinfo","/Users/feiyunzhou/git/tiger/tigerp/crm/src/main/doc/userinfo_import.csv"); + + } + + private class WorkerThread implements Runnable { + private String entityName; + private String filename; + + public WorkerThread(final String entityName, final String filename) { + this.entityName = entityName; + this.filename = filename; + } + + @Override + public void run() { + processCommand(); + + } + + public void processCommand() { + try { + + long id = DAOImpl.insertImportMetaInfo(entityName, filename); + if(id>0){ + ImportMeta metaInfo = DataImporter._importData(entityName, filename); + DAOImpl.updateImportMetaInfoById(metaInfo.getLogfilename(), metaInfo.getNum_of_total_record(), + metaInfo.getNum_of_imported(), metaInfo.getNum_of_failed(),metaInfo.getNum_of_updated(), metaInfo.getResult(), id); + } + + + } catch (Exception e) { + + e.printStackTrace(); + + } + + } + + + } + +} diff --git a/crm/src/main/java/com/rex/crm/dataport/ImportDataWizard$SelectEntityNameStep.html b/crm/src/main/java/com/rex/crm/dataport/ImportDataWizard$SelectEntityNameStep.html new file mode 100755 index 0000000..56a83c5 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/dataport/ImportDataWizard$SelectEntityNameStep.html @@ -0,0 +1,11 @@ + +
+ + + +
+
diff --git a/crm/src/main/java/com/rex/crm/dataport/ImportDataWizard$SelectFileStep.html b/crm/src/main/java/com/rex/crm/dataport/ImportDataWizard$SelectFileStep.html new file mode 100755 index 0000000..ca57288 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/dataport/ImportDataWizard$SelectFileStep.html @@ -0,0 +1,5 @@ + +
+ +
+
diff --git a/crm/src/main/java/com/rex/crm/dataport/ImportDataWizard.java b/crm/src/main/java/com/rex/crm/dataport/ImportDataWizard.java new file mode 100755 index 0000000..b536f97 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/dataport/ImportDataWizard.java @@ -0,0 +1,195 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rex.crm.dataport; + +import java.util.Arrays; +import java.util.List; + +import org.apache.log4j.Logger; +import org.apache.wicket.extensions.wizard.Wizard; +import org.apache.wicket.extensions.wizard.WizardModel; +import org.apache.wicket.extensions.wizard.WizardStep; +import org.apache.wicket.markup.html.form.DropDownChoice; +import org.apache.wicket.markup.html.form.IChoiceRenderer; +import org.apache.wicket.markup.html.form.upload.FileUpload; +import org.apache.wicket.markup.html.form.upload.FileUploadField; + + +import org.apache.wicket.model.CompoundPropertyModel; +import org.apache.wicket.model.IModel; +import org.apache.wicket.model.Model; +import org.apache.wicket.util.file.File; + + + +import com.google.common.collect.Lists; +import com.rex.crm.beans.Choice; +import com.rex.crm.util.CRMUtility; + + +/** + * This wizard shows some basic form use. It uses custom panels for the form elements, and a single + * domain object ({@link User}) as it's subject. Also, the user roles step}is an optional step, that + * will only be executed when assignRoles is true (and that value is edited in the user details + * step). + * + * @author Eelco Hillenius + */ +public class ImportDataWizard extends Wizard +{ + private static final Logger logger = Logger.getLogger(ImportDataWizard.class); + private static final List choiceList = Lists.newArrayList(); + static { + choiceList.add(new Choice(0L, "contact")); + choiceList.add(new Choice(1L, "account")); + choiceList.add(new Choice(2L, "accountTeam")); + choiceList.add(new Choice(3L, "position")); + choiceList.add(new Choice(4L, "userInfo")); + + } + private FileUploadField fileUpload; + private String entityName; + private Choice selected_entity = choiceList.get(0); + + /** + * The user details step. + */ + private final class SelectEntityNameStep extends WizardStep + { + /** + * Construct. + */ + public SelectEntityNameStep() + { + //add( new Label("entityName", new PropertyModel(this,"entityName"))); + + IModel choices = Model.ofList(choiceList); + + DropDownChoice dropdown = createDropDownListFromPickList("entityName", choices, new Model(selected_entity)); + add(dropdown); + } + } + + /** + * The user name step. + */ + private final class SelectFileStep extends WizardStep + { + /** + * Construct. + */ + public SelectFileStep() + { + //final FileUploadField position = new FileUploadField("position"); + fileUpload = new FileUploadField("fileUpload"); + + add(fileUpload); + + } + } + + + /** + * Construct. + * + * @param id + * The component id + */ + public ImportDataWizard(String id) + { + super(id); + + setDefaultModel(new CompoundPropertyModel(this)); + WizardModel model = new WizardModel(); + model.add(new SelectEntityNameStep()); + model.add(new SelectFileStep()); + + + // initialize the wizard with the wizard model we just built + init(model); + getForm().setMultiPart(true); + } + + + /** + * @see org.apache.wicket.extensions.wizard.Wizard#onCancel() + */ + @Override + public void onCancel() + { + System.out.println("Canceled"); + } + + /** + * @see org.apache.wicket.extensions.wizard.Wizard#onFinish() + */ + @Override + public void onFinish() + { + System.out.println("Finished"); + logger.debug("selecte entity:"+ selected_entity.getId()); + + + List uploadedFile = fileUpload.getFileUploads(); + + if (uploadedFile != null && uploadedFile.size()>0) { + + // write to a new file + File newFile = new File(CRMUtility.readFileAttribure("uploadpath") + uploadedFile.get(0).getClientFileName()); + + if (newFile.exists()) { + newFile.delete(); + } + + try { + newFile.createNewFile(); + uploadedFile.get(0).writeTo(newFile); + + info("saved file: " + uploadedFile.get(0).getClientFileName()); + } catch (Exception e) { + throw new IllegalStateException("Error"); + } + } + + } + + + private DropDownChoice createDropDownListFromPickList(String markupId,IModel choices,IModel default_model) { + + DropDownChoice choice = new DropDownChoice(markupId, default_model, choices, + new IChoiceRenderer() { + @Override + public Object getDisplayValue(Choice choice) { + // TODO Auto-generated method stub + return choice.getVal(); + } + @Override + public String getIdValue(Choice choice, int index) { + // TODO Auto-generated method stub + return String.valueOf(choice.getId()); + } + + + }); + + choice.setNullValid(true); + return choice; + } + + + +} \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/dataport/ImportMeta.java b/crm/src/main/java/com/rex/crm/dataport/ImportMeta.java new file mode 100755 index 0000000..82a7201 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/dataport/ImportMeta.java @@ -0,0 +1,107 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rex.crm.dataport; + +import java.util.HashSet; +import java.util.Set; + +import org.apache.wicket.util.io.IClusterable; + + +/** + * Domain class for the new user wizard example. + * + * @author Eelco Hillenius + */ +public final class ImportMeta implements IClusterable +{ + private String entityName; + private String importfilename; + private String logfilename; + private int num_of_total_record; + private int num_of_imported; + private int num_of_failed; + private int num_of_updated; + private int result; + + public String getEntityName() { + return entityName; + } + + public void setEntityName(String entityName) { + this.entityName = entityName; + } + + public String getImportfilename() { + return importfilename; + } + + public void setImportfilename(String importfilename) { + this.importfilename = importfilename; + } + + public String getLogfilename() { + return logfilename; + } + + public void setLogfilename(String logfilename) { + this.logfilename = logfilename; + } + + public int getNum_of_total_record() { + return num_of_total_record; + } + + public void setNum_of_total_record(int num_of_total_record) { + this.num_of_total_record = num_of_total_record; + } + + public int getNum_of_imported() { + return num_of_imported; + } + + public void setNum_of_imported(int num_of_imported) { + this.num_of_imported = num_of_imported; + } + + public int getNum_of_failed() { + return num_of_failed; + } + + public void setNum_of_failed(int num_of_failed) { + this.num_of_failed = num_of_failed; + } + + public int getResult() { + return result; + } + + public void setResult(int result) { + this.result = result; + } + + public int getNum_of_updated() { + return num_of_updated; + } + + public void setNum_of_updated(int num_of_updated) { + this.num_of_updated = num_of_updated; + } + + + +} diff --git a/crm/src/main/java/com/rex/crm/db/DAOImpl.java b/crm/src/main/java/com/rex/crm/db/DAOImpl.java new file mode 100644 index 0000000..b608eed --- /dev/null +++ b/crm/src/main/java/com/rex/crm/db/DAOImpl.java @@ -0,0 +1,3234 @@ +package com.rex.crm.db; + +import java.sql.Connection; +import java.sql.ParameterMetaData; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.concurrent.Callable; +import java.util.concurrent.TimeUnit; + +import javax.annotation.Resource; +import javax.sql.DataSource; + +import org.apache.commons.codec.digest.DigestUtils; +import org.apache.commons.dbutils.DbUtils; +import org.apache.commons.dbutils.QueryRunner; +import org.apache.commons.dbutils.ResultSetHandler; +import org.apache.commons.dbutils.handlers.BeanHandler; +import org.apache.commons.dbutils.handlers.BeanListHandler; +import org.apache.commons.dbutils.handlers.MapHandler; +import org.apache.commons.dbutils.handlers.MapListHandler; +import org.apache.commons.lang3.tuple.Pair; +import org.apache.log4j.Logger; +import org.apache.wicket.util.string.StringValue; + +import com.google.common.base.Joiner; +import com.google.common.cache.Cache; +import com.google.common.cache.CacheBuilder; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ListMultimap; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.gson.Gson; +import com.rex.crm.beans.Account; +import com.rex.crm.beans.AccountCRMUserRelation; +import com.rex.crm.beans.CRMUser; +import com.rex.crm.beans.CalendarEvent; +import com.rex.crm.beans.Choice; +import com.rex.crm.beans.City; +import com.rex.crm.beans.Contact; +import com.rex.crm.beans.Product; +import com.rex.crm.beans.ProductLine; +import com.rex.crm.beans.Productcategory; +import com.rex.crm.beans.Province; +import com.rex.crm.beans.UserInfo; +import com.rex.crm.beans.UserPosition; +import com.rex.crm.common.Entity; +import com.rex.crm.db.model.Activity; +import com.rex.crm.util.Configuration; +import com.rexen.crm.beans.Crmuser; + +public class DAOImpl +{ + + private static final Logger logger = Logger.getLogger(DAOImpl.class); + public static ListMultimap accountIdsByUserId; + + private static Cache pickListCache = CacheBuilder.newBuilder() + .maximumSize(1000).expireAfterWrite(10, TimeUnit.MINUTES) + .build(); + + private static Cache relationDataCache = CacheBuilder.newBuilder() + .maximumSize(1000).expireAfterWrite(10, TimeUnit.MINUTES) + .build(); + + public static ImmutableMap getCityTable() { + com.google.common.collect.ImmutableMap.Builder mapBuilder = ImmutableMap. builder(); + + ResultSetHandler> h = new BeanListHandler(City.class); + Connection conn = null; + try { + QueryRunner run = new QueryRunner(); + conn = DBConnector.getConnection(); + + List result = run.query(conn, "SELECT * FROM city", h); + for (City c : result) { + mapBuilder.put(c.getId(), c); + } + + } catch (Exception e) { + logger.error("failed to get city table data", e); + } finally { + DBHelper.closeConnection(conn); + } + return mapBuilder.build(); + } + + public static ImmutableMap getProvinceTable() { + com.google.common.collect.ImmutableMap.Builder mapBuilder = ImmutableMap. builder(); + + Connection conn = null; + try { + ResultSetHandler> h = new BeanListHandler(Province.class); + QueryRunner run = new QueryRunner(); + conn = DBConnector.getConnection(); + List result = run.query(conn, "SELECT * FROM province", h); + for (Province p : result) { + mapBuilder.put(p.getId(), p); + } + } catch (Exception e) { + logger.error("faield to get provinces data", e); + } finally { + DBHelper.closeConnection(conn); + } + + return mapBuilder.build(); + } + + public static long getNumOfContactOfUser(String userId) { + long size = 0; + Connection conn = null; + String sql = "select count(distinct contact.id) as num_of_contact from " + + "contactcrmuser,contact where contactcrmuser.crmuserId=? AND contact.id=contactcrmuser.contactId"; + try { + QueryRunner run = new QueryRunner(); + conn = DBConnector.getConnection(); + Map map = run.query(conn, sql, new MapHandler(), userId); + size = (long) map.get("num_of_contact"); + } catch (Exception e) { + logger.error("failed to get size of account", e); + } finally { + DBHelper.closeConnection(conn); + } + + return size; + } + + public static long getNumOfAccountOfUser(String userId) { + long size = 0; + Connection conn = null; + String sql = "select count(distinct account.id) as num_of_account from " + + "accountcrmuser,account where accountcrmuser.crmuserId=? AND account.id=accountcrmuser.accountId"; + try { + QueryRunner run = new QueryRunner(); + conn = DBConnector.getConnection(); + Map map = run.query(conn, sql, new MapHandler(), userId); + size = (long) map.get("num_of_account"); + } catch (Exception e) { + logger.error("failed to get size of account", e); + } finally { + DBHelper.closeConnection(conn); + } + + return size; + } + + public static long getNumOfActivityOfUser(String userId) { + long size = 0; + Connection conn = null; + String sql = "select count(activityId) as num_of_activity from activitycrmuser where crmuserId=?"; + try { + QueryRunner run = new QueryRunner(); + conn = DBConnector.getConnection(); + Map map = run.query(conn, sql, new MapHandler(), userId); + size = (long) map.get("num_of_activity"); + } catch (Exception e) { + logger.error("failed to get size of account", e); + } finally { + DBHelper.closeConnection(conn); + } + + return size; + } + + + public static long getSizeOfAccountByUserId(int userId) { + long size = 0; + Connection conn = null; + try { + QueryRunner run = new QueryRunner(); + conn = DBConnector.getConnection(); + Map map = run.query(conn, "select count(*) as ct from account as a inner join accountcrmuser as b on a.id=b.accountId where b.crmuserId=?", new MapHandler(), userId); + size = (long) map.get("ct"); + } catch (Exception e) { + logger.error("failed to get size of account", e); + } finally { + DBHelper.closeConnection(conn); + } + + return size; + } + + + + public static long getSizeOfUsersByAccountId(int accountId) { + long size = 0; + Connection conn = null; + try { + QueryRunner run = new QueryRunner(); + conn = DBConnector.getConnection(); + Map map = run.query(conn, "select count(*) as ct from crmuser as a inner join accountcrmuser as b on a.id=b.crmuserId where b.accountId=?", new MapHandler(), accountId); + size = (long) map.get("ct"); + } catch (Exception e) { + logger.error("failed to get size of account", e); + } finally { + DBHelper.closeConnection(conn); + } + + return size; + } + + public static List getAccountsByIds(List accountIds) { + List accounts = Lists.newArrayList(); + ResultSetHandler> h = new BeanListHandler(Account.class); + + List params = new ArrayList<>(); + for (int id : accountIds) { + params.add(id); + } + Connection conn = null; + try { + QueryRunner run = new QueryRunner(); + + conn = DBConnector.getConnection(); + accounts = run.query(conn, "select * from account where id=?", params.toArray(new Object[0]), h); + + } catch (Exception e) { + logger.error("failed to get city table data", e); + } finally { + DBHelper.closeConnection(conn); + } + + return accounts; + } + + public static Province getProvinceById(int provinceId) { + Connection conn = null; + Province prov = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler h = new BeanHandler(Province.class); + + prov = run.query(conn, "SELECT * FROM province where id=?", h, provinceId); + + } catch (SQLException e) { + logger.error("failed to get province", e); + } finally { + DBHelper.closeConnection(conn); + } + + return prov; + } + + public static List getAccountsByUserId(int userId) { + List accounts = Lists.newArrayList(); + ResultSetHandler> h = new BeanListHandler(Account.class); + Connection conn = null; + try { + QueryRunner run = new QueryRunner(); + conn = DBConnector.getConnection(); + accounts = run.query(conn, "select a.* from account as a inner join accountcrmuser as b on a.id=b.accountId where b.crmuserId=?", h, userId); + } catch (Exception e) { + logger.error("failed to get city table data", e); + } finally { + DBHelper.closeConnection(conn); + } + + return accounts; + } + + public static List getAccountsByPositionId(int id) { + List accounts = Lists.newArrayList(); + ResultSetHandler> h = new BeanListHandler(AccountCRMUserRelation.class); + Connection conn = null; + try { + QueryRunner run = new QueryRunner(); + conn = DBConnector.getConnection(); + accounts = run.query(conn, "select * from accountcrmuser where crmuserId=?", h, id); + } catch (Exception e) { + logger.error("failed to get city table data", e); + } finally { + DBHelper.closeConnection(conn); + } + + return accounts; + } + + public static AccountCRMUserRelation getAccountsByAccountCrmuserId(int id) { + AccountCRMUserRelation accounts = null; + ResultSetHandler h = new BeanHandler(AccountCRMUserRelation.class); + Connection conn = null; + try { + QueryRunner run = new QueryRunner(); + conn = DBConnector.getConnection(); + accounts = run.query(conn, "select * from accountcrmuser where id=?", h, id); + } catch (Exception e) { + logger.error("failed to get city table data", e); + } finally { + DBHelper.closeConnection(conn); + } + + return accounts; + } + + public static List getAccountsByAccountId(int id) { + List accounts = Lists.newArrayList(); + ResultSetHandler> h = new BeanListHandler(AccountCRMUserRelation.class); + Connection conn = null; + try { + QueryRunner run = new QueryRunner(); + conn = DBConnector.getConnection(); + accounts = run.query(conn, "select * from accountcrmuser where accountid=?", h, id); + } catch (Exception e) { + logger.error("failed to get city table data", e); + } finally { + DBHelper.closeConnection(conn); + } + + return accounts; + } + + + public static List getUsersByAccountId(int accountId) { + List users = Lists.newArrayList(); + ResultSetHandler> h = new BeanListHandler(CRMUser.class); + Connection conn = null; + try { + QueryRunner run = new QueryRunner(); + conn = DBConnector.getConnection(); + users = run.query(conn, "select a.* from crmuser as a inner join accountcrmuser as b on a.id=b.crmuserId where b.accountId=?", h, accountId); + } catch (Exception e) { + logger.error("failed to get city table data", e); + } finally { + DBHelper.closeConnection(conn); + } + + return users; + } + + public static List getAllAccounts() { + List accounts = Lists.newArrayList(); + Connection conn = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler> h = new BeanListHandler(Account.class); + + accounts = run.query(conn, "SELECT * FROM account", h); + + } catch (SQLException e) { + logger.error("failed to get all accounts", e); + } finally { + try { + DbUtils.close(conn); + } catch (SQLException e) { + // TODO Auto-generated catch block + logger.error("failed to close connection", e); + } + } + + return accounts; + } + + public static List getAllContacts() { + List contacts = Lists.newArrayList(); + Connection conn = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler> h = new BeanListHandler(Contact.class); + + contacts = run.query(conn, "SELECT * FROM contact", h); + + } catch (SQLException e) { + logger.error("failed to get all accounts", e); + } finally { + try { + DbUtils.close(conn); + } catch (SQLException e) { + // TODO Auto-generated catch block + logger.error("failed to close connection", e); + } + } + + return contacts; + } + + public static List>> getNumberOfTypeOfAccount(String user_id) { + String query = "select b.id as id,b.val as val,sum(a.id) as sum from (SELECT account.* FROM account,accountcrmuser WHERE account.id=accountcrmuser.accountId AND accountcrmuser.crmuserId=?) as a, account_pl6 as b where a.pl6=b.id group by b.id order by sum DESC"; + List>> res = Lists.newArrayList(); + Connection conn = null; + List> lMap = Lists.newArrayList(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + lMap = run.query(conn, query, new MapListHandler(), user_id); + if (lMap != null) { + for (Map map : lMap) { + Pair> value = Pair.of(String.valueOf(map.get("id")), map); + res.add(value); + } + } + + } catch (SQLException e) { + logger.error("failed to get list from picklist", e); + } finally { + DBHelper.closeConnection(conn); + } + + return res; + } + + public static Account getAccountById(int id) { + Connection conn = null; + Account account = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler h = new BeanHandler(Account.class); + + account = run.query(conn, "SELECT * FROM account where id=?", h, id); + + } catch (SQLException e) { + logger.error("failed to get all accounts", e); + } finally { + DBHelper.closeConnection(conn); + } + + return account; + } + + public static Entity getEntityById(String tableName,String id) { + Connection conn = null; + Entity entity = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler h = new BeanHandler(Entity.class); + + entity = run.query(conn, "SELECT * FROM "+tableName + " where id=?", h, id); + + } catch (SQLException e) { + logger.error("failed to get all entity", e); + } finally { + DBHelper.closeConnection(conn); + } + + return entity; + } + + public static CRMUser[] getAllCRMUsersArray() { + return getAllCRMUsers().toArray(new CRMUser[0]); + } + + public static List getAllCRMUsers() { + List users = Lists.newArrayList(); + Connection conn = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler> h = new BeanListHandler(CRMUser.class); + + users = run.query(conn, "SELECT * FROM crmuser", h); + + } catch (SQLException e) { + logger.error("failed to get all crm users", e); + } finally { + DBHelper.closeConnection(conn); + } + return users; + } + + public static CRMUser getCRMUserInfoById(int id) { + Connection conn = null; + CRMUser user = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler h = new BeanHandler(CRMUser.class); + + user = run.query(conn, "SELECT * FROM crmuser where id=?", h, id); + + } catch (SQLException e) { + logger.error("failed to get user", e); + } finally { + DBHelper.closeConnection(conn); + } + + return user; + } + + public static CRMUser getCrmUserByAccountId(int id) { + Connection conn = null; + CRMUser user = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler h = new BeanHandler(CRMUser.class); + + user = run.query(conn, "SELECT crmuser.* FROM crmuser inner join accountcrmuser on crmuser.id = accountcrmuser.crmuserid where accountcrmuser.accountid=?", h, id); + + } catch (SQLException e) { + logger.error("failed to get user", e); + } finally { + DBHelper.closeConnection(conn); + } + + return user; + } + + public static void insertRelationOfAccountIDCRMUserID(int accountId, int userId) throws Exception { + // Account account = accountIndexTable.get(accountId); + CRMUser user = DAOImpl.getCRMUserInfoById(userId); + Account account = DAOImpl.getAccountById(accountId); + if (account != null && account.getId() != 0 && user != null && user.getId() != 0) { + Connection conn = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + int inserts = run.update(conn, "INSERT INTO accountcrmuser (accountId,crmuserId) VALUES (?,?)", account.getId(), user.getId()); + + logger.info(String.format("%s row inserted into insertRelationOfAccountIDCRMUserID!", inserts)); + + } catch (SQLException e) { + logger.error("failed to insertRelationOfAccountIDCRMUserID", e); + } finally { + DBHelper.closeConnection(conn); + } + + } + + } + + public static void insertAudit(String entityName, String columnName,String oldValue,String newValue,String entityId,String userName) throws Exception { + Connection conn = null; + long ts= System.currentTimeMillis(); + SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String date_value = dateformat.format(ts); + try { + conn = DBHelper.getConnection(); + QueryRunner run = new QueryRunner(); + int inserts = run.update(conn, "INSERT INTO data_audit (entity_name,record_id,modify_time,modifier,column_name,old_value,new_value) VALUES (?,?,?,?,?,?,?)",entityName,entityId,date_value,userName,columnName,oldValue,newValue); + + logger.info(String.format("%s row inserted into insertRelationOfAccountIDCRMUserID!", inserts)); + + } catch (SQLException e) { + logger.error("failed to insertRelationOfAccountIDCRMUserID", e); + } finally { + DBHelper.closeConnection(conn); + } + + } + + public static void insertRelationOfEntityIDCRMUserID(String entityName, String cId, String userId ,int type) throws Exception { + int contactId = Integer.parseInt(cId); + int uid = Integer.parseInt(userId); + if (contactId != 0 && uid != 0) { + String sql = ""; + long ts= System.currentTimeMillis(); + SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String date_value = dateformat.format(ts); + if(entityName.equalsIgnoreCase("contact")){ + sql = "INSERT INTO contactcrmuser (crmuserId,contactId) VALUES (?,?)"; + }else if(entityName.equalsIgnoreCase("account")){ + sql = "INSERT INTO accountcrmuser (crmuserId,accountId) VALUES (?,?)"; + }else if(entityName.equalsIgnoreCase("userInfo")){ + sql = "INSERT INTO user_position (positionId,userId,whenadded,isPrimary) VALUES (?,?,?,?)"; + }else if(entityName.equalsIgnoreCase("crmuser")){ + if(type == 0||type==4){ + sql = "INSERT INTO accountcrmuser (accountId,crmuserId) VALUES (?,?)"; + }else if(type == 1){ + sql = "INSERT INTO contactcrmuser (contactId,crmuserId) VALUES (?,?)"; + }else if(type == 2){ + sql = "INSERT INTO user_position (userId,positionId,whenadded,isPrimary) VALUES (?,?,?,?)"; + }else{ + sql = "update crmuser set reportto = ? where id = "+userId+" "; + } + } + int isPrimary = 1; + Connection conn = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + int inserts = 0; + if(entityName.equalsIgnoreCase("userinfo")||type==2){ + inserts = run.update(conn, sql, userId,cId,date_value,isPrimary); + }else if(type == 3){ + inserts = run.update(conn, sql, cId); + }else { + inserts = run.update(conn, sql, userId,cId); + } + + logger.info(String.format("%s row inserted into insertRelationOfEntityIDCRMUserID!", inserts)); + + } catch (SQLException e) { + logger.error("failed to insertRelationOfEntityIDCRMUserID", e); + } finally { + DBHelper.closeConnection(conn); + } + + } + + } + + + public static List getEventsByUserId(int userId) { + List events = Lists.newArrayList(); + Connection conn = null; + SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + try { + + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler> h = new BeanListHandler(CalendarEvent.class); + + events = run.query(conn, "SELECT * FROM activitycrmuser where crmuserId=?", h, userId); + logger.debug("events:"+events.size()); + for (CalendarEvent e : events) { + e.setStart(sd.format(new Date(e.getStarttime()))); + e.setEnd(sd.format(new Date(e.getEndtime()))); + } + } catch (SQLException e) { + logger.error("failed to getEventsByUserId:" + userId, e); + } finally { + DBHelper.closeConnection(conn); + } + + return events; + } + + + public static List getEventsByEventId(int id) { + List events = Lists.newArrayList(); + Connection conn = null; + SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + try { + + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler> h = new BeanListHandler(CalendarEvent.class); + + events = run.query(conn, "SELECT * FROM activity where id=?", h, id); + for (CalendarEvent e : events) { + e.setStart(sd.format(new Date(e.getStarttime()))); + e.setEnd(sd.format(new Date(e.getEndtime()))); + } + } catch (SQLException e) { + logger.error("failed to getEventsByEventId:" + id, e); + } finally { + DBHelper.closeConnection(conn); + } + + return events; + } + + + public static List getMenuByRole(int roleId) { + List menulist = Lists.newArrayList(); + menulist.add("home"); + menulist.add("calendar"); + menulist.add("account"); + menulist.add("contact"); + menulist.add("activity"); + menulist.add("coaching"); + return menulist; + } + + public static List getTableData(String tableName, List colunmNames, int first, int count) { + String queryColunm = Joiner.on(",").join(colunmNames); + String query = "select " + queryColunm + " from " + tableName + " limit " + first + ", " + count; + + Connection conn = null; + List lMap = Lists.newArrayList(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + lMap = (List) run.query(conn, query, new MapListHandler()); + + } catch (SQLException e) { + logger.error("failed to get user", e); + } finally { + DBHelper.closeConnection(conn); + } + + return lMap; + + } + + public static List queryEntityRelationList(String sql, String... params) { + Connection conn = null; + List lMap = Lists.newArrayList(); + try { + + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + lMap = (List) run.query(conn, sql, new MapListHandler(), params); + + } catch (SQLException e) { + logger.error("failed to queryEntityRelationList", e); + } finally { + DBHelper.closeConnection(conn); + } + return lMap; + } + + public static List queryEntityWithFilter(String sql, String filterField, List filters, String... params) { + + List joinedFilter = Lists.newArrayList(); + if (filters.size() > 0) { + for (String f : filters) { + if(f.equalsIgnoreCase("-1")){ + joinedFilter.add(filterField + " is NULL "); + }else{ + joinedFilter.add(filterField + " = " + f); + } + + } + sql = sql + " where (" + Joiner.on(" OR ").join(joinedFilter) + ")"; + } else { + sql = sql + " where " + filterField + " = -1"; + } + Connection conn = null; + List lMap = Lists.newArrayList(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + lMap = (List) run.query(conn, sql, new MapListHandler(), params); + + } catch (SQLException e) { + logger.error("failed to get entity", e); + } finally { + DBHelper.closeConnection(conn); + } + + return lMap; + + } + + public static List queryEntityList(String sql, int first, int count) { + String query = sql + " limit " + first + ", " + count; + logger.debug(query); + Connection conn = null; + List lMap = Lists.newArrayList(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + lMap = (List) run.query(conn, query, new MapListHandler()); + List maplist = (List) lMap; + logger.debug(maplist.get(0).keySet()); + + } catch (SQLException e) { + logger.error("failed to get user", e); + } finally { + DBHelper.closeConnection(conn); + } + + return lMap; + + } + + + public static Map queryEntityById(String sql, String id) { + String query = sql.replace("?", id); + + Connection conn = null; + Map map = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + map = (Map) run.query(conn, query, new MapHandler()); + + } catch (SQLException e) { + logger.error("failed to get user", e); + } finally { + DBHelper.closeConnection(conn); + } + + return map; + } + + public static String queryEntityByName(String name) { + Connection conn = null; + int id = 0; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + Statement st = conn.createStatement(); + ResultSet rs = st.executeQuery("select id from crmdb.account where name = '" + name + "'"); + rs.next(); + id = rs.getInt(1); + rs.close(); + st.close(); + } catch (SQLException e) { + logger.error("failed to get user", e); + } finally { + DBHelper.closeConnection(conn); + } + return String.valueOf(id); + } + + /*** + * 获得目标医生拜访频率统计 + * @param userId + * @return + */ + public static Map stat4ContactVisitingFrequencyByUserId(String userId) { + String query = "select * from (select * from contact_grade_pl as grade_pl " + + "left join (select grade, count(contact.id) as num_of_contact from contactcrmuser,contact " + + "where contactcrmuser.crmuserId=? AND contact.id=contactcrmuser.contactId group by grade) as countact_count" + + " on grade_pl.id = countact_count.grade) as joined_countact_count left " + + "join (select grade, count(activity.id) as num_of_activity from activity,contact where " + + "activity.contactId=contact.id AND activity.status=2 AND activity.crmuserId=? group by contact.grade) as " + + "activity_count on activity_count.grade = joined_countact_count.grade"; + logger.debug(query); + Connection conn = null; + List> list = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + list = run.query(conn, query, new MapListHandler(),userId,userId); + + } catch (SQLException e) { + logger.error("failed to getStat4ContactVisitingFrequencyByUserId:"+userId, e); + } finally { + DBHelper.closeConnection(conn); + } + + Map map = Maps.newLinkedHashMap(); + if(list!=null){ + for(Map m:list){ + map.put((String)m.get("val"),m); + } + } + return map; + + } + + + /*** + * 获得目标医生拜访覆盖率统计 + * @param userId + * @return + */ + public static Map stat4ContactVisitingCoverRateByUserId(String userId) { + String query = "select * from (select * from contact_grade_pl as " + + "grade_pl left join (select grade, count(contact.id) as num_of_contact " + + "from contactcrmuser,contact where contactcrmuser.crmuserId=? AND " + + "contact.id=contactcrmuser.contactId group by grade) as countact_count " + + "on grade_pl.id = countact_count.grade) as joined_countact_count " + + "left join (select grade, count(distinct contactId) as " + + "num_of_visited_contact from activity,contact where " + + "activity.contactId=contact.id AND activity.crmuserId=? group by contact.grade) " + + "as visited_contact_count on visited_contact_count.grade = joined_countact_count.grade"; + logger.debug(query); + Connection conn = null; + List> list = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + list = run.query(conn, query, new MapListHandler(),userId,userId); + + } catch (SQLException e) { + logger.error("failed to stat4ContactVisitingCoverRateByUserId:"+userId, e); + } finally { + DBHelper.closeConnection(conn); + } + + Map map = Maps.newLinkedHashMap(); + if(list!=null){ + for(Map m:list){ + map.put((String)m.get("val"),m); + } + } + return map; + + } + + + public static Map getEntityData(String tableName, List colunmNames, long id) { + String queryColunm = Joiner.on(",").join(colunmNames); + String query = "select * from " + tableName + " where id= " + id; + logger.debug("query entity:" + query); + Connection conn = null; + Map map = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + map = (Map) run.query(conn, query, new MapHandler()); + + } catch (SQLException e) { + logger.error("failed to get user", e); + } finally { + DBHelper.closeConnection(conn); + } + + return map; + + } + + public static String queryCachedRelationDataById(final String tableName, final String id){ + String value = ""; + try{ + value = relationDataCache.get(tableName + "_" + id, new Callable() { + @Override + public String call() throws Exception { + return queryRelationDataById(tableName,id); + } + }); + }catch(Exception e){ + logger.error("Failed to get data from cache",e); + } + + //logger.debug("hitRate:"+pickListCache.stats().hitRate() + " size:"+ pickListCache.size()); + return value; + } + + + public static String queryRelationDataById(final String tableName, final String id){ + String query=""; + if(tableName.equals("province")){ + query = "select id, val from " + tableName + " where id=? "; + }else{ + query = "select id, name from " + tableName + " where id=? "; + } + String result = ""; + Connection conn = null; + Map map = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + map = (Map) run.query(conn, query, new MapHandler(), id); + if (map != null) { + Object value=null; + if(tableName.equals("province")){ + value = map.get("val"); + }else{ + value = map.get("name"); + } + if (value != null) { + result = (String) value; + } + } + + } catch (SQLException e) { + logger.error("failed to get queryPickListById", e); + } finally { + DBHelper.closeConnection(conn); + } + return result; + } + + + public static String queryPickListByIdCached(final String picklist, final String id){ + String value = ""; + try{ + value = pickListCache.get(picklist + "_" + id, new Callable() { + @Override + public String call() throws Exception { + return queryPickListById(picklist,id); + } + }); + }catch(Exception e){ + logger.error("Failed to get data from cache",e); + } + + //logger.debug("hitRate:"+pickListCache.stats().hitRate() + " size:"+ pickListCache.size()); + return value; + } + + public static String queryPickListById(String picklist, String id) { + String query = "select id, val from " + picklist + " where id=? "; + // logger.debug(query); + String result = ""; + Connection conn = null; + Map map = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + map = (Map) run.query(conn, query, new MapHandler(), id); + if (map != null) { + Object value = map.get("val"); + if (value != null) { + result = (String) value; + } + } + + } catch (SQLException e) { + logger.error("failed to get queryPickListById", e); + } finally { + DBHelper.closeConnection(conn); + } + + return result; + + } + + public static List queryPickList(String picklist) { + String query = null; + if(picklist.equalsIgnoreCase("product")){ + query = "select id, name from " + picklist; + }else{ + query = "select id, val from " + picklist; + } + List choices = Lists.newArrayList(); + Connection conn = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler> h = new BeanListHandler(Choice.class); + choices = run.query(conn, "SELECT * FROM " + picklist, h); + + } catch (SQLException e) { + logger.error("failed to get queryPickListById", e); + } finally { + DBHelper.closeConnection(conn); + } + + return choices; + + } + + public static List queryPickListByFilter(String picklist,String filterName, String filterValue) { + String query = null; + if(picklist.equalsIgnoreCase("product")){ + query = "select id, name from " + picklist + " where "+filterName+"=?"; + }else{ + query = "select id, val from " + picklist + " where "+filterName+"=?"; + } + List choices = Lists.newArrayList(); + Connection conn = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler> h = new BeanListHandler(Choice.class); + choices = run.query(conn, query, h,filterValue); + + } catch (SQLException e) { + logger.error("failed to get queryPickListById", e); + } finally { + DBHelper.closeConnection(conn); + } + + return choices; + + } + + + public static List queryRelationDataList(String tablename,String userId) { + Entity entity = Configuration.getEntityByName(tablename); + List choices = Lists.newArrayList(); + List list = DAOImpl.queryEntityRelationList(entity.getSql(), userId); + + for(Map map:(List)list){ + Choice c = new Choice(); + c.setId(((Number)map.get("id")).longValue()); + c.setVal((String)map.get("name")); + choices.add(c); + } + + return choices; + + } + + public static List queryExternalIds(String tablename,String externalIdFieldName) { + String sql = "select * from "+ tablename; + List choices = Lists.newArrayList(); + List list = DAOImpl.queryEntityRelationList(sql); + + for(Map map:(List)list){ + Choice c = new Choice(); + c.setId(((Number)map.get("id")).longValue()); + c.setVal((String)map.get(externalIdFieldName)); + choices.add(c); + } + + return choices; + + } + + + + + public static List>> queryFilters(String sourceTableSQL, String filterField, String filterbyTable, String... param) { + //sourceTableSQL = sourceTableSQL.replaceAll("?", user_id); + List choices = queryPickList(filterbyTable); + List>> res = Lists.newArrayList(); + // Connection conn = null; + // String query = null; + try { + // conn = DBConnector.getConnection(); + for (Choice ch : choices) { + + //query = "select count(a.id) as sum from (" + sourceTableSQL + " where " + filterField + " = " + ch.getId() + ") as a"; + // logger.debug("query is:" + query); + // QueryRunner run = new QueryRunner(); + /*Map map = run.query(conn, query, new MapHandler(), param); + if (map.get("sum") == null) { + map.put("sum", 0L); + }*/ + Map map = Maps.newHashMap(); + map.put("val", ch.getVal()); + res.add(Pair.of(String.valueOf(ch.getId()), map)); + } + } catch (Exception e) { + logger.error("failed to queryFilters", e); + } finally { + // DBHelper.closeConnection(conn); + } + return res; + } + + public static long addCalendarEvent(int crmuserId, int contactId, String type, String title, String start, String end,int status, + String owner,String modifier,String responsible_person,String visiting_purpose,String feature_product,int event_type,String participants) throws Exception { + int type_id = Integer.parseInt(type); + //logger.debug("modified date time:"+modify_datetime); + String sql = "INSERT INTO activity (crmuserId,contactId,endtime,starttime,title,activity_type," + + "status,owner,whenadded,modifier,modify_datetime ,responsible_person,visiting_purpose,feature_product,event_type,participants) " + + "VALUES (?,?,?,?,?,?,?,?,now(),?,now(),?,?,?,?,?)"; + Connection conn = null; + PreparedStatement statement = null; + ResultSet generatedKeys = null; + long key = -1; + try { + conn = DBConnector.getConnection(); + //QueryRunner run = new QueryRunner(); + //int inserts = 0; + //inserts += run.update(conn, sql, crmuserId, contactId, Long.parseLong(end) * 1000L, Long.parseLong(start) * 1000L, title, type_id, + /// status,owner,modifier,responsible_person,visiting_purpose,feature_product,event_type); + //logger.debug("inserted:" + inserts); + + statement = conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS); + fillStatement(statement,crmuserId, contactId, Long.parseLong(end) * 1000L, Long.parseLong(start) * 1000L, title, type_id, + status,owner,modifier,responsible_person,visiting_purpose,feature_product,event_type,participants); + + int affectedRows = statement.executeUpdate(); + if (affectedRows == 0) { + logger.error("Failed to insert data"); + return -1; + } + + generatedKeys = statement.getGeneratedKeys(); + if (generatedKeys.next()) { + //user.setId(generatedKeys.getLong(1)); + key = generatedKeys.getLong(1); + } else { + logger.error("failed to insert data"); + return -1; + } + + + } catch (Exception e) { + logger.error("failed to add new calendar event", e); + } finally { + DBHelper.closeConnection(conn); + } + + return key; + } + + public static long addCalendarEventForCoach(int crmuserId, int contactId, String type, String title, String start, String end,int status, + String owner,String modifier,String responsible_person,String visiting_purpose,String feature_product,int event_type,String participants, + int coach,String location,int total_score,String planing,String openling,String enquery_listening,String deliverable,String objection_handing,String summary) throws Exception { + int type_id =Integer.valueOf(type).intValue(); + if(event_type==2){ + type_id= 3; + } + //logger.debug("modified date time:"+modify_datetime); + String sql = "INSERT INTO activity (crmuserId,contactId,endtime,starttime,title,activity_type," + + "status,owner,whenadded,modifier,modify_datetime ,responsible_person,visiting_purpose," + + "feature_product,event_type,participants,coacheeId,location,total_score,planing,openling,enquery_listening,deliverable,objection_handing,summary) " + + "VALUES (?,?,?,?,?,?,?,?,now(),?,now(),?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + Connection conn = null; + PreparedStatement statement = null; + ResultSet generatedKeys = null; + long key = -1; + try { + conn = DBConnector.getConnection(); + statement = conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS); + fillStatement(statement,crmuserId, contactId, Long.parseLong(end) * 1000L, Long.parseLong(start) * 1000L, title, type_id, + status,owner,modifier,responsible_person,visiting_purpose,feature_product,event_type,participants + ,coach,location,total_score,planing,openling,enquery_listening,deliverable,objection_handing,summary); + System.out.println("visiting_purpose:"+visiting_purpose); + int affectedRows = statement.executeUpdate(); + if (affectedRows == 0) { + logger.error("Failed to insert data"); + return -1; + } + generatedKeys = statement.getGeneratedKeys(); + if (generatedKeys.next()) { + key = generatedKeys.getLong(1); + } else { + logger.error("failed to insert data"); + return -1; + } + } catch (Exception e) { + logger.error("failed to add new calendar event", e); + } finally { + DBHelper.closeConnection(conn); + } + + return key; + } + + + private static void fillStatement(PreparedStatement stmt, Object... params) + throws SQLException { + + if (params == null) { + return; + } + ParameterMetaData pmd = stmt.getParameterMetaData(); + for (int i = 0; i < params.length; i++) { + stmt.setObject(i + 1, params[i]); + /*if (params[i] != null) { + stmt.setObject(i + 1, params[i]); + } else { + stmt.setNull(i + 1, pmd.getParameterType(i + 1)); + } +*/ } + } + + + public static void updateCalendarEvent(String entityId, String contactId, String type, String title, String start, String end,int status, + String modifier,String visiting_purpose,String feature_product) throws Exception { + int type_id = Integer.parseInt(type); + String sql = "update activity SET contactId=?,endtime=?,starttime=?,title=?,activity_type=?,status=?,"+ + "modifier=?,modify_datetime=?,visiting_purpose=?,feature_product=? where id=?"; + Connection conn = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + int inserts = 0; + inserts += run.update(conn, sql, contactId, Long.parseLong(end) * 1000L, Long.parseLong(start) * 1000L, title, type_id, + status,modifier,new Date(),visiting_purpose,feature_product,entityId); + logger.debug("updated ok:" + inserts); + } catch (Exception e) { + logger.error("failed to updateCalendarEvent", e); + } finally { + DBHelper.closeConnection(conn); + } + } + + public static void updateCalendarEventForCoach(String entityId,String crmuserId,String start, String end, + String modifier,int coach,String location,int total_score,String planing,String openling,String enquery_listening,String deliverable,String objection_handing,String summary,String name) throws Exception { + String sql = "update activity SET crmuserID =?,endtime=?,starttime=?,"+ + "modifier=?,modify_datetime=?,coachId=?,location=?,total_score=?,planing=?,openling=?,enquery_listening=?,deliverable=?,objection_handing=?,summary=?,title=? where id=?"; + Connection conn = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + int inserts = 0; + inserts += run.update(conn, sql,crmuserId,Long.parseLong(end) * 1000L, Long.parseLong(start) * 1000L, + modifier,new Date(),coach,location,total_score,planing,openling,enquery_listening,deliverable,objection_handing,summary,name,entityId); + logger.debug("updated ok:" + inserts); + } catch (Exception e) { + logger.error("failed to updateCalendarEvent", e); + } finally { + DBHelper.closeConnection(conn); + } + } + + public static void addExternalMeeting(int crmuserId, int[] contactIds, String title, long start, long end, int status,String meeting_type,String coachId) throws Exception { + //int type_id = Integer.parseInt(type); + String sql = "INSERT INTO externalMeeting (crmuserId,contactIds,endtime,starttime,title,status,activity_type,coachId) VALUES (?,?,?,?,?,?,?,?)"; + Connection conn = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + int inserts = 0; + CalendarEvent e = new CalendarEvent(); + e.setTitle("拜访"); + e.setStarttime(start * 1000L); + e.setEndtime(end * 1000L); + e.setCrmUserId(crmuserId); + //e.setActivity_type(type_id); + //e.setContactId(contactId); + //e.setContactIds(contactIds); + e.setStatus(status); + Gson gson = new Gson(); + inserts += run.update(conn, sql, e.getCrmUserId(), gson.toJson(contactIds, int[].class), e.getEndtime(), e.getStarttime(), e.getTitle(), e.getStatus(),Integer.parseInt(meeting_type),Integer.parseInt(coachId)); + System.out.println("inserted:" + inserts); + } catch (Exception e) { + logger.error("failed to add new calendar event", e); + } finally { + DBHelper.closeConnection(conn); + } + } + public static long createNewCrmUser(String entityName,List fieldNames,List values,String userId){ + String fieldssql = Joiner.on(",").join(fieldNames); + String valuesql = Joiner.on(",").join(values); + fieldssql = fieldssql + ",num_of_signIn,password"; + valuesql = valuesql + ",0,'"+DigestUtils.md5Hex("12345")+"'"; + logger.debug("fieldssql sql is:"+fieldssql); + logger.debug("valuesql sql is:"+valuesql); + String sql = "INSERT INTO "+entityName+" ("+fieldssql+") VALUES ("+valuesql+")"; + + logger.debug("insert sql is:"+sql); + + Connection conn = null; + //PreparedStatement statement = null; + ResultSet generatedKeys = null; + PreparedStatement statement = null; + long key=-1; + try { + conn = DBConnector.getConnection(); + statement = conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS); + int affectedRows = statement.executeUpdate(); + + generatedKeys = statement.getGeneratedKeys(); + if (generatedKeys.next()) { + //user.setId(generatedKeys.getLong(1)); + key = generatedKeys.getLong(1); + } else { + logger.error("failed to insert data"); + return -1; + } + System.out.println("add crmuser is True"); + return key; + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } finally { + if (generatedKeys != null) try { generatedKeys.close(); } catch (SQLException logOrIgnore) {} + if (statement != null) try { statement.close(); } catch (SQLException logOrIgnore) {} + if (conn != null) try { conn.close(); } catch (SQLException logOrIgnore) {} + } + return -1L; + } + + public static int updateRecord4Import(String table,List fieldNames,List values, String byfieldname, String fieldvalue){ + String sql = ""; + int i=0; + for(String name:fieldNames){ + if(i==0){ + sql = name +" = "+ values.get(i) ; + }else{ + sql = sql + "," + name +" = "+ values.get(i) ; + } + i++; + } + sql = "UPDATE "+table+ " SET "+sql+" where "+byfieldname+" = ?" ; + + logger.debug("UPDATE sql is:"+sql); + Connection conn = null; + int inserts = 0; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + + inserts += run.update(conn, sql,fieldvalue); + + System.out.println("inserted:" + inserts); + } catch (Exception e) { + logger.error("failed to add new calendar event", e); + } finally { + DBHelper.closeConnection(conn); + } + + return inserts; + } + + public static Map queryRecordByField(String table, String fieldName, String fieldValue){ + + String query = "select * from "+ table + " where "+fieldName + " = ?"; + + Connection conn = null; + Map map = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + map = run.query(conn, query, new MapHandler(),fieldValue); + + } catch (SQLException e) { + logger.error("failed to get user", e); + } finally { + DBHelper.closeConnection(conn); + } + + return map; + + } + + public static long importRecord(String table, List fNames, List fvalues){ + List names = Lists.newArrayList(fNames); + List values = Lists.newArrayList(fvalues); + + SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm"); + names.add("whenadded"); + values.add("'"+dateformat.format(new Date())+"'"); + names.add("owner"); + values.add("'数据导入模块'"); + + String fieldssql = Joiner.on(",").join(names); + String valuesql = Joiner.on(",").join(values); + + logger.debug("fieldssql sql is:"+fieldssql); + logger.debug("valuesql sql is:"+valuesql); + String sql = "INSERT INTO "+table+" ("+fieldssql+") VALUES ("+valuesql+")"; + + logger.debug("insert sql is:"+sql); + + Connection conn = null; + //PreparedStatement statement = null; + ResultSet generatedKeys = null; + PreparedStatement statement = null; + long key = -1; + try { + conn = DBConnector.getConnection(); + + statement = conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS); + + int affectedRows = statement.executeUpdate(); + if (affectedRows == 0) { + logger.error("Failed to insert data"); + return -1; + } + + generatedKeys = statement.getGeneratedKeys(); + if (generatedKeys.next()) { + //user.setId(generatedKeys.getLong(1)); + key = generatedKeys.getLong(1); + } else { + logger.error("failed to insert data"); + return -1; + } + + } catch (Exception e) { + logger.error("failed to add new calendar event", e); + } finally { + if (generatedKeys != null) try { generatedKeys.close(); } catch (SQLException logOrIgnore) {} + if (statement != null) try { statement.close(); } catch (SQLException logOrIgnore) {} + if (conn != null) try { conn.close(); } catch (SQLException logOrIgnore) {} + } + + return key; + + } + + + public static long insertImportMetaInfo(String entityName,String import_file_name){ + String sql = "INSERT INTO importMetaInfo (name,entity_name,importfilename,whenadded,result) VALUES ('fakename','"+entityName+"','"+import_file_name+"',now(),NULL)"; + + Connection conn = null; + //PreparedStatement statement = null; + ResultSet generatedKeys = null; + PreparedStatement statement = null; + long key = -1; + try { + conn = DBConnector.getConnection(); + + statement = conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS); + + int affectedRows = statement.executeUpdate(); + if (affectedRows == 0) { + logger.error("Failed to insert data"); + return -1; + } + + generatedKeys = statement.getGeneratedKeys(); + if (generatedKeys.next()) { + //user.setId(generatedKeys.getLong(1)); + key = generatedKeys.getLong(1); + } else { + logger.error("failed to insert data"); + return -1; + } + + } catch (Exception e) { + logger.error("failed to insertImportMetaInfo", e); + } finally { + if (generatedKeys != null) try { generatedKeys.close(); } catch (SQLException logOrIgnore) {} + if (statement != null) try { statement.close(); } catch (SQLException logOrIgnore) {} + if (conn != null) try { conn.close(); } catch (SQLException logOrIgnore) {} + } + + return key; + + } + + public static boolean updateImportMetaInfoById( String logfilename,int num_of_total_record, int num_of_imported,int num_of_failed,int num_of_updated,int result,long id){ + String sql = "UPDATE importMetaInfo SET logfilename=?,num_of_total_record=?,num_of_imported=?,num_of_failed=?,result=?,status=?,num_of_updated=? where id=?"; + logger.debug("sql:"+sql); + Connection conn = null; + int inserts = 0; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + inserts += run.update(conn, sql,logfilename,num_of_total_record,num_of_imported,num_of_failed,result,1,num_of_updated,id); + } catch (Exception e) { + logger.error("failed to activity", e); + } finally { + DBHelper.closeConnection(conn); + } + if(inserts>0){ + return true; + } + return false; + } + + public static long createNewRecord(String entityName, List fieldNames, List values,String userId){ + String fieldssql = Joiner.on(",").join(fieldNames); + String valuesql = Joiner.on(",").join(values); + if(entityName.equals("coaching")){ + entityName= "activity"; + fieldssql = fieldssql + ",event_type"; + valuesql = valuesql + "," +2; + fieldssql = fieldssql + ",status"; + valuesql = valuesql + "," +1; + fieldssql = fieldssql + ",activity_coachType"; + valuesql = valuesql + "," +1; + }else if(entityName.equals("activity")){ + fieldssql = fieldssql.replaceAll("accountId,","").trim(); + fieldssql = fieldssql + ",crmuserId"; + valuesql = valuesql + "," +userId; + + fieldssql = fieldssql + ",event_type"; + valuesql = valuesql + "," +1; + fieldssql = fieldssql + ",status"; + valuesql = valuesql + "," +1; + }else if(entityName.equals("willcoaching")){ + entityName= "activity"; + fieldssql = fieldssql + ",event_type"; + valuesql = valuesql + "," +2; + fieldssql = fieldssql + ",status"; + valuesql = valuesql + "," +1; + fieldssql = fieldssql + ",activity_coachType"; + valuesql = valuesql + "," +2; + } + logger.debug("fieldssql sql is:"+fieldssql); + logger.debug("valuesql sql is:"+valuesql); + String sql = "INSERT INTO "+entityName+" ("+fieldssql+") VALUES ("+valuesql+")"; + + logger.debug("insert sql is:"+sql); + + Connection conn = null; + //PreparedStatement statement = null; + ResultSet generatedKeys = null; + PreparedStatement statement = null; + long key = -1; + try { + conn = DBConnector.getConnection(); + + statement = conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS); + + int affectedRows = statement.executeUpdate(); + if (affectedRows == 0) { + logger.error("Failed to insert data"); + return -1; + } + + generatedKeys = statement.getGeneratedKeys(); + if (generatedKeys.next()) { + //user.setId(generatedKeys.getLong(1)); + key = generatedKeys.getLong(1); + } else { + logger.error("failed to insert data"); + return -1; + } + + } catch (Exception e) { + logger.error("failed to add new calendar event", e); + } finally { + if (generatedKeys != null) try { generatedKeys.close(); } catch (SQLException logOrIgnore) {} + if (statement != null) try { statement.close(); } catch (SQLException logOrIgnore) {} + if (conn != null) try { conn.close(); } catch (SQLException logOrIgnore) {} + } + + return key; + + } + + public static void insert2UserRelationTable(String entityName,String userId,String positionId,String coacheePositionId,String entityId){ + String sql = null; + long ts= System.currentTimeMillis(); + SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String date_value = dateformat.format(ts); + if(entityName.equalsIgnoreCase("account_delect")){//暂不需要 + sql = "INSERT INTO accountcrmuser ( accountId, crmuserId) VALUES ("+entityId+","+positionId+")"; + }else if(entityName.equalsIgnoreCase("contact_delect")){//暂不需要 + sql = "INSERT INTO contactcrmuser ( contactId, crmuserId) VALUES ("+entityId+","+positionId+")"; + }else if(entityName.equalsIgnoreCase("activity")){ + sql = "INSERT INTO activitycrmuser ( activityId, crmuserId) VALUES ("+entityId+","+positionId+")"; + }else if (entityName.equalsIgnoreCase("coaching")||entityName.equalsIgnoreCase("willCoaching")){ + sql = "INSERT INTO activitycrmuser ( activityId,crmuserId) VALUES ("+entityId+","+positionId+")"; + insertActivityCrmuserTable(entityId,coacheePositionId); + }else if (entityName.equalsIgnoreCase("userinfo")){ + sql = "INSERT INTO user_position ( userId,positionId,status,isPrimary,whenadded) VALUES ("+userId+","+positionId+",1,1,'"+date_value+"')"; + } + if(sql == null) { + logger.error("entityName error"); + return; + } + + Connection conn = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + int inserts = 0; + inserts += run.update(conn, sql); + + System.out.println("inserted:" + inserts); + } catch (Exception e) { + logger.error("failed to add new calendar event", e); + } finally { + DBHelper.closeConnection(conn); + } + } + + public static void insertActivityCrmuserTable(String activityId,String crmuserId){ + String sql = "INSERT INTO activitycrmuser ( activityId,crmuserId) VALUES ("+activityId+","+crmuserId+")"; + + if(sql == null) { + logger.error("entityName error"); + return; + } + + Connection conn = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + int inserts = 0; + inserts += run.update(conn, sql); + + System.out.println("inserted:" + inserts); + } catch (Exception e) { + logger.error("failed to add new calendar event", e); + } finally { + DBHelper.closeConnection(conn); + } + } + public static boolean updateRecord(String id,String entityName, List fieldNames, List values ) { + String sql = ""; + int i=0; + for(String name:fieldNames){ + if(i==0){ + sql = name +" = "+ values.get(i) ; + }else{ + sql = sql + "," + name +" = "+ values.get(i) ; + } + i++; + } + sql = sql.replaceAll("accountName","accountId").trim(); + if(entityName.equalsIgnoreCase("coaching")){ + sql = "UPDATE activity SET "+sql+" where id = " + id; +// }else if(entityName.equalsIgnoreCase("user_position")){ +// sql = "UPDATE "+entityName+ " SET "+sql+" where userId = " + id; + }else{ + sql = "UPDATE "+entityName+ " SET "+sql+" where id = " + id; + } + logger.debug("UPDATE sql is:"+sql); + Connection conn = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + int inserts = 0; + inserts += run.update(conn, sql); + + System.out.println("inserted:" + inserts); + return true; + } catch (Exception e) { + logger.error("failed to add new calendar event", e); + return false; + } finally { + DBHelper.closeConnection(conn); + } + } + public static void updateRecordStatus(String id,String entityName ) { + String sql = ""; + sql = "UPDATE "+entityName+" SET status = 2 where id = " + id; + logger.debug("UPDATE sql is:"+sql); + Connection conn = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + int inserts = 0; + inserts += run.update(conn, sql); + + System.out.println("inserted:" + inserts); + } catch (Exception e) { + logger.error("failed to add new calendar event", e); + } finally { + DBHelper.closeConnection(conn); + } + } + + + public static void updateProductCategoryWhenEditProduct(String productid,String target) { + String sql="select * from productcategory where productId="+productid; + List> lt=DAOImpl.queryEntityRelationList(sql); + List fieldNames=Lists.newArrayList(); + fieldNames.add("productlineId"); + List values=Lists.newArrayList(); + values.add(target); + String id=""; + for(int i=0;i fieldNames=Lists.newArrayList(); + fieldNames.add("productlineId"); + List values=Lists.newArrayList(); + values.add(target); + System.out.println("updateProductlineWhenEditcategory"); + System.out.println(fieldNames); + System.out.println(values); + updateRecord(id,"productcategory",fieldNames,values); + } + + public static void updateUserInfoPositionByUserId(String entityName, String userId) { + String sql = ""; + sql = "UPDATE "+entityName+" SET pl1 = 2 where id = " + userId; + logger.debug("UPDATE sql is:"+sql); + Connection conn = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + int inserts = 0; + inserts += run.update(conn, sql); + } catch (Exception e) { + logger.error("failed to add new calendar event", e); + } finally { + DBHelper.closeConnection(conn); + } + } + public static void insertUserPositionRelationTable(String entityName,String userId,String positionId, String entityId) { + String sql = ""; + long ts= System.currentTimeMillis(); + SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String date_value = dateformat.format(ts); + sql = "INSERT INTO user_position ( userId,positionId,status,isPrimary,createtime) VALUES ("+userId+","+positionId+",1,1,'"+date_value+"')"; + logger.debug("UPDATE sql is:"+sql); + Connection conn = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + int inserts = 0; + inserts += run.update(conn, sql); + } catch (Exception e) { + logger.error("failed to add new calendar event", e); + } finally { + DBHelper.closeConnection(conn); + } + } + public static void updatePositionByUserId( String userId) { + String sql = ""; + sql = "UPDATE userInfo SET positionId = -1 where id = " + userId; + logger.debug("UPDATE sql is:"+sql); + Connection conn = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + int inserts = 0; + inserts += run.update(conn, sql); + } catch (Exception e) { + logger.error("failed to add new calendar event", e); + } finally { + DBHelper.closeConnection(conn); + } + } + + public static void updateUserInfoPositionByPositionId( String positionId) { + String sql = ""; + sql = "UPDATE user_position SET status = 2 where positionId = " + positionId; + logger.debug("UPDATE sql is:"+sql); + Connection conn = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + int inserts = 0; + inserts += run.update(conn, sql); + } catch (Exception e) { + logger.error("failed to add new calendar event", e); + } finally { + DBHelper.closeConnection(conn); + } + } + public static int getLevelByPositionId(int positionId) { + Connection conn = null; + int level = 0; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + Map map = run.query(conn, "SELECT level FROM crmuser where id=?", new MapHandler(), positionId); + if(map != null && map.get("level") !=null){ + level = (int) map.get("level"); + } + } catch (SQLException e) { + logger.error("failed to get all accounts", e); + } finally { + DBHelper.closeConnection(conn); + } + + return level; + } +// public static void updatePositionByPositionId( String positionId) { +// String sql = ""; +// sql = "UPDATE userInfo SET positionId = -1 where positionId = " + positionId; +// logger.debug("UPDATE sql is:"+sql); +// Connection conn = null; +// try { +// conn = DBConnector.getConnection(); +// QueryRunner run = new QueryRunner(); +// int inserts = 0; +// inserts += run.update(conn, sql); +// } catch (Exception e) { +// logger.error("failed to add new calendar event", e); +// } finally { +// DBHelper.closeConnection(conn); +// } +// } + + public static void deleteProductRecord(String id,String entityName) { + if(entityName.trim().equals("product")){ + List> grandson=DAOImpl.queryEntityRelationList("Select id from productcategory where productId="+id); + for(int j=0;j> grandson=DAOImpl.queryEntityRelationList("Select id from "+sonEntity+" where "+sonEntityId+"="+id); + for(int j=0;j> grandson=DAOImpl.queryEntityRelationList("Select id from productcategory where productlineId="+id); + for(int j=0;j> grandson=DAOImpl.queryEntityRelationList("Select id from product where productlineId="+id); + for(int k=0;k h = new BeanHandler(UserInfo.class); + password = DigestUtils.md5Hex(password); + logger.debug("MD5 password is:" + password); + user = run.query(conn, "SELECT * FROM userInfo where loginName=? AND password=?", h, loginName, password); + + } catch (SQLException e) { + logger.error("failed to get all accounts", e); + } finally { + try { + DbUtils.close(conn); + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + return user; + } + + public static CRMUser getPositionInfoByUserId(int uid) { + System.out.println("登录"+uid); + Connection conn = null; + CRMUser user = new CRMUser(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler h = new BeanHandler(CRMUser.class); + user = run.query(conn, "SELECT * FROM crmuser where id=? ", h, uid); + + } catch (SQLException e) { + logger.error("failed to get all accounts", e); + } finally { + DBHelper.closeConnection(conn); + } + + return user; + } + + public static UserPosition getActivityPositionInfoByUserId(int uid) { + Connection conn = null; + UserPosition user = new UserPosition(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler h = new BeanHandler(UserPosition.class); + user = run.query(conn, "SELECT *,whenadded FROM user_position where userId=? group by whenadded desc limit 1 ", h, uid); + + } catch (SQLException e) { + logger.error("failed to get all accounts", e); + } finally { + DBHelper.closeConnection(conn); + } + + return user; + } + + public static UserPosition getUserPositionById(int uid) { + Connection conn = null; + UserPosition user = new UserPosition(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler h = new BeanHandler(UserPosition.class); + user = run.query(conn, "SELECT * from user_position where id=? ", h, uid); + + } catch (SQLException e) { + logger.error("failed to get all accounts", e); + } finally { + DBHelper.closeConnection(conn); + } + + return user; + } + + public static UserPosition getUserPositionByUserId(int uid) { + Connection conn = null; + UserPosition user = new UserPosition(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler h = new BeanHandler(UserPosition.class); + user = run.query(conn, "SELECT * from user_position where userId=? ", h, uid); + + } catch (SQLException e) { + logger.error("failed to get all accounts", e); + } finally { + DBHelper.closeConnection(conn); + } + + return user; + } + public static boolean isSessionValid(String sessionId, String sessionKey) { + boolean res = false; + Connection conn = null; + CRMUser user = new CRMUser(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler h = new BeanHandler(CRMUser.class); + user = run.query(conn, "SELECT * FROM crmuser where id=? AND password=?", h, sessionId, sessionKey); + if(user !=null){ + res = true; + } + + } catch (SQLException e) { + logger.error("failed to get all accounts", e); + } finally { + DBHelper.closeConnection(conn); + } + return res; + } + + //only support to judge account and contact + public static boolean isAllow2ReadEntity(String entityName, String id, String positionId) { + String query = ""; + + if(entityName.equalsIgnoreCase("account")){ + query = "select * from accountcrmuser where (crmuserId in (select crmuser.id from crmuser where crmuser.reportto = ?) or crmuserId=?) and accountId=? group by accountId"; + }else if(entityName.equalsIgnoreCase("contact")){ + query= "select * from (" + + " select * from accountcrmuser where (crmuserId in (select crmuser.id from crmuser where crmuser.reportto = ?) or crmuserId=?) group by accountId) as a " + + " left join contact on a.accountId = contact.accountId where contact.id=?"; + } + + logger.debug(String.format(query + "parms: %s id:%s positionId:%s", entityName,id,positionId)); + Connection conn = null; + List lMap = Lists.newArrayList(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + lMap = run.query(conn, query, new MapListHandler(),positionId,positionId,id); + if(lMap.size()>0) return true; + + } catch (SQLException e) { + logger.error("failed to get user", e); + } finally { + DBHelper.closeConnection(conn); + } + return false; + + } + + + public static List searchContact(String userId, String search_target) { + if(search_target == null|| search_target.equalsIgnoreCase("*")){ + search_target = ""; + } + String sql = "select * from (select contact.id as cid,contact.name as cname,account.name as aname from contact,account,contactcrmuser where contactcrmuser.crmuserId="+userId+" AND contactcrmuser.contactId = contact.id AND contact.accountId=account.id AND (contact.name like '%"+search_target+"%' OR account.name like '%"+search_target+"%')) as a"; + Connection conn = null; + List lMap = Lists.newArrayList(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + lMap = (List) run.query(conn, sql, new MapListHandler()); + + } catch (SQLException e) { + logger.error("failed to get user", e); + } finally { + DBHelper.closeConnection(conn); + } + + return lMap; + } + + public static List searchMergeContact(String search_target) { + if(search_target == null|| search_target.equalsIgnoreCase("*")){ + search_target = ""; + } + String sql = "select * from (select contact.*,contact.name as cname,account.name as aname from contact left join account ON contact.accountId = account.id left join contactcrmuser ON contact.id = contactcrmuser.contactId where contact.name like '%"+search_target+"%' OR account.name like '%"+search_target+"%' ) as a"; + Connection conn = null; + List lMap = Lists.newArrayList(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + lMap = (List) run.query(conn, sql, new MapListHandler()); + + } catch (SQLException e) { + logger.error("failed to get user", e); + } finally { + DBHelper.closeConnection(conn); + } + + return lMap; + } + + + public static List searchAccount(String userId, String search_target,int roleId) { + if(search_target == null|| search_target.equalsIgnoreCase("*")){ + search_target = ""; + } + String sql = "select * from account where (? is not null) AND account.id !=-1 AND name like '%"+search_target+"%' order by whenadded DESC"; + if(roleId != 1){ + sql = "SELECT * from (select account.* from accountcrmuser,account"+ + " where accountcrmuser.crmuserId=? AND account.id != -1 AND " + + "accountcrmuser.accountId=account.id AND (name like '%"+search_target+"%' ) order by whenadded DESC) as aAccount"; + } + Connection conn = null; + List lMap = Lists.newArrayList(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + lMap = (List) run.query(conn, sql, new MapListHandler(),userId); + + } catch (SQLException e) { + logger.error("failed to searchAccount", e); + } finally { + DBHelper.closeConnection(conn); + } + + return lMap; + } + + public static List searchCRMUserOfManager(String managerId,String search_target) { + if(search_target == null|| search_target.equalsIgnoreCase("*")){ + search_target = ""; + } + String sql = "select * from crmuser"; + if(managerId!=null){ + sql = "select * from (select * from crmuser where crmuser.id > 0 AND reportto="+managerId+" AND (name like '%"+search_target+"%' OR email like '%"+search_target+"%' OR cellPhone like '%"+search_target+"%')) as a"; + }else{ + sql = "select * from (select * from crmuser where crmuser.id > 0 AND (name like '%"+search_target+"%' OR email like '%"+search_target+"%' OR cellPhone like '%"+search_target+"%')) as a"; + } + logger.debug(sql ); + Connection conn = null; + List lMap = Lists.newArrayList(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + lMap = (List) run.query(conn, sql, new MapListHandler()); + + } catch (SQLException e) { + logger.error("failed to get user", e); + } finally { + DBHelper.closeConnection(conn); + } + + return lMap; + } + + public static List searchCRMUserByManager(String managerId,String search_target) { + if(search_target == null|| search_target.equalsIgnoreCase("*")){ + search_target = ""; + } + String sql = "select * from crmuser"; + sql = "select * from (select * from crmuser where crmuser.id > 0 AND reportto="+managerId+") as a"; + logger.debug(sql ); + Connection conn = null; + List lMap = Lists.newArrayList(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + lMap = (List) run.query(conn, sql, new MapListHandler()); + + } catch (SQLException e) { + logger.error("failed to get user", e); + } finally { + DBHelper.closeConnection(conn); + } + + return lMap; + } + + + public static List searchCRMUser(String search_target) { + if(search_target == null|| search_target.equalsIgnoreCase("*")){ + search_target = ""; + } + String sql = "select * from (select * from crmuser where (crmuser.id !=-1) AND (name like '%"+search_target+"%' OR code like '%"+search_target+"%' OR reportto like '%"+search_target+"%')) as a"; + logger.debug(sql ); + Connection conn = null; + List lMap = Lists.newArrayList(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + lMap = (List) run.query(conn, sql, new MapListHandler()); + + } catch (SQLException e) { + logger.error("failed to get user", e); + } finally { + DBHelper.closeConnection(conn); + } + return lMap; + } + + public static List searchUserPosition(String uid,String search_target) { + if(search_target == null|| search_target.equalsIgnoreCase("*")){ + search_target = ""; + } + String sql = "select * from ( select * from crmuser where id not in (select positionid from user_position ) and (crmuser.id !=-1) AND (name like '%"+search_target+"%' OR code like '%"+search_target+"%' OR reportto like '%"+search_target+"%')) as a"; + logger.debug(sql ); + Connection conn = null; + List lMap = Lists.newArrayList(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + lMap = (List) run.query(conn, sql, new MapListHandler()); + + } catch (SQLException e) { + logger.error("failed to get user", e); + } finally { + DBHelper.closeConnection(conn); + } + return lMap; + } + + + public static List searchPositionCRMUser(String search_target) { + if(search_target == null|| search_target.equalsIgnoreCase("*")){ + search_target = ""; + } + + String sql = "SELECT * FROM (select * from (select crmuser.*, user_position.positionId from crmuser left join user_position ON crmuser.id = user_position.positionId where user_position.positionId is null and crmuser.pl1=1) as crmuserposition where (crmuserposition.id !=-1 )AND (name like '%"+search_target+"%' OR code like '%"+search_target+"%' OR reportto like '%"+search_target+"%')) as a"; + logger.debug(sql ); + Connection conn = null; + List lMap = Lists.newArrayList(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + lMap = (List) run.query(conn, sql, new MapListHandler()); + + } catch (SQLException e) { + logger.error("failed to get user", e); + } finally { + DBHelper.closeConnection(conn); + } + + return lMap; + } + + public static List searchUser(String search_target) { + if(search_target == null|| search_target.equalsIgnoreCase("*")){ + search_target = ""; + } + String sql = "select * from (select * from userinfo where (userinfo.id !=-1) AND (name like '%"+search_target+"%' OR sex like '%"+search_target+"%' )) as a"; + logger.debug(sql ); + Connection conn = null; + List lMap = Lists.newArrayList(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + lMap = (List) run.query(conn, sql, new MapListHandler()); + + } catch (SQLException e) { + logger.error("failed to get user", e); + } finally { + DBHelper.closeConnection(conn); + } + + return lMap; + } + public static List searchManager(String search_target,String excludeId) { + if(search_target == null|| search_target.equalsIgnoreCase("*")){ + search_target = ""; + } + if(excludeId == null) excludeId = "-1"; + + String sql = "select * from (select * from crmuser where (crmuser.id !="+excludeId+") AND (role = 2 )AND (crmuser.id !=-1)AND (crmuser.pl1 !=2) AND (name like '%"+search_target+"%' OR reportto like '%"+search_target+"%' )) as a"; + logger.debug("searchManager:"+ sql ); + Connection conn = null; + List lMap = Lists.newArrayList(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + lMap = (List) run.query(conn, sql, new MapListHandler()); + + } catch (SQLException e) { + logger.error("failed to get user", e); + } finally { + DBHelper.closeConnection(conn); + } + + return lMap; + } + + public static List searchCoachee(String search_target,String excludeId,String userId) { + if(search_target == null|| search_target.equalsIgnoreCase("*")){ + search_target = ""; + } + if(excludeId == null) excludeId = "-1"; + + String sql = "select * from (select * from userInfo where (userInfo.id !="+excludeId+") AND (userInfo.id !=-1) AND (name like '%"+search_target+"%' )) as a"; + logger.debug("searchManager:"+ sql ); + Connection conn = null; + List lMap = Lists.newArrayList(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + lMap = (List) run.query(conn, sql, new MapListHandler()); + + } catch (SQLException e) { + logger.error("failed to get user", e); + } finally { + DBHelper.closeConnection(conn); + } + + return lMap; + } + + public static List searchCRMAccount(String search_target) { + if(search_target == null|| search_target.equalsIgnoreCase("*")){ + search_target = ""; + } + String sql = "select * from (select * from account where (account.id > 0 ) AND (name like '%"+search_target+"%' OR tel like '%"+search_target+"%' OR fax like '%"+search_target+"%')) as a"; + logger.debug(sql ); + Connection conn = null; + List lMap = Lists.newArrayList(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + lMap = (List) run.query(conn, sql, new MapListHandler()); + + } catch (SQLException e) { + logger.error("failed to get user", e); + } finally { + DBHelper.closeConnection(conn); + } + + return lMap; + } + + public static List searchCRMContact(String search_target) { + if(search_target == null|| search_target.equalsIgnoreCase("*")){ + search_target = ""; + } + String sql = "select * from (select * from contact where (contact.id > 0) AND (name like '%"+search_target+"%' OR office_tel like '%"+search_target+"%' OR cellphone like '%"+search_target+"%')) as a"; + logger.debug(sql ); + Connection conn = null; + List lMap = Lists.newArrayList(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + lMap = (List) run.query(conn, sql, new MapListHandler()); + + } catch (SQLException e) { + logger.error("failed to get user", e); + } finally { + DBHelper.closeConnection(conn); + } + + return lMap; + } + public static void removeEntityFromTeam(String teamtable, String id) { + String sql = "delete from "+teamtable+" where id="+id; + if(teamtable.equalsIgnoreCase("crmuser")){ + sql = "update "+teamtable+" set reportto = 0 where id="+id; + } + logger.debug("sserserserser"+ sql); + Connection conn = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + int inserts = 0; + inserts += run.update(conn, sql); + + System.out.println("removed:" + inserts); + } catch (Exception e) { + logger.error("removeContactFromTeam", e); + } finally { + DBHelper.closeConnection(conn); + } + + } + + public static void insertRealtionHestory(String teamtable,String user,int positionId,int otherId) { + String sql = null; + long ts= System.currentTimeMillis(); + SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String date_value = dateformat.format(ts); + if(teamtable.equalsIgnoreCase("userinfo")||teamtable.equalsIgnoreCase("user_position")){ + sql = "insert into userposition_relation_history (position_id, user_id, modify_time, modifier) values("+positionId+","+otherId+",'"+date_value+"','"+user+"') "; + }else if(teamtable.equalsIgnoreCase("accountcrmuser")){ + sql = "insert into accountcrmuser_relation_history (position_id,account_id,modify_time,modifier) values("+positionId+","+otherId+",'"+date_value+"','"+user+"') "; + } + logger.debug("sserserserser"+ sql); + Connection conn = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + int inserts = 0; + inserts += run.update(conn, sql); + + System.out.println("removed:" + inserts); + } catch (Exception e) { + logger.error("removeContactFromTeam", e); + } finally { + DBHelper.closeConnection(conn); + } + + } + + public static List getInferiorsByManagerId(String managerId) { + List inferiors = Lists.newArrayList(); + List users = Lists.newArrayList(); + Connection conn = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler> h = new BeanListHandler(CRMUser.class); + + users = run.query(conn, "SELECT crmuser.*,userInfo.name as userInfoName FROM crmuser left join user_position on crmuser.id = user_position.positionId left join userInfo on user_position.userId = userInfo.id where crmuser.reportto=? and crmuser.pl1=1", h,managerId); + + } catch (SQLException e) { + logger.error("failed to get all crm users", e); + } finally { + DBHelper.closeConnection(conn); + } + for(CRMUser user:users){ + CRMUser u = new CRMUser(); + if(user.getUserInfoName()==null){ + u.setName(user.getCode()+"--无"); + }else{ + u.setName(user.getCode()+"--"+user.getUserInfoName()); + } + u.setCellPhone(user.getCellPhone()); + u.setEmail(user.getEmail()); + u.setId(user.getId()); + u.setRole(user.getRole()); + u.setLoginName(user.getLoginName()); + u.setCode(user.getCode()); + inferiors.add(u); + } + return inferiors; + } + + public static List getProductByLineId(String lineId) { + List inferiors = Lists.newArrayList(); + List products = Lists.newArrayList(); + Connection conn = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler> h = new BeanListHandler(Product.class); + products = run.query(conn, "SELECT * FROM product where productlineId =?", h,lineId); + + } catch (SQLException e) { + logger.error("failed to get all crm users", e); + } finally { + DBHelper.closeConnection(conn); + } + for(Product product:products){ + Product u = new Product(); + u.setName(product.getName()); + u.setId(product.getId()); + inferiors.add(u); + } + return inferiors; + } + + public static List getCategoryByLineId(String lineId) { + List inferiors = Lists.newArrayList(); + List products = Lists.newArrayList(); + Connection conn = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler> h = new BeanListHandler(Productcategory.class); + + products = run.query(conn, "SELECT * FROM productcategory where productId =?", h,lineId); + + } catch (SQLException e) { + logger.error("failed to get all crm users", e); + } finally { + DBHelper.closeConnection(conn); + } + for(Productcategory product:products){ + Productcategory u = new Productcategory(); + u.setName(product.getName()); + u.setId(product.getId()); + inferiors.add(u); + } + return inferiors; + } + + public static List getCRMUserWithoutSuperior() { + List inferiors = Lists.newArrayList(); + List users = Lists.newArrayList(); + Connection conn = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler> h = new BeanListHandler(CRMUser.class); + + users = run.query(conn, "SELECT crmuser.*,userInfo.name as userInfoName FROM crmuser left join user_position on crmuser.id = user_position.positionId left join userInfo on user_position.userId = userInfo.id where (crmuser.reportto=0 OR crmuser.reportto=-1 OR (crmuser.reportto is NULL)) AND crmuser.id != -1 AND crmuser.pl1 = 1", h); + + } catch (SQLException e) { + logger.error("failed to get all crm users", e); + } finally { + DBHelper.closeConnection(conn); + } + for(CRMUser user:users){ + CRMUser u = new CRMUser(); + if(user.getUserInfoName()==null){ + u.setName(user.getCode()+"--无"); + }else{ + u.setName(user.getCode()+"--"+user.getUserInfoName()); + } + u.setCellPhone(user.getCellPhone()); + u.setEmail(user.getEmail()); + u.setId(user.getId()); + u.setRole(user.getRole()); + u.setLoginName(user.getLoginName()); + u.setCode(user.getCode()); + inferiors.add(u); + } + + return inferiors; + } + public static List getProductLineWithoutSuperior() { + + List users = Lists.newArrayList(); + Connection conn = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler> h = new BeanListHandler(Product.class); + + // users = run.query(conn, "SELECT * FROM product where parentid = 0 ", h); + users = run.query(conn, "SELECT * FROM productline", h); + + } catch (SQLException e) { + logger.error("failed to get all crm users", e); + } finally { + DBHelper.closeConnection(conn); + } + + return users; + } +public static List getProducWithoutProductLine(int productLines) { + + List products = Lists.newArrayList(); + Connection conn = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler> h = new BeanListHandler(Product.class); + + products = run.query(conn, "SELECT * FROM product where productlineId =? ", h,productLines); + + } catch (SQLException e) { + logger.error("failed to get all crm products", e); + } finally { + DBHelper.closeConnection(conn); + } + + return products; + } + public static List getRegionWithPosition() { + + List users = Lists.newArrayList(); + Connection conn = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler> h = new BeanListHandler(Province.class); + + users = run.query(conn, "SELECT * FROM crmuser where (reportto=0 OR reportto=-1 OR (reportto is NULL)) AND id != -1", h); + + } catch (SQLException e) { + logger.error("failed to get all crm users", e); + } finally { + DBHelper.closeConnection(conn); + } + + return users; + } + + // update crmuser baseInfo + public static boolean updateStatusOfInternalMeeting(int userId,String userName,String cellphone,String email,String photo,int sex,String loginName,String office_tel) { + String sql = "UPDATE userinfo SET name=?,cellphone=?,email=?,photo=?,sex=?,loginName=?,office_tel =? where id=?"; + Connection conn = null; + int inserts = 0; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + inserts += run.update(conn, sql, userName, cellphone,email,photo,sex,loginName,office_tel,userId); + System.out.println("updateCrmUser:" + inserts); + } catch (Exception e) { + logger.error("failed to updateStatusOfInternalMeeting", e); + } finally { + DBHelper.closeConnection(conn); + } + if(inserts>0){ + return true; + } + return false; + } + //update user Password + public static boolean updateCrmUserPassword(int userId,String password){ + String sql=" UPDATE userinfo SET password=? where id =?"; + Connection conn = null; + String newPassword = DigestUtils.md5Hex(password); + int updates = 0; + try{ + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + updates += run.update(conn, sql, newPassword,userId); + logger.debug("update password success!"); + } catch (Exception e){ + logger.error("failed to updatecrmUser Password",e); + }finally{ + DBHelper.closeConnection(conn); + } + if(updates>0){ + return true; + } + return false; + } + public static UserInfo getUserByActivation(int userID,long createTime){ + System.out.println("根据激活码Code获取用户"); + Connection conn = null; + UserInfo user = new UserInfo(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler h = new BeanHandler(UserInfo.class); + user = run.query(conn, "SELECT * FROM userinfo where ts=? and id=?", h, createTime,userID); + } catch (SQLException e) { + logger.error("failed to get all accounts", e); + } finally { + DBHelper.closeConnection(conn); + } + return user; + } + + //reset password + public static int resetUserPassword(int entityId){ + System.out.println("reset password"); + String sql=" UPDATE userinfo SET password= ?, num_of_signIn = 0 where id =?"; + Connection conn = null; + int insert = 0; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler h = new BeanHandler(UserInfo.class); + insert = run.update(conn, sql,DigestUtils.md5Hex("12345"),entityId); + logger.debug("reset password success!"); + } catch (SQLException e) { + logger.error("failed to get all accounts", e); + } finally { + DBHelper.closeConnection(conn); + } + return insert; + } + //修改用户激活状态 + public static void updateUserActivited(int entityId){ + String sql=" UPDATE userinfo SET isActivited=? where id =?"; + Connection conn = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler h = new BeanHandler(UserInfo.class); + run.update(conn, sql,1,entityId); + logger.debug("update activited success!"); + } catch (SQLException e) { + logger.error("failed to get all accounts", e); + } finally { + DBHelper.closeConnection(conn); + } + } + + //update user reportto from someone to someone + public static boolean updateCrmUserReport(String from, String to){ + String sql=" UPDATE crmuser SET reportto=? where reportto =?"; + Connection conn = null; + + int updates = 0; + try{ + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + updates += run.update(conn, sql, to, from); + logger.debug("updateCrmUserReport success!"); + } catch (Exception e){ + logger.error("failed to updateCrmUserReport",e); + }finally{ + DBHelper.closeConnection(conn); + } + if(updates>0){ + return true; + } + return false; + } + + //update user reportto from someone to someone + public static boolean updateCrmUserReportById(String from, String to){ + String sql=" UPDATE crmuser SET reportto=? where id =?"; + Connection conn = null; + + int updates = 0; + try{ + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + updates += run.update(conn, sql, to, from); + logger.debug("updateCrmUserReport success!"); + } catch (Exception e){ + logger.error("failed to updateCrmUserReport",e); + }finally{ + DBHelper.closeConnection(conn); + } + if(updates>0){ + return true; + } + return false; + } + + + public static UserInfo getUserById(int entityId){ + System.out.println("根据crmuserID获取用户" + entityId); + Connection conn = null; + UserInfo userInfo = new UserInfo(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler h = new BeanHandler(UserInfo.class); + userInfo = run.query(conn, "SELECT * FROM userInfo where id=?", h, entityId); + } catch (SQLException e) { + logger.error("failed to get all accounts", e); + } finally { + DBHelper.closeConnection(conn); + } + return userInfo; + } + public static CRMUser getCrmUserById(String entityId){ + int id = Integer.parseInt(entityId); + return getCrmUserById(id); + } + + //根据crmuserid获取crm对象 + public static CRMUser getCrmUserById(int entityId){ + System.out.println("根据crmuserID获取用户" + entityId); + Connection conn = null; + CRMUser crmuser = new CRMUser(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler h = new BeanHandler(CRMUser.class); + crmuser = run.query(conn, "SELECT * FROM crmuser where id=?", h, entityId); + } catch (SQLException e) { + logger.error("failed to get all accounts", e); + } finally { + DBHelper.closeConnection(conn); + } + return crmuser; + } + //根据医生ID获取医生对象 + public static Contact getContactById(int entityId){ + Connection conn = null; + Contact contact = new Contact(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler h = new BeanHandler(Contact.class); + contact = run.query(conn, "SELECT * FROM contact where id=?", h, entityId); + } catch (SQLException e) { + logger.error("failed to get all accounts", e); + } finally { + DBHelper.closeConnection(conn); + } + return contact; + } + public static UserInfo getUserByLoginName(String loginName){ + Connection conn = null; + UserInfo user = new UserInfo(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler h = new BeanHandler(UserInfo.class); + user = run.query(conn, "SELECT * FROM userInfo where loginName=?", h, loginName); + } catch (SQLException e) { + logger.error("failed to get all accounts", e); + } finally { + DBHelper.closeConnection(conn); + } + return user; + } + + public static List getUserByPositionId(int userId){ + Connection conn = null; + List inferiors = Lists.newArrayList(); + List users = Lists.newArrayList(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler> h = new BeanListHandler(UserInfo.class); + users = run.query(conn, "SELECT * FROM userInfo left join user_position on userInfo.id = user_position.userId where (user_position.status=1) and (user_position.positionId = ?)", h, userId); + } catch (SQLException e) { + logger.error("failed to get all accounts", e); + } finally { + DBHelper.closeConnection(conn); + } + for(UserInfo userInfo:users){ + UserInfo u = new UserInfo(); + u.setName(userInfo.getName()); + inferiors.add(u); + } + return inferiors; + } + + public static Activity getActivityById(int entityId){ + System.out.println("根据活动ID获取用户"); + Connection conn = null; + Activity activity = new Activity(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler h = new BeanHandler(Activity.class); + activity = run.query(conn, "SELECT * FROM activity where id=?", h, entityId); + } catch (SQLException e) { + logger.error("failed to get all accounts", e); + } finally { + DBHelper.closeConnection(conn); + } + return activity; + } + + public static UserInfo getUserInfoById(int id) { + Connection conn = null; + UserInfo user = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler h = new BeanHandler(UserInfo.class); + + user = run.query(conn, "SELECT * FROM userinfo where id=?", h, id); + + } catch (SQLException e) { + logger.error("failed to get user", e); + } finally { + DBHelper.closeConnection(conn); + } + + return user; + } + + + public static void insertLogInfor(String sessionId,String loginName , int type){ + String sql = null; + if(type == 0){ + sql = "INSERT INTO loginhistory ( sessionId, loginName,loginTime) VALUES (?,?,?)"; + }else if(type == 1){ + sql = "INSERT INTO loginhistory ( sessionId, loginName,logoutTime) VALUES (?,?,?)"; + } + + Connection conn = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + int inserts = 0; + inserts += run.update(conn, sql,sessionId,loginName,new Date()); + + System.out.println("inserted:" + inserts); + } catch (Exception e) { + logger.error("failed to insertLogInfor", e); + } finally { + DBHelper.closeConnection(conn); + } + } + //update signIn number + public static void addSignInNumber(int userId,int number){ + String sql=" UPDATE userinfo SET num_of_signIn=? where id =?"; + Connection conn = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler h = new BeanHandler(UserInfo.class); + run.update(conn, sql,number,userId); + } catch (SQLException e) { + logger.error("failed to get all accounts", e); + } finally { + DBHelper.closeConnection(conn); + } + } + public static List getPositionsByUserId(int userId){ + List users = Lists.newArrayList(); + ResultSetHandler> h = new BeanListHandler(UserPosition.class); + Connection conn = null; + try { + QueryRunner run = new QueryRunner(); + conn = DBConnector.getConnection(); + users = run.query(conn, "select * from user_position where userId=?", h,userId); + } catch (Exception e) { + logger.error("failed to get userPostion table data", e); + } finally { + DBHelper.closeConnection(conn); + } + + return users; + } + + public static List getUsersByPositionId( String positionId){ + List users = Lists.newArrayList(); + ResultSetHandler> h = new BeanListHandler(UserPosition.class); + Connection conn = null; + try { + QueryRunner run = new QueryRunner(); + conn = DBConnector.getConnection(); + users = run.query(conn, "select * from user_position where positionId=?", h,positionId); + } catch (Exception e) { + logger.error("failed to get userPostion table data", e); + } finally { + DBHelper.closeConnection(conn); + } + + return users; + } + //根据crmuserid获取crm对象 + public static int getReporttoIdById(String entityId){ + System.out.println("根据crmuserID获取用户" + entityId); + Connection conn = null; + int id = 0; + CRMUser crmuser = new CRMUser(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler h = new BeanHandler(CRMUser.class); + crmuser = run.query(conn, "SELECT * FROM crmuser inner join crmuser as a on crmuser.reportto = a.id where crmuser.id=?", h, entityId); + id =crmuser.getReportto(); + } catch (SQLException e) { + logger.error("failed to get all accounts", e); + } finally { + DBHelper.closeConnection(conn); + } + return id; + } + //根据reportto获取crm对象 + public static List getPositionByReporttoId(String entityId){ + Connection conn = null; + List crmuser = new ArrayList(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler> h = new BeanListHandler(CRMUser.class); + crmuser = run.query(conn, "SELECT crmuser.* FROM crmuser inner join crmuser as a on crmuser.reportto = a.id where a.id=?", h, entityId); + } catch (SQLException e) { + logger.error("failed to get all accounts", e); + } finally { + DBHelper.closeConnection(conn); + } + return crmuser; + } + //用户初次登录修改关键信息 + public static boolean updateKeyUserInfoMessage(String phone,String email,String password,int userId){ + String sql = "UPDATE userinfo SET cellphone=?,email=?,password=? where id=?"; + Connection conn = null; + int inserts = 0; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + inserts += run.update(conn, sql, phone,email,DigestUtils.md5Hex(password),userId); + } catch (Exception e) { + logger.error("failed to userInfo", e); + } finally { + DBHelper.closeConnection(conn); + } + if(inserts>0){ + return true; + } + return false; + } + //修改活动状态为未执行 + public static boolean updateActivityStatusById(int entityId){ + String sql = "UPDATE activity SET status=3 where id=?"; + Connection conn = null; + int inserts = 0; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + inserts += run.update(conn, sql,entityId); + } catch (Exception e) { + logger.error("failed to activity", e); + } finally { + DBHelper.closeConnection(conn); + } + if(inserts>0){ + return true; + } + return false; + } + //修改活动拜访医生 + public static boolean updateActivityCountactById(String entityId_B,String entityId_A){ + String sql = "UPDATE activity SET contactId="+entityId_B+" where contactId=?"; + Connection conn = null; + int inserts = 0; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + inserts += run.update(conn, sql,entityId_A); + } catch (Exception e) { + logger.error("failed to activity", e); + } finally { + DBHelper.closeConnection(conn); + } + if(inserts>0){ + return true; + } + return false; + } + + //修改活动拜访医生 + public static boolean updateAccountCountactById(String entityId_B,String entityId_A){ + String sql = "UPDATE contact SET accountId="+entityId_B+" where accountId=?"; + Connection conn = null; + int inserts = 0; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + inserts += run.update(conn, sql,entityId_A); + } catch (Exception e) { + logger.error("failed to activity", e); + } finally { + DBHelper.closeConnection(conn); + } + if(inserts>0){ + return true; + } + return false; + } + //查询所有用户登录名 + public static List getAllLoginNames(){ + Connection conn = null; + List loginNames = Lists.newArrayList(); + List users = Lists.newArrayList(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler> h = new BeanListHandler(UserInfo.class); + users = run.query(conn, "SELECT * FROM userInfo ",h); + } catch (SQLException e) { + logger.error("failed to get all accounts", e); + } finally { + DBHelper.closeConnection(conn); + } + for(UserInfo userInfo:users){ + loginNames.add(userInfo.getName()); + } + return loginNames; + } + public static UserInfo getUserInfoByCrmuserId(int id) { + Connection conn = null; + UserInfo user = null; + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler h = new BeanHandler(UserInfo.class); + user = run.query(conn, "select userinfo.* , user_position.whenadded from userinfo inner join user_position ON user_position.userId = userinfo.id where user_position.positionId = ?", h, id); + } catch (SQLException e) { + logger.error("failed to get user", e); + } finally { + DBHelper.closeConnection(conn); + } + + return user; + } + public static String getTargetById(String target,String id,String entityName){ + String result; + String sql="select "+target+" from "+entityName+" where id="+id; + List> lt=DAOImpl.queryEntityRelationList(sql); + result=String.valueOf(lt.get(0).get(target).toString()); + return result; + } + + public static String getCreateRecordByEntity(String entityName){ + String result; + String sql="select Max(id) as target from "+entityName+""; + List> lt=DAOImpl.queryEntityRelationList(sql); + result=String.valueOf(lt.get(0).get("target").toString()); + return result; + } + //查询所有用户登录名 + public static List getLoginNames(String entityId){ + Connection conn = null; + List loginNames = Lists.newArrayList(); + List users = Lists.newArrayList(); + try { + conn = DBConnector.getConnection(); + QueryRunner run = new QueryRunner(); + ResultSetHandler> h = new BeanListHandler(UserInfo.class); + users = run.query(conn, "SELECT * FROM userInfo where id!=?",h,entityId); + } catch (SQLException e) { + logger.error("failed to get all accounts", e); + } finally { + DBHelper.closeConnection(conn); + } + for(UserInfo userInfo:users){ + loginNames.add(userInfo.getName()); + } + return loginNames; + } +} diff --git a/crm/src/main/java/com/rex/crm/db/DBConnector.java b/crm/src/main/java/com/rex/crm/db/DBConnector.java new file mode 100644 index 0000000..20b4761 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/db/DBConnector.java @@ -0,0 +1,28 @@ +package com.rex.crm.db; + +import java.sql.Connection; +import java.sql.SQLException; + +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import javax.sql.DataSource; + +public final class DBConnector { + + private static DataSource dataSource; + static { + try { + Context initContext = new InitialContext(); + Context envContext = (Context)initContext.lookup("java:/comp/env"); + dataSource = (DataSource)envContext.lookup("jdbc/crm_db"); + } catch (NamingException e) { + throw new ExceptionInInitializerError(e); + } + } + + public static Connection getConnection() throws SQLException { + return dataSource.getConnection(); + } + +} diff --git a/crm/src/main/java/com/rex/crm/db/DBHelper.java b/crm/src/main/java/com/rex/crm/db/DBHelper.java new file mode 100644 index 0000000..075b13c --- /dev/null +++ b/crm/src/main/java/com/rex/crm/db/DBHelper.java @@ -0,0 +1,96 @@ +package com.rex.crm.db; + + +import java.io.IOException; +import java.io.InputStream; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; +import java.util.Properties; + + +public class DBHelper { + private static final org.apache.commons.logging.Log logger = org.apache.commons.logging.LogFactory.getLog(DBHelper.class); + + public static Properties dbProperties = new Properties(); + static{ + try { + Class.forName("com.mysql.jdbc.Driver"); + } catch (ClassNotFoundException e) { + System.out.println("Where is your MySQL JDBC Driver?"); + e.printStackTrace(); + } + InputStream inputStream = DBHelper.class.getResourceAsStream("/dbconfig.properties"); + try { + dbProperties.load(inputStream); + } catch (IOException e) { + logger.error("failed to load properties files"+e); + e.printStackTrace(); + } + } + public static Connection getConnection() throws SQLException { + Connection conn = null; + Properties connectionProps = new Properties(); + + connectionProps.put("user", dbProperties.getProperty("db.username")); + connectionProps.put("password", dbProperties.getProperty("db.password")); + conn = DriverManager.getConnection( + "jdbc:" + "mysql" + "://" + + dbProperties.getProperty("db.host") + + ":" + 3306 + "/"+dbProperties.getProperty("db.name")+"?useUnicode=true&characterEncoding=utf-8", + connectionProps); + + logger.debug("Connected to database"); + return conn; + } + + public static void closeConnection(Connection connArg) { + try { + if (connArg != null) { + connArg.close(); + connArg = null; + } + } catch (SQLException sqle) { + printSQLException(sqle); + } + } + + + public static void printSQLException(SQLException ex) { + for (Throwable e : ex) { + if (e instanceof SQLException) { + if (ignoreSQLException(((SQLException)e).getSQLState()) == false) { + e.printStackTrace(System.err); + System.err.println("SQLState: " + ((SQLException)e).getSQLState()); + System.err.println("Error Code: " + ((SQLException)e).getErrorCode()); + System.err.println("Message: " + e.getMessage()); + Throwable t = ex.getCause(); + while (t != null) { + System.out.println("Cause: " + t); + t = t.getCause(); + } + } + } + } + } + + public static boolean ignoreSQLException(String sqlState) { + if (sqlState == null) { + System.out.println("The SQL state is not defined!"); + return false; + } + // X0Y32: Jar file already exists in schema + if (sqlState.equalsIgnoreCase("X0Y32")) + return true; + // 42Y55: Table already exists in schema + if (sqlState.equalsIgnoreCase("42Y55")) + return true; + return false; + } + + public static void main(String[] args) { + // TODO Auto-generated method stub + + } + +} diff --git a/crm/src/main/java/com/rex/crm/db/hbm/Account.hbm.xml b/crm/src/main/java/com/rex/crm/db/hbm/Account.hbm.xml new file mode 100644 index 0000000..b7f9221 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/db/hbm/Account.hbm.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/crm/src/main/java/com/rex/crm/db/hbm/Accountcrmuser.hbm.xml b/crm/src/main/java/com/rex/crm/db/hbm/Accountcrmuser.hbm.xml new file mode 100644 index 0000000..673ff30 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/db/hbm/Accountcrmuser.hbm.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + diff --git a/crm/src/main/java/com/rex/crm/db/hbm/Activity.hbm.xml b/crm/src/main/java/com/rex/crm/db/hbm/Activity.hbm.xml new file mode 100644 index 0000000..b1b1287 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/db/hbm/Activity.hbm.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/crm/src/main/java/com/rex/crm/db/hbm/City.hbm.xml b/crm/src/main/java/com/rex/crm/db/hbm/City.hbm.xml new file mode 100644 index 0000000..99b205c --- /dev/null +++ b/crm/src/main/java/com/rex/crm/db/hbm/City.hbm.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + diff --git a/crm/src/main/java/com/rex/crm/db/hbm/Contact.hbm.xml b/crm/src/main/java/com/rex/crm/db/hbm/Contact.hbm.xml new file mode 100644 index 0000000..8476f95 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/db/hbm/Contact.hbm.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/crm/src/main/java/com/rex/crm/db/hbm/Crmuser.hbm.xml b/crm/src/main/java/com/rex/crm/db/hbm/Crmuser.hbm.xml new file mode 100644 index 0000000..40de9a5 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/db/hbm/Crmuser.hbm.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/crm/src/main/java/com/rex/crm/db/hbm/Province.hbm.xml b/crm/src/main/java/com/rex/crm/db/hbm/Province.hbm.xml new file mode 100644 index 0000000..470218a --- /dev/null +++ b/crm/src/main/java/com/rex/crm/db/hbm/Province.hbm.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + diff --git a/crm/src/main/java/com/rex/crm/db/model/Account.java b/crm/src/main/java/com/rex/crm/db/model/Account.java new file mode 100644 index 0000000..00e40b0 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/db/model/Account.java @@ -0,0 +1,122 @@ +package com.rex.crm.db.model; + +// Generated 2013-5-4 16:44:24 by Hibernate Tools 4.0.0 + +/** + * Account generated by hbm2java + */ +public class Account implements java.io.Serializable { + + private Integer id; + private String name; + private String address; + private Integer cityId; + private String classification; + private Boolean isKeyAccount; + private String level; + private String photo; + private String status; + private String tele; + + public Account() { + } + + public Account(String name) { + this.name = name; + } + + public Account(String name, String address, Integer cityId, + String classification, Boolean isKeyAccount, String level, + String photo, String status, String tele) { + this.name = name; + this.address = address; + this.cityId = cityId; + this.classification = classification; + this.isKeyAccount = isKeyAccount; + this.level = level; + this.photo = photo; + this.status = status; + this.tele = tele; + } + + public Integer getId() { + return this.id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getAddress() { + return this.address; + } + + public void setAddress(String address) { + this.address = address; + } + + public Integer getCityId() { + return this.cityId; + } + + public void setCityId(Integer cityId) { + this.cityId = cityId; + } + + public String getClassification() { + return this.classification; + } + + public void setClassification(String classification) { + this.classification = classification; + } + + public Boolean getIsKeyAccount() { + return this.isKeyAccount; + } + + public void setIsKeyAccount(Boolean isKeyAccount) { + this.isKeyAccount = isKeyAccount; + } + + public String getLevel() { + return this.level; + } + + public void setLevel(String level) { + this.level = level; + } + + public String getPhoto() { + return this.photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getTele() { + return this.tele; + } + + public void setTele(String tele) { + this.tele = tele; + } + +} diff --git a/crm/src/main/java/com/rex/crm/db/model/Accountcrmuser.java b/crm/src/main/java/com/rex/crm/db/model/Accountcrmuser.java new file mode 100644 index 0000000..50b78ba --- /dev/null +++ b/crm/src/main/java/com/rex/crm/db/model/Accountcrmuser.java @@ -0,0 +1,46 @@ +package com.rex.crm.db.model; + +// Generated 2013-5-4 16:44:24 by Hibernate Tools 4.0.0 + +/** + * Accountcrmuser generated by hbm2java + */ +public class Accountcrmuser implements java.io.Serializable { + + private Integer id; + private int accountId; + private int crmuserId; + + public Accountcrmuser() { + } + + public Accountcrmuser(int accountId, int crmuserId) { + this.accountId = accountId; + this.crmuserId = crmuserId; + } + + public Integer getId() { + return this.id; + } + + public void setId(Integer id) { + this.id = id; + } + + public int getAccountId() { + return this.accountId; + } + + public void setAccountId(int accountId) { + this.accountId = accountId; + } + + public int getCrmuserId() { + return this.crmuserId; + } + + public void setCrmuserId(int crmuserId) { + this.crmuserId = crmuserId; + } + +} diff --git a/crm/src/main/java/com/rex/crm/db/model/Activity.java b/crm/src/main/java/com/rex/crm/db/model/Activity.java new file mode 100644 index 0000000..808cbb2 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/db/model/Activity.java @@ -0,0 +1,100 @@ +package com.rex.crm.db.model; + +import java.util.Date; + +// Generated 2013-5-4 16:44:24 by Hibernate Tools 4.0.0 + +/** + * Activity generated by hbm2java + */ +public class Activity implements java.io.Serializable { + + private Integer id; + private int crmuserId; + private Date endtime; + private Date starttime; + private String title; + private int event_type; + private int status; + private int activity_coachType; + public Activity() { + } + + public Activity(int crmuserId, Date starttime) { + this.crmuserId = crmuserId; + this.starttime = starttime; + } + + public Activity(int crmuserId, Date endtime, Date starttime, String title) { + this.crmuserId = crmuserId; + this.endtime = endtime; + this.starttime = starttime; + this.title = title; + } + + public Integer getId() { + return this.id; + } + + public void setId(Integer id) { + this.id = id; + } + + public int getCrmuserId() { + return this.crmuserId; + } + + public void setCrmuserId(int crmuserId) { + this.crmuserId = crmuserId; + } + + + public Date getEndtime() { + return endtime; + } + + public void setEndtime(Date endtime) { + this.endtime = endtime; + } + + public Date getStarttime() { + return starttime; + } + + public void setStarttime(Date starttime) { + this.starttime = starttime; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public int getEvent_type() { + return event_type; + } + + public void setEvent_type(int event_type) { + this.event_type = event_type; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public int getActivity_coachType() { + return activity_coachType; + } + + public void setActivity_coachType(int activity_coachType) { + this.activity_coachType = activity_coachType; + } + +} diff --git a/crm/src/main/java/com/rex/crm/db/model/City.java b/crm/src/main/java/com/rex/crm/db/model/City.java new file mode 100644 index 0000000..3e4b199 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/db/model/City.java @@ -0,0 +1,46 @@ +package com.rex.crm.db.model; + +// Generated 2013-5-4 16:44:24 by Hibernate Tools 4.0.0 + +/** + * City generated by hbm2java + */ +public class City implements java.io.Serializable { + + private Integer id; + private String name; + private String provinceId; + + public City() { + } + + public City(String name, String provinceId) { + this.name = name; + this.provinceId = provinceId; + } + + public Integer getId() { + return this.id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getProvinceId() { + return this.provinceId; + } + + public void setProvinceId(String provinceId) { + this.provinceId = provinceId; + } + +} diff --git a/crm/src/main/java/com/rex/crm/db/model/Contact.java b/crm/src/main/java/com/rex/crm/db/model/Contact.java new file mode 100644 index 0000000..5ab6d8e --- /dev/null +++ b/crm/src/main/java/com/rex/crm/db/model/Contact.java @@ -0,0 +1,123 @@ +package com.rex.crm.db.model; + +// Generated 2013-5-4 16:44:24 by Hibernate Tools 4.0.0 + +/** + * Contact generated by hbm2java + */ +public class Contact implements java.io.Serializable { + + private Integer id; + private String name; + private String branch; + private String department; + private String duty; + private String gender; + private String mobilephone; + private String telWork; + private String title; + private int accountId; + + public Contact() { + } + + public Contact(String name, int accountId) { + this.name = name; + this.accountId = accountId; + } + + public Contact(String name, String branch, String department, String duty, + String gender, String mobilephone, String telWork, String title, + int accountId) { + this.name = name; + this.branch = branch; + this.department = department; + this.duty = duty; + this.gender = gender; + this.mobilephone = mobilephone; + this.telWork = telWork; + this.title = title; + this.accountId = accountId; + } + + public Integer getId() { + return this.id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getBranch() { + return this.branch; + } + + public void setBranch(String branch) { + this.branch = branch; + } + + public String getDepartment() { + return this.department; + } + + public void setDepartment(String department) { + this.department = department; + } + + public String getDuty() { + return this.duty; + } + + public void setDuty(String duty) { + this.duty = duty; + } + + public String getGender() { + return this.gender; + } + + public void setGender(String gender) { + this.gender = gender; + } + + public String getMobilephone() { + return this.mobilephone; + } + + public void setMobilephone(String mobilephone) { + this.mobilephone = mobilephone; + } + + public String getTelWork() { + return this.telWork; + } + + public void setTelWork(String telWork) { + this.telWork = telWork; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public int getAccountId() { + return this.accountId; + } + + public void setAccountId(int accountId) { + this.accountId = accountId; + } + +} diff --git a/crm/src/main/java/com/rex/crm/db/model/Crmuser.java b/crm/src/main/java/com/rex/crm/db/model/Crmuser.java new file mode 100644 index 0000000..8523f72 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/db/model/Crmuser.java @@ -0,0 +1,123 @@ +package com.rex.crm.db.model; + +// Generated 2013-5-4 16:44:24 by Hibernate Tools 4.0.0 + +/** + * Crmuser generated by hbm2java + */ +public class Crmuser implements java.io.Serializable { + + private Integer id; + private String name; + private String department; + private String division; + private String cellPhone; + private String email; + private String employeeNumber; + private String photo; + private String jobTitle; + private int cityId; + + public Crmuser() { + } + + public Crmuser(String name, int cityId) { + this.name = name; + this.cityId = cityId; + } + + public Crmuser(String name, String department, String division, + String cellPhone, String email, String employeeNumber, + String photo, String jobTitle, int cityId) { + this.name = name; + this.department = department; + this.division = division; + this.cellPhone = cellPhone; + this.email = email; + this.employeeNumber = employeeNumber; + this.photo = photo; + this.jobTitle = jobTitle; + this.cityId = cityId; + } + + public Integer getId() { + return this.id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDepartment() { + return this.department; + } + + public void setDepartment(String department) { + this.department = department; + } + + public String getDivision() { + return this.division; + } + + public void setDivision(String division) { + this.division = division; + } + + public String getCellPhone() { + return this.cellPhone; + } + + public void setCellPhone(String cellPhone) { + this.cellPhone = cellPhone; + } + + public String getEmail() { + return this.email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getEmployeeNumber() { + return this.employeeNumber; + } + + public void setEmployeeNumber(String employeeNumber) { + this.employeeNumber = employeeNumber; + } + + public String getPhoto() { + return this.photo; + } + + public void setPhoto(String photo) { + this.photo = photo; + } + + public String getJobTitle() { + return this.jobTitle; + } + + public void setJobTitle(String jobTitle) { + this.jobTitle = jobTitle; + } + + public int getCityId() { + return this.cityId; + } + + public void setCityId(int cityId) { + this.cityId = cityId; + } + +} diff --git a/crm/src/main/java/com/rex/crm/db/model/Province.java b/crm/src/main/java/com/rex/crm/db/model/Province.java new file mode 100644 index 0000000..490d573 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/db/model/Province.java @@ -0,0 +1,36 @@ +package com.rex.crm.db.model; + +// Generated 2013-5-4 16:44:24 by Hibernate Tools 4.0.0 + +/** + * Province generated by hbm2java + */ +public class Province implements java.io.Serializable { + + private Integer id; + private String name; + + public Province() { + } + + public Province(String name) { + this.name = name; + } + + public Integer getId() { + return this.id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + +} diff --git a/crm/src/main/java/com/rex/crm/html/Node.java b/crm/src/main/java/com/rex/crm/html/Node.java new file mode 100644 index 0000000..4967bac --- /dev/null +++ b/crm/src/main/java/com/rex/crm/html/Node.java @@ -0,0 +1,49 @@ +package com.rex.crm.html; + +public class Node { + private String title; + private boolean isFolder; + private Node[] children; + private String type; + private String key; + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public boolean isFolder() { + return isFolder; + } + + public void setFolder(boolean isFolder) { + this.isFolder = isFolder; + } + + public Node[] getChildren() { + return children; + } + + public void setChildren(Node[] children) { + this.children = children; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } +} diff --git a/crm/src/main/java/com/rex/crm/offline/DataFeederServlet.java b/crm/src/main/java/com/rex/crm/offline/DataFeederServlet.java new file mode 100644 index 0000000..1269072 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/offline/DataFeederServlet.java @@ -0,0 +1,124 @@ +package com.rex.crm.offline; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintWriter; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import com.rex.crm.ajax.DataProvider; +import com.rex.crm.ajax.FunctionClass; +import com.rex.crm.ajax.FunctionInvoker; +import com.rex.crm.db.DAOImpl; + +/** + * Servlet implementation class DataFeederServlet + */ +public class DataFeederServlet extends HttpServlet { + private static final long serialVersionUID = 1L; + + /** + * @see HttpServlet#HttpServlet() + */ + public DataFeederServlet() { + super(); + // TODO Auto-generated constructor stub + } + + + /** + * Processes requests for both HTTP GET and POST methods. + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + protected void processRequest(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + response.setContentType("application/json;charset=UTF-8"); + PrintWriter out = response.getWriter(); + Gson gson = new Gson(); + try { + BufferedReader br = request.getReader(); + + String jsonString = br.readLine(); + if ((jsonString == null) || jsonString.isEmpty()) { + System.out.println(" no json found"); + } else { + System.out.println(" json is :" + jsonString); + } + + //JsonElement jelement = new JsonParser().parse(jsonString); + + //JsonObject jobject = jelement.getAsJsonObject(); + //FunctionClass method = new FunctionClass(); + //method.setF(jobject.getAsJsonPrimitive("f").getAsString()); + + + + FunctionClass method = new Gson().fromJson(jsonString, FunctionClass.class); + + if (!method.getF().equalsIgnoreCase("login")) { + if (method.getS() == null) { + response.setStatus(HttpServletResponse.SC_FORBIDDEN); + br.close(); + out.print("session information not provided"); + out.flush(); + return; + } + + String sessionId = method.getS().getId(); + String sessionKey = method.getS().getKey(); + if (sessionId == null || sessionKey == null || !DAOImpl.isSessionValid(sessionId, sessionKey)) { + response.setStatus(HttpServletResponse.SC_FORBIDDEN); + br.close(); + out.print("session is not valid"); + out.flush(); + return; + } + } + + + FunctionInvoker invoker = new FunctionInvoker(DataProvider.class); + System.out.println(" method:" + method); + String repTxt = ""; + if(method.getCp() == null){ + repTxt = (String) invoker.invoke(method.getF(), method.getP()); + }else{ + System.out.println("AAAAAAAA:"+ method.getCp()); + repTxt = (String) invoker.invoke(method.getF(),new String[]{method.getCp().toString()}); + } + System.out.println(repTxt); + br.close(); + + out.print(repTxt); + out.flush(); + } catch (Exception e) { + e.printStackTrace(); + } finally { + out.close(); + } + } + + /** + * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) + */ + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + processRequest(request, response); + } + + /** + * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) + */ + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + processRequest(request, response); + } + +} diff --git a/crm/src/main/java/com/rex/crm/reporter/ReportEngineFactory.java b/crm/src/main/java/com/rex/crm/reporter/ReportEngineFactory.java new file mode 100644 index 0000000..2e0e513 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/reporter/ReportEngineFactory.java @@ -0,0 +1,55 @@ +package com.rex.crm.reporter; + +import java.util.logging.Level; + +import org.eclipse.birt.core.framework.Platform; +import org.eclipse.birt.report.engine.api.EngineConfig; +import org.eclipse.birt.report.engine.api.IReportEngine; +import org.eclipse.birt.report.engine.api.IReportEngineFactory; +import org.eclipse.core.internal.registry.RegistryProviderFactory; + +import com.rex.crm.util.CRMUtility; + +public class ReportEngineFactory { + + private static IReportEngine birtEngine = null; + private static Object syncObject_ = new Object(); + + public static IReportEngine getBirtReportEngine(){ + if(birtEngine == null){ + + synchronized(syncObject_) { + + if (birtEngine == null) { + try{ + + final EngineConfig config = new EngineConfig( ); + config.setEngineHome( CRMUtility.getReportEngineHome() ); + config.setLogConfig(CRMUtility.getReportLog(), Level.ALL); + + Platform.startup( config ); //If using RE API in Eclipse/RCP application this is not needed. + IReportEngineFactory factory = (IReportEngineFactory) Platform + .createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY ); + birtEngine = factory.createReportEngine( config ); + birtEngine.changeLogLevel( Level.WARNING ); + }catch(Exception e){ + e.printStackTrace(); + } + + } + + } + + } + + return birtEngine; + } + + public static void destoryBirtPlat(){ + if(birtEngine!=null) + birtEngine.destroy(); + Platform.shutdown(); + //Bugzilla 351052 + RegistryProviderFactory.releaseDefault(); + } +} diff --git a/crm/src/main/java/com/rex/crm/reporter/ReporterMain.java b/crm/src/main/java/com/rex/crm/reporter/ReporterMain.java new file mode 100644 index 0000000..6b03be2 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/reporter/ReporterMain.java @@ -0,0 +1,84 @@ +package com.rex.crm.reporter; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import org.kohsuke.args4j.Argument; +import org.kohsuke.args4j.CmdLineException; +import org.kohsuke.args4j.CmdLineParser; +import org.kohsuke.args4j.Option; + +public class ReporterMain { + @Option(name="-rn",usage="reporting name") + private String reporting_name = ""; + + @Option(name="-sd",usage="sarting date") + private String start_date; + + @Option(name="-ed",usage="ending date") + private String end_date; + + // receives other command line parameters than options + @Argument + private List arguments = new ArrayList(); + + + public void doMain(String[] args) throws IOException { + CmdLineParser parser = new CmdLineParser(this); + + // if you have a wider console, you could increase the value; + // here 80 is also the default + parser.setUsageWidth(100); + + try { + // parse the arguments. + parser.parseArgument(args); + + // you can parse additional arguments if you want. + // parser.parseArgument("more","args"); + + // after parsing arguments, you should check + // if enough arguments are given. + if( arguments.isEmpty() ) + throw new CmdLineException(parser,"No argument is given"); + + } catch( CmdLineException e ) { + // if there's a problem in the command line, + // you'll get this exception. this will report + // an error message. + System.err.println(e.getMessage()); + System.err.println("java SampleMain [options...] arguments..."); + // print the list of available options + parser.printUsage(System.err); + System.err.println(); + + // print option sample. This is useful some time + //System.err.println(" Example: java SampleMain"+parser.printExample(ALL)); + + return; + } + + + + if( !reporting_name.isEmpty() ){ + if(reporting_name.equalsIgnoreCase("visiting")){ + + } + } + + + // access non-option arguments + System.out.println("other arguments are:"); + for( String s : arguments ) + System.out.println(s); + } + + public static void main(String[] args) throws IOException { + new ReporterMain().doMain(args); + + } + + + +} diff --git a/crm/src/main/java/com/rex/crm/reporter/ReportingTablePanel.html b/crm/src/main/java/com/rex/crm/reporter/ReportingTablePanel.html new file mode 100644 index 0000000..623f972 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/reporter/ReportingTablePanel.html @@ -0,0 +1,30 @@ + + + +
+
+ + + + + + + + + + + + + + +
+ +
+ +
+
+ +
\ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/reporter/ReportingTablePanel.java b/crm/src/main/java/com/rex/crm/reporter/ReportingTablePanel.java new file mode 100644 index 0000000..0cbd290 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/reporter/ReportingTablePanel.java @@ -0,0 +1,56 @@ +package com.rex.crm.reporter; + +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.list.AbstractItem; + +import org.apache.wicket.markup.html.panel.Panel; +import org.apache.wicket.markup.repeater.RepeatingView; + + +import com.rex.crm.common.Entity; +import com.rex.crm.common.Field; + + +public class ReportingTablePanel extends Panel { + private static final long serialVersionUID = 2501105233172820074L; + private static final Logger logger = Logger.getLogger(ReportingTablePanel.class); + + public ReportingTablePanel(String id,String reporting_caption,Entity entity,List dataList) { + super(id); + + add(new Label("reporting_cap",reporting_caption)); + //set column name + RepeatingView column_name_repeater = new RepeatingView("column_name_repeater"); + add(column_name_repeater); + List fields = entity.getFields(); + for( Field f:fields){ + AbstractItem item = new AbstractItem(column_name_repeater.newChildId()); + column_name_repeater.add(item); + item.add(new Label("column_name",f.getDisplay())); + } + + if(dataList != null){ + RepeatingView row_repeater = new RepeatingView("row_repeater"); + add(row_repeater); + for(Map data:dataList){ + AbstractItem row_item = new AbstractItem(row_repeater.newChildId()); + row_repeater.add(row_item); + + RepeatingView column_repeater = new RepeatingView("column_repeater"); + row_item.add(column_repeater); + for( Field f:fields){ + AbstractItem col_item = new AbstractItem(column_repeater.newChildId()); + column_repeater.add(col_item); + col_item.add(new Label("cell_value",String.valueOf(data.get(f.getName()))).setEscapeModelStrings(false)); + } + } + } + + } + + +} diff --git a/crm/src/main/java/com/rex/crm/reporter/ValuePackReportPage.html b/crm/src/main/java/com/rex/crm/reporter/ValuePackReportPage.html new file mode 100644 index 0000000..65e81b8 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/reporter/ValuePackReportPage.html @@ -0,0 +1,21 @@ + + + + + + +
+ + +
+
+ +
+ + diff --git a/crm/src/main/java/com/rex/crm/reporter/ValuePackReportPage.java b/crm/src/main/java/com/rex/crm/reporter/ValuePackReportPage.java new file mode 100644 index 0000000..08fa4e0 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/reporter/ValuePackReportPage.java @@ -0,0 +1,128 @@ +package com.rex.crm.reporter; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.charset.Charset; + + +import org.apache.log4j.Logger; +import org.apache.wicket.AttributeModifier; +import org.apache.wicket.markup.ComponentTag; +import org.apache.wicket.markup.html.WebComponent; +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.model.Model; +import org.apache.wicket.request.Response; +import org.eclipse.birt.report.engine.api.EngineConstants; +import org.eclipse.birt.report.engine.api.EngineException; +import org.eclipse.birt.report.engine.api.HTMLRenderOption; +import org.eclipse.birt.report.engine.api.HTMLServerImageHandler; +import org.eclipse.birt.report.engine.api.IReportEngine; +import org.eclipse.birt.report.engine.api.IReportRunnable; +import org.eclipse.birt.report.engine.api.IRunAndRenderTask; + +import com.rex.crm.TemplatePage; +import com.rex.crm.util.CRMUtility; + + +/** + * @author Feiyun Zhou + */ +public class ValuePackReportPage extends TemplatePage{ + private static final Logger logger = Logger.getLogger(ValuePackReportPage.class); + /** + * Constructor + */ + + public ValuePackReportPage(){ + init("all.rptdesign"); + // setMenuActive(0); + } + + public ValuePackReportPage(String reportName){ + init(reportName); + } + + public void init(String reportName) + { + + try { + System.out.print("starting rendering..."); + IReportEngine engine = ReportEngineFactory.getBirtReportEngine(); + + IReportRunnable design = engine.openReportDesign( CRMUtility.getReportDesignFolder()+File.separator+reportName ); + + + IRunAndRenderTask task = engine.createRunAndRenderTask(design); + // engine.createRenderTask(design); + + + task.getAppContext().put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY, ValuePackReportPage.class.getClassLoader()); + + HTMLRenderOption options = new HTMLRenderOption(); + + //File tmpfile = File.createTempFile("rpt_", ".html", new File( Configuration.getReportOutputFolder())); + final File tmpfile = File.createTempFile("rpt"+System.currentTimeMillis()+"_"+(int)1000*Math.random(), ".html", new File( CRMUtility.getReportOutputFolder())); + logger.debug("tmp file:"+tmpfile.getAbsolutePath()); + + FileOutputStream tempfileos = new FileOutputStream(tmpfile); + options.setOutputStream(tempfileos); + options.setOutputFormat("html"); + options.setImageDirectory(CRMUtility.getReportImagesFolder()); + options.setBaseImageURL(CRMUtility.getReportBaseImgURL()); + options.setImageHandler(new HTMLServerImageHandler()); + + + //Setting this to true removes html and body tags + //options.setEmbeddable(true); + //PDFRenderOption options = new PDFRenderOption(); + //options.setOutputFormat("pdf"); + //File tmpfile = File.createTempFile("rpt_", ".pdf", new File( Configuration.getReportOutputFolder())); + //options.setOutputStream(new FileOutputStream(tmpfile)); + + task.setRenderOption(options); + //run and render report + //task. + task.run(); + task.close(); + + logger.debug("file generated:"+tmpfile.getAbsolutePath()); + + tempfileos.close(); + //add(new DocumentInlineFrame("report_frame", new FileResourceStream(tmpfile))); + //add(new WebMarkupContainer("report_frame")); + // WebMarkupContainer mag_report_frame = new WebMarkupContainer("report_frame"); + // add(mag_report_frame); + // mag_report_frame.add( new AttributeModifier("src",new Model(CRMUtility.getReportBaseURL()+tmpfile.getName()))); + + add( + new WebComponent("report_container") { + + @Override + protected void onComponentTag(ComponentTag tag) { + Response response = getRequestCycle().getResponse(); + try { + String report_html = com.google.common.io.Files.toString(tmpfile, Charset.forName("utf-8")); + response.write(report_html); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + }); + + } catch (EngineException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + + + } + + +} \ No newline at end of file diff --git a/crm/src/main/java/com/rex/crm/reporter/VisitingReporter.java b/crm/src/main/java/com/rex/crm/reporter/VisitingReporter.java new file mode 100644 index 0000000..ce0631a --- /dev/null +++ b/crm/src/main/java/com/rex/crm/reporter/VisitingReporter.java @@ -0,0 +1,219 @@ +package com.rex.crm.reporter; + +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Map; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.rex.crm.db.DAOImpl; + +public class VisitingReporter { + + + public void generateReporting(String year_month){ + + Date today = new Date(); + DateFormat sdf = new SimpleDateFormat("yyyy-MM"); + + if(year_month != null && !year_month.isEmpty()){ + try { + today = sdf.parse(year_month); + } catch (ParseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + + //compute the first day of month, and the last day of month + Calendar calendar = Calendar.getInstance(); + calendar.setTime(today); + + calendar.set(Calendar.DAY_OF_MONTH, 1); + //calendar.set(Calendar., 1); + calendar.set(Calendar.HOUR_OF_DAY, 0); + calendar.set(Calendar.MINUTE, 0); + calendar.set(Calendar.SECOND, 0); + calendar.set(Calendar.MILLISECOND, 0); + Date firstDayOfMonth = calendar.getTime(); + + + calendar.add(Calendar.MONTH, 1); + calendar.add(Calendar.MILLISECOND, -1); + Date lastDayOfMonth = calendar.getTime(); + + DateFormat datetimeFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + System.out.println("firstDayOfMonth : " + datetimeFormatter.format(firstDayOfMonth)); + System.out.println("lastDayOfMonth : " + datetimeFormatter.format(lastDayOfMonth)); + + + + } + + + public static List generateVisitingPerDay(List activityData, List workingDayData){ + List res = Lists.newArrayList(); + Map map = Maps.newHashMap(); + res.add(map); + + int num_of_activity = 0; + int num_of_working_day = 1; + + if(activityData!=null && activityData.size()>0){ + num_of_activity = ((Number)activityData.get(0).get("num_of_activity")).intValue(); + } + + if(workingDayData!=null && workingDayData.size()>0){ + num_of_working_day = ((Number)workingDayData.get(0).get("num_of_working_day")).intValue(); + } + int metric_of_visiting_per_day = 12; + map.put("metric_of_visiting_per_day", metric_of_visiting_per_day); + int num_of_visiting_per_day = num_of_activity/num_of_working_day; + map.put("num_of_visiting_per_day", num_of_visiting_per_day); + + + int rate_of_achieving = num_of_visiting_per_day*100/metric_of_visiting_per_day; + + map.put("Chart4", rate_of_achieving); + + if(rate_of_achieving<100){ + map.put("rate_of_achieving", ""+rate_of_achieving+"%"); + }else{ + map.put("rate_of_achieving", rate_of_achieving+"%"); + } + + return res; + } + + public static List generateVisitingFrequencyReportingByUserId(String userId){ + float num_of_target_of_visiting_frequency = 3.7f; + String sql = "select num_of_contact,num_of_activity, "+num_of_target_of_visiting_frequency+" as num_of_target_of_visiting_frequency," + + "(num_of_activity/num_of_contact) as num_of_visiting_frequency, ((num_of_activity/num_of_contact)*100/"+num_of_target_of_visiting_frequency+") " + + "as rate_of_achieving from (select crmuserId, count(distinct contact.id) as num_of_contact from contactcrmuser," + + "contact where crmuserId=? AND contact.id=contactcrmuser.contactId) as a, (SELECT crmuserId, count(activity.id)" + + " as num_of_activity FROM activity,contact WHERE crmuserId=? AND activity.status=2 AND activity.contactId=contact.id)" + + " as b where a.crmuserId=b.crmuserId"; + + + List dataList = DAOImpl.queryEntityRelationList(sql, userId,userId); + + //format the data + for(Map mapData:dataList){ + float rate_of_achieving =0; + if(null==mapData.get("rate_of_achieving")){ + rate_of_achieving = 0; + }else{ + rate_of_achieving = ((Number)mapData.get("rate_of_achieving")).floatValue(); + } + + int int_rate_of_achieving = (int)rate_of_achieving; + mapData.put("Chart1", int_rate_of_achieving); + + if(int_rate_of_achieving<100){ + mapData.put("rate_of_achieving", ""+int_rate_of_achieving+"%"); + }else{ + mapData.put("rate_of_achieving", int_rate_of_achieving+"%"); + } + + } + + return dataList; + + } + + public static List generateVisitingCoverReportingByUserId(String userId){ + //float num_of_target_of_visiting_frequency = 3.7f; + String sql = "select " + + "num_of_visited_contact," + + "num_of_contact, " + + "90 as metric_of_visiting_cover, " + + "(num_of_visited_contact*100/num_of_contact) as rate_of_visiting_cover, " + + "((num_of_visited_contact*100*100)/(90*num_of_contact)) as rate_of_achieving " + + "FROM (select crmuserId, count(distinct contact.id) as num_of_contact from contactcrmuser,contact " + + " where contactcrmuser.crmuserId=? AND contact.id=contactcrmuser.contactId ) as a, " + + " (SELECT crmuserId, count(distinct contact.id) as num_of_visited_contact FROM activity,contact " + + "WHERE activity.status=2 AND activity.contactId=contact.id AND crmuserId=?) as b WHERE a.crmuserId = b.crmuserId"; + + System.out.println(sql); + List dataList = DAOImpl.queryEntityRelationList(sql, userId,userId); + + //format the data + for(Map mapData:dataList){ + int rate_of_achieving = 0; + if(null==mapData.get("rate_of_achieving")){ + rate_of_achieving = 0; + }else{ + rate_of_achieving = ((Number)mapData.get("rate_of_achieving")).intValue(); + //int int_rate_of_achieving = (int)rate_of_achieving; + } + mapData.put("Chart2b",rate_of_achieving); + if(rate_of_achieving<100){ + mapData.put("rate_of_achieving", ""+rate_of_achieving+"%"); + }else{ + mapData.put("rate_of_achieving", rate_of_achieving+"%"); + } + int rate_of_visiting_cover = 0; + if(null==mapData.get("rate_of_visiting_cover")){ + rate_of_visiting_cover = 0; + }else{ + rate_of_visiting_cover = ((Number)mapData.get("rate_of_visiting_cover")).intValue(); + //int int_rate_of_achieving = (int)rate_of_achieving; + } + mapData.put("Chart2a",rate_of_visiting_cover); + //int rate_of_visiting_cover = ((Number)mapData.get("rate_of_visiting_cover")).intValue(); + mapData.put("rate_of_visiting_cover", rate_of_visiting_cover+"%"); + } + + return dataList; + } + + /** + * 区域内工作天数 + * @param userId + * @return + */ + public static List generateWorkingDayReportingByUserId(String userId){ + //float num_of_target_of_visiting_frequency = 3.7f; + String sql = "select 21 as metric_of_working_day, " + + "count(crmuserId) as num_of_working_day, " + + "count(crmuserId)*100/21 as rate_of_achieving from " + + "(SELECT crmuserId FROM activity where crmuserId=? " + + " AND status=2 group by crmuserId,DATE_FORMAT(act_endtime,'%Y-%m-%d')) " + + "as a group by crmuserId"; + + System.out.println(sql); + List dataList = DAOImpl.queryEntityRelationList(sql, userId); + + //format the data + for(Map mapData:dataList){ + int rate_of_achieving = ((Number)mapData.get("rate_of_achieving")).intValue(); + //int int_rate_of_achieving = (int)rate_of_achieving; + // mapData.put("rate_of_achieving", rate_of_achieving+"%"); + mapData.put("Chart3", rate_of_achieving); + if(rate_of_achieving<100){ + mapData.put("rate_of_achieving", ""+rate_of_achieving+"%"); + }else{ + mapData.put("rate_of_achieving", rate_of_achieving+"%"); + } + + } + return dataList; + } + + + /** + * @param args + */ + public static void main(String[] args) { + VisitingReporter test = new VisitingReporter(); + // test.generateReporting("2013-07"); + test.generateVisitingFrequencyReportingByUserId("99"); + + } + +} diff --git a/crm/src/main/java/com/rex/crm/template.js b/crm/src/main/java/com/rex/crm/template.js new file mode 100644 index 0000000..869bada --- /dev/null +++ b/crm/src/main/java/com/rex/crm/template.js @@ -0,0 +1,5 @@ +var context_name='${context_name}'; +var ajaxURL = '${ajaxURL}'; +var allUsers = '${allUsers}'; +var allAccounts = '${allAccounts}'; +var userInfo='${userInfo}'; diff --git a/crm/src/main/java/com/rex/crm/user/CRMUserDataProvider.java b/crm/src/main/java/com/rex/crm/user/CRMUserDataProvider.java new file mode 100644 index 0000000..a69e362 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/user/CRMUserDataProvider.java @@ -0,0 +1,38 @@ +package com.rex.crm.user; + +import java.util.Iterator; +import java.util.List; + +import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider; +import org.apache.wicket.model.IModel; + +import com.rex.crm.beans.Account; +import com.rex.crm.beans.CRMUser; +import com.rex.crm.db.DAOImpl; + +public class CRMUserDataProvider extends SortableDataProvider { + + private int accountId; + public CRMUserDataProvider(int accountId){ + this.accountId = accountId; + } + + @Override + public Iterator iterator(long first, long count) { + // TODO Auto-generated method stub + List list = DAOImpl.getUsersByAccountId(accountId); + + return list.iterator(); + } + + @Override + public long size() { + return DAOImpl.getSizeOfUsersByAccountId(accountId); + } + + @Override + public IModel model(CRMUser object) { + return new DetachableCRMUserModel(object); + } + +} diff --git a/crm/src/main/java/com/rex/crm/user/DetachableCRMUserModel.java b/crm/src/main/java/com/rex/crm/user/DetachableCRMUserModel.java new file mode 100644 index 0000000..2a6a4f9 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/user/DetachableCRMUserModel.java @@ -0,0 +1,98 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rex.crm.user; + +import org.apache.wicket.model.LoadableDetachableModel; + +import com.rex.crm.beans.Account; +import com.rex.crm.beans.CRMUser; +import com.rex.crm.db.DAOImpl; + +/** + * detachable model for an instance of contact + * + * @author igor + * + */ +public class DetachableCRMUserModel extends LoadableDetachableModel +{ + private final int id; + + + /** + * @param c + */ + public DetachableCRMUserModel(CRMUser u) + { + this(u.getId()); + } + + /** + * @param id + */ + public DetachableCRMUserModel(int id) + { + if (id == 0) + { + throw new IllegalArgumentException(); + } + this.id = id; + } + + /** + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() + { + return Long.valueOf(id).hashCode(); + } + + /** + * used for dataview with ReuseIfModelsEqualStrategy item reuse strategy + * + * @see org.apache.wicket.markup.repeater.ReuseIfModelsEqualStrategy + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(final Object obj) + { + if (obj == this) + { + return true; + } + else if (obj == null) + { + return false; + } + else if (obj instanceof DetachableCRMUserModel) + { + DetachableCRMUserModel other = (DetachableCRMUserModel)obj; + return other.id == id; + } + return false; + } + + /** + * @see org.apache.wicket.model.LoadableDetachableModel#load() + */ + @Override + protected CRMUser load() + { + return DAOImpl.getCRMUserInfoById(id); + } +} diff --git a/crm/src/main/java/com/rex/crm/userlog/LogInOut.java b/crm/src/main/java/com/rex/crm/userlog/LogInOut.java new file mode 100644 index 0000000..e9f2f07 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/userlog/LogInOut.java @@ -0,0 +1,36 @@ +package com.rex.crm.userlog; + + +public class LogInOut extends LogObj { + + private String loginName; + private String sessionId; + private long logints; + private long logoutts; + + public String getLoginName() { + return loginName; + } + public void setLoginName(String loginName) { + this.loginName = loginName; + } + public String getSessionId() { + return sessionId; + } + public void setSessionId(String sessionId) { + this.sessionId = sessionId; + } + public long getLogints() { + return logints; + } + public void setLogints(long logints) { + this.logints = logints; + } + public long getLogoutts() { + return logoutts; + } + public void setLogoutts(long logoutts) { + this.logoutts = logoutts; + } + +} diff --git a/crm/src/main/java/com/rex/crm/userlog/LogObj.java b/crm/src/main/java/com/rex/crm/userlog/LogObj.java new file mode 100644 index 0000000..4ac34b6 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/userlog/LogObj.java @@ -0,0 +1,14 @@ +package com.rex.crm.userlog; + +public class LogObj { + private String uuid; + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + +} diff --git a/crm/src/main/java/com/rex/crm/util/CRMUtility.java b/crm/src/main/java/com/rex/crm/util/CRMUtility.java new file mode 100644 index 0000000..82f1a72 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/util/CRMUtility.java @@ -0,0 +1,521 @@ +package com.rex.crm.util; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.lang.reflect.Type; +import java.util.EnumSet; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.UUID; +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.Executors; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.lang3.tuple.Pair; +import org.apache.log4j.Logger; +import org.apache.velocity.app.VelocityEngine; + +import com.google.common.base.Function; +import com.google.common.base.Predicate; +import com.google.common.collect.ImmutableListMultimap; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMultiset; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Multimaps; +import com.google.gson.Gson; +import com.rex.crm.beans.Account; +import com.rex.crm.beans.CRMUser; +import com.rex.crm.beans.CalendarEvent; +import com.rex.crm.beans.City; +import com.rex.crm.beans.Contact; +import com.rex.crm.common.CRUDPanel; +import com.rex.crm.common.IFormatter; +import com.rex.crm.common.NewDataFormPanel; +import com.rex.crm.common.CRUDPanel.Permissions; +import com.rex.crm.userlog.LogInOut; +import com.rex.crm.userlog.LogObj; + +public class CRMUtility { + private static final Logger logger = Logger.getLogger(CRMUtility.class); + private static String configPath = null; + private static Properties commonProps = null; + public static final String STAT_LOG_IN_OUT = "logInOut"; + public static ThreadPoolExecutor executorPool; + + + public static ThreadPoolExecutor getThreadPoolExecutor() { + + if (executorPool == null) { + synchronized (Configuration.class) { + ThreadFactory threadFactory = Executors.defaultThreadFactory(); + + //creating the ThreadPoolExecutor + executorPool = new ThreadPoolExecutor(100, 100, 10, TimeUnit.SECONDS, new ArrayBlockingQueue(100), threadFactory); + } + } + return executorPool; + + } + + public static ImmutableListMultimap categorizeAccountsByCityIds(List accounts){ + Function idFunction = new Function() { + public Integer apply(Account account) { + return account.getCityId(); + } + }; + + ImmutableListMultimap accountsByCityIds = Multimaps.index(accounts, idFunction); + + return accountsByCityIds; + } + + public static ImmutableListMultimap categorizeCRMUsersByCityIds(List users){ + Function idFunction = new Function() { + public Integer apply(CRMUser user) { + return user.getCityId(); + } + }; + + ImmutableListMultimap usersByCityIds = Multimaps.index(users, idFunction); + + return usersByCityIds; + } + + + public static ImmutableListMultimap categorizeCitiesByProvinceIds(List cities){ + Function idFunction = new Function() { + public Integer apply(City city) { + return city.getProvinceId(); + } + }; + + + ImmutableListMultimap citiesByProvinceId = Multimaps + .index(cities, idFunction); + return citiesByProvinceId; + } + + + public static ImmutableListMultimap categorizeContactsByAccountId(List contacts){ + Function idFunction = new Function() { + public Integer apply(Contact contact) { + return contact.getAccountId(); + } + }; + + + ImmutableListMultimap contactsByAccountId = Multimaps.index(contacts, idFunction); + return contactsByAccountId; + } + + + public static ImmutableListMultimap> categorizeEntitiesByExternalId(List> pairs){ + Function, Integer> idFunction = new Function, Integer>() { + public Integer apply(Pair pair) { + return pair.getRight(); + } + }; + + + ImmutableListMultimap> entitiesByExternalId = Multimaps.index(pairs, idFunction); + return entitiesByExternalId; + } + + + + public static ImmutableListMultimap categorizeEventsByUserIds(List events){ + Function idFunction = new Function() { + public Integer apply(CalendarEvent event) { + return event.getCrmUserId(); + } + }; + + ImmutableListMultimap eventsByUserId = Multimaps.index(events, idFunction); + return eventsByUserId; + } + + + public static List getAccountsByIds(Map accountTable, final List accountIds){ + Predicate filters = new Predicate() { + public boolean apply(String id) { + return accountIds.contains(id); + } + }; + + return Lists.newArrayList(Maps.filterKeys(accountTable, filters).values()); + } + + + public static List getCRMUsersByIds(Map crmUserTable, final List userIds){ + Predicate filters = new Predicate() { + public boolean apply(String id) { + return userIds.contains(id); + } + }; + + return Lists.newArrayList(Maps.filterKeys(crmUserTable, filters).values()); + } + + + public static List filterObjectsByIds(Map idMappingTable, final List ids){ + Predicate filters = new Predicate() { + public boolean apply(String id) { + return ids.contains(id); + } + }; + + return Lists.newArrayList(Maps.filterKeys(idMappingTable, filters).values()); + } + + public static Map filterCitiesWithIds(ImmutableMap cityTable,final ImmutableMultiset cityIds){ + Predicate filters = new Predicate() { + public boolean apply(Integer id) { + return cityIds.contains(id); + } + }; + + return Maps.filterKeys(cityTable, filters); + } + + + public static List filterEventsByUserIds(Map idMappingTable, final List userIds){ + Predicate filters = new Predicate() { + public boolean apply(CalendarEvent event) { + + return userIds.contains(event.getCrmUserId()); + } + }; + return Lists.newArrayList(Maps.filterValues(idMappingTable, filters).values()); + } + + public static String formatValue(String formatter, String value) { + String res = value; + try { + if (formatter != null) { + Class clazz = Class.forName(formatter); + IFormatter formatterImplement = (IFormatter) clazz.newInstance(); + res = formatterImplement.format(value); + } + } catch (Exception e) { + logger.error("failed to format value",e); + } + return res; + + } + + + public static EnumSet getPermissionForEntity(int roleId, String entityName) { + + EnumSet permission = null; + if (entityName.equalsIgnoreCase("account")) { + if (roleId == 1) { + permission = EnumSet.of(CRUDPanel.Permissions.DEL,CRUDPanel.Permissions.EDIT,CRUDPanel.Permissions.MERGE); + } + }else if (entityName.equalsIgnoreCase("crmuser")) { + if (roleId == 1) { + permission = EnumSet.of(CRUDPanel.Permissions.DEL,CRUDPanel.Permissions.EDIT,CRUDPanel.Permissions.INEFFECTIVE); + } + }else if(entityName.equalsIgnoreCase("contact") ){ + if(roleId==1){ + permission = EnumSet.of(CRUDPanel.Permissions.EDIT,CRUDPanel.Permissions.DEL,CRUDPanel.Permissions.MERGE); + }else{ + permission = EnumSet.of(CRUDPanel.Permissions.EDIT); + } + }else if( entityName.equalsIgnoreCase("calendar")|| entityName.equalsIgnoreCase("product")){ + if(roleId==1){ + permission = EnumSet.of(CRUDPanel.Permissions.EDIT,CRUDPanel.Permissions.DEL); + }else{ + permission = EnumSet.of(CRUDPanel.Permissions.EDIT); + } + }else if(entityName.equalsIgnoreCase("activity")){ + if (roleId == 3) { + permission = EnumSet.of(CRUDPanel.Permissions.EDIT,CRUDPanel.Permissions.DONE,CRUDPanel.Permissions.noExecute); + }else if(roleId == 1){ + permission = EnumSet.of(CRUDPanel.Permissions.DEL); + } + }else if(entityName.equalsIgnoreCase("coaching")||entityName.equalsIgnoreCase("willcoaching")){ + if (roleId == 2){ + permission = EnumSet.of(CRUDPanel.Permissions.EDIT,CRUDPanel.Permissions.DONE,CRUDPanel.Permissions.noExecute); + }else if(roleId == 1){ + permission = EnumSet.of(CRUDPanel.Permissions.DEL); + } + }else if(entityName.equalsIgnoreCase("userInfo")){ + if (roleId == 1) { + permission = EnumSet.of(CRUDPanel.Permissions.DEL,CRUDPanel.Permissions.EDIT,CRUDPanel.Permissions.RESETPWD,CRUDPanel.Permissions.INEFFECTIVE); + } + }else if(entityName.equalsIgnoreCase("alert")||entityName.equalsIgnoreCase("alertattachment")){ + if(roleId == 1){ + permission = EnumSet.of(CRUDPanel.Permissions.DEL,CRUDPanel.Permissions.EDIT); + } + }else if(entityName.equalsIgnoreCase("productline")||entityName.equalsIgnoreCase("productcategory")){ + if(roleId == 1){ + permission = EnumSet.of(CRUDPanel.Permissions.DEL,CRUDPanel.Permissions.EDIT); + } + }else if(entityName.equalsIgnoreCase("province")||entityName.equalsIgnoreCase("city")||entityName.equalsIgnoreCase("user_position")){ + if(roleId == 1){ + permission = EnumSet.of(CRUDPanel.Permissions.DEL,CRUDPanel.Permissions.EDIT); + } + } + + return permission; + } + + + public static EnumSet getPermissionOfEntityList(int roleId, String entityName) { + + EnumSet permission = null; + if (entityName.equalsIgnoreCase("account")||entityName.equalsIgnoreCase("product")||entityName.equalsIgnoreCase("productline")||entityName.equalsIgnoreCase("productcategory")) { + if (roleId == 1) { + permission = EnumSet.of(CRUDPanel.Permissions.ADD,CRUDPanel.Permissions.DOWNLOAD); + } + }else if(entityName.equalsIgnoreCase("contact")||entityName.equalsIgnoreCase("calendar")){ + permission = EnumSet.of(CRUDPanel.Permissions.ADD,CRUDPanel.Permissions.DOWNLOAD ); + }else if(entityName.equalsIgnoreCase("activity")){ + if(roleId == 3){ + permission = EnumSet.of(CRUDPanel.Permissions.ADD); + }else if(roleId == 1){ + permission = EnumSet.of(CRUDPanel.Permissions.DOWNLOAD); + }else{ + permission = null; + } + }else if(entityName.equalsIgnoreCase("coaching")){ + if(roleId==1){ + permission = EnumSet.of(CRUDPanel.Permissions.DOWNLOAD); + }else if(roleId ==2){ + permission = EnumSet.of(CRUDPanel.Permissions.ADD); + } + }else if(entityName.equalsIgnoreCase("crmuser")||entityName.equalsIgnoreCase("userInfo")){ + + if (roleId == 1) { + permission = EnumSet.of(CRUDPanel.Permissions.ADD,CRUDPanel.Permissions.DOWNLOAD); + } + }else if(entityName.equalsIgnoreCase("alert")||entityName.equalsIgnoreCase("alertAttachment")){ + if(roleId == 1){ + permission = EnumSet.of(CRUDPanel.Permissions.ADD); + } + }else if(entityName.equalsIgnoreCase("user_position")){ + if(roleId == 1){ + permission = EnumSet.of(CRUDPanel.Permissions.ADD); + } + }else if(entityName.equalsIgnoreCase("province")||entityName.equalsIgnoreCase("city")){ + if(roleId == 1){ + permission = EnumSet.of(CRUDPanel.Permissions.ADD); + } + }else if(entityName.equalsIgnoreCase("user_position_query")||entityName.equalsIgnoreCase("user_position_account")){ + if(roleId == 1){ + permission = EnumSet.of(CRUDPanel.Permissions.DOWNLOAD); + } + } +// else if(entityName.equalsIgnoreCase("upLoad")){ +// +// if (roleId == 1) { +// permission = EnumSet.of(CRUDPanel.Permissions.DOWNLOAD); +// } +// } + return permission; + } + public static String MD5Base64(String src) { + if (src == null || src.isEmpty()) + return null; + + java.security.MessageDigest digest = null; + try { + digest = java.security.MessageDigest.getInstance("MD5"); + } catch (Throwable ex) { + logger.fatal("Exception", ex); + } + if (null == digest) { + logger.fatal("No MD5 digest"); + return src; + } + // Convert + digest.update(src.getBytes()); + final byte[] in = digest.digest(); + if (in == null || in.length <= 0) { + logger.fatal("MD5 returned empty digest"); + return src; + } + + // encode with Base64 + final String hash = new String(Base64.encodeBase64(in)); + + return hash; + } + + + public static String getToolTipById(String id) { + Properties systemPeroperties = new Properties(); + try { + systemPeroperties.load(new InputStreamReader(CRMUtility.class.getResourceAsStream("/tooltipMessage.properties"),"UTF-8")); + } catch (FileNotFoundException e1) { + logger.error(e1); + } catch (IOException e1) { + logger.error(e1); + } + String message=""; + try { + message = String.valueOf(systemPeroperties.getProperty(id)); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return message; + } + + + public static void printStat(String type, LogObj object,Type typeOfSrc){ + + UUID uuid = UUID.randomUUID(); + object.setUuid(uuid.toString()); + Gson gson = new Gson(); + String js = gson.toJson(object, typeOfSrc); + logger.info("STAT."+type +"="+js); + } + + public static String readFileAttribure(String fieldName){ + Properties systemPeroperties = new Properties(); + try { + systemPeroperties.load(NewDataFormPanel.class.getResourceAsStream("/crm.properties")); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return systemPeroperties.getProperty(fieldName); + } + + + + public static String getConfigPath() { + if (configPath == null) { + synchronized (Configuration.class) { + String OS = System.getProperty("os.name").toLowerCase(); + if (OS.indexOf("win") >= 0) { + logger.debug("This is a Windows"); + configPath = "C:\\var\\crm\\config"; + } else { + logger.debug("This is not a Windows"); + configPath = "/var/crm/config"; + } + + } + } + + return configPath; + } + + + + public static Properties getCommProps(){ + if (commonProps == null) { + synchronized (Configuration.class) { + commonProps = new Properties(); + try { + String cfgPath = getConfigPath(); + File file = new File(cfgPath + File.separator + "common.cfg"); + if(file.exists()){ + commonProps.load(new FileReader(cfgPath + File.separator + "common.cfg")); + }else{ + commonProps.loadFromXML(Configuration.class.getResourceAsStream("/common.cfg")); + } + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + + return commonProps; + } + + + public static String getJCRHost(){ + Properties prop= getCommProps(); + String value = (String) prop.get("jcr_host"); + return value; + } + + public static String getPicturesPath(){ + Properties prop= getCommProps(); + String media_files_path = (String) prop.get("media_files_path"); + return media_files_path; + } + + public static String getPictureHost(){ + Properties prop= getCommProps(); + String value = (String) prop.get("picture_host"); + return value; + } + + public static String getReportEngineHome(){ + Properties prop= getCommProps(); + String value = (String) prop.get("report_engine_home"); + return value; + } + + public static String getReportLog(){ + Properties prop= getCommProps(); + String value = (String) prop.get("report_engine_log"); + return value; + } + + public static String getReportDesignFolder(){ + Properties prop= getCommProps(); + String value = (String) prop.get("report_design_folder"); + return value; + } + + public static String getReportOutputFolder(){ + Properties prop= getCommProps(); + String value = (String) prop.get("report_output_folder"); + return value; + } + + public static String getReportImagesFolder(){ + Properties prop= getCommProps(); + String value = (String) prop.get("report_images_folder"); + return value; + } + + + public static String getReportBaseImgURL(){ + Properties prop= getCommProps(); + String value = (String) prop.get("report_base_img_url"); + return value; + } + + public static String getReportBaseURL(){ + Properties prop= getCommProps(); + String value = (String) prop.get("report_base_url"); + return value; + } + + + public static File createTempDirectory() + throws IOException + { + final File temp; + + temp = File.createTempFile("temp", Long.toString(System.nanoTime())); + + if(!(temp.delete())) + { + throw new IOException("Could not delete temp file: " + temp.getAbsolutePath()); + } + + if(!(temp.mkdir())) + { + throw new IOException("Could not create temp directory: " + temp.getAbsolutePath()); + } + + return (temp); + } + +} diff --git a/crm/src/main/java/com/rex/crm/util/Configuration.java b/crm/src/main/java/com/rex/crm/util/Configuration.java new file mode 100644 index 0000000..6dd4c2d --- /dev/null +++ b/crm/src/main/java/com/rex/crm/util/Configuration.java @@ -0,0 +1,296 @@ +package com.rex.crm.util; + +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Properties; + +import org.apache.commons.configuration.ConfigurationException; +import org.apache.commons.configuration.HierarchicalConfiguration; +import org.apache.commons.configuration.XMLConfiguration; +import org.apache.log4j.Logger; +import org.apache.velocity.app.VelocityEngine; + + +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Multimap; +import com.google.gson.annotations.Expose; +import com.rex.crm.common.Entity; +import com.rex.crm.common.Field; +import com.rex.crm.common.Reaction; +import com.rex.crm.common.Relation; + +public class Configuration { + private static final Logger logger = Logger.getLogger(Configuration.class); + private static VelocityEngine ve; + private static Map entities = null; + private static Multimap relations = null; + + + public static VelocityEngine getVelocityEngine() { + + if (ve == null) { + synchronized (Configuration.class) { + Properties properties = new Properties(); + try { + properties.load(Configuration.class.getResourceAsStream("/velocity.properties")); + } catch (IOException e) { + e.printStackTrace(); + } + ve = new VelocityEngine(); + ve.init(properties); + } + } + return ve; + + } + + public static Entity getEntityByName(String name){ + Entity entity = null; + Map ents = getEntityTable(); + if(ents!=null && ents.size()!=0){ + entity = ents.get(name.toLowerCase()); + } + return entity; + } + public static Map getEntityTable(){ + if (entities == null || entities.size() == 0) { + synchronized (Configuration.class) { + List list = getEntities(); + entities = Maps.newHashMap(); + for(Entity en:list){ + entities.put(en.getName().toLowerCase(), en); + } + } + } + return entities; + } + + private static Class convert2Clazz(String dataType){ + + if(dataType.equalsIgnoreCase("string")){ + return String.class; + }else if(dataType.equalsIgnoreCase("long")){ + return long.class; + }else if(dataType.equalsIgnoreCase("boolean")){ + return boolean.class; + }else{ + return Object.class; + } + } + + public static List getRelationsByName(String name){ + List list = Lists.newArrayList(); + Multimap rel = getRelationTable(); + if(rel != null){ + Collection alist = rel.get(name); + list.addAll(alist); + } + return list; + } + + public static Multimap getRelationTable(){ + if (relations == null || relations.size() == 0) { + synchronized (Configuration.class) { + List list = getRelations(); + relations = ArrayListMultimap.create(); + for(Relation r:list){ + relations.put(r.getFrom(), r); + } + } + } + return relations; + } + + + public static List getSortedFieldGroupNames(){ + List list = Lists.newArrayList(); + list.add("关键信息"); + list.add("基本信息"); + list.add("附加信息"); + list.add("评分信息"); + return list; + } + + public static List getRelations(){ + List relations = new ArrayList<>(); + try { + XMLConfiguration config = new XMLConfiguration("relations.xml"); + List hp = config.configurationsAt("relation"); + + for (HierarchicalConfiguration sub : hp) { + Relation relation = new Relation(); + relations.add(relation); + relation.setName( sub.getString("name")); + relation.setDisplay(sub.getString("display")); + relation.setFrom(sub.getString("from")); + relation.setTo(sub.getString("to")); + relation.setSql(sub.getString("sql")); + relation.setSql_admin(sub.getString("sql-admin")); + relation.setSql_manager(sub.getString("sql-manager")); + List reactions = Lists.newArrayList(); + relation.setReactions(reactions); + List hp2 = sub.configurationsAt("reactions.reaction"); + + for(HierarchicalConfiguration sub2:hp2){ + Reaction reaction = new Reaction(); + reactions.add(reaction); + reaction.setName(sub2.getString("name")); + reaction.setUrl(sub2.getString("url")); + reaction.setDisplay(sub2.getString("display")); + reaction.setParamName(sub2.getString("paramName")); + + } + } + + } catch (ConfigurationException cex) { + cex.printStackTrace(); + } + + return relations; + } + + public static List getEntities() { + List enitites = new ArrayList<>(); + try { + XMLConfiguration config = new XMLConfiguration("entity.xml"); + List hp = config.configurationsAt("entity"); + + for (HierarchicalConfiguration sub : hp) { + Entity entity = new Entity(); + enitites.add(entity); + entity.setName( sub.getString("name")); + entity.setDisplay(sub.getString("display")); + entity.setSql(sub.getString("sql")); + entity.setSql_ent(sub.getString("sql-ent")); + entity.setSqlAdmin(sub.getString("sql-admin")); + entity.setSqlManager(sub.getString("sql-manager")); + entity.setSqlManagerCalendar(sub.getString("sql-manager-calendar")); + entity.setSqlAdminCalendar(sub.getString("sql-admin-calendar")); + entity.setSqlCalendar(sub.getString("sql-calendar")); + entity.setSqlManagerCoaching(sub.getString("sql-manager-coaching")); + entity.setSqlAdminCoaching(sub.getString("sql-admin-coaching")); + entity.setSqlCoaching(sub.getString("sql-coaching")); + entity.setExternalField(sub.getString("externalField")); + entity.setGlobalsearch(Boolean.parseBoolean(sub.getString("globalsearch"))); + String filterField = sub.getString("filterField"); + + if(filterField !=null){ + entity.setFilterField(filterField); + } + + List fields = Lists.newArrayList(); + entity.setFields(fields); + List hp2 = sub.configurationsAt("fields.field"); + + for(HierarchicalConfiguration sub2:hp2){ + Field field = new Field(); + fields.add(field); + field.setDataType(sub2.getString("data-type")); + field.setDisplay(sub2.getString("display")); + field.setName(sub2.getString("name")); + field.setPriority(Integer.parseInt(sub2.getString("priority"))); + + String picklist = sub2.getString("picklist"); + if(picklist!=null && picklist.trim().length()!=0){ + field.setPicklist(picklist); + }else{ + field.setPicklist(null); + } + + + String relationTable = sub2.getString("relationTable"); + if(relationTable!=null && relationTable.trim().length()!=0){ + field.setRelationTable(relationTable); + }else{ + field.setRelationTable(null); + } + + + String alias = sub2.getString("alias"); + if(alias!=null && alias.trim().length()!=0){ + field.setAlias(alias); + }else{ + field.setAlias(null); + } + + String formatter = sub2.getString("formatter"); + if(formatter !=null){ + field.setFormatter(formatter); + } + + + String fieldGroup = sub2.getString("fieldGroup"); + if(fieldGroup !=null){ + field.setFieldGroup(fieldGroup); + } + + String default_value = sub2.getString("default-value"); + if(default_value !=null){ + field.setDefault_value(default_value); + //System.out.println("default_value:"+field.getDefault_value()); + } + + String default_value_type = sub2.getString("default-value-type"); + if(default_value_type !=null){ + field.setDefault_value_type(default_value_type); + } + + String childNode = sub2.getString("childNode"); + if(childNode !=null){ + field.setChildNode(childNode); + } + + String parentNode = sub2.getString("parentNode"); + if(parentNode !=null){ + field.setParentNode(parentNode); + } + + String fieldtype = sub2.getString("field-type"); + if(fieldtype !=null){ + field.setFieldType(fieldtype); + } + String tooltip = sub2.getString("tooltip"); + if(tooltip!=null){ + field.setTooltip(Integer.parseInt(tooltip)); + } + String import_field_name = sub2.getString("import_field_name"); + if(import_field_name !=null){ + field.setImport_field_name(import_field_name); + } + + String import_external_foreignkey_field_name = sub2.getString("import_external_foreignkey_field_name"); + if(import_external_foreignkey_field_name!=null){ + field.setImport_external_foreignkey_field_name(import_external_foreignkey_field_name); + } + + field.setPrimaryKey(Boolean.parseBoolean(sub2.getString("isPrimaryKey"))); + field.setDetailLink(Boolean.parseBoolean(sub2.getString("isDetailLink"))); + field.setVisible(Boolean.parseBoolean(sub2.getString("isVisible"))); + field.setEditable(Boolean.parseBoolean(sub2.getString("isEditable"))); + field.setRequired(Boolean.parseBoolean(sub2.getString("isRequired"))); + field.setBaseInfo(Boolean.parseBoolean(sub2.getString("isBaseInfo"))); + field.setSearchable(Boolean.parseBoolean(sub2.getString("isSearchable"))); + field.setParam(Boolean.parseBoolean(sub2.getString("isParam"))); + field.setShow(Boolean.parseBoolean(sub2.getString("isShow"))); + field.setExistsDefaultValue(Boolean.parseBoolean(sub2.getString("isExistsDefaultValue"))); + + + } + + } + + } catch (ConfigurationException cex) { + cex.printStackTrace(); + } + + return enitites; + } + +} diff --git a/crm/src/main/java/com/rex/crm/util/SMTPAuthenticator.java b/crm/src/main/java/com/rex/crm/util/SMTPAuthenticator.java new file mode 100644 index 0000000..452ce0a --- /dev/null +++ b/crm/src/main/java/com/rex/crm/util/SMTPAuthenticator.java @@ -0,0 +1,21 @@ +package com.rex.crm.util; + +import javax.mail.Authenticator; +import javax.mail.PasswordAuthentication; + +public class SMTPAuthenticator extends Authenticator{ + String username = ""; + + String password = ""; + public SMTPAuthenticator() { + super(); + } + public SMTPAuthenticator(String user,String pwd){ + super(); + username = user; + password = pwd; + } + public PasswordAuthentication getPasswordAuthentication(){ + return new PasswordAuthentication(username,password); + } +} diff --git a/crm/src/main/java/com/rex/crm/util/SendEmail.java b/crm/src/main/java/com/rex/crm/util/SendEmail.java new file mode 100644 index 0000000..f63ec17 --- /dev/null +++ b/crm/src/main/java/com/rex/crm/util/SendEmail.java @@ -0,0 +1,68 @@ +package com.rex.crm.util; + +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.util.Properties; + +import javax.mail.Message; +import javax.mail.Session; +import javax.mail.Transport; +import javax.mail.internet.InternetAddress; +import javax.mail.internet.MimeMessage; + +import org.apache.log4j.Logger; + +import com.sun.mail.smtp.SMTPTransport; + +public class SendEmail { + private static final Logger logger = Logger.getLogger(SendEmail.class); + //发送有邮件方法 + public static boolean sendMail(String code,String sendEmail){ + Session sendMailSession = null; + SMTPTransport transport = null; + String str = "请点击链接激活用户:"; + try { + str = new String(str.getBytes("UTF-8"),"UTF-8"); + } catch (UnsupportedEncodingException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } + StringBuilder emailContent = new StringBuilder(str); + CRMUtility readFileUtil = new CRMUtility(); + emailContent.append(readFileUtil.readFileAttribure("http")); + emailContent.append(readFileUtil.readFileAttribure("url")); + emailContent.append("/"); + emailContent.append(readFileUtil.readFileAttribure("project")); + emailContent.append("/"); + emailContent.append(readFileUtil.readFileAttribure("jumpage")); + emailContent.append("?"); + emailContent.append(readFileUtil.readFileAttribure("parameter")); + emailContent.append("="); + emailContent.append(code); + Properties props = new Properties(); + // 与服务器建立Session的参数设置 + props.put("mail.smtp.host", "smtp.163.com"); // 写上你的SMTP服务器。 + props.put("mail.smtp.auth", "true"); // 将这个参数设为true,让服务器进行认证。 + SMTPAuthenticator auth = new SMTPAuthenticator("accpcui@163.com", "992041099"); // 用户名,密码。 + sendMailSession = Session.getInstance(props, auth); // 建立连接。 + // SMTPTransport用来发送邮件。 + try { + transport = (SMTPTransport) sendMailSession.getTransport("smtp"); + transport.connect(); + // 创建邮件。 + Message newMessage = new MimeMessage(sendMailSession); + newMessage.setFrom(new InternetAddress("accpcui@163.com")); + newMessage.setRecipient(Message.RecipientType.TO, new InternetAddress(sendEmail)); + newMessage.setSubject("Your crm Activation Email "); + newMessage.setSentDate(new Date()); + newMessage.setText(emailContent.toString()); + Transport.send(newMessage); + transport.close(); + logger.info("accpcui@163.com发送邮件到"+sendEmail+",已发送成功!"); + return true; + } catch (Exception e) { + System.err.println("邮件发送失败!"+e); + return false; + } + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/Account.java b/crm/src/main/java/com/rexen/crm/beans/Account.java new file mode 100644 index 0000000..db29c20 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/Account.java @@ -0,0 +1,487 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import com.rexen.crm.integration.DataObject; + +/** + * @author Ralf + */ +@Entity +@Table(name = "account") +@NamedQueries( + { + @NamedQuery(name = "Account.findAll", query = "SELECT a FROM Account a") + }) +public class Account extends DataObject implements Serializable +{ + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + private int id; + @Column(name = "name") + private String name; + @Column(name = "bdm_code") + private String bdmCode; + @Column(name = "administrativ_level") + private int administrativLevel; + @Column(name = "hospital_type") + private int hospitalType; + @Column(name = "local_or_army") + private int localOrArmy; + @Column(name = "comprehensive_or_specialized") + private int comprehensiveOrSpecialized; + @Column(name = "key_type") + private int keyType; + @Column(name = "status") + private int status; + @Column(name = "duty_officer") + private String dutyOfficer; + @Column(name = "num_of_doctors") + private int numOfDoctors; + @Column(name = "num_of_assistant_doctors") + private int numOfAssistantDoctors; + @Column(name = "num_of_staff") + private int numOfStaff; + @Column(name = "num_of_treat_per_year") + private int numOfTreatPerYear; + @Column(name = "num_of_outpatient") + private int numOfOutpatient; + @Column(name = "total_num_of_sickbed") + private int totalNumOfSickbed; + @Column(name = "num_of_anesthesia_doctor") + private int numOfAnesthesiaDoctor; + @Column(name = "num_of_pain_doctor") + private int numOfPainDoctor; + @Column(name = "num_of_surgery_per_year") + private int numOfSurgeryPerYear; + @Column(name = "num_of_surgery_room") + private int numOfSurgeryRoom; + @Column(name = "num_of_using_opiates_medicine") + private int numOfUsingOpiatesMedicine; + @Column(name = "num_of_using_opiates_injection") + private int numOfUsingOpiatesInjection; + @Column(name = "date_of_establish") + @Temporal(TemporalType.TIMESTAMP) + private Date dateOfEstablish; + @Column(name = "registered_capital") + private int registeredCapital; + @Column(name = "tel") + private String tel; + @Column(name = "fax") + private String fax; + @Column(name = "market_classification") + private int marketClassification; + @Column(name = "province") + private int province; + @Column(name = "city") + private int city; + @Column(name = "districts") + private String districts; + @Column(name = "address") + private String address; + @Column(name = "owner") + private String owner; + @Column(name = "whenadded") + @Temporal(TemporalType.TIMESTAMP) + private Date whenadded; + @Column(name = "modifier") + private String modifier; + @Column(name = "modify_datetime") + @Temporal(TemporalType.TIMESTAMP) + private Date modifyDatetime; + @Column(name = "responsible_person") + private String responsiblePerson; + + public Account() + { + } + + public Account(int id) + { + this.id = id; + } + + public Account(int id, String name) + { + this.id = id; + this.name = name; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public String getBdmCode() + { + return bdmCode; + } + + public void setBdmCode(String bdmCode) + { + this.bdmCode = bdmCode; + } + + public int getAdministrativLevel() + { + return administrativLevel; + } + + public void setAdministrativLevel(int administrativLevel) + { + this.administrativLevel = administrativLevel; + } + + public int getHospitalType() + { + return hospitalType; + } + + public void setHospitalType(int hospitalType) + { + this.hospitalType = hospitalType; + } + + public int getLocalOrArmy() + { + return localOrArmy; + } + + public void setLocalOrArmy(int localOrArmy) + { + this.localOrArmy = localOrArmy; + } + + public int getComprehensiveOrSpecialized() + { + return comprehensiveOrSpecialized; + } + + public void setComprehensiveOrSpecialized(int comprehensiveOrSpecialized) + { + this.comprehensiveOrSpecialized = comprehensiveOrSpecialized; + } + + public int getKeyType() + { + return keyType; + } + + public void setKeyType(int keyType) + { + this.keyType = keyType; + } + + public int getStatus() + { + return status; + } + + public void setStatus(int status) + { + this.status = status; + } + + public String getDutyOfficer() + { + return dutyOfficer; + } + + public void setDutyOfficer(String dutyOfficer) + { + this.dutyOfficer = dutyOfficer; + } + + public int getNumOfDoctors() + { + return numOfDoctors; + } + + public void setNumOfDoctors(int numOfDoctors) + { + this.numOfDoctors = numOfDoctors; + } + + public int getNumOfAssistantDoctors() + { + return numOfAssistantDoctors; + } + + public void setNumOfAssistantDoctors(int numOfAssistantDoctors) + { + this.numOfAssistantDoctors = numOfAssistantDoctors; + } + + public int getNumOfStaff() + { + return numOfStaff; + } + + public void setNumOfStaff(int numOfStaff) + { + this.numOfStaff = numOfStaff; + } + + public int getNumOfTreatPerYear() + { + return numOfTreatPerYear; + } + + public void setNumOfTreatPerYear(int numOfTreatPerYear) + { + this.numOfTreatPerYear = numOfTreatPerYear; + } + + public int getNumOfOutpatient() + { + return numOfOutpatient; + } + + public void setNumOfOutpatient(int numOfOutpatient) + { + this.numOfOutpatient = numOfOutpatient; + } + + public int getTotalNumOfSickbed() + { + return totalNumOfSickbed; + } + + public void setTotalNumOfSickbed(int totalNumOfSickbed) + { + this.totalNumOfSickbed = totalNumOfSickbed; + } + + public int getNumOfAnesthesiaDoctor() + { + return numOfAnesthesiaDoctor; + } + + public void setNumOfAnesthesiaDoctor(int numOfAnesthesiaDoctor) + { + this.numOfAnesthesiaDoctor = numOfAnesthesiaDoctor; + } + + public int getNumOfPainDoctor() + { + return numOfPainDoctor; + } + + public void setNumOfPainDoctor(int numOfPainDoctor) + { + this.numOfPainDoctor = numOfPainDoctor; + } + + public int getNumOfSurgeryPerYear() + { + return numOfSurgeryPerYear; + } + + public void setNumOfSurgeryPerYear(int numOfSurgeryPerYear) + { + this.numOfSurgeryPerYear = numOfSurgeryPerYear; + } + + public int getNumOfSurgeryRoom() + { + return numOfSurgeryRoom; + } + + public void setNumOfSurgeryRoom(int numOfSurgeryRoom) + { + this.numOfSurgeryRoom = numOfSurgeryRoom; + } + + public int getNumOfUsingOpiatesMedicine() + { + return numOfUsingOpiatesMedicine; + } + + public void setNumOfUsingOpiatesMedicine(int numOfUsingOpiatesMedicine) + { + this.numOfUsingOpiatesMedicine = numOfUsingOpiatesMedicine; + } + + public int getNumOfUsingOpiatesInjection() + { + return numOfUsingOpiatesInjection; + } + + public void setNumOfUsingOpiatesInjection(int numOfUsingOpiatesInjection) + { + this.numOfUsingOpiatesInjection = numOfUsingOpiatesInjection; + } + + public Date getDateOfEstablish() + { + return dateOfEstablish; + } + + public void setDateOfEstablish(Date dateOfEstablish) + { + this.dateOfEstablish = dateOfEstablish; + } + + public int getRegisteredCapital() + { + return registeredCapital; + } + + public void setRegisteredCapital(int registeredCapital) + { + this.registeredCapital = registeredCapital; + } + + public String getTel() + { + return tel; + } + + public void setTel(String tel) + { + this.tel = tel; + } + + public String getFax() + { + return fax; + } + + public void setFax(String fax) + { + this.fax = fax; + } + + public int getMarketClassification() + { + return marketClassification; + } + + public void setMarketClassification(int marketClassification) + { + this.marketClassification = marketClassification; + } + + public int getProvince() + { + return province; + } + + public void setProvince(int province) + { + this.province = province; + } + + public int getCity() + { + return city; + } + + public void setCity(int city) + { + this.city = city; + } + + public String getDistricts() + { + return districts; + } + + public void setDistricts(String districts) + { + this.districts = districts; + } + + public String getAddress() + { + return address; + } + + public void setAddress(String address) + { + this.address = address; + } + + public String getOwner() + { + return owner; + } + + public void setOwner(String owner) + { + this.owner = owner; + } + + public Date getWhenadded() + { + return whenadded; + } + + public void setWhenadded(Date whenadded) + { + this.whenadded = whenadded; + } + + public String getModifier() + { + return modifier; + } + + public void setModifier(String modifier) + { + this.modifier = modifier; + } + + public Date getModifyDatetime() + { + return modifyDatetime; + } + + public void setModifyDatetime(Date modifyDatetime) + { + this.modifyDatetime = modifyDatetime; + } + + public String getResponsiblePerson() + { + return responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) + { + this.responsiblePerson = responsiblePerson; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/AccountAdministrativLevelPl.java b/crm/src/main/java/com/rexen/crm/beans/AccountAdministrativLevelPl.java new file mode 100644 index 0000000..5dfa2de --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/AccountAdministrativLevelPl.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "account_administrativ_level_pl") +@NamedQueries( + { + @NamedQuery(name = "AccountAdministrativLevelPl.findAll", query = "SELECT a FROM AccountAdministrativLevelPl a") + }) +public class AccountAdministrativLevelPl implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public AccountAdministrativLevelPl() + { + } + + public AccountAdministrativLevelPl(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/AccountComprehensiveOrSpecializedPl.java b/crm/src/main/java/com/rexen/crm/beans/AccountComprehensiveOrSpecializedPl.java new file mode 100644 index 0000000..227b862 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/AccountComprehensiveOrSpecializedPl.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "account_comprehensive_or_specialized_pl") +@NamedQueries( + { + @NamedQuery(name = "AccountComprehensiveOrSpecializedPl.findAll", query = "SELECT a FROM AccountComprehensiveOrSpecializedPl a") + }) +public class AccountComprehensiveOrSpecializedPl implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public AccountComprehensiveOrSpecializedPl() + { + } + + public AccountComprehensiveOrSpecializedPl(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/AccountGradePl.java b/crm/src/main/java/com/rexen/crm/beans/AccountGradePl.java new file mode 100644 index 0000000..668ea21 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/AccountGradePl.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "account_grade_pl") +@NamedQueries( + { + @NamedQuery(name = "AccountGradePl.findAll", query = "SELECT a FROM AccountGradePl a") + }) +public class AccountGradePl implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public AccountGradePl() + { + } + + public AccountGradePl(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/AccountLocalOrArmyPl.java b/crm/src/main/java/com/rexen/crm/beans/AccountLocalOrArmyPl.java new file mode 100644 index 0000000..5e1833f --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/AccountLocalOrArmyPl.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "account_local_or_army_pl") +@NamedQueries( + { + @NamedQuery(name = "AccountLocalOrArmyPl.findAll", query = "SELECT a FROM AccountLocalOrArmyPl a") + }) +public class AccountLocalOrArmyPl implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public AccountLocalOrArmyPl() + { + } + + public AccountLocalOrArmyPl(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/AccountMarketClassificationPl.java b/crm/src/main/java/com/rexen/crm/beans/AccountMarketClassificationPl.java new file mode 100644 index 0000000..da33842 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/AccountMarketClassificationPl.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "account_market_classification_pl") +@NamedQueries( + { + @NamedQuery(name = "AccountMarketClassificationPl.findAll", query = "SELECT a FROM AccountMarketClassificationPl a") + }) +public class AccountMarketClassificationPl implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public AccountMarketClassificationPl() + { + } + + public AccountMarketClassificationPl(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/AccountMedicaltypePl.java b/crm/src/main/java/com/rexen/crm/beans/AccountMedicaltypePl.java new file mode 100644 index 0000000..6e40c9c --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/AccountMedicaltypePl.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "account_medicaltype_pl") +@NamedQueries( + { + @NamedQuery(name = "AccountMedicaltypePl.findAll", query = "SELECT a FROM AccountMedicaltypePl a") + }) +public class AccountMedicaltypePl implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public AccountMedicaltypePl() + { + } + + public AccountMedicaltypePl(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/AccountPl1.java b/crm/src/main/java/com/rexen/crm/beans/AccountPl1.java new file mode 100644 index 0000000..f3cf4d1 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/AccountPl1.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "account_pl1") +@NamedQueries( + { + @NamedQuery(name = "AccountPl1.findAll", query = "SELECT a FROM AccountPl1 a") + }) +public class AccountPl1 implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public AccountPl1() + { + } + + public AccountPl1(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/AccountPl2.java b/crm/src/main/java/com/rexen/crm/beans/AccountPl2.java new file mode 100644 index 0000000..a3db7ee --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/AccountPl2.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "account_pl2") +@NamedQueries( + { + @NamedQuery(name = "AccountPl2.findAll", query = "SELECT a FROM AccountPl2 a") + }) +public class AccountPl2 implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public AccountPl2() + { + } + + public AccountPl2(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/AccountPl3.java b/crm/src/main/java/com/rexen/crm/beans/AccountPl3.java new file mode 100644 index 0000000..e8854b7 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/AccountPl3.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "account_pl3") +@NamedQueries( + { + @NamedQuery(name = "AccountPl3.findAll", query = "SELECT a FROM AccountPl3 a") + }) +public class AccountPl3 implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public AccountPl3() + { + } + + public AccountPl3(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/AccountPl4.java b/crm/src/main/java/com/rexen/crm/beans/AccountPl4.java new file mode 100644 index 0000000..12d95a7 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/AccountPl4.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "account_pl4") +@NamedQueries( + { + @NamedQuery(name = "AccountPl4.findAll", query = "SELECT a FROM AccountPl4 a") + }) +public class AccountPl4 implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public AccountPl4() + { + } + + public AccountPl4(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/AccountPl5.java b/crm/src/main/java/com/rexen/crm/beans/AccountPl5.java new file mode 100644 index 0000000..890ee07 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/AccountPl5.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "account_pl5") +@NamedQueries( + { + @NamedQuery(name = "AccountPl5.findAll", query = "SELECT a FROM AccountPl5 a") + }) +public class AccountPl5 implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public AccountPl5() + { + } + + public AccountPl5(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/AccountPl6.java b/crm/src/main/java/com/rexen/crm/beans/AccountPl6.java new file mode 100644 index 0000000..0d31969 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/AccountPl6.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "account_pl6") +@NamedQueries( + { + @NamedQuery(name = "AccountPl6.findAll", query = "SELECT a FROM AccountPl6 a") + }) +public class AccountPl6 implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public AccountPl6() + { + } + + public AccountPl6(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/AccountPointPl.java b/crm/src/main/java/com/rexen/crm/beans/AccountPointPl.java new file mode 100644 index 0000000..cb26633 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/AccountPointPl.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "account_point_pl") +@NamedQueries( + { + @NamedQuery(name = "AccountPointPl.findAll", query = "SELECT a FROM AccountPointPl a") + }) +public class AccountPointPl implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public AccountPointPl() + { + } + + public AccountPointPl(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/AccountStatusPl.java b/crm/src/main/java/com/rexen/crm/beans/AccountStatusPl.java new file mode 100644 index 0000000..26b677e --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/AccountStatusPl.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "account_status_pl") +@NamedQueries( + { + @NamedQuery(name = "AccountStatusPl.findAll", query = "SELECT a FROM AccountStatusPl a") + }) +public class AccountStatusPl implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public AccountStatusPl() + { + } + + public AccountStatusPl(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/AccountTypePl.java b/crm/src/main/java/com/rexen/crm/beans/AccountTypePl.java new file mode 100644 index 0000000..fcbd195 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/AccountTypePl.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "account_type_pl") +@NamedQueries( + { + @NamedQuery(name = "AccountTypePl.findAll", query = "SELECT a FROM AccountTypePl a") + }) +public class AccountTypePl implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public AccountTypePl() + { + } + + public AccountTypePl(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/Accountcrmuser.java b/crm/src/main/java/com/rexen/crm/beans/Accountcrmuser.java new file mode 100644 index 0000000..ec76781 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/Accountcrmuser.java @@ -0,0 +1,91 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "accountcrmuser") +@NamedQueries( + { + @NamedQuery(name = "Accountcrmuser.findAll", query = "SELECT a FROM Accountcrmuser a") + }) +public class Accountcrmuser implements Serializable +{ + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "crmuserId") + private int crmuserId; + @Column(name = "accountId") + private int accountId; + @Column(name = "externalId") + private String externalId; + + public String getExternalId() + { + return externalId; + } + + public void setExternalId(String externalId) + { + this.externalId = externalId; + } + + public int getCrmuserId() + { + return crmuserId; + } + + public void setCrmuserId(int crmuserId) + { + this.crmuserId = crmuserId; + } + + public int getAccountId() + { + return accountId; + } + + public void setAccountId(int accountId) + { + this.accountId = accountId; + } + + public Accountcrmuser() + { + } + + public Accountcrmuser(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/Activity.java b/crm/src/main/java/com/rexen/crm/beans/Activity.java new file mode 100644 index 0000000..9c1e731 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/Activity.java @@ -0,0 +1,454 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Ralf + */ +@Entity +@Table(name = "activity") +@NamedQueries( +{ + @NamedQuery(name = "Activity.findAll", query = "SELECT a FROM Activity a") +}) +public class Activity implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "name") + private String name; + @Basic(optional = false) + @Column(name = "event_type") + private int eventType; + @Column(name = "endtime") + private int endtime; + @Basic(optional = false) + @Column(name = "starttime") + private long starttime; + @Column(name = "title") + private String title; + @Column(name = "participants") + private String participants; + @Column(name = "activity_type") + private int activityType; + @Column(name = "coacheeId") + private int coacheeId; + @Column(name = "status") + private int status; + @Column(name = "visiting_purpose") + private int visitingPurpose; + @Column(name = "feature_product") + private int featureProduct; + @Column(name = "act_endtime") + @Temporal(TemporalType.TIMESTAMP) + private Date actEndtime; + @Column(name = "owner") + private String owner; + @Column(name = "whenadded") + @Temporal(TemporalType.TIMESTAMP) + private Date whenadded; + @Column(name = "modifier") + private String modifier; + @Column(name = "modify_datetime") + @Temporal(TemporalType.TIMESTAMP) + private Date modifyDatetime; + @Column(name = "responsible_person") + private String responsiblePerson; + @Column(name = "coach") + private int coach; + @Column(name = "location") + private String location; + @Column(name = "total_score") + private int totalScore; + @Column(name = "planing") + private int planing; + @Column(name = "openling") + private int openling; + @Column(name = "enquery_listening") + private int enqueryListening; + @Column(name = "deliverable") + private int deliverable; + @Column(name = "objection_handing") + private int objectionHanding; + @Column(name = "summary") + private int summary; + @Column(name = "whetherCoach") + private int whetherCoach; + @Column(name = "coachTime") + private int coachTime; + @Column(name = "accountId") + private int accountId; + @Column(name = "department") + private int department; + @Column(name = "whether_coach") + private String whetherCoach1; + @Column(name = "activity_daypart") + private int activityDaypart; + + public Activity() + { + } + + public Activity(int id) + { + this.id = id; + } + + public Activity(int id, int eventType, long starttime) + { + this.id = id; + this.eventType = eventType; + this.starttime = starttime; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public int getEventType() + { + return eventType; + } + + public void setEventType(int eventType) + { + this.eventType = eventType; + } + + public int getEndtime() + { + return endtime; + } + + public void setEndtime(int endtime) + { + this.endtime = endtime; + } + + public long getStarttime() + { + return starttime; + } + + public void setStarttime(long starttime) + { + this.starttime = starttime; + } + + public String getTitle() + { + return title; + } + + public void setTitle(String title) + { + this.title = title; + } + + public String getParticipants() + { + return participants; + } + + public void setParticipants(String participants) + { + this.participants = participants; + } + + public int getActivityType() + { + return activityType; + } + + public void setActivityType(int activityType) + { + this.activityType = activityType; + } + + public int getCoacheeId() + { + return coacheeId; + } + + public void setCoacheeId(int coacheeId) + { + this.coacheeId = coacheeId; + } + + public int getStatus() + { + return status; + } + + public void setStatus(int status) + { + this.status = status; + } + + public int getVisitingPurpose() + { + return visitingPurpose; + } + + public void setVisitingPurpose(int visitingPurpose) + { + this.visitingPurpose = visitingPurpose; + } + + public int getFeatureProduct() + { + return featureProduct; + } + + public void setFeatureProduct(int featureProduct) + { + this.featureProduct = featureProduct; + } + + public Date getActEndtime() + { + return actEndtime; + } + + public void setActEndtime(Date actEndtime) + { + this.actEndtime = actEndtime; + } + + public String getOwner() + { + return owner; + } + + public void setOwner(String owner) + { + this.owner = owner; + } + + public Date getWhenadded() + { + return whenadded; + } + + public void setWhenadded(Date whenadded) + { + this.whenadded = whenadded; + } + + public String getModifier() + { + return modifier; + } + + public void setModifier(String modifier) + { + this.modifier = modifier; + } + + public Date getModifyDatetime() + { + return modifyDatetime; + } + + public void setModifyDatetime(Date modifyDatetime) + { + this.modifyDatetime = modifyDatetime; + } + + public String getResponsiblePerson() + { + return responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) + { + this.responsiblePerson = responsiblePerson; + } + + public int getCoach() + { + return coach; + } + + public void setCoach(int coach) + { + this.coach = coach; + } + + public String getLocation() + { + return location; + } + + public void setLocation(String location) + { + this.location = location; + } + + public int getTotalScore() + { + return totalScore; + } + + public void setTotalScore(int totalScore) + { + this.totalScore = totalScore; + } + + public int getPlaning() + { + return planing; + } + + public void setPlaning(int planing) + { + this.planing = planing; + } + + public int getOpenling() + { + return openling; + } + + public void setOpenling(int openling) + { + this.openling = openling; + } + + public int getEnqueryListening() + { + return enqueryListening; + } + + public void setEnqueryListening(int enqueryListening) + { + this.enqueryListening = enqueryListening; + } + + public int getDeliverable() + { + return deliverable; + } + + public void setDeliverable(int deliverable) + { + this.deliverable = deliverable; + } + + public int getObjectionHanding() + { + return objectionHanding; + } + + public void setObjectionHanding(int objectionHanding) + { + this.objectionHanding = objectionHanding; + } + + public int getSummary() + { + return summary; + } + + public void setSummary(int summary) + { + this.summary = summary; + } + + public int getWhetherCoach() + { + return whetherCoach; + } + + public void setWhetherCoach(int whetherCoach) + { + this.whetherCoach = whetherCoach; + } + + public int getCoachTime() + { + return coachTime; + } + + public void setCoachTime(int coachTime) + { + this.coachTime = coachTime; + } + + public int getAccountId() + { + return accountId; + } + + public void setAccountId(int accountId) + { + this.accountId = accountId; + } + + public int getDepartment() + { + return department; + } + + public void setDepartment(int department) + { + this.department = department; + } + + public String getWhetherCoach1() + { + return whetherCoach1; + } + + public void setWhetherCoach1(String whetherCoach1) + { + this.whetherCoach1 = whetherCoach1; + } + + public int getActivityDaypart() + { + return activityDaypart; + } + + public void setActivityDaypart(int activityDaypart) + { + this.activityDaypart = activityDaypart; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/ActivityActivityTypesPl.java b/crm/src/main/java/com/rexen/crm/beans/ActivityActivityTypesPl.java new file mode 100644 index 0000000..8b3ec73 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/ActivityActivityTypesPl.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "activity_activity_types_pl") +@NamedQueries( + { + @NamedQuery(name = "ActivityActivityTypesPl.findAll", query = "SELECT a FROM ActivityActivityTypesPl a") + }) +public class ActivityActivityTypesPl implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public ActivityActivityTypesPl() + { + } + + public ActivityActivityTypesPl(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/ActivityEventTypePl.java b/crm/src/main/java/com/rexen/crm/beans/ActivityEventTypePl.java new file mode 100644 index 0000000..5740a0a --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/ActivityEventTypePl.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "activity_event_type_pl") +@NamedQueries( + { + @NamedQuery(name = "ActivityEventTypePl.findAll", query = "SELECT a FROM ActivityEventTypePl a") + }) +public class ActivityEventTypePl implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public ActivityEventTypePl() + { + } + + public ActivityEventTypePl(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/ActivityFeatureProductPl.java b/crm/src/main/java/com/rexen/crm/beans/ActivityFeatureProductPl.java new file mode 100644 index 0000000..3b86ed7 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/ActivityFeatureProductPl.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "activity_feature_product_pl") +@NamedQueries( + { + @NamedQuery(name = "ActivityFeatureProductPl.findAll", query = "SELECT a FROM ActivityFeatureProductPl a") + }) +public class ActivityFeatureProductPl implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public ActivityFeatureProductPl() + { + } + + public ActivityFeatureProductPl(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/ActivityStatus.java b/crm/src/main/java/com/rexen/crm/beans/ActivityStatus.java new file mode 100644 index 0000000..53d41a8 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/ActivityStatus.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "activity_status") +@NamedQueries( + { + @NamedQuery(name = "ActivityStatus.findAll", query = "SELECT a FROM ActivityStatus a") + }) +public class ActivityStatus implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public ActivityStatus() + { + } + + public ActivityStatus(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/ActivityStatusPl.java b/crm/src/main/java/com/rexen/crm/beans/ActivityStatusPl.java new file mode 100644 index 0000000..7cbf642 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/ActivityStatusPl.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "activity_status_pl") +@NamedQueries( + { + @NamedQuery(name = "ActivityStatusPl.findAll", query = "SELECT a FROM ActivityStatusPl a") + }) +public class ActivityStatusPl implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public ActivityStatusPl() + { + } + + public ActivityStatusPl(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/ActivityTypes.java b/crm/src/main/java/com/rexen/crm/beans/ActivityTypes.java new file mode 100644 index 0000000..6022ed2 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/ActivityTypes.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "activity_types") +@NamedQueries( + { + @NamedQuery(name = "ActivityTypes.findAll", query = "SELECT a FROM ActivityTypes a") + }) +public class ActivityTypes implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public ActivityTypes() + { + } + + public ActivityTypes(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/ActivityVisitingPurposePl.java b/crm/src/main/java/com/rexen/crm/beans/ActivityVisitingPurposePl.java new file mode 100644 index 0000000..109cfad --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/ActivityVisitingPurposePl.java @@ -0,0 +1,90 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "activity_visiting_purpose_pl") +@NamedQueries( + { + @NamedQuery(name = "ActivityVisitingPurposePl.findAll", query = "SELECT a FROM ActivityVisitingPurposePl a") + }) +public class ActivityVisitingPurposePl implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + @Column(name = "activity_type") + private int activityType; + @Column(name = "parentId") + private int parentId; + + public ActivityVisitingPurposePl() + { + } + + public ActivityVisitingPurposePl(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } + + public int getActivityType() + { + return activityType; + } + + public void setActivityType(int activityType) + { + this.activityType = activityType; + } + + public int getParentId() + { + return parentId; + } + + public void setParentId(int parentId) + { + this.parentId = parentId; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/ActivityWhethercoachPl.java b/crm/src/main/java/com/rexen/crm/beans/ActivityWhethercoachPl.java new file mode 100644 index 0000000..e2107e3 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/ActivityWhethercoachPl.java @@ -0,0 +1,63 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "activity_whethercoach_pl") +@NamedQueries( + { + @NamedQuery(name = "ActivityWhethercoachPl.findAll", query = "SELECT a FROM ActivityWhethercoachPl a") + }) +public class ActivityWhethercoachPl implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public ActivityWhethercoachPl() + { + } + + public ActivityWhethercoachPl(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/Activitycrmuser.java b/crm/src/main/java/com/rexen/crm/beans/Activitycrmuser.java new file mode 100644 index 0000000..aa02474 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/Activitycrmuser.java @@ -0,0 +1,81 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "activitycrmuser") +@NamedQueries( + { + @NamedQuery(name = "Activitycrmuser.findAll", query = "SELECT a FROM Activitycrmuser a") + }) +public class Activitycrmuser implements Serializable +{ + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "activityId") + private int activityId; + @Column(name = "crmuserId") + private int crmuserId; + + public int getActivityId() + { + return activityId; + } + + public void setActivityId(int activityId) + { + this.activityId = activityId; + } + + public int getCrmuserId() + { + return crmuserId; + } + + public void setCrmuserId(int crmuserId) + { + this.crmuserId = crmuserId; + } + + public Activitycrmuser() + { + } + + public Activitycrmuser(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/CallExport.java b/crm/src/main/java/com/rexen/crm/beans/CallExport.java new file mode 100644 index 0000000..2d2ee07 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/CallExport.java @@ -0,0 +1,410 @@ +/* + * Copyright 2013 Ralf. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * @author Ralf + */ +@Entity +@Table(name = "call_export") +@XmlRootElement +public class CallExport implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @Column(name = "activity_id") + private int activityId; + + public int getActivityId() + { + return activityId; + } + + public void setActivityId(int activityId) + { + this.activityId = activityId; + } + + @Column(name = "Activity_title") + private String activitytitle; + @Column(name = "Activity_whetherCoach") + private String activitywhetherCoach; + @Column(name = "Activity_feature_product") + private String activityfeatureproduct; + @Column(name = "Activity_types") + private String activitytypes; + @Column(name = "Activity_addTime") + @Temporal(TemporalType.TIMESTAMP) + private Date activityaddTime; + @Column(name = "Activity_modifyTime") + @Temporal(TemporalType.TIMESTAMP) + private Date activitymodifyTime; + @Column(name = "Activity_start") + @Temporal(TemporalType.TIMESTAMP) + private Date activitystart; + @Column(name = "Activity_end") + @Temporal(TemporalType.TIMESTAMP) + private Date activityend; + @Column(name = "Position_name") + private String positionname; + @Column(name = "Region_level_1") + private String regionlevel1; + @Column(name = "Region_level_2") + private String regionlevel2; + @Column(name = "position_code") + private String positionCode; + @Column(name = "position_role") + private String positionRole; + @Column(name = "Contact_name") + private String contactname; + @Column(name = "Contact_grade") + private String contactgrade; + @Column(name = "Contact_department") + private String contactdepartment; + @Column(name = "Contact_sex") + private String contactsex; + @Column(name = "Contact_email") + private String contactemail; + @Column(name = "Contact_duty") + private String contactduty; + @Column(name = "Contact_job_title") + private String contactjobtitle; + @Column(name = "Account_name") + private String accountname; + @Column(name = "Account_BDMCode") + private String accountBDMCode; + @Column(name = "Account_garde") + private String accountgarde; + @Column(name = "Account_type") + private String accounttype; + @Column(name = "Account_administrative_level") + private String accountadministrativelevel; + @Column(name = "local_or_army") + private String localOrArmy; + @Column(name = "comprehensive_or_specialized") + private String comprehensiveOrSpecialized; + @Column(name = "isKey") + private String isKey; + @Column(name = "Account_status") + private String accountstatus; + + public CallExport() + { + } + + public String getActivitytitle() + { + return activitytitle; + } + + public void setActivitytitle(String activitytitle) + { + this.activitytitle = activitytitle; + } + + public String getActivitywhetherCoach() + { + return activitywhetherCoach; + } + + public void setActivitywhetherCoach(String activitywhetherCoach) + { + this.activitywhetherCoach = activitywhetherCoach; + } + + public String getActivityfeatureproduct() + { + return activityfeatureproduct; + } + + public void setActivityfeatureproduct(String activityfeatureproduct) + { + this.activityfeatureproduct = activityfeatureproduct; + } + + public String getActivitytypes() + { + return activitytypes; + } + + public void setActivitytypes(String activitytypes) + { + this.activitytypes = activitytypes; + } + + public Date getActivityaddTime() + { + return activityaddTime; + } + + public void setActivityaddTime(Date activityaddTime) + { + this.activityaddTime = activityaddTime; + } + + public Date getActivitymodifyTime() + { + return activitymodifyTime; + } + + public void setActivitymodifyTime(Date activitymodifyTime) + { + this.activitymodifyTime = activitymodifyTime; + } + + public Date getActivitystart() + { + return activitystart; + } + + public void setActivitystart(Date activitystart) + { + this.activitystart = activitystart; + } + + public Date getActivityend() + { + return activityend; + } + + public void setActivityend(Date activityend) + { + this.activityend = activityend; + } + + public String getPositionname() + { + return positionname; + } + + public void setPositionname(String positionname) + { + this.positionname = positionname; + } + + public String getRegionlevel1() + { + return regionlevel1; + } + + public void setRegionlevel1(String regionlevel1) + { + this.regionlevel1 = regionlevel1; + } + + public String getRegionlevel2() + { + return regionlevel2; + } + + public void setRegionlevel2(String regionlevel2) + { + this.regionlevel2 = regionlevel2; + } + + public String getPositionCode() + { + return positionCode; + } + + public void setPositionCode(String positionCode) + { + this.positionCode = positionCode; + } + + public String getPositionRole() + { + return positionRole; + } + + public void setPositionRole(String positionRole) + { + this.positionRole = positionRole; + } + + public String getContactname() + { + return contactname; + } + + public void setContactname(String contactname) + { + this.contactname = contactname; + } + + public String getContactgrade() + { + return contactgrade; + } + + public void setContactgrade(String contactgrade) + { + this.contactgrade = contactgrade; + } + + public String getContactdepartment() + { + return contactdepartment; + } + + public void setContactdepartment(String contactdepartment) + { + this.contactdepartment = contactdepartment; + } + + public String getContactsex() + { + return contactsex; + } + + public void setContactsex(String contactsex) + { + this.contactsex = contactsex; + } + + public String getContactemail() + { + return contactemail; + } + + public void setContactemail(String contactemail) + { + this.contactemail = contactemail; + } + + public String getContactduty() + { + return contactduty; + } + + public void setContactduty(String contactduty) + { + this.contactduty = contactduty; + } + + public String getContactjobtitle() + { + return contactjobtitle; + } + + public void setContactjobtitle(String contactjobtitle) + { + this.contactjobtitle = contactjobtitle; + } + + public String getAccountname() + { + return accountname; + } + + public void setAccountname(String accountname) + { + this.accountname = accountname; + } + + public String getAccountBDMCode() + { + return accountBDMCode; + } + + public void setAccountBDMCode(String accountBDMCode) + { + this.accountBDMCode = accountBDMCode; + } + + public String getAccountgarde() + { + return accountgarde; + } + + public void setAccountgarde(String accountgarde) + { + this.accountgarde = accountgarde; + } + + public String getAccounttype() + { + return accounttype; + } + + public void setAccounttype(String accounttype) + { + this.accounttype = accounttype; + } + + public String getAccountadministrativelevel() + { + return accountadministrativelevel; + } + + public void setAccountadministrativelevel(String accountadministrativelevel) + { + this.accountadministrativelevel = accountadministrativelevel; + } + + public String getLocalOrArmy() + { + return localOrArmy; + } + + public void setLocalOrArmy(String localOrArmy) + { + this.localOrArmy = localOrArmy; + } + + public String getComprehensiveOrSpecialized() + { + return comprehensiveOrSpecialized; + } + + public void setComprehensiveOrSpecialized(String comprehensiveOrSpecialized) + { + this.comprehensiveOrSpecialized = comprehensiveOrSpecialized; + } + + public String getIsKey() + { + return isKey; + } + + public void setIsKey(String isKey) + { + this.isKey = isKey; + } + + public String getAccountstatus() + { + return accountstatus; + } + + public void setAccountstatus(String accountstatus) + { + this.accountstatus = accountstatus; + } + +} diff --git a/crm/src/main/java/com/rexen/crm/beans/City.java b/crm/src/main/java/com/rexen/crm/beans/City.java new file mode 100644 index 0000000..f59ab33 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/City.java @@ -0,0 +1,91 @@ +/* + * Copyright 2013 Ralf. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "city") +@NamedQueries( + { + @NamedQuery(name = "City.findAll", query = "SELECT c FROM City c") + }) +public class City implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + @Column(name = "externalId") + private String externalId; + + public City() + { + } + + public City(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } + + public String getExternalId() + { + return externalId; + } + + public void setExternalId(String externalId) + { + this.externalId = externalId; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/Contact.java b/crm/src/main/java/com/rexen/crm/beans/Contact.java new file mode 100644 index 0000000..9567070 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/Contact.java @@ -0,0 +1,374 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import com.rexen.crm.integration.DataObject; + +/** + * @author Ralf + */ +@Entity +@Table(name = "contact") +@NamedQueries( + { + @NamedQuery(name = "Contact.findAll", query = "SELECT c FROM Contact c") + }) +public class Contact extends DataObject implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Basic(optional = false) + @Column(name = "name") + private String name; + @Column(name = "department") + private int department; + @Column(name = "sex") + private int sex; + @Column(name = "native_place") + private String nativePlace; + @Column(name = "office_tel") + private String officeTel; + @Column(name = "office_fax") + private String officeFax; + @Column(name = "cellphone") + private String cellphone; + @Column(name = "email") + private String email; + @Column(name = "status") + private String status; + @Column(name = "market_classification") + private int marketClassification; + @Column(name = "grade") + private int grade; + @Column(name = "province") + private int province; + @Column(name = "city") + private int city; + @Column(name = "districts") + private String districts; + @Column(name = "duty") + private int duty; + @Column(name = "job_title") + private int jobTitle; + @Column(name = "visiting_target") + private int visitingTarget; + @Column(name = "product_target") + private String productTarget; + @Column(name = "owner") + private String owner; + @Column(name = "whenadded") + @Temporal(TemporalType.TIMESTAMP) + private Date whenadded; + @Column(name = "modifier") + private String modifier; + @Column(name = "modify_datetime") + @Temporal(TemporalType.TIMESTAMP) + private Date modifyDatetime; + @Column(name = "responsible_person") + private String responsiblePerson; + @Column(name = "contactCode") + private String contactCode; + @Column(name = "accountId") + private int accountId; + + public int getAccountId() + { + return accountId; + } + + public void setAccountId(int accountId) + { + this.accountId = accountId; + } + + public Contact() + { + } + + public Contact(int id) + { + this.id = id; + } + + public Contact(int id, String name) + { + this.id = id; + this.name = name; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public int getDepartment() + { + return department; + } + + public void setDepartment(int department) + { + this.department = department; + } + + public int getSex() + { + return sex; + } + + public void setSex(int sex) + { + this.sex = sex; + } + + public String getNativePlace() + { + return nativePlace; + } + + public void setNativePlace(String nativePlace) + { + this.nativePlace = nativePlace; + } + + public String getOfficeTel() + { + return officeTel; + } + + public void setOfficeTel(String officeTel) + { + this.officeTel = officeTel; + } + + public String getOfficeFax() + { + return officeFax; + } + + public void setOfficeFax(String officeFax) + { + this.officeFax = officeFax; + } + + public String getCellphone() + { + return cellphone; + } + + public void setCellphone(String cellphone) + { + this.cellphone = cellphone; + } + + public String getEmail() + { + return email; + } + + public void setEmail(String email) + { + this.email = email; + } + + public String getStatus() + { + return status; + } + + public void setStatus(String status) + { + this.status = status; + } + + public int getMarketClassification() + { + return marketClassification; + } + + public void setMarketClassification(int marketClassification) + { + this.marketClassification = marketClassification; + } + + public int getGrade() + { + return grade; + } + + public void setGrade(int grade) + { + this.grade = grade; + } + + public int getProvince() + { + return province; + } + + public void setProvince(int province) + { + this.province = province; + } + + public int getCity() + { + return city; + } + + public void setCity(int city) + { + this.city = city; + } + + public String getDistricts() + { + return districts; + } + + public void setDistricts(String districts) + { + this.districts = districts; + } + + public int getDuty() + { + return duty; + } + + public void setDuty(int duty) + { + this.duty = duty; + } + + public int getJobTitle() + { + return jobTitle; + } + + public void setJobTitle(int jobTitle) + { + this.jobTitle = jobTitle; + } + + public int getVisitingTarget() + { + return visitingTarget; + } + + public void setVisitingTarget(int visitingTarget) + { + this.visitingTarget = visitingTarget; + } + + public String getProductTarget() + { + return productTarget; + } + + public void setProductTarget(String productTarget) + { + this.productTarget = productTarget; + } + + public String getOwner() + { + return owner; + } + + public void setOwner(String owner) + { + this.owner = owner; + } + + public Date getWhenadded() + { + return whenadded; + } + + public void setWhenadded(Date whenadded) + { + this.whenadded = whenadded; + } + + public String getModifier() + { + return modifier; + } + + public void setModifier(String modifier) + { + this.modifier = modifier; + } + + public Date getModifyDatetime() + { + return modifyDatetime; + } + + public void setModifyDatetime(Date modifyDatetime) + { + this.modifyDatetime = modifyDatetime; + } + + public String getResponsiblePerson() + { + return responsiblePerson; + } + + public void setResponsiblePerson(String responsiblePerson) + { + this.responsiblePerson = responsiblePerson; + } + + public String getContactCode() + { + return contactCode; + } + + public void setContactCode(String contactCode) + { + this.contactCode = contactCode; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/ContactDepartmentPl.java b/crm/src/main/java/com/rexen/crm/beans/ContactDepartmentPl.java new file mode 100644 index 0000000..80478fc --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/ContactDepartmentPl.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "contact_department_pl") +@NamedQueries( + { + @NamedQuery(name = "ContactDepartmentPl.findAll", query = "SELECT c FROM ContactDepartmentPl c") + }) +public class ContactDepartmentPl implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public ContactDepartmentPl() + { + } + + public ContactDepartmentPl(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/ContactDutyPl.java b/crm/src/main/java/com/rexen/crm/beans/ContactDutyPl.java new file mode 100644 index 0000000..82a6c2f --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/ContactDutyPl.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "contact_duty_pl") +@NamedQueries( + { + @NamedQuery(name = "ContactDutyPl.findAll", query = "SELECT c FROM ContactDutyPl c") + }) +public class ContactDutyPl implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public ContactDutyPl() + { + } + + public ContactDutyPl(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/ContactGeneralizationTargetPl.java b/crm/src/main/java/com/rexen/crm/beans/ContactGeneralizationTargetPl.java new file mode 100644 index 0000000..8df737e --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/ContactGeneralizationTargetPl.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "contact_generalization_target_pl") +@NamedQueries( + { + @NamedQuery(name = "ContactGeneralizationTargetPl.findAll", query = "SELECT c FROM ContactGeneralizationTargetPl c") + }) +public class ContactGeneralizationTargetPl implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public ContactGeneralizationTargetPl() + { + } + + public ContactGeneralizationTargetPl(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/ContactGradePl.java b/crm/src/main/java/com/rexen/crm/beans/ContactGradePl.java new file mode 100644 index 0000000..95967f6 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/ContactGradePl.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "contact_grade_pl") +@NamedQueries( + { + @NamedQuery(name = "ContactGradePl.findAll", query = "SELECT c FROM ContactGradePl c") + }) +public class ContactGradePl implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public ContactGradePl() + { + } + + public ContactGradePl(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/ContactJobTitlePl.java b/crm/src/main/java/com/rexen/crm/beans/ContactJobTitlePl.java new file mode 100644 index 0000000..42e9712 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/ContactJobTitlePl.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "contact_job_title_pl") +@NamedQueries( + { + @NamedQuery(name = "ContactJobTitlePl.findAll", query = "SELECT c FROM ContactJobTitlePl c") + }) +public class ContactJobTitlePl implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public ContactJobTitlePl() + { + } + + public ContactJobTitlePl(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/ContactMarketClassificationPl.java b/crm/src/main/java/com/rexen/crm/beans/ContactMarketClassificationPl.java new file mode 100644 index 0000000..c359de9 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/ContactMarketClassificationPl.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "contact_market_classification_pl") +@NamedQueries( + { + @NamedQuery(name = "ContactMarketClassificationPl.findAll", query = "SELECT c FROM ContactMarketClassificationPl c") + }) +public class ContactMarketClassificationPl implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public ContactMarketClassificationPl() + { + } + + public ContactMarketClassificationPl(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/ContactPl1.java b/crm/src/main/java/com/rexen/crm/beans/ContactPl1.java new file mode 100644 index 0000000..809d98d --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/ContactPl1.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "contact_pl1") +@NamedQueries( + { + @NamedQuery(name = "ContactPl1.findAll", query = "SELECT c FROM ContactPl1 c") + }) +public class ContactPl1 implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public ContactPl1() + { + } + + public ContactPl1(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/ContactPl2.java b/crm/src/main/java/com/rexen/crm/beans/ContactPl2.java new file mode 100644 index 0000000..20801be --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/ContactPl2.java @@ -0,0 +1,67 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "contact_pl2") +@NamedQueries( + { + @NamedQuery(name = "ContactPl2.findAll", query = "SELECT c FROM ContactPl2 c") + }) +public class ContactPl2 implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public ContactPl2() + { + } + + public ContactPl2(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } + +} diff --git a/crm/src/main/java/com/rexen/crm/beans/ContactPl3.java b/crm/src/main/java/com/rexen/crm/beans/ContactPl3.java new file mode 100644 index 0000000..d807b09 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/ContactPl3.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "contact_pl3") +@NamedQueries( + { + @NamedQuery(name = "ContactPl3.findAll", query = "SELECT c FROM ContactPl3 c") + }) +public class ContactPl3 implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public ContactPl3() + { + } + + public ContactPl3(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/ContactPl4.java b/crm/src/main/java/com/rexen/crm/beans/ContactPl4.java new file mode 100644 index 0000000..3805848 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/ContactPl4.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "contact_pl4") +@NamedQueries( + { + @NamedQuery(name = "ContactPl4.findAll", query = "SELECT c FROM ContactPl4 c") + }) +public class ContactPl4 implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public ContactPl4() + { + } + + public ContactPl4(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/ContactPl5.java b/crm/src/main/java/com/rexen/crm/beans/ContactPl5.java new file mode 100644 index 0000000..4db6bdb --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/ContactPl5.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "contact_pl5") +@NamedQueries( + { + @NamedQuery(name = "ContactPl5.findAll", query = "SELECT c FROM ContactPl5 c") + }) +public class ContactPl5 implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public ContactPl5() + { + } + + public ContactPl5(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/ContactPl6.java b/crm/src/main/java/com/rexen/crm/beans/ContactPl6.java new file mode 100644 index 0000000..e8a9bb1 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/ContactPl6.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "contact_pl6") +@NamedQueries( + { + @NamedQuery(name = "ContactPl6.findAll", query = "SELECT c FROM ContactPl6 c") + }) +public class ContactPl6 implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public ContactPl6() + { + } + + public ContactPl6(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/ContactStatusPl.java b/crm/src/main/java/com/rexen/crm/beans/ContactStatusPl.java new file mode 100644 index 0000000..3d5735d --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/ContactStatusPl.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "contact_status_pl") +@NamedQueries( + { + @NamedQuery(name = "ContactStatusPl.findAll", query = "SELECT c FROM ContactStatusPl c") + }) +public class ContactStatusPl implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public ContactStatusPl() + { + } + + public ContactStatusPl(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/Contactcrmuser.java b/crm/src/main/java/com/rexen/crm/beans/Contactcrmuser.java new file mode 100644 index 0000000..7a0a716 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/Contactcrmuser.java @@ -0,0 +1,81 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "contactcrmuser") +@NamedQueries( + { + @NamedQuery(name = "Contactcrmuser.findAll", query = "SELECT c FROM Contactcrmuser c") + }) +public class Contactcrmuser implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + + @Column(name = "contactId") + private int contactId; + @Column(name = "crmuserId") + private int crmuserId; + + public int getContactId() + { + return contactId; + } + + public void setContactId(int contactId) + { + this.contactId = contactId; + } + + public int getCrmuserId() + { + return crmuserId; + } + + public void setCrmuserId(int crmuserId) + { + this.crmuserId = crmuserId; + } + + public Contactcrmuser() + { + } + + public Contactcrmuser(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/Crmuser.java b/crm/src/main/java/com/rexen/crm/beans/Crmuser.java new file mode 100644 index 0000000..3224a47 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/Crmuser.java @@ -0,0 +1,249 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import com.rexen.crm.integration.DataObject; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * @author Ralf + */ + +@Entity +@Table(name = "crmuser") +@NamedQueries( + { + @NamedQuery(name = "Crmuser.findAll", query = "SELECT c FROM Crmuser c") + }) +public class Crmuser extends DataObject implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Basic(optional = false) + @Column(name = "name") + private String name; + @Column(name = "code") + private String code; + @Column(name = "reportto") + private int reportto; + @Column(name = "role") + private int role; + @Column(name = "pl1") + private int pl1; + @Column(name = "pl2") + private int pl2; + @Column(name = "pl4") + private int pl4; + @Column(name = "pl5") + private int pl5; + @Column(name = "city") + private int city; + @Column(name = "department") + private String department; + @Column(name = "whenadded") + @Temporal(TemporalType.TIMESTAMP) + private Date whenadded; + @Column(name = "modifier") + private String modifier; + @Column(name = "modify_datetime") + @Temporal(TemporalType.DATE) + private Date modifyDatetime; + @Column(name = "owner") + private String owner; + @Column(name = "level") + private int level; + + public Crmuser() + { + } + + public Crmuser(int id) + { + this.id = id; + } + + public Crmuser(int id, String name) + { + this.id = id; + this.name = name; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public String getCode() + { + return code; + } + + public void setCode(String code) + { + this.code = code; + } + + public int getReportto() + { + return reportto; + } + + public void setReportto(int reportto) + { + this.reportto = reportto; + } + + public int getRole() + { + return role; + } + + public void setRole(int role) + { + this.role = role; + } + + public int getPl1() + { + return pl1; + } + + public void setPl1(int pl1) + { + this.pl1 = pl1; + } + + public int getPl2() + { + return pl2; + } + + public void setPl2(int pl2) + { + this.pl2 = pl2; + } + + public int getPl4() + { + return pl4; + } + + public void setPl4(int pl4) + { + this.pl4 = pl4; + } + + public int getPl5() + { + return pl5; + } + + public void setPl5(int pl5) + { + this.pl5 = pl5; + } + + public int getCity() + { + return city; + } + + public void setCity(int city) + { + this.city = city; + } + + public String getDepartment() + { + return department; + } + + public void setDepartment(String department) + { + this.department = department; + } + + public Date getWhenadded() + { + return whenadded; + } + + public void setWhenadded(Date whenadded) + { + this.whenadded = whenadded; + } + + public String getModifier() + { + return modifier; + } + + public void setModifier(String modifier) + { + this.modifier = modifier; + } + + public Date getModifyDatetime() + { + return modifyDatetime; + } + + public void setModifyDatetime(Date modifyDatetime) + { + this.modifyDatetime = modifyDatetime; + } + + public String getOwner() + { + return owner; + } + + public void setOwner(String owner) + { + this.owner = owner; + } + + public int getLevel() + { + return level; + } + + public void setLevel(int level) + { + this.level = level; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/CrmuserActivited.java b/crm/src/main/java/com/rexen/crm/beans/CrmuserActivited.java new file mode 100644 index 0000000..d64e4d1 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/CrmuserActivited.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "crmuser_activited") +@NamedQueries( + { + @NamedQuery(name = "CrmuserActivited.findAll", query = "SELECT c FROM CrmuserActivited c") + }) +public class CrmuserActivited implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public CrmuserActivited() + { + } + + public CrmuserActivited(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/CrmuserPl1.java b/crm/src/main/java/com/rexen/crm/beans/CrmuserPl1.java new file mode 100644 index 0000000..1256e13 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/CrmuserPl1.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "crmuser_pl1") +@NamedQueries( + { + @NamedQuery(name = "CrmuserPl1.findAll", query = "SELECT c FROM CrmuserPl1 c") + }) +public class CrmuserPl1 implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public CrmuserPl1() + { + } + + public CrmuserPl1(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/CrmuserPl2.java b/crm/src/main/java/com/rexen/crm/beans/CrmuserPl2.java new file mode 100644 index 0000000..1641d61 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/CrmuserPl2.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "crmuser_pl2") +@NamedQueries( + { + @NamedQuery(name = "CrmuserPl2.findAll", query = "SELECT c FROM CrmuserPl2 c") + }) +public class CrmuserPl2 implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public CrmuserPl2() + { + } + + public CrmuserPl2(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/DataExchangeOperation.java b/crm/src/main/java/com/rexen/crm/beans/DataExchangeOperation.java new file mode 100644 index 0000000..cdfa5ef --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/DataExchangeOperation.java @@ -0,0 +1,74 @@ +/* + * Copyright 2013 Ralf. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * @author Ralf + */ +@Entity +@Table(name = "data_exchange_operation") +@XmlRootElement +public class DataExchangeOperation implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Basic(optional = false) + @Column(name = "val") + private String val; + + public DataExchangeOperation() + { + } + + public DataExchangeOperation(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/DataExchangeStatus.java b/crm/src/main/java/com/rexen/crm/beans/DataExchangeStatus.java new file mode 100644 index 0000000..f3f99ec --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/DataExchangeStatus.java @@ -0,0 +1,74 @@ +/* + * Copyright 2013 Ralf. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * @author Ralf + */ +@Entity +@Table(name = "data_exchange_status") +@XmlRootElement +public class DataExchangeStatus implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Basic(optional = false) + @Column(name = "val") + private String val; + + public DataExchangeStatus() + { + } + + public DataExchangeStatus(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/DataExchangeTeample.java b/crm/src/main/java/com/rexen/crm/beans/DataExchangeTeample.java new file mode 100644 index 0000000..e1a338f --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/DataExchangeTeample.java @@ -0,0 +1,90 @@ +/* + * Copyright 2013 Ralf. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Lob; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * @author Ralf + */ +@Entity +@Table(name = "data_exchange_teample") +@XmlRootElement + +public class DataExchangeTeample implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Basic(optional = false) + @Column(name = "name") + private String name; + @Basic(optional = false) + @Lob + @Column(name = "template") + private String template; + + public DataExchangeTeample() + { + } + + public DataExchangeTeample(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public String getTemplate() + { + return template; + } + + public void setTemplate(String template) + { + this.template = template; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/Province.java b/crm/src/main/java/com/rexen/crm/beans/Province.java new file mode 100644 index 0000000..778c022 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/Province.java @@ -0,0 +1,92 @@ +/* + * Copyright 2013 Ralf. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "province") +@NamedQueries( + { + @NamedQuery(name = "Province.findAll", query = "SELECT p FROM Province p") + }) +public class Province implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + @Column(name = "externalId") + private String externalId; + + public Province() + { + } + + public Province(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } + + public String getExternalId() + { + return externalId; + } + + public void setExternalId(String externalId) + { + this.externalId = externalId; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/RecordType.java b/crm/src/main/java/com/rexen/crm/beans/RecordType.java new file mode 100644 index 0000000..db98efa --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/RecordType.java @@ -0,0 +1,74 @@ +/* + * Copyright 2013 Ralf. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * @author Ralf + */ +@Entity +@Table(name = "record_type") +@XmlRootElement +public class RecordType implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Basic(optional = false) + @Column(name = "name") + private String name; + + public RecordType() + { + } + + public RecordType(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/RegionLevel1Pl.java b/crm/src/main/java/com/rexen/crm/beans/RegionLevel1Pl.java new file mode 100644 index 0000000..8c6490d --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/RegionLevel1Pl.java @@ -0,0 +1,78 @@ +/* + * Copyright 2013 Ralf. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "region_level1_pl") +@NamedQueries( + { + @NamedQuery(name = "RegionLevel1Pl.findAll", query = "SELECT r FROM RegionLevel1Pl r") + }) +public class RegionLevel1Pl implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public RegionLevel1Pl() + { + } + + public RegionLevel1Pl(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } + +} diff --git a/crm/src/main/java/com/rexen/crm/beans/RegionLevel2Pl.java b/crm/src/main/java/com/rexen/crm/beans/RegionLevel2Pl.java new file mode 100644 index 0000000..3bdf8fa --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/RegionLevel2Pl.java @@ -0,0 +1,77 @@ +/* + * Copyright 2013 Ralf. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "region_level2_pl") +@NamedQueries( + { + @NamedQuery(name = "RegionLevel2Pl.findAll", query = "SELECT r FROM RegionLevel2Pl r") + }) +public class RegionLevel2Pl implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public RegionLevel2Pl() + { + } + + public RegionLevel2Pl(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/Role.java b/crm/src/main/java/com/rexen/crm/beans/Role.java new file mode 100644 index 0000000..203e133 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/Role.java @@ -0,0 +1,78 @@ +/* + * Copyright 2013 Ralf. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "role") +@NamedQueries( + { + @NamedQuery(name = "Role.findAll", query = "SELECT r FROM Role r") + }) +public class Role implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public Role() + { + } + + public Role(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } + +} diff --git a/crm/src/main/java/com/rexen/crm/beans/Score1Pl.java b/crm/src/main/java/com/rexen/crm/beans/Score1Pl.java new file mode 100644 index 0000000..44c35d9 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/Score1Pl.java @@ -0,0 +1,75 @@ +/* + * Copyright 2013 Ralf. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "score1_pl") +@NamedQueries( + { + @NamedQuery(name = "Score1Pl.findAll", query = "SELECT s FROM Score1Pl s") + }) +public class Score1Pl implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public Score1Pl() + { + } + + public Score1Pl(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } + +} diff --git a/crm/src/main/java/com/rexen/crm/beans/Score2Pl.java b/crm/src/main/java/com/rexen/crm/beans/Score2Pl.java new file mode 100644 index 0000000..6d272af --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/Score2Pl.java @@ -0,0 +1,75 @@ +/* + * Copyright 2013 Ralf. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "score2_pl") +@NamedQueries( + { + @NamedQuery(name = "Score2Pl.findAll", query = "SELECT s FROM Score2Pl s") + }) +public class Score2Pl implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public Score2Pl() + { + } + + public Score2Pl(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } + +} diff --git a/crm/src/main/java/com/rexen/crm/beans/SexPl.java b/crm/src/main/java/com/rexen/crm/beans/SexPl.java new file mode 100644 index 0000000..2c06355 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/SexPl.java @@ -0,0 +1,78 @@ +/* + * Copyright 2013 Ralf. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * @author Ralf + */ +@Entity +@Table(name = "sex_pl") +@NamedQueries( + { + @NamedQuery(name = "SexPl.findAll", query = "SELECT s FROM SexPl s") + }) +public class SexPl implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "val") + private String val; + + public SexPl() + { + } + + public SexPl(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getVal() + { + return val; + } + + public void setVal(String val) + { + this.val = val; + } + +} diff --git a/crm/src/main/java/com/rexen/crm/beans/UserPosition.java b/crm/src/main/java/com/rexen/crm/beans/UserPosition.java new file mode 100644 index 0000000..a5fb5af --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/UserPosition.java @@ -0,0 +1,116 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import com.rexen.crm.integration.DataObject; +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; + +/** + * + * @author Ralf + */ +@Entity +@Table(name = "user_position") +@NamedQueries( +{ + @NamedQuery(name = "UserPosition.findAll", query = "SELECT u FROM UserPosition u") +}) +public class UserPosition extends DataObject implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Column(name = "userId") + private int userId; + @Column(name = "positionId") + private int positionId; + @Column(name = "status") + private int status; + @Column(name = "isPrimary") + private int isPrimary; + @Column(name = "externalid") + private String externalId; + + public UserPosition() + { + } + + public UserPosition(int id) + { + this.id = id; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public int getUserId() + { + return userId; + } + + public void setUserId(int userId) + { + this.userId = userId; + } + + public int getPositionId() + { + return positionId; + } + + public void setPositionId(int positionId) + { + this.positionId = positionId; + } + + public int getStatus() + { + return status; + } + + public void setStatus(int status) + { + this.status = status; + } + + public int getIsPrimary() + { + return isPrimary; + } + + public void setIsPrimary(int isPrimary) + { + this.isPrimary = isPrimary; + } + + public String getExternalId() + { + return externalId; + } + + public void setExternalId(String externalId) + { + this.externalId = externalId; + } +} diff --git a/crm/src/main/java/com/rexen/crm/beans/UserRole.java b/crm/src/main/java/com/rexen/crm/beans/UserRole.java new file mode 100644 index 0000000..0101a0e --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/UserRole.java @@ -0,0 +1,8 @@ +package com.rexen.crm.beans; + +public interface UserRole +{ + public int USER_ROLE_ADMINISTRATOR = 1; + public int USER_ROLE_MANAGER = 2; + public int USER_ROLE_SALES = 3; +} diff --git a/crm/src/main/java/com/rexen/crm/beans/Userinfo.java b/crm/src/main/java/com/rexen/crm/beans/Userinfo.java new file mode 100644 index 0000000..509566c --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/beans/Userinfo.java @@ -0,0 +1,391 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.beans; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author Ralf + */ +@Entity +@Table(name = "userinfo") +@NamedQueries( +{ + @NamedQuery(name = "Userinfo.findAll", query = "SELECT u FROM Userinfo u") +}) +public class Userinfo implements Serializable +{ + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Basic(optional = false) + @Column(name = "id") + private int id; + @Basic(optional = false) + @Column(name = "name") + private String name; + @Column(name = "department") + private String department; + @Column(name = "division") + private String division; + @Column(name = "cellPhone") + private String cellPhone; + @Column(name = "email") + private String email; + @Column(name = "employeeNumber") + private String employeeNumber; + @Column(name = "photo") + private String photo; + @Column(name = "jobTitle") + private String jobTitle; + @Column(name = "pl1") + private int pl1; + @Column(name = "pl2") + private int pl2; + @Column(name = "role") + private int role; + @Column(name = "pl4") + private int pl4; + @Column(name = "pl5") + private int pl5; + @Column(name = "sex") + private int sex; + @Column(name = "loginName") + private String loginName; + @Column(name = "password") + private String password; + @Column(name = "sessionKey") + private String sessionKey; + @Column(name = "lastLoginTime") + private long lastLoginTime; + @Column(name = "whenadded") + @Temporal(TemporalType.TIMESTAMP) + private Date whenadded; + @Column(name = "parcel") + private String parcel; + @Column(name = "modifier") + private String modifier; + @Column(name = "modify_datetime") + @Temporal(TemporalType.TIMESTAMP) + private Date modifyDatetime; + @Column(name = "owner") + private String owner; + @Column(name = "province") + private int province; + @Column(name = "city") + private int city; + @Column(name = "office_tel") + private String officeTel; + @Column(name = "num_of_signIn") + private int numofsignIn; + + public Userinfo() + { + } + + public Userinfo(int id) + { + this.id = id; + } + + public Userinfo(int id, String name) + { + this.id = id; + this.name = name; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public String getDepartment() + { + return department; + } + + public void setDepartment(String department) + { + this.department = department; + } + + public String getDivision() + { + return division; + } + + public void setDivision(String division) + { + this.division = division; + } + + public String getCellPhone() + { + return cellPhone; + } + + public void setCellPhone(String cellPhone) + { + this.cellPhone = cellPhone; + } + + public String getEmail() + { + return email; + } + + public void setEmail(String email) + { + this.email = email; + } + + public String getEmployeeNumber() + { + return employeeNumber; + } + + public void setEmployeeNumber(String employeeNumber) + { + this.employeeNumber = employeeNumber; + } + + public String getPhoto() + { + return photo; + } + + public void setPhoto(String photo) + { + this.photo = photo; + } + + public String getJobTitle() + { + return jobTitle; + } + + public void setJobTitle(String jobTitle) + { + this.jobTitle = jobTitle; + } + + public int getPl1() + { + return pl1; + } + + public void setPl1(int pl1) + { + this.pl1 = pl1; + } + + public int getPl2() + { + return pl2; + } + + public void setPl2(int pl2) + { + this.pl2 = pl2; + } + + public int getRole() + { + return role; + } + + public void setRole(int role) + { + this.role = role; + } + + public int getPl4() + { + return pl4; + } + + public void setPl4(int pl4) + { + this.pl4 = pl4; + } + + public int getPl5() + { + return pl5; + } + + public void setPl5(int pl5) + { + this.pl5 = pl5; + } + + public int getSex() + { + return sex; + } + + public void setSex(int sex) + { + this.sex = sex; + } + + public String getLoginName() + { + return loginName; + } + + public void setLoginName(String loginName) + { + this.loginName = loginName; + } + + public String getPassword() + { + return password; + } + + public void setPassword(String password) + { + this.password = password; + } + + public String getSessionKey() + { + return sessionKey; + } + + public void setSessionKey(String sessionKey) + { + this.sessionKey = sessionKey; + } + + public long getLastLoginTime() + { + return lastLoginTime; + } + + public void setLastLoginTime(long lastLoginTime) + { + this.lastLoginTime = lastLoginTime; + } + + public Date getWhenadded() + { + return whenadded; + } + + public void setWhenadded(Date whenadded) + { + this.whenadded = whenadded; + } + + public String getParcel() + { + return parcel; + } + + public void setParcel(String parcel) + { + this.parcel = parcel; + } + + public String getModifier() + { + return modifier; + } + + public void setModifier(String modifier) + { + this.modifier = modifier; + } + + public Date getModifyDatetime() + { + return modifyDatetime; + } + + public void setModifyDatetime(Date modifyDatetime) + { + this.modifyDatetime = modifyDatetime; + } + + public String getOwner() + { + return owner; + } + + public void setOwner(String owner) + { + this.owner = owner; + } + + public int getProvince() + { + return province; + } + + public void setProvince(int province) + { + this.province = province; + } + + public int getCity() + { + return city; + } + + public void setCity(int city) + { + this.city = city; + } + + public String getOfficeTel() + { + return officeTel; + } + + public void setOfficeTel(String officeTel) + { + this.officeTel = officeTel; + } + + public int getNumofsignIn() + { + return numofsignIn; + } + + public void setNumofsignIn(int numofsignIn) + { + this.numofsignIn = numofsignIn; + } +} diff --git a/crm/src/main/java/com/rexen/crm/integration/Configuration.java b/crm/src/main/java/com/rexen/crm/integration/Configuration.java new file mode 100644 index 0000000..6f0602a --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/integration/Configuration.java @@ -0,0 +1,130 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.integration; + +import java.util.ArrayList; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + *

+ * @author Kamala + */ +@XmlRootElement(name = "Configuration") +public class Configuration +{ + @XmlElement(name = "FileName") + public String getFileName() + { + return fileName; + } + + public void setFileName(String fileName) + { + this.fileName = fileName; + } + + @XmlElement(name = "EntityName") + public String getEntityName() + { + return entityName; + } + + public void setEntityName(String entityName) + { + this.entityName = entityName; + } + private ArrayList fields; + + @XmlElement(name = "Fields") + public ArrayList getFields() + { + return fields; + } + + public void setFields(ArrayList fields) + { + this.fields = fields; + } + private String fileName; + private String entityName; + private String externalId; + + @XmlElement(name = "ExternalId") + public String getExternalId() + { + return externalId; + } + + public void setExternalId(String externalIdName) + { + this.externalId = externalIdName; + } + + private int batchSize; + + @XmlElement(name = "BatchSize") + public int getBatchSize() + { + return batchSize; + } + + public void setBatchSize(int batchSize) + { + this.batchSize = batchSize; + } + + private String database; + + @XmlElement(name = "Database") + public String getDatabase() + { + return database; + } + + public void setDatabase(String database) + { + this.database = database; + } + + private int max = 1000000; + + @XmlElement(name = "Max") + public int getMax() + { + return max; + } + + public void setMax(int max) + { + this.max = max; + } + + private String encoded; + + @XmlElement(name = "Encoded") + public String getEncoded() + { + return encoded; + } + + public void setEncoded(String encoded) + { + this.encoded = encoded; + } + + private String operation; + + @XmlElement(name = "Operation") + public String getOperation() + { + return operation; + } + + public void setOperation(String operation) + { + this.operation = operation; + } +} diff --git a/crm/src/main/java/com/rexen/crm/integration/CreateConfiguration.java b/crm/src/main/java/com/rexen/crm/integration/CreateConfiguration.java new file mode 100644 index 0000000..9bb7927 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/integration/CreateConfiguration.java @@ -0,0 +1,94 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.integration; + +import java.io.File; +import java.io.FileNotFoundException; +import java.util.ArrayList; +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Marshaller; +import javax.xml.bind.Unmarshaller; + +/** +

+ @author Kamala + */ +public class CreateConfiguration +{ + + public static void main(String args[]) throws JAXBException, FileNotFoundException + { + + Configuration configuration = new Configuration(); + configuration.setEntityName("Account"); + configuration.setFileName("account.csv"); + configuration.setFields(new ArrayList()); + configuration.setExternalId("ExternalId"); + configuration.setBatchSize(1000); + configuration.setDatabase("crm_mysql"); + + FieldConfiguration fc = new FieldConfiguration(); + fc.setColumnName("Id"); + fc.setDataType("Integer"); + fc.setFieldName("Id"); + + configuration.getFields().add(fc); + + FieldConfiguration fc2 = new FieldConfiguration(); + fc2.setColumnName("ExternalId"); + fc2.setDataType("Integer"); + fc2.setFieldName("ExternalId"); + + configuration.getFields().add(fc2); + + FieldConfiguration fc3 = new FieldConfiguration(); + fc3.setColumnName("StartTime"); + fc3.setDataType("Date"); + fc3.setFieldName("StartTime"); + fc3.setFormat("YYYY-MM-DD"); + + configuration.getFields().add(fc3); + + + FieldConfiguration fc4 = new FieldConfiguration(); + fc4.setColumnName("Department"); + fc4.setDataType("Lookup"); + fc4.setFieldName("DepartmentId"); + fc4.setLookupEntityName("Department"); + fc4.setLookupFieldName("Name"); + fc4.setTargetFieldName("Id"); + fc4.setAutoReference(true); + + configuration.getFields().add(fc4); + configuration.setDatabase("crm_mysql"); + configuration.setMax(1000000); + configuration.setBatchSize(1000); + + + + File file = new File("configuration.xml"); + JAXBContext context = JAXBContext.newInstance(Configuration.class); + Marshaller mrshaller = context.createMarshaller(); + + mrshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); + mrshaller.marshal(configuration, file); + mrshaller.marshal(configuration, System.out); + + + Unmarshaller unmarshaller = context.createUnmarshaller(); + configuration = (Configuration) unmarshaller.unmarshal(file); + + System.out.println(configuration.getFileName()); + System.out.println(configuration.getEntityName()); + + for (FieldConfiguration f : configuration.getFields()) + { + System.out.println(f.getColumnName()); + System.out.println(f.getFieldName()); + System.out.println(f.getDataType()); + } + } +} diff --git a/crm/src/main/java/com/rexen/crm/integration/DataAccessObject.java b/crm/src/main/java/com/rexen/crm/integration/DataAccessObject.java new file mode 100644 index 0000000..e084f80 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/integration/DataAccessObject.java @@ -0,0 +1,324 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.integration; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import javax.persistence.FlushModeType; +import javax.persistence.Persistence; +import javax.persistence.Query; +import org.apache.log4j.Logger; +import org.apache.log4j.Priority; +import org.eclipse.persistence.jpa.JpaEntityManager; +import org.eclipse.persistence.jpa.JpaHelper; + +/** + * + * @author Kamala + */ +public class DataAccessObject +{ + + private JpaEntityManager jpa; + private boolean transaction = true; + static Logger logger = Logger.getLogger("dataloader"); + + public DataAccessObject(String unitName) + { + try + { + jpa = JpaHelper.getEntityManager(Persistence.createEntityManagerFactory(unitName).createEntityManager()); + jpa.setFlushMode(FlushModeType.COMMIT); + } + catch (Exception e) + { + logger.log(Priority.ERROR, "DataAccessObject(String unitName:" + unitName + ")", e); + throw e; + } + } + + public void update(Object[] data, String[] keys) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException + { + if (data != null && data.length > 0) + { + try + { + start(); + + for (Object o : data) + { + Object example = o.getClass().newInstance(); + + this.copy(o, example, keys); + + DataObject entity = (DataObject) find(example); + + if (entity != null) + { + entity.assign(o); + + jpa.merge(entity); + + data = null; + } + } + + commit(); + } + catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException e) + { + rollback(); + logger.log(Priority.ERROR, "DataObjectAccess.update(Object o, String[] keys)", e); + throw e; + } + } + } + + private void delete(Object[] data) throws Exception + { + if (data != null && data.length > 0) + { + try + { + start(); + + for (Object o : data) + { + jpa.remove(o); + } + + commit(); + } + catch (Exception e) + { + rollback(); + + throw e; + } + } + } + + public void delete(Object[] data, String[] keys) throws Exception + { + ArrayList buffer = new ArrayList<>(); + + for(Object o : data) + { + Object sample = o.getClass().newInstance(); + copy(o, sample, keys); + + sample = find(sample); + if(sample != null) + { + buffer.add(sample); + } + } + + delete(buffer.toArray()); + } + + public void append(Object[] data) + { + if (data != null && data.length > 0) + { + try + { + start(); + + for (Object o : data) + { + jpa.persist(o); + } + + commit(); + } + catch (Exception e) + { + rollback(); + logger.log(Priority.ERROR, "DataObjectAccess.append(Object[] data)", e); + throw e; + } + } + } + + public Object[] find(Object example, int count) + { + Query q = jpa.createQueryByExample(example); + + q.setMaxResults(count); + + List l = q.getResultList(); + + if (l != null && l.size() > 0) + { + return l.toArray(); + } + else + { + return null; + } + } + + public Object find(Object example) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException + { + Object[] data = find(example, 1); + + if (data != null && data.length > 0) + { + return data[0]; + } + else + { + return null; + } + } + + public void merge(Object[] objects, String[] keys) throws Exception + { + if (objects != null && objects.length > 0) + { + + ArrayList buffer1 = new ArrayList<>(); + ArrayList buffer2 = new ArrayList<>(); + + for (Object o : objects) + { + Object example = o.getClass().newInstance(); + + copy(o, example, keys); + + if (find(example) != null) + { + buffer2.add(o); + } + else + { + buffer1.add(o); + } + } + + if (buffer1.size() > 0) + { + try + { + append(buffer1.toArray()); + } + catch (Exception e) + { + logger.log(Priority.ERROR, "DataObjectAccess.merge(Object[] objects, String[] keys)", e); + throw e; + } + } + + if (buffer2.size() > 0) + { + try + { + update(buffer2.toArray(), keys); + } + catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException e) + { + logger.log(Priority.ERROR, "DataObjectAccess.merge(Object[] objects, String[] keys)", e); + throw e; + } + } + } + } + + public void start() + { + if (!jpa.getTransaction().isActive()) + { + jpa.getTransaction().begin(); + } + } + + public void commit() + { + if (jpa.getTransaction().isActive()) + { + jpa.getTransaction().commit(); + } + } + + public void rollback() + { + if (jpa.getTransaction().isActive()) + { + jpa.getTransaction().rollback(); + } + } + + public void execute(String sql) throws Exception + { + start(); + try + { + Query q = jpa.createNativeQuery(sql); + + q.executeUpdate(); + commit(); + } + catch (Exception e) + { + rollback(); + + logger.log(Priority.ERROR, "DataObjectAccess.execute(String sql)", e); + + throw e; + } + } + + public void transaction(boolean auto) + { + this.transaction = auto; + } + + private void copy(Object o1, Object o2, String[] properties) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException + { + HashMap o1m = new HashMap<>(); + + for (Method m : o1.getClass().getMethods()) + { + o1m.put(m.getName(), m); + } + + HashMap o2m = new HashMap<>(); + + for (Method m : o2.getClass().getMethods()) + { + o2m.put(m.getName(), m); + } + + for (String property : properties) + { + String getterName = "get" + property; + String setterName = "set" + property; + + try + { + Method getter = o1m.get(getterName); + Object value = getter.invoke(o1, new Object[] + { + }); + + Method setter = o2m.get(setterName); + setter.invoke(o2, new Object[] + { + value + }); + } + catch (Exception e) + { + System.out.println("getter name: " + getterName); + System.out.println("setter name: " + setterName); + e.printStackTrace(); + } + } + } +} diff --git a/crm/src/main/java/com/rexen/crm/integration/DataExport.java b/crm/src/main/java/com/rexen/crm/integration/DataExport.java new file mode 100644 index 0000000..ad28388 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/integration/DataExport.java @@ -0,0 +1,321 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.integration; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.nio.charset.Charset; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; + +import org.jumpmind.symmetric.csv.CsvWriter; + +/** + * @author Ralf + */ +public class DataExport +{ + + private DataAccessObject dao; + private Configuration config = null; + + public DataExport(String configuration) throws JAXBException + { + File file = new File(configuration); + JAXBContext context = JAXBContext.newInstance(Configuration.class); +// + Unmarshaller unmarshaller = context.createUnmarshaller(); +// + config = (Configuration) unmarshaller.unmarshal(file); + + dao = new DataAccessObject(config.getDatabase()); + } + + public DataExport(Configuration config, DataAccessObject dao) throws JAXBException + { + this.config = config; + + this.dao = dao; + } + + public byte[] export() throws IOException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, ClassNotFoundException, InstantiationException + { + Object example = null; + + String class_name = "com.rexen.crm.beans." + config.getEntityName(); + Class c = Class.forName(class_name); + example = c.newInstance(); + + Object[] data = dao.find(example, config.getMax()); + + System.out.println("record count " + data.length); + + if (data != null && data.length > 0) + { + ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + + CsvWriter writer = null; + + String encoded = config.getEncoded(); + + if (encoded != null && encoded.length() > 0) + { + try + { + writer = new CsvWriter(buffer, ',', Charset.forName(encoded)); + } + catch (Exception e) + { + //e.printStackTrace(); + writer = new CsvWriter(buffer, ',', Charset.forName("UTF-8")); + } + } + else + { + writer = new CsvWriter(buffer, ',', Charset.forName("UTF-8")); + } + + ArrayList heads = new ArrayList<>(); + + for (FieldConfiguration field : config.getFields()) + { + heads.add(field.getColumnName()); + } + + writer.writeRecord(heads.toArray(new String[config.getFields().size()])); + + for (Object o : data) + { + writer.writeRecord(convert(o)); + } + + writer.flush(); + + ByteArrayOutputStream out = new ByteArrayOutputStream(); + //FileOutputStream out = new FileOutputStream(config.getEntityName() + ".zip"); + + try (ZipOutputStream zip_output_stream = new ZipOutputStream(out)) + { + zip_output_stream.setLevel(9); + ZipEntry zip_entry = new ZipEntry(config.getEntityName() + ".csv"); + + zip_output_stream.putNextEntry(zip_entry); + + zip_output_stream.write(buffer.toByteArray()); + + zip_output_stream.flush(); + } + + //out.flush(); + //out.close(); + + return out.toByteArray(); + } + + return null; + } + + private String[] convert(Object o) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException + { + ArrayList buffer = new ArrayList<>(); + + for (FieldConfiguration field : config.getFields()) + { + String method_name = "get" + field.getFieldName(); + + Method m = queryMethod(o.getClass(), method_name); + + Object value = m.invoke(o, new Object[] + { + }); + + if (value != null) + { + switch (field.getDataType()) + { + case "String": + { + buffer.add((String) value); + break; + } + + case "Integer": + { + switch (value.getClass().getName()) + { + case "java.lang.Integer": + { + Integer i = (Integer) value; + buffer.add(i.toString()); + break; + } + case "java.lang.String": + { + buffer.add((String) value); + } + } + break; + } + + case "Date": + { + switch (value.getClass().getName()) + { + case "java.lang.Integer": + { + try + { + Integer i = (Integer) value; + Date d = new Date(); + d.setTime(i); + + DateFormat format = new SimpleDateFormat(field.getFormat()); + buffer.add(format.format(d)); + } + catch (Exception e) + { + buffer.add(""); + } + break; + } + case "java.util.Date": + { + try + { + Date d = (Date) value; + DateFormat format = new SimpleDateFormat(field.getFormat()); + buffer.add(format.format(d)); + } + catch (Exception e) + { + buffer.add(""); + } + break; + } + case "java.lang.String": + { + buffer.add((String) value); + } + } + break; + } + case "Lookup": + { + try + { + int id = ((Integer) value); + + //System.out.println(field.getTargetFieldName()) + + Class c = Class.forName("com.rexen.crm.beans." + field.getLookupEntityName()); + Object example = c.newInstance(); + + String setter_name = "set" + field.getTargetFieldName(); + Method setter = queryMethod(c, setter_name); + + setter.invoke(example, new Object[] + { + id + }); + + example = dao.find(example); + + if (example != null) + { + String getter_name = "get" + field.getLookupFieldName(); + + Method getter = queryMethod(c, getter_name); + + String lookup_value = (String) getter.invoke(example, new Object[] + { + }); + + if (lookup_value != null) + { + buffer.add(lookup_value); + } + else + { + buffer.add(""); + } + } + else + { + buffer.add(""); + } + + } + catch (Exception e) + { + System.out.println("error: " + field.getColumnName() + ", " + field.getTargetFieldName() + ", " + field.getLookupEntityName() + ", " + field.getLookupFieldName()); + e.printStackTrace(); + buffer.add(""); + } + } + } + } + else + { + buffer.add(""); + } + } + + return buffer.toArray(new String[buffer.size()]); + } + + public static void main(String args[]) throws JAXBException, IOException, Exception + { + DataExport exporter = new DataExport(args[0]); + exporter.export(); + } + + public Method queryMethod(Class c, String methodName) + { + + System.out.println("query method: " + c.getName() + "." + methodName); + HashMap methods = new HashMap<>(); + + for (Method m : c.getMethods()) + { + methods.put(m.getName().toLowerCase(), m); + } + + return methods.get(methodName.toLowerCase()); + } + + private void log(String objectName, String methodName, String stackTrace, String message) + { + LogMessage logMessage; + logMessage = new LogMessage(); + + logMessage.setObjectName(objectName); + logMessage.setMethodName(methodName); + logMessage.setStackTrace(stackTrace); + logMessage.setMessage(message); + logMessage.setCreated(new Date()); + + dao.append(new Object[]{logMessage}); + + System.out.println("raise error in " + objectName + "." + methodName +"."); + System.out.println("message is " + message); + if(stackTrace != null) + { + System.out.println("stack track is " + stackTrace); + } + } +} diff --git a/crm/src/main/java/com/rexen/crm/integration/DataExportDelegate.java b/crm/src/main/java/com/rexen/crm/integration/DataExportDelegate.java new file mode 100644 index 0000000..2afe8d1 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/integration/DataExportDelegate.java @@ -0,0 +1,99 @@ +/* + * Copyright 2013 Ralf. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rexen.crm.integration; + +import com.rexen.crm.beans.DataExchangeTeample; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.InvocationTargetException; + +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; + +/** + * + * @author Ralf + */ + +public class DataExportDelegate +{ + + private DataAccessObject dao; + + public DataExportDelegate() + { + dao = new DataAccessObject("crm_mysql"); + } + + public Configuration getConfiguration(String template) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException, JAXBException + { + Configuration config = null; + + DataExchangeTeample example = new DataExchangeTeample(); + example.setName(template); + + example = (DataExchangeTeample) dao.find(example); + + if (example != null) + { + try + { + StringReader buffer = new StringReader(example.getTemplate()); + + JAXBContext context = JAXBContext.newInstance(Configuration.class); + + Unmarshaller unmarshaller = context.createUnmarshaller(); + + config = (Configuration) unmarshaller.unmarshal(buffer); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + else + { + System.out.println("template not found!"); + } + + return config; + } + + public void export(String template, HttpServletResponse response) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException, JAXBException, IOException, IllegalArgumentException, ClassNotFoundException + { + Configuration config = getConfiguration(template); + + if (config != null) + { + DataExport exporter = new DataExport(config, dao); + + byte[] buffer = exporter.export(); + + response.setContentType("application/octet-stream"); + response.setHeader("Content-Disposition", "attachment;filename=" + config.getEntityName() + ".zip"); + ServletOutputStream out = response.getOutputStream(); + out.write(buffer); + + System.out.println("buffer size " + buffer.length); + out.flush(); + out.close(); + } + } +} diff --git a/crm/src/main/java/com/rexen/crm/integration/DataImport.java b/crm/src/main/java/com/rexen/crm/integration/DataImport.java new file mode 100644 index 0000000..8fcfd21 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/integration/DataImport.java @@ -0,0 +1,382 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.integration; + +import java.io.File; +import java.io.IOException; +import java.lang.reflect.Method; +import java.nio.charset.Charset; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; +import org.apache.commons.codec.digest.DigestUtils; +import org.jumpmind.symmetric.csv.CsvReader; + +/** + *

+ * + * @author Kamala + */ + +public class DataImport +{ + + private DataAccessObject dao; + private Configuration config = null; + + public DataImport(String configuration) throws JAXBException + { + File file = new File(configuration); + JAXBContext context = JAXBContext.newInstance(Configuration.class); + + Unmarshaller unmarshaller = context.createUnmarshaller(); + + config = (Configuration) unmarshaller.unmarshal(file); + + dao = new DataAccessObject(config.getDatabase()); + } + + public DataImport(Configuration config, DataAccessObject dao) throws JAXBException + { + this.config = config; + + this.dao = dao; + } + + public void load() throws IOException, Exception + { + try + { + CsvReader reader = new CsvReader(config.getFileName(), ',', Charset.forName("UTF-8")); + + reader.readHeaders(); + + ArrayList buffer = new ArrayList<>(); + + while (reader.readRecord()) + { + try + { + Object o = convert(reader); + buffer.add(o); + } + catch (Exception e) + { + e.printStackTrace(); + + log("DataImport", "load", e.getMessage(), config.getEntityName() + ": " + reader.getRawRecord()); + } + + if (buffer.size() > config.getBatchSize()) + { + commit(buffer.toArray(new Object[buffer.size()])); + System.out.println("commit " + buffer.size()); + + buffer.clear(); + } + } + + if (buffer.size() > 0) + { + commit(buffer.toArray(new Object[buffer.size()])); + + System.out.println("commit " + buffer.size()); + + buffer.clear(); + } + } + catch (Exception e) + { + e.printStackTrace(); + log("DataImport", "load", e.getMessage(), null); + } + } + + private void commit(Object[] data) throws Exception + { + String operation = config.getOperation(); + + if (operation == null || operation.length() <= 0) + { + operation = "Merge"; + } + + switch (operation) + { + case "Merge": + { + dao.merge(data, new String[] + { + config.getExternalId() + }); + + break; + } + case "Delete": + { + dao.delete(data, new String[] + { + config.getExternalId() + }); + + break; + } + } + } + + public Object convert(CsvReader reader) throws Exception + { + Object record = null; + + String class_name = "com.rexen.crm.beans." + config.getEntityName(); + Class c = Class.forName(class_name); + record = c.newInstance(); + + for (FieldConfiguration field : config.getFields()) + { + String s = reader.get(field.getColumnName()); + + if (s != null && s.length() > 0) + { + s = s.trim(); + } + + Method setter = queryMethod(c, "set" + field.getFieldName()); + + if (setter != null) + { + switch (field.getDataType()) + { + /** + * ***************************************************************************************************************************************************************************************************** + */ + case "String": + { + if (s != null && s.length() > 0) + { + setter.invoke(record, new Object[] + { + s + }); + } + break; + } + /** + * ***************************************************************************************************************************************************************************************************** + */ + case "Integer": + { + int i = 0; + + try + { + i = Integer.valueOf(s); + } + catch (Exception e) + { + i = 0; + } + setter.invoke(record, new Object[] + { + i + }); + break; + } + /** + * ***************************************************************************************************************************************************************************************************** + */ + case "Date": + { + Date date = null; + if (s != null && s.length() >= field.getFormat().length() - 2) + { + try + { + DateFormat format = new SimpleDateFormat(field.getFormat()); + date = format.parse(s); + setter.invoke(record, new Object[] + { + date + }); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + break; + } + /** + * ***************************************************************************************************************************************************************************************************** + */ + case "Lookup": + { + if (s != null && s.length() > 0) + { + try + { + Class lookup_entiry_class = Class.forName("com.rexen.crm.beans." + field.getLookupEntityName()); + Object example = lookup_entiry_class.newInstance(); + + String method_name = "set" + field.getLookupFieldName(); + + Method method = queryMethod(lookup_entiry_class, method_name); + + method.invoke(example, new Object[] + { + s + }); + + Object result = dao.find(example); + + if (result != null) + { + Method getter = queryMethod(lookup_entiry_class, "get" + field.getTargetFieldName()); + + int lookup_value = (Integer) getter.invoke(result, new Object[] + { + }); + + setter.invoke(record, new Object[] + { + lookup_value + }); + } + else + { + if (field.isAutoReference()) + { + try + { + Object lookup_object = lookup_entiry_class.newInstance(); + + Method lookup_setter = queryMethod(c, "set" + field.getLookupFieldName()); + lookup_setter.invoke(lookup_object, new Object[] + { + s + }); + + dao.append(new Object[] + { + lookup_object + }); + + lookup_object = dao.find(lookup_object); + + Method getter = queryMethod(c, "get" + field.getTargetFieldName()); + int lookup_value = (Integer) getter.invoke(lookup_object, new Object[] + { + }); + + setter.invoke(record, new Object[] + { + lookup_value + }); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + } + } + catch (Exception e) + { + e.printStackTrace(); + } + } + break; + } + case "Password": + { + if (s != null && s.length() > 0) + { + setter.invoke(record, new Object[] + { + DigestUtils.md5Hex(s) + }); + } + break; + } + case "AutoTimeMillis": + { + long i = System.currentTimeMillis(); + + setter.invoke(record, new Object[] + { + i + }); + break; + } + /** + * ***************************************************************************************************************************************************************************************************** + */ + } + } + } + + return record; + } + + public static void main(String args[]) throws JAXBException, IOException, + Exception + { + System.out.println("template: " + args[0]); + DataImport loader = new DataImport(args[0]); + loader.load(); + } + + public Method queryMethod(Class c, String methodName) throws Exception + { + Method method = null; + + HashMap methods = new HashMap<>(); + + for (Method m : c.getMethods()) + { + methods.put(m.getName().toLowerCase(), m); + } + + if (methods.keySet().contains(methodName.toLowerCase())) + { + method = methods.get(methodName.toLowerCase()); + } + else + { + throw new Exception("method not found: " + c.getName() + "." + methodName); + } + + return method; + } + + private void log(String objectName, String methodName, String stackTrace, String message) + { + LogMessage logMessage; + logMessage = new LogMessage(); + + logMessage.setObjectName(objectName); + logMessage.setMethodName(methodName); + logMessage.setStackTrace(stackTrace); + logMessage.setMessage(message); + logMessage.setCreated(new Date()); + + dao.append(new Object[] + { + logMessage + }); + + System.out.println("raise error in " + objectName + "." + methodName + "."); + System.out.println("message is " + message); + if (stackTrace != null) + { + System.out.println("stack track is " + stackTrace); + } + } +} diff --git a/crm/src/main/java/com/rexen/crm/integration/DataImportDelegate.java b/crm/src/main/java/com/rexen/crm/integration/DataImportDelegate.java new file mode 100644 index 0000000..b7919fe --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/integration/DataImportDelegate.java @@ -0,0 +1,81 @@ +/* + * Copyright 2013 Ralf. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rexen.crm.integration; + +import com.rexen.crm.beans.DataExchangeTeample; +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.InvocationTargetException; +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; + +/** + * + * @author Ralf + */ +public class DataImportDelegate +{ + + private DataAccessObject dao; + + public DataImportDelegate() + { + dao = new DataAccessObject("crm_mysql"); + } + + public Configuration getConfiguration(String template) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException, JAXBException + { + Configuration config = null; + + DataExchangeTeample example = new DataExchangeTeample(); + example.setName(template); + + example = (DataExchangeTeample) dao.find(example); + + if (example != null) + { + try + { + StringReader buffer = new StringReader(example.getTemplate()); + + JAXBContext context = JAXBContext.newInstance(Configuration.class); + + Unmarshaller unmarshaller = context.createUnmarshaller(); + + config = (Configuration) unmarshaller.unmarshal(buffer); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + + return config; + } + + public void load(String template, String filePath) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException, JAXBException, IOException, Exception + {//模板名 文件路径 + Configuration config = getConfiguration(template); + + if (config != null) + { + config.setFileName(filePath); + DataImport dataImport = new DataImport(config, dao); + dataImport.load(); + } + } +} diff --git a/crm/src/main/java/com/rexen/crm/integration/DataObject.java b/crm/src/main/java/com/rexen/crm/integration/DataObject.java new file mode 100644 index 0000000..4007f01 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/integration/DataObject.java @@ -0,0 +1,62 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.integration; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.HashMap; + +/** + * + * @author Kamala + */ +public class DataObject +{ + + public void assign(Object o) + { + HashMap target_methods = new HashMap<>(); + + for (Method m : this.getClass().getMethods()) + { + target_methods.put(m.getName(), m); + } + + HashMap source_methods = new HashMap<>(); + for (Method m : o.getClass().getMethods()) + { + source_methods.put(m.getName(), m); + } + + for (String get_method_name : source_methods.keySet()) + { + String set_method_name = null; + if (get_method_name.substring(0, 3).equals("get")) + { + if (!get_method_name.equals("getId")) + { + Method get_method = source_methods.get(get_method_name); + try + { + Object value = get_method.invoke(o, new Object[] + { + }); + + set_method_name = "set" + get_method_name.substring(3, get_method_name.length()); + + Method setter = target_methods.get(set_method_name); + setter.invoke(this, new Object[] + { + value + }); + } + catch (Exception e) + { + } + } + } + } + } +} diff --git a/crm/src/main/java/com/rexen/crm/integration/FieldConfiguration.java b/crm/src/main/java/com/rexen/crm/integration/FieldConfiguration.java new file mode 100644 index 0000000..5098a28 --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/integration/FieldConfiguration.java @@ -0,0 +1,120 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.integration; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

+ * @author Kamala + */ +@XmlRootElement(name = "Field") +public class FieldConfiguration +{ + + private String columnName; + private String fieldName; + private String dataType; + + @XmlElement(name = "ColumnName") + public String getColumnName() + { + return columnName; + } + + public void setColumnName(String columnName) + { + this.columnName = columnName; + } + + @XmlElement(name = "FieldName") + public String getFieldName() + { + return fieldName; + } + + public void setFieldName(String fieldName) + { + this.fieldName = fieldName; + } + + @XmlElement(name = "DataType") + public String getDataType() + { + return dataType; + } + + public void setDataType(String dataType) + { + this.dataType = dataType; + } + + private String format; + + @XmlElement(name = "Format") + public String getFormat() + { + return format; + } + + public void setFormat(String format) + { + this.format = format; + } + + private String lookupEntityName; + + @XmlElement(name = "LookupEntityName") + public String getLookupEntityName() + { + return lookupEntityName; + } + + public void setLookupEntityName(String lookupEntityName) + { + this.lookupEntityName = lookupEntityName; + } + + private String lookupFieldName; + + private String targetFieldName; + + @XmlElement(name = "LookupFieldName") + public String getLookupFieldName() + { + return lookupFieldName; + } + + public void setLookupFieldName(String lookupFieldName) + { + this.lookupFieldName = lookupFieldName; + } + + @XmlElement(name = "TargetFieldName") + public String getTargetFieldName() + { + return targetFieldName; + } + + public void setTargetFieldName(String targetFieldName) + { + this.targetFieldName = targetFieldName; + } + + private boolean autoReference; + + @XmlElement(name = "AutoReference") + public boolean isAutoReference() + { + return autoReference; + } + + public void setAutoReference(boolean autoReference) + { + this.autoReference = autoReference; + } +} diff --git a/crm/src/main/java/com/rexen/crm/integration/LogMessage.java b/crm/src/main/java/com/rexen/crm/integration/LogMessage.java new file mode 100644 index 0000000..e9abaac --- /dev/null +++ b/crm/src/main/java/com/rexen/crm/integration/LogMessage.java @@ -0,0 +1,102 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rexen.crm.integration; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import org.eclipse.persistence.jpa.jpql.parser.DateTime; + +/** + * + * @author Ralf + */ +@Entity +@Table(name = "des_log") +public class LogMessage implements Serializable +{ + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + private Long id; + @Column(name = "object_name", length = 256) + private String objectName; + @Column(name = "method_name", length = 256) + private String methodName; + @Column(name = "stack_trace", length = 4000) + private String stackTrace; + @Column(name = "message", length = 4000) + private String message; + @Column(name = "created") + @Temporal(javax.persistence.TemporalType.TIMESTAMP) + private Date created; + + public Long getId() + { + return id; + } + + public void setId(Long id) + { + this.id = id; + } + + public String getObjectName() + { + return objectName; + } + + public void setObjectName(String objectName) + { + this.objectName = objectName; + } + + public String getMethodName() + { + return methodName; + } + + public void setMethodName(String methodName) + { + this.methodName = methodName; + } + + public String getStackTrace() + { + return stackTrace; + } + + public void setStackTrace(String stackTrace) + { + this.stackTrace = stackTrace; + } + + public String getMessage() + { + return message; + } + + public void setMessage(String message) + { + this.message = message; + } + + public Date getCreated() + { + return created; + } + + public void setCreated(Date created) + { + this.created = created; + } +} diff --git a/crm/src/main/resources/META-INF/persistence.xml b/crm/src/main/resources/META-INF/persistence.xml new file mode 100644 index 0000000..5b5d3b5 --- /dev/null +++ b/crm/src/main/resources/META-INF/persistence.xml @@ -0,0 +1,76 @@ + + + + org.eclipse.persistence.jpa.PersistenceProvider + com.rexen.crm.beans.Account + com.rexen.crm.beans.AccountAdministrativLevelPl + com.rexen.crm.beans.AccountComprehensiveOrSpecializedPl + com.rexen.crm.beans.AccountGradePl + com.rexen.crm.beans.AccountLocalOrArmyPl + com.rexen.crm.beans.AccountMarketClassificationPl + com.rexen.crm.beans.AccountMedicaltypePl + com.rexen.crm.beans.AccountPl1 + com.rexen.crm.beans.AccountPl2 + com.rexen.crm.beans.AccountPl3 + com.rexen.crm.beans.AccountPl4 + com.rexen.crm.beans.AccountPl5 + com.rexen.crm.beans.AccountPl6 + com.rexen.crm.beans.AccountPointPl + com.rexen.crm.beans.AccountStatusPl + com.rexen.crm.beans.AccountTypePl + com.rexen.crm.beans.Accountcrmuser + com.rexen.crm.beans.Activity + com.rexen.crm.beans.ActivityActivityTypesPl + com.rexen.crm.beans.ActivityEventTypePl + com.rexen.crm.beans.ActivityFeatureProductPl + com.rexen.crm.beans.ActivityStatus + com.rexen.crm.beans.ActivityStatusPl + com.rexen.crm.beans.ActivityTypes + com.rexen.crm.beans.ActivityVisitingPurposePl + com.rexen.crm.beans.ActivityWhethercoachPl + com.rexen.crm.beans.Activitycrmuser + com.rexen.crm.beans.CallExport + com.rexen.crm.beans.City + com.rexen.crm.beans.Contact + com.rexen.crm.beans.ContactDepartmentPl + com.rexen.crm.beans.ContactDutyPl + com.rexen.crm.beans.ContactGeneralizationTargetPl + com.rexen.crm.beans.ContactGradePl + com.rexen.crm.beans.ContactJobTitlePl + com.rexen.crm.beans.ContactMarketClassificationPl + com.rexen.crm.beans.ContactPl1 + com.rexen.crm.beans.ContactPl2 + com.rexen.crm.beans.ContactPl3 + com.rexen.crm.beans.ContactPl4 + com.rexen.crm.beans.ContactPl5 + com.rexen.crm.beans.ContactPl6 + com.rexen.crm.beans.ContactStatusPl + com.rexen.crm.beans.Contactcrmuser + com.rexen.crm.beans.Crmuser + com.rexen.crm.beans.CrmuserActivited + com.rexen.crm.beans.CrmuserPl1 + com.rexen.crm.beans.CrmuserPl2 + com.rexen.crm.beans.DataExchangeOperation + com.rexen.crm.beans.DataExchangeStatus + com.rexen.crm.beans.DataExchangeTeample + com.rexen.crm.beans.Province + com.rexen.crm.beans.RecordType + com.rexen.crm.beans.RegionLevel1Pl + com.rexen.crm.beans.RegionLevel2Pl + com.rexen.crm.beans.Role + com.rexen.crm.beans.Score1Pl + com.rexen.crm.beans.Score2Pl + com.rexen.crm.beans.SexPl + com.rexen.crm.beans.UserPosition + com.rexen.crm.beans.Userinfo + com.rexen.crm.integration.LogMessage + ALL + NONE + + + + + + + + diff --git a/crm/src/main/resources/accountInfoListVM.html b/crm/src/main/resources/accountInfoListVM.html new file mode 100644 index 0000000..4a3c357 --- /dev/null +++ b/crm/src/main/resources/accountInfoListVM.html @@ -0,0 +1,18 @@ + + + + + + + +
+ +
+
    +
  • 名称:$data.name.
  • +
  • 地址:$data.address
  • +
  • 电话:$data.tele
  • +
  • 类型:$data.classification
  • +
+
+ diff --git a/crm/src/main/resources/accountsTableVM.html b/crm/src/main/resources/accountsTableVM.html new file mode 100644 index 0000000..fff80fb --- /dev/null +++ b/crm/src/main/resources/accountsTableVM.html @@ -0,0 +1,20 @@ + + + + + + + + + + + #foreach( $acct in $accountList ) + + + + + + + #end + +
名称地址电话类别
$acct.name$acct.address$acct.tele$acct.classification
\ No newline at end of file diff --git a/crm/src/main/resources/common.cfg b/crm/src/main/resources/common.cfg new file mode 100644 index 0000000..57e3775 --- /dev/null +++ b/crm/src/main/resources/common.cfg @@ -0,0 +1,12 @@ +media_files_path=C:\\var\\cpp\\media_files +#jcr_host=http://localhost:8888 +#jcr_host=http://109.105.47.77:8888 +jcr_host=http://localhost:8080/jackrabbit-webapp +picture_host=http://localhost:8080/media +report_engine_home=D:\\work\\projects\\source_code\\content-processor\\report-portal\\ReportEngine +report_engine_log=C:\\tmp +report_design_folder=D:\\work\\projects\\web_app_store +report_output_folder=C:\\var\\cpp\\media_files\\_report +report_images_folder=C:\\var\\cpp\\media_files\\_birtimg +report_base_img_url=http://localhost:8080/media/_birtimg/ +report_base_url=http://localhost:8080/media/_report/ \ No newline at end of file diff --git a/crm/src/main/resources/country.xml b/crm/src/main/resources/country.xml new file mode 100644 index 0000000..26d60a3 --- /dev/null +++ b/crm/src/main/resources/country.xml @@ -0,0 +1,540 @@ + + + + + + 北京 + 1 + + + 北京 + cty1 + + + + + 天津市 + 2 + + + 天津市 + cty2 + + + + + + 河北省 + 3 + + + 石家庄市 + cty3 + + + 唐山市 + cty4 + + + 秦皇岛市 + cty5 + + + 邯郸市 + cty6 + + + 邢台市 + cty7 + + + 保定市 + cty8 + + + 张家口市 + cty9 + + + 承德市 + cty10 + + + 沧州市 + cty11 + + + 衡水市 + cty12 + + + + + + 山西省 + 4 + + + 太原市 + cty13 + + + 大同市 + cty14 + + + 阳泉市 + cty15 + + + 长治市 + cty16 + + + 晋城市 + cty17 + + + 朔州市 + cty18 + + + 忻州市 + cty19 + + + 吕梁市 + cty20 + + + 晋中市 + cty21 + + + + + + 内蒙古 + 5 + + + 呼和浩特市 + cty22 + + + 包头市 + cty23 + + + 乌海市 + cty24 + + + 赤峰市 + cty25 + + + 呼伦贝尔市 + cty26 + + + 兴安盟 + cty27 + + + 通辽市 + cty28 + + + 锡林郭勒盟 + cty29 + + + 乌兰察布盟 + cty30 + + + + + + 辽宁省 + 6 + + + 沈阳市 + cty31 + + + 大连市 + cty32 + + + 鞍山市 + cty33 + + + 抚顺市 + cty34 + + + 丹东市 + cty35 + + + 锦州市 + cty36 + + + 阜新市 + cty37 + + + 辽阳市 + cty38 + + + 盘锦市 + cty39 + + + 铁岭市 + cty40 + + + 朝阳市 + cty41 + + + + + + 吉林省 + 7 + + + 长春市 + cty42 + + + 吉林市 + cty43 + + + 四平市 + cty44 + + + 四平市 + cty45 + + + 辽源市 + cty46 + + + 通化市 + cty47 + + + 白山市 + cty48 + + + 松原市 + cty49 + + + 白城市 + cty50 + + + 延边朝鲜族自治州 + cty51 + + + + + + 湖南省 + 8 + + + 长沙市 + cty52 + + + 株洲市 + cty53 + + + 湘潭市 + cty54 + + + 衡阳市 + cty55 + + + 邵阳市 + cty56 + + + 岳阳市 + cty57 + + + 张家界市 + cty58 + + + 郴州市 + cty59 + + + 永州市 + cty60 + + + 怀化市 + cty61 + + + + + + 海南省 + 9 + + + 海口市 + cty62 + + + 三亚市 + cty63 + + + + + + 重庆市 + 10 + + + 重庆市 + cty64 + + + + + + 四川省 + 11 + + + 成都市 + cty65 + + + 自贡市 + cty66 + + + 攀枝花市 + cty67 + + + + + + 贵州省 + 12 + + + 贵阳市 + cty68 + + + 六盘水市 + cty69 + + + 遵义市 + cty70 + + + + + + 云南省 + 13 + + + 昆明市 + cty71 + + + 曲靖市 + cty72 + + + 玉溪市 + cty73 + + + + + + 西藏 + 14 + + + 拉萨市 + cty74 + + + 昌都地区 + cty75 + + + 山南地区 + cty76 + + + + + + 甘肃省 + 15 + + + 兰州市 + cty77 + + + 嘉峪关市 + cty78 + + + 金昌市 + cty79 + + + + + + 青海省 + 16 + + + 西宁市 + cty80 + + + 海东地区 + cty81 + + + 海北藏族自治州 + cty82 + + + + + + 宁夏 + 17 + + + 银川市 + cty83 + + + 石嘴山市 + cty84 + + + 吴忠市 + cty85 + + + + + + 新疆 + 18 + + + 乌鲁木齐市 + cty86 + + + 克拉玛依市 + cty87 + + + 吐鲁番地区 + cty88 + + + + + + 广西 + 19 + + + 南宁市 + cty89 + + + 柳州市 + cty90 + + + 桂林市 + cty91 + + + + + + 湖北省 + 20 + + + 武汉市 + cty92 + + + 黄石市 + cty93 + + + 十堰市 + cty94 + + + + + + 河南省 + 21 + + + 郑州市 + cty95 + + + 开封市 + cty96 + + + 洛阳市 + cty97 + + + + + + \ No newline at end of file diff --git a/crm/src/main/resources/crm.properties b/crm/src/main/resources/crm.properties new file mode 100644 index 0000000..d440f42 --- /dev/null +++ b/crm/src/main/resources/crm.properties @@ -0,0 +1,6 @@ +http=http:// +url=e3.salestrategies.net +project=crm-1.0 +jumpage=mount/ActivitedUser +parameter=activitedCode +uploadpath=/tmp/ diff --git a/crm/src/main/resources/crmUserTableVM.html b/crm/src/main/resources/crmUserTableVM.html new file mode 100644 index 0000000..9972c01 --- /dev/null +++ b/crm/src/main/resources/crmUserTableVM.html @@ -0,0 +1,22 @@ + + + + + + + + + + + + #foreach( $item in $list ) + + + + + + + + #end + +
姓名电话部门职务动作
$item.name$item.cellPhone$item.division$item.jobTitle删除
diff --git a/crm/src/main/resources/dbconfig.properties b/crm/src/main/resources/dbconfig.properties new file mode 100644 index 0000000..b1e3595 --- /dev/null +++ b/crm/src/main/resources/dbconfig.properties @@ -0,0 +1,4 @@ +db.host=localhost +db.username=crm +db.password= +db.name=crmdb \ No newline at end of file diff --git a/crm/src/main/resources/entity.xml b/crm/src/main/resources/entity.xml new file mode 100644 index 0000000..104ca4f --- /dev/null +++ b/crm/src/main/resources/entity.xml @@ -0,0 +1,7763 @@ + + + + + account + 医院 + true + bdm_code + + select * from (select account.*\, + account_point_pl.val as + key_type_val\, + account_type_pl.val as hospital_type_val\, + account_comprehensive_or_specialized_pl.val as + comprehensive_or_specialized_val\, + account_administrativ_level_pl.val\, + account_administrativ_level_pl.val as administrativ_level_val + from + account + left join account_point_pl on account.key_type = + account_point_pl.id + left join account_type_pl on account.hospital_type + = account_type_pl.id + left join account_comprehensive_or_specialized_pl + on + account.comprehensive_or_specialized = + account_comprehensive_or_specialized_pl.id + left join + account_administrativ_level_pl on account.administrativ_level = + account_administrativ_level_pl.id + where account.id != -1 and account.status = 1 and( + account.id in (select + accountid from accountcrmuser + left join user_position on user_position.positionId = + accountcrmuser.crmuserid + where accountcrmuser.crmuserid = ?) + or + account.id in (select contact.accountid from contactcrmuser + left join + contact on contactcrmuser.contactid = contact.id + left join + accountcrmuser on accountcrmuser.accountid = contact.accountId + left + join user_position on user_position.positionId = + accountcrmuser.crmuserid + where contactcrmuser.crmuserid = ? + ))ORDER BY CONVERT( name USING gbk )) as aAccount + + + + select * from (select account.*\, + account_point_pl.val as key_type_val\, + account_type_pl.val as hospital_type_val\, + account_administrativ_level_pl.val as administrativ_level_val + from + account + left join account_point_pl on account.key_type = account_point_pl.id + left + join account_type_pl on account.hospital_type = account_type_pl.id + left join account_administrativ_level_pl on + account.administrativ_level = + account_administrativ_level_pl.id + where + account.id != -1 ORDER BY CONVERT( name USING gbk )) as aAccount + + + + + select * from (select account.*\,account_point_pl.val as + key_type_val\, + account_type_pl.val as hospital_type_val\, + account_comprehensive_or_specialized_pl.val as + comprehensive_or_specialized_val\, + account_administrativ_level_pl.val\, + account_administrativ_level_pl.val as administrativ_level_val + FROM + account + left join account_point_pl on account.key_type = + account_point_pl.id + left join account_type_pl on account.hospital_type + = account_type_pl.id + left join account_administrativ_level_pl on + account.administrativ_level = account_administrativ_level_pl.id + left join account_comprehensive_or_specialized_pl on + account_comprehensive_or_specialized_pl.id = + account.comprehensive_or_specialized + where account.status =1 and (account.id in (select accountid from + crmdb.accountcrmuser + where + crmuserid = ?) OR + account.id in (select + accountid from crmdb.accountcrmuser where crmuserid in + (select + crmuser.id from crmuser + left join user_position on crmuser.id = + user_position.positionId + where crmuser.reportto = ? + )) OR + account.id in + (select accountid from crmdb.contact where id in (select + contactid + from crmdb.contactcrmuser where crmuserid in (select id from + crmdb.crmuser where reportto = ?)))) ORDER BY CONVERT( name USING gbk + )) as aAccount + + + SELECT * from (select account.* from account where + account.id=? ORDER BY CONVERT( name USING gbk ) ) as aAccount + + administrativ_level + + + + + id + 编码 + number + true + false + false + false + false + String + true + 0 + 关键信息 + + + name + 医院名称 + true + text + false + true + true + true + String + 1 + true + true + 关键信息 + 标准医院名 + + + bdm_code + BDM医院编码 + true + text + false + false + true + true + true + String + 1 + true + 关键信息 + BDM编码 + + + administrativ_level + 医院行政级别 + false + number + false + false + true + true + account_administrativ_level_pl + picklist + 1 + true + 关键信息 + 行政级别 + + + administrativ_level_val + 医院行政级别 + false + number + false + false + false + false + true + picklist + 2 + true + 关键信息 + + + + grade + 医院分级 + false + number + false + false + false + false + account_grade_pl + picklist + 2 + 关键信息 + 医院分级 + + + hospital_type + 医院类型 + false + text + false + false + true + true + picklist + account_type_pl + 1 + true + 关键信息 + 医院类型 + + + hospital_type_val + 医院类型 + false + text + false + false + false + false + picklist + true + 1 + true + 关键信息 + + + local_or_army + 地方/军队医院 + false + number + false + false + true + true + picklist + account_local_or_army_pl + 2 + true + 关键信息 + 地方军队医院 + + + comprehensive_or_specialized + 综合/专科医院 + false + number + false + false + true + true + picklist + account_comprehensive_or_specialized_pl + 2 + true + 关键信息 + 综合专科医院 + + + comprehensive_or_specialized_val + 综合医院/专科医院 + false + number + false + false + false + false + picklist + 2 + true + 关键信息 + + + key_type + 重点医院 + false + text + false + false + true + true + picklist + account_point_pl + 2 + true + 关键信息 + 重点医院 + + + key_type_val + 重点医院 + false + text + false + false + false + false + true + picklist + 2 + true + 关键信息 + + + status + 状态 + number + false + false + false + true + true + picklist + account_status_pl + 2 + true + 关键信息 + 状态 + + + + duty_officer + 院长(法人) + false + text + false + false + true + true + String + 2 + true + 基本信息 + + + + num_of_doctors + 医生数量 + false + number + false + false + number + true + true + number + 2 + true + 基本信息 + + + num_of_assistant_doctors + 助理医师人数 + false + number + false + false + number + true + true + number + 2 + true + 基本信息 + + + num_of_staff + 员工总数 + false + number + false + false + number + true + true + number + 2 + true + 基本信息 + + + num_of_treat_per_year + 年诊疗人数 + false + number + false + false + number + true + true + number + 2 + true + 基本信息 + + + num_of_outpatient + 门诊人数 + false + number + false + false + number + true + true + number + 2 + true + 基本信息 + + + total_num_of_sickbed + 总病床数 + false + number + false + false + number + true + true + number + 2 + true + 基本信息 + + + num_of_anesthesia_doctor + 麻醉科医生数 + false + number + false + false + number + true + true + number + 2 + true + 基本信息 + + + num_of_pain_doctor + 疼痛学组医生数 + false + number + false + false + number + true + true + number + 2 + true + 基本信息 + + + num_of_surgery_per_year + 手术量/年 + false + number + false + false + number + true + true + number + 2 + true + 基本信息 + + + num_of_surgery_room + 手术间 + false + number + false + false + number + true + true + number + 2 + true + 基本信息 + + + num_of_using_opiates_medicine + 阿片类用药量 + false + number + false + false + true + true + number + 2 + true + 基本信息 + + + num_of_using_opiates_injection + 阿片类注射剂量(¥) + false + number + false + false + true + true + number + 2 + true + 基本信息 + + + date_of_establish + 成立时间 + false + text + false + false + true + true + String + 2 + true + 基本信息 + + + registered_capital + 注册资金 + false + number + false + false + true + true + number + 2 + true + 基本信息 + + + tel + 主要电话号码 + false + tel + false + false + true + true + number + 2 + true + 基本信息 + + + fax + 主要传真号码 + false + tel + false + false + true + true + number + 2 + true + 基本信息 + + + market_classification + 市场分类 + false + number + false + false + true + true + picklist + account_market_classification_pl + 2 + true + 基本信息 + 市场分类 + + + province + 医院省份 + false + text + false + false + province + true + true + 基本信息 + true + picklist + 1 + true + city + 省份 + + + city + 医院城市 + false + text + false + false + true + true + 1 + true + city + true + 基本信息 + province + picklist + 城市 + + + districts + 医院区县 + false + text + false + false + true + true + String + 2 + true + 基本信息 + 区县 + + + address + 医院详细地址 + false + textarea + false + false + true + true + String + 2 + true + 基本信息 + + + + owner + 创建人 + false + text + false + false + true + auto + false + true + 4 + true + 附加信息 + + + whenadded + 创建时间 + false + text + false + false + auto + true + false + 4 + true + 附加信息 + + + modifier + 修改人 + false + text + false + false + auto + true + false + 4 + true + 附加信息 + + + modify_datetime + 修改时间 + false + text + false + false + auto + true + false + 4 + true + 附加信息 + + + responsible_person + 负责人 + false + text + false + false + auto + false + false + 4 + true + 附加信息 + + + + + + contact + 医生 + true + externalId + + select * from (select contact.*\, + productline.id as + product_target_val\, + account.name as + accountName_val\,contact_department_pl.val as department_val\, + contact_duty_pl.val as duty_val + from contact + left join productline on + contact.product_target = + productline.id + left join account on + contact.accountid = account.id + left join accountcrmuser on + contact.accountId = accountcrmuser.accountid + left join user_position + on user_position.positionId = accountcrmuser.crmuserId + left join + contact_department_pl on contact.department = + contact_department_pl.id + left join contact_duty_pl on contact.duty = + contact_duty_pl.id + where contact.id != -1 and contact.status = 1 and + accountcrmuser.crmuserid = ? ) as aContact + + + Select distinct * + FROM (select aContact.*\, + productline.val as product_target_val\, + account.name as accountName_val\, + contact_department_pl.val as department_val\, + contact_duty_pl.val as duty_val + from (select distinct contact.id as cid\,contact.* + from contact\, accountcrmuser\,crmuser + where crmuser.reportto=? and + contact.accountId = accountcrmuser.accountId and + crmuser.id = accountcrmuser.crmuserId and + crmuser.pl1=1) as aContact + left join productline on aContact.product_target = productline.id + left join accountcrmuser on aContact.accountId = accountcrmuser.accountId + left join account on accountcrmuser.accountId = account.id + left join user_position on user_position.positionId = + accountcrmuser.crmuserId + left join contact_duty_pl on aContact.duty = contact_duty_pl.id + left join contact_department_pl on contact_department_pl.id = + aContact.department + where aContact.status = 1) as cContact + + + + + + + + + + + + + select * from (select contact.*\, + productline.val as + product_target_val\, + account.name as + accountName_val\,contact_department_pl.val as department_val\, + contact_duty_pl.val as duty_val + from contact + left join account on + contact.accountid = account.id + left join productline on + contact.product_target = + productline.id + left join contact_department_pl on contact.department = + contact_department_pl.id + left join contact_duty_pl on contact.duty = + contact_duty_pl.id + where contact.id != -1 ) as aContact + + + select * from (select contact.*\,account.id as accountName + from contact\,account where contact.id=? AND + account.id=contact.accountId order by whenadded DESC) as + aContact + + + select * from (select contact.*\,account.id as + accountName + from contact\,account where contact.id=? AND + account.id=contact.accountId order by whenadded DESC) as + aContact + + grade + + + + id + 编码 + number + true + false + true + false + 0 + String + true + 关键信息 + + + name + 姓名 + true + text + false + true + true + true + true + String + 1 + true + 关键信息 + true + 姓名 + + + externalId + CRM医生编码 + text + true + false + false + false + String + 1 + CRM医生编码 + 关键信息 + + + + accountId + 医院名称 + true + accountId + text + false + false + true + true + String + 1 + true + account + var + account.id\,account.name + 关键信息 + BDM编码 + bdm_code + + + + accountName_val + 医疗机构 + false + accountId + text + false + false + false + false + true + String + 2 + true + 关键信息 + + + native_place + 籍贯 + false + text + false + false + true + true + String + 2 + true + 关键信息 + + + department + 科室 + true + text + false + false + true + true + picklist + val + 2 + 1 + true + contact_department_pl + 关键信息 + 科室 + + + initializationdepartment + 参考科室 + false + text + false + false + true + true + String + 2 + true + 关键信息 + 参考科室 + + + department_val + 科室 + false + text + false + false + false + false + picklist + val + 2 + true + 2 + true + 关键信息 + + + duty + 职务 + true + text + false + false + true + true + picklist + 1 + true + contact_duty_pl + 关键信息 + 职务 + + + duty_val + 职务 + true + text + false + false + false + false + picklist + 1 + true + true + 关键信息 + 职务 + + + + job_title + 职称 + true + text + false + false + true + true + picklist + 1 + true + contact_job_title_pl + 关键信息 + 职称 + + + num_of_monthlySurgery + 月均手术量 + true + number + false + false + number + true + true + number + 1 + true + 关键信息 + 月均手术量 + + + num_of_monthlyAnalgesia + 镇痛泵台数 + true + number + false + false + number + true + true + number + 1 + true + 关键信息 + 镇痛泵台数 + + + sex + 性别 + false + text + false + false + true + true + picklist + 2 + true + sex_pl + 基本信息 + 性别 + + + office_tel + 工作电话号码 + false + tel + false + false + true + true + number + 2 + true + 基本信息 + + + office_fax + 工作传真号码 + false + tel + false + false + true + true + number + 2 + true + 基本信息 + + + cellphone + 手机 + false + tel + false + false + true + true + number + 2 + true + 基本信息 + 手机 + + + email + 电子邮件 + false + email + false + false + true + true + String + 2 + true + 基本信息 + + + grade + 医生分级 + false + text + false + false + true + true + picklist + 2 + true + contact_grade_pl + 基本信息 + 医生分级 + + + status + 状态 + false + text + false + false + true + true + picklist + 2 + true + contact_status_pl + 基本信息 + 状态 + + + market_classification + 市场分类 + false + text + false + false + true + true + picklist + 2 + true + contact_market_classification_pl + 基本信息 + + + province + 医院省份 + false + text + false + false + true + true + picklist + 2 + true + province + city + 基本信息 + var + account.province + + + city + 医院城市 + false + text + false + false + true + true + 2 + true + city + picklist + province + 基本信息 + var + account.city + + + districts + 医院区县 + false + text + false + false + true + true + String + 2 + true + 基本信息 + + + + product_target + 主推广产品目标 + false + text + false + false + true + true + productline + picklist + 2 + true + 基本信息 + + + product_target_val + 主推广产品目标 + false + text + false + false + true + false + true + 2 + false + picklist + 基本信息 + + + + visiting_target + 拜访目标次数 + false + number + false + false + true + true + true + number + 2 + true + 基本信息 + + + + + + owner + 创建人 + text + false + false + false + auto + true + false + 4 + true + 附加信息 + + + whenadded + 创建时间 + false + text + false + false + auto + true + false + 4 + true + 附加信息 + + + modifier + 修改人 + false + text + false + false + auto + true + false + 4 + true + 附加信息 + + + modify_datetime + 修改时间 + false + text + false + false + auto + true + false + 4 + true + 附加信息 + + + responsible_person + 负责人 + false + text + false + false + auto + false + false + 4 + true + 附加信息 + + + + + + coach + + select * from crmuser where ? is NOT NULL limit 10 + select * from crmuser where ? is NOT NULL limit 10 + pl2 + + + id + ID + number + true + false + false + false + String + 0 + 基本信息 + + + name + 姓名 + true + text + false + true + true + true + String + 1 + true + 基本信息 + + + cellPhone + 手机号码 + false + tel + false + false + true + true + number + 1 + true + 地址信息 + + + email + 邮箱 + false + email + false + false + true + true + String + 1 + true + 地址信息 + + + jobTitle + 职位 + false + text + false + false + true + true + picklist + 1 + true + 基本信息 + + + + + userinfo + 用户管理 + pl1 + employeeNumber + + select * from (select * from userInfo where id = ? ) as aUserInfo + + + select * from (select userinfo.*\, crmuser.role as + crmuserRole\, + crmuser.name as positionId\,role.val as + role_val\,province.val as province_val + from userinfo + left join user_position on user_position.userId = userinfo.id + left join + crmuser on crmuser.id = user_position.positionId + left join role on + role.id = crmuser.role + left join province on userinfo.province = + province.id + where userinfo.id != -1 and (user_position.isPrimary !=2 or + user_position.isPrimary is null) ORDER BY CONVERT( userinfo.name + USING gbk ) )as aUserInfo + + + select * from ( select userInfo.*\, crmuser.role as crmuserRole\, + crmuser.name as positionId from userInfo + left join user_position on userInfo.id = user_position.userId + left join + crmuser on crmuser.id = user_position.positionId + where userInfo.id != -1 and crmuser.id = ? and crmuser.reportto = ? + ORDER BY CONVERT( userInfo.name USING gbk )) as aUserInfo + + + + + + + + + + + + select * from userInfo where id=? + + + + id + ID + number + true + false + false + false + true + String + 0 + 关键信息 + + + name + 姓名 + true + text + false + true + true + true + String + 1 + true + true + 关键信息 + true + 姓名 + + + jobTitle + 职位 + false + text + false + false + String + true + true + 1 + true + 关键信息 + + + password + password + false + password + false + false + String + false + false + 4 + 关键信息 + Password + + + sex + 性别 + false + text + false + false + true + true + picklist + 1 + true + sex_pl + true + 关键信息 + true + + + email + 邮箱 + false + email + false + false + true + true + String + 2 + true + 关键信息 + true + true + email + + + cellPhone + 手机号码 + false + tel + false + false + true + true + number + 2 + true + true + 基本信息 + false + + + office_tel + 工作电话号码 + false + tel + false + false + true + true + number + 2 + true + true + 基本信息 + false + + + loginName + 用户登录名 + true + text + false + false + true + true + String + 1 + true + true + 关键信息 + 登录名 + + + crmuserRole + 角色 + false + text + role + false + false + String + false + true + false + 1 + 基本信息 + + + role_val + 角色 + false + text + role + picklist + false + false + false + false + false + true + 2 + 基本信息 + + + isActivited + 激活状态 + text + false + false + false + false + false + picklist + crmuser_activited + 2 + true + 基本信息 + + + positionId + 岗位编码 + true + text + false + false + true + false + true + String + 1 + false + 1 + 关键信息 + + + + + + + + + + + + + + + + + employeeNumber + 雇员编码 + false + text + false + false + true + true + String + 2 + true + 基本信息 + employeeNumber + + + pl1 + 状态 + false + text + crmuser_pl1 + false + false + true + true + true + picklist + 1 + true + 基本信息 + 用户状态 + + + province + 省份 + false + text + province + false + picklist + false + true + true + 1 + true + 基本信息 + city + + + province_val + 省份 + false + text + province + false + false + false + false + true + picklist + 2 + true + 基本信息 + city + + + city + 城市 + false + text + city + false + false + picklist + true + true + true + 1 + true + 基本信息 + province + + + + whenadded + 创建时间 + false + text + false + false + auto + true + false + 4 + true + 附加信息 + + + modifier + 修改人 + false + text + false + false + auto + true + false + 4 + true + 附加信息 + + + modify_datetime + 修改时间 + false + text + false + false + auto + true + false + 4 + true + true + 附加信息 + + + photo + 图片 + String + false + false + false + true + true + String + true + 1 + true + 基本信息 + + + + + crmuser + 岗位管理 + pl1 + code + + select * from + ( + select crmuser.*\,userInfo.name as userInfoName \,role.name as permission + \,role.val as role_val from crmuser + left join (select * from user_position order by whenadded limit 1) as + userposition + on crmuser.id = userposition.positionId + left join userInfo on userInfo.id = user_position.userId + left join crmdb.role on crmuser.role = role.id + where (id = ?) ORDER BY CONVERT( crmuser.code USING gbk ) + ) as aCrmuser + + + select * from + (select crmuser.*\,crmmanager.name as reportto_val\,userInfo.name as + userInfoName + \,role.name as permission\,role.val as role_val + from crmuser + left join (select * from crmuser) crmmanager on + crmuser.reportto = crmmanager.id + left join (select * from user_position order by whenadded ) as + userposition on userposition.positionId = crmuser.id + left join userInfo on userposition.userId = userInfo.id + left join crmdb.role on crmuser.role = role.id + where crmuser.id != -1 ORDER BY CONVERT( crmuser.code USING gbk ) + ) as + aCrmuser + + + select * from (select crmuser.*\,userInfo.name as + userInfoName + \,role.name as permission\,role.val as role_val + from crmuser + left join (select * from user_position order by whenadded) as + userposition + on userposition.positionId = crmuser.id + left join userInfo on + userInfo.id = user_position.userId + left join crmdb.role on + crmuser.role = role.id + where id = ? or reportto = ? ORDER BY CONVERT( crmuser.code USING gbk )) + as aCrmuser + + select * from (select crmuser.*\, + crmmanager.name as reportto_val\, + role.val as role_val + from crmuser + left join (select * from crmuser) crmmanager on crmuser.reportto = + crmmanager.id + left join crmdb.role on crmuser.role = role.id + where crmuser.reportto = ?) as aCrmuser + + select * from crmuser where id=? + + + id + ID + number + true + false + true + false + String + false + 0 + 关键信息 + + + name + 岗位名称 + true + text + false + true + true + true + 2 + true + true + 关键信息 + String + true + 岗位名称 + + + code + 岗位编码 + true + text + false + true + true + true + true + String + true + 1 + 关键信息 + 岗位编码 + + + reportto + 上级岗位 + false + text + crmuser + false + false + true + true + true + 1 + picklist + false + 关键信息 + 上级岗位 + code + + + + reportto_val + 上级岗位 + false + text + false + false + true + false + false + picklist + true + 1 + false + 关键信息 + + + pl1 + 状态 + false + text + picklist + crmuser_pl1 + false + false + true + true + true + 1 + 基本信息 + 状态 + + + role + 角色 + false + text + role + picklist + false + false + true + true + true + val + 3 + 1 + 关键信息 + 角色 + + + role_val + 角色 + false + text + picklist + false + false + false + false + true + 2 + 关键信息 + + + userInfoName + 用户名称 + false + text + String + false + false + true + false + true + false + 1 + 基本信息 + + + permission + 用户权限 + false + text + String + false + false + true + false + false + 1 + 基本信息 + + + pl2 + 产品线 + false + text + picklist + productline + false + false + true + true + true + false + 1 + 基本信息 + 产品线 + + + + level + 级别 + true + number + picklist + false + false + true + crmuser_level_pl + true + true + false + 1 + 关键信息 + 级别 + + + product + 产品名称 + false + picklist + text + product + false + false + false + false + 2 + true + 基本信息 + + + + pl4 + 一级区域 + false + text + picklist + region_level1_pl + false + false + true + true + true + 1 + 基本信息 + 一级区域 + + + pl5 + 二级区域 + false + text + picklist + region_level2_pl + false + false + true + true + true + 1 + 基本信息 + 二级区域 + + + + + city + 城市 + false + text + picklist + false + false + true + city + true + true + 1 + 基本信息 + 城市 + + + + + + + + + + + + + + + + whenadded + 创建时间 + false + text + false + false + true + auto + true + false + 4 + 附加信息 + + + modifier + 修改人 + false + text + false + false + true + auto + true + false + 4 + 附加信息 + + + modify_datetime + 修改时间 + false + text + false + false + true + auto + true + false + 4 + 附加信息 + + + + + + user_position + 用户岗位管理 + externalId + + select * from ( select userinfo.name as name\,user_position.* + from user_position + inner join userinfo on userinfo.id = user_position.userId + inner join crmuser on crmuser.id = user_position.positionId) as a + + + select * from ( select userinfo.name as name\,user_position.* + from user_position + inner join userinfo on userinfo.id = user_position.userId + inner join crmuser on crmuser.id = user_position.positionId) as a + + select * from(select userinfo.name as name \,user_position.* + from user_position + inner join userinfo on userinfo.id = user_position.userId + inner join crmuser on crmuser.id = user_position.positionId + where user_position.id = ?) as a + + + + id + ID + number + true + false + false + String + false + 0 + 关键信息 + + + userId + 用户名称 + text + false + true + true + true + 2 + String + userinfo + true + 关键信息 + EmployeeNumber + employeeNumber + + + + name + 用户名称 + text + false + true + true + false + 1 + String + false + 关键信息 + + + positionId + 岗位名称 + text + false + false + true + true + String + 1 + true + crmuser + 关键信息 + PositionExternalId + code + + + + status + 状态 + text + picklist + false + false + false + contact_status_pl + false + 2 + true + 关键信息 + 状态 + + + isPrimary + 是否主岗 + text + false + false + true + true + String + account_pl3 + 1 + true + 关键信息 + 是否主岗 + + + externalId + 外部ID + text + false + false + false + false + String + 2 + true + 关键信息 + + + + + + + accountcrmuser + 医院用户关系 + externalId + + + + + id + ID + number + true + false + false + false + String + 0 + 基本信息 + + + accountId + 医院Id + text + false + false + true + true + String + 1 + account + true + 关键信息 + BDM编码 + bdm_code + + + + crmuserId + 岗位Id + text + false + false + true + true + 1 + true + String + crmuser + 关键信息 + 岗位编码 + code + + + + externalId + 外部ID + text + false + false + false + false + String + 1 + true + 关键本信息 + + + + + + + city + 城市 + + + id + ID + number + true + false + false + false + 0 + String + 基本信息 + + + name + 城市 + text + false + false + true + true + String + 1 + true + 基本信息 + + + provinceId + ID + number + false + false + false + true + String + 1 + true + 基本信息 + + + + + activity + 拜访 + true + activity_type + + select * from (select * from (select activity.*\, + activity.activity_type as act_type\, + activity.activity_coachType as + coachType\, + activity.status as act_status\, + activity.contactId as + contactName\, + contact.accountId as accountName\, + activity_event_type_pl.val as event_type_val\, + account.name as + accountName_val\, + contact.grade as contactgrade\, + activity_daypart_pl.val as activity_daypart_val\, + activity_activity_types_pl.val as activity_type_val\, + contact.name as + contactname_val + from activity + left join activity_event_type_pl on + activity.event_type = + activity_event_type_pl.id + left join + activity_daypart_pl on activity.activity_daypart = + activity_daypart_pl.id + left join activity_activity_types_pl on + activity.activity_type = + activity_activity_types_pl.id + left join contact on activity.contactId = contact.id + left join account + on contact.accountId = account.Id + left join activitycrmuser on + activity.id = activitycrmuser.activityId + where + activitycrmuser.crmuserid = ?) as aactivity where event_type = + 1 order + by whenadded DESC) as aActivity + + + select * from (select * from (select activity.*\, + activity.activity_type as act_type\, + activity.activity_coachType as + coachType\, + activity.status as act_status\, + activity.contactId as + contactName\, + contact.accountId as accountName\, + activity_event_type_pl.val as event_type_val\, + account.name as + accountName_val\, + contact.grade as contactgrade\, + activity_daypart_pl.val as activity_daypart_val\, + activity_activity_types_pl.val as activity_type_val\, + contact.name as + contactname_val + from activity + left join activity_event_type_pl on + activity.event_type = + activity_event_type_pl.id + left join + activity_daypart_pl on activity.activity_daypart = + activity_daypart_pl.id + left join activity_activity_types_pl on + activity.activity_type = + activity_activity_types_pl.id + left join contact on activity.contactId = contact.id + left join account + on contact.accountId = account.Id + left join activitycrmuser on + activity.id = activitycrmuser.activityId + left join crmuser on + activitycrmuser.crmuserId = crmuser.id + where crmuser.reportto = ? or + crmuser.id = ? ) as aactivity where + event_type = 1 order by whenadded + DESC) as aActivity + + + + + select * from (select activity.*\, + activity.activity_type as + act_type\, + activity.activity_coachType as coachType\, + activity.status + as act_status\, + activity.contactId as contactName\, + contact.accountId + as accountName\, + activity_event_type_pl.val as event_type_val\, + account.name as accountName_val\, + contact.grade as contactgrade\, + activity_daypart_pl.val as activity_daypart_val\, + activity_activity_types_pl.val as activity_type_val\, + contact.name as + contactname_val + from activity + left join activity_event_type_pl on + activity.event_type = + activity_event_type_pl.id + left join + activity_daypart_pl on activity.activity_daypart = + activity_daypart_pl.id + left join activity_activity_types_pl on + activity.activity_type = + activity_activity_types_pl.id + left join contact on activity.contactId = contact.id + left join account + on contact.accountId = account.Id where + activity.event_type = 1 order + by whenadded DESC) as aActivity + + + select * from (select * from (select activity.*\, + activity.activity_type as act_type\, + activity.activity_coachType as + coachType\, + activity.status as act_status\, + activity.contactId as + contactName\, + contact.accountId as accountName\, + activity_event_type_pl.val as event_type_val\, + activity_daypart_pl.val as activity_daypart_val\, + activity_activity_types_pl.val as activity_type_val\, + account.name as + accountName_val\, + contact.grade as contactgrade\, + contact.name as + contactname_val + from activity + left join activity_event_type_pl on + activity.event_type = + activity_event_type_pl.id + left join + activity_daypart_pl on activity.activity_daypart = + activity_daypart_pl.id + left join activity_activity_types_pl on + activity.activity_type = + activity_activity_types_pl.id + left join contact on activity.contactId = contact.id + left join account + on contact.accountId = account.Id + left join activitycrmuser on + activity.id = activitycrmuser.activityId + where + activitycrmuser.crmuserid = ?) as aactivity order by whenadded + DESC) + as aActivity + + + select * from (select * from (select + activity.*\, + activity.activity_type as act_type\, + activity.activity_coachType as coachType\, + activity.status as + act_status\, + activity.contactId as contactName\, + contact.accountId as + accountName\, + activity_event_type_pl.val as event_type_val\, + activity_activity_types_pl.val as activity_type_val\, + account.name as + accountName_val\, + contact.grade as contactgrade\, + activity_daypart_pl.val as activity_daypart_val\, + contact.name as + contactname_val + from activity + left join activity_event_type_pl on + activity.event_type = + activity_event_type_pl.id + left join + activity_daypart_pl on activity.activity_daypart = + activity_daypart_pl.id + left join activity_activity_types_pl on + activity.activity_type = + activity_activity_types_pl.id + left join contact on activity.contactId = contact.id + left join account + on contact.accountId = account.Id + left join activitycrmuser on + activity.id = activitycrmuser.activityId + left join crmuser on + activitycrmuser.crmuserId = crmuser.id + where crmuser.id = ? ) as + aactivity order by whenadded DESC) as aActivity + + + + + select * from (select activity.*\, + activity.activity_type as act_type\, + activity.activity_coachType as + coachType\, + activity.status as act_status\, + activity.contactId as + contactName\, + contact.accountId as accountName\, + activity_event_type_pl.val as event_type_val\, + activity_activity_types_pl.val as activity_type_val\, + account.name as + accountName_val\, + contact.grade as contactgrade\, + activity_daypart_pl.val as activity_daypart_val\, + contact.name as + contactname_val + from activity + left join activity_event_type_pl on + activity.event_type = + activity_event_type_pl.id + left join + activity_daypart_pl on activity.activity_daypart = + activity_daypart_pl.id + left join activity_activity_types_pl on + activity.activity_type = + activity_activity_types_pl.id + left join contact on activity.contactId = contact.id + left join account + on contact.accountId = account.Id order by whenadded + DESC) as + aActivity + + select * from (select activity.*\,activity.activity_type as + act_type\,activity.activity_coachType as coachType\,activity.status + as act_status\, activity.contactId as + contactName\, contact.accountId + as accountName\,activity_daypart_pl.val as + activity_daypart_val\,activity_activity_types_pl.val as + activity_type_val\, contact.grade as contactgrade\,contact.name as cn + from activity left join activitycrmuser on + activitycrmuser.activityId=activity.id left join + activity_activity_types_pl on activity.activity_type = + activity_activity_types_pl.id left join activity_daypart_pl on + activity.activity_daypart = + activity_daypart_pl.id LEFT JOIN contact on + contact.id = activity.contactId where + activity.id=?) + as aActivity + + + + id + 编码 + number + true + false + true + false + 0 + String + 关键信息 + + + + + + event_type_val + 活动类型 + false + text + false + false + false + false + true + String + 1 + true + true + 关键信息 + + + + coachType + 活动类型 + false + text + false + false + false + false + 1 + true + String + activity_coachType_pl + 关键信息 + + + + title + 活动名称 + false + text + false + true + true + true + String + 1 + true + 关键信息 + + + + starttime + 开始时间 + true + datetime-local + + false + false + true + true + String + 1 + true + var + start_datetime + 关键信息 + + + endtime + 结束时间 + true + datetime-local + + false + false + true + false + String + 1 + true + var + end_datetime + 关键信息 + + + activity_daypart + 活动开始时段 + text + false + false + true + true + 1 + true + String + activity_daypart_pl + true + true + 关键信息 + + + activity_daypart_val + 活动开始时段 + false + number + false + false + false + false + true + picklist + 2 + true + 关键信息 + + + activity_type + 拜访类型 + text + activity_activity_types_pl + false + false + true + true + true + 1 + true + true + String + val + 1 + visiting_purpose + 关键信息 + + + + activity_type_val + 拜访类型 + false + number + false + false + false + false + true + picklist + 2 + true + 关键信息 + + + + visiting_purpose + 拜访目的 + text + false + false + true + true + picklist + activity_visiting_purpose_pl + 2 + true + true + activity_type + true + true + val + -1 + 基本信息 + + + + + contactId + 拜访医生 + text + false + false + true + true + String + 1 + true + true + var + contact.id\,contact.name + contact + true + 关键信息 + + + + contactname_val + 拜访医生 + number + false + false + false + false + true + String + 1 + true + true + true + contact + 关键信息 + + + contactName + 拜访医生 + contactId + true + text + false + false + false + false + String + 1 + true + contact + true + true + 关键信息 + + + + whether_coach + 是否协访 + radio + false + false + true + true + true + 1 + true + true + String + 关键信息 + + + + + contactgrade + 医生等级 + text + false + false + true + false + 1 + true + picklist + contact_grade_pl + true + 关键信息 + + + + + accountName + 拜访医院 + accountId + text + false + false + true + false + String + 1 + true + account + true + 关键信息 + + + accountName_val + 拜访医院 + text + false + false + false + false + true + String + 1 + true + true + 关键信息 + + + responsible_person + 负责人 + text + false + false + true + false + 1 + true + auto + 关键信息 + + + act_type + 拜访类型 + number + false + false + false + true + picklist + 1 + true + 基本信息 + + + + feature_product + 主推产品 + text + false + false + true + true + productline + 2 + true + picklist + true + true + 基本信息 + + + + status + 状态 + text + false + false + true + false + picklist + activity_status_pl + 1 + true + true + true + 基本信息 + + + + + act_status + 状态 + number + false + false + false + false + picklist + 3 + true + true + true + 附加信息 + + + owner + 创建人 + text + false + false + true + false + 4 + true + auto + 附加信息 + + + whenadded + 创建时间 + text + false + false + true + false + 4 + true + auto + 附加信息 + + + modifier + 修改人 + text + false + false + true + false + 4 + true + auto + 附加信息 + + + modify_datetime + 修改时间 + text + false + false + true + false + 4 + true + auto + 附加信息 + + + + act_endtime + 活动结束时间 + text + false + false + true + false + String + 4 + true + 附加信息 + + + + + + + data_exchange_teample + 数据模板 + select * from data_exchange_teample + + select * from data_exchange_teample where + data_exchange_teample.id = ? + 数据版本 + + + id + Id + number + true + false + false + false + 0 + String + 关键信息 + + + name + 名称 + text + false + true + true + true + String + 1 + true + 关键信息 + + + version + 数据版本 + text + false + false + true + true + String + 1 + true + 关键信息 + + + operation_id + 操作 + text + false + false + true + true + picklist + data_exchange_operation + 1 + true + + 关键信息 + + + type_id + 类型 + text + false + false + true + true + picklist + data_exchange_status + 1 + true + 关键信息 + + + template + 模板 + textarea + true + false + false + true + true + String + 2 + true + 关键信息 + + + + + + coaching + 辅导 + true + status + + select distinct * from (select * from (select activity.crmuserId + as + crmuserName\, activity.coacheeId as coacheeName\, activity.*\, + activity.activity_type as act_type\, + activity.activity_coachType as + coachType\, + activity_status_pl.val as act_status\, + activity.contactId + as contactName\, + contact.accountId as accountName\, + activity_event_type_pl.val as event_type_val\, + activity_coachType_pl.val as coachType_val\, + account.name as + accountName_val\, + userinfo.id as coacheeUserinfoName\, + auserinfo.id as + coachUserInfoName\, + contact.name as contactname_val + from activity + left + join activity_event_type_pl on activity.event_type = + activity_event_type_pl.id + left join activity_coachType_pl on + activity.activity_coachType = + activity_coachType_pl.id + left join activity_status_pl on activity.status = + activity_status_pl.id + left join contact on activity.contactId = + contact.id + left join account on contact.accountId = account.Id + left + join crmuser on crmuser.id = activity.coacheeId + left join + user_position on user_position.positionId=crmuser.id + left join userinfo on userinfo.id=user_position.userId + left join crmuser as acrmuser on acrmuser.id=crmuser.reportto + left join user_position as auser_position on + auser_position.positionId=acrmuser.id + left join userinfo as auserinfo on auser_position.userId=auserinfo.id + left join activitycrmuser on activity.id = activitycrmuser.activityId + where activitycrmuser.crmuserid = ?) as aactivity where event_type = + 2 order by whenadded DESC) as aActivity + + + select distinct * from (select * from (select + activity.crmuserId as + crmuserName\, activity.coacheeId as + coacheeName\, activity.*\, + activity.activity_type as act_type\, + activity.activity_coachType as coachType\, + activity_status_pl.val as + act_status\, + activity.contactId as contactName\, + contact.accountId as + accountName\, + activity_event_type_pl.val as event_type_val\, + activity_coachType_pl.val as coachType_val\, + account.name as + accountName_val\, + userinfo.id as coacheeUserinfoName\, + auserinfo.id as + coachUserInfoName\, + contact.name as contactname_val + from activity + left + join activity_event_type_pl on activity.event_type = + activity_event_type_pl.id + left join activity_coachType_pl on + activity.activity_coachType = + activity_coachType_pl.id + left join activity_status_pl on activity.status = + activity_status_pl.id + left join contact on activity.contactId = + contact.id + left join account on contact.accountId = account.Id + left + join activitycrmuser on activity.id = activitycrmuser.activityId + left + join crmuser on activitycrmuser.crmuserid = crmuser.id + left join + crmuser as bcrmuser on bcrmuser.id = activity.coacheeId + left join + crmuser as ccrmuser on ccrmuser.id = activity.crmuserId + left join + user_position on user_position.positionId=bcrmuser.id + left join + user_position as auser_position on + auser_position.positionId=ccrmuser.id + left join userinfo on userinfo.id=user_position.userId + left join userinfo as auserinfo on auserinfo.id=auser_position.userId + where crmuser.reportto = ? or crmuser.id = ?)as aactivity where + event_type + = 2 order by whenadded DESC) as aActivity + + + select * from (select * from crmuser where crmuser.reportto = ?) as crmUSER + + + select distinct * from (select activity.crmuserId as + crmuserName\, + activity.coacheeId as coacheeName\, activity.*\, + activity.activity_type as act_type\, + activity.activity_coachType as + coachType\, + activity_status_pl.val as act_status\, + activity.contactId + as contactName\, + contact.accountId as accountName\, + activity_event_type_pl.val as event_type_val\, + activity_coachType_pl.val as coachType_val\, + account.name as + accountName_val\, + userinfo.id as coacheeUserinfoName\, + auserinfo.id as + coachUserInfoName\, + contact.name as contactname_val + from activity + left + join activity_event_type_pl on activity.event_type = + activity_event_type_pl.id + left join activity_coachType_pl on + activity.activity_coachType = + activity_coachType_pl.id + left join activity_status_pl on activity.status = + activity_status_pl.id + left join contact on activity.contactId = + contact.id + left join crmuser as bcrmuser on bcrmuser.id = + activity.coacheeId + left join crmuser as ccrmuser on ccrmuser.id = + activity.crmuserId + left join user_position on + user_position.positionId=bcrmuser.id + left join user_position as + auser_position on auser_position.positionId=ccrmuser.id + left join userinfo on userinfo.id=user_position.userId + left join userinfo as auserinfo on auserinfo.id=auser_position.userId + left join account on contact.accountId = account.Id where + activity.event_type = 2 order by whenadded DESC) as aActivity + + select * from (select activity.crmuserId as crmuserName\, + activity.coacheeId as coacheeName\, + activity.*\,activity.activity_type as + act_type\,activity.activity_coachType as + coachType\,activity_status_pl.val as act_status\, activity.contactId + as + contactName\, contact.accountId as + accountName\,activity_coachType_pl.val as coachType_val\, userinfo.id + as coacheeUserinfoName\,auserinfo.id as + coachUserInfoName\,contact.name as cn + from activity left join + activitycrmuser on + activitycrmuser.activityId=activity.id + left join activity_coachType_pl on activity.activity_coachType = + activity_coachType_pl.id + left join activity_status_pl on + activity.status = + activity_status_pl.id + left join crmuser as bcrmuser on bcrmuser.id = activity.coacheeId + left join crmuser as ccrmuser on ccrmuser.id = activity.crmuserId + left join user_position on user_position.positionId=bcrmuser.id + left + join user_position as auser_position on + auser_position.positionId=ccrmuser.id + left join userinfo on userinfo.id=user_position.userId + left join userinfo as auserinfo on auserinfo.id=auser_position.userId + LEFT JOIN contact on + contact.id = activity.contactId where + activity.id=?) + as aCoaching + + + + id + 编码 + number + true + false + true + false + String + 0 + 关键信息 + + + + title + 活动名称 + false + text + false + true + true + true + String + 1 + true + 关键信息 + + + + coachType + 辅导类型 + false + text + false + false + true + false + 1 + true + activity_coachType_pl + picklist + 关键信息 + + + + coachType_val + 辅导类型 + false + number + false + false + false + false + true + 1 + true + picklist + 关键信息 + + + crmuserId + 辅导人Id + text + false + false + false + false + 1 + true + true + auto + 关键信息 + + + crmuserName + 辅导人 + true + crmuserId + text + false + false + true + false + String + 1 + true + crmuser + true + 关键信息 + + + + coachUserInfoId + 辅导人用户ID + text + false + false + false + false + String + 1 + true + true + 关键信息 + + + + coachUserInfoName + 辅导人姓名 + true + coachUserInfoId + text + String + false + false + true + false + 1 + true + userinfo + true + 关键信息 + + + coacheeId + 被辅导人Id + text + false + false + false + false + String + 1 + true + true + 关键信息 + + + coacheeName + 被辅导人 + true + coacheeId + text + false + false + true + true + String + 1 + false + crmuser + true + 关键信息 + + + + coacheeUserinfoId + 被辅导人用户ID + text + false + false + false + false + 1 + true + String + userinfo + true + 关键信息 + + + + coacheeUserinfoName + 被辅导人姓名 + true + coacheeUserinfoId + text + false + false + true + false + 1 + true + String + userinfo + true + 关键信息 + + + + starttime + 开始时间 + datetime-local + false + false + true + true + String + var + start_datetime + 1 + true + true + 关键信息 + + + + endtime + 结束时间 + datetime-local + false + false + true + true + String + var + end_datetime + 1 + true + true + 关键信息 + + + + participants + 参与人/相关人员 + text + false + false + false + false + String + 2 + true + true + 关键信息 + + + + feature_product + 主推产品 + text + false + false + true + true + productline + picklist + 2 + true + true + true + 基本信息 + + + + accountId + 医院 + true + accountId + text + false + false + true + false + 1 + false + String + account + var + account.id\,account.name + 关键信息 + + + + accountName_val + 医疗机构 + false + accountId + text + false + false + false + false + 1 + false + String + true + 关键信息 + + + + department + 科室 + true + text + false + false + true + false + picklist + val + 0 + 1 + false + contact_department_pl + 关键信息 + + + + coachTime + 协访时间 + text + false + false + true + true + picklist + activity_coachtime_pl + 1 + true + true + true + true + 关键信息 + + + + location + 计划地点 + textarea + false + false + true + true + String + true + 2 + 基本信息 + + + + status + 状态 + text + false + false + true + false + picklist + activity_status_pl + 1 + true + true + true + 关键信息 + + + act_status + 状态 + number + false + false + false + false + picklist + true + 3 + true + true + true + 附加信息 + + + owner + 创建人 + text + false + false + true + false + auto + 4 + true + 附加信息 + + + whenadded + 创建时间 + text + false + false + true + false + auto + 4 + true + 附加信息 + + + modifier + 修改人 + text + false + false + true + false + auto + 4 + true + 附加信息 + + + modify_datetime + 修改时间 + text + false + false + true + false + auto + 4 + true + 附加信息 + + + responsible_person + 负责人 + text + false + false + true + false + auto + 2 + true + 基本信息 + + + act_endtime + 活动结束时间 + text + false + false + true + false + String + 4 + true + 附加信息 + + + + planing + 访前计划 + text + false + false + true + true + 5 + true + val + 0 + score1_pl + picklist + 1 + 评分信息 + + + openling + 开场 + text + false + false + true + true + val + 0 + picklist + 5 + true + score1_pl + 2 + 评分信息 + + + enquery_listening + 探寻聆听 + text + false + false + true + true + picklist + val + 0 + 5 + true + score1_pl + 3 + 评分信息 + + + deliverable + 信息传递 + text + false + false + true + true + val + 0 + picklist + 5 + true + score1_pl + 4 + 评分信息 + + + objection_handing + 异常处理 + text + false + false + true + true + val + 0 + picklist + 5 + true + score2_pl + 5 + 评分信息 + + + summary + 缔结 + text + false + false + true + true + val + 0 + picklist + 5 + true + score2_pl + 6 + 评分信息 + + + total_score + 总分 + text + false + false + true + false + calculated + 1 + true + 关键信息 + + + + + productline + 产品线 + + SELECT * FROM productline + select * from productline + select * from productline where id = ? + + + id + ID + text + true + false + true + false + String + 0 + 关键信息 + true + + + name + true + 产品线名称 + text + false + true + true + true + String + 1 + true + 关键信息 + true + + + val + true + 产品线别名 + text + false + false + true + true + String + true + 1 + true + 关键信息 + + + description + true + 描述 + text + String + false + false + true + true + 1 + true + 基本信息 + + + whenadded + 创建时间 + false + text + false + false + auto + true + false + 4 + true + 附加信息 + + + modify_datetime + 修改时间 + false + text + false + false + auto + true + false + 4 + true + 附加信息 + + + owner + 创建人 + text + false + false + false + auto + true + false + 1 + true + 附加信息 + + + modifier + 修改人 + false + text + false + false + auto + true + false + 1 + true + 附加信息 + + + + + product + 产品 + + SELECT * FROM product + SELECT * FROM product + select * from product where id = ? + + + id + ID + text + true + false + true + false + String + 0 + 关键信息 + true + + + name + true + 产品名称 + text + false + true + true + true + String + 1 + true + 关键信息 + true + + + + productlineId + true + 产品线名称 + productlineId + text + String + false + false + true + true + 1 + true + productline + var + productline.id\,productline.name + 关键信息 + + + whenadded + 创建时间 + text + false + false + true + true + auto + 1 + true + 附加信息 + + + modify_datetime + 修改时间 + text + false + false + true + true + auto + 1 + true + 附加信息 + + + owner + 创建人 + text + false + false + false + auto + true + false + 1 + true + 附加信息 + + + modifier + 修改人 + false + text + false + false + auto + true + false + 1 + true + 附加信息 + + + + + + productcategory + 产品规格 + + SELECT * FROM productcategory + select * from productcategory where id = ? + + + id + ID + text + true + false + true + false + 0 + String + 关键信息 + + + name + true + 规格名称 + text + false + true + true + true + 1 + true + String + 关键信息 + + + productId + true + 产品名称 + productId + text + false + false + true + true + 1 + true + product + var + product.id\,product.name + String + 关键信息 + + + + productlineId + true + 产品线名称 + productlineId + text + false + false + true + false + String + 1 + true + productline + var + productline.id\,productline.name + 关键信息 + + + + whenadded + 创建时间 + text + false + false + true + true + auto + 1 + true + 附加信息 + + + modify_datetime + 修改时间 + text + false + false + true + true + auto + 1 + true + 附加信息 + + + owner + 创建人 + text + false + false + false + auto + true + false + 1 + true + 附加信息 + + + modifier + 修改人 + false + text + false + false + auto + true + false + 1 + true + 附加信息 + + + + + + willcoaching + 科室会辅导 + status + + select distinct * from (select * from (select activity.crmuserId + as + crmuserName\, activity.coacheeId as coacheeName\, activity.*\, + activity.activity_type as act_type\, + activity.activity_coachType as + coachType\, + activity_status_pl.val as act_status\, + activity.contactId + as contactName\, + contact.accountId as accountName\, + activity_event_type_pl.val as event_type_val\, + activity_coachType_pl.val as coachType_val\, + account.name as + accountName_val\, + userinfo.id as coacheeUserinfoName\, + auserinfo.id as + coachUserInfoName\, + contact.name as contactname_val + from activity + left + join activity_event_type_pl on activity.event_type = + activity_event_type_pl.id + left join activity_coachType_pl on + activity.activity_coachType = + activity_coachType_pl.id + left join activity_status_pl on activity.status = + activity_status_pl.id + left join contact on activity.contactId = + contact.id + left join account on contact.accountId = account.Id + left + join crmuser on crmuser.id = activity.coacheeId + left join + user_position on user_position.positionId=crmuser.id + left join userinfo on userinfo.id=user_position.userId + left join + activitycrmuser on activity.id = activitycrmuser.activityId + left join + crmuser as acrmuser on acrmuser.id=crmuser.reportto + left join user_position as auser_position on + auser_position.positionId=acrmuser.id + left join userinfo as auserinfo on auser_position.userId=auserinfo.id + where activitycrmuser.crmuserid = ?) as aactivity where event_type = + 2 order by whenadded DESC) as aActivity + + + select distinct * from (select * from (select + activity.crmuserId as + crmuserName\, activity.coacheeId as + coacheeName\, activity.*\, + activity.activity_type as act_type\, + activity.activity_coachType as coachType\, + activity_status_pl.val as + act_status\, + activity.contactId as contactName\, + contact.accountId as + accountName\, + activity_event_type_pl.val as event_type_val\, + activity_coachType_pl.val as coachType_val\, + account.name as + accountName_val\, + userinfo.id as coacheeUserinfoName\, + auserinfo.id as + coachUserInfoName\, + contact.name as contactname_val + from activity + left + join activity_event_type_pl on activity.event_type = + activity_event_type_pl.id + left join activity_coachType_pl on + activity.activity_coachType = + activity_coachType_pl.id + left join activity_status_pl on activity.status = + activity_status_pl.id + left join contact on activity.contactId = + contact.id + left join account on contact.accountId = account.Id + left + join activitycrmuser on activity.id = activitycrmuser.activityId + left + join crmuser on activitycrmuser.crmuserid = crmuser.id + left join + crmuser as bcrmuser on bcrmuser.id = activity.coacheeId + left join + crmuser as ccrmuser on ccrmuser.id = activity.crmuserId + left join + user_position on user_position.positionId=bcrmuser.id + left join + user_position as auser_position on + auser_position.positionId=ccrmuser.id + left join userinfo on userinfo.id=user_position.userId + left join userinfo as auserinfo on auserinfo.id=auser_position.userId + where crmuser.reportto = ? or crmuser.id = ?)as aactivity where + event_type + = 2 order by whenadded DESC) as aActivity + + + select * from (select * from crmuser where crmuser.reportto = ?) as crmUSER + + + select distinct * from (select activity.crmuserId as + crmuserName\, + activity.coacheeId as coacheeName\, activity.*\, + activity.activity_type as act_type\, + activity.activity_coachType as + coachType\, + activity_status_pl.val as act_status\, + activity.contactId + as contactName\, + contact.accountId as accountName\, + activity_event_type_pl.val as event_type_val\, + activity_coachType_pl.val as coachType_val\, + account.name as + accountName_val\, + userinfo.id as coacheeUserinfoName\, + auserinfo.id as + coachUserInfoName\, + contact.name as contactname_val + from activity + left + join activity_event_type_pl on activity.event_type = + activity_event_type_pl.id + left join activity_coachType_pl on + activity.activity_coachType = + activity_coachType_pl.id + left join activity_status_pl on activity.status = + activity_status_pl.id + left join contact on activity.contactId = + contact.id + left join crmuser as bcrmuser on bcrmuser.id = + activity.coacheeId + left join crmuser as ccrmuser on ccrmuser.id = + activity.crmuserId + left join user_position on + user_position.positionId=bcrmuser.id + left join user_position as + auser_position on auser_position.positionId=ccrmuser.id + left join userinfo on userinfo.id=user_position.userId + left join userinfo as auserinfo on auserinfo.id=auser_position.userId + left join account on contact.accountId = account.Id where + activity.event_type = 2 order by whenadded DESC) as aActivity + + select * from (select activity.crmuserId as crmuserName\, + activity.coacheeId as coacheeName\, + activity.*\,activity.activity_type as + act_type\,activity.activity_coachType as + coachType\,activity_status_pl.val as act_status\, activity.contactId + as + contactName\, contact.accountId as + accountName\, + activity_coachType_pl.val as coachType_val\,userinfo.id as + coacheeUserinfoName\,auserinfo.id as coachUserInfoName\,contact.name + as cn + from activity left join activitycrmuser on + activitycrmuser.activityId=activity.id + left join activity_coachType_pl on activity.activity_coachType = + activity_coachType_pl.id + left join activity_status_pl on + activity.status = + activity_status_pl.id + left join crmuser as bcrmuser on bcrmuser.id = activity.coacheeId + left join crmuser as ccrmuser on ccrmuser.id = activity.crmuserId + left join user_position on user_position.positionId=bcrmuser.id + left + join user_position as auser_position on + auser_position.positionId=ccrmuser.id + left join userinfo on userinfo.id=user_position.userId + left join userinfo as auserinfo on auserinfo.id=auser_position.userId + LEFT JOIN contact on + contact.id = activity.contactId where + activity.id=?) + as aCoaching + + + + id + ID + number + true + false + false + false + 0 + String + 关键信息 + + + + title + 活动名称 + false + text + String + false + true + true + true + 1 + true + 关键信息 + + + + coachType + 辅导类型 + false + text + false + false + true + false + 1 + true + activity_coachType_pl + picklist + 关键信息 + + + + coachType_val + 辅导类型 + false + number + false + false + false + false + true + 1 + true + picklist + 关键信息 + + + + crmuserId + 辅导人Id + text + false + false + true + false + false + 1 + true + true + auto + 关键信息 + + + crmuserName + 辅导人 + true + crmuserId + text + false + false + true + false + 1 + true + String + crmuser + true + 关键信息 + + + + coachUserInfoId + 辅导人用户ID + text + false + false + false + false + 1 + true + String + true + 关键信息 + + + + coachUserInfoName + 辅导人姓名 + true + coachUserInfoId + text + false + false + true + String + false + 1 + true + userinfo + true + 关键信息 + + + + coacheeId + 被辅导人Id + text + false + false + false + false + 1 + true + String + true + 关键信息 + + + coacheeName + 被辅导人 + true + coacheeId + text + false + false + true + true + 1 + true + String + crmuser + true + 关键信息 + + + + coacheeUserinfoId + 被辅导人用户ID + text + false + false + false + false + 1 + false + String + userinfo + true + 关键信息 + + + + coacheeUserinfoName + 被辅导人姓名 + true + coacheeUserinfoId + text + false + false + true + false + 1 + true + String + userinfo + true + 关键信息 + + + + starttime + 开始时间 + datetime-local + false + false + true + true + String + var + start_datetime + 1 + true + true + 关键信息 + + + endtime + 结束时间 + datetime-local + false + false + true + true + String + var + end_datetime + 1 + true + true + 关键信息 + + + + participants + 参与人/相关人员 + text + false + false + false + false + 1 + true + String + true + 关键信息 + + + + accountId + 医院 + true + accountId + text + false + false + true + true + 1 + true + String + account + var + account.id\,account.name + 关键信息 + + + + accountName_val + 医疗机构 + false + accountId + text + false + false + false + false + 1 + true + String + true + 关键信息 + + + + department + 科室 + true + text + false + false + true + true + val + 0 + 1 + true + picklist + contact_department_pl + 关键信息 + + + + feature_product + 主推产品 + text + false + false + true + true + productline + picklist + 2 + true + true + true + 基本信息 + + + status + 状态 + text + false + false + true + false + activity_status_pl + 1 + true + true + picklist + true + 关键信息 + + + act_status + 状态 + number + false + false + false + false + 3 + true + true + picklist + true + 附加信息 + + + owner + 创建人 + text + false + false + true + false + auto + 4 + true + 附加信息 + + + whenadded + 创建时间 + text + false + false + true + false + auto + 4 + true + 附加信息 + + + modifier + 修改人 + text + false + false + true + false + auto + 4 + true + 附加信息 + + + modify_datetime + 修改时间 + text + false + false + true + false + auto + 4 + true + 附加信息 + + + responsible_person + 负责人 + text + false + false + true + false + auto + 2 + true + 基本信息 + + + act_endtime + 活动结束时间 + text + false + false + true + false + 4 + true + String + 附加信息 + + + + + planing + 访前计划 + text + false + false + false + true + 5 + true + val + 0 + score1_pl + 1 + picklist + 评分信息 + + + + openling + 开始 + text + false + false + true + true + picklist + val + 0 + 5 + true + activity_score3_pl + 7 + 评分信息 + + + enquery_listening + 内容 + text + false + false + true + true + val + 0 + 5 + true + picklist + activity_score5_pl + 8 + 评分信息 + + + objection_handing + 异常处理 + text + false + false + false + true + val + 0 + 5 + true + picklist + score2_pl + 5 + 评分信息 + + + deliverable + 表现 + text + false + false + true + true + val + 0 + 5 + true + picklist + activity_score4_pl + 9 + 评分信息 + + + summary + 总结 + text + false + false + true + true + val + 0 + 5 + true + picklist + score1_pl + 10 + 评分信息 + + + total_score + 总分 + text + false + false + true + false + calculated + 5 + true + 评分信息 + + + + + + externalMeeting + 日历 + select * from (select *\,activity_type as act_type\,status as + act_status from externalMeeting where crmuserId=?) as aMeeting + + select * from (select *\,activity_type as act_type\,status + as act_status from externalMeeting where crmuserId=?) as aMeeting + + select * from (select *\,activity_type as act_type\,status as + act_status from externalMeeting where externalMeeting.id=?) as + aMeeting + + + + id + ID + number + true + false + false + false + 0 + String + 基本信息 + + + title + 标题 + text + false + true + true + true + String + 1 + true + 基本信息 + + + starttime + 开始时间 + datetime-local + com.rex.crm.common.TimestampFormatter + false + false + true + true + String + 1 + true + 基本信息 + + + endtime + 结束时间 + datetime-local + com.rex.crm.common.TimestampFormatter + false + false + true + true + String + 1 + true + 基本信息 + + + contactIds + 联系人 + text + false + false + true + true + String + 1 + true + 基本信息 + + + activity_type + 类型 + text + activity_types + false + false + true + true + picklist + 1 + true + 基本信息 + + + act_type + 拜访类型 + Integer + false + false + false + true + String + 1 + true + 基本信息 + + + status + 状态 + text + false + false + true + true + picklist + activity_status + 1 + true + 基本信息 + + + act_status + 状态 + Integer + false + false + false + true + String + 1 + true + 基本信息 + + + coachId + 教练 + text + false + false + true + true + String + 1 + true + 基本信息 + + + + + + + + + + + contactVisitingFrequency + 目标医生拜访频率 + + + + + + + num_of_activity + 活动数 + number + true + false + true + false + String + 0 + + + num_of_contact + 拥有医生数 + number + false + true + true + false + String + 1 + true + + + num_of_target_of_visiting_frequency + 拜访频率目标 + number + false + true + true + false + String + 1 + true + + + num_of_visiting_frequency + 拜访频率 + number + false + true + true + false + String + 1 + true + + + rate_of_achieving + 达标率 + text + false + true + true + false + String + 1 + true + + + + + + contactVisitingCoverRate + 目标医生拜访覆盖 + + + + + + + num_of_visited_contact + 被拜访的医生数 + number + true + false + true + false + String + 0 + + + num_of_contact + 拥有医生数 + number + false + true + true + false + String + 1 + true + + + metric_of_visiting_cover + 拜访覆盖率标准 + number + false + true + true + false + String + 1 + true + + + rate_of_visiting_cover + 拜访覆盖率 + number + false + true + true + false + 1 + true + + + rate_of_achieving + 达标率 + text + false + true + true + false + String + 1 + true + + + + + + workingday + 区域内工作天数 + + + + + + + metric_of_working_day + 区域内工作天数标准 + number + true + false + true + String + false + 0 + + + num_of_working_day + 实际工作天数 + number + false + true + true + false + String + 1 + true + + + rate_of_achieving + 达标率 + number + false + true + true + false + String + 1 + true + + + + + callreport + 活动报表 + select * from crmdb.call_export + select * from crmdb.call_export + select * from crmdb.call_export + + + + id + 活动Id + text + true + false + true + true + String + 1 + true + + + Activity_title + 活动标题 + text + false + false + true + true + String + 1 + true + + + whether_coach + 是否协防 + text + false + false + true + true + String + 1 + true + + + Activity_feature_product + 主推产品 + text + false + false + true + true + String + 1 + true + + + Activity_types + 活动类型 + text + false + false + true + true + String + 1 + true + + + Activity_addTime + 活动添加时间 + text + false + false + true + true + String + 1 + true + + + Activity_modifyTime + 活动修改时间 + text + false + false + true + true + String + 1 + true + + + + + + Activity_start + 活动开始时间 + text + false + false + true + true + String + 1 + true + + + Activity_end + 活动结束时间 + text + false + false + true + true + String + 1 + true + + + Position_name + 岗位名称 + text + false + false + true + true + String + 1 + true + + + Region_level_1 + 一级区域 + text + false + false + true + true + String + 1 + true + + + Region_level_2 + 二级区域 + text + false + false + true + true + String + 1 + true + + + position_code + 岗位代码 + text + false + false + true + String + true + 2 + true + + + position_role + 岗位 + text + false + false + true + true + String + 2 + true + + + Contact_name + 医生姓名 + text + false + false + true + true + String + 1 + true + + + Contact_grade + 医生分级 + text + false + false + true + true + String + 1 + true + + + Contact_department + 医生科室 + text + false + false + true + true + String + 1 + true + + + Contact_sex + 医生性别 + text + false + false + true + true + String + 1 + true + + + Contact_email + 医生邮箱 + text + false + false + true + true + String + 2 + true + + + Contact_duty + 医生职称 + text + false + false + true + true + String + 1 + true + + + Contact_job_title + 医生职位 + text + false + false + true + true + String + 1 + true + + + Account_name + 医院名称 + text + false + false + true + true + String + 1 + true + + + Account_BDMCode + 医院BDM编码 + text + false + false + true + true + String + 1 + true + + + Account_garde + 医院分级 + text + false + false + true + true + String + 1 + true + + + Account_type + 医院类型 + text + false + false + true + true + String + 1 + true + + + Account_administrative_level + 行政级别 + text + false + false + true + true + String + 1 + true + + + local_or_army + 地方/军队医院 + text + false + false + true + true + String + 2 + true + + + comprehensive_or_specialized + 综合/专科医院 + text + false + false + true + true + String + 1 + true + + + isKey + 重点医院 + text + false + false + true + true + String + 2 + true + + + Account_status + 状态 + text + false + false + true + true + String + 1 + true + + + + + visitingPerDayReport + 日均拜访量 + + + + + + + metric_of_visiting_per_day + 日均拜访量标准 + number + true + false + true + false + String + 0 + + + num_of_visiting_per_day + 实际日均拜访量 + number + false + true + true + false + String + 1 + true + + + rate_of_achieving + 达标率 + number + false + true + true + false + String + 1 + true + + + + + upLoad + 上传 + + + + + + + upLoadAccount + 上传医生 + radio + String + 1 + true + + + upLoadContact + 上传医生 + radio + String + 1 + true + + + upLoadCoaching + 上传岗位 + radio + String + 1 + true + + + upLoadCoaching + 上传 + radio + String + 1 + true + + + upLoadAcvitity + 上传辅导 + radio + String + 1 + true + + + upLoadCoaching + 上传拜访 + radio + String + 1 + true + + + + + downLoad + 下载 + + + + + + + downLoadAccount + 下载医院 + radio + String + 1 + true + + + downLoadContact + 下载医生 + radio + String + 1 + true + + + downLoadCoaching + 下载岗位 + radio + String + 1 + true + + + downLoadCoaching + 下载 + radio + String + 1 + true + + + downLoadAcvitity + 下载辅导 + radio + String + 1 + true + + + downLoadCoaching + 下载拜访 + radio + String + 1 + true + + + + + alert + 信息发布 + priority + + SELECT * from (select alert.* from alert where (towhom = 3 or + towhom = 4) + and expired > now() and now() > publishDate + and (alertRegion = ? or alertRegion = 7) + ORDER BY whenadded DESC) as + aAlert + + + SELECT * from (select * from alert where + (towhom = 2 or towhom = 4) and expired > now() + and now() > publishDate + and (alertRegion = ? or alertRegion = 7) + ORDER BY whenadded DESC) as aAlert + + + SELECT * from (SELECT * from alert ORDER BY whenadded DESC) + alert + + + SELECT * from (select alert.* from alert where alert.id = ? + ORDER BY whenadded DESC) as aAlert + + + + id + ID + number + true + false + false + false + String + 0 + true + 关键信息 + + + + name + 标题 + true + text + String + false + true + true + true + true + 1 + true + 关键信息 + + + + publishDate + 公布日期 + datetime-local + false + false + true + true + String + var + start_datetime + 1 + true + 关键信息 + + + expired + 截止日期 + String + datetime-local + false + false + true + true + var + end_datetime + 1 + true + 关键信息 + + + + priority + 优先级 + text + false + false + true + true + String + 1 + true + alert_priority_pl + 关键信息 + + + + alertRegion + 公布大区 + text + false + false + true + true + picklist + alert_region_pl + 0 + true + false + 关键信息 + + + + towhom + 公布对象 + text + false + false + true + true + picklist + alert_publicObject_pl + 0 + true + false + 关键信息 + + + + description + 预警说明 + true + bjgtextarea + false + true + true + true + String + 2 + true + 基本信息 + + + + owner + 创建人 + text + false + false + true + false + auto + 4 + true + 附加信息 + + + whenadded + 创建时间 + text + false + false + true + false + auto + 4 + true + 附加信息 + + + modifier + 修改人 + text + false + false + true + false + auto + 4 + true + 附加信息 + + + modify_datetime + 修改时间 + text + false + false + true + false + auto + 4 + true + 附加信息 + + + + + alertattachment + 预警附件 + SELECT * FROM alertAttachment + SELECT * FROM alertAttachment + SELECT * FROM alertAttachment where alertAttachment.id = ? + + + + + id + 附件Id + text + true + false + false + false + String + 1 + true + 关键信息 + + + fileName + 附件文件 + file + false + true + true + true + String + 1 + true + 关键信息 + + + srcForFile + 附件文件路径 + text + false + true + false + true + auto + 1 + true + 关键信息 + + + alertId + 预警标题 + alertId + text + false + false + true + true + String + 1 + true + alert + var + alert.id\,alert.name + 关键信息 + + + owner + 上传人 + false + text + false + false + true + auto + false + 1 + true + 关键信息 + + + whenadded + 上传时间 + false + text + false + false + auto + true + false + 1 + true + 关键信息 + + + modifier + 修改人 + text + false + false + true + false + auto + 4 + true + 附加信息 + + + modify_datetime + 修改时间 + text + false + false + true + false + auto + 4 + true + 附加信息 + + + + + todolist + 待进行活动 + SELECT * FROM crmdb.activity_alert + SELECT * FROM crmdb.activity_alert + SELECT * FROM crmdb.activity_alert + + + + id + 活动Id + text + true + false + false + false + String + 1 + true + + + title + 活动标题 + text + false + true + true + false + String + 1 + true + + + time + 时间 + text + false + false + true + false + String + 1 + true + + + starttime + 开始时间 + text + false + false + true + false + String + 1 + true + + + endtime + 结束时间 + text + false + false + false + false + String + 1 + true + + + contact + 医生 + text + false + false + true + false + String + contact + 1 + true + + + purpose + 目标 + text + false + false + true + false + String + 1 + true + + + addtime + 添加时间 + text + false + false + true + false + String + 1 + true + + + product + 主推产品 + text + false + false + true + false + String + 1 + true + + + + + + todolistcoach + 待进行辅导 + SELECT * FROM crmdb.activity_alert + SELECT * FROM crmdb.activity_alert + SELECT * FROM crmdb.activity_alert + + + + id + 活动Id + text + true + false + false + false + String + 1 + true + + + title + 活动标题 + text + false + true + true + false + String + 1 + true + + + time + 时间 + text + false + false + true + false + String + 1 + true + + + starttime + 开始时间 + text + false + false + true + false + String + 1 + true + + + endtime + 结束时间 + text + false + false + false + false + String + 1 + true + + + contact + 医生 + text + false + false + false + false + String + 1 + true + + + purpose + 目标 + text + false + false + false + false + String + 1 + true + + + addtime + 添加时间 + text + false + false + true + false + String + 1 + true + + + product + 主推产品 + text + false + false + true + false + String + 1 + true + + + coachtype + 辅导类型 + text + false + false + true + false + String + 1 + true + + + + + + user_position_account + 活动报表 + select * from crmdb.user_position_account + select * from crmdb.user_position_account + select * from crmdb.user_position_account + + + + id + Id + text + true + false + true + true + String + 1 + true + + + userName + 代表姓名 + text + false + false + true + true + 1 + String + true + + + loginName + 登录名 + text + false + false + true + true + String + 2 + true + + + email + 邮箱 + text + false + false + true + true + String + 2 + true + + + sex + 性别 + text + false + false + true + true + String + 1 + true + + + addTime + 添加时间 + text + false + false + true + true + String + 1 + true + + + positionName + 岗位名称 + text + false + false + false + true + String + 1 + true + + + positionCode + MR + text + false + false + true + true + String + 1 + true + + + reportTo + DSM + text + false + false + false + true + String + 1 + true + + + DSMName + DSM_Name + text + false + false + true + true + String + 1 + true + + + reporttto + RSM + text + false + false + false + true + String + 1 + true + + + RSMName + RSM_Name + text + false + false + true + true + String + 1 + true + + + role + 角色 + text + false + false + true + true + String + 1 + true + + + city + 城市 + text + false + false + true + true + String + 1 + true + + + regoin2 + 二级区域 + text + false + false + true + true + String + 1 + true + + + regoin1 + 一级区域 + text + false + false + true + true + String + 1 + true + + + accountName + 医院名 + text + false + false + true + true + String + 1 + true + + + BDMCode + BDM编码 + text + false + false + false + true + String + 1 + true + + + accountLevel + 医院级别 + text + false + false + false + true + String + 1 + true + + + status + 状态 + text + false + false + true + true + 1 + String + true + + + + + importLog + 导入日志 + select * from importMetaInfo order by whenadded DESC + select * from importMetaInfo order by whenadded DESC + + select * from importMetaInfo order by whenadded DESC + + + + id + Id + text + true + false + true + true + String + 2 + true + + + entity_name + 导入模块名 + text + false + false + true + true + String + true + 1 + true + + + importfilename + 导入文件名 + downloadlink + false + false + true + true + String + true + 1 + true + + + logfilename + 日志文件 + downloadlink + false + false + true + true + String + 1 + true + + + whenadded + 上传时间 + false + text + false + false + auto + true + false + String + 1 + true + 附加信息 + + + modify_datetime + 修改时间 + false + text + false + false + auto + false + false + 2 + true + 附加信息 + + + num_of_total_record + 处理行数 + text + false + false + true + true + String + 1 + true + + + num_of_imported + 成功导入数 + text + false + false + true + true + String + 1 + true + + + num_of_updated + 成功更新数 + text + false + false + true + String + true + 1 + true + + + num_of_failed + 失败导入数 + text + String + false + false + true + true + 1 + true + + + status + 状态 + text + false + false + true + picklist + true + true + importStatus + 1 + true + + + result + 结果 + text + false + false + true + true + true + picklist + importResult + 1 + true + + + modifier + 创建人 + false + text + false + false + auto + true + false + 4 + true + 附加信息 + + + + + regionManage + 省市设置 + select * from crmuser + + + id + Id + true + text + false + false + false + String + 0 + true + 关键信息 + + + area + 中国区 + false + text + false + true + false + 1 + String + true + 关键信息 + + + region + 大区 + false + text + false + true + false + 1 + String + true + 关键信息 + + + province + 省份 + false + text + false + true + false + 1 + String + true + 关键信息 + + + BDMcode + BDM编码 + false + text + false + true + false + 1 + String + true + 关键信息 + + + accountName + 医院名称 + false + text + false + true + false + 1 + true + account + String + 关键信息 + + + regionManager + 地区经理 + false + text + false + true + false + String + 1 + true + 关键信息 + + + managerPosition + 经理岗位 + false + text + false + true + false + String + 1 + true + 关键信息 + + + delegateName + 代表名称 + false + text + false + true + false + String + 1 + true + 关键信息 + + + delegatePosition + 代表岗位 + false + text + false + true + false + String + 1 + true + 关键信息 + + + productLine + 产品线 + false + text + false + true + false + String + 1 + true + 关键信息 + + + + + data_audit + 修改历史 + select * from data_audit + + + id + Id + true + text + false + false + false + String + 0 + true + 关键信息 + + + entity_name + 表名 + false + text + String + false + true + false + 2 + true + 关键信息 + + + record_id + 修改位置 + false + text + String + false + true + false + 2 + true + 关键信息 + + + column_name + 修改字段名 + false + text + String + false + true + false + 1 + true + 关键信息 + + + old_value + 改前值 + String + false + text + false + true + false + 1 + true + 关键信息 + + + new_value + 改后值 + false + text + String + false + true + false + 1 + true + 关键信息 + + + modifier + 修改人 + false + text + false + true + false + 1 + true + String + 关键信息 + + + modify_time + 修改时间 + false + text + false + true + false + 1 + String + true + 关键信息 + + + + + province + 省市设置 + + SELECT * FROM province + select * from province + select * from province where id = ? + + + id + ID + text + true + false + true + false + 0 + 关键信息 + String + true + + + val + true + 省份名称 + text + false + true + true + true + 1 + true + 关键信息 + String + true + + + externalId + true + 邮编 + text + false + false + true + true + true + 1 + true + String + 关键信息 + + + + + city + 区域管理 + + SELECT * FROM city + select * from city + select * from city where id = ? + + + id + ID + text + true + false + true + false + 0 + String + 关键信息 + + + val + true + 城市名称 + text + false + true + true + true + 1 + true + String + 关键信息 + + + externalId + true + 邮编 + text + false + false + true + true + 1 + true + String + 关键信息 + + + + parentId + 所属省份 + true + text + false + false + true + true + 1 + true + province + var + String + province.id\,province.val + 关键信息 + + + + + accountcrmuser_relation_history + 岗位与医院关系历史 + select * from accountcrmuser_relation_history + + + id + Id + true + text + false + false + false + String + 0 + true + 关键信息 + + + position_id + 岗位编码 + false + text + String + false + true + false + 1 + true + 关键信息 + + + account_id + 医院名称 + false + text + String + false + true + false + 1 + true + 关键信息 + + + modifier + 修改人 + false + text + false + true + false + 1 + true + String + 关键信息 + + + modify_time + 修改时间 + false + text + false + true + false + 1 + String + true + 关键信息 + + + + + userposition_relation_history + 岗位与用户关系历史 + select * from userposition_relation_history + + + id + Id + true + text + false + false + false + String + 0 + true + 关键信息 + + + position_id + 岗位编码 + false + text + String + false + true + false + 1 + true + 关键信息 + + + user_id + 用户名称 + false + text + String + false + true + false + 1 + true + 关键信息 + + + modifier + 修改人 + false + text + false + true + false + 1 + true + String + 关键信息 + + + modify_time + 修改时间 + false + text + false + true + false + 1 + String + true + 关键信息 + + + + + user_position_query + 区域管理 + + + id + ID + text + true + false + false + false + 0 + 关键信息 + true + + + user_id + 用户ID + false + text + String + false + false + false + 1 + true + 关键信息 + + + position_id + 岗位编码 + false + text + String + false + false + false + 1 + true + 关键信息 + + + area + 中国区 + false + text + String + false + true + false + 1 + true + 关键信息 + + + region + 大区 + false + text + String + false + true + false + 1 + true + 关键信息 + + + province + 省份 + false + text + String + false + true + false + 1 + true + 关键信息 + + + productLine + 产品线 + false + text + String + false + true + false + 1 + true + 关键信息 + + + accountName + 医院名 + false + text + String + false + true + false + account + 1 + true + 关键信息 + + + BDMcode + 医院BDM + false + text + String + false + true + false + 1 + true + 关键信息 + + + + position_level + 岗位级别 + false + text + String + false + false + false + 1 + true + 关键信息 + + + position_name + 岗位名称 + false + text + String + false + false + false + 1 + true + 关键信息 + + + position_code + 岗位编码 + false + text + String + false + true + false + 1 + true + 关键信息 + + + delegatePosition + 代表岗位 + false + text + String + false + false + false + 1 + true + 关键信息 + + + delegateName + 代表姓名 + false + text + String + false + true + false + 1 + true + 关键信息 + + + manager_position_id + 经理岗位Id + false + text + String + false + false + false + 1 + true + 关键信息 + + + managerPosition + 经理岗位 + false + text + String + false + true + false + 1 + true + 关键信息 + + + manager_position_name + 经理岗位名称 + false + text + String + false + false + false + 1 + true + 关键信息 + + + manager_position_level + 经理岗位级别 + false + text + String + false + false + false + 1 + true + 关键信息 + + + manager_employee_number + 经理 + false + text + String + false + false + false + 1 + true + 关键信息 + + + regionManager + 上级经理 + false + text + String + false + true + false + 1 + true + 关键信息 + + + + diff --git a/crm/src/main/resources/log4j.properties b/crm/src/main/resources/log4j.properties new file mode 100644 index 0000000..18212b3 --- /dev/null +++ b/crm/src/main/resources/log4j.properties @@ -0,0 +1,22 @@ +log4j.appender.Stdout=org.apache.log4j.ConsoleAppender +log4j.appender.Stdout.layout=org.apache.log4j.PatternLayout +#log4j.appender.Stdout.layout.conversionPattern=%l %-5p - %-26.26c{1} - %m\n +log4j.appender.Stdout.layout.conversionPattern=%5p\t[%d] [%t] (%F:%L)\n \t%m%n\n + +log4j.appender.RollingAppender=org.apache.log4j.DailyRollingFileAppender +log4j.appender.RollingAppender.File=/var/log/crm/crm.log +#log4j.appender.file.File=${catalina.base}/logs/crm.log +log4j.appender.RollingAppender.DatePattern='.'yyyy-MM-dd +log4j.appender.RollingAppender.layout=org.apache.log4j.PatternLayout +log4j.appender.rollingFile.layout.ConversionPattern=%p %t %c - %m%n + +log4j.rootLogger=DEBUG,Stdout,RollingAppender + +log4j.logger.org.apache.wicket=INFO +log4j.logger.org.apache.wicket.protocol.http.HttpSessionStore=INFO +log4j.logger.org.apache.wicket.version=INFO +log4j.logger.org.apache.wicket.RequestCycle=INFO + +log4j.logger.com.rex.crm.db.DBHelper=INFO + + diff --git a/crm/src/main/resources/provinces.properties b/crm/src/main/resources/provinces.properties new file mode 100644 index 0000000..f3690ab --- /dev/null +++ b/crm/src/main/resources/provinces.properties @@ -0,0 +1,2 @@ +province=\u5317\u4EAC +province.\u5317\u4EAC= diff --git a/crm/src/main/resources/relations.xml b/crm/src/main/resources/relations.xml new file mode 100644 index 0000000..e0f236e --- /dev/null +++ b/crm/src/main/resources/relations.xml @@ -0,0 +1,273 @@ + + + + + account + contactlistOfaccount + 医生列表 + select a.* from contact as a where a.accountId=? + contact + accountId + + + + + + + + + + + + + + + + + + + + crmuser + crmuser2activity + 拜访 + + select * from (select activity.*\,activity.activity_type as + act_type\,activity.status as act_status\, activity.contactId as + contactName\, contact.accountId as accountName\,activity_event_type_pl.val as event_type_val\,account.name as accountName_val\, + contact.name as contactname_val + from activity\,contact\,activitycrmuser\,activity_event_type_pl\,account + where contact.id= activity.contactId AND activitycrmuser.activityId=activity.id AND activitycrmuser.crmuserId=? AND + activity_event_type_pl.id=event_type AND account.id=contact.accountId) as + aActivity + + activity + + + crmuser + accountcrmuserrelationhistory + 岗位与医院关系历史信息 + select * from (select a.id \,a.modify_time \,a.modifier \,account.name as account_id \,crmuser.name as position_id from accountcrmuser_relation_history as a left join account on account.id = a.account_id left join crmuser on crmuser.id = a.position_id where crmuser.id = ? ) as act + accountcrmuser_relation_history + + + account + accountcrmuserrelationhistory + 岗位与医院关系历史信息 + select * from (select a.id \,a.modify_time \,a.modifier \,account.name as account_id \,crmuser.name as position_id from accountcrmuser_relation_history as a left join account on account.id = a.account_id left join crmuser on crmuser.id = a.position_id where account.id = ? ) as act + accountcrmuser_relation_history + + + crmuser + userposition_relation_history + 岗位与用户关系历史信息 + select * from (select a.id \,a.modify_time \,a.modifier \,userinfo.name as user_id \,crmuser.name as position_id from userposition_relation_history as a left join userinfo on userinfo.id = a.user_id left join crmuser on crmuser.id = a.position_id where crmuser.id = ? ) as act + userposition_relation_history + + + userinfo + userposition_relation_history + 岗位与用户关系历史信息 + select * from (select a.id \,a.modify_time \,a.modifier \,userinfo.name as user_id \,crmuser.name as position_id from userposition_relation_history as a left join userinfo on userinfo.id = a.user_id left join crmuser on crmuser.id = a.position_id where userinfo.id = ? ) as act + userposition_relation_history + + + contact + accountInfoOfContact + 医院信息 + select * from (select account.* from contact\,account where contact.id=? AND account.id=contact.accountId) as act + account + + + + contact + contataudit + 医生修改记录 + select * from (select * from data_audit where entity_name = "contact" and record_id = ? order by modify_time desc) as act + data_audit + + + activity + activityaudit + 活动修改记录 + select * from (select * from data_audit where entity_name = "activity" and record_id = ? order by modify_time desc) as act + data_audit + + + + coaching + coachingaudit + 活动修改记录 + select * from (select * from data_audit where entity_name = "activity" and record_id = ? order by modify_time desc) as act + data_audit + + + willcoaching + willcoachingaudit + 活动修改记录 + select * from (select * from data_audit where entity_name = "activity" and record_id = ? order by modify_time desc) as act + data_audit + + + account + accountaudit + 医院修改记录 + select * from (select * from data_audit where entity_name = "account" and record_id = ? order by modify_time desc) as act + data_audit + + + + userinfo + userinfoaudit + 用户修改记录 + select * from (select * from data_audit where entity_name = "userinfo" and record_id = ? order by modify_time desc) as act + data_audit + + + + crmuser + crmuseraudit + 岗位修改记录 + select * from (select * from data_audit where entity_name = "crmuser" and record_id = ? order by modify_time desc) as act + data_audit + + + + productline + productlineaudit + 产品线修改记录 + select * from (select * from data_audit where entity_name = "productline" and record_id = ? order by modify_time desc) as act + data_audit + + + + product + productaudit + 产品修改记录 + select * from (select * from data_audit where entity_name = "product" and record_id = ? order by modify_time desc) as act + data_audit + + + + productcategory + productcategoryaudit + 产品修改记录 + select * from (select * from data_audit where entity_name = "productcategory" and record_id = ? order by modify_time desc) as act + data_audit + + + contact + visitingOfContact + 拜访 + + select * from (select * from (select activity.*\, + activity.activity_type as act_type\, + activity.status as act_status\, + activity.contactId as contactName\, + contact.accountId as accountName\, + activity_event_type_pl.val as event_type_val\, + account.name as accountName_val\, + contact.grade as contactgrade\, + contact.name as contactname_val + from activity + left join activity_event_type_pl on activity.event_type = + activity_event_type_pl.id + left join contact on activity.contactId = contact.id + left join account on contact.accountId = account.Id + left join activitycrmuser on activity.id = activitycrmuser.activityId + where activity.contactId = ? and activity.crmuserId = ?) as aactivity where event_type = + 1 order by whenadded DESC) as aActivity + + + select * from (select * from (select activity.*\, + activity.activity_type as act_type\, + activity.status as act_status\, + activity.contactId as contactName\, + contact.accountId as accountName\, + activity_event_type_pl.val as event_type_val\, + account.name as accountName_val\, + contact.grade as contactgrade\, + contact.name as contactname_val + from activity + left join activity_event_type_pl on activity.event_type = + activity_event_type_pl.id + left join contact on activity.contactId = contact.id + left join account on contact.accountId = account.Id + left join activitycrmuser on activity.id = activitycrmuser.activityId + where activity.contactId = ?) as aactivity where event_type = + 1 order by whenadded DESC) as aActivity + + + select * from (select * from (select activity.*\, + activity.activity_type as act_type\, + activity.status as act_status\, + activity.contactId as contactName\, + contact.accountId as accountName\, + activity_event_type_pl.val as event_type_val\, + account.name as accountName_val\, + contact.grade as contactgrade\, + contact.name as contactname_val + from activity + left join activity_event_type_pl on activity.event_type = + activity_event_type_pl.id + left join contact on activity.contactId = contact.id + left join account on contact.accountId = account.Id + left join activitycrmuser on activity.id = activitycrmuser.activityId + left join crmuser on crmuser.id = activity.crmuserId + where activity.contactId = ? and crmuser.reportto = ?) as aactivity where event_type = + 1 order by whenadded DESC) as aActivity + + activity + + + + + + productline + productBasic + 产品列表 + + select * from product where productlineid=? + product + + + productline + productSpecification + 规格列表 + select * from productcategory where productlineid=? + productcategory + + + product + productSpecification + 规格列表 + select * from productcategory where productid=? + productcategory + + + province + provincecity + 城市列表 + select * from city where parentId=? + city + + + + alert + alert_attachment + 附件 + select * from alertAttachment where alertId = ? + alertattachment + + + \ No newline at end of file diff --git a/crm/src/main/resources/templates/account.csv b/crm/src/main/resources/templates/account.csv new file mode 100644 index 0000000..f408d14 --- /dev/null +++ b/crm/src/main/resources/templates/account.csv @@ -0,0 +1 @@ +BDM,׼ҽԺ,ʡ,,,,ҽԺ,طҽԺ,ۺרҽԺ,صҽԺ,״̬,ҽԺּ,г 10071,ѪܲרҽԺ,,,,,ŵĿҽԺ,طҽԺ,ۺҽԺ,ŵصҽԺ,Ч,,սԳ 11139,йһͻְҽԺ,,,ϳ,δ,ĿҽԺ,ҽԺ,רҽԺ,صҽԺ,Ч,,һ 1114,дȾҽԺ,,,,,ʹĿҽԺ,ҽԺ,ۺҽԺ,ŵصҽԺ,Ч,, \ No newline at end of file diff --git a/crm/src/main/resources/templates/accountcrmuser.csv b/crm/src/main/resources/templates/accountcrmuser.csv new file mode 100644 index 0000000..babebdb --- /dev/null +++ b/crm/src/main/resources/templates/accountcrmuser.csv @@ -0,0 +1 @@ +BDM,λ,ExternalId 16940,SH131011001,16940SH131011001 16879,SH131011001,16879SH131011001 16836,SH131011001,16836SH131011001 \ No newline at end of file diff --git a/crm/src/main/resources/templates/contact.csv b/crm/src/main/resources/templates/contact.csv new file mode 100644 index 0000000..2a6d48c --- /dev/null +++ b/crm/src/main/resources/templates/contact.csv @@ -0,0 +1 @@ +,ҽּ,¾,ʹ̨,ְ,ְ,Ա,ֻ,BDM,״̬,CRMҽ,ο, ƽ,A,80,80,סԺҽʦ,,,13888888888,20540,Ч,D0000001,, лȻ,A,20,20,ҽʦ,,Ů,13777777777,20540,Ч,D0000002,, ,A,20,20,ҽʦ,ɹ,,13555555555,20151,Ч,D0000003,, \ No newline at end of file diff --git a/crm/src/main/resources/templates/crmuser.csv b/crm/src/main/resources/templates/crmuser.csv new file mode 100644 index 0000000..67aa780 --- /dev/null +++ b/crm/src/main/resources/templates/crmuser.csv @@ -0,0 +1 @@ +λ,λ,ϼλ,ɫ,״̬,Ʒ,һ,,, BJ131011001,BJ131011001,BJ131021001,۴,Ч,ŵ,ŵһ,ŵһ,Ϻ,11 BJ131011002,BJ131011002,BJ131021001,۴,Ч,ŵ,ŵһ,ŵһ,Ϻ,11 BJ131011003,BJ131011003,BJ131021001,۴,Ч,ŵ,ŵһ,ŵһ,Ϻ,11 \ No newline at end of file diff --git a/crm/src/main/resources/templates/crmuser_reportto.csv b/crm/src/main/resources/templates/crmuser_reportto.csv new file mode 100644 index 0000000..0cff48d --- /dev/null +++ b/crm/src/main/resources/templates/crmuser_reportto.csv @@ -0,0 +1 @@ +λ,λ,ϼλ,ɫ,״̬,Ʒ,,һ,, E1131031001,E1131031001,,,Ч,ŵ,31,й,,ŵһ һ01,SH131021001,E1131031001,,Ч,ŵ,21,й,Ϻ,ŵһ һ001,SH131011001,SH131021001,۴,Ч,ŵ,11,й,Ϻ,ŵһ \ No newline at end of file diff --git a/crm/src/main/resources/templates/user_position.csv b/crm/src/main/resources/templates/user_position.csv new file mode 100644 index 0000000..99a8756 --- /dev/null +++ b/crm/src/main/resources/templates/user_position.csv @@ -0,0 +1 @@ +PositionExternalId,EmployeeNumber,ExternalId,Ƿ E1131031001,101SH218,E1131031001101SH218, NT131031001,101BJ144,NT131031001101BJ144, NE131031001,101LN098,NE131031001101LN098, \ No newline at end of file diff --git a/crm/src/main/resources/templates/userinfo.csv b/crm/src/main/resources/templates/userinfo.csv new file mode 100644 index 0000000..edb49d8 --- /dev/null +++ b/crm/src/main/resources/templates/userinfo.csv @@ -0,0 +1 @@ +,email,employeeNumber,¼,Password,û״̬,Ƿ񼤻 ʢ,sample@mail.com,101SH218,101SH218,12345,Ч,Ѽ ,sample@mail.com,101BJ144,101BJ144,12345,Ч,Ѽ ,sample@qq.com,101LN098,101LN098,12345,Ч,Ѽ \ No newline at end of file diff --git a/crm/src/main/resources/tooltipMessage.properties b/crm/src/main/resources/tooltipMessage.properties new file mode 100644 index 0000000..04218f3 --- /dev/null +++ b/crm/src/main/resources/tooltipMessage.properties @@ -0,0 +1,10 @@ +1=

1.访前市场信息收集;
2.根据前次访后分析设定拜访目标;
3.拜访各步骤的设想/准备;
4.准备拜访所需的文献/资料;
5.确定合适病人,就特定病患进行访前计划(SPF)
+2=
1.开场基本要素/技巧;
2.从合适患者谈起,用病人/病情等话题引发医生兴趣(SPF)
+3=
1.合理运用探询,聆听-寻找客户需求;
2.寻找合适患者的特征(SPF)
3.寻找医生对合适患者的治疗期望(SPF)
+4=
1.根据客户特点和需求传递产品疗效/附加信息;
2.运用利益销售传递关键产品信息(FAB);
3.有效地,适时地应用推广资料/文献/工具/医学信息;
4.针对合适的患者进行产品疗效和附加信息的讨论以满足治疗期望(SPF)
+5=
1.有效地运用DA及文献,确认消除顾虑;
2.用提及的方案,方法解决医生对病患存在的顾虑与问题(SPF)
+6=
1.在一定时限内就合适的病人取得可衡量的处方;
2.根据合适的病人给予处方建议并跟踪结果(SPF)
+7=
1.吸引注意、引发兴趣(6)
1).介绍举办科室会的原因.
2)原因能针对客户的需求
3)概述引导(借助有趣话题)
2.自我简介(4)
1)公司名称
2)姓名
3)所负责产品
+8=
1.产品知识熟练(20)
1)产品知识正确.
2)产品知识熟练
2.主题简明/ 内容完整、有逻辑(5)
1)围绕主题演讲
2)内容完整
3.讲解简明/衔接顺畅(5)
1)语言简洁
2)有过渡语言
4.关注效益F-A-B(15)
1.有3次的FAB转换(5分/次)
6.时间控制(5)
1.15分钟
+9=
1.语音/语调/语速/口头语(5)
1)语音声音洪亮、语言清楚
2)语调有变化
3)语速适中
4)无口头语
2.语气/停顿(2)
1)语气自然
2)有停顿
3.站位/姿势/肢体语言/感染力(8)
1)站位合理
2)姿势自然
3)借助肢体语言
4)表现正向积极
4.无多余动作(2)
1)无小动作(2次扣1分)
5.与观众有目光交流(5)
1)与观众有多次目光交流
6.器材(1)
1)合理应用激光笔、幻灯机等
7.仪表(2)
1)外表整洁
2)着装专业
+10=
1.总结/突出主题/反馈(5)
1)总结性语言
2)强调主题
3)要求听众反馈
2.提出要求或建议(10)
1)有缔结的问句
2)具体的处方或行动建议
\ No newline at end of file diff --git a/crm/src/main/resources/types.xml b/crm/src/main/resources/types.xml new file mode 100644 index 0000000..9d7018a --- /dev/null +++ b/crm/src/main/resources/types.xml @@ -0,0 +1,10 @@ + + + + + cityList + 团队关系 + city + + + \ No newline at end of file diff --git a/crm/src/main/resources/userInfoVM.html b/crm/src/main/resources/userInfoVM.html new file mode 100644 index 0000000..d038cd0 --- /dev/null +++ b/crm/src/main/resources/userInfoVM.html @@ -0,0 +1,18 @@ + + + + + + + +
+ +
+
    +
  • 姓名:$data.name
  • +
  • 电话:$data.cellPhone
  • +
  • 部门:$data.division
  • +
  • 邮箱:$data.email
  • +
  • 职务:$data.jobTitle
  • +
+
\ No newline at end of file diff --git a/crm/src/main/resources/velocity.properties b/crm/src/main/resources/velocity.properties new file mode 100644 index 0000000..ea68f7f --- /dev/null +++ b/crm/src/main/resources/velocity.properties @@ -0,0 +1,28 @@ +# +# specify three resource loaders to use +# +resource.loader = class + +# +# for the loader we call 'file', set the FileResourceLoader as the +# class to use, turn off caching, and use 3 directories for templates +# +#file.resource.loader.description = Velocity File Resource Loader +#file.resource.loader.class = org.apache.velocity.runtime.resource.loader.FileResourceLoader +#file.resource.loader.path = /var/crm-admin/ +#file.resource.loader.cache = false +#file.resource.loader.modificationCheckInterval = 0 + +## +## for the loader we call 'class', use the ClasspathResourceLoader +## +class.resource.loader.description = Velocity Classpath Resource Loader +class.resource.loader.class = org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader +# +## +## and finally, for the loader we call 'jar', use the JarResourceLoader +## and specify two jars to load from +## +#jar.resource.loader.description = Velocity Jar Resource Loader +#jar.resource.loader.class = org.apache.velocity.runtime.resource.loader.JarResourceLoader +#jar.resource.loader.path = jar:file:/myjarplace/myjar.jar, jar:file:/myjarplace/myjar2.jar \ No newline at end of file diff --git a/crm/src/main/webapp/Chart/.gitignore b/crm/src/main/webapp/Chart/.gitignore new file mode 100644 index 0000000..9bea433 --- /dev/null +++ b/crm/src/main/webapp/Chart/.gitignore @@ -0,0 +1,2 @@ + +.DS_Store diff --git a/crm/src/main/webapp/Chart/Chart.js b/crm/src/main/webapp/Chart/Chart.js new file mode 100644 index 0000000..ffbe16f --- /dev/null +++ b/crm/src/main/webapp/Chart/Chart.js @@ -0,0 +1,1426 @@ +/*! + * Chart.js + * http://chartjs.org/ + * + * Copyright 2013 Nick Downie + * Released under the MIT license + * https://github.com/nnnick/Chart.js/blob/master/LICENSE.md + */ + +//Define the global Chart Variable as a class. +window.Chart = function(context){ + + var chart = this; + + + //Easing functions adapted from Robert Penner's easing equations + //http://www.robertpenner.com/easing/ + + var animationOptions = { + linear : function (t){ + return t; + }, + easeInQuad: function (t) { + return t*t; + }, + easeOutQuad: function (t) { + return -1 *t*(t-2); + }, + easeInOutQuad: function (t) { + if ((t/=1/2) < 1) return 1/2*t*t; + return -1/2 * ((--t)*(t-2) - 1); + }, + easeInCubic: function (t) { + return t*t*t; + }, + easeOutCubic: function (t) { + return 1*((t=t/1-1)*t*t + 1); + }, + easeInOutCubic: function (t) { + if ((t/=1/2) < 1) return 1/2*t*t*t; + return 1/2*((t-=2)*t*t + 2); + }, + easeInQuart: function (t) { + return t*t*t*t; + }, + easeOutQuart: function (t) { + return -1 * ((t=t/1-1)*t*t*t - 1); + }, + easeInOutQuart: function (t) { + if ((t/=1/2) < 1) return 1/2*t*t*t*t; + return -1/2 * ((t-=2)*t*t*t - 2); + }, + easeInQuint: function (t) { + return 1*(t/=1)*t*t*t*t; + }, + easeOutQuint: function (t) { + return 1*((t=t/1-1)*t*t*t*t + 1); + }, + easeInOutQuint: function (t) { + if ((t/=1/2) < 1) return 1/2*t*t*t*t*t; + return 1/2*((t-=2)*t*t*t*t + 2); + }, + easeInSine: function (t) { + return -1 * Math.cos(t/1 * (Math.PI/2)) + 1; + }, + easeOutSine: function (t) { + return 1 * Math.sin(t/1 * (Math.PI/2)); + }, + easeInOutSine: function (t) { + return -1/2 * (Math.cos(Math.PI*t/1) - 1); + }, + easeInExpo: function (t) { + return (t==0) ? 1 : 1 * Math.pow(2, 10 * (t/1 - 1)); + }, + easeOutExpo: function (t) { + return (t==1) ? 1 : 1 * (-Math.pow(2, -10 * t/1) + 1); + }, + easeInOutExpo: function (t) { + if (t==0) return 0; + if (t==1) return 1; + if ((t/=1/2) < 1) return 1/2 * Math.pow(2, 10 * (t - 1)); + return 1/2 * (-Math.pow(2, -10 * --t) + 2); + }, + easeInCirc: function (t) { + if (t>=1) return t; + return -1 * (Math.sqrt(1 - (t/=1)*t) - 1); + }, + easeOutCirc: function (t) { + return 1 * Math.sqrt(1 - (t=t/1-1)*t); + }, + easeInOutCirc: function (t) { + if ((t/=1/2) < 1) return -1/2 * (Math.sqrt(1 - t*t) - 1); + return 1/2 * (Math.sqrt(1 - (t-=2)*t) + 1); + }, + easeInElastic: function (t) { + var s=1.70158;var p=0;var a=1; + if (t==0) return 0; if ((t/=1)==1) return 1; if (!p) p=1*.3; + if (a < Math.abs(1)) { a=1; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (1/a); + return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*1-s)*(2*Math.PI)/p )); + }, + easeOutElastic: function (t) { + var s=1.70158;var p=0;var a=1; + if (t==0) return 0; if ((t/=1)==1) return 1; if (!p) p=1*.3; + if (a < Math.abs(1)) { a=1; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (1/a); + return a*Math.pow(2,-10*t) * Math.sin( (t*1-s)*(2*Math.PI)/p ) + 1; + }, + easeInOutElastic: function (t) { + var s=1.70158;var p=0;var a=1; + if (t==0) return 0; if ((t/=1/2)==2) return 1; if (!p) p=1*(.3*1.5); + if (a < Math.abs(1)) { a=1; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin (1/a); + if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*1-s)*(2*Math.PI)/p )); + return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*1-s)*(2*Math.PI)/p )*.5 + 1; + }, + easeInBack: function (t) { + var s = 1.70158; + return 1*(t/=1)*t*((s+1)*t - s); + }, + easeOutBack: function (t) { + var s = 1.70158; + return 1*((t=t/1-1)*t*((s+1)*t + s) + 1); + }, + easeInOutBack: function (t) { + var s = 1.70158; + if ((t/=1/2) < 1) return 1/2*(t*t*(((s*=(1.525))+1)*t - s)); + return 1/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2); + }, + easeInBounce: function (t) { + return 1 - animationOptions.easeOutBounce (1-t); + }, + easeOutBounce: function (t) { + if ((t/=1) < (1/2.75)) { + return 1*(7.5625*t*t); + } else if (t < (2/2.75)) { + return 1*(7.5625*(t-=(1.5/2.75))*t + .75); + } else if (t < (2.5/2.75)) { + return 1*(7.5625*(t-=(2.25/2.75))*t + .9375); + } else { + return 1*(7.5625*(t-=(2.625/2.75))*t + .984375); + } + }, + easeInOutBounce: function (t) { + if (t < 1/2) return animationOptions.easeInBounce (t*2) * .5; + return animationOptions.easeOutBounce (t*2-1) * .5 + 1*.5; + } + }; + + //Variables global to the chart + var width = context.canvas.width; + var height = context.canvas.height; + + + //High pixel density displays - multiply the size of the canvas height/width by the device pixel ratio, then scale. + if (window.devicePixelRatio) { + context.canvas.style.width = width + "px"; + context.canvas.style.height = height + "px"; + context.canvas.height = height * window.devicePixelRatio; + context.canvas.width = width * window.devicePixelRatio; + context.scale(window.devicePixelRatio, window.devicePixelRatio); + } + + this.PolarArea = function(data,options){ + + chart.PolarArea.defaults = { + scaleOverlay : true, + scaleOverride : false, + scaleSteps : null, + scaleStepWidth : null, + scaleStartValue : null, + scaleShowLine : true, + scaleLineColor : "rgba(0,0,0,.1)", + scaleLineWidth : 1, + scaleShowLabels : true, + scaleLabel : "<%=value%>", + scaleFontFamily : "'Arial'", + scaleFontSize : 12, + scaleFontStyle : "normal", + scaleFontColor : "#666", + scaleShowLabelBackdrop : true, + scaleBackdropColor : "rgba(255,255,255,0.75)", + scaleBackdropPaddingY : 2, + scaleBackdropPaddingX : 2, + segmentShowStroke : true, + segmentStrokeColor : "#fff", + segmentStrokeWidth : 2, + animation : true, + animationSteps : 100, + animationEasing : "easeOutBounce", + animateRotate : true, + animateScale : false, + onAnimationComplete : null + }; + + var config = (options)? mergeChartConfig(chart.PolarArea.defaults,options) : chart.PolarArea.defaults; + + return new PolarArea(data,config,context); + }; + + this.Radar = function(data,options){ + + chart.Radar.defaults = { + scaleOverlay : false, + scaleOverride : false, + scaleSteps : null, + scaleStepWidth : null, + scaleStartValue : null, + scaleShowLine : true, + scaleLineColor : "rgba(0,0,0,.1)", + scaleLineWidth : 1, + scaleShowLabels : false, + scaleLabel : "<%=value%>", + scaleFontFamily : "'Arial'", + scaleFontSize : 12, + scaleFontStyle : "normal", + scaleFontColor : "#666", + scaleShowLabelBackdrop : true, + scaleBackdropColor : "rgba(255,255,255,0.75)", + scaleBackdropPaddingY : 2, + scaleBackdropPaddingX : 2, + angleShowLineOut : true, + angleLineColor : "rgba(0,0,0,.1)", + angleLineWidth : 1, + pointLabelFontFamily : "'Arial'", + pointLabelFontStyle : "normal", + pointLabelFontSize : 12, + pointLabelFontColor : "#666", + pointDot : true, + pointDotRadius : 3, + pointDotStrokeWidth : 1, + datasetStroke : true, + datasetStrokeWidth : 2, + datasetFill : true, + animation : true, + animationSteps : 60, + animationEasing : "easeOutQuart", + onAnimationComplete : null + }; + + var config = (options)? mergeChartConfig(chart.Radar.defaults,options) : chart.Radar.defaults; + + return new Radar(data,config,context); + }; + + this.Pie = function(data,options){ + chart.Pie.defaults = { + segmentShowStroke : true, + segmentStrokeColor : "#fff", + segmentStrokeWidth : 2, + animation : true, + animationSteps : 100, + animationEasing : "easeOutBounce", + animateRotate : true, + animateScale : false, + onAnimationComplete : null + }; + + var config = (options)? mergeChartConfig(chart.Pie.defaults,options) : chart.Pie.defaults; + + return new Pie(data,config,context); + }; + + this.Doughnut = function(data,options){ + + chart.Doughnut.defaults = { + segmentShowStroke : true, + segmentStrokeColor : "#fff", + segmentStrokeWidth : 2, + percentageInnerCutout : 50, + animation : true, + animationSteps : 100, + animationEasing : "easeOutBounce", + animateRotate : true, + animateScale : false, + onAnimationComplete : null + }; + + var config = (options)? mergeChartConfig(chart.Doughnut.defaults,options) : chart.Doughnut.defaults; + + return new Doughnut(data,config,context); + + }; + + this.Line = function(data,options){ + + chart.Line.defaults = { + scaleOverlay : false, + scaleOverride : false, + scaleSteps : null, + scaleStepWidth : null, + scaleStartValue : null, + scaleLineColor : "rgba(0,0,0,.1)", + scaleLineWidth : 1, + scaleShowLabels : true, + scaleLabel : "<%=value%>", + scaleFontFamily : "'Arial'", + scaleFontSize : 12, + scaleFontStyle : "normal", + scaleFontColor : "#666", + scaleShowGridLines : true, + scaleGridLineColor : "rgba(0,0,0,.05)", + scaleGridLineWidth : 1, + bezierCurve : true, + pointDot : true, + pointDotRadius : 4, + pointDotStrokeWidth : 2, + datasetStroke : true, + datasetStrokeWidth : 2, + datasetFill : true, + animation : true, + animationSteps : 60, + animationEasing : "easeOutQuart", + onAnimationComplete : null + }; + var config = (options) ? mergeChartConfig(chart.Line.defaults,options) : chart.Line.defaults; + + return new Line(data,config,context); + } + + this.Bar = function(data,options){ + chart.Bar.defaults = { + scaleOverlay : false, + scaleOverride : false, + scaleSteps : null, + scaleStepWidth : null, + scaleStartValue : null, + scaleLineColor : "rgba(0,0,0,.1)", + scaleLineWidth : 1, + scaleShowLabels : true, + scaleLabel : "<%=value%>", + scaleFontFamily : "'Arial'", + scaleFontSize : 12, + scaleFontStyle : "normal", + scaleFontColor : "#666", + scaleShowGridLines : true, + scaleGridLineColor : "rgba(0,0,0,.05)", + scaleGridLineWidth : 1, + barShowStroke : true, + barStrokeWidth : 2, + barValueSpacing : 5, + barDatasetSpacing : 1, + animation : true, + animationSteps : 60, + animationEasing : "easeOutQuart", + onAnimationComplete : null + }; + var config = (options) ? mergeChartConfig(chart.Bar.defaults,options) : chart.Bar.defaults; + + return new Bar(data,config,context); + } + + var clear = function(c){ + c.clearRect(0, 0, width, height); + }; + + var PolarArea = function(data,config,ctx){ + var maxSize, scaleHop, calculatedScale, labelHeight, scaleHeight, valueBounds, labelTemplateString; + + + calculateDrawingSizes(); + + valueBounds = getValueBounds(); + + labelTemplateString = (config.scaleShowLabels)? config.scaleLabel : null; + + //Check and set the scale + if (!config.scaleOverride){ + + calculatedScale = calculateScale(scaleHeight,valueBounds.maxSteps,valueBounds.minSteps,valueBounds.maxValue,valueBounds.minValue,labelTemplateString); + } + else { + calculatedScale = { + steps : config.scaleSteps, + stepValue : config.scaleStepWidth, + graphMin : config.scaleStartValue, + labels : [] + } + populateLabels(labelTemplateString, calculatedScale.labels,calculatedScale.steps,config.scaleStartValue,config.scaleStepWidth); + } + + scaleHop = maxSize/(calculatedScale.steps); + + //Wrap in an animation loop wrapper + animationLoop(config,drawScale,drawAllSegments,ctx); + + function calculateDrawingSizes(){ + maxSize = (Min([width,height])/2); + //Remove whatever is larger - the font size or line width. + + maxSize -= Max([config.scaleFontSize*0.5,config.scaleLineWidth*0.5]); + + labelHeight = config.scaleFontSize*2; + //If we're drawing the backdrop - add the Y padding to the label height and remove from drawing region. + if (config.scaleShowLabelBackdrop){ + labelHeight += (2 * config.scaleBackdropPaddingY); + maxSize -= config.scaleBackdropPaddingY*1.5; + } + + scaleHeight = maxSize; + //If the label height is less than 5, set it to 5 so we don't have lines on top of each other. + labelHeight = Default(labelHeight,5); + } + function drawScale(){ + for (var i=0; i upperValue) {upperValue = data[i].value;} + if (data[i].value < lowerValue) {lowerValue = data[i].value;} + }; + + var maxSteps = Math.floor((scaleHeight / (labelHeight*0.66))); + var minSteps = Math.floor((scaleHeight / labelHeight*0.5)); + + return { + maxValue : upperValue, + minValue : lowerValue, + maxSteps : maxSteps, + minSteps : minSteps + }; + + + } + } + + var Radar = function (data,config,ctx) { + var maxSize, scaleHop, calculatedScale, labelHeight, scaleHeight, valueBounds, labelTemplateString; + + //If no labels are defined set to an empty array, so referencing length for looping doesn't blow up. + if (!data.labels) data.labels = []; + + calculateDrawingSizes(); + + var valueBounds = getValueBounds(); + + labelTemplateString = (config.scaleShowLabels)? config.scaleLabel : null; + + //Check and set the scale + if (!config.scaleOverride){ + + calculatedScale = calculateScale(scaleHeight,valueBounds.maxSteps,valueBounds.minSteps,valueBounds.maxValue,valueBounds.minValue,labelTemplateString); + } + else { + calculatedScale = { + steps : config.scaleSteps, + stepValue : config.scaleStepWidth, + graphMin : config.scaleStartValue, + labels : [] + } + populateLabels(labelTemplateString, calculatedScale.labels,calculatedScale.steps,config.scaleStartValue,config.scaleStepWidth); + } + + scaleHop = maxSize/(calculatedScale.steps); + + animationLoop(config,drawScale,drawAllDataPoints,ctx); + + //Radar specific functions. + function drawAllDataPoints(animationDecimal){ + var rotationDegree = (2*Math.PI)/data.datasets[0].data.length; + + ctx.save(); + //translate to the centre of the canvas. + ctx.translate(width/2,height/2); + + //We accept multiple data sets for radar charts, so show loop through each set + for (var i=0; i Math.PI){ + ctx.textAlign = "right"; + } + else{ + ctx.textAlign = "left"; + } + + ctx.textBaseline = "middle"; + + ctx.fillText(data.labels[k],opposite,-adjacent); + + } + ctx.restore(); + }; + function calculateDrawingSizes(){ + maxSize = (Min([width,height])/2); + + labelHeight = config.scaleFontSize*2; + + var labelLength = 0; + for (var i=0; ilabelLength) labelLength = textMeasurement; + } + + //Figure out whats the largest - the height of the text or the width of what's there, and minus it from the maximum usable size. + maxSize -= Max([labelLength,((config.pointLabelFontSize/2)*1.5)]); + + maxSize -= config.pointLabelFontSize; + maxSize = CapValue(maxSize, null, 0); + scaleHeight = maxSize; + //If the label height is less than 5, set it to 5 so we don't have lines on top of each other. + labelHeight = Default(labelHeight,5); + }; + function getValueBounds() { + var upperValue = Number.MIN_VALUE; + var lowerValue = Number.MAX_VALUE; + + for (var i=0; i upperValue){upperValue = data.datasets[i].data[j]} + if (data.datasets[i].data[j] < lowerValue){lowerValue = data.datasets[i].data[j]} + } + } + + var maxSteps = Math.floor((scaleHeight / (labelHeight*0.66))); + var minSteps = Math.floor((scaleHeight / labelHeight*0.5)); + + return { + maxValue : upperValue, + minValue : lowerValue, + maxSteps : maxSteps, + minSteps : minSteps + }; + + + } + } + + var Pie = function(data,config,ctx){ + var segmentTotal = 0; + + //In case we have a canvas that is not a square. Minus 5 pixels as padding round the edge. + var pieRadius = Min([height/2,width/2]) - 5; + + for (var i=0; i 0){ + ctx.save(); + ctx.textAlign = "right"; + } + else{ + ctx.textAlign = "center"; + } + ctx.fillStyle = config.scaleFontColor; + for (var i=0; i 0){ + ctx.translate(yAxisPosX + i*valueHop,xAxisPosY + config.scaleFontSize); + ctx.rotate(-(rotateLabels * (Math.PI/180))); + ctx.fillText(data.labels[i], 0,0); + ctx.restore(); + } + + else{ + ctx.fillText(data.labels[i], yAxisPosX + i*valueHop,xAxisPosY + config.scaleFontSize+3); + } + + ctx.beginPath(); + ctx.moveTo(yAxisPosX + i * valueHop, xAxisPosY+3); + + //Check i isnt 0, so we dont go over the Y axis twice. + if(config.scaleShowGridLines && i>0){ + ctx.lineWidth = config.scaleGridLineWidth; + ctx.strokeStyle = config.scaleGridLineColor; + ctx.lineTo(yAxisPosX + i * valueHop, 5); + } + else{ + ctx.lineTo(yAxisPosX + i * valueHop, xAxisPosY+3); + } + ctx.stroke(); + } + + //Y axis + ctx.lineWidth = config.scaleLineWidth; + ctx.strokeStyle = config.scaleLineColor; + ctx.beginPath(); + ctx.moveTo(yAxisPosX,xAxisPosY+5); + ctx.lineTo(yAxisPosX,5); + ctx.stroke(); + + ctx.textAlign = "right"; + ctx.textBaseline = "middle"; + for (var j=0; j longestText)? measuredText : longestText; + } + //Add a little extra padding from the y axis + longestText +=10; + } + xAxisLength = width - longestText - widestXLabel; + valueHop = Math.floor(xAxisLength/(data.labels.length-1)); + + yAxisPosX = width-widestXLabel/2-xAxisLength; + xAxisPosY = scaleHeight + config.scaleFontSize/2; + } + function calculateDrawingSizes(){ + maxSize = height; + + //Need to check the X axis first - measure the length of each text metric, and figure out if we need to rotate by 45 degrees. + ctx.font = config.scaleFontStyle + " " + config.scaleFontSize+"px " + config.scaleFontFamily; + widestXLabel = 1; + for (var i=0; i widestXLabel)? textLength : widestXLabel; + } + if (width/data.labels.length < widestXLabel){ + rotateLabels = 45; + if (width/data.labels.length < Math.cos(rotateLabels) * widestXLabel){ + rotateLabels = 90; + maxSize -= widestXLabel; + } + else{ + maxSize -= Math.sin(rotateLabels) * widestXLabel; + } + } + else{ + maxSize -= config.scaleFontSize; + } + + //Add a little padding between the x line and the text + maxSize -= 5; + + + labelHeight = config.scaleFontSize; + + maxSize -= labelHeight; + //Set 5 pixels greater than the font size to allow for a little padding from the X axis. + + scaleHeight = maxSize; + + //Then get the area above we can safely draw on. + + } + function getValueBounds() { + var upperValue = Number.MIN_VALUE; + var lowerValue = Number.MAX_VALUE; + for (var i=0; i upperValue) { upperValue = data.datasets[i].data[j] }; + if ( data.datasets[i].data[j] < lowerValue) { lowerValue = data.datasets[i].data[j] }; + } + }; + + var maxSteps = Math.floor((scaleHeight / (labelHeight*0.66))); + var minSteps = Math.floor((scaleHeight / labelHeight*0.5)); + + return { + maxValue : upperValue, + minValue : lowerValue, + maxSteps : maxSteps, + minSteps : minSteps + }; + + + } + + + } + + var Bar = function(data,config,ctx){ + var maxSize, scaleHop, calculatedScale, labelHeight, scaleHeight, valueBounds, labelTemplateString, valueHop,widestXLabel, xAxisLength,yAxisPosX,xAxisPosY,barWidth, rotateLabels = 0; + + calculateDrawingSizes(); + + valueBounds = getValueBounds(); + //Check and set the scale + labelTemplateString = (config.scaleShowLabels)? config.scaleLabel : ""; + if (!config.scaleOverride){ + + calculatedScale = calculateScale(scaleHeight,valueBounds.maxSteps,valueBounds.minSteps,valueBounds.maxValue,valueBounds.minValue,labelTemplateString); + } + else { + calculatedScale = { + steps : config.scaleSteps, + stepValue : config.scaleStepWidth, + graphMin : config.scaleStartValue, + labels : [] + } + populateLabels(labelTemplateString, calculatedScale.labels,calculatedScale.steps,config.scaleStartValue,config.scaleStepWidth); + } + + scaleHop = Math.floor(scaleHeight/calculatedScale.steps); + calculateXAxisSize(); + animationLoop(config,drawScale,drawBars,ctx); + + function drawBars(animPc){ + ctx.lineWidth = config.barStrokeWidth; + for (var i=0; i 0){ + ctx.save(); + ctx.textAlign = "right"; + } + else{ + ctx.textAlign = "center"; + } + ctx.fillStyle = config.scaleFontColor; + for (var i=0; i 0){ + ctx.translate(yAxisPosX + i*valueHop,xAxisPosY + config.scaleFontSize); + ctx.rotate(-(rotateLabels * (Math.PI/180))); + ctx.fillText(data.labels[i], 0,0); + ctx.restore(); + } + + else{ + ctx.fillText(data.labels[i], yAxisPosX + i*valueHop + valueHop/2,xAxisPosY + config.scaleFontSize+3); + } + + ctx.beginPath(); + ctx.moveTo(yAxisPosX + (i+1) * valueHop, xAxisPosY+3); + + //Check i isnt 0, so we dont go over the Y axis twice. + ctx.lineWidth = config.scaleGridLineWidth; + ctx.strokeStyle = config.scaleGridLineColor; + ctx.lineTo(yAxisPosX + (i+1) * valueHop, 5); + ctx.stroke(); + } + + //Y axis + ctx.lineWidth = config.scaleLineWidth; + ctx.strokeStyle = config.scaleLineColor; + ctx.beginPath(); + ctx.moveTo(yAxisPosX,xAxisPosY+5); + ctx.lineTo(yAxisPosX,5); + ctx.stroke(); + + ctx.textAlign = "right"; + ctx.textBaseline = "middle"; + for (var j=0; j longestText)? measuredText : longestText; + } + //Add a little extra padding from the y axis + longestText +=10; + } + xAxisLength = width - longestText - widestXLabel; + valueHop = Math.floor(xAxisLength/(data.labels.length)); + + barWidth = (valueHop - config.scaleGridLineWidth*2 - (config.barValueSpacing*2) - (config.barDatasetSpacing*data.datasets.length-1) - ((config.barStrokeWidth/2)*data.datasets.length-1))/data.datasets.length; + + yAxisPosX = width-widestXLabel/2-xAxisLength; + xAxisPosY = scaleHeight + config.scaleFontSize/2; + } + function calculateDrawingSizes(){ + maxSize = height; + + //Need to check the X axis first - measure the length of each text metric, and figure out if we need to rotate by 45 degrees. + ctx.font = config.scaleFontStyle + " " + config.scaleFontSize+"px " + config.scaleFontFamily; + widestXLabel = 1; + for (var i=0; i widestXLabel)? textLength : widestXLabel; + } + if (width/data.labels.length < widestXLabel){ + rotateLabels = 45; + if (width/data.labels.length < Math.cos(rotateLabels) * widestXLabel){ + rotateLabels = 90; + maxSize -= widestXLabel; + } + else{ + maxSize -= Math.sin(rotateLabels) * widestXLabel; + } + } + else{ + maxSize -= config.scaleFontSize; + } + + //Add a little padding between the x line and the text + maxSize -= 5; + + + labelHeight = config.scaleFontSize; + + maxSize -= labelHeight; + //Set 5 pixels greater than the font size to allow for a little padding from the X axis. + + scaleHeight = maxSize; + + //Then get the area above we can safely draw on. + + } + function getValueBounds() { + var upperValue = Number.MIN_VALUE; + var lowerValue = Number.MAX_VALUE; + for (var i=0; i upperValue) { upperValue = data.datasets[i].data[j] }; + if ( data.datasets[i].data[j] < lowerValue) { lowerValue = data.datasets[i].data[j] }; + } + }; + + var maxSteps = Math.floor((scaleHeight / (labelHeight*0.66))); + var minSteps = Math.floor((scaleHeight / labelHeight*0.5)); + + return { + maxValue : upperValue, + minValue : lowerValue, + maxSteps : maxSteps, + minSteps : minSteps + }; + + + } + } + + function calculateOffset(val,calculatedScale,scaleHop){ + var outerValue = calculatedScale.steps * calculatedScale.stepValue; + var adjustedValue = val - calculatedScale.graphMin; + var scalingFactor = CapValue(adjustedValue/outerValue,1,0); + return (scaleHop*calculatedScale.steps) * scalingFactor; + } + + function animationLoop(config,drawScale,drawData,ctx){ + var animFrameAmount = (config.animation)? 1/CapValue(config.animationSteps,Number.MAX_VALUE,1) : 1, + easingFunction = animationOptions[config.animationEasing], + percentAnimComplete =(config.animation)? 0 : 1; + + + + if (typeof drawScale !== "function") drawScale = function(){}; + + requestAnimFrame(animLoop); + + function animateFrame(){ + var easeAdjustedAnimationPercent =(config.animation)? CapValue(easingFunction(percentAnimComplete),null,0) : 1; + clear(ctx); + if(config.scaleOverlay){ + drawData(easeAdjustedAnimationPercent); + drawScale(); + } else { + drawScale(); + drawData(easeAdjustedAnimationPercent); + } + } + function animLoop(){ + //We need to check if the animation is incomplete (less than 1), or complete (1). + percentAnimComplete += animFrameAmount; + animateFrame(); + //Stop the loop continuing forever + if (percentAnimComplete <= 1){ + requestAnimFrame(animLoop); + } + else{ + if (typeof config.onAnimationComplete == "function") config.onAnimationComplete(); + } + + } + + } + + //Declare global functions to be called within this namespace here. + + + // shim layer with setTimeout fallback + var requestAnimFrame = (function(){ + return window.requestAnimationFrame || + window.webkitRequestAnimationFrame || + window.mozRequestAnimationFrame || + window.oRequestAnimationFrame || + window.msRequestAnimationFrame || + function(callback) { + window.setTimeout(callback, 1000 / 60); + }; + })(); + + function calculateScale(drawingHeight,maxSteps,minSteps,maxValue,minValue,labelTemplateString){ + var graphMin,graphMax,graphRange,stepValue,numberOfSteps,valueRange,rangeOrderOfMagnitude,decimalNum; + + valueRange = maxValue - minValue; + + rangeOrderOfMagnitude = calculateOrderOfMagnitude(valueRange); + + graphMin = Math.floor(minValue / (1 * Math.pow(10, rangeOrderOfMagnitude))) * Math.pow(10, rangeOrderOfMagnitude); + + graphMax = Math.ceil(maxValue / (1 * Math.pow(10, rangeOrderOfMagnitude))) * Math.pow(10, rangeOrderOfMagnitude); + + graphRange = graphMax - graphMin; + + stepValue = Math.pow(10, rangeOrderOfMagnitude); + + numberOfSteps = Math.round(graphRange / stepValue); + + //Compare number of steps to the max and min for that size graph, and add in half steps if need be. + while(numberOfSteps < minSteps || numberOfSteps > maxSteps) { + if (numberOfSteps < minSteps){ + stepValue /= 2; + numberOfSteps = Math.round(graphRange/stepValue); + } + else{ + stepValue *=2; + numberOfSteps = Math.round(graphRange/stepValue); + } + }; + + var labels = []; + populateLabels(labelTemplateString, labels, numberOfSteps, graphMin, stepValue); + + return { + steps : numberOfSteps, + stepValue : stepValue, + graphMin : graphMin, + labels : labels + + } + + function calculateOrderOfMagnitude(val){ + return Math.floor(Math.log(val) / Math.LN10); + } + + + } + + //Populate an array of all the labels by interpolating the string. + function populateLabels(labelTemplateString, labels, numberOfSteps, graphMin, stepValue) { + if (labelTemplateString) { + //Fix floating point errors by setting to fixed the on the same decimal as the stepValue. + for (var i = 1; i < numberOfSteps + 1; i++) { + labels.push(tmpl(labelTemplateString, {value: (graphMin + (stepValue * i)).toFixed(getDecimalPlaces(stepValue))})); + } + } + } + + //Max value from array + function Max( array ){ + return Math.max.apply( Math, array ); + }; + //Min value from array + function Min( array ){ + return Math.min.apply( Math, array ); + }; + //Default if undefined + function Default(userDeclared,valueIfFalse){ + if(!userDeclared){ + return valueIfFalse; + } else { + return userDeclared; + } + }; + //Is a number function + function isNumber(n) { + return !isNaN(parseFloat(n)) && isFinite(n); + } + //Apply cap a value at a high or low number + function CapValue(valueToCap, maxValue, minValue){ + if(isNumber(maxValue)) { + if( valueToCap > maxValue ) { + return maxValue; + } + } + if(isNumber(minValue)){ + if ( valueToCap < minValue ){ + return minValue; + } + } + return valueToCap; + } + function getDecimalPlaces (num){ + var numberOfDecimalPlaces; + if (num%1!=0){ + return num.toString().split(".")[1].length + } + else{ + return 0; + } + + } + + function mergeChartConfig(defaults,userDefined){ + var returnObj = {}; + for (var attrname in defaults) { returnObj[attrname] = defaults[attrname]; } + for (var attrname in userDefined) { returnObj[attrname] = userDefined[attrname]; } + return returnObj; + } + + //Javascript micro templating by John Resig - source at http://ejohn.org/blog/javascript-micro-templating/ + var cache = {}; + + function tmpl(str, data){ + // Figure out if we're getting a template, or if we need to + // load the template - and be sure to cache the result. + var fn = !/\W/.test(str) ? + cache[str] = cache[str] || + tmpl(document.getElementById(str).innerHTML) : + + // Generate a reusable function that will serve as a template + // generator (and which will be cached). + new Function("obj", + "var p=[],print=function(){p.push.apply(p,arguments);};" + + + // Introduce the data as local variables using with(){} + "with(obj){p.push('" + + + // Convert the template into pure JavaScript + str + .replace(/[\r\t\n]/g, " ") + .split("<%").join("\t") + .replace(/((^|%>)[^\t]*)'/g, "$1\r") + .replace(/\t=(.*?)%>/g, "',$1,'") + .split("\t").join("');") + .split("%>").join("p.push('") + .split("\r").join("\\'") + + "');}return p.join('');"); + + // Provide some basic currying to the user + return data ? fn( data ) : fn; + }; +} + + diff --git a/crm/src/main/webapp/Chart/Chart.min.js b/crm/src/main/webapp/Chart/Chart.min.js new file mode 100644 index 0000000..ab63588 --- /dev/null +++ b/crm/src/main/webapp/Chart/Chart.min.js @@ -0,0 +1,39 @@ +var Chart=function(s){function v(a,c,b){a=A((a-c.graphMin)/(c.steps*c.stepValue),1,0);return b*c.steps*a}function x(a,c,b,e){function h(){g+=f;var k=a.animation?A(d(g),null,0):1;e.clearRect(0,0,q,u);a.scaleOverlay?(b(k),c()):(c(),b(k));if(1>=g)D(h);else if("function"==typeof a.onAnimationComplete)a.onAnimationComplete()}var f=a.animation?1/A(a.animationSteps,Number.MAX_VALUE,1):1,d=B[a.animationEasing],g=a.animation?0:1;"function"!==typeof c&&(c=function(){});D(h)}function C(a,c,b,e,h,f){var d;a= +Math.floor(Math.log(e-h)/Math.LN10);h=Math.floor(h/(1*Math.pow(10,a)))*Math.pow(10,a);e=Math.ceil(e/(1*Math.pow(10,a)))*Math.pow(10,a)-h;a=Math.pow(10,a);for(d=Math.round(e/a);dc;)a=dc?c:!isNaN(parseFloat(b))&& +isFinite(b)&&a)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split("\t").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');");return c? +b(c):b}var r=this,B={linear:function(a){return a},easeInQuad:function(a){return a*a},easeOutQuad:function(a){return-1*a*(a-2)},easeInOutQuad:function(a){return 1>(a/=0.5)?0.5*a*a:-0.5*(--a*(a-2)-1)},easeInCubic:function(a){return a*a*a},easeOutCubic:function(a){return 1*((a=a/1-1)*a*a+1)},easeInOutCubic:function(a){return 1>(a/=0.5)?0.5*a*a*a:0.5*((a-=2)*a*a+2)},easeInQuart:function(a){return a*a*a*a},easeOutQuart:function(a){return-1*((a=a/1-1)*a*a*a-1)},easeInOutQuart:function(a){return 1>(a/=0.5)? +0.5*a*a*a*a:-0.5*((a-=2)*a*a*a-2)},easeInQuint:function(a){return 1*(a/=1)*a*a*a*a},easeOutQuint:function(a){return 1*((a=a/1-1)*a*a*a*a+1)},easeInOutQuint:function(a){return 1>(a/=0.5)?0.5*a*a*a*a*a:0.5*((a-=2)*a*a*a*a+2)},easeInSine:function(a){return-1*Math.cos(a/1*(Math.PI/2))+1},easeOutSine:function(a){return 1*Math.sin(a/1*(Math.PI/2))},easeInOutSine:function(a){return-0.5*(Math.cos(Math.PI*a/1)-1)},easeInExpo:function(a){return 0==a?1:1*Math.pow(2,10*(a/1-1))},easeOutExpo:function(a){return 1== +a?1:1*(-Math.pow(2,-10*a/1)+1)},easeInOutExpo:function(a){return 0==a?0:1==a?1:1>(a/=0.5)?0.5*Math.pow(2,10*(a-1)):0.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return 1<=a?a:-1*(Math.sqrt(1-(a/=1)*a)-1)},easeOutCirc:function(a){return 1*Math.sqrt(1-(a=a/1-1)*a)},easeInOutCirc:function(a){return 1>(a/=0.5)?-0.5*(Math.sqrt(1-a*a)-1):0.5*(Math.sqrt(1-(a-=2)*a)+1)},easeInElastic:function(a){var c=1.70158,b=0,e=1;if(0==a)return 0;if(1==(a/=1))return 1;b||(b=0.3);ea?-0.5*e*Math.pow(2,10* +(a-=1))*Math.sin((1*a-c)*2*Math.PI/b):0.5*e*Math.pow(2,-10*(a-=1))*Math.sin((1*a-c)*2*Math.PI/b)+1},easeInBack:function(a){return 1*(a/=1)*a*(2.70158*a-1.70158)},easeOutBack:function(a){return 1*((a=a/1-1)*a*(2.70158*a+1.70158)+1)},easeInOutBack:function(a){var c=1.70158;return 1>(a/=0.5)?0.5*a*a*(((c*=1.525)+1)*a-c):0.5*((a-=2)*a*(((c*=1.525)+1)*a+c)+2)},easeInBounce:function(a){return 1-B.easeOutBounce(1-a)},easeOutBounce:function(a){return(a/=1)<1/2.75?1*7.5625*a*a:a<2/2.75?1*(7.5625*(a-=1.5/2.75)* +a+0.75):a<2.5/2.75?1*(7.5625*(a-=2.25/2.75)*a+0.9375):1*(7.5625*(a-=2.625/2.75)*a+0.984375)},easeInOutBounce:function(a){return 0.5>a?0.5*B.easeInBounce(2*a):0.5*B.easeOutBounce(2*a-1)+0.5}},q=s.canvas.width,u=s.canvas.height;window.devicePixelRatio&&(s.canvas.style.width=q+"px",s.canvas.style.height=u+"px",s.canvas.height=u*window.devicePixelRatio,s.canvas.width=q*window.devicePixelRatio,s.scale(window.devicePixelRatio,window.devicePixelRatio));this.PolarArea=function(a,c){r.PolarArea.defaults={scaleOverlay:!0, +scaleOverride:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleShowLine:!0,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:!0,scaleLabel:"<%=value%>",scaleFontFamily:"'Arial'",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",scaleShowLabelBackdrop:!0,scaleBackdropColor:"rgba(255,255,255,0.75)",scaleBackdropPaddingY:2,scaleBackdropPaddingX:2,segmentShowStroke:!0,segmentStrokeColor:"#fff",segmentStrokeWidth:2,animation:!0,animationSteps:100,animationEasing:"easeOutBounce", +animateRotate:!0,animateScale:!1,onAnimationComplete:null};var b=c?y(r.PolarArea.defaults,c):r.PolarArea.defaults;return new G(a,b,s)};this.Radar=function(a,c){r.Radar.defaults={scaleOverlay:!1,scaleOverride:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleShowLine:!0,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:!1,scaleLabel:"<%=value%>",scaleFontFamily:"'Arial'",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",scaleShowLabelBackdrop:!0,scaleBackdropColor:"rgba(255,255,255,0.75)", +scaleBackdropPaddingY:2,scaleBackdropPaddingX:2,angleShowLineOut:!0,angleLineColor:"rgba(0,0,0,.1)",angleLineWidth:1,pointLabelFontFamily:"'Arial'",pointLabelFontStyle:"normal",pointLabelFontSize:12,pointLabelFontColor:"#666",pointDot:!0,pointDotRadius:3,pointDotStrokeWidth:1,datasetStroke:!0,datasetStrokeWidth:2,datasetFill:!0,animation:!0,animationSteps:60,animationEasing:"easeOutQuart",onAnimationComplete:null};var b=c?y(r.Radar.defaults,c):r.Radar.defaults;return new H(a,b,s)};this.Pie=function(a, +c){r.Pie.defaults={segmentShowStroke:!0,segmentStrokeColor:"#fff",segmentStrokeWidth:2,animation:!0,animationSteps:100,animationEasing:"easeOutBounce",animateRotate:!0,animateScale:!1,onAnimationComplete:null};var b=c?y(r.Pie.defaults,c):r.Pie.defaults;return new I(a,b,s)};this.Doughnut=function(a,c){r.Doughnut.defaults={segmentShowStroke:!0,segmentStrokeColor:"#fff",segmentStrokeWidth:2,percentageInnerCutout:50,animation:!0,animationSteps:100,animationEasing:"easeOutBounce",animateRotate:!0,animateScale:!1, +onAnimationComplete:null};var b=c?y(r.Doughnut.defaults,c):r.Doughnut.defaults;return new J(a,b,s)};this.Line=function(a,c){r.Line.defaults={scaleOverlay:!1,scaleOverride:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:!0,scaleLabel:"<%=value%>",scaleFontFamily:"'Arial'",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",scaleShowGridLines:!0,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,bezierCurve:!0, +pointDot:!0,pointDotRadius:4,pointDotStrokeWidth:2,datasetStroke:!0,datasetStrokeWidth:2,datasetFill:!0,animation:!0,animationSteps:60,animationEasing:"easeOutQuart",onAnimationComplete:null};var b=c?y(r.Line.defaults,c):r.Line.defaults;return new K(a,b,s)};this.Bar=function(a,c){r.Bar.defaults={scaleOverlay:!1,scaleOverride:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:!0,scaleLabel:"<%=value%>",scaleFontFamily:"'Arial'", +scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",scaleShowGridLines:!0,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,barShowStroke:!0,barStrokeWidth:2,barValueSpacing:5,barDatasetSpacing:1,animation:!0,animationSteps:60,animationEasing:"easeOutQuart",onAnimationComplete:null};var b=c?y(r.Bar.defaults,c):r.Bar.defaults;return new L(a,b,s)};var G=function(a,c,b){var e,h,f,d,g,k,j,l,m;g=Math.min.apply(Math,[q,u])/2;g-=Math.max.apply(Math,[0.5*c.scaleFontSize,0.5*c.scaleLineWidth]); +d=2*c.scaleFontSize;c.scaleShowLabelBackdrop&&(d+=2*c.scaleBackdropPaddingY,g-=1.5*c.scaleBackdropPaddingY);l=g;d=d?d:5;e=Number.MIN_VALUE;h=Number.MAX_VALUE;for(f=0;fe&&(e=a[f].value),a[f].valuel&&(l=h);g-=Math.max.apply(Math,[l,1.5*(c.pointLabelFontSize/2)]);g-=c.pointLabelFontSize;l=g=A(g,null,0);d=d?d:5;e=Number.MIN_VALUE; +h=Number.MAX_VALUE;for(f=0;fe&&(e=a.datasets[f].data[m]),a.datasets[f].data[m]Math.PI?"right":"left";b.textBaseline="middle";b.fillText(a.labels[d],f,-h)}b.restore()},function(d){var e=2*Math.PI/a.datasets[0].data.length;b.save();b.translate(q/2,u/2);for(var g=0;gt?e:t;q/a.labels.lengthe&&(e=a.datasets[f].data[l]),a.datasets[f].data[l]d?h:d;d+=10}r=q-d-t;m=Math.floor(r/(a.labels.length-1));n=q-t/2-r;p=g+c.scaleFontSize/2;x(c,function(){b.lineWidth=c.scaleLineWidth;b.strokeStyle=c.scaleLineColor;b.beginPath();b.moveTo(q-t/2+5,p);b.lineTo(q-t/2-r-5,p);b.stroke();0t?e:t;q/a.labels.lengthe&&(e=a.datasets[f].data[l]),a.datasets[f].data[l]< +h&&(h=a.datasets[f].data[l]);f=Math.floor(g/(0.66*d));d=Math.floor(0.5*(g/d));l=c.scaleShowLabels?c.scaleLabel:"";c.scaleOverride?(j={steps:c.scaleSteps,stepValue:c.scaleStepWidth,graphMin:c.scaleStartValue,labels:[]},z(l,j.labels,j.steps,c.scaleStartValue,c.scaleStepWidth)):j=C(g,f,d,e,h,l);k=Math.floor(g/j.steps);d=1;if(c.scaleShowLabels){b.font=c.scaleFontStyle+" "+c.scaleFontSize+"px "+c.scaleFontFamily;for(e=0;ed?h:d;d+=10}r=q-d-t;m= +Math.floor(r/a.labels.length);s=(m-2*c.scaleGridLineWidth-2*c.barValueSpacing-(c.barDatasetSpacing*a.datasets.length-1)-(c.barStrokeWidth/2*a.datasets.length-1))/a.datasets.length;n=q-t/2-r;p=g+c.scaleFontSize/2;x(c,function(){b.lineWidth=c.scaleLineWidth;b.strokeStyle=c.scaleLineColor;b.beginPath();b.moveTo(q-t/2+5,p);b.lineTo(q-t/2-r-5,p);b.stroke();0What does it do? + +FooTable transforms your HTML tables into expandable responsive tables. This is how it works: + +1. It hides certain columns of data at different resolutions (we call these breakpoints). +2. Rows become expandable to show the data that was hidden. + +So simple! So all the data that is hidden can always be seen just by clicking the row. + +

Demo

+ +Check out the [FooTable homepage](http://themergency.com/footable/) where we will be adding more demos, including the responsive demo! + +

Data Attribute Configuration

+ +One of the main goals of FooTable was to make it completely configurable via data attributes inside the table. We wanted you to be able to look at the HTML markup and see exactly how the FooTable was going to function. Take a look at this markup for example: + +```html + + + + + + + + + + +``` + +So you can immediately see that certain columns will be hidden on phones and tablets. We are also going to assign all cells in the first column with a class of "expand" - this is used to style the cool plus/minus icons in the demo. + +All available "data-" attributes are listed below with their descriptions. The "Applied To" column specifies whether the attribute should be added to the table header cells or body cells. + +
+ First Name + + Last Name + + Job Title + + DOB + + Status +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameValuesApplied ToDescription
data-classCSS ClassheaderThis specifies a CSS class to be applied to all cells in a column.
data-hidebreakpoint | defaultheaderThis specifies at which breakpoints to hide a column. Seperate multiple using a comma.
data-ignoretrue | falseheaderThis will stop the column being included in the detail row creation.
data-nameStringheaderThis will override the name of the column in the detail row.
data-typeparser | alphaheaderThis specifies the parser to use to retrieve a cell's value.
data-valueAnybodyThis specifies a value to use other than the text of the cell.
+ +

Breakpoints

+ +We work with the concepts of "breakpoints", which are different device widths we care about. The default breakpoints are: + +```javascript +breakpoints: { + phone: 480, + tablet: 1024 +} +``` + +So looking at the markup in the *Data Attribute Configuration* section, you can now tell that the *Job Title*, *DOB* and *Status* columns will be hidden when the screen width is below 480 (phone). + +There are also two built-in breakpoints called "default" and "all". + +The "default" breakpoint is the fallback breakpoint for when the current screen width is larger than any defined breakpoint. Looking at the above JS snippet the "default" breakpoint would be applied once the screen width is larger than 1024 (tablet). + +The last breakpoint "all" is pretty straight forward in it's use. You can always hide a column on any screen width by applying the *data-hide="all"* attribute to the header. + +

Usage

+ +Create a simple table (don't forget to set the data attributes for each column!): + +```html + + + + + + + + + + + + + + + + + + + + + + + + + +
NamePhoneEmail
Bob Builder555-12345bob@home.com
Bridget Jones544-776655bjones@mysite.com
Tom Cruise555-99911cruise1@crazy.com
+``` + +Then include the FooTable CSS and JS in your page head: + +```html + + + +``` + +And finally, call the FooTable plugin: + +```html + +``` + +

Extensible

+ +Another goal of FooTable was to make it super extensible. If you look at the code you will see that there is a plugin framework within the plugin, so extra mods can be attached just by including another javascript file. We also didn't want to bloat FooTable, so you can only use what you need and leave out everything else. + +Working add-ons: + +* sorting +* filtering + +Othere add-on ideas so far are: + +* conditional formatting +* json loading + +

Parsers

+ +Parsers are the heart of FooTable as data is what we are displaying and working with and due to this they are highly extensible. They are used to retrieve values from cells or alternatively from a "data-value" attribute. +By default there is only an "alpha" parser and this will be used unless a custom parser is implemented and a column is set to use it via the "data-type" attribute. + +The below is the very simple "alpha" parser used by default to retrieve a cell's value: + +```javascript +alpha: function (cell) { + return $(cell).data('value') || $.trim($(cell).text()); +} +``` + +The below is an example of a numeric parser and how to apply it (these can be wrapped up in a plugin; see the sortable plugin): + +```html + +``` + +```html + + + + + ... + + + ... +``` + +As you can see in the snippet for the "numeric" parser, like the "alpha" parser, they both check for a "data-value" attribute and will use this value before using a cell's text. + +An example of this could look like the below, where you want to display the name of a number instead of the actual value: + +```html +
+ Count +
+ + + + ... + + + + + + ... + + + + ... + + ... + + ... +``` + +

Thanks

+ +We would not have created FooTable without inspiration from others. Thanks must be given to: + +* Catalin for his [original table CSS](http://www.red-team-design.com/practical-css3-tables-with-rounded-corners) +* [Chris Coyier](http://css-tricks.com/responsive-data-tables/) (also check out Chris' [responsive table roundup post](http://css-tricks.com/responsive-data-table-roundup/)) +* [Zurb](http://www.zurb.com/playground/responsive-tables) +* [Dave Bushell](http://dbushell.com/2012/01/05/responsive-tables-2/) +* [Filament Group](http://filamentgroup.com/examples/rwd-table-patterns/) +* [Stewart Curry](http://www.irishstu.com/stublog/2011/12/13/tables-responsive-design-part-2-nchilds/) \ No newline at end of file diff --git a/crm/src/main/webapp/FooTable/bootstrap/bootstrap-responsive.css b/crm/src/main/webapp/FooTable/bootstrap/bootstrap-responsive.css new file mode 100644 index 0000000..fcd72f7 --- /dev/null +++ b/crm/src/main/webapp/FooTable/bootstrap/bootstrap-responsive.css @@ -0,0 +1,1109 @@ +/*! + * Bootstrap Responsive v2.3.1 + * + * Copyright 2012 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + */ + +.clearfix { + *zoom: 1; +} + +.clearfix:before, +.clearfix:after { + display: table; + line-height: 0; + content: ""; +} + +.clearfix:after { + clear: both; +} + +.hide-text { + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0; +} + +.input-block-level { + display: block; + width: 100%; + min-height: 30px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +@-ms-viewport { + width: device-width; +} + +.hidden { + display: none; + visibility: hidden; +} + +.visible-phone { + display: none !important; +} + +.visible-tablet { + display: none !important; +} + +.hidden-desktop { + display: none !important; +} + +.visible-desktop { + display: inherit !important; +} + +@media (min-width: 768px) and (max-width: 979px) { + .hidden-desktop { + display: inherit !important; + } + .visible-desktop { + display: none !important ; + } + .visible-tablet { + display: inherit !important; + } + .hidden-tablet { + display: none !important; + } +} + +@media (max-width: 767px) { + .hidden-desktop { + display: inherit !important; + } + .visible-desktop { + display: none !important; + } + .visible-phone { + display: inherit !important; + } + .hidden-phone { + display: none !important; + } +} + +.visible-print { + display: none !important; +} + +@media print { + .visible-print { + display: inherit !important; + } + .hidden-print { + display: none !important; + } +} + +@media (min-width: 1200px) { + .row { + margin-left: -30px; + *zoom: 1; + } + .row:before, + .row:after { + display: table; + line-height: 0; + content: ""; + } + .row:after { + clear: both; + } + [class*="span"] { + float: left; + min-height: 1px; + margin-left: 30px; + } + .container, + .navbar-static-top .container, + .navbar-fixed-top .container, + .navbar-fixed-bottom .container { + width: 1170px; + } + .span12 { + width: 1170px; + } + .span11 { + width: 1070px; + } + .span10 { + width: 970px; + } + .span9 { + width: 870px; + } + .span8 { + width: 770px; + } + .span7 { + width: 670px; + } + .span6 { + width: 570px; + } + .span5 { + width: 470px; + } + .span4 { + width: 370px; + } + .span3 { + width: 270px; + } + .span2 { + width: 170px; + } + .span1 { + width: 70px; + } + .offset12 { + margin-left: 1230px; + } + .offset11 { + margin-left: 1130px; + } + .offset10 { + margin-left: 1030px; + } + .offset9 { + margin-left: 930px; + } + .offset8 { + margin-left: 830px; + } + .offset7 { + margin-left: 730px; + } + .offset6 { + margin-left: 630px; + } + .offset5 { + margin-left: 530px; + } + .offset4 { + margin-left: 430px; + } + .offset3 { + margin-left: 330px; + } + .offset2 { + margin-left: 230px; + } + .offset1 { + margin-left: 130px; + } + .row-fluid { + width: 100%; + *zoom: 1; + } + .row-fluid:before, + .row-fluid:after { + display: table; + line-height: 0; + content: ""; + } + .row-fluid:after { + clear: both; + } + .row-fluid [class*="span"] { + display: block; + float: left; + width: 100%; + min-height: 30px; + margin-left: 2.564102564102564%; + *margin-left: 2.5109110747408616%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + .row-fluid [class*="span"]:first-child { + margin-left: 0; + } + .row-fluid .controls-row [class*="span"] + [class*="span"] { + margin-left: 2.564102564102564%; + } + .row-fluid .span12 { + width: 100%; + *width: 99.94680851063829%; + } + .row-fluid .span11 { + width: 91.45299145299145%; + *width: 91.39979996362975%; + } + .row-fluid .span10 { + width: 82.90598290598291%; + *width: 82.8527914166212%; + } + .row-fluid .span9 { + width: 74.35897435897436%; + *width: 74.30578286961266%; + } + .row-fluid .span8 { + width: 65.81196581196582%; + *width: 65.75877432260411%; + } + .row-fluid .span7 { + width: 57.26495726495726%; + *width: 57.21176577559556%; + } + .row-fluid .span6 { + width: 48.717948717948715%; + *width: 48.664757228587014%; + } + .row-fluid .span5 { + width: 40.17094017094017%; + *width: 40.11774868157847%; + } + .row-fluid .span4 { + width: 31.623931623931625%; + *width: 31.570740134569924%; + } + .row-fluid .span3 { + width: 23.076923076923077%; + *width: 23.023731587561375%; + } + .row-fluid .span2 { + width: 14.52991452991453%; + *width: 14.476723040552828%; + } + .row-fluid .span1 { + width: 5.982905982905983%; + *width: 5.929714493544281%; + } + .row-fluid .offset12 { + margin-left: 105.12820512820512%; + *margin-left: 105.02182214948171%; + } + .row-fluid .offset12:first-child { + margin-left: 102.56410256410257%; + *margin-left: 102.45771958537915%; + } + .row-fluid .offset11 { + margin-left: 96.58119658119658%; + *margin-left: 96.47481360247316%; + } + .row-fluid .offset11:first-child { + margin-left: 94.01709401709402%; + *margin-left: 93.91071103837061%; + } + .row-fluid .offset10 { + margin-left: 88.03418803418803%; + *margin-left: 87.92780505546462%; + } + .row-fluid .offset10:first-child { + margin-left: 85.47008547008548%; + *margin-left: 85.36370249136206%; + } + .row-fluid .offset9 { + margin-left: 79.48717948717949%; + *margin-left: 79.38079650845607%; + } + .row-fluid .offset9:first-child { + margin-left: 76.92307692307693%; + *margin-left: 76.81669394435352%; + } + .row-fluid .offset8 { + margin-left: 70.94017094017094%; + *margin-left: 70.83378796144753%; + } + .row-fluid .offset8:first-child { + margin-left: 68.37606837606839%; + *margin-left: 68.26968539734497%; + } + .row-fluid .offset7 { + margin-left: 62.393162393162385%; + *margin-left: 62.28677941443899%; + } + .row-fluid .offset7:first-child { + margin-left: 59.82905982905982%; + *margin-left: 59.72267685033642%; + } + .row-fluid .offset6 { + margin-left: 53.84615384615384%; + *margin-left: 53.739770867430444%; + } + .row-fluid .offset6:first-child { + margin-left: 51.28205128205128%; + *margin-left: 51.175668303327875%; + } + .row-fluid .offset5 { + margin-left: 45.299145299145295%; + *margin-left: 45.1927623204219%; + } + .row-fluid .offset5:first-child { + margin-left: 42.73504273504273%; + *margin-left: 42.62865975631933%; + } + .row-fluid .offset4 { + margin-left: 36.75213675213675%; + *margin-left: 36.645753773413354%; + } + .row-fluid .offset4:first-child { + margin-left: 34.18803418803419%; + *margin-left: 34.081651209310785%; + } + .row-fluid .offset3 { + margin-left: 28.205128205128204%; + *margin-left: 28.0987452264048%; + } + .row-fluid .offset3:first-child { + margin-left: 25.641025641025642%; + *margin-left: 25.53464266230224%; + } + .row-fluid .offset2 { + margin-left: 19.65811965811966%; + *margin-left: 19.551736679396257%; + } + .row-fluid .offset2:first-child { + margin-left: 17.094017094017094%; + *margin-left: 16.98763411529369%; + } + .row-fluid .offset1 { + margin-left: 11.11111111111111%; + *margin-left: 11.004728132387708%; + } + .row-fluid .offset1:first-child { + margin-left: 8.547008547008547%; + *margin-left: 8.440625568285142%; + } + input, + textarea, + .uneditable-input { + margin-left: 0; + } + .controls-row [class*="span"] + [class*="span"] { + margin-left: 30px; + } + input.span12, + textarea.span12, + .uneditable-input.span12 { + width: 1156px; + } + input.span11, + textarea.span11, + .uneditable-input.span11 { + width: 1056px; + } + input.span10, + textarea.span10, + .uneditable-input.span10 { + width: 956px; + } + input.span9, + textarea.span9, + .uneditable-input.span9 { + width: 856px; + } + input.span8, + textarea.span8, + .uneditable-input.span8 { + width: 756px; + } + input.span7, + textarea.span7, + .uneditable-input.span7 { + width: 656px; + } + input.span6, + textarea.span6, + .uneditable-input.span6 { + width: 556px; + } + input.span5, + textarea.span5, + .uneditable-input.span5 { + width: 456px; + } + input.span4, + textarea.span4, + .uneditable-input.span4 { + width: 356px; + } + input.span3, + textarea.span3, + .uneditable-input.span3 { + width: 256px; + } + input.span2, + textarea.span2, + .uneditable-input.span2 { + width: 156px; + } + input.span1, + textarea.span1, + .uneditable-input.span1 { + width: 56px; + } + .thumbnails { + margin-left: -30px; + } + .thumbnails > li { + margin-left: 30px; + } + .row-fluid .thumbnails { + margin-left: 0; + } +} + +@media (min-width: 768px) and (max-width: 979px) { + .row { + margin-left: -20px; + *zoom: 1; + } + .row:before, + .row:after { + display: table; + line-height: 0; + content: ""; + } + .row:after { + clear: both; + } + [class*="span"] { + float: left; + min-height: 1px; + margin-left: 20px; + } + .container, + .navbar-static-top .container, + .navbar-fixed-top .container, + .navbar-fixed-bottom .container { + width: 724px; + } + .span12 { + width: 724px; + } + .span11 { + width: 662px; + } + .span10 { + width: 600px; + } + .span9 { + width: 538px; + } + .span8 { + width: 476px; + } + .span7 { + width: 414px; + } + .span6 { + width: 352px; + } + .span5 { + width: 290px; + } + .span4 { + width: 228px; + } + .span3 { + width: 166px; + } + .span2 { + width: 104px; + } + .span1 { + width: 42px; + } + .offset12 { + margin-left: 764px; + } + .offset11 { + margin-left: 702px; + } + .offset10 { + margin-left: 640px; + } + .offset9 { + margin-left: 578px; + } + .offset8 { + margin-left: 516px; + } + .offset7 { + margin-left: 454px; + } + .offset6 { + margin-left: 392px; + } + .offset5 { + margin-left: 330px; + } + .offset4 { + margin-left: 268px; + } + .offset3 { + margin-left: 206px; + } + .offset2 { + margin-left: 144px; + } + .offset1 { + margin-left: 82px; + } + .row-fluid { + width: 100%; + *zoom: 1; + } + .row-fluid:before, + .row-fluid:after { + display: table; + line-height: 0; + content: ""; + } + .row-fluid:after { + clear: both; + } + .row-fluid [class*="span"] { + display: block; + float: left; + width: 100%; + min-height: 30px; + margin-left: 2.7624309392265194%; + *margin-left: 2.709239449864817%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + .row-fluid [class*="span"]:first-child { + margin-left: 0; + } + .row-fluid .controls-row [class*="span"] + [class*="span"] { + margin-left: 2.7624309392265194%; + } + .row-fluid .span12 { + width: 100%; + *width: 99.94680851063829%; + } + .row-fluid .span11 { + width: 91.43646408839778%; + *width: 91.38327259903608%; + } + .row-fluid .span10 { + width: 82.87292817679558%; + *width: 82.81973668743387%; + } + .row-fluid .span9 { + width: 74.30939226519337%; + *width: 74.25620077583166%; + } + .row-fluid .span8 { + width: 65.74585635359117%; + *width: 65.69266486422946%; + } + .row-fluid .span7 { + width: 57.18232044198895%; + *width: 57.12912895262725%; + } + .row-fluid .span6 { + width: 48.61878453038674%; + *width: 48.56559304102504%; + } + .row-fluid .span5 { + width: 40.05524861878453%; + *width: 40.00205712942283%; + } + .row-fluid .span4 { + width: 31.491712707182323%; + *width: 31.43852121782062%; + } + .row-fluid .span3 { + width: 22.92817679558011%; + *width: 22.87498530621841%; + } + .row-fluid .span2 { + width: 14.3646408839779%; + *width: 14.311449394616199%; + } + .row-fluid .span1 { + width: 5.801104972375691%; + *width: 5.747913483013988%; + } + .row-fluid .offset12 { + margin-left: 105.52486187845304%; + *margin-left: 105.41847889972962%; + } + .row-fluid .offset12:first-child { + margin-left: 102.76243093922652%; + *margin-left: 102.6560479605031%; + } + .row-fluid .offset11 { + margin-left: 96.96132596685082%; + *margin-left: 96.8549429881274%; + } + .row-fluid .offset11:first-child { + margin-left: 94.1988950276243%; + *margin-left: 94.09251204890089%; + } + .row-fluid .offset10 { + margin-left: 88.39779005524862%; + *margin-left: 88.2914070765252%; + } + .row-fluid .offset10:first-child { + margin-left: 85.6353591160221%; + *margin-left: 85.52897613729868%; + } + .row-fluid .offset9 { + margin-left: 79.8342541436464%; + *margin-left: 79.72787116492299%; + } + .row-fluid .offset9:first-child { + margin-left: 77.07182320441989%; + *margin-left: 76.96544022569647%; + } + .row-fluid .offset8 { + margin-left: 71.2707182320442%; + *margin-left: 71.16433525332079%; + } + .row-fluid .offset8:first-child { + margin-left: 68.50828729281768%; + *margin-left: 68.40190431409427%; + } + .row-fluid .offset7 { + margin-left: 62.70718232044199%; + *margin-left: 62.600799341718584%; + } + .row-fluid .offset7:first-child { + margin-left: 59.94475138121547%; + *margin-left: 59.838368402492065%; + } + .row-fluid .offset6 { + margin-left: 54.14364640883978%; + *margin-left: 54.037263430116376%; + } + .row-fluid .offset6:first-child { + margin-left: 51.38121546961326%; + *margin-left: 51.27483249088986%; + } + .row-fluid .offset5 { + margin-left: 45.58011049723757%; + *margin-left: 45.47372751851417%; + } + .row-fluid .offset5:first-child { + margin-left: 42.81767955801105%; + *margin-left: 42.71129657928765%; + } + .row-fluid .offset4 { + margin-left: 37.01657458563536%; + *margin-left: 36.91019160691196%; + } + .row-fluid .offset4:first-child { + margin-left: 34.25414364640884%; + *margin-left: 34.14776066768544%; + } + .row-fluid .offset3 { + margin-left: 28.45303867403315%; + *margin-left: 28.346655695309746%; + } + .row-fluid .offset3:first-child { + margin-left: 25.69060773480663%; + *margin-left: 25.584224756083227%; + } + .row-fluid .offset2 { + margin-left: 19.88950276243094%; + *margin-left: 19.783119783707537%; + } + .row-fluid .offset2:first-child { + margin-left: 17.12707182320442%; + *margin-left: 17.02068884448102%; + } + .row-fluid .offset1 { + margin-left: 11.32596685082873%; + *margin-left: 11.219583872105325%; + } + .row-fluid .offset1:first-child { + margin-left: 8.56353591160221%; + *margin-left: 8.457152932878806%; + } + input, + textarea, + .uneditable-input { + margin-left: 0; + } + .controls-row [class*="span"] + [class*="span"] { + margin-left: 20px; + } + input.span12, + textarea.span12, + .uneditable-input.span12 { + width: 710px; + } + input.span11, + textarea.span11, + .uneditable-input.span11 { + width: 648px; + } + input.span10, + textarea.span10, + .uneditable-input.span10 { + width: 586px; + } + input.span9, + textarea.span9, + .uneditable-input.span9 { + width: 524px; + } + input.span8, + textarea.span8, + .uneditable-input.span8 { + width: 462px; + } + input.span7, + textarea.span7, + .uneditable-input.span7 { + width: 400px; + } + input.span6, + textarea.span6, + .uneditable-input.span6 { + width: 338px; + } + input.span5, + textarea.span5, + .uneditable-input.span5 { + width: 276px; + } + input.span4, + textarea.span4, + .uneditable-input.span4 { + width: 214px; + } + input.span3, + textarea.span3, + .uneditable-input.span3 { + width: 152px; + } + input.span2, + textarea.span2, + .uneditable-input.span2 { + width: 90px; + } + input.span1, + textarea.span1, + .uneditable-input.span1 { + width: 28px; + } +} + +@media (max-width: 767px) { + body { + padding-right: 20px; + padding-left: 20px; + } + .navbar-fixed-top, + .navbar-fixed-bottom, + .navbar-static-top { + margin-right: -20px; + margin-left: -20px; + } + .container-fluid { + padding: 0; + } + .dl-horizontal dt { + float: none; + width: auto; + clear: none; + text-align: left; + } + .dl-horizontal dd { + margin-left: 0; + } + .container { + width: auto; + } + .row-fluid { + width: 100%; + } + .row, + .thumbnails { + margin-left: 0; + } + .thumbnails > li { + float: none; + margin-left: 0; + } + [class*="span"], + .uneditable-input[class*="span"], + .row-fluid [class*="span"] { + display: block; + float: none; + width: 100%; + margin-left: 0; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + .span12, + .row-fluid .span12 { + width: 100%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + .row-fluid [class*="offset"]:first-child { + margin-left: 0; + } + .input-large, + .input-xlarge, + .input-xxlarge, + input[class*="span"], + select[class*="span"], + textarea[class*="span"], + .uneditable-input { + display: block; + width: 100%; + min-height: 30px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + } + .input-prepend input, + .input-append input, + .input-prepend input[class*="span"], + .input-append input[class*="span"] { + display: inline-block; + width: auto; + } + .controls-row [class*="span"] + [class*="span"] { + margin-left: 0; + } + .modal { + position: fixed; + top: 20px; + right: 20px; + left: 20px; + width: auto; + margin: 0; + } + .modal.fade { + top: -100px; + } + .modal.fade.in { + top: 20px; + } +} + +@media (max-width: 480px) { + .nav-collapse { + -webkit-transform: translate3d(0, 0, 0); + } + .page-header h1 small { + display: block; + line-height: 20px; + } + input[type="checkbox"], + input[type="radio"] { + border: 1px solid #ccc; + } + .form-horizontal .control-label { + float: none; + width: auto; + padding-top: 0; + text-align: left; + } + .form-horizontal .controls { + margin-left: 0; + } + .form-horizontal .control-list { + padding-top: 0; + } + .form-horizontal .form-actions { + padding-right: 10px; + padding-left: 10px; + } + .media .pull-left, + .media .pull-right { + display: block; + float: none; + margin-bottom: 10px; + } + .media-object { + margin-right: 0; + margin-left: 0; + } + .modal { + top: 10px; + right: 10px; + left: 10px; + } + .modal-header .close { + padding: 10px; + margin: -10px; + } + .carousel-caption { + position: static; + } +} + +@media (max-width: 979px) { + body { + padding-top: 0; + } + .navbar-fixed-top, + .navbar-fixed-bottom { + position: static; + } + .navbar-fixed-top { + margin-bottom: 20px; + } + .navbar-fixed-bottom { + margin-top: 20px; + } + .navbar-fixed-top .navbar-inner, + .navbar-fixed-bottom .navbar-inner { + padding: 5px; + } + .navbar .container { + width: auto; + padding: 0; + } + .navbar .brand { + padding-right: 10px; + padding-left: 10px; + margin: 0 0 0 -5px; + } + .nav-collapse { + clear: both; + } + .nav-collapse .nav { + float: none; + margin: 0 0 10px; + } + .nav-collapse .nav > li { + float: none; + } + .nav-collapse .nav > li > a { + margin-bottom: 2px; + } + .nav-collapse .nav > .divider-vertical { + display: none; + } + .nav-collapse .nav .nav-header { + color: #777777; + text-shadow: none; + } + .nav-collapse .nav > li > a, + .nav-collapse .dropdown-menu a { + padding: 9px 15px; + font-weight: bold; + color: #777777; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + } + .nav-collapse .btn { + padding: 4px 10px 4px; + font-weight: normal; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + } + .nav-collapse .dropdown-menu li + li a { + margin-bottom: 2px; + } + .nav-collapse .nav > li > a:hover, + .nav-collapse .nav > li > a:focus, + .nav-collapse .dropdown-menu a:hover, + .nav-collapse .dropdown-menu a:focus { + background-color: #f2f2f2; + } + .navbar-inverse .nav-collapse .nav > li > a, + .navbar-inverse .nav-collapse .dropdown-menu a { + color: #999999; + } + .navbar-inverse .nav-collapse .nav > li > a:hover, + .navbar-inverse .nav-collapse .nav > li > a:focus, + .navbar-inverse .nav-collapse .dropdown-menu a:hover, + .navbar-inverse .nav-collapse .dropdown-menu a:focus { + background-color: #111111; + } + .nav-collapse.in .btn-group { + padding: 0; + margin-top: 5px; + } + .nav-collapse .dropdown-menu { + position: static; + top: auto; + left: auto; + display: none; + float: none; + max-width: none; + padding: 0; + margin: 0 15px; + background-color: transparent; + border: none; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + } + .nav-collapse .open > .dropdown-menu { + display: block; + } + .nav-collapse .dropdown-menu:before, + .nav-collapse .dropdown-menu:after { + display: none; + } + .nav-collapse .dropdown-menu .divider { + display: none; + } + .nav-collapse .nav > li > .dropdown-menu:before, + .nav-collapse .nav > li > .dropdown-menu:after { + display: none; + } + .nav-collapse .navbar-form, + .nav-collapse .navbar-search { + float: none; + padding: 10px 15px; + margin: 10px 0; + border-top: 1px solid #f2f2f2; + border-bottom: 1px solid #f2f2f2; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + } + .navbar-inverse .nav-collapse .navbar-form, + .navbar-inverse .nav-collapse .navbar-search { + border-top-color: #111111; + border-bottom-color: #111111; + } + .navbar .nav-collapse .nav.pull-right { + float: none; + margin-left: 0; + } + .nav-collapse, + .nav-collapse.collapse { + height: 0; + overflow: hidden; + } + .navbar .btn-navbar { + display: block; + } + .navbar-static .navbar-inner { + padding-right: 10px; + padding-left: 10px; + } +} + +@media (min-width: 980px) { + .nav-collapse.collapse { + height: auto !important; + overflow: visible !important; + } +} diff --git a/crm/src/main/webapp/FooTable/bootstrap/bootstrap-tab.js b/crm/src/main/webapp/FooTable/bootstrap/bootstrap-tab.js new file mode 100644 index 0000000..1d23df6 --- /dev/null +++ b/crm/src/main/webapp/FooTable/bootstrap/bootstrap-tab.js @@ -0,0 +1,144 @@ +/* ======================================================== + * bootstrap-tab.js v2.3.1 + * http://twitter.github.com/bootstrap/javascript.html#tabs + * ======================================================== + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ======================================================== */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* TAB CLASS DEFINITION + * ==================== */ + + var Tab = function (element) { + this.element = $(element) + } + + Tab.prototype = { + + constructor: Tab + + , show: function () { + var $this = this.element + , $ul = $this.closest('ul:not(.dropdown-menu)') + , selector = $this.attr('data-target') + , previous + , $target + , e + + if (!selector) { + selector = $this.attr('href') + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 + } + + if ( $this.parent('li').hasClass('active') ) return + + previous = $ul.find('.active:last a')[0] + + e = $.Event('show', { + relatedTarget: previous + }) + + $this.trigger(e) + + if (e.isDefaultPrevented()) return + + $target = $(selector) + + this.activate($this.parent('li'), $ul) + this.activate($target, $target.parent(), function () { + $this.trigger({ + type: 'shown' + , relatedTarget: previous + }) + }) + } + + , activate: function ( element, container, callback) { + var $active = container.find('> .active') + , transition = callback + && $.support.transition + && $active.hasClass('fade') + + function next() { + $active + .removeClass('active') + .find('> .dropdown-menu > .active') + .removeClass('active') + + element.addClass('active') + + if (transition) { + element[0].offsetWidth // reflow for transition + element.addClass('in') + } else { + element.removeClass('fade') + } + + if ( element.parent('.dropdown-menu') ) { + element.closest('li.dropdown').addClass('active') + } + + callback && callback() + } + + transition ? + $active.one($.support.transition.end, next) : + next() + + $active.removeClass('in') + } + } + + + /* TAB PLUGIN DEFINITION + * ===================== */ + + var old = $.fn.tab + + $.fn.tab = function ( option ) { + return this.each(function () { + var $this = $(this) + , data = $this.data('tab') + if (!data) $this.data('tab', (data = new Tab(this))) + if (typeof option == 'string') data[option]() + }) + } + + $.fn.tab.Constructor = Tab + + + /* TAB NO CONFLICT + * =============== */ + + $.fn.tab.noConflict = function () { + $.fn.tab = old + return this + } + + + /* TAB DATA-API + * ============ */ + + $(document).on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) { + e.preventDefault() + $(this).tab('show') + }) + +}(window.jQuery); \ No newline at end of file diff --git a/crm/src/main/webapp/FooTable/bootstrap/bootstrap.css b/crm/src/main/webapp/FooTable/bootstrap/bootstrap.css new file mode 100644 index 0000000..2f56af3 --- /dev/null +++ b/crm/src/main/webapp/FooTable/bootstrap/bootstrap.css @@ -0,0 +1,6158 @@ +/*! + * Bootstrap v2.3.1 + * + * Copyright 2012 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + */ + +.clearfix { + *zoom: 1; +} + +.clearfix:before, +.clearfix:after { + display: table; + line-height: 0; + content: ""; +} + +.clearfix:after { + clear: both; +} + +.hide-text { + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0; +} + +.input-block-level { + display: block; + width: 100%; + min-height: 30px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +nav, +section { + display: block; +} + +audio, +canvas, +video { + display: inline-block; + *display: inline; + *zoom: 1; +} + +audio:not([controls]) { + display: none; +} + +html { + font-size: 100%; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; +} + +a:focus { + outline: thin dotted #333; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} + +a:hover, +a:active { + outline: 0; +} + +sub, +sup { + position: relative; + font-size: 75%; + line-height: 0; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +img { + width: auto\9; + height: auto; + max-width: 100%; + vertical-align: middle; + border: 0; + -ms-interpolation-mode: bicubic; +} + +#map_canvas img, +.google-maps img { + max-width: none; +} + +button, +input, +select, +textarea { + margin: 0; + font-size: 100%; + vertical-align: middle; +} + +button, +input { + *overflow: visible; + line-height: normal; +} + +button::-moz-focus-inner, +input::-moz-focus-inner { + padding: 0; + border: 0; +} + +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + cursor: pointer; + -webkit-appearance: button; +} + +label, +select, +button, +input[type="button"], +input[type="reset"], +input[type="submit"], +input[type="radio"], +input[type="checkbox"] { + cursor: pointer; +} + +input[type="search"] { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + -webkit-appearance: textfield; +} + +input[type="search"]::-webkit-search-decoration, +input[type="search"]::-webkit-search-cancel-button { + -webkit-appearance: none; +} + +textarea { + overflow: auto; + vertical-align: top; +} + +@media print { + * { + color: #000 !important; + text-shadow: none !important; + background: transparent !important; + box-shadow: none !important; + } + a, + a:visited { + text-decoration: underline; + } + a[href]:after { + content: " (" attr(href) ")"; + } + abbr[title]:after { + content: " (" attr(title) ")"; + } + .ir a:after, + a[href^="javascript:"]:after, + a[href^="#"]:after { + content: ""; + } + pre, + blockquote { + border: 1px solid #999; + page-break-inside: avoid; + } + thead { + display: table-header-group; + } + tr, + img { + page-break-inside: avoid; + } + img { + max-width: 100% !important; + } + @page { + margin: 0.5cm; + } + p, + h2, + h3 { + orphans: 3; + widows: 3; + } + h2, + h3 { + page-break-after: avoid; + } +} + +body { + margin: 0; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 20px; + color: #333333; + background-color: #ffffff; +} + +a { + color: #0088cc; + text-decoration: none; +} + +a:hover, +a:focus { + color: #005580; + text-decoration: underline; +} + +.img-rounded { + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; +} + +.img-polaroid { + padding: 4px; + background-color: #fff; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.2); + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); +} + +.img-circle { + -webkit-border-radius: 500px; + -moz-border-radius: 500px; + border-radius: 500px; +} + +.row { + margin-left: -20px; + *zoom: 1; +} + +.row:before, +.row:after { + display: table; + line-height: 0; + content: ""; +} + +.row:after { + clear: both; +} + +[class*="span"] { + float: left; + min-height: 1px; + margin-left: 20px; +} + +.container, +.navbar-static-top .container, +.navbar-fixed-top .container, +.navbar-fixed-bottom .container { + width: 940px; +} + +.span12 { + width: 940px; +} + +.span11 { + width: 860px; +} + +.span10 { + width: 780px; +} + +.span9 { + width: 700px; +} + +.span8 { + width: 620px; +} + +.span7 { + width: 540px; +} + +.span6 { + width: 460px; +} + +.span5 { + width: 380px; +} + +.span4 { + width: 300px; +} + +.span3 { + width: 220px; +} + +.span2 { + width: 140px; +} + +.span1 { + width: 60px; +} + +.offset12 { + margin-left: 980px; +} + +.offset11 { + margin-left: 900px; +} + +.offset10 { + margin-left: 820px; +} + +.offset9 { + margin-left: 740px; +} + +.offset8 { + margin-left: 660px; +} + +.offset7 { + margin-left: 580px; +} + +.offset6 { + margin-left: 500px; +} + +.offset5 { + margin-left: 420px; +} + +.offset4 { + margin-left: 340px; +} + +.offset3 { + margin-left: 260px; +} + +.offset2 { + margin-left: 180px; +} + +.offset1 { + margin-left: 100px; +} + +.row-fluid { + width: 100%; + *zoom: 1; +} + +.row-fluid:before, +.row-fluid:after { + display: table; + line-height: 0; + content: ""; +} + +.row-fluid:after { + clear: both; +} + +.row-fluid [class*="span"] { + display: block; + float: left; + width: 100%; + min-height: 30px; + margin-left: 2.127659574468085%; + *margin-left: 2.074468085106383%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.row-fluid [class*="span"]:first-child { + margin-left: 0; +} + +.row-fluid .controls-row [class*="span"] + [class*="span"] { + margin-left: 2.127659574468085%; +} + +.row-fluid .span12 { + width: 100%; + *width: 99.94680851063829%; +} + +.row-fluid .span11 { + width: 91.48936170212765%; + *width: 91.43617021276594%; +} + +.row-fluid .span10 { + width: 82.97872340425532%; + *width: 82.92553191489361%; +} + +.row-fluid .span9 { + width: 74.46808510638297%; + *width: 74.41489361702126%; +} + +.row-fluid .span8 { + width: 65.95744680851064%; + *width: 65.90425531914893%; +} + +.row-fluid .span7 { + width: 57.44680851063829%; + *width: 57.39361702127659%; +} + +.row-fluid .span6 { + width: 48.93617021276595%; + *width: 48.88297872340425%; +} + +.row-fluid .span5 { + width: 40.42553191489362%; + *width: 40.37234042553192%; +} + +.row-fluid .span4 { + width: 31.914893617021278%; + *width: 31.861702127659576%; +} + +.row-fluid .span3 { + width: 23.404255319148934%; + *width: 23.351063829787233%; +} + +.row-fluid .span2 { + width: 14.893617021276595%; + *width: 14.840425531914894%; +} + +.row-fluid .span1 { + width: 6.382978723404255%; + *width: 6.329787234042553%; +} + +.row-fluid .offset12 { + margin-left: 104.25531914893617%; + *margin-left: 104.14893617021275%; +} + +.row-fluid .offset12:first-child { + margin-left: 102.12765957446808%; + *margin-left: 102.02127659574467%; +} + +.row-fluid .offset11 { + margin-left: 95.74468085106382%; + *margin-left: 95.6382978723404%; +} + +.row-fluid .offset11:first-child { + margin-left: 93.61702127659574%; + *margin-left: 93.51063829787232%; +} + +.row-fluid .offset10 { + margin-left: 87.23404255319149%; + *margin-left: 87.12765957446807%; +} + +.row-fluid .offset10:first-child { + margin-left: 85.1063829787234%; + *margin-left: 84.99999999999999%; +} + +.row-fluid .offset9 { + margin-left: 78.72340425531914%; + *margin-left: 78.61702127659572%; +} + +.row-fluid .offset9:first-child { + margin-left: 76.59574468085106%; + *margin-left: 76.48936170212764%; +} + +.row-fluid .offset8 { + margin-left: 70.2127659574468%; + *margin-left: 70.10638297872339%; +} + +.row-fluid .offset8:first-child { + margin-left: 68.08510638297872%; + *margin-left: 67.9787234042553%; +} + +.row-fluid .offset7 { + margin-left: 61.70212765957446%; + *margin-left: 61.59574468085106%; +} + +.row-fluid .offset7:first-child { + margin-left: 59.574468085106375%; + *margin-left: 59.46808510638297%; +} + +.row-fluid .offset6 { + margin-left: 53.191489361702125%; + *margin-left: 53.085106382978715%; +} + +.row-fluid .offset6:first-child { + margin-left: 51.063829787234035%; + *margin-left: 50.95744680851063%; +} + +.row-fluid .offset5 { + margin-left: 44.68085106382979%; + *margin-left: 44.57446808510638%; +} + +.row-fluid .offset5:first-child { + margin-left: 42.5531914893617%; + *margin-left: 42.4468085106383%; +} + +.row-fluid .offset4 { + margin-left: 36.170212765957444%; + *margin-left: 36.06382978723405%; +} + +.row-fluid .offset4:first-child { + margin-left: 34.04255319148936%; + *margin-left: 33.93617021276596%; +} + +.row-fluid .offset3 { + margin-left: 27.659574468085104%; + *margin-left: 27.5531914893617%; +} + +.row-fluid .offset3:first-child { + margin-left: 25.53191489361702%; + *margin-left: 25.425531914893618%; +} + +.row-fluid .offset2 { + margin-left: 19.148936170212764%; + *margin-left: 19.04255319148936%; +} + +.row-fluid .offset2:first-child { + margin-left: 17.02127659574468%; + *margin-left: 16.914893617021278%; +} + +.row-fluid .offset1 { + margin-left: 10.638297872340425%; + *margin-left: 10.53191489361702%; +} + +.row-fluid .offset1:first-child { + margin-left: 8.51063829787234%; + *margin-left: 8.404255319148938%; +} + +[class*="span"].hide, +.row-fluid [class*="span"].hide { + display: none; +} + +[class*="span"].pull-right, +.row-fluid [class*="span"].pull-right { + float: right; +} + +.container { + margin-right: auto; + margin-left: auto; + *zoom: 1; +} + +.container:before, +.container:after { + display: table; + line-height: 0; + content: ""; +} + +.container:after { + clear: both; +} + +.container-fluid { + padding-right: 20px; + padding-left: 20px; + *zoom: 1; +} + +.container-fluid:before, +.container-fluid:after { + display: table; + line-height: 0; + content: ""; +} + +.container-fluid:after { + clear: both; +} + +p { + margin: 0 0 10px; +} + +.lead { + margin-bottom: 20px; + font-size: 21px; + font-weight: 200; + line-height: 30px; +} + +small { + font-size: 85%; +} + +strong { + font-weight: bold; +} + +em { + font-style: italic; +} + +cite { + font-style: normal; +} + +.muted { + color: #999999; +} + +a.muted:hover, +a.muted:focus { + color: #808080; +} + +.text-warning { + color: #c09853; +} + +a.text-warning:hover, +a.text-warning:focus { + color: #a47e3c; +} + +.text-error { + color: #b94a48; +} + +a.text-error:hover, +a.text-error:focus { + color: #953b39; +} + +.text-info { + color: #3a87ad; +} + +a.text-info:hover, +a.text-info:focus { + color: #2d6987; +} + +.text-success { + color: #468847; +} + +a.text-success:hover, +a.text-success:focus { + color: #356635; +} + +.text-left { + text-align: left; +} + +.text-right { + text-align: right; +} + +.text-center { + text-align: center; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + margin: 10px 0; + font-family: inherit; + font-weight: bold; + line-height: 20px; + color: inherit; + text-rendering: optimizelegibility; +} + +h1 small, +h2 small, +h3 small, +h4 small, +h5 small, +h6 small { + font-weight: normal; + line-height: 1; + color: #999999; +} + +h1, +h2, +h3 { + line-height: 40px; +} + +h1 { + font-size: 38.5px; +} + +h2 { + font-size: 31.5px; +} + +h3 { + font-size: 24.5px; +} + +h4 { + font-size: 17.5px; +} + +h5 { + font-size: 14px; +} + +h6 { + font-size: 11.9px; +} + +h1 small { + font-size: 24.5px; +} + +h2 small { + font-size: 17.5px; +} + +h3 small { + font-size: 14px; +} + +h4 small { + font-size: 14px; +} + +.page-header { + padding-bottom: 9px; + margin: 20px 0 30px; + border-bottom: 1px solid #eeeeee; +} + +ul, +ol { + padding: 0; + margin: 0 0 10px 25px; +} + +ul ul, +ul ol, +ol ol, +ol ul { + margin-bottom: 0; +} + +li { + line-height: 20px; +} + +ul.unstyled, +ol.unstyled { + margin-left: 0; + list-style: none; +} + +ul.inline, +ol.inline { + margin-left: 0; + list-style: none; +} + +ul.inline > li, +ol.inline > li { + display: inline-block; + *display: inline; + padding-right: 5px; + padding-left: 5px; + *zoom: 1; +} + +dl { + margin-bottom: 20px; +} + +dt, +dd { + line-height: 20px; +} + +dt { + font-weight: bold; +} + +dd { + margin-left: 10px; +} + +.dl-horizontal { + *zoom: 1; +} + +.dl-horizontal:before, +.dl-horizontal:after { + display: table; + line-height: 0; + content: ""; +} + +.dl-horizontal:after { + clear: both; +} + +.dl-horizontal dt { + float: left; + width: 160px; + overflow: hidden; + clear: left; + text-align: right; + text-overflow: ellipsis; + white-space: nowrap; +} + +.dl-horizontal dd { + margin-left: 180px; +} + +hr { + margin: 20px 0; + border: 0; + border-top: 1px solid #eeeeee; + border-bottom: 1px solid #ffffff; +} + +abbr[title], +abbr[data-original-title] { + cursor: help; + border-bottom: 1px dotted #999999; +} + +abbr.initialism { + font-size: 90%; + text-transform: uppercase; +} + +blockquote { + padding: 0 0 0 15px; + margin: 0 0 20px; + border-left: 5px solid #eeeeee; +} + +blockquote p { + margin-bottom: 0; + font-size: 17.5px; + font-weight: 300; + line-height: 1.25; +} + +blockquote small { + display: block; + line-height: 20px; + color: #999999; +} + +blockquote small:before { + content: '\2014 \00A0'; +} + +blockquote.pull-right { + float: right; + padding-right: 15px; + padding-left: 0; + border-right: 5px solid #eeeeee; + border-left: 0; +} + +blockquote.pull-right p, +blockquote.pull-right small { + text-align: right; +} + +blockquote.pull-right small:before { + content: ''; +} + +blockquote.pull-right small:after { + content: '\00A0 \2014'; +} + +q:before, +q:after, +blockquote:before, +blockquote:after { + content: ""; +} + +address { + display: block; + margin-bottom: 20px; + font-style: normal; + line-height: 20px; +} + +code, +pre { + padding: 0 3px 2px; + font-family: Monaco, Menlo, Consolas, "Courier New", monospace; + font-size: 12px; + color: #333333; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} + +code { + padding: 2px 4px; + color: #d14; + white-space: nowrap; + background-color: #f7f7f9; + border: 1px solid #e1e1e8; +} + +pre { + display: block; + padding: 9.5px; + margin: 0 0 10px; + font-size: 13px; + line-height: 20px; + word-break: break-all; + word-wrap: break-word; + white-space: pre; + white-space: pre-wrap; + background-color: #f5f5f5; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.15); + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} + +pre.prettyprint { + margin-bottom: 20px; +} + +pre code { + padding: 0; + color: inherit; + white-space: pre; + white-space: pre-wrap; + background-color: transparent; + border: 0; +} + +.pre-scrollable { + max-height: 340px; + overflow-y: scroll; +} + +form { + margin: 0 0 20px; +} + +fieldset { + padding: 0; + margin: 0; + border: 0; +} + +legend { + display: block; + width: 100%; + padding: 0; + margin-bottom: 20px; + font-size: 21px; + line-height: 40px; + color: #333333; + border: 0; + border-bottom: 1px solid #e5e5e5; +} + +legend small { + font-size: 15px; + color: #999999; +} + +label, +input, +button, +select, +textarea { + font-size: 14px; + font-weight: normal; + line-height: 20px; +} + +input, +button, +select, +textarea { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; +} + +label { + display: block; + margin-bottom: 5px; +} + +select, +textarea, +input[type="text"], +input[type="password"], +input[type="datetime"], +input[type="datetime-local"], +input[type="date"], +input[type="month"], +input[type="time"], +input[type="week"], +input[type="number"], +input[type="email"], +input[type="url"], +input[type="search"], +input[type="tel"], +input[type="color"], +.uneditable-input { + display: inline-block; + height: 20px; + padding: 4px 6px; + margin-bottom: 10px; + font-size: 14px; + line-height: 20px; + color: #555555; + vertical-align: middle; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} + +input, +textarea, +.uneditable-input { + width: 206px; +} + +textarea { + height: auto; +} + +textarea, +input[type="text"], +input[type="password"], +input[type="datetime"], +input[type="datetime-local"], +input[type="date"], +input[type="month"], +input[type="time"], +input[type="week"], +input[type="number"], +input[type="email"], +input[type="url"], +input[type="search"], +input[type="tel"], +input[type="color"], +.uneditable-input { + background-color: #ffffff; + border: 1px solid #cccccc; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-transition: border linear 0.2s, box-shadow linear 0.2s; + -moz-transition: border linear 0.2s, box-shadow linear 0.2s; + -o-transition: border linear 0.2s, box-shadow linear 0.2s; + transition: border linear 0.2s, box-shadow linear 0.2s; +} + +textarea:focus, +input[type="text"]:focus, +input[type="password"]:focus, +input[type="datetime"]:focus, +input[type="datetime-local"]:focus, +input[type="date"]:focus, +input[type="month"]:focus, +input[type="time"]:focus, +input[type="week"]:focus, +input[type="number"]:focus, +input[type="email"]:focus, +input[type="url"]:focus, +input[type="search"]:focus, +input[type="tel"]:focus, +input[type="color"]:focus, +.uneditable-input:focus { + border-color: rgba(82, 168, 236, 0.8); + outline: 0; + outline: thin dotted \9; + /* IE6-9 */ + + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); +} + +input[type="radio"], +input[type="checkbox"] { + margin: 4px 0 0; + margin-top: 1px \9; + *margin-top: 0; + line-height: normal; +} + +input[type="file"], +input[type="image"], +input[type="submit"], +input[type="reset"], +input[type="button"], +input[type="radio"], +input[type="checkbox"] { + width: auto; +} + +select, +input[type="file"] { + height: 30px; + /* In IE7, the height of the select element cannot be changed by height, only font-size */ + + *margin-top: 4px; + /* For IE7, add top margin to align select with labels */ + + line-height: 30px; +} + +select { + width: 220px; + background-color: #ffffff; + border: 1px solid #cccccc; +} + +select[multiple], +select[size] { + height: auto; +} + +select:focus, +input[type="file"]:focus, +input[type="radio"]:focus, +input[type="checkbox"]:focus { + outline: thin dotted #333; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} + +.uneditable-input, +.uneditable-textarea { + color: #999999; + cursor: not-allowed; + background-color: #fcfcfc; + border-color: #cccccc; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); + -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); +} + +.uneditable-input { + overflow: hidden; + white-space: nowrap; +} + +.uneditable-textarea { + width: auto; + height: auto; +} + +input:-moz-placeholder, +textarea:-moz-placeholder { + color: #999999; +} + +input:-ms-input-placeholder, +textarea:-ms-input-placeholder { + color: #999999; +} + +input::-webkit-input-placeholder, +textarea::-webkit-input-placeholder { + color: #999999; +} + +.radio, +.checkbox { + min-height: 20px; + padding-left: 20px; +} + +.radio input[type="radio"], +.checkbox input[type="checkbox"] { + float: left; + margin-left: -20px; +} + +.controls > .radio:first-child, +.controls > .checkbox:first-child { + padding-top: 5px; +} + +.radio.inline, +.checkbox.inline { + display: inline-block; + padding-top: 5px; + margin-bottom: 0; + vertical-align: middle; +} + +.radio.inline + .radio.inline, +.checkbox.inline + .checkbox.inline { + margin-left: 10px; +} + +.input-mini { + width: 60px; +} + +.input-small { + width: 90px; +} + +.input-medium { + width: 150px; +} + +.input-large { + width: 210px; +} + +.input-xlarge { + width: 270px; +} + +.input-xxlarge { + width: 530px; +} + +input[class*="span"], +select[class*="span"], +textarea[class*="span"], +.uneditable-input[class*="span"], +.row-fluid input[class*="span"], +.row-fluid select[class*="span"], +.row-fluid textarea[class*="span"], +.row-fluid .uneditable-input[class*="span"] { + float: none; + margin-left: 0; +} + +.input-append input[class*="span"], +.input-append .uneditable-input[class*="span"], +.input-prepend input[class*="span"], +.input-prepend .uneditable-input[class*="span"], +.row-fluid input[class*="span"], +.row-fluid select[class*="span"], +.row-fluid textarea[class*="span"], +.row-fluid .uneditable-input[class*="span"], +.row-fluid .input-prepend [class*="span"], +.row-fluid .input-append [class*="span"] { + display: inline-block; +} + +input, +textarea, +.uneditable-input { + margin-left: 0; +} + +.controls-row [class*="span"] + [class*="span"] { + margin-left: 20px; +} + +input.span12, +textarea.span12, +.uneditable-input.span12 { + width: 926px; +} + +input.span11, +textarea.span11, +.uneditable-input.span11 { + width: 846px; +} + +input.span10, +textarea.span10, +.uneditable-input.span10 { + width: 766px; +} + +input.span9, +textarea.span9, +.uneditable-input.span9 { + width: 686px; +} + +input.span8, +textarea.span8, +.uneditable-input.span8 { + width: 606px; +} + +input.span7, +textarea.span7, +.uneditable-input.span7 { + width: 526px; +} + +input.span6, +textarea.span6, +.uneditable-input.span6 { + width: 446px; +} + +input.span5, +textarea.span5, +.uneditable-input.span5 { + width: 366px; +} + +input.span4, +textarea.span4, +.uneditable-input.span4 { + width: 286px; +} + +input.span3, +textarea.span3, +.uneditable-input.span3 { + width: 206px; +} + +input.span2, +textarea.span2, +.uneditable-input.span2 { + width: 126px; +} + +input.span1, +textarea.span1, +.uneditable-input.span1 { + width: 46px; +} + +.controls-row { + *zoom: 1; +} + +.controls-row:before, +.controls-row:after { + display: table; + line-height: 0; + content: ""; +} + +.controls-row:after { + clear: both; +} + +.controls-row [class*="span"], +.row-fluid .controls-row [class*="span"] { + float: left; +} + +.controls-row .checkbox[class*="span"], +.controls-row .radio[class*="span"] { + padding-top: 5px; +} + +input[disabled], +select[disabled], +textarea[disabled], +input[readonly], +select[readonly], +textarea[readonly] { + cursor: not-allowed; + background-color: #eeeeee; +} + +input[type="radio"][disabled], +input[type="checkbox"][disabled], +input[type="radio"][readonly], +input[type="checkbox"][readonly] { + background-color: transparent; +} + +.control-group.warning .control-label, +.control-group.warning .help-block, +.control-group.warning .help-inline { + color: #c09853; +} + +.control-group.warning .checkbox, +.control-group.warning .radio, +.control-group.warning input, +.control-group.warning select, +.control-group.warning textarea { + color: #c09853; +} + +.control-group.warning input, +.control-group.warning select, +.control-group.warning textarea { + border-color: #c09853; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} + +.control-group.warning input:focus, +.control-group.warning select:focus, +.control-group.warning textarea:focus { + border-color: #a47e3c; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e; + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e; +} + +.control-group.warning .input-prepend .add-on, +.control-group.warning .input-append .add-on { + color: #c09853; + background-color: #fcf8e3; + border-color: #c09853; +} + +.control-group.error .control-label, +.control-group.error .help-block, +.control-group.error .help-inline { + color: #b94a48; +} + +.control-group.error .checkbox, +.control-group.error .radio, +.control-group.error input, +.control-group.error select, +.control-group.error textarea { + color: #b94a48; +} + +.control-group.error input, +.control-group.error select, +.control-group.error textarea { + border-color: #b94a48; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} + +.control-group.error input:focus, +.control-group.error select:focus, +.control-group.error textarea:focus { + border-color: #953b39; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392; + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392; +} + +.control-group.error .input-prepend .add-on, +.control-group.error .input-append .add-on { + color: #b94a48; + background-color: #f2dede; + border-color: #b94a48; +} + +.control-group.success .control-label, +.control-group.success .help-block, +.control-group.success .help-inline { + color: #468847; +} + +.control-group.success .checkbox, +.control-group.success .radio, +.control-group.success input, +.control-group.success select, +.control-group.success textarea { + color: #468847; +} + +.control-group.success input, +.control-group.success select, +.control-group.success textarea { + border-color: #468847; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} + +.control-group.success input:focus, +.control-group.success select:focus, +.control-group.success textarea:focus { + border-color: #356635; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b; + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b; +} + +.control-group.success .input-prepend .add-on, +.control-group.success .input-append .add-on { + color: #468847; + background-color: #dff0d8; + border-color: #468847; +} + +.control-group.info .control-label, +.control-group.info .help-block, +.control-group.info .help-inline { + color: #3a87ad; +} + +.control-group.info .checkbox, +.control-group.info .radio, +.control-group.info input, +.control-group.info select, +.control-group.info textarea { + color: #3a87ad; +} + +.control-group.info input, +.control-group.info select, +.control-group.info textarea { + border-color: #3a87ad; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} + +.control-group.info input:focus, +.control-group.info select:focus, +.control-group.info textarea:focus { + border-color: #2d6987; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3; + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3; +} + +.control-group.info .input-prepend .add-on, +.control-group.info .input-append .add-on { + color: #3a87ad; + background-color: #d9edf7; + border-color: #3a87ad; +} + +input:focus:invalid, +textarea:focus:invalid, +select:focus:invalid { + color: #b94a48; + border-color: #ee5f5b; +} + +input:focus:invalid:focus, +textarea:focus:invalid:focus, +select:focus:invalid:focus { + border-color: #e9322d; + -webkit-box-shadow: 0 0 6px #f8b9b7; + -moz-box-shadow: 0 0 6px #f8b9b7; + box-shadow: 0 0 6px #f8b9b7; +} + +.form-actions { + padding: 19px 20px 20px; + margin-top: 20px; + margin-bottom: 20px; + background-color: #f5f5f5; + border-top: 1px solid #e5e5e5; + *zoom: 1; +} + +.form-actions:before, +.form-actions:after { + display: table; + line-height: 0; + content: ""; +} + +.form-actions:after { + clear: both; +} + +.help-block, +.help-inline { + color: #595959; +} + +.help-block { + display: block; + margin-bottom: 10px; +} + +.help-inline { + display: inline-block; + *display: inline; + padding-left: 5px; + vertical-align: middle; + *zoom: 1; +} + +.input-append, +.input-prepend { + display: inline-block; + margin-bottom: 10px; + font-size: 0; + white-space: nowrap; + vertical-align: middle; +} + +.input-append input, +.input-prepend input, +.input-append select, +.input-prepend select, +.input-append .uneditable-input, +.input-prepend .uneditable-input, +.input-append .dropdown-menu, +.input-prepend .dropdown-menu, +.input-append .popover, +.input-prepend .popover { + font-size: 14px; +} + +.input-append input, +.input-prepend input, +.input-append select, +.input-prepend select, +.input-append .uneditable-input, +.input-prepend .uneditable-input { + position: relative; + margin-bottom: 0; + *margin-left: 0; + vertical-align: top; + -webkit-border-radius: 0 4px 4px 0; + -moz-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; +} + +.input-append input:focus, +.input-prepend input:focus, +.input-append select:focus, +.input-prepend select:focus, +.input-append .uneditable-input:focus, +.input-prepend .uneditable-input:focus { + z-index: 2; +} + +.input-append .add-on, +.input-prepend .add-on { + display: inline-block; + width: auto; + height: 20px; + min-width: 16px; + padding: 4px 5px; + font-size: 14px; + font-weight: normal; + line-height: 20px; + text-align: center; + text-shadow: 0 1px 0 #ffffff; + background-color: #eeeeee; + border: 1px solid #ccc; +} + +.input-append .add-on, +.input-prepend .add-on, +.input-append .btn, +.input-prepend .btn, +.input-append .btn-group > .dropdown-toggle, +.input-prepend .btn-group > .dropdown-toggle { + vertical-align: top; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} + +.input-append .active, +.input-prepend .active { + background-color: #a9dba9; + border-color: #46a546; +} + +.input-prepend .add-on, +.input-prepend .btn { + margin-right: -1px; +} + +.input-prepend .add-on:first-child, +.input-prepend .btn:first-child { + -webkit-border-radius: 4px 0 0 4px; + -moz-border-radius: 4px 0 0 4px; + border-radius: 4px 0 0 4px; +} + +.input-append input, +.input-append select, +.input-append .uneditable-input { + -webkit-border-radius: 4px 0 0 4px; + -moz-border-radius: 4px 0 0 4px; + border-radius: 4px 0 0 4px; +} + +.input-append input + .btn-group .btn:last-child, +.input-append select + .btn-group .btn:last-child, +.input-append .uneditable-input + .btn-group .btn:last-child { + -webkit-border-radius: 0 4px 4px 0; + -moz-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; +} + +.input-append .add-on, +.input-append .btn, +.input-append .btn-group { + margin-left: -1px; +} + +.input-append .add-on:last-child, +.input-append .btn:last-child, +.input-append .btn-group:last-child > .dropdown-toggle { + -webkit-border-radius: 0 4px 4px 0; + -moz-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; +} + +.input-prepend.input-append input, +.input-prepend.input-append select, +.input-prepend.input-append .uneditable-input { + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} + +.input-prepend.input-append input + .btn-group .btn, +.input-prepend.input-append select + .btn-group .btn, +.input-prepend.input-append .uneditable-input + .btn-group .btn { + -webkit-border-radius: 0 4px 4px 0; + -moz-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; +} + +.input-prepend.input-append .add-on:first-child, +.input-prepend.input-append .btn:first-child { + margin-right: -1px; + -webkit-border-radius: 4px 0 0 4px; + -moz-border-radius: 4px 0 0 4px; + border-radius: 4px 0 0 4px; +} + +.input-prepend.input-append .add-on:last-child, +.input-prepend.input-append .btn:last-child { + margin-left: -1px; + -webkit-border-radius: 0 4px 4px 0; + -moz-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; +} + +.input-prepend.input-append .btn-group:first-child { + margin-left: 0; +} + +input.search-query { + padding-right: 14px; + padding-right: 4px \9; + padding-left: 14px; + padding-left: 4px \9; + /* IE7-8 doesn't have border-radius, so don't indent the padding */ + + margin-bottom: 0; + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + border-radius: 15px; +} + +/* Allow for input prepend/append in search forms */ + +.form-search .input-append .search-query, +.form-search .input-prepend .search-query { + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} + +.form-search .input-append .search-query { + -webkit-border-radius: 14px 0 0 14px; + -moz-border-radius: 14px 0 0 14px; + border-radius: 14px 0 0 14px; +} + +.form-search .input-append .btn { + -webkit-border-radius: 0 14px 14px 0; + -moz-border-radius: 0 14px 14px 0; + border-radius: 0 14px 14px 0; +} + +.form-search .input-prepend .search-query { + -webkit-border-radius: 0 14px 14px 0; + -moz-border-radius: 0 14px 14px 0; + border-radius: 0 14px 14px 0; +} + +.form-search .input-prepend .btn { + -webkit-border-radius: 14px 0 0 14px; + -moz-border-radius: 14px 0 0 14px; + border-radius: 14px 0 0 14px; +} + +.form-search input, +.form-inline input, +.form-horizontal input, +.form-search textarea, +.form-inline textarea, +.form-horizontal textarea, +.form-search select, +.form-inline select, +.form-horizontal select, +.form-search .help-inline, +.form-inline .help-inline, +.form-horizontal .help-inline, +.form-search .uneditable-input, +.form-inline .uneditable-input, +.form-horizontal .uneditable-input, +.form-search .input-prepend, +.form-inline .input-prepend, +.form-horizontal .input-prepend, +.form-search .input-append, +.form-inline .input-append, +.form-horizontal .input-append { + display: inline-block; + *display: inline; + margin-bottom: 0; + vertical-align: middle; + *zoom: 1; +} + +.form-search .hide, +.form-inline .hide, +.form-horizontal .hide { + display: none; +} + +.form-search label, +.form-inline label, +.form-search .btn-group, +.form-inline .btn-group { + display: inline-block; +} + +.form-search .input-append, +.form-inline .input-append, +.form-search .input-prepend, +.form-inline .input-prepend { + margin-bottom: 0; +} + +.form-search .radio, +.form-search .checkbox, +.form-inline .radio, +.form-inline .checkbox { + padding-left: 0; + margin-bottom: 0; + vertical-align: middle; +} + +.form-search .radio input[type="radio"], +.form-search .checkbox input[type="checkbox"], +.form-inline .radio input[type="radio"], +.form-inline .checkbox input[type="checkbox"] { + float: left; + margin-right: 3px; + margin-left: 0; +} + +.control-group { + margin-bottom: 10px; +} + +legend + .control-group { + margin-top: 20px; + -webkit-margin-top-collapse: separate; +} + +.form-horizontal .control-group { + margin-bottom: 20px; + *zoom: 1; +} + +.form-horizontal .control-group:before, +.form-horizontal .control-group:after { + display: table; + line-height: 0; + content: ""; +} + +.form-horizontal .control-group:after { + clear: both; +} + +.form-horizontal .control-label { + float: left; + width: 160px; + padding-top: 5px; + text-align: right; +} + +.form-horizontal .controls { + *display: inline-block; + *padding-left: 20px; + margin-left: 180px; + *margin-left: 0; +} + +.form-horizontal .controls:first-child { + *padding-left: 180px; +} + +.form-horizontal .help-block { + margin-bottom: 0; +} + +.form-horizontal input + .help-block, +.form-horizontal select + .help-block, +.form-horizontal textarea + .help-block, +.form-horizontal .uneditable-input + .help-block, +.form-horizontal .input-prepend + .help-block, +.form-horizontal .input-append + .help-block { + margin-top: 10px; +} + +.form-horizontal .form-actions { + padding-left: 180px; +} + +table { + max-width: 100%; + background-color: transparent; + border-collapse: collapse; + border-spacing: 0; +} + +.table { + width: 100%; + margin-bottom: 20px; +} + +.table th, +.table td { + padding: 8px; + line-height: 20px; + text-align: left; + vertical-align: top; + border-top: 1px solid #dddddd; +} + +.table th { + font-weight: bold; +} + +.table thead th { + vertical-align: bottom; +} + +.table caption + thead tr:first-child th, +.table caption + thead tr:first-child td, +.table colgroup + thead tr:first-child th, +.table colgroup + thead tr:first-child td, +.table thead:first-child tr:first-child th, +.table thead:first-child tr:first-child td { + border-top: 0; +} + +.table tbody + tbody { + border-top: 2px solid #dddddd; +} + +.table .table { + background-color: #ffffff; +} + +.table-condensed th, +.table-condensed td { + padding: 4px 5px; +} + +.table-bordered { + border: 1px solid #dddddd; + border-collapse: separate; + *border-collapse: collapse; + border-left: 0; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} + +.table-bordered th, +.table-bordered td { + border-left: 1px solid #dddddd; +} + +.table-bordered caption + thead tr:first-child th, +.table-bordered caption + tbody tr:first-child th, +.table-bordered caption + tbody tr:first-child td, +.table-bordered colgroup + thead tr:first-child th, +.table-bordered colgroup + tbody tr:first-child th, +.table-bordered colgroup + tbody tr:first-child td, +.table-bordered thead:first-child tr:first-child th, +.table-bordered tbody:first-child tr:first-child th, +.table-bordered tbody:first-child tr:first-child td { + border-top: 0; +} + +.table-bordered thead:first-child tr:first-child > th:first-child, +.table-bordered tbody:first-child tr:first-child > td:first-child, +.table-bordered tbody:first-child tr:first-child > th:first-child { + -webkit-border-top-left-radius: 4px; + border-top-left-radius: 4px; + -moz-border-radius-topleft: 4px; +} + +.table-bordered thead:first-child tr:first-child > th:last-child, +.table-bordered tbody:first-child tr:first-child > td:last-child, +.table-bordered tbody:first-child tr:first-child > th:last-child { + -webkit-border-top-right-radius: 4px; + border-top-right-radius: 4px; + -moz-border-radius-topright: 4px; +} + +.table-bordered thead:last-child tr:last-child > th:first-child, +.table-bordered tbody:last-child tr:last-child > td:first-child, +.table-bordered tbody:last-child tr:last-child > th:first-child, +.table-bordered tfoot:last-child tr:last-child > td:first-child, +.table-bordered tfoot:last-child tr:last-child > th:first-child { + -webkit-border-bottom-left-radius: 4px; + border-bottom-left-radius: 4px; + -moz-border-radius-bottomleft: 4px; +} + +.table-bordered thead:last-child tr:last-child > th:last-child, +.table-bordered tbody:last-child tr:last-child > td:last-child, +.table-bordered tbody:last-child tr:last-child > th:last-child, +.table-bordered tfoot:last-child tr:last-child > td:last-child, +.table-bordered tfoot:last-child tr:last-child > th:last-child { + -webkit-border-bottom-right-radius: 4px; + border-bottom-right-radius: 4px; + -moz-border-radius-bottomright: 4px; +} + +.table-bordered tfoot + tbody:last-child tr:last-child td:first-child { + -webkit-border-bottom-left-radius: 0; + border-bottom-left-radius: 0; + -moz-border-radius-bottomleft: 0; +} + +.table-bordered tfoot + tbody:last-child tr:last-child td:last-child { + -webkit-border-bottom-right-radius: 0; + border-bottom-right-radius: 0; + -moz-border-radius-bottomright: 0; +} + +.table-bordered caption + thead tr:first-child th:first-child, +.table-bordered caption + tbody tr:first-child td:first-child, +.table-bordered colgroup + thead tr:first-child th:first-child, +.table-bordered colgroup + tbody tr:first-child td:first-child { + -webkit-border-top-left-radius: 4px; + border-top-left-radius: 4px; + -moz-border-radius-topleft: 4px; +} + +.table-bordered caption + thead tr:first-child th:last-child, +.table-bordered caption + tbody tr:first-child td:last-child, +.table-bordered colgroup + thead tr:first-child th:last-child, +.table-bordered colgroup + tbody tr:first-child td:last-child { + -webkit-border-top-right-radius: 4px; + border-top-right-radius: 4px; + -moz-border-radius-topright: 4px; +} + +.table-striped tbody > tr:nth-child(odd) > td, +.table-striped tbody > tr:nth-child(odd) > th { + background-color: #f9f9f9; +} + +.table-hover tbody tr:hover > td, +.table-hover tbody tr:hover > th { + background-color: #f5f5f5; +} + +table td[class*="span"], +table th[class*="span"], +.row-fluid table td[class*="span"], +.row-fluid table th[class*="span"] { + display: table-cell; + float: none; + margin-left: 0; +} + +.table td.span1, +.table th.span1 { + float: none; + width: 44px; + margin-left: 0; +} + +.table td.span2, +.table th.span2 { + float: none; + width: 124px; + margin-left: 0; +} + +.table td.span3, +.table th.span3 { + float: none; + width: 204px; + margin-left: 0; +} + +.table td.span4, +.table th.span4 { + float: none; + width: 284px; + margin-left: 0; +} + +.table td.span5, +.table th.span5 { + float: none; + width: 364px; + margin-left: 0; +} + +.table td.span6, +.table th.span6 { + float: none; + width: 444px; + margin-left: 0; +} + +.table td.span7, +.table th.span7 { + float: none; + width: 524px; + margin-left: 0; +} + +.table td.span8, +.table th.span8 { + float: none; + width: 604px; + margin-left: 0; +} + +.table td.span9, +.table th.span9 { + float: none; + width: 684px; + margin-left: 0; +} + +.table td.span10, +.table th.span10 { + float: none; + width: 764px; + margin-left: 0; +} + +.table td.span11, +.table th.span11 { + float: none; + width: 844px; + margin-left: 0; +} + +.table td.span12, +.table th.span12 { + float: none; + width: 924px; + margin-left: 0; +} + +.table tbody tr.success > td { + background-color: #dff0d8; +} + +.table tbody tr.error > td { + background-color: #f2dede; +} + +.table tbody tr.warning > td { + background-color: #fcf8e3; +} + +.table tbody tr.info > td { + background-color: #d9edf7; +} + +.table-hover tbody tr.success:hover > td { + background-color: #d0e9c6; +} + +.table-hover tbody tr.error:hover > td { + background-color: #ebcccc; +} + +.table-hover tbody tr.warning:hover > td { + background-color: #faf2cc; +} + +.table-hover tbody tr.info:hover > td { + background-color: #c4e3f3; +} + +[class^="icon-"], +[class*=" icon-"] { + display: inline-block; + width: 14px; + height: 14px; + margin-top: 1px; + *margin-right: .3em; + line-height: 14px; + vertical-align: text-top; + background-image: url("../img/glyphicons-halflings.png"); + background-position: 14px 14px; + background-repeat: no-repeat; +} + +/* White icons with optional class, or on hover/focus/active states of certain elements */ + +.icon-white, +.nav-pills > .active > a > [class^="icon-"], +.nav-pills > .active > a > [class*=" icon-"], +.nav-list > .active > a > [class^="icon-"], +.nav-list > .active > a > [class*=" icon-"], +.navbar-inverse .nav > .active > a > [class^="icon-"], +.navbar-inverse .nav > .active > a > [class*=" icon-"], +.dropdown-menu > li > a:hover > [class^="icon-"], +.dropdown-menu > li > a:focus > [class^="icon-"], +.dropdown-menu > li > a:hover > [class*=" icon-"], +.dropdown-menu > li > a:focus > [class*=" icon-"], +.dropdown-menu > .active > a > [class^="icon-"], +.dropdown-menu > .active > a > [class*=" icon-"], +.dropdown-submenu:hover > a > [class^="icon-"], +.dropdown-submenu:focus > a > [class^="icon-"], +.dropdown-submenu:hover > a > [class*=" icon-"], +.dropdown-submenu:focus > a > [class*=" icon-"] { + background-image: url("../img/glyphicons-halflings-white.png"); +} + +.icon-glass { + background-position: 0 0; +} + +.icon-music { + background-position: -24px 0; +} + +.icon-search { + background-position: -48px 0; +} + +.icon-envelope { + background-position: -72px 0; +} + +.icon-heart { + background-position: -96px 0; +} + +.icon-star { + background-position: -120px 0; +} + +.icon-star-empty { + background-position: -144px 0; +} + +.icon-user { + background-position: -168px 0; +} + +.icon-film { + background-position: -192px 0; +} + +.icon-th-large { + background-position: -216px 0; +} + +.icon-th { + background-position: -240px 0; +} + +.icon-th-list { + background-position: -264px 0; +} + +.icon-ok { + background-position: -288px 0; +} + +.icon-remove { + background-position: -312px 0; +} + +.icon-zoom-in { + background-position: -336px 0; +} + +.icon-zoom-out { + background-position: -360px 0; +} + +.icon-off { + background-position: -384px 0; +} + +.icon-signal { + background-position: -408px 0; +} + +.icon-cog { + background-position: -432px 0; +} + +.icon-trash { + background-position: -456px 0; +} + +.icon-home { + background-position: 0 -24px; +} + +.icon-file { + background-position: -24px -24px; +} + +.icon-time { + background-position: -48px -24px; +} + +.icon-road { + background-position: -72px -24px; +} + +.icon-download-alt { + background-position: -96px -24px; +} + +.icon-download { + background-position: -120px -24px; +} + +.icon-upload { + background-position: -144px -24px; +} + +.icon-inbox { + background-position: -168px -24px; +} + +.icon-play-circle { + background-position: -192px -24px; +} + +.icon-repeat { + background-position: -216px -24px; +} + +.icon-refresh { + background-position: -240px -24px; +} + +.icon-list-alt { + background-position: -264px -24px; +} + +.icon-lock { + background-position: -287px -24px; +} + +.icon-flag { + background-position: -312px -24px; +} + +.icon-headphones { + background-position: -336px -24px; +} + +.icon-volume-off { + background-position: -360px -24px; +} + +.icon-volume-down { + background-position: -384px -24px; +} + +.icon-volume-up { + background-position: -408px -24px; +} + +.icon-qrcode { + background-position: -432px -24px; +} + +.icon-barcode { + background-position: -456px -24px; +} + +.icon-tag { + background-position: 0 -48px; +} + +.icon-tags { + background-position: -25px -48px; +} + +.icon-book { + background-position: -48px -48px; +} + +.icon-bookmark { + background-position: -72px -48px; +} + +.icon-print { + background-position: -96px -48px; +} + +.icon-camera { + background-position: -120px -48px; +} + +.icon-font { + background-position: -144px -48px; +} + +.icon-bold { + background-position: -167px -48px; +} + +.icon-italic { + background-position: -192px -48px; +} + +.icon-text-height { + background-position: -216px -48px; +} + +.icon-text-width { + background-position: -240px -48px; +} + +.icon-align-left { + background-position: -264px -48px; +} + +.icon-align-center { + background-position: -288px -48px; +} + +.icon-align-right { + background-position: -312px -48px; +} + +.icon-align-justify { + background-position: -336px -48px; +} + +.icon-list { + background-position: -360px -48px; +} + +.icon-indent-left { + background-position: -384px -48px; +} + +.icon-indent-right { + background-position: -408px -48px; +} + +.icon-facetime-video { + background-position: -432px -48px; +} + +.icon-picture { + background-position: -456px -48px; +} + +.icon-pencil { + background-position: 0 -72px; +} + +.icon-map-marker { + background-position: -24px -72px; +} + +.icon-adjust { + background-position: -48px -72px; +} + +.icon-tint { + background-position: -72px -72px; +} + +.icon-edit { + background-position: -96px -72px; +} + +.icon-share { + background-position: -120px -72px; +} + +.icon-check { + background-position: -144px -72px; +} + +.icon-move { + background-position: -168px -72px; +} + +.icon-step-backward { + background-position: -192px -72px; +} + +.icon-fast-backward { + background-position: -216px -72px; +} + +.icon-backward { + background-position: -240px -72px; +} + +.icon-play { + background-position: -264px -72px; +} + +.icon-pause { + background-position: -288px -72px; +} + +.icon-stop { + background-position: -312px -72px; +} + +.icon-forward { + background-position: -336px -72px; +} + +.icon-fast-forward { + background-position: -360px -72px; +} + +.icon-step-forward { + background-position: -384px -72px; +} + +.icon-eject { + background-position: -408px -72px; +} + +.icon-chevron-left { + background-position: -432px -72px; +} + +.icon-chevron-right { + background-position: -456px -72px; +} + +.icon-plus-sign { + background-position: 0 -96px; +} + +.icon-minus-sign { + background-position: -24px -96px; +} + +.icon-remove-sign { + background-position: -48px -96px; +} + +.icon-ok-sign { + background-position: -72px -96px; +} + +.icon-question-sign { + background-position: -96px -96px; +} + +.icon-info-sign { + background-position: -120px -96px; +} + +.icon-screenshot { + background-position: -144px -96px; +} + +.icon-remove-circle { + background-position: -168px -96px; +} + +.icon-ok-circle { + background-position: -192px -96px; +} + +.icon-ban-circle { + background-position: -216px -96px; +} + +.icon-arrow-left { + background-position: -240px -96px; +} + +.icon-arrow-right { + background-position: -264px -96px; +} + +.icon-arrow-up { + background-position: -289px -96px; +} + +.icon-arrow-down { + background-position: -312px -96px; +} + +.icon-share-alt { + background-position: -336px -96px; +} + +.icon-resize-full { + background-position: -360px -96px; +} + +.icon-resize-small { + background-position: -384px -96px; +} + +.icon-plus { + background-position: -408px -96px; +} + +.icon-minus { + background-position: -433px -96px; +} + +.icon-asterisk { + background-position: -456px -96px; +} + +.icon-exclamation-sign { + background-position: 0 -120px; +} + +.icon-gift { + background-position: -24px -120px; +} + +.icon-leaf { + background-position: -48px -120px; +} + +.icon-fire { + background-position: -72px -120px; +} + +.icon-eye-open { + background-position: -96px -120px; +} + +.icon-eye-close { + background-position: -120px -120px; +} + +.icon-warning-sign { + background-position: -144px -120px; +} + +.icon-plane { + background-position: -168px -120px; +} + +.icon-calendar { + background-position: -192px -120px; +} + +.icon-random { + width: 16px; + background-position: -216px -120px; +} + +.icon-comment { + background-position: -240px -120px; +} + +.icon-magnet { + background-position: -264px -120px; +} + +.icon-chevron-up { + background-position: -288px -120px; +} + +.icon-chevron-down { + background-position: -313px -119px; +} + +.icon-retweet { + background-position: -336px -120px; +} + +.icon-shopping-cart { + background-position: -360px -120px; +} + +.icon-folder-close { + width: 16px; + background-position: -384px -120px; +} + +.icon-folder-open { + width: 16px; + background-position: -408px -120px; +} + +.icon-resize-vertical { + background-position: -432px -119px; +} + +.icon-resize-horizontal { + background-position: -456px -118px; +} + +.icon-hdd { + background-position: 0 -144px; +} + +.icon-bullhorn { + background-position: -24px -144px; +} + +.icon-bell { + background-position: -48px -144px; +} + +.icon-certificate { + background-position: -72px -144px; +} + +.icon-thumbs-up { + background-position: -96px -144px; +} + +.icon-thumbs-down { + background-position: -120px -144px; +} + +.icon-hand-right { + background-position: -144px -144px; +} + +.icon-hand-left { + background-position: -168px -144px; +} + +.icon-hand-up { + background-position: -192px -144px; +} + +.icon-hand-down { + background-position: -216px -144px; +} + +.icon-circle-arrow-right { + background-position: -240px -144px; +} + +.icon-circle-arrow-left { + background-position: -264px -144px; +} + +.icon-circle-arrow-up { + background-position: -288px -144px; +} + +.icon-circle-arrow-down { + background-position: -312px -144px; +} + +.icon-globe { + background-position: -336px -144px; +} + +.icon-wrench { + background-position: -360px -144px; +} + +.icon-tasks { + background-position: -384px -144px; +} + +.icon-filter { + background-position: -408px -144px; +} + +.icon-briefcase { + background-position: -432px -144px; +} + +.icon-fullscreen { + background-position: -456px -144px; +} + +.dropup, +.dropdown { + position: relative; +} + +.dropdown-toggle { + *margin-bottom: -3px; +} + +.dropdown-toggle:active, +.open .dropdown-toggle { + outline: 0; +} + +.caret { + display: inline-block; + width: 0; + height: 0; + vertical-align: top; + border-top: 4px solid #000000; + border-right: 4px solid transparent; + border-left: 4px solid transparent; + content: ""; +} + +.dropdown .caret { + margin-top: 8px; + margin-left: 2px; +} + +.dropdown-menu { + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + display: none; + float: left; + min-width: 160px; + padding: 5px 0; + margin: 2px 0 0; + list-style: none; + background-color: #ffffff; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.2); + *border-right-width: 2px; + *border-bottom-width: 2px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -webkit-background-clip: padding-box; + -moz-background-clip: padding; + background-clip: padding-box; +} + +.dropdown-menu.pull-right { + right: 0; + left: auto; +} + +.dropdown-menu .divider { + *width: 100%; + height: 1px; + margin: 9px 1px; + *margin: -5px 0 5px; + overflow: hidden; + background-color: #e5e5e5; + border-bottom: 1px solid #ffffff; +} + +.dropdown-menu > li > a { + display: block; + padding: 3px 20px; + clear: both; + font-weight: normal; + line-height: 20px; + color: #333333; + white-space: nowrap; +} + +.dropdown-menu > li > a:hover, +.dropdown-menu > li > a:focus, +.dropdown-submenu:hover > a, +.dropdown-submenu:focus > a { + color: #ffffff; + text-decoration: none; + background-color: #0081c2; + background-image: -moz-linear-gradient(top, #0088cc, #0077b3); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3)); + background-image: -webkit-linear-gradient(top, #0088cc, #0077b3); + background-image: -o-linear-gradient(top, #0088cc, #0077b3); + background-image: linear-gradient(to bottom, #0088cc, #0077b3); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0); +} + +.dropdown-menu > .active > a, +.dropdown-menu > .active > a:hover, +.dropdown-menu > .active > a:focus { + color: #ffffff; + text-decoration: none; + background-color: #0081c2; + background-image: -moz-linear-gradient(top, #0088cc, #0077b3); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3)); + background-image: -webkit-linear-gradient(top, #0088cc, #0077b3); + background-image: -o-linear-gradient(top, #0088cc, #0077b3); + background-image: linear-gradient(to bottom, #0088cc, #0077b3); + background-repeat: repeat-x; + outline: 0; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0); +} + +.dropdown-menu > .disabled > a, +.dropdown-menu > .disabled > a:hover, +.dropdown-menu > .disabled > a:focus { + color: #999999; +} + +.dropdown-menu > .disabled > a:hover, +.dropdown-menu > .disabled > a:focus { + text-decoration: none; + cursor: default; + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); +} + +.open { + *z-index: 1000; +} + +.open > .dropdown-menu { + display: block; +} + +.pull-right > .dropdown-menu { + right: 0; + left: auto; +} + +.dropup .caret, +.navbar-fixed-bottom .dropdown .caret { + border-top: 0; + border-bottom: 4px solid #000000; + content: ""; +} + +.dropup .dropdown-menu, +.navbar-fixed-bottom .dropdown .dropdown-menu { + top: auto; + bottom: 100%; + margin-bottom: 1px; +} + +.dropdown-submenu { + position: relative; +} + +.dropdown-submenu > .dropdown-menu { + top: 0; + left: 100%; + margin-top: -6px; + margin-left: -1px; + -webkit-border-radius: 0 6px 6px 6px; + -moz-border-radius: 0 6px 6px 6px; + border-radius: 0 6px 6px 6px; +} + +.dropdown-submenu:hover > .dropdown-menu { + display: block; +} + +.dropup .dropdown-submenu > .dropdown-menu { + top: auto; + bottom: 0; + margin-top: 0; + margin-bottom: -2px; + -webkit-border-radius: 5px 5px 5px 0; + -moz-border-radius: 5px 5px 5px 0; + border-radius: 5px 5px 5px 0; +} + +.dropdown-submenu > a:after { + display: block; + float: right; + width: 0; + height: 0; + margin-top: 5px; + margin-right: -10px; + border-color: transparent; + border-left-color: #cccccc; + border-style: solid; + border-width: 5px 0 5px 5px; + content: " "; +} + +.dropdown-submenu:hover > a:after { + border-left-color: #ffffff; +} + +.dropdown-submenu.pull-left { + float: none; +} + +.dropdown-submenu.pull-left > .dropdown-menu { + left: -100%; + margin-left: 10px; + -webkit-border-radius: 6px 0 6px 6px; + -moz-border-radius: 6px 0 6px 6px; + border-radius: 6px 0 6px 6px; +} + +.dropdown .dropdown-menu .nav-header { + padding-right: 20px; + padding-left: 20px; +} + +.typeahead { + z-index: 1051; + margin-top: 2px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} + +.well { + min-height: 20px; + padding: 19px; + margin-bottom: 20px; + background-color: #f5f5f5; + border: 1px solid #e3e3e3; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); +} + +.well blockquote { + border-color: #ddd; + border-color: rgba(0, 0, 0, 0.15); +} + +.well-large { + padding: 24px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; +} + +.well-small { + padding: 9px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} + +.fade { + opacity: 0; + -webkit-transition: opacity 0.15s linear; + -moz-transition: opacity 0.15s linear; + -o-transition: opacity 0.15s linear; + transition: opacity 0.15s linear; +} + +.fade.in { + opacity: 1; +} + +.collapse { + position: relative; + height: 0; + overflow: hidden; + -webkit-transition: height 0.35s ease; + -moz-transition: height 0.35s ease; + -o-transition: height 0.35s ease; + transition: height 0.35s ease; +} + +.collapse.in { + height: auto; +} + +.close { + float: right; + font-size: 20px; + font-weight: bold; + line-height: 20px; + color: #000000; + text-shadow: 0 1px 0 #ffffff; + opacity: 0.2; + filter: alpha(opacity=20); +} + +.close:hover, +.close:focus { + color: #000000; + text-decoration: none; + cursor: pointer; + opacity: 0.4; + filter: alpha(opacity=40); +} + +button.close { + padding: 0; + cursor: pointer; + background: transparent; + border: 0; + -webkit-appearance: none; +} + +.btn { + display: inline-block; + *display: inline; + padding: 4px 12px; + margin-bottom: 0; + *margin-left: .3em; + font-size: 14px; + line-height: 20px; + color: #333333; + text-align: center; + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); + vertical-align: middle; + cursor: pointer; + background-color: #f5f5f5; + *background-color: #e6e6e6; + background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6)); + background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6); + background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); + background-image: linear-gradient(to bottom, #ffffff, #e6e6e6); + background-repeat: repeat-x; + border: 1px solid #cccccc; + *border: 0; + border-color: #e6e6e6 #e6e6e6 #bfbfbf; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + border-bottom-color: #b3b3b3; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + *zoom: 1; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); +} + +.btn:hover, +.btn:focus, +.btn:active, +.btn.active, +.btn.disabled, +.btn[disabled] { + color: #333333; + background-color: #e6e6e6; + *background-color: #d9d9d9; +} + +.btn:active, +.btn.active { + background-color: #cccccc \9; +} + +.btn:first-child { + *margin-left: 0; +} + +.btn:hover, +.btn:focus { + color: #333333; + text-decoration: none; + background-position: 0 -15px; + -webkit-transition: background-position 0.1s linear; + -moz-transition: background-position 0.1s linear; + -o-transition: background-position 0.1s linear; + transition: background-position 0.1s linear; +} + +.btn:focus { + outline: thin dotted #333; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} + +.btn.active, +.btn:active { + background-image: none; + outline: 0; + -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); +} + +.btn.disabled, +.btn[disabled] { + cursor: default; + background-image: none; + opacity: 0.65; + filter: alpha(opacity=65); + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} + +.btn-large { + padding: 11px 19px; + font-size: 17.5px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; +} + +.btn-large [class^="icon-"], +.btn-large [class*=" icon-"] { + margin-top: 4px; +} + +.btn-small { + padding: 2px 10px; + font-size: 11.9px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} + +.btn-small [class^="icon-"], +.btn-small [class*=" icon-"] { + margin-top: 0; +} + +.btn-mini [class^="icon-"], +.btn-mini [class*=" icon-"] { + margin-top: -1px; +} + +.btn-mini { + padding: 0 6px; + font-size: 10.5px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} + +.btn-block { + display: block; + width: 100%; + padding-right: 0; + padding-left: 0; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.btn-block + .btn-block { + margin-top: 5px; +} + +input[type="submit"].btn-block, +input[type="reset"].btn-block, +input[type="button"].btn-block { + width: 100%; +} + +.btn-primary.active, +.btn-warning.active, +.btn-danger.active, +.btn-success.active, +.btn-info.active, +.btn-inverse.active { + color: rgba(255, 255, 255, 0.75); +} + +.btn-primary { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #006dcc; + *background-color: #0044cc; + background-image: -moz-linear-gradient(top, #0088cc, #0044cc); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); + background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); + background-image: -o-linear-gradient(top, #0088cc, #0044cc); + background-image: linear-gradient(to bottom, #0088cc, #0044cc); + background-repeat: repeat-x; + border-color: #0044cc #0044cc #002a80; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); +} + +.btn-primary:hover, +.btn-primary:focus, +.btn-primary:active, +.btn-primary.active, +.btn-primary.disabled, +.btn-primary[disabled] { + color: #ffffff; + background-color: #0044cc; + *background-color: #003bb3; +} + +.btn-primary:active, +.btn-primary.active { + background-color: #003399 \9; +} + +.btn-warning { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #faa732; + *background-color: #f89406; + background-image: -moz-linear-gradient(top, #fbb450, #f89406); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406)); + background-image: -webkit-linear-gradient(top, #fbb450, #f89406); + background-image: -o-linear-gradient(top, #fbb450, #f89406); + background-image: linear-gradient(to bottom, #fbb450, #f89406); + background-repeat: repeat-x; + border-color: #f89406 #f89406 #ad6704; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); +} + +.btn-warning:hover, +.btn-warning:focus, +.btn-warning:active, +.btn-warning.active, +.btn-warning.disabled, +.btn-warning[disabled] { + color: #ffffff; + background-color: #f89406; + *background-color: #df8505; +} + +.btn-warning:active, +.btn-warning.active { + background-color: #c67605 \9; +} + +.btn-danger { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #da4f49; + *background-color: #bd362f; + background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f)); + background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f); + background-image: -o-linear-gradient(top, #ee5f5b, #bd362f); + background-image: linear-gradient(to bottom, #ee5f5b, #bd362f); + background-repeat: repeat-x; + border-color: #bd362f #bd362f #802420; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffbd362f', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); +} + +.btn-danger:hover, +.btn-danger:focus, +.btn-danger:active, +.btn-danger.active, +.btn-danger.disabled, +.btn-danger[disabled] { + color: #ffffff; + background-color: #bd362f; + *background-color: #a9302a; +} + +.btn-danger:active, +.btn-danger.active { + background-color: #942a25 \9; +} + +.btn-success { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #5bb75b; + *background-color: #51a351; + background-image: -moz-linear-gradient(top, #62c462, #51a351); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351)); + background-image: -webkit-linear-gradient(top, #62c462, #51a351); + background-image: -o-linear-gradient(top, #62c462, #51a351); + background-image: linear-gradient(to bottom, #62c462, #51a351); + background-repeat: repeat-x; + border-color: #51a351 #51a351 #387038; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff51a351', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); +} + +.btn-success:hover, +.btn-success:focus, +.btn-success:active, +.btn-success.active, +.btn-success.disabled, +.btn-success[disabled] { + color: #ffffff; + background-color: #51a351; + *background-color: #499249; +} + +.btn-success:active, +.btn-success.active { + background-color: #408140 \9; +} + +.btn-info { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #49afcd; + *background-color: #2f96b4; + background-image: -moz-linear-gradient(top, #5bc0de, #2f96b4); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4)); + background-image: -webkit-linear-gradient(top, #5bc0de, #2f96b4); + background-image: -o-linear-gradient(top, #5bc0de, #2f96b4); + background-image: linear-gradient(to bottom, #5bc0de, #2f96b4); + background-repeat: repeat-x; + border-color: #2f96b4 #2f96b4 #1f6377; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2f96b4', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); +} + +.btn-info:hover, +.btn-info:focus, +.btn-info:active, +.btn-info.active, +.btn-info.disabled, +.btn-info[disabled] { + color: #ffffff; + background-color: #2f96b4; + *background-color: #2a85a0; +} + +.btn-info:active, +.btn-info.active { + background-color: #24748c \9; +} + +.btn-inverse { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #363636; + *background-color: #222222; + background-image: -moz-linear-gradient(top, #444444, #222222); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222)); + background-image: -webkit-linear-gradient(top, #444444, #222222); + background-image: -o-linear-gradient(top, #444444, #222222); + background-image: linear-gradient(to bottom, #444444, #222222); + background-repeat: repeat-x; + border-color: #222222 #222222 #000000; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444', endColorstr='#ff222222', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); +} + +.btn-inverse:hover, +.btn-inverse:focus, +.btn-inverse:active, +.btn-inverse.active, +.btn-inverse.disabled, +.btn-inverse[disabled] { + color: #ffffff; + background-color: #222222; + *background-color: #151515; +} + +.btn-inverse:active, +.btn-inverse.active { + background-color: #080808 \9; +} + +button.btn, +input[type="submit"].btn { + *padding-top: 3px; + *padding-bottom: 3px; +} + +button.btn::-moz-focus-inner, +input[type="submit"].btn::-moz-focus-inner { + padding: 0; + border: 0; +} + +button.btn.btn-large, +input[type="submit"].btn.btn-large { + *padding-top: 7px; + *padding-bottom: 7px; +} + +button.btn.btn-small, +input[type="submit"].btn.btn-small { + *padding-top: 3px; + *padding-bottom: 3px; +} + +button.btn.btn-mini, +input[type="submit"].btn.btn-mini { + *padding-top: 1px; + *padding-bottom: 1px; +} + +.btn-link, +.btn-link:active, +.btn-link[disabled] { + background-color: transparent; + background-image: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} + +.btn-link { + color: #0088cc; + cursor: pointer; + border-color: transparent; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} + +.btn-link:hover, +.btn-link:focus { + color: #005580; + text-decoration: underline; + background-color: transparent; +} + +.btn-link[disabled]:hover, +.btn-link[disabled]:focus { + color: #333333; + text-decoration: none; +} + +.btn-group { + position: relative; + display: inline-block; + *display: inline; + *margin-left: .3em; + font-size: 0; + white-space: nowrap; + vertical-align: middle; + *zoom: 1; +} + +.btn-group:first-child { + *margin-left: 0; +} + +.btn-group + .btn-group { + margin-left: 5px; +} + +.btn-toolbar { + margin-top: 10px; + margin-bottom: 10px; + font-size: 0; +} + +.btn-toolbar > .btn + .btn, +.btn-toolbar > .btn-group + .btn, +.btn-toolbar > .btn + .btn-group { + margin-left: 5px; +} + +.btn-group > .btn { + position: relative; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} + +.btn-group > .btn + .btn { + margin-left: -1px; +} + +.btn-group > .btn, +.btn-group > .dropdown-menu, +.btn-group > .popover { + font-size: 14px; +} + +.btn-group > .btn-mini { + font-size: 10.5px; +} + +.btn-group > .btn-small { + font-size: 11.9px; +} + +.btn-group > .btn-large { + font-size: 17.5px; +} + +.btn-group > .btn:first-child { + margin-left: 0; + -webkit-border-bottom-left-radius: 4px; + border-bottom-left-radius: 4px; + -webkit-border-top-left-radius: 4px; + border-top-left-radius: 4px; + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-topleft: 4px; +} + +.btn-group > .btn:last-child, +.btn-group > .dropdown-toggle { + -webkit-border-top-right-radius: 4px; + border-top-right-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + border-bottom-right-radius: 4px; + -moz-border-radius-topright: 4px; + -moz-border-radius-bottomright: 4px; +} + +.btn-group > .btn.large:first-child { + margin-left: 0; + -webkit-border-bottom-left-radius: 6px; + border-bottom-left-radius: 6px; + -webkit-border-top-left-radius: 6px; + border-top-left-radius: 6px; + -moz-border-radius-bottomleft: 6px; + -moz-border-radius-topleft: 6px; +} + +.btn-group > .btn.large:last-child, +.btn-group > .large.dropdown-toggle { + -webkit-border-top-right-radius: 6px; + border-top-right-radius: 6px; + -webkit-border-bottom-right-radius: 6px; + border-bottom-right-radius: 6px; + -moz-border-radius-topright: 6px; + -moz-border-radius-bottomright: 6px; +} + +.btn-group > .btn:hover, +.btn-group > .btn:focus, +.btn-group > .btn:active, +.btn-group > .btn.active { + z-index: 2; +} + +.btn-group .dropdown-toggle:active, +.btn-group.open .dropdown-toggle { + outline: 0; +} + +.btn-group > .btn + .dropdown-toggle { + *padding-top: 5px; + padding-right: 8px; + *padding-bottom: 5px; + padding-left: 8px; + -webkit-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); +} + +.btn-group > .btn-mini + .dropdown-toggle { + *padding-top: 2px; + padding-right: 5px; + *padding-bottom: 2px; + padding-left: 5px; +} + +.btn-group > .btn-small + .dropdown-toggle { + *padding-top: 5px; + *padding-bottom: 4px; +} + +.btn-group > .btn-large + .dropdown-toggle { + *padding-top: 7px; + padding-right: 12px; + *padding-bottom: 7px; + padding-left: 12px; +} + +.btn-group.open .dropdown-toggle { + background-image: none; + -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); +} + +.btn-group.open .btn.dropdown-toggle { + background-color: #e6e6e6; +} + +.btn-group.open .btn-primary.dropdown-toggle { + background-color: #0044cc; +} + +.btn-group.open .btn-warning.dropdown-toggle { + background-color: #f89406; +} + +.btn-group.open .btn-danger.dropdown-toggle { + background-color: #bd362f; +} + +.btn-group.open .btn-success.dropdown-toggle { + background-color: #51a351; +} + +.btn-group.open .btn-info.dropdown-toggle { + background-color: #2f96b4; +} + +.btn-group.open .btn-inverse.dropdown-toggle { + background-color: #222222; +} + +.btn .caret { + margin-top: 8px; + margin-left: 0; +} + +.btn-large .caret { + margin-top: 6px; +} + +.btn-large .caret { + border-top-width: 5px; + border-right-width: 5px; + border-left-width: 5px; +} + +.btn-mini .caret, +.btn-small .caret { + margin-top: 8px; +} + +.dropup .btn-large .caret { + border-bottom-width: 5px; +} + +.btn-primary .caret, +.btn-warning .caret, +.btn-danger .caret, +.btn-info .caret, +.btn-success .caret, +.btn-inverse .caret { + border-top-color: #ffffff; + border-bottom-color: #ffffff; +} + +.btn-group-vertical { + display: inline-block; + *display: inline; + /* IE7 inline-block hack */ + + *zoom: 1; +} + +.btn-group-vertical > .btn { + display: block; + float: none; + max-width: 100%; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} + +.btn-group-vertical > .btn + .btn { + margin-top: -1px; + margin-left: 0; +} + +.btn-group-vertical > .btn:first-child { + -webkit-border-radius: 4px 4px 0 0; + -moz-border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; +} + +.btn-group-vertical > .btn:last-child { + -webkit-border-radius: 0 0 4px 4px; + -moz-border-radius: 0 0 4px 4px; + border-radius: 0 0 4px 4px; +} + +.btn-group-vertical > .btn-large:first-child { + -webkit-border-radius: 6px 6px 0 0; + -moz-border-radius: 6px 6px 0 0; + border-radius: 6px 6px 0 0; +} + +.btn-group-vertical > .btn-large:last-child { + -webkit-border-radius: 0 0 6px 6px; + -moz-border-radius: 0 0 6px 6px; + border-radius: 0 0 6px 6px; +} + +.alert { + padding: 8px 35px 8px 14px; + margin-bottom: 20px; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); + background-color: #fcf8e3; + border: 1px solid #fbeed5; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} + +.alert, +.alert h4 { + color: #c09853; +} + +.alert h4 { + margin: 0; +} + +.alert .close { + position: relative; + top: -2px; + right: -21px; + line-height: 20px; +} + +.alert-success { + color: #468847; + background-color: #dff0d8; + border-color: #d6e9c6; +} + +.alert-success h4 { + color: #468847; +} + +.alert-danger, +.alert-error { + color: #b94a48; + background-color: #f2dede; + border-color: #eed3d7; +} + +.alert-danger h4, +.alert-error h4 { + color: #b94a48; +} + +.alert-info { + color: #3a87ad; + background-color: #d9edf7; + border-color: #bce8f1; +} + +.alert-info h4 { + color: #3a87ad; +} + +.alert-block { + padding-top: 14px; + padding-bottom: 14px; +} + +.alert-block > p, +.alert-block > ul { + margin-bottom: 0; +} + +.alert-block p + p { + margin-top: 5px; +} + +.nav { + margin-bottom: 20px; + margin-left: 0; + list-style: none; +} + +.nav > li > a { + display: block; +} + +.nav > li > a:hover, +.nav > li > a:focus { + text-decoration: none; + background-color: #eeeeee; +} + +.nav > li > a > img { + max-width: none; +} + +.nav > .pull-right { + float: right; +} + +.nav-header { + display: block; + padding: 3px 15px; + font-size: 11px; + font-weight: bold; + line-height: 20px; + color: #999999; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); + text-transform: uppercase; +} + +.nav li + .nav-header { + margin-top: 9px; +} + +.nav-list { + padding-right: 15px; + padding-left: 15px; + margin-bottom: 0; +} + +.nav-list > li > a, +.nav-list .nav-header { + margin-right: -15px; + margin-left: -15px; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); +} + +.nav-list > li > a { + padding: 3px 15px; +} + +.nav-list > .active > a, +.nav-list > .active > a:hover, +.nav-list > .active > a:focus { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); + background-color: #0088cc; +} + +.nav-list [class^="icon-"], +.nav-list [class*=" icon-"] { + margin-right: 2px; +} + +.nav-list .divider { + *width: 100%; + height: 1px; + margin: 9px 1px; + *margin: -5px 0 5px; + overflow: hidden; + background-color: #e5e5e5; + border-bottom: 1px solid #ffffff; +} + +.nav-tabs, +.nav-pills { + *zoom: 1; +} + +.nav-tabs:before, +.nav-pills:before, +.nav-tabs:after, +.nav-pills:after { + display: table; + line-height: 0; + content: ""; +} + +.nav-tabs:after, +.nav-pills:after { + clear: both; +} + +.nav-tabs > li, +.nav-pills > li { + float: left; +} + +.nav-tabs > li > a, +.nav-pills > li > a { + padding-right: 12px; + padding-left: 12px; + margin-right: 2px; + line-height: 14px; +} + +.nav-tabs { + border-bottom: 1px solid #ddd; +} + +.nav-tabs > li { + margin-bottom: -1px; +} + +.nav-tabs > li > a { + padding-top: 8px; + padding-bottom: 8px; + line-height: 20px; + border: 1px solid transparent; + -webkit-border-radius: 4px 4px 0 0; + -moz-border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; +} + +.nav-tabs > li > a:hover, +.nav-tabs > li > a:focus { + border-color: #eeeeee #eeeeee #dddddd; +} + +.nav-tabs > .active > a, +.nav-tabs > .active > a:hover, +.nav-tabs > .active > a:focus { + color: #555555; + cursor: default; + background-color: #ffffff; + border: 1px solid #ddd; + border-bottom-color: transparent; +} + +.nav-pills > li > a { + padding-top: 8px; + padding-bottom: 8px; + margin-top: 2px; + margin-bottom: 2px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; +} + +.nav-pills > .active > a, +.nav-pills > .active > a:hover, +.nav-pills > .active > a:focus { + color: #ffffff; + background-color: #0088cc; +} + +.nav-stacked > li { + float: none; +} + +.nav-stacked > li > a { + margin-right: 0; +} + +.nav-tabs.nav-stacked { + border-bottom: 0; +} + +.nav-tabs.nav-stacked > li > a { + border: 1px solid #ddd; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} + +.nav-tabs.nav-stacked > li:first-child > a { + -webkit-border-top-right-radius: 4px; + border-top-right-radius: 4px; + -webkit-border-top-left-radius: 4px; + border-top-left-radius: 4px; + -moz-border-radius-topright: 4px; + -moz-border-radius-topleft: 4px; +} + +.nav-tabs.nav-stacked > li:last-child > a { + -webkit-border-bottom-right-radius: 4px; + border-bottom-right-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + border-bottom-left-radius: 4px; + -moz-border-radius-bottomright: 4px; + -moz-border-radius-bottomleft: 4px; +} + +.nav-tabs.nav-stacked > li > a:hover, +.nav-tabs.nav-stacked > li > a:focus { + z-index: 2; + border-color: #ddd; +} + +.nav-pills.nav-stacked > li > a { + margin-bottom: 3px; +} + +.nav-pills.nav-stacked > li:last-child > a { + margin-bottom: 1px; +} + +.nav-tabs .dropdown-menu { + -webkit-border-radius: 0 0 6px 6px; + -moz-border-radius: 0 0 6px 6px; + border-radius: 0 0 6px 6px; +} + +.nav-pills .dropdown-menu { + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; +} + +.nav .dropdown-toggle .caret { + margin-top: 6px; + border-top-color: #0088cc; + border-bottom-color: #0088cc; +} + +.nav .dropdown-toggle:hover .caret, +.nav .dropdown-toggle:focus .caret { + border-top-color: #005580; + border-bottom-color: #005580; +} + +/* move down carets for tabs */ + +.nav-tabs .dropdown-toggle .caret { + margin-top: 8px; +} + +.nav .active .dropdown-toggle .caret { + border-top-color: #fff; + border-bottom-color: #fff; +} + +.nav-tabs .active .dropdown-toggle .caret { + border-top-color: #555555; + border-bottom-color: #555555; +} + +.nav > .dropdown.active > a:hover, +.nav > .dropdown.active > a:focus { + cursor: pointer; +} + +.nav-tabs .open .dropdown-toggle, +.nav-pills .open .dropdown-toggle, +.nav > li.dropdown.open.active > a:hover, +.nav > li.dropdown.open.active > a:focus { + color: #ffffff; + background-color: #999999; + border-color: #999999; +} + +.nav li.dropdown.open .caret, +.nav li.dropdown.open.active .caret, +.nav li.dropdown.open a:hover .caret, +.nav li.dropdown.open a:focus .caret { + border-top-color: #ffffff; + border-bottom-color: #ffffff; + opacity: 1; + filter: alpha(opacity=100); +} + +.tabs-stacked .open > a:hover, +.tabs-stacked .open > a:focus { + border-color: #999999; +} + +.tabbable { + *zoom: 1; +} + +.tabbable:before, +.tabbable:after { + display: table; + line-height: 0; + content: ""; +} + +.tabbable:after { + clear: both; +} + +.tab-content { + overflow: auto; +} + +.tabs-below > .nav-tabs, +.tabs-right > .nav-tabs, +.tabs-left > .nav-tabs { + border-bottom: 0; +} + +.tab-content > .tab-pane, +.pill-content > .pill-pane { + display: none; +} + +.tab-content > .active, +.pill-content > .active { + display: block; +} + +.tabs-below > .nav-tabs { + border-top: 1px solid #ddd; +} + +.tabs-below > .nav-tabs > li { + margin-top: -1px; + margin-bottom: 0; +} + +.tabs-below > .nav-tabs > li > a { + -webkit-border-radius: 0 0 4px 4px; + -moz-border-radius: 0 0 4px 4px; + border-radius: 0 0 4px 4px; +} + +.tabs-below > .nav-tabs > li > a:hover, +.tabs-below > .nav-tabs > li > a:focus { + border-top-color: #ddd; + border-bottom-color: transparent; +} + +.tabs-below > .nav-tabs > .active > a, +.tabs-below > .nav-tabs > .active > a:hover, +.tabs-below > .nav-tabs > .active > a:focus { + border-color: transparent #ddd #ddd #ddd; +} + +.tabs-left > .nav-tabs > li, +.tabs-right > .nav-tabs > li { + float: none; +} + +.tabs-left > .nav-tabs > li > a, +.tabs-right > .nav-tabs > li > a { + min-width: 74px; + margin-right: 0; + margin-bottom: 3px; +} + +.tabs-left > .nav-tabs { + float: left; + margin-right: 19px; + border-right: 1px solid #ddd; +} + +.tabs-left > .nav-tabs > li > a { + margin-right: -1px; + -webkit-border-radius: 4px 0 0 4px; + -moz-border-radius: 4px 0 0 4px; + border-radius: 4px 0 0 4px; +} + +.tabs-left > .nav-tabs > li > a:hover, +.tabs-left > .nav-tabs > li > a:focus { + border-color: #eeeeee #dddddd #eeeeee #eeeeee; +} + +.tabs-left > .nav-tabs .active > a, +.tabs-left > .nav-tabs .active > a:hover, +.tabs-left > .nav-tabs .active > a:focus { + border-color: #ddd transparent #ddd #ddd; + *border-right-color: #ffffff; +} + +.tabs-right > .nav-tabs { + float: right; + margin-left: 19px; + border-left: 1px solid #ddd; +} + +.tabs-right > .nav-tabs > li > a { + margin-left: -1px; + -webkit-border-radius: 0 4px 4px 0; + -moz-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; +} + +.tabs-right > .nav-tabs > li > a:hover, +.tabs-right > .nav-tabs > li > a:focus { + border-color: #eeeeee #eeeeee #eeeeee #dddddd; +} + +.tabs-right > .nav-tabs .active > a, +.tabs-right > .nav-tabs .active > a:hover, +.tabs-right > .nav-tabs .active > a:focus { + border-color: #ddd #ddd #ddd transparent; + *border-left-color: #ffffff; +} + +.nav > .disabled > a { + color: #999999; +} + +.nav > .disabled > a:hover, +.nav > .disabled > a:focus { + text-decoration: none; + cursor: default; + background-color: transparent; +} + +.navbar { + *position: relative; + *z-index: 2; + margin-bottom: 20px; + overflow: visible; +} + +.navbar-inner { + min-height: 40px; + padding-right: 20px; + padding-left: 20px; + background-color: #fafafa; + background-image: -moz-linear-gradient(top, #ffffff, #f2f2f2); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f2f2f2)); + background-image: -webkit-linear-gradient(top, #ffffff, #f2f2f2); + background-image: -o-linear-gradient(top, #ffffff, #f2f2f2); + background-image: linear-gradient(to bottom, #ffffff, #f2f2f2); + background-repeat: repeat-x; + border: 1px solid #d4d4d4; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff2f2f2', GradientType=0); + *zoom: 1; + -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); + -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); + box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); +} + +.navbar-inner:before, +.navbar-inner:after { + display: table; + line-height: 0; + content: ""; +} + +.navbar-inner:after { + clear: both; +} + +.navbar .container { + width: auto; +} + +.nav-collapse.collapse { + height: auto; + overflow: visible; +} + +.navbar .brand { + display: block; + float: left; + padding: 10px 20px 10px; + margin-left: -20px; + font-size: 20px; + font-weight: 200; + color: #777777; + text-shadow: 0 1px 0 #ffffff; +} + +.navbar .brand:hover, +.navbar .brand:focus { + text-decoration: none; +} + +.navbar-text { + margin-bottom: 0; + line-height: 40px; + color: #777777; +} + +.navbar-link { + color: #777777; +} + +.navbar-link:hover, +.navbar-link:focus { + color: #333333; +} + +.navbar .divider-vertical { + height: 40px; + margin: 0 9px; + border-right: 1px solid #ffffff; + border-left: 1px solid #f2f2f2; +} + +.navbar .btn, +.navbar .btn-group { + margin-top: 5px; +} + +.navbar .btn-group .btn, +.navbar .input-prepend .btn, +.navbar .input-append .btn, +.navbar .input-prepend .btn-group, +.navbar .input-append .btn-group { + margin-top: 0; +} + +.navbar-form { + margin-bottom: 0; + *zoom: 1; +} + +.navbar-form:before, +.navbar-form:after { + display: table; + line-height: 0; + content: ""; +} + +.navbar-form:after { + clear: both; +} + +.navbar-form input, +.navbar-form select, +.navbar-form .radio, +.navbar-form .checkbox { + margin-top: 5px; +} + +.navbar-form input, +.navbar-form select, +.navbar-form .btn { + display: inline-block; + margin-bottom: 0; +} + +.navbar-form input[type="image"], +.navbar-form input[type="checkbox"], +.navbar-form input[type="radio"] { + margin-top: 3px; +} + +.navbar-form .input-append, +.navbar-form .input-prepend { + margin-top: 5px; + white-space: nowrap; +} + +.navbar-form .input-append input, +.navbar-form .input-prepend input { + margin-top: 0; +} + +.navbar-search { + position: relative; + float: left; + margin-top: 5px; + margin-bottom: 0; +} + +.navbar-search .search-query { + padding: 4px 14px; + margin-bottom: 0; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 13px; + font-weight: normal; + line-height: 1; + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + border-radius: 15px; +} + +.navbar-static-top { + position: static; + margin-bottom: 0; +} + +.navbar-static-top .navbar-inner { + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} + +.navbar-fixed-top, +.navbar-fixed-bottom { + position: fixed; + right: 0; + left: 0; + z-index: 1030; + margin-bottom: 0; +} + +.navbar-fixed-top .navbar-inner, +.navbar-static-top .navbar-inner { + border-width: 0 0 1px; +} + +.navbar-fixed-bottom .navbar-inner { + border-width: 1px 0 0; +} + +.navbar-fixed-top .navbar-inner, +.navbar-fixed-bottom .navbar-inner { + padding-right: 0; + padding-left: 0; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} + +.navbar-static-top .container, +.navbar-fixed-top .container, +.navbar-fixed-bottom .container { + width: 940px; +} + +.navbar-fixed-top { + top: 0; +} + +.navbar-fixed-top .navbar-inner, +.navbar-static-top .navbar-inner { + -webkit-box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1); + -moz-box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1); + box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1); +} + +.navbar-fixed-bottom { + bottom: 0; +} + +.navbar-fixed-bottom .navbar-inner { + -webkit-box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.1); + -moz-box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.1); + box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.1); +} + +.navbar .nav { + position: relative; + left: 0; + display: block; + float: left; + margin: 0 10px 0 0; +} + +.navbar .nav.pull-right { + float: right; + margin-right: 0; +} + +.navbar .nav > li { + float: left; +} + +.navbar .nav > li > a { + float: none; + padding: 10px 15px 10px; + color: #777777; + text-decoration: none; + text-shadow: 0 1px 0 #ffffff; +} + +.navbar .nav .dropdown-toggle .caret { + margin-top: 8px; +} + +.navbar .nav > li > a:focus, +.navbar .nav > li > a:hover { + color: #333333; + text-decoration: none; + background-color: transparent; +} + +.navbar .nav > .active > a, +.navbar .nav > .active > a:hover, +.navbar .nav > .active > a:focus { + color: #555555; + text-decoration: none; + background-color: #e5e5e5; + -webkit-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); + -moz-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); + box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); +} + +.navbar .btn-navbar { + display: none; + float: right; + padding: 7px 10px; + margin-right: 5px; + margin-left: 5px; + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #ededed; + *background-color: #e5e5e5; + background-image: -moz-linear-gradient(top, #f2f2f2, #e5e5e5); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#e5e5e5)); + background-image: -webkit-linear-gradient(top, #f2f2f2, #e5e5e5); + background-image: -o-linear-gradient(top, #f2f2f2, #e5e5e5); + background-image: linear-gradient(to bottom, #f2f2f2, #e5e5e5); + background-repeat: repeat-x; + border-color: #e5e5e5 #e5e5e5 #bfbfbf; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2', endColorstr='#ffe5e5e5', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); +} + +.navbar .btn-navbar:hover, +.navbar .btn-navbar:focus, +.navbar .btn-navbar:active, +.navbar .btn-navbar.active, +.navbar .btn-navbar.disabled, +.navbar .btn-navbar[disabled] { + color: #ffffff; + background-color: #e5e5e5; + *background-color: #d9d9d9; +} + +.navbar .btn-navbar:active, +.navbar .btn-navbar.active { + background-color: #cccccc \9; +} + +.navbar .btn-navbar .icon-bar { + display: block; + width: 18px; + height: 2px; + background-color: #f5f5f5; + -webkit-border-radius: 1px; + -moz-border-radius: 1px; + border-radius: 1px; + -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); + -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); + box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); +} + +.btn-navbar .icon-bar + .icon-bar { + margin-top: 3px; +} + +.navbar .nav > li > .dropdown-menu:before { + position: absolute; + top: -7px; + left: 9px; + display: inline-block; + border-right: 7px solid transparent; + border-bottom: 7px solid #ccc; + border-left: 7px solid transparent; + border-bottom-color: rgba(0, 0, 0, 0.2); + content: ''; +} + +.navbar .nav > li > .dropdown-menu:after { + position: absolute; + top: -6px; + left: 10px; + display: inline-block; + border-right: 6px solid transparent; + border-bottom: 6px solid #ffffff; + border-left: 6px solid transparent; + content: ''; +} + +.navbar-fixed-bottom .nav > li > .dropdown-menu:before { + top: auto; + bottom: -7px; + border-top: 7px solid #ccc; + border-bottom: 0; + border-top-color: rgba(0, 0, 0, 0.2); +} + +.navbar-fixed-bottom .nav > li > .dropdown-menu:after { + top: auto; + bottom: -6px; + border-top: 6px solid #ffffff; + border-bottom: 0; +} + +.navbar .nav li.dropdown > a:hover .caret, +.navbar .nav li.dropdown > a:focus .caret { + border-top-color: #333333; + border-bottom-color: #333333; +} + +.navbar .nav li.dropdown.open > .dropdown-toggle, +.navbar .nav li.dropdown.active > .dropdown-toggle, +.navbar .nav li.dropdown.open.active > .dropdown-toggle { + color: #555555; + background-color: #e5e5e5; +} + +.navbar .nav li.dropdown > .dropdown-toggle .caret { + border-top-color: #777777; + border-bottom-color: #777777; +} + +.navbar .nav li.dropdown.open > .dropdown-toggle .caret, +.navbar .nav li.dropdown.active > .dropdown-toggle .caret, +.navbar .nav li.dropdown.open.active > .dropdown-toggle .caret { + border-top-color: #555555; + border-bottom-color: #555555; +} + +.navbar .pull-right > li > .dropdown-menu, +.navbar .nav > li > .dropdown-menu.pull-right { + right: 0; + left: auto; +} + +.navbar .pull-right > li > .dropdown-menu:before, +.navbar .nav > li > .dropdown-menu.pull-right:before { + right: 12px; + left: auto; +} + +.navbar .pull-right > li > .dropdown-menu:after, +.navbar .nav > li > .dropdown-menu.pull-right:after { + right: 13px; + left: auto; +} + +.navbar .pull-right > li > .dropdown-menu .dropdown-menu, +.navbar .nav > li > .dropdown-menu.pull-right .dropdown-menu { + right: 100%; + left: auto; + margin-right: -1px; + margin-left: 0; + -webkit-border-radius: 6px 0 6px 6px; + -moz-border-radius: 6px 0 6px 6px; + border-radius: 6px 0 6px 6px; +} + +.navbar-inverse .navbar-inner { + background-color: #1b1b1b; + background-image: -moz-linear-gradient(top, #222222, #111111); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#222222), to(#111111)); + background-image: -webkit-linear-gradient(top, #222222, #111111); + background-image: -o-linear-gradient(top, #222222, #111111); + background-image: linear-gradient(to bottom, #222222, #111111); + background-repeat: repeat-x; + border-color: #252525; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff111111', GradientType=0); +} + +.navbar-inverse .brand, +.navbar-inverse .nav > li > a { + color: #999999; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); +} + +.navbar-inverse .brand:hover, +.navbar-inverse .nav > li > a:hover, +.navbar-inverse .brand:focus, +.navbar-inverse .nav > li > a:focus { + color: #ffffff; +} + +.navbar-inverse .brand { + color: #999999; +} + +.navbar-inverse .navbar-text { + color: #999999; +} + +.navbar-inverse .nav > li > a:focus, +.navbar-inverse .nav > li > a:hover { + color: #ffffff; + background-color: transparent; +} + +.navbar-inverse .nav .active > a, +.navbar-inverse .nav .active > a:hover, +.navbar-inverse .nav .active > a:focus { + color: #ffffff; + background-color: #111111; +} + +.navbar-inverse .navbar-link { + color: #999999; +} + +.navbar-inverse .navbar-link:hover, +.navbar-inverse .navbar-link:focus { + color: #ffffff; +} + +.navbar-inverse .divider-vertical { + border-right-color: #222222; + border-left-color: #111111; +} + +.navbar-inverse .nav li.dropdown.open > .dropdown-toggle, +.navbar-inverse .nav li.dropdown.active > .dropdown-toggle, +.navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle { + color: #ffffff; + background-color: #111111; +} + +.navbar-inverse .nav li.dropdown > a:hover .caret, +.navbar-inverse .nav li.dropdown > a:focus .caret { + border-top-color: #ffffff; + border-bottom-color: #ffffff; +} + +.navbar-inverse .nav li.dropdown > .dropdown-toggle .caret { + border-top-color: #999999; + border-bottom-color: #999999; +} + +.navbar-inverse .nav li.dropdown.open > .dropdown-toggle .caret, +.navbar-inverse .nav li.dropdown.active > .dropdown-toggle .caret, +.navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle .caret { + border-top-color: #ffffff; + border-bottom-color: #ffffff; +} + +.navbar-inverse .navbar-search .search-query { + color: #ffffff; + background-color: #515151; + border-color: #111111; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15); + -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.15); + -webkit-transition: none; + -moz-transition: none; + -o-transition: none; + transition: none; +} + +.navbar-inverse .navbar-search .search-query:-moz-placeholder { + color: #cccccc; +} + +.navbar-inverse .navbar-search .search-query:-ms-input-placeholder { + color: #cccccc; +} + +.navbar-inverse .navbar-search .search-query::-webkit-input-placeholder { + color: #cccccc; +} + +.navbar-inverse .navbar-search .search-query:focus, +.navbar-inverse .navbar-search .search-query.focused { + padding: 5px 15px; + color: #333333; + text-shadow: 0 1px 0 #ffffff; + background-color: #ffffff; + border: 0; + outline: 0; + -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); + -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); + box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); +} + +.navbar-inverse .btn-navbar { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #0e0e0e; + *background-color: #040404; + background-image: -moz-linear-gradient(top, #151515, #040404); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#151515), to(#040404)); + background-image: -webkit-linear-gradient(top, #151515, #040404); + background-image: -o-linear-gradient(top, #151515, #040404); + background-image: linear-gradient(to bottom, #151515, #040404); + background-repeat: repeat-x; + border-color: #040404 #040404 #000000; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff151515', endColorstr='#ff040404', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); +} + +.navbar-inverse .btn-navbar:hover, +.navbar-inverse .btn-navbar:focus, +.navbar-inverse .btn-navbar:active, +.navbar-inverse .btn-navbar.active, +.navbar-inverse .btn-navbar.disabled, +.navbar-inverse .btn-navbar[disabled] { + color: #ffffff; + background-color: #040404; + *background-color: #000000; +} + +.navbar-inverse .btn-navbar:active, +.navbar-inverse .btn-navbar.active { + background-color: #000000 \9; +} + +.breadcrumb { + padding: 8px 15px; + margin: 0 0 20px; + list-style: none; + background-color: #f5f5f5; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} + +.breadcrumb > li { + display: inline-block; + *display: inline; + text-shadow: 0 1px 0 #ffffff; + *zoom: 1; +} + +.breadcrumb > li > .divider { + padding: 0 5px; + color: #ccc; +} + +.breadcrumb > .active { + color: #999999; +} + +.pagination { + margin: 20px 0; +} + +.pagination ul { + display: inline-block; + *display: inline; + margin-bottom: 0; + margin-left: 0; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + *zoom: 1; + -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); +} + +.pagination ul > li { + display: inline; +} + +.pagination ul > li > a, +.pagination ul > li > span { + float: left; + padding: 4px 12px; + line-height: 20px; + text-decoration: none; + background-color: #ffffff; + border: 1px solid #dddddd; + border-left-width: 0; +} + +.pagination ul > li > a:hover, +.pagination ul > li > a:focus, +.pagination ul > .active > a, +.pagination ul > .active > span { + background-color: #f5f5f5; +} + +.pagination ul > .active > a, +.pagination ul > .active > span { + color: #999999; + cursor: default; +} + +.pagination ul > .disabled > span, +.pagination ul > .disabled > a, +.pagination ul > .disabled > a:hover, +.pagination ul > .disabled > a:focus { + color: #999999; + cursor: default; + background-color: transparent; +} + +.pagination ul > li:first-child > a, +.pagination ul > li:first-child > span { + border-left-width: 1px; + -webkit-border-bottom-left-radius: 4px; + border-bottom-left-radius: 4px; + -webkit-border-top-left-radius: 4px; + border-top-left-radius: 4px; + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-topleft: 4px; +} + +.pagination ul > li:last-child > a, +.pagination ul > li:last-child > span { + -webkit-border-top-right-radius: 4px; + border-top-right-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + border-bottom-right-radius: 4px; + -moz-border-radius-topright: 4px; + -moz-border-radius-bottomright: 4px; +} + +.pagination-centered { + text-align: center; +} + +.pagination-right { + text-align: right; +} + +.pagination-large ul > li > a, +.pagination-large ul > li > span { + padding: 11px 19px; + font-size: 17.5px; +} + +.pagination-large ul > li:first-child > a, +.pagination-large ul > li:first-child > span { + -webkit-border-bottom-left-radius: 6px; + border-bottom-left-radius: 6px; + -webkit-border-top-left-radius: 6px; + border-top-left-radius: 6px; + -moz-border-radius-bottomleft: 6px; + -moz-border-radius-topleft: 6px; +} + +.pagination-large ul > li:last-child > a, +.pagination-large ul > li:last-child > span { + -webkit-border-top-right-radius: 6px; + border-top-right-radius: 6px; + -webkit-border-bottom-right-radius: 6px; + border-bottom-right-radius: 6px; + -moz-border-radius-topright: 6px; + -moz-border-radius-bottomright: 6px; +} + +.pagination-mini ul > li:first-child > a, +.pagination-small ul > li:first-child > a, +.pagination-mini ul > li:first-child > span, +.pagination-small ul > li:first-child > span { + -webkit-border-bottom-left-radius: 3px; + border-bottom-left-radius: 3px; + -webkit-border-top-left-radius: 3px; + border-top-left-radius: 3px; + -moz-border-radius-bottomleft: 3px; + -moz-border-radius-topleft: 3px; +} + +.pagination-mini ul > li:last-child > a, +.pagination-small ul > li:last-child > a, +.pagination-mini ul > li:last-child > span, +.pagination-small ul > li:last-child > span { + -webkit-border-top-right-radius: 3px; + border-top-right-radius: 3px; + -webkit-border-bottom-right-radius: 3px; + border-bottom-right-radius: 3px; + -moz-border-radius-topright: 3px; + -moz-border-radius-bottomright: 3px; +} + +.pagination-small ul > li > a, +.pagination-small ul > li > span { + padding: 2px 10px; + font-size: 11.9px; +} + +.pagination-mini ul > li > a, +.pagination-mini ul > li > span { + padding: 0 6px; + font-size: 10.5px; +} + +.pager { + margin: 20px 0; + text-align: center; + list-style: none; + *zoom: 1; +} + +.pager:before, +.pager:after { + display: table; + line-height: 0; + content: ""; +} + +.pager:after { + clear: both; +} + +.pager li { + display: inline; +} + +.pager li > a, +.pager li > span { + display: inline-block; + padding: 5px 14px; + background-color: #fff; + border: 1px solid #ddd; + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + border-radius: 15px; +} + +.pager li > a:hover, +.pager li > a:focus { + text-decoration: none; + background-color: #f5f5f5; +} + +.pager .next > a, +.pager .next > span { + float: right; +} + +.pager .previous > a, +.pager .previous > span { + float: left; +} + +.pager .disabled > a, +.pager .disabled > a:hover, +.pager .disabled > a:focus, +.pager .disabled > span { + color: #999999; + cursor: default; + background-color: #fff; +} + +.modal-backdrop { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1040; + background-color: #000000; +} + +.modal-backdrop.fade { + opacity: 0; +} + +.modal-backdrop, +.modal-backdrop.fade.in { + opacity: 0.8; + filter: alpha(opacity=80); +} + +.modal { + position: fixed; + top: 10%; + left: 50%; + z-index: 1050; + width: 560px; + margin-left: -280px; + background-color: #ffffff; + border: 1px solid #999; + border: 1px solid rgba(0, 0, 0, 0.3); + *border: 1px solid #999; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + outline: none; + -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + -webkit-background-clip: padding-box; + -moz-background-clip: padding-box; + background-clip: padding-box; +} + +.modal.fade { + top: -25%; + -webkit-transition: opacity 0.3s linear, top 0.3s ease-out; + -moz-transition: opacity 0.3s linear, top 0.3s ease-out; + -o-transition: opacity 0.3s linear, top 0.3s ease-out; + transition: opacity 0.3s linear, top 0.3s ease-out; +} + +.modal.fade.in { + top: 10%; +} + +.modal-header { + padding: 9px 15px; + border-bottom: 1px solid #eee; +} + +.modal-header .close { + margin-top: 2px; +} + +.modal-header h3 { + margin: 0; + line-height: 30px; +} + +.modal-body { + position: relative; + max-height: 400px; + padding: 15px; + overflow-y: auto; +} + +.modal-form { + margin-bottom: 0; +} + +.modal-footer { + padding: 14px 15px 15px; + margin-bottom: 0; + text-align: right; + background-color: #f5f5f5; + border-top: 1px solid #ddd; + -webkit-border-radius: 0 0 6px 6px; + -moz-border-radius: 0 0 6px 6px; + border-radius: 0 0 6px 6px; + *zoom: 1; + -webkit-box-shadow: inset 0 1px 0 #ffffff; + -moz-box-shadow: inset 0 1px 0 #ffffff; + box-shadow: inset 0 1px 0 #ffffff; +} + +.modal-footer:before, +.modal-footer:after { + display: table; + line-height: 0; + content: ""; +} + +.modal-footer:after { + clear: both; +} + +.modal-footer .btn + .btn { + margin-bottom: 0; + margin-left: 5px; +} + +.modal-footer .btn-group .btn + .btn { + margin-left: -1px; +} + +.modal-footer .btn-block + .btn-block { + margin-left: 0; +} + +.tooltip { + position: absolute; + z-index: 1030; + display: block; + font-size: 11px; + line-height: 1.4; + opacity: 0; + filter: alpha(opacity=0); + visibility: visible; +} + +.tooltip.in { + opacity: 0.8; + filter: alpha(opacity=80); +} + +.tooltip.top { + padding: 5px 0; + margin-top: -3px; +} + +.tooltip.right { + padding: 0 5px; + margin-left: 3px; +} + +.tooltip.bottom { + padding: 5px 0; + margin-top: 3px; +} + +.tooltip.left { + padding: 0 5px; + margin-left: -3px; +} + +.tooltip-inner { + max-width: 200px; + padding: 8px; + color: #ffffff; + text-align: center; + text-decoration: none; + background-color: #000000; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} + +.tooltip-arrow { + position: absolute; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} + +.tooltip.top .tooltip-arrow { + bottom: 0; + left: 50%; + margin-left: -5px; + border-top-color: #000000; + border-width: 5px 5px 0; +} + +.tooltip.right .tooltip-arrow { + top: 50%; + left: 0; + margin-top: -5px; + border-right-color: #000000; + border-width: 5px 5px 5px 0; +} + +.tooltip.left .tooltip-arrow { + top: 50%; + right: 0; + margin-top: -5px; + border-left-color: #000000; + border-width: 5px 0 5px 5px; +} + +.tooltip.bottom .tooltip-arrow { + top: 0; + left: 50%; + margin-left: -5px; + border-bottom-color: #000000; + border-width: 0 5px 5px; +} + +.popover { + position: absolute; + top: 0; + left: 0; + z-index: 1010; + display: none; + max-width: 276px; + padding: 1px; + text-align: left; + white-space: normal; + background-color: #ffffff; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.2); + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -webkit-background-clip: padding-box; + -moz-background-clip: padding; + background-clip: padding-box; +} + +.popover.top { + margin-top: -10px; +} + +.popover.right { + margin-left: 10px; +} + +.popover.bottom { + margin-top: 10px; +} + +.popover.left { + margin-left: -10px; +} + +.popover-title { + padding: 8px 14px; + margin: 0; + font-size: 14px; + font-weight: normal; + line-height: 18px; + background-color: #f7f7f7; + border-bottom: 1px solid #ebebeb; + -webkit-border-radius: 5px 5px 0 0; + -moz-border-radius: 5px 5px 0 0; + border-radius: 5px 5px 0 0; +} + +.popover-title:empty { + display: none; +} + +.popover-content { + padding: 9px 14px; +} + +.popover .arrow, +.popover .arrow:after { + position: absolute; + display: block; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} + +.popover .arrow { + border-width: 11px; +} + +.popover .arrow:after { + border-width: 10px; + content: ""; +} + +.popover.top .arrow { + bottom: -11px; + left: 50%; + margin-left: -11px; + border-top-color: #999; + border-top-color: rgba(0, 0, 0, 0.25); + border-bottom-width: 0; +} + +.popover.top .arrow:after { + bottom: 1px; + margin-left: -10px; + border-top-color: #ffffff; + border-bottom-width: 0; +} + +.popover.right .arrow { + top: 50%; + left: -11px; + margin-top: -11px; + border-right-color: #999; + border-right-color: rgba(0, 0, 0, 0.25); + border-left-width: 0; +} + +.popover.right .arrow:after { + bottom: -10px; + left: 1px; + border-right-color: #ffffff; + border-left-width: 0; +} + +.popover.bottom .arrow { + top: -11px; + left: 50%; + margin-left: -11px; + border-bottom-color: #999; + border-bottom-color: rgba(0, 0, 0, 0.25); + border-top-width: 0; +} + +.popover.bottom .arrow:after { + top: 1px; + margin-left: -10px; + border-bottom-color: #ffffff; + border-top-width: 0; +} + +.popover.left .arrow { + top: 50%; + right: -11px; + margin-top: -11px; + border-left-color: #999; + border-left-color: rgba(0, 0, 0, 0.25); + border-right-width: 0; +} + +.popover.left .arrow:after { + right: 1px; + bottom: -10px; + border-left-color: #ffffff; + border-right-width: 0; +} + +.thumbnails { + margin-left: -20px; + list-style: none; + *zoom: 1; +} + +.thumbnails:before, +.thumbnails:after { + display: table; + line-height: 0; + content: ""; +} + +.thumbnails:after { + clear: both; +} + +.row-fluid .thumbnails { + margin-left: 0; +} + +.thumbnails > li { + float: left; + margin-bottom: 20px; + margin-left: 20px; +} + +.thumbnail { + display: block; + padding: 4px; + line-height: 20px; + border: 1px solid #ddd; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055); + -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055); + -webkit-transition: all 0.2s ease-in-out; + -moz-transition: all 0.2s ease-in-out; + -o-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; +} + +a.thumbnail:hover, +a.thumbnail:focus { + border-color: #0088cc; + -webkit-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); + -moz-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); + box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); +} + +.thumbnail > img { + display: block; + max-width: 100%; + margin-right: auto; + margin-left: auto; +} + +.thumbnail .caption { + padding: 9px; + color: #555555; +} + +.media, +.media-body { + overflow: hidden; + *overflow: visible; + zoom: 1; +} + +.media, +.media .media { + margin-top: 15px; +} + +.media:first-child { + margin-top: 0; +} + +.media-object { + display: block; +} + +.media-heading { + margin: 0 0 5px; +} + +.media > .pull-left { + margin-right: 10px; +} + +.media > .pull-right { + margin-left: 10px; +} + +.media-list { + margin-left: 0; + list-style: none; +} + +.label, +.badge { + display: inline-block; + padding: 2px 4px; + font-size: 11.844px; + font-weight: bold; + line-height: 14px; + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + white-space: nowrap; + vertical-align: baseline; + background-color: #999999; +} + +.label { + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} + +.badge { + padding-right: 9px; + padding-left: 9px; + -webkit-border-radius: 9px; + -moz-border-radius: 9px; + border-radius: 9px; +} + +.label:empty, +.badge:empty { + display: none; +} + +a.label:hover, +a.label:focus, +a.badge:hover, +a.badge:focus { + color: #ffffff; + text-decoration: none; + cursor: pointer; +} + +.label-important, +.badge-important { + background-color: #b94a48; +} + +.label-important[href], +.badge-important[href] { + background-color: #953b39; +} + +.label-warning, +.badge-warning { + background-color: #f89406; +} + +.label-warning[href], +.badge-warning[href] { + background-color: #c67605; +} + +.label-success, +.badge-success { + background-color: #468847; +} + +.label-success[href], +.badge-success[href] { + background-color: #356635; +} + +.label-info, +.badge-info { + background-color: #3a87ad; +} + +.label-info[href], +.badge-info[href] { + background-color: #2d6987; +} + +.label-inverse, +.badge-inverse { + background-color: #333333; +} + +.label-inverse[href], +.badge-inverse[href] { + background-color: #1a1a1a; +} + +.btn .label, +.btn .badge { + position: relative; + top: -1px; +} + +.btn-mini .label, +.btn-mini .badge { + top: 0; +} + +@-webkit-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} + +@-moz-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} + +@-ms-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} + +@-o-keyframes progress-bar-stripes { + from { + background-position: 0 0; + } + to { + background-position: 40px 0; + } +} + +@keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} + +.progress { + height: 20px; + margin-bottom: 20px; + overflow: hidden; + background-color: #f7f7f7; + background-image: -moz-linear-gradient(top, #f5f5f5, #f9f9f9); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9)); + background-image: -webkit-linear-gradient(top, #f5f5f5, #f9f9f9); + background-image: -o-linear-gradient(top, #f5f5f5, #f9f9f9); + background-image: linear-gradient(to bottom, #f5f5f5, #f9f9f9); + background-repeat: repeat-x; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#fff9f9f9', GradientType=0); + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); +} + +.progress .bar { + float: left; + width: 0; + height: 100%; + font-size: 12px; + color: #ffffff; + text-align: center; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #0e90d2; + background-image: -moz-linear-gradient(top, #149bdf, #0480be); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be)); + background-image: -webkit-linear-gradient(top, #149bdf, #0480be); + background-image: -o-linear-gradient(top, #149bdf, #0480be); + background-image: linear-gradient(to bottom, #149bdf, #0480be); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf', endColorstr='#ff0480be', GradientType=0); + -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -moz-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -webkit-transition: width 0.6s ease; + -moz-transition: width 0.6s ease; + -o-transition: width 0.6s ease; + transition: width 0.6s ease; +} + +.progress .bar + .bar { + -webkit-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -moz-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15); + box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.15); +} + +.progress-striped .bar { + background-color: #149bdf; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + -webkit-background-size: 40px 40px; + -moz-background-size: 40px 40px; + -o-background-size: 40px 40px; + background-size: 40px 40px; +} + +.progress.active .bar { + -webkit-animation: progress-bar-stripes 2s linear infinite; + -moz-animation: progress-bar-stripes 2s linear infinite; + -ms-animation: progress-bar-stripes 2s linear infinite; + -o-animation: progress-bar-stripes 2s linear infinite; + animation: progress-bar-stripes 2s linear infinite; +} + +.progress-danger .bar, +.progress .bar-danger { + background-color: #dd514c; + background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#c43c35)); + background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35); + background-image: -o-linear-gradient(top, #ee5f5b, #c43c35); + background-image: linear-gradient(to bottom, #ee5f5b, #c43c35); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffc43c35', GradientType=0); +} + +.progress-danger.progress-striped .bar, +.progress-striped .bar-danger { + background-color: #ee5f5b; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} + +.progress-success .bar, +.progress .bar-success { + background-color: #5eb95e; + background-image: -moz-linear-gradient(top, #62c462, #57a957); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#57a957)); + background-image: -webkit-linear-gradient(top, #62c462, #57a957); + background-image: -o-linear-gradient(top, #62c462, #57a957); + background-image: linear-gradient(to bottom, #62c462, #57a957); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff57a957', GradientType=0); +} + +.progress-success.progress-striped .bar, +.progress-striped .bar-success { + background-color: #62c462; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} + +.progress-info .bar, +.progress .bar-info { + background-color: #4bb1cf; + background-image: -moz-linear-gradient(top, #5bc0de, #339bb9); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#339bb9)); + background-image: -webkit-linear-gradient(top, #5bc0de, #339bb9); + background-image: -o-linear-gradient(top, #5bc0de, #339bb9); + background-image: linear-gradient(to bottom, #5bc0de, #339bb9); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff339bb9', GradientType=0); +} + +.progress-info.progress-striped .bar, +.progress-striped .bar-info { + background-color: #5bc0de; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} + +.progress-warning .bar, +.progress .bar-warning { + background-color: #faa732; + background-image: -moz-linear-gradient(top, #fbb450, #f89406); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406)); + background-image: -webkit-linear-gradient(top, #fbb450, #f89406); + background-image: -o-linear-gradient(top, #fbb450, #f89406); + background-image: linear-gradient(to bottom, #fbb450, #f89406); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0); +} + +.progress-warning.progress-striped .bar, +.progress-striped .bar-warning { + background-color: #fbb450; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} + +.accordion { + margin-bottom: 20px; +} + +.accordion-group { + margin-bottom: 2px; + border: 1px solid #e5e5e5; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} + +.accordion-heading { + border-bottom: 0; +} + +.accordion-heading .accordion-toggle { + display: block; + padding: 8px 15px; +} + +.accordion-toggle { + cursor: pointer; +} + +.accordion-inner { + padding: 9px 15px; + border-top: 1px solid #e5e5e5; +} + +.carousel { + position: relative; + margin-bottom: 20px; + line-height: 1; +} + +.carousel-inner { + position: relative; + width: 100%; + overflow: hidden; +} + +.carousel-inner > .item { + position: relative; + display: none; + -webkit-transition: 0.6s ease-in-out left; + -moz-transition: 0.6s ease-in-out left; + -o-transition: 0.6s ease-in-out left; + transition: 0.6s ease-in-out left; +} + +.carousel-inner > .item > img, +.carousel-inner > .item > a > img { + display: block; + line-height: 1; +} + +.carousel-inner > .active, +.carousel-inner > .next, +.carousel-inner > .prev { + display: block; +} + +.carousel-inner > .active { + left: 0; +} + +.carousel-inner > .next, +.carousel-inner > .prev { + position: absolute; + top: 0; + width: 100%; +} + +.carousel-inner > .next { + left: 100%; +} + +.carousel-inner > .prev { + left: -100%; +} + +.carousel-inner > .next.left, +.carousel-inner > .prev.right { + left: 0; +} + +.carousel-inner > .active.left { + left: -100%; +} + +.carousel-inner > .active.right { + left: 100%; +} + +.carousel-control { + position: absolute; + top: 40%; + left: 15px; + width: 40px; + height: 40px; + margin-top: -20px; + font-size: 60px; + font-weight: 100; + line-height: 30px; + color: #ffffff; + text-align: center; + background: #222222; + border: 3px solid #ffffff; + -webkit-border-radius: 23px; + -moz-border-radius: 23px; + border-radius: 23px; + opacity: 0.5; + filter: alpha(opacity=50); +} + +.carousel-control.right { + right: 15px; + left: auto; +} + +.carousel-control:hover, +.carousel-control:focus { + color: #ffffff; + text-decoration: none; + opacity: 0.9; + filter: alpha(opacity=90); +} + +.carousel-indicators { + position: absolute; + top: 15px; + right: 15px; + z-index: 5; + margin: 0; + list-style: none; +} + +.carousel-indicators li { + display: block; + float: left; + width: 10px; + height: 10px; + margin-left: 5px; + text-indent: -999px; + background-color: #ccc; + background-color: rgba(255, 255, 255, 0.25); + border-radius: 5px; +} + +.carousel-indicators .active { + background-color: #fff; +} + +.carousel-caption { + position: absolute; + right: 0; + bottom: 0; + left: 0; + padding: 15px; + background: #333333; + background: rgba(0, 0, 0, 0.75); +} + +.carousel-caption h4, +.carousel-caption p { + line-height: 20px; + color: #ffffff; +} + +.carousel-caption h4 { + margin: 0 0 5px; +} + +.carousel-caption p { + margin-bottom: 0; +} + +.hero-unit { + padding: 60px; + margin-bottom: 30px; + font-size: 18px; + font-weight: 200; + line-height: 30px; + color: inherit; + background-color: #eeeeee; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; +} + +.hero-unit h1 { + margin-bottom: 0; + font-size: 60px; + line-height: 1; + letter-spacing: -1px; + color: inherit; +} + +.hero-unit li { + line-height: 30px; +} + +.pull-right { + float: right; +} + +.pull-left { + float: left; +} + +.hide { + display: none; +} + +.show { + display: block; +} + +.invisible { + visibility: hidden; +} + +.affix { + position: fixed; +} diff --git a/crm/src/main/webapp/FooTable/bootstrap/bootstrapSwitch.css b/crm/src/main/webapp/FooTable/bootstrap/bootstrapSwitch.css new file mode 100644 index 0000000..f329c7c --- /dev/null +++ b/crm/src/main/webapp/FooTable/bootstrap/bootstrapSwitch.css @@ -0,0 +1,359 @@ +/* ============================================================ + * bootstrapSwitch v1.2 by Larentis Mattia @spiritualGuru + * http://www.larentis.eu/switch/ + * ============================================================ + * Licensed under the Apache License, Version 2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * ============================================================ */ +.has-switch { + display: inline-block; + cursor: pointer; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + border: 1px solid; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + position: relative; + text-align: left; + overflow: hidden; + line-height: 8px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + -o-user-select: none; + user-select: none; + min-width: 100px; +} +.has-switch.switch-mini { + min-width: 72px; +} +.has-switch.switch-small { + min-width: 80px; +} +.has-switch.switch-large { + min-width: 120px; +} +.has-switch.deactivate { + opacity: 0.5; + filter: alpha(opacity=50); + cursor: default !important; +} +.has-switch.deactivate label, +.has-switch.deactivate span { + cursor: default !important; +} +.has-switch > div { + display: inline-block; + width: 150%; + position: relative; + top: 0; +} +.has-switch > div.switch-animate { + -webkit-transition: left 0.5s; + -moz-transition: left 0.5s; + -o-transition: left 0.5s; + transition: left 0.5s; +} +.has-switch > div.switch-off { + left: -50%; +} +.has-switch > div.switch-on { + left: 0%; +} +.has-switch input[type=checkbox] { + display: none; +} +.has-switch span, +.has-switch label { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + cursor: pointer; + position: relative; + display: inline-block; + height: 100%; + padding-bottom: 4px; + padding-top: 4px; + font-size: 14px; + line-height: 20px; +} +.has-switch span.switch-mini, +.has-switch label.switch-mini { + padding-bottom: 4px; + padding-top: 4px; + font-size: 10px; + line-height: 9px; +} +.has-switch span.switch-small, +.has-switch label.switch-small { + padding-bottom: 3px; + padding-top: 3px; + font-size: 12px; + line-height: 18px; +} +.has-switch span.switch-large, +.has-switch label.switch-large { + padding-bottom: 9px; + padding-top: 9px; + font-size: 16px; + line-height: normal; +} +.has-switch label { + text-align: center; + margin-top: -1px; + margin-bottom: -1px; + z-index: 100; + width: 34%; + border-left: 1px solid #cccccc; + border-right: 1px solid #cccccc; + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #f5f5f5; + background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6)); + background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6); + background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); + background-image: linear-gradient(to bottom, #ffffff, #e6e6e6); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0); + border-color: #e6e6e6 #e6e6e6 #bfbfbf; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + *background-color: #e6e6e6; + /* Darken IE7 buttons by default so they stand out more given they won't have borders */ + + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); +} +.has-switch label:hover, +.has-switch label:focus, +.has-switch label:active, +.has-switch label.active, +.has-switch label.disabled, +.has-switch label[disabled] { + color: #ffffff; + background-color: #e6e6e6; + *background-color: #d9d9d9; +} +.has-switch label:active, +.has-switch label.active { + background-color: #cccccc \9; +} +.has-switch label i { + color: #000; + text-shadow: 0 1px 0 #fff; + line-height: 18px; + pointer-events: none; +} +.has-switch span { + text-align: center; + z-index: 1; + width: 33%; +} +.has-switch span.switch-left { + -webkit-border-top-left-radius: 4px; + -moz-border-radius-topleft: 4px; + border-top-left-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + -moz-border-radius-bottomleft: 4px; + border-bottom-left-radius: 4px; +} +.has-switch span.switch-right { + color: #333333; + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); + background-color: #f0f0f0; + background-image: -moz-linear-gradient(top, #e6e6e6, #ffffff); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#ffffff)); + background-image: -webkit-linear-gradient(top, #e6e6e6, #ffffff); + background-image: -o-linear-gradient(top, #e6e6e6, #ffffff); + background-image: linear-gradient(to bottom, #e6e6e6, #ffffff); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffffffff', GradientType=0); + border-color: #ffffff #ffffff #d9d9d9; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + *background-color: #ffffff; + /* Darken IE7 buttons by default so they stand out more given they won't have borders */ + + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); +} +.has-switch span.switch-right:hover, +.has-switch span.switch-right:focus, +.has-switch span.switch-right:active, +.has-switch span.switch-right.active, +.has-switch span.switch-right.disabled, +.has-switch span.switch-right[disabled] { + color: #333333; + background-color: #ffffff; + *background-color: #f2f2f2; +} +.has-switch span.switch-right:active, +.has-switch span.switch-right.active { + background-color: #e6e6e6 \9; +} +.has-switch span.switch-primary, +.has-switch span.switch-left { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #005fcc; + background-image: -moz-linear-gradient(top, #0044cc, #0088cc); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0044cc), to(#0088cc)); + background-image: -webkit-linear-gradient(top, #0044cc, #0088cc); + background-image: -o-linear-gradient(top, #0044cc, #0088cc); + background-image: linear-gradient(to bottom, #0044cc, #0088cc); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0044cc', endColorstr='#ff0088cc', GradientType=0); + border-color: #0088cc #0088cc #005580; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + *background-color: #0088cc; + /* Darken IE7 buttons by default so they stand out more given they won't have borders */ + + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); +} +.has-switch span.switch-primary:hover, +.has-switch span.switch-left:hover, +.has-switch span.switch-primary:focus, +.has-switch span.switch-left:focus, +.has-switch span.switch-primary:active, +.has-switch span.switch-left:active, +.has-switch span.switch-primary.active, +.has-switch span.switch-left.active, +.has-switch span.switch-primary.disabled, +.has-switch span.switch-left.disabled, +.has-switch span.switch-primary[disabled], +.has-switch span.switch-left[disabled] { + color: #ffffff; + background-color: #0088cc; + *background-color: #0077b3; +} +.has-switch span.switch-primary:active, +.has-switch span.switch-left:active, +.has-switch span.switch-primary.active, +.has-switch span.switch-left.active { + background-color: #006699 \9; +} +.has-switch span.switch-info { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #41a7c5; + background-image: -moz-linear-gradient(top, #2f96b4, #5bc0de); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#2f96b4), to(#5bc0de)); + background-image: -webkit-linear-gradient(top, #2f96b4, #5bc0de); + background-image: -o-linear-gradient(top, #2f96b4, #5bc0de); + background-image: linear-gradient(to bottom, #2f96b4, #5bc0de); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff2f96b4', endColorstr='#ff5bc0de', GradientType=0); + border-color: #5bc0de #5bc0de #28a1c5; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + *background-color: #5bc0de; + /* Darken IE7 buttons by default so they stand out more given they won't have borders */ + + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); +} +.has-switch span.switch-info:hover, +.has-switch span.switch-info:focus, +.has-switch span.switch-info:active, +.has-switch span.switch-info.active, +.has-switch span.switch-info.disabled, +.has-switch span.switch-info[disabled] { + color: #ffffff; + background-color: #5bc0de; + *background-color: #46b8da; +} +.has-switch span.switch-info:active, +.has-switch span.switch-info.active { + background-color: #31b0d5 \9; +} +.has-switch span.switch-success { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #58b058; + background-image: -moz-linear-gradient(top, #51a351, #62c462); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#51a351), to(#62c462)); + background-image: -webkit-linear-gradient(top, #51a351, #62c462); + background-image: -o-linear-gradient(top, #51a351, #62c462); + background-image: linear-gradient(to bottom, #51a351, #62c462); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff51a351', endColorstr='#ff62c462', GradientType=0); + border-color: #62c462 #62c462 #3b9e3b; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + *background-color: #62c462; + /* Darken IE7 buttons by default so they stand out more given they won't have borders */ + + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); +} +.has-switch span.switch-success:hover, +.has-switch span.switch-success:focus, +.has-switch span.switch-success:active, +.has-switch span.switch-success.active, +.has-switch span.switch-success.disabled, +.has-switch span.switch-success[disabled] { + color: #ffffff; + background-color: #62c462; + *background-color: #4fbd4f; +} +.has-switch span.switch-success:active, +.has-switch span.switch-success.active { + background-color: #42b142 \9; +} +.has-switch span.switch-warning { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #f9a123; + background-image: -moz-linear-gradient(top, #f89406, #fbb450); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f89406), to(#fbb450)); + background-image: -webkit-linear-gradient(top, #f89406, #fbb450); + background-image: -o-linear-gradient(top, #f89406, #fbb450); + background-image: linear-gradient(to bottom, #f89406, #fbb450); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff89406', endColorstr='#fffbb450', GradientType=0); + border-color: #fbb450 #fbb450 #f89406; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + *background-color: #fbb450; + /* Darken IE7 buttons by default so they stand out more given they won't have borders */ + + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); +} +.has-switch span.switch-warning:hover, +.has-switch span.switch-warning:focus, +.has-switch span.switch-warning:active, +.has-switch span.switch-warning.active, +.has-switch span.switch-warning.disabled, +.has-switch span.switch-warning[disabled] { + color: #ffffff; + background-color: #fbb450; + *background-color: #faa937; +} +.has-switch span.switch-warning:active, +.has-switch span.switch-warning.active { + background-color: #fa9f1e \9; +} +.has-switch span.switch-danger { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #d14641; + background-image: -moz-linear-gradient(top, #bd362f, #ee5f5b); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#bd362f), to(#ee5f5b)); + background-image: -webkit-linear-gradient(top, #bd362f, #ee5f5b); + background-image: -o-linear-gradient(top, #bd362f, #ee5f5b); + background-image: linear-gradient(to bottom, #bd362f, #ee5f5b); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffbd362f', endColorstr='#ffee5f5b', GradientType=0); + border-color: #ee5f5b #ee5f5b #e51d18; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + *background-color: #ee5f5b; + /* Darken IE7 buttons by default so they stand out more given they won't have borders */ + + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); +} +.has-switch span.switch-danger:hover, +.has-switch span.switch-danger:focus, +.has-switch span.switch-danger:active, +.has-switch span.switch-danger.active, +.has-switch span.switch-danger.disabled, +.has-switch span.switch-danger[disabled] { + color: #ffffff; + background-color: #ee5f5b; + *background-color: #ec4844; +} +.has-switch span.switch-danger:active, +.has-switch span.switch-danger.active { + background-color: #e9322d \9; +} diff --git a/crm/src/main/webapp/FooTable/bootstrap/bootstrapSwitch.js b/crm/src/main/webapp/FooTable/bootstrap/bootstrapSwitch.js new file mode 100644 index 0000000..46b9216 --- /dev/null +++ b/crm/src/main/webapp/FooTable/bootstrap/bootstrapSwitch.js @@ -0,0 +1,251 @@ +/* ============================================================ + * bootstrapSwitch v1.3 by Larentis Mattia @spiritualGuru + * http://www.larentis.eu/switch/ + * ============================================================ + * Licensed under the Apache License, Version 2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * ============================================================ */ + +!function ($) { + "use strict"; + + $.fn['bootstrapSwitch'] = function (method) { + var methods = { + init: function () { + return this.each(function () { + var $element = $(this) + , $div + , $switchLeft + , $switchRight + , $label + , myClasses = "" + , classes = $element.attr('class') + , color + , moving + , onLabel = "ON" + , offLabel = "OFF" + , icon = false; + + $.each(['switch-mini', 'switch-small', 'switch-large'], function (i, el) { + if (classes.indexOf(el) >= 0) + myClasses = el; + }); + + $element.addClass('has-switch'); + + if ($element.data('on') !== undefined) + color = "switch-" + $element.data('on'); + + if ($element.data('on-label') !== undefined) + onLabel = $element.data('on-label'); + + if ($element.data('off-label') !== undefined) + offLabel = $element.data('off-label'); + + if ($element.data('icon') !== undefined) + icon = $element.data('icon'); + + $switchLeft = $('') + .addClass("switch-left") + .addClass(myClasses) + .addClass(color) + .html(onLabel); + + color = ''; + if ($element.data('off') !== undefined) + color = "switch-" + $element.data('off'); + + $switchRight = $('') + .addClass("switch-right") + .addClass(myClasses) + .addClass(color) + .html(offLabel); + + $label = $(''; + //row += ''; + row += ''; + row += ''; + row += ''; + row += ''; + row += ''; + for (var j = 0; j < extraCols; j++) { + row += ''; + } + row += ''; + document.writeln(row); + } + }; +})(window); \ No newline at end of file diff --git a/crm/src/main/webapp/FooTable/js/footable.filter.js b/crm/src/main/webapp/FooTable/js/footable.filter.js new file mode 100644 index 0000000..77f261b --- /dev/null +++ b/crm/src/main/webapp/FooTable/js/footable.filter.js @@ -0,0 +1,117 @@ +(function ($, w, undefined) { + if (w.footable == undefined || w.footable == null) + throw new Error('Please check and make sure footable.js is included in the page and is loaded prior to this script.'); + + var jQversion = w.footable.version.parse($.fn.jquery); + if (jQversion.major == 1 && jQversion.minor < 8) { // For older versions of jQuery, anything below 1.8 + $.expr[':'].ftcontains = function (a, i, m) { + return $(a).text().toUpperCase().indexOf(m[3].toUpperCase()) >= 0; + }; + } else { // For jQuery 1.8 and above + $.expr[':'].ftcontains = $.expr.createPseudo(function (arg) { + return function (elem) { + var text = $(elem).find('td').text(); + var data = $(elem).find('td[data-value]').each(function() { + text += $(this).data('value'); + }); + return text.toUpperCase().indexOf(arg.toUpperCase()) >= 0; + }; + }); + } + + var defaults = { + filter: { + enabled: true, + input: '.footable-filter', + timeout: 300, + minimum: 2, + disableEnter: false + } + }; + + function Filter() { + var p = this; + p.name = 'Footable Filter'; + p.init = function (ft) { + if (ft.options.filter.enabled == true) { + ft.timers.register('filter'); + $(ft.table).bind({ + 'footable_initialized': function (e) { + var $table = $(e.ft.table); + var data = { + 'input': $table.data('filter') || e.ft.options.filter.input, + 'timeout': $table.data('filter-timeout') || e.ft.options.filter.timeout, + 'minimum': $table.data('filter-minimum') || e.ft.options.filter.minimum, + 'disableEnter': $table.data('filter-disable-enter') || e.ft.options.filter.disableEnter + }; + if (data.disableEnter) { + $(data.input).keypress(function (event) { + if (window.event) + return (window.event.keyCode != 13); + else + return (event.which != 13); + }); + } + $table.bind('footable_clear_filter', function () { + $(data.input).val(''); + p.clearFilter(e.ft); + }); + $table.bind('footable_filter', function (event, args) { + p.filter(e.ft, args.filter); + }); + $(data.input).keyup(function (eve) { + e.ft.timers.filter.stop(); + if (eve.which == 27) { $(data.input).val(''); } + e.ft.timers.filter.start(function () { + e.ft.raise('footable_filtering'); + var val = $(data.input).val() || ''; + p.filter(e.ft, val); + }, data.timeout); + }); + } + }); + } + }; + + p.filter = function(ft, filterString) { + var $table = $(ft.table); + var minimum = $table.data('filter-minimum') || ft.options.filter.minimum; + if (!filterString || filterString.length < minimum) { + p.clearFilter(ft); + } else { + var filters = filterString.split(' '); + $table.find('> tbody > tr').hide().addClass('footable-filtered'); + var rows = $table.find('> tbody > tr:not(.footable-row-detail)'); + $.each(filters, function (i, f) { + if (f && f.length) + rows = rows.filter('*:ftcontains("' + f + '")'); + }); + rows.each(function () { + p.showRow(this, ft); + $(this).removeClass('footable-filtered'); + }); + ft.raise('footable_filtered', { filter : filterString }); + } + }; + + p.clearFilter = function (ft) { + $(ft.table).find('> tbody > tr:not(.footable-row-detail)').removeClass('footable-filtered').each(function () { + p.showRow(this, ft); + }); + ft.raise('footable_filtered', { cleared : true }); + }; + + p.showRow = function (row, ft) { + var $row = $(row), $next = $row.next(), $table = $(ft.table); + if ($row.is(':visible')) return; //already visible - do nothing + if ($table.hasClass('breakpoint') && $row.hasClass('footable-detail-show') && $next.hasClass('footable-row-detail')) { + $row.add($next).show(); + ft.createOrUpdateDetailRow(row); + } + else $row.show(); + }; + }; + + w.footable.plugins.register(new Filter(), defaults); + +})(jQuery, window); diff --git a/crm/src/main/webapp/FooTable/js/footable.js b/crm/src/main/webapp/FooTable/js/footable.js new file mode 100644 index 0000000..1c56208 --- /dev/null +++ b/crm/src/main/webapp/FooTable/js/footable.js @@ -0,0 +1,547 @@ +/*! + * FooTable - Awesome Responsive Tables + * Version : 0.5 + * http://themergency.com/footable + * + * Requires jQuery - http://jquery.com/ + * + * Copyright 2012 Steven Usher & Brad Vincent + * Released under the MIT license + * You are free to use FooTable in commercial projects as long as this copyright header is left intact. + * + * Date: 22 Apr 2013 + */ +(function ($, w, undefined) { + w.footable = { + options: { + delay: 100, // The number of millseconds to wait before triggering the react event + breakpoints: { // The different screen resolution breakpoints + phone: 480, + tablet: 1024 + }, + parsers: { // The default parser to parse the value out of a cell (values are used in building up row detail) + alpha: function (cell) { + return $(cell).data('value') || $.trim($(cell).text()); + } + }, + calculateWidthAndHeightOverride: null, + toggleSelector: ' > tbody > tr:not(.footable-row-detail)', //the selector to show/hide the detail row + columnDataSelector: '> thead > tr:last-child > th, > thead > tr:last-child > td', //the selector used to find the column data in the thead + createDetail: function (element, data) { + /// This function is used by FooTable to generate the detail view seen when expanding a collapsed row. + /// This is the div that contains all the detail row information, anything could be added to it. + /// + /// This is an array of objects containing the cell information for the current row. + /// These objects look like the below: + /// obj = { + /// 'name': String, // The name of the column + /// 'value': Object, // The value parsed from the cell using the parsers. This could be a string, a number or whatever the parser outputs. + /// 'display': String, // This is the actual HTML from the cell, so if you have images etc you want moved this is the one to use and is the default value used. + /// 'group': String, // This is the identifier used in the data-group attribute of the column. + /// 'groupName': String // This is the actual name of the group the column belongs to. + /// } + /// + + var groups = { '_none': { 'name': null, 'data': [] } }; + for (var i = 0; i < data.length; i++) { + var groupid = data[i].group; + if (groupid != null) { + if (!(groupid in groups)) + groups[groupid] = { 'name': data[i].groupName, 'data': [] }; + + groups[groupid].data.push(data[i]); + } else { + groups._none.data.push(data[i]); + } + } + + for (var group in groups) { + if (groups[group].data.length == 0) continue; + if (group != '_none') element.append('

' + groups[group].name + '

'); + + for (var j = 0; j < groups[group].data.length; j++) { + var separator = (groups[group].data[j].name) ? ':' : ''; + element.append('
' + groups[group].data[j].name + ' ' + separator + ' ' + groups[group].data[j].display + '
'); + } + } + }, + classes: { + loading: 'footable-loading', + loaded: 'footable-loaded', + sorted: 'footable-sorted', + descending: 'footable-sorted-desc', + indicator: 'footable-sort-indicator' + }, + debug: false // Whether or not to log information to the console. + }, + + version: { + major: 0, minor: 5, + toString: function () { + return w.footable.version.major + '.' + w.footable.version.minor; + }, + parse: function (str) { + version = /(\d+)\.?(\d+)?\.?(\d+)?/.exec(str); + return { + major: parseInt(version[1]) || 0, + minor: parseInt(version[2]) || 0, + patch: parseInt(version[3]) || 0 + }; + } + }, + + plugins: { + _validate: function (plugin) { + ///Simple validation of the to make sure any members called by Foobox actually exist. + ///The object defining the plugin, this should implement a string property called "name" and a function called "init". + + if (typeof plugin['name'] !== 'string') { + if (w.footable.options.debug == true) console.error('Validation failed, plugin does not implement a string property called "name".', plugin); + return false; + } + if (!$.isFunction(plugin['init'])) { + if (w.footable.options.debug == true) console.error('Validation failed, plugin "' + plugin['name'] + '" does not implement a function called "init".', plugin); + return false; + } + if (w.footable.options.debug == true) console.log('Validation succeeded for plugin "' + plugin['name'] + '".', plugin); + return true; + }, + registered: [], // An array containing all registered plugins. + register: function (plugin, options) { + ///Registers a and its default with Foobox. + ///The plugin that should implement a string property called "name" and a function called "init". + ///The default options to merge with the Foobox's base options. + + if (w.footable.plugins._validate(plugin)) { + w.footable.plugins.registered.push(plugin); + if (options != undefined && typeof options === 'object') $.extend(true, w.footable.options, options); + if (w.footable.options.debug == true) console.log('Plugin "' + plugin['name'] + '" has been registered with the Foobox.', plugin); + } + }, + init: function (instance) { + ///Loops through all registered plugins and calls the "init" method supplying the current of the Foobox as the first parameter. + ///The current instance of the Foobox that the plugin is being initialized for. + + for (var i = 0; i < w.footable.plugins.registered.length; i++) { + try { + w.footable.plugins.registered[i]['init'](instance); + } catch (err) { + if (w.footable.options.debug == true) console.error(err); + } + } + } + } + }; + + var instanceCount = 0; + + $.fn.footable = function (options) { + ///The main constructor call to initialize the plugin using the supplied . + /// + ///A JSON object containing user defined options for the plugin to use. Any options not supplied will have a default value assigned. + ///Check the documentation or the default options object above for more information on available options. + /// + + options = options || {}; + var o = $.extend(true, {}, w.footable.options, options); //merge user and default options + return this.each(function () { + instanceCount++; + this.footable = new Footable(this, o, instanceCount); + }); + }; + + //helper for using timeouts + function Timer() { + ///Simple timer object created around a timeout. + var t = this; + t.id = null; + t.busy = false; + t.start = function (code, milliseconds) { + ///Starts the timer and waits the specified amount of before executing the supplied . + ///The code to execute once the timer runs out. + ///The time in milliseconds to wait before executing the supplied . + + if (t.busy) { + return; + } + t.stop(); + t.id = setTimeout(function () { + code(); + t.id = null; + t.busy = false; + }, milliseconds); + t.busy = true; + }; + t.stop = function () { + ///Stops the timer if its runnning and resets it back to its starting state. + + if (t.id != null) { + clearTimeout(t.id); + t.id = null; + t.busy = false; + } + }; + }; + + function Footable(t, o, id) { + ///Inits a new instance of the plugin. + ///The main table element to apply this plugin to. + ///The options supplied to the plugin. Check the defaults object to see all available options. + ///The id to assign to this instance of the plugin. + + var ft = this; + ft.id = id; + ft.table = t; + ft.options = o; + ft.breakpoints = []; + ft.breakpointNames = ''; + ft.columns = {}; + + var opt = ft.options; + var cls = opt.classes; + var indexOffset = 0; + + // This object simply houses all the timers used in the footable. + ft.timers = { + resize: new Timer(), + register: function (name) { + ft.timers[name] = new Timer(); + return ft.timers[name]; + } + }; + + w.footable.plugins.init(ft); + + ft.init = function () { + var $window = $(w), $table = $(ft.table); + + if ($table.hasClass(cls.loaded)) { + //already loaded FooTable for the table, so don't init again + ft.raise('footable_already_initialized'); + return; + } + + $table.addClass(cls.loading); + + // Get the column data once for the life time of the plugin + $table.find(opt.columnDataSelector).each(function () { + var data = ft.getColumnData(this); + ft.columns[data.index] = data; + + if (data.className != null) { + var selector = '', first = true; + $.each(data.matches, function (m, match) { //support for colspans + if (!first) { + selector += ', '; + } + selector += '> tbody > tr:not(.footable-row-detail) > td:nth-child(' + (parseInt(match) + 1) + ')'; + first = false; + }); + //add the className to the cells specified by data-class="blah" + $table.find(selector).not('.footable-cell-detail').addClass(data.className); + } + }); + + // Create a nice friendly array to work with out of the breakpoints object. + for (var name in opt.breakpoints) { + ft.breakpoints.push({ 'name': name, 'width': opt.breakpoints[name] }); + ft.breakpointNames += (name + ' '); + } + + // Sort the breakpoints so the smallest is checked first + ft.breakpoints.sort(function (a, b) { + return a['width'] - b['width']; + }); + + //bind the toggle selector click events + ft.bindToggleSelectors(); + + ft.raise('footable_initializing'); + + $table.bind('footable_initialized', function () { + //resize the footable onload + ft.resize(); + + //remove the loading class + $table.removeClass(cls.loading); + + //hides all elements within the table that have the attribute data-hide="init" + //what does this do? LOL + $table.find('[data-init="hide"]').hide(); + $table.find('[data-init="show"]').show(); + + //add the loaded class + $table.addClass(cls.loaded); + }); + + $table.bind('footable_resize', function () { + ft.resize(); + }); + + $window + .bind('resize.footable', function () { + ft.timers.resize.stop(); + ft.timers.resize.start(function () { + ft.resize(); + }, opt.delay); + }); + + ft.raise('footable_initialized'); + }; + + //moved this out into it's own function so that it can be called from other add-ons + ft.bindToggleSelectors = function () { + var $table = $(ft.table); + $table.find(opt.toggleSelector).unbind('click.footable').bind('click.footable', function (e) { + if ($table.is('.breakpoint') && $(e.target).is('td')) { + var $row = $(this).is('tr') ? $(this) : $(this).parents('tr:first'); + ft.toggleDetail($row.get(0)); + } + }); + }; + + ft.parse = function (cell, column) { + var parser = opt.parsers[column.type] || opt.parsers.alpha; + return parser(cell); + }; + + ft.getColumnData = function (th) { + var $th = $(th), hide = $th.data('hide'), index = $th.index(); + hide = hide || ''; + hide = hide.split(','); + var data = { + 'index': index, + 'hide': { }, + 'type': $th.data('type') || 'alpha', + 'name': $th.data('name') || $.trim($th.text()), + 'ignore': $th.data('ignore') || false, + 'className': $th.data('class') || null, + 'matches': [], + 'names': { }, + 'group': $th.data('group') || null, + 'groupName': null + }; + + if (data.group != null) { + var $group = $(ft.table).find('> thead > tr.footable-group-row > th[data-group="' + data.group + '"], > thead > tr.footable-group-row > td[data-group="' + data.group + '"]').first(); + data.groupName = ft.parse($group, { 'type': 'alpha' }); + } + + var pcolspan = parseInt($th.prev().attr('colspan') || 0); + indexOffset += pcolspan > 1 ? pcolspan - 1 : 0; + var colspan = parseInt($th.attr('colspan') || 0), curindex = data.index + indexOffset; + if (colspan > 1) { + var names = $th.data('names'); + names = names || ''; + names = names.split(','); + for (var i = 0; i < colspan; i++) { + data.matches.push(i + curindex); + if (i < names.length) data.names[i + curindex] = names[i]; + } + } else { + data.matches.push(curindex); + } + + data.hide['default'] = ($th.data('hide') === "all") || ($.inArray('default', hide) >= 0); + + for (var name in opt.breakpoints) { + data.hide[name] = ($th.data('hide') === "all") || ($.inArray(name, hide) >= 0); + } + var e = ft.raise('footable_column_data', { 'column': { 'data': data, 'th': th } }); + return e.column.data; + }; + + ft.getViewportWidth = function () { + return window.innerWidth || (document.body ? document.body.offsetWidth : 0); + }; + + ft.getViewportHeight = function () { + return window.innerHeight || (document.body ? document.body.offsetHeight : 0); + }; + + ft.calculateWidthAndHeight = function ($table, info) { + if (jQuery.isFunction(opt.calculateWidthAndHeightOverride)) { + return opt.calculateWidthAndHeightOverride($table, info); + } + if (info.viewportWidth < info.width) info.width = info.viewportWidth; + if (info.viewportHeight < info.height) info.height = info.viewportHeight; + + return info; + }; + + ft.hasBreakpointColumn = function (breakpoint) { + for (var c in ft.columns) { + if (ft.columns[c].hide[breakpoint]) { + return true; + } + } + return false; + }; + + ft.resize = function () { + var $table = $(ft.table); + var info = { + 'width': $table.width(), //the table width + 'height': $table.height(), //the table height + 'viewportWidth': ft.getViewportWidth(), //the width of the viewport + 'viewportHeight': ft.getViewportHeight(), //the width of the viewport + 'orientation': null + }; + info.orientation = info.viewportWidth > info.viewportHeight ? 'landscape' : 'portrait'; + + info = ft.calculateWidthAndHeight($table, info); + + var pinfo = $table.data('footable_info'); + $table.data('footable_info', info); + ft.raise('footable_resizing', { 'old': pinfo, 'info': info }); + + // This (if) statement is here purely to make sure events aren't raised twice as mobile safari seems to do + if (!pinfo || ((pinfo && pinfo.width && pinfo.width != info.width) || (pinfo && pinfo.height && pinfo.height != info.height))) { + var current = null, breakpoint; + for (var i = 0; i < ft.breakpoints.length; i++) { + breakpoint = ft.breakpoints[i]; + if (breakpoint && breakpoint.width && info.width <= breakpoint.width) { + current = breakpoint; + break; + } + } + + var breakpointName = (current == null ? 'default' : current['name']); + + var hasBreakpointFired = ft.hasBreakpointColumn(breakpointName); + + $table + .removeClass('default breakpoint').removeClass(ft.breakpointNames) + .addClass(breakpointName + (hasBreakpointFired ? ' breakpoint' : '')) + .find('> thead > tr:last-child > th') + .each(function () { + var data = ft.columns[$(this).index()], selector = '', first = true; + $.each(data.matches, function (m, match) { + if (!first) { + selector += ', '; + } + var count = match + 1; + selector += '> tbody > tr:not(.footable-row-detail) > td:nth-child(' + count + ')'; + selector += ', > tfoot > tr:not(.footable-row-detail) > td:nth-child(' + count + ')'; + selector += ', > colgroup > col:nth-child(' + count + ')'; + first = false; + }); + + selector += ', > thead > tr[data-group-row="true"] > th[data-group="' + data.group + '"]'; + var $column = $table.find(selector).add(this); + if (data.hide[breakpointName] == false) $column.show(); + else $column.hide(); + + if ($table.find('> thead > tr.footable-group-row').length == 1) { + var $groupcols = $table.find('> thead > tr:last-child > th[data-group="' + data.group + '"]:visible, > thead > tr:last-child > th[data-group="' + data.group + '"]:visible'), + $group = $table.find('> thead > tr.footable-group-row > th[data-group="' + data.group + '"], > thead > tr.footable-group-row > td[data-group="' + data.group + '"]'), + groupspan = 0; + + $.each($groupcols, function () { + groupspan += parseInt($(this).attr('colspan') || 1); + }); + + if (groupspan > 0) $group.attr('colspan', groupspan).show(); + else $group.hide(); + } + }) + .end() + .find('> tbody > tr.footable-detail-show').each(function () { + ft.createOrUpdateDetailRow(this); + }); + + $table.find('> tbody > tr.footable-detail-show:visible').each(function () { + var $next = $(this).next(); + if ($next.hasClass('footable-row-detail')) { + if (breakpointName == 'default' && !hasBreakpointFired) $next.hide(); + else $next.show(); + } + }); + + // adding .footable-first-column and .footable-last-column to the first and last th and td of each row in order to allow + // for styling if the first or last column is hidden (which won't work using :first-child or :last-child) + $table.find('> thead > tr > th.footable-last-column, > tbody > tr > td.footable-last-column').removeClass('footable-last-column'); + $table.find('> thead > tr > th.footable-first-column, > tbody > tr > td.footable-first-column').removeClass('footable-first-column'); + $table.find('> thead > tr, > tbody > tr') + .find('> th:visible:last, > td:visible:last') + .addClass('footable-last-column') + .end() + .find('> th:visible:first, > td:visible:first') + .addClass('footable-first-column'); + + ft.raise('footable_breakpoint_' + breakpointName, { 'info': info }); + } + + ft.raise('footable_resized', { 'old': pinfo, 'info': info }); + }; + + ft.toggleDetail = function (actualRow) { + var $row = $(actualRow), + created = ft.createOrUpdateDetailRow($row.get(0)), + $next = $row.next(); + + if (!created && $next.is(':visible')) { + $row.removeClass('footable-detail-show'); + //only hide the next row if it's a detail row + if ($next.hasClass('footable-row-detail')) $next.hide(); + } else { + $row.addClass('footable-detail-show'); + $next.show(); + } + }; + + ft.getColumnFromTdIndex = function (index) { + /// Returns the correct column data for the supplied index taking into account colspans. + /// The index to retrieve the column data for. + /// A JSON object containing the column data for the supplied index. + var result = null; + for (var column in ft.columns) { + if ($.inArray(index, ft.columns[column].matches) >= 0) { + result = ft.columns[column]; + break; + } + } + return result; + }; + + ft.createOrUpdateDetailRow = function (actualRow) { + var $row = $(actualRow), $next = $row.next(), $detail, values = []; + if ($row.is(':hidden')) return false; //if the row is hidden for some readon (perhaps filtered) then get out of here + ft.raise('footable_rowdetailupdated', { 'row': $row, 'detail': $next }); + $row.find('> td:hidden').each(function () { + var index = $(this).index(), column = ft.getColumnFromTdIndex(index), name = column.name; + if (column.ignore == true) return true; + + if (index in column.names) name = column.names[index]; + values.push({ 'name': name, 'value': ft.parse(this, column), 'display': $.trim($(this).html()), 'group': column.group, 'groupName': column.groupName }); + return true; + }); + if (values.length == 0) return false; //return if we don't have any data to show + var colspan = $row.find('> td:visible').length; + var exists = $next.hasClass('footable-row-detail'); + if (!exists) { // Create + $next = $(''); + $row.after($next); + } + $next.find('> td:first').attr('colspan', colspan); + $detail = $next.find('.footable-row-detail-inner').empty(); + opt.createDetail($detail, values); + return !exists; + }; + + ft.raise = function (eventName, args) { + args = args || { }; + var def = { 'ft': ft }; + $.extend(true, def, args); + var e = $.Event(eventName, def); + if (!e.ft) { + $.extend(true, e, def); + } //pre jQuery 1.6 which did not allow data to be passed to event object constructor + $(ft.table).trigger(e); + return e; + }; + + ft.init(); + return ft; + }; +})(jQuery, window); diff --git a/crm/src/main/webapp/FooTable/js/footable.paginate.js b/crm/src/main/webapp/FooTable/js/footable.paginate.js new file mode 100644 index 0000000..e89a376 --- /dev/null +++ b/crm/src/main/webapp/FooTable/js/footable.paginate.js @@ -0,0 +1,123 @@ +(function ($, w, undefined) { + if (w.footable == undefined || w.footable == null) + throw new Error('Please check and make sure footable.js is included in the page and is loaded prior to this script.'); + + var defaults = { + paginate: true, + pageSize: 10, + pageNavigation: '.footable-nav' + }; + + function pageInfo(ft) { + var $table = $(ft.table), $tbody = $table.find('> tbody'); + this.pageNavigation = $table.data('page-navigation') || ft.options.pageNavigation; + this.pageSize = $table.data('page-size') || ft.options.pageSize; + this.currentPage = 0; + this.pages = []; + }; + + function Paginate() { + var p = this; + p.name = 'Footable Paginate'; + + p.init = function (ft) { + if (ft.options.paginate == true) { + $(ft.table).bind({ + 'footable_initialized': function (e) { + e.ft.pageInfo = new pageInfo(e.ft); + e.ft.raise('footable_setup_paging'); + }, + 'footable_sorted footable_filtered footable_setup_paging': function () { + p.setupPaging(ft); + } + }); + } + }; + + p.setupPaging = function(ft) { + var $tbody = $(ft.table).find('> tbody'); + p.createPages(ft, $tbody); + p.createNavigation(ft, $tbody); + p.fillPage(ft, $tbody, ft.pageInfo.currentPage); + }; + + p.createPages = function (ft, tbody) { + var pages = 1; + var info = ft.pageInfo; + var pageCount = pages * info.pageSize; + var page = []; + var lastPage = []; + info.pages = []; + var rows = tbody.find('> tr:not(.footable-filtered,.footable-row-detail)'); + rows.each(function (i, row) { + page.push(row); + if (i === pageCount - 1) { + info.pages.push(page); + pages++; + pageCount = pages * info.pageSize; + page = []; + } else if (i >= rows.length - (rows.length % info.pageSize)) { + lastPage.push(row); + } + }); + if (lastPage.length > 0) info.pages.push(lastPage); + if (info.currentPage >= info.pages.length) info.currentPage = info.pages.length - 1; + if (info.currentPage < 0) info.currentPage = 0; + }; + + p.createNavigation = function (ft, tbody) { + var $nav = $(ft.pageInfo.pageNavigation); + if ($nav.length == 0) return; + $nav.find('li').remove(); + var info = ft.pageInfo; + if (info.pages.length > 0) { + + $nav.append('
  • «
  • '); + $.each(info.pages, function (i, page) { + if (page.length > 0) { + $nav.append('
  • ' + (i + 1) + '
  • '); + } + }); + $nav.append('
  • »
  • '); + } + $nav.find('a').click(function (e) { + e.preventDefault(); + var page = $(this).data('page'); + var newPage = info.currentPage; + if (page == 'prev') { + if (newPage > 0) newPage--; + } else if (page == 'next') { + if (newPage < info.pages.length - 1) newPage++; + } else { + newPage = page; + } + if (info.currentPage != newPage) { + p.fillPage(ft, tbody, newPage); + } + $nav.find('li').removeClass('footable-page-current'); + $nav.find('li.footable-page > a[data-page=' + info.currentPage + ']').parent().addClass('footable-page-current'); + }); + $nav.find('li.footable-page > a[data-page=' + info.currentPage + ']').parent().addClass('footable-page-current'); + }; + + p.fillPage = function (ft, tbody, pageNumber) { + ft.pageInfo.currentPage = pageNumber; + tbody.find('> tr').hide(); + $(ft.pageInfo.pages[pageNumber]).each(function () { + p.showRow(this, ft); + }); + }; + + p.showRow = function (row, ft) { + var $row = $(row), $next = $row.next(), $table = $(ft.table); + if ($table.hasClass('breakpoint') && $row.hasClass('footable-detail-show') && $next.hasClass('footable-row-detail')) { + $row.add($next).show(); + ft.createOrUpdateDetailRow(row); + } + else $row.show(); + }; + }; + + w.footable.plugins.register(new Paginate(), defaults); + +})(jQuery, window); \ No newline at end of file diff --git a/crm/src/main/webapp/FooTable/js/footable.plugin.template.js b/crm/src/main/webapp/FooTable/js/footable.plugin.template.js new file mode 100644 index 0000000..a5e1cba --- /dev/null +++ b/crm/src/main/webapp/FooTable/js/footable.plugin.template.js @@ -0,0 +1,44 @@ +(function ($, w, undefined) { + if (w.footable == undefined || w.foobox == null) + throw new Error('Please check and make sure footable.js is included in the page and is loaded prior to this script.'); + + var defaults = { + /* + Plugin options here, example: + + var defaults = { + myPlugin: { + enabled: true + } + }; + + This would allow you to access this option using ft.options.myPlugin.enabled + */ + }; + + function MyPlugin() { + var p = this; + p.name = 'Footable MyPlugin'; + p.init = function(ft) { + $(ft.table).bind({ + /* + Bind to relevant events here to modify/add functionality to Footable, example: + + $(ft.table).bind({ + 'footable_initialized': function(e){ + if (e.ft.options.myPlugin.enabled == true){ + alert('Hello World'); + } + } + }); + + This would listen for the 'footable_initialized' event and when called check if the plugin is enabled + and if it is alert 'Hello World' to the user. + */ + }); + }; + }; + + w.footable.plugins.register(new MyPlugin(), defaults); + +})(jQuery, window); \ No newline at end of file diff --git a/crm/src/main/webapp/FooTable/js/footable.sortable.js b/crm/src/main/webapp/FooTable/js/footable.sortable.js new file mode 100644 index 0000000..b3a0795 --- /dev/null +++ b/crm/src/main/webapp/FooTable/js/footable.sortable.js @@ -0,0 +1,160 @@ +(function($, w, undefined) { + if (w.footable == undefined || w.footable == null) + throw new Error('Please check and make sure footable.js is included in the page and is loaded prior to this script.'); + + var defaults = { + sort: true, + sorters: { + alpha: function(a, b) { + if (a == b) return 0; + if (a < b) return -1; + return 1; + }, + numeric: function(a, b) { + return a - b; + } + }, + parsers: { + numeric: function(cell) { + var val = $(cell).data('value') || $(cell).text().replace(/[^0-9.-]/g, ''); + val = parseFloat(val); + if (isNaN(val)) val = 0; + return val; + } + }, + classes: { + sort: { + sortable: 'footable-sortable', + sorted: 'footable-sorted', + descending: 'footable-sorted-desc', + indicator: 'footable-sort-indicator' + } + } + }; + + function Sortable() { + var p = this; + p.name = 'Footable Sortable'; + p.init = function(ft) { + if (ft.options.sort == true) { + $(ft.table).bind({ + 'footable_initialized': function(e) { + var cls = ft.options.classes.sort, column; + + var $table = $(e.ft.table), $tbody = $table.find('> tbody'), $th; + + $table.find('> thead > tr:last-child > th, > thead > tr:last-child > td').each(function(ec) { + $th = $(this), column = e.ft.columns[$th.index()]; + if (column.sort.ignore != true) { + $th.addClass(cls.sortable); + $('').addClass(cls.indicator).appendTo($th); + } + }); + + $table.find('> thead > tr:last-child > th.' + cls.sortable + ', > thead > tr:last-child > td.' + cls.sortable).click(function(ec) { + $th = $(this), column = e.ft.columns[$th.index()]; + if (column.sort.ignore == true) return true; + ec.preventDefault(); + + $table.find('> thead > tr:last-child > th, > thead > tr:last-child > td').not($th).removeClass(cls.sorted + ' ' + cls.descending); + + if ($th.hasClass(cls.sorted)) { + p.reverse(e.ft, $tbody); + $th.removeClass(cls.sorted).addClass(cls.descending); + } else if ($th.hasClass(cls.descending)) { + p.reverse(e.ft, $tbody); + $th.removeClass(cls.descending).addClass(cls.sorted); + } else { + p.sort(e.ft, $tbody, column); + $th.removeClass(cls.descending).addClass(cls.sorted); + } + e.ft.bindToggleSelectors(); + e.ft.raise('footable_sorted', { column : column }); + return false; + }); + + var didSomeSorting = false; + for (var c in e.ft.columns) { + column = e.ft.columns[c]; + if (column.sort.initial) { + p.sort(e.ft, $tbody, column); + didSomeSorting = true; + $th = $table.find('> thead > tr:last-child > th:eq(' + c + '), > thead > tr:last-child > td:eq(' + c + ')'); + + if (column.sort.initial == 'descending') { + p.reverse(e.ft, $tbody); + $th.addClass(cls.descending); + } else { + $th.addClass(cls.sorted); + } + + break; + } else if (column.sort.ignore != true) { + + } + } + if (didSomeSorting) { + e.ft.bindToggleSelectors(); + } + }, + 'footable_column_data': function(e) { + var $th = $(e.column.th); + e.column.data.sort = e.column.data.sort || {}; + e.column.data.sort.initial = $th.data('sort-initial') || false; + e.column.data.sort.ignore = $th.data('sort-ignore') || false; + e.column.data.sort.selector = $th.data('sort-selector') || null; + + var match = $th.data('sort-match') || 0; + if (match >= e.column.data.matches.length) match = 0; + e.column.data.sort.match = e.column.data.matches[match]; + } + }); + } + }; + + p.rows = function(ft, tbody, column) { + var rows = []; + tbody.find('> tr').each(function() { + var $row = $(this), $next = null; + if ($row.hasClass('footable-row-detail')) return true; + if ($row.next().hasClass('footable-row-detail')) { + $next = $row.next().get(0); + } + var row = { 'row': $row, 'detail': $next }; + if (column != undefined) { + row.value = ft.parse(this.cells[column.sort.match], column); + } + rows.push(row); + return true; + }).detach(); + return rows; + }; + + p.sort = function(ft, tbody, column) { + var rows = p.rows(ft, tbody, column); + var sorter = ft.options.sorters[column.type] || ft.options.sorters.alpha; + rows.sort(function(a, b) { return sorter(a.value, b.value); }); + for (var j = 0; j < rows.length; j++) { + tbody.append(rows[j].row); + if (rows[j].detail != null) { + tbody.append(rows[j].detail); + } + } + }; + + p.reverse = function(ft, tbody) { + var rows = p.rows(ft, tbody); + for (var i = rows.length - 1; i >= 0; i--) { + tbody.append(rows[i].row); + if (rows[i].detail != null) { + tbody.append(rows[i].detail); + } + } + }; + } + + ; + + w.footable.plugins.register(new Sortable(), defaults); + +})(jQuery, window); \ No newline at end of file diff --git a/crm/src/main/webapp/FortAwesome/.gitignore b/crm/src/main/webapp/FortAwesome/.gitignore new file mode 100644 index 0000000..51d8053 --- /dev/null +++ b/crm/src/main/webapp/FortAwesome/.gitignore @@ -0,0 +1,29 @@ +*.pyc +*.egg-info +*.db +*.db.old +*.swp +*.db-journal + +.coverage +.DS_Store +.installed.cfg + +.idea/* +.svn/* +src/website/static/* +src/website/media/* + +bin +build +cfcache +develop-eggs +dist +downloads +eggs +parts +tmp +.sass-cache + +src/website/settingslocal.py +stunnel.log \ No newline at end of file diff --git a/crm/src/main/webapp/FortAwesome/README.md b/crm/src/main/webapp/FortAwesome/README.md new file mode 100644 index 0000000..cd1de27 --- /dev/null +++ b/crm/src/main/webapp/FortAwesome/README.md @@ -0,0 +1,22 @@ +#Font Awesome 3.0.2 +##the iconic font designed for use with Twitter Bootstrap + +The full suite of pictographic icons, examples, and documentation can be found at: +http://fortawesome.github.com/Font-Awesome/ + + +##License +- The Font Awesome font is licensed under the SIL Open Font License - http://scripts.sil.org/OFL +- Font Awesome CSS, LESS, and SASS files are licensed under the MIT License - http://opensource.org/licenses/mit-license.html +- The Font Awesome pictograms are licensed under the CC BY 3.0 License - http://creativecommons.org/licenses/by/3.0/ +- Attribution is no longer required in Font Awesome 3.0, but much appreciated: "Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome" + +##Contact +- Email: dave@davegandy.com +- Twitter: http://twitter.com/fortaweso_me +- Work: Lead Product Designer @ http://kyru.us + +##Changelog +- v3.0.0 - all icons redesigned from scratch, optimized for Bootstrap's 14px default +- v3.0.1 - much improved rendering in webkit, various bugfixes +- v3.0.2 - much improved rendering and alignment in IE7 diff --git a/crm/src/main/webapp/FortAwesome/css/font-awesome.min.css b/crm/src/main/webapp/FortAwesome/css/font-awesome.min.css new file mode 100644 index 0000000..d4e45b3 --- /dev/null +++ b/crm/src/main/webapp/FortAwesome/css/font-awesome.min.css @@ -0,0 +1,33 @@ +/*! + * Font Awesome 3.0.2 + * the iconic font designed for use with Twitter Bootstrap + * ------------------------------------------------------- + * The full suite of pictographic icons, examples, and documentation + * can be found at: http://fortawesome.github.com/Font-Awesome/ + * + * License + * ------------------------------------------------------- + * - The Font Awesome font is licensed under the SIL Open Font License - http://scripts.sil.org/OFL + * - Font Awesome CSS, LESS, and SASS files are licensed under the MIT License - + * http://opensource.org/licenses/mit-license.html + * - The Font Awesome pictograms are licensed under the CC BY 3.0 License - http://creativecommons.org/licenses/by/3.0/ + * - Attribution is no longer required in Font Awesome 3.0, but much appreciated: + * "Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome" + + * Contact + * ------------------------------------------------------- + * Email: dave@davegandy.com + * Twitter: http://twitter.com/fortaweso_me + * Work: Lead Product Designer @ http://kyruus.com + */ + +@font-face{ + font-family:'FontAwesome'; + src:url('../font/fontawesome-webfont.eot?v=3.0.1'); + src:url('../font/fontawesome-webfont.eot?#iefix&v=3.0.1') format('embedded-opentype'), + url('../font/fontawesome-webfont.woff?v=3.0.1') format('woff'), + url('../font/fontawesome-webfont.ttf?v=3.0.1') format('truetype'); + font-weight:normal; + font-style:normal } + +[class^="icon-"],[class*=" icon-"]{font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;display:inline;width:auto;height:auto;line-height:normal;vertical-align:baseline;background-image:none;background-position:0 0;background-repeat:repeat;margin-top:0}.icon-white,.nav-pills>.active>a>[class^="icon-"],.nav-pills>.active>a>[class*=" icon-"],.nav-list>.active>a>[class^="icon-"],.nav-list>.active>a>[class*=" icon-"],.navbar-inverse .nav>.active>a>[class^="icon-"],.navbar-inverse .nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^="icon-"],.dropdown-submenu:hover>a>[class*=" icon-"]{background-image:none}[class^="icon-"]:before,[class*=" icon-"]:before{text-decoration:inherit;display:inline-block;speak:none}a [class^="icon-"],a [class*=" icon-"]{display:inline-block}.icon-large:before{vertical-align:-10%;font-size:1.3333333333333333em}.btn [class^="icon-"],.nav [class^="icon-"],.btn [class*=" icon-"],.nav [class*=" icon-"]{display:inline}.btn [class^="icon-"].icon-large,.nav [class^="icon-"].icon-large,.btn [class*=" icon-"].icon-large,.nav [class*=" icon-"].icon-large{line-height:.9em}.btn [class^="icon-"].icon-spin,.nav [class^="icon-"].icon-spin,.btn [class*=" icon-"].icon-spin,.nav [class*=" icon-"].icon-spin{display:inline-block}.nav-tabs [class^="icon-"],.nav-pills [class^="icon-"],.nav-tabs [class*=" icon-"],.nav-pills [class*=" icon-"],.nav-tabs [class^="icon-"].icon-large,.nav-pills [class^="icon-"].icon-large,.nav-tabs [class*=" icon-"].icon-large,.nav-pills [class*=" icon-"].icon-large{line-height:.9em}li [class^="icon-"],.nav li [class^="icon-"],li [class*=" icon-"],.nav li [class*=" icon-"]{display:inline-block;width:1.25em;text-align:center}li [class^="icon-"].icon-large,.nav li [class^="icon-"].icon-large,li [class*=" icon-"].icon-large,.nav li [class*=" icon-"].icon-large{width:1.5625em}ul.icons{list-style-type:none;text-indent:-0.75em}ul.icons li [class^="icon-"],ul.icons li [class*=" icon-"]{width:.75em}.icon-muted{color:#eee}.icon-border{border:solid 1px #eee;padding:.2em .25em .15em;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.icon-2x{font-size:2em}.icon-2x.icon-border{border-width:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.icon-3x{font-size:3em}.icon-3x.icon-border{border-width:3px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.icon-4x{font-size:4em}.icon-4x.icon-border{border-width:4px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.pull-right{float:right}.pull-left{float:left}[class^="icon-"].pull-left,[class*=" icon-"].pull-left{margin-right:.3em}[class^="icon-"].pull-right,[class*=" icon-"].pull-right{margin-left:.3em}.btn [class^="icon-"].pull-left.icon-2x,.btn [class*=" icon-"].pull-left.icon-2x,.btn [class^="icon-"].pull-right.icon-2x,.btn [class*=" icon-"].pull-right.icon-2x{margin-top:.18em}.btn [class^="icon-"].icon-spin.icon-large,.btn [class*=" icon-"].icon-spin.icon-large{line-height:.8em}.btn.btn-small [class^="icon-"].pull-left.icon-2x,.btn.btn-small [class*=" icon-"].pull-left.icon-2x,.btn.btn-small [class^="icon-"].pull-right.icon-2x,.btn.btn-small [class*=" icon-"].pull-right.icon-2x{margin-top:.25em}.btn.btn-large [class^="icon-"],.btn.btn-large [class*=" icon-"]{margin-top:0}.btn.btn-large [class^="icon-"].pull-left.icon-2x,.btn.btn-large [class*=" icon-"].pull-left.icon-2x,.btn.btn-large [class^="icon-"].pull-right.icon-2x,.btn.btn-large [class*=" icon-"].pull-right.icon-2x{margin-top:.05em}.btn.btn-large [class^="icon-"].pull-left.icon-2x,.btn.btn-large [class*=" icon-"].pull-left.icon-2x{margin-right:.2em}.btn.btn-large [class^="icon-"].pull-right.icon-2x,.btn.btn-large [class*=" icon-"].pull-right.icon-2x{margin-left:.2em}.icon-spin{display:inline-block;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg)}100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg)}100%{-o-transform:rotate(359deg)}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg)}100%{-ms-transform:rotate(359deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}}@-moz-document url-prefix(){.icon-spin{height:.9em}.btn .icon-spin{height:auto}.icon-spin.icon-large{height:1.25em}.btn .icon-spin.icon-large{height:.75em}}.icon-glass:before{content:"\f000"}.icon-music:before{content:"\f001"}.icon-search:before{content:"\f002"}.icon-envelope:before{content:"\f003"}.icon-heart:before{content:"\f004"}.icon-star:before{content:"\f005"}.icon-star-empty:before{content:"\f006"}.icon-user:before{content:"\f007"}.icon-film:before{content:"\f008"}.icon-th-large:before{content:"\f009"}.icon-th:before{content:"\f00a"}.icon-th-list:before{content:"\f00b"}.icon-ok:before{content:"\f00c"}.icon-remove:before{content:"\f00d"}.icon-zoom-in:before{content:"\f00e"}.icon-zoom-out:before{content:"\f010"}.icon-off:before{content:"\f011"}.icon-signal:before{content:"\f012"}.icon-cog:before{content:"\f013"}.icon-trash:before{content:"\f014"}.icon-home:before{content:"\f015"}.icon-file:before{content:"\f016"}.icon-time:before{content:"\f017"}.icon-road:before{content:"\f018"}.icon-download-alt:before{content:"\f019"}.icon-download:before{content:"\f01a"}.icon-upload:before{content:"\f01b"}.icon-inbox:before{content:"\f01c"}.icon-play-circle:before{content:"\f01d"}.icon-repeat:before{content:"\f01e"}.icon-refresh:before{content:"\f021"}.icon-list-alt:before{content:"\f022"}.icon-lock:before{content:"\f023"}.icon-flag:before{content:"\f024"}.icon-headphones:before{content:"\f025"}.icon-volume-off:before{content:"\f026"}.icon-volume-down:before{content:"\f027"}.icon-volume-up:before{content:"\f028"}.icon-qrcode:before{content:"\f029"}.icon-barcode:before{content:"\f02a"}.icon-tag:before{content:"\f02b"}.icon-tags:before{content:"\f02c"}.icon-book:before{content:"\f02d"}.icon-bookmark:before{content:"\f02e"}.icon-print:before{content:"\f02f"}.icon-camera:before{content:"\f030"}.icon-font:before{content:"\f031"}.icon-bold:before{content:"\f032"}.icon-italic:before{content:"\f033"}.icon-text-height:before{content:"\f034"}.icon-text-width:before{content:"\f035"}.icon-align-left:before{content:"\f036"}.icon-align-center:before{content:"\f037"}.icon-align-right:before{content:"\f038"}.icon-align-justify:before{content:"\f039"}.icon-list:before{content:"\f03a"}.icon-indent-left:before{content:"\f03b"}.icon-indent-right:before{content:"\f03c"}.icon-facetime-video:before{content:"\f03d"}.icon-picture:before{content:"\f03e"}.icon-pencil:before{content:"\f040"}.icon-map-marker:before{content:"\f041"}.icon-adjust:before{content:"\f042"}.icon-tint:before{content:"\f043"}.icon-edit:before{content:"\f044"}.icon-share:before{content:"\f045"}.icon-check:before{content:"\f046"}.icon-move:before{content:"\f047"}.icon-step-backward:before{content:"\f048"}.icon-fast-backward:before{content:"\f049"}.icon-backward:before{content:"\f04a"}.icon-play:before{content:"\f04b"}.icon-pause:before{content:"\f04c"}.icon-stop:before{content:"\f04d"}.icon-forward:before{content:"\f04e"}.icon-fast-forward:before{content:"\f050"}.icon-step-forward:before{content:"\f051"}.icon-eject:before{content:"\f052"}.icon-chevron-left:before{content:"\f053"}.icon-chevron-right:before{content:"\f054"}.icon-plus-sign:before{content:"\f055"}.icon-minus-sign:before{content:"\f056"}.icon-remove-sign:before{content:"\f057"}.icon-ok-sign:before{content:"\f058"}.icon-question-sign:before{content:"\f059"}.icon-info-sign:before{content:"\f05a"}.icon-screenshot:before{content:"\f05b"}.icon-remove-circle:before{content:"\f05c"}.icon-ok-circle:before{content:"\f05d"}.icon-ban-circle:before{content:"\f05e"}.icon-arrow-left:before{content:"\f060"}.icon-arrow-right:before{content:"\f061"}.icon-arrow-up:before{content:"\f062"}.icon-arrow-down:before{content:"\f063"}.icon-share-alt:before{content:"\f064"}.icon-resize-full:before{content:"\f065"}.icon-resize-small:before{content:"\f066"}.icon-plus:before{content:"\f067"}.icon-minus:before{content:"\f068"}.icon-asterisk:before{content:"\f069"}.icon-exclamation-sign:before{content:"\f06a"}.icon-gift:before{content:"\f06b"}.icon-leaf:before{content:"\f06c"}.icon-fire:before{content:"\f06d"}.icon-eye-open:before{content:"\f06e"}.icon-eye-close:before{content:"\f070"}.icon-warning-sign:before{content:"\f071"}.icon-plane:before{content:"\f072"}.icon-calendar:before{content:"\f073"}.icon-random:before{content:"\f074"}.icon-comment:before{content:"\f075"}.icon-magnet:before{content:"\f076"}.icon-chevron-up:before{content:"\f077"}.icon-chevron-down:before{content:"\f078"}.icon-retweet:before{content:"\f079"}.icon-shopping-cart:before{content:"\f07a"}.icon-folder-close:before{content:"\f07b"}.icon-folder-open:before{content:"\f07c"}.icon-resize-vertical:before{content:"\f07d"}.icon-resize-horizontal:before{content:"\f07e"}.icon-bar-chart:before{content:"\f080"}.icon-twitter-sign:before{content:"\f081"}.icon-facebook-sign:before{content:"\f082"}.icon-camera-retro:before{content:"\f083"}.icon-key:before{content:"\f084"}.icon-cogs:before{content:"\f085"}.icon-comments:before{content:"\f086"}.icon-thumbs-up:before{content:"\f087"}.icon-thumbs-down:before{content:"\f088"}.icon-star-half:before{content:"\f089"}.icon-heart-empty:before{content:"\f08a"}.icon-signout:before{content:"\f08b"}.icon-linkedin-sign:before{content:"\f08c"}.icon-pushpin:before{content:"\f08d"}.icon-external-link:before{content:"\f08e"}.icon-signin:before{content:"\f090"}.icon-trophy:before{content:"\f091"}.icon-github-sign:before{content:"\f092"}.icon-upload-alt:before{content:"\f093"}.icon-lemon:before{content:"\f094"}.icon-phone:before{content:"\f095"}.icon-check-empty:before{content:"\f096"}.icon-bookmark-empty:before{content:"\f097"}.icon-phone-sign:before{content:"\f098"}.icon-twitter:before{content:"\f099"}.icon-facebook:before{content:"\f09a"}.icon-github:before{content:"\f09b"}.icon-unlock:before{content:"\f09c"}.icon-credit-card:before{content:"\f09d"}.icon-rss:before{content:"\f09e"}.icon-hdd:before{content:"\f0a0"}.icon-bullhorn:before{content:"\f0a1"}.icon-bell:before{content:"\f0a2"}.icon-certificate:before{content:"\f0a3"}.icon-hand-right:before{content:"\f0a4"}.icon-hand-left:before{content:"\f0a5"}.icon-hand-up:before{content:"\f0a6"}.icon-hand-down:before{content:"\f0a7"}.icon-circle-arrow-left:before{content:"\f0a8"}.icon-circle-arrow-right:before{content:"\f0a9"}.icon-circle-arrow-up:before{content:"\f0aa"}.icon-circle-arrow-down:before{content:"\f0ab"}.icon-globe:before{content:"\f0ac"}.icon-wrench:before{content:"\f0ad"}.icon-tasks:before{content:"\f0ae"}.icon-filter:before{content:"\f0b0"}.icon-briefcase:before{content:"\f0b1"}.icon-fullscreen:before{content:"\f0b2"}.icon-group:before{content:"\f0c0"}.icon-link:before{content:"\f0c1"}.icon-cloud:before{content:"\f0c2"}.icon-beaker:before{content:"\f0c3"}.icon-cut:before{content:"\f0c4"}.icon-copy:before{content:"\f0c5"}.icon-paper-clip:before{content:"\f0c6"}.icon-save:before{content:"\f0c7"}.icon-sign-blank:before{content:"\f0c8"}.icon-reorder:before{content:"\f0c9"}.icon-list-ul:before{content:"\f0ca"}.icon-list-ol:before{content:"\f0cb"}.icon-strikethrough:before{content:"\f0cc"}.icon-underline:before{content:"\f0cd"}.icon-table:before{content:"\f0ce"}.icon-magic:before{content:"\f0d0"}.icon-truck:before{content:"\f0d1"}.icon-pinterest:before{content:"\f0d2"}.icon-pinterest-sign:before{content:"\f0d3"}.icon-google-plus-sign:before{content:"\f0d4"}.icon-google-plus:before{content:"\f0d5"}.icon-money:before{content:"\f0d6"}.icon-caret-down:before{content:"\f0d7"}.icon-caret-up:before{content:"\f0d8"}.icon-caret-left:before{content:"\f0d9"}.icon-caret-right:before{content:"\f0da"}.icon-columns:before{content:"\f0db"}.icon-sort:before{content:"\f0dc"}.icon-sort-down:before{content:"\f0dd"}.icon-sort-up:before{content:"\f0de"}.icon-envelope-alt:before{content:"\f0e0"}.icon-linkedin:before{content:"\f0e1"}.icon-undo:before{content:"\f0e2"}.icon-legal:before{content:"\f0e3"}.icon-dashboard:before{content:"\f0e4"}.icon-comment-alt:before{content:"\f0e5"}.icon-comments-alt:before{content:"\f0e6"}.icon-bolt:before{content:"\f0e7"}.icon-sitemap:before{content:"\f0e8"}.icon-umbrella:before{content:"\f0e9"}.icon-paste:before{content:"\f0ea"}.icon-lightbulb:before{content:"\f0eb"}.icon-exchange:before{content:"\f0ec"}.icon-cloud-download:before{content:"\f0ed"}.icon-cloud-upload:before{content:"\f0ee"}.icon-user-md:before{content:"\f0f0"}.icon-stethoscope:before{content:"\f0f1"}.icon-suitcase:before{content:"\f0f2"}.icon-bell-alt:before{content:"\f0f3"}.icon-coffee:before{content:"\f0f4"}.icon-food:before{content:"\f0f5"}.icon-file-alt:before{content:"\f0f6"}.icon-building:before{content:"\f0f7"}.icon-hospital:before{content:"\f0f8"}.icon-ambulance:before{content:"\f0f9"}.icon-medkit:before{content:"\f0fa"}.icon-fighter-jet:before{content:"\f0fb"}.icon-beer:before{content:"\f0fc"}.icon-h-sign:before{content:"\f0fd"}.icon-plus-sign-alt:before{content:"\f0fe"}.icon-double-angle-left:before{content:"\f100"}.icon-double-angle-right:before{content:"\f101"}.icon-double-angle-up:before{content:"\f102"}.icon-double-angle-down:before{content:"\f103"}.icon-angle-left:before{content:"\f104"}.icon-angle-right:before{content:"\f105"}.icon-angle-up:before{content:"\f106"}.icon-angle-down:before{content:"\f107"}.icon-desktop:before{content:"\f108"}.icon-laptop:before{content:"\f109"}.icon-tablet:before{content:"\f10a"}.icon-mobile-phone:before{content:"\f10b"}.icon-circle-blank:before{content:"\f10c"}.icon-quote-left:before{content:"\f10d"}.icon-quote-right:before{content:"\f10e"}.icon-spinner:before{content:"\f110"}.icon-circle:before{content:"\f111"}.icon-reply:before{content:"\f112"}.icon-github-alt:before{content:"\f113"}.icon-folder-close-alt:before{content:"\f114"}.icon-folder-open-alt:before{content:"\f115"} \ No newline at end of file diff --git a/crm/src/main/webapp/FortAwesome/docs/assets/css/font-awesome-ie7.min.css b/crm/src/main/webapp/FortAwesome/docs/assets/css/font-awesome-ie7.min.css new file mode 100644 index 0000000..ae30160 --- /dev/null +++ b/crm/src/main/webapp/FortAwesome/docs/assets/css/font-awesome-ie7.min.css @@ -0,0 +1,22 @@ +/*! + * Font Awesome 3.0.2 + * the iconic font designed for use with Twitter Bootstrap + * ------------------------------------------------------- + * The full suite of pictographic icons, examples, and documentation + * can be found at: http://fortawesome.github.com/Font-Awesome/ + * + * License + * ------------------------------------------------------- + * - The Font Awesome font is licensed under the SIL Open Font License - http://scripts.sil.org/OFL + * - Font Awesome CSS, LESS, and SASS files are licensed under the MIT License - + * http://opensource.org/licenses/mit-license.html + * - The Font Awesome pictograms are licensed under the CC BY 3.0 License - http://creativecommons.org/licenses/by/3.0/ + * - Attribution is no longer required in Font Awesome 3.0, but much appreciated: + * "Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome" + + * Contact + * ------------------------------------------------------- + * Email: dave@davegandy.com + * Twitter: http://twitter.com/fortaweso_me + * Work: Lead Product Designer @ http://kyruus.com + */.icon-large{font-size:1.3333333333333333em;margin-top:-4px;padding-top:3px;margin-bottom:-4px;padding-bottom:3px;vertical-align:middle}.nav [class^="icon-"],.nav [class*=" icon-"]{vertical-align:inherit;margin-top:-4px;padding-top:3px;margin-bottom:-4px;padding-bottom:3px}.nav [class^="icon-"].icon-large,.nav [class*=" icon-"].icon-large{vertical-align:-25%}.nav-pills [class^="icon-"].icon-large,.nav-tabs [class^="icon-"].icon-large,.nav-pills [class*=" icon-"].icon-large,.nav-tabs [class*=" icon-"].icon-large{line-height:.75em;margin-top:-7px;padding-top:5px;margin-bottom:-5px;padding-bottom:4px}.btn [class^="icon-"].pull-left,.btn [class*=" icon-"].pull-left,.btn [class^="icon-"].pull-right,.btn [class*=" icon-"].pull-right{vertical-align:inherit}.btn [class^="icon-"].icon-large,.btn [class*=" icon-"].icon-large{margin-top:-0.5em}a [class^="icon-"],a [class*=" icon-"]{cursor:pointer}ul.icons{text-indent:-1.5em;margin-left:3em}.icon-glass{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-music{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-search{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-envelope{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-heart{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-star{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-star-empty{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-user{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-film{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-th-large{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-th{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-th-list{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-ok{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-remove{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-zoom-in{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-zoom-out{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-off{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-signal{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-cog{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-trash{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-home{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-file{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-time{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-road{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-download-alt{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-download{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-upload{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-inbox{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-play-circle{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-repeat{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-refresh{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-list-alt{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-lock{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-flag{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-headphones{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-volume-off{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-volume-down{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-volume-up{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-qrcode{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-barcode{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-tag{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-tags{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-book{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-bookmark{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-print{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-camera{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-font{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-bold{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-italic{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-text-height{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-text-width{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-align-left{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-align-center{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-align-right{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-align-justify{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-list{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-indent-left{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-indent-right{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-facetime-video{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-picture{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-pencil{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-map-marker{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-adjust{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-tint{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-edit{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-share{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-check{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-move{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-step-backward{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-fast-backward{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-backward{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-play{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-pause{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-stop{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-forward{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-fast-forward{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-step-forward{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-eject{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-chevron-left{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-chevron-right{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-plus-sign{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-minus-sign{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-remove-sign{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-ok-sign{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-question-sign{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-info-sign{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-screenshot{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-remove-circle{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-ok-circle{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-ban-circle{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-arrow-left{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-arrow-right{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-arrow-up{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-arrow-down{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-share-alt{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-resize-full{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-resize-small{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-plus{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-minus{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-asterisk{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-exclamation-sign{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-gift{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-leaf{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-fire{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-eye-open{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-eye-close{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-warning-sign{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-plane{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-calendar{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-random{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-comment{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-magnet{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-chevron-up{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-chevron-down{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-retweet{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-shopping-cart{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-folder-close{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-folder-open{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-resize-vertical{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-resize-horizontal{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-bar-chart{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-twitter-sign{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-facebook-sign{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-camera-retro{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-key{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-cogs{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-comments{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-thumbs-up{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-thumbs-down{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-star-half{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-heart-empty{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-signout{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-linkedin-sign{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-pushpin{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-external-link{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-signin{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-trophy{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-github-sign{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-upload-alt{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-lemon{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-phone{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-check-empty{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-bookmark-empty{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-phone-sign{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-twitter{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-facebook{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-github{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-unlock{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-credit-card{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-rss{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-hdd{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-bullhorn{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-bell{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-certificate{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-hand-right{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-hand-left{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-hand-up{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-hand-down{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-circle-arrow-left{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-circle-arrow-right{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-circle-arrow-up{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-circle-arrow-down{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-globe{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-wrench{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-tasks{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-filter{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-briefcase{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-fullscreen{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-group{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-link{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-cloud{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-beaker{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-cut{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-copy{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-paper-clip{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-save{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-sign-blank{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-reorder{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-list-ul{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-list-ol{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-strikethrough{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-underline{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-table{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-magic{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-truck{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-pinterest{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-pinterest-sign{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-google-plus-sign{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-google-plus{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-money{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-caret-down{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-caret-up{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-caret-left{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-caret-right{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-columns{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-sort{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-sort-down{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-sort-up{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-envelope-alt{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-linkedin{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-undo{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-legal{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-dashboard{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-comment-alt{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-comments-alt{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-bolt{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-sitemap{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-umbrella{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-paste{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-lightbulb{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-exchange{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-cloud-download{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-cloud-upload{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-user-md{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-stethoscope{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-suitcase{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-bell-alt{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-coffee{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-food{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-file-alt{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-building{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-hospital{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-ambulance{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-medkit{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-fighter-jet{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-beer{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-h-sign{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-plus-sign-alt{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-double-angle-left{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-double-angle-right{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-double-angle-up{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-double-angle-down{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-angle-left{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-angle-right{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-angle-up{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-angle-down{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-desktop{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-laptop{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-tablet{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-mobile-phone{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-circle-blank{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-quote-left{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-quote-right{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-spinner{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-circle{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-reply{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-github-alt{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-folder-close-alt{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')}.icon-folder-open-alt{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = '')} \ No newline at end of file diff --git a/crm/src/main/webapp/FortAwesome/docs/assets/css/font-awesome.css b/crm/src/main/webapp/FortAwesome/docs/assets/css/font-awesome.css new file mode 100644 index 0000000..8875098 --- /dev/null +++ b/crm/src/main/webapp/FortAwesome/docs/assets/css/font-awesome.css @@ -0,0 +1,540 @@ +/*! + * Font Awesome 3.0.2 + * the iconic font designed for use with Twitter Bootstrap + * ------------------------------------------------------- + * The full suite of pictographic icons, examples, and documentation + * can be found at: http://fortawesome.github.com/Font-Awesome/ + * + * License + * ------------------------------------------------------- + * - The Font Awesome font is licensed under the SIL Open Font License - http://scripts.sil.org/OFL + * - Font Awesome CSS, LESS, and SASS files are licensed under the MIT License - + * http://opensource.org/licenses/mit-license.html + * - The Font Awesome pictograms are licensed under the CC BY 3.0 License - http://creativecommons.org/licenses/by/3.0/ + * - Attribution is no longer required in Font Awesome 3.0, but much appreciated: + * "Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome" + + * Contact + * ------------------------------------------------------- + * Email: dave@davegandy.com + * Twitter: http://twitter.com/fortaweso_me + * Work: Lead Product Designer @ http://kyruus.com + */ +@font-face { + font-family: 'FontAwesome'; + src: url('../font/fontawesome-webfont.eot?v=3.0.1'); + src: url('../font/fontawesome-webfont.eot?#iefix&v=3.0.1') format('embedded-opentype'), + url('../font/fontawesome-webfont.woff?v=3.0.1') format('woff'), + url('../font/fontawesome-webfont.ttf?v=3.0.1') format('truetype'); + font-weight: normal; + font-style: normal; +} +/* Font Awesome styles + ------------------------------------------------------- */ +[class^="icon-"], +[class*=" icon-"] { + font-family: FontAwesome; + font-weight: normal; + font-style: normal; + text-decoration: inherit; + -webkit-font-smoothing: antialiased; + + /* sprites.less reset */ + display: inline; + width: auto; + height: auto; + line-height: normal; + vertical-align: baseline; + background-image: none; + background-position: 0% 0%; + background-repeat: repeat; + margin-top: 0; +} +/* more sprites.less reset */ +.icon-white, +.nav-pills > .active > a > [class^="icon-"], +.nav-pills > .active > a > [class*=" icon-"], +.nav-list > .active > a > [class^="icon-"], +.nav-list > .active > a > [class*=" icon-"], +.navbar-inverse .nav > .active > a > [class^="icon-"], +.navbar-inverse .nav > .active > a > [class*=" icon-"], +.dropdown-menu > li > a:hover > [class^="icon-"], +.dropdown-menu > li > a:hover > [class*=" icon-"], +.dropdown-menu > .active > a > [class^="icon-"], +.dropdown-menu > .active > a > [class*=" icon-"], +.dropdown-submenu:hover > a > [class^="icon-"], +.dropdown-submenu:hover > a > [class*=" icon-"] { + background-image: none; +} +[class^="icon-"]:before, +[class*=" icon-"]:before { + text-decoration: inherit; + display: inline-block; + speak: none; +} +/* makes sure icons active on rollover in links */ +a [class^="icon-"], +a [class*=" icon-"] { + display: inline-block; +} +/* makes the font 33% larger relative to the icon container */ +.icon-large:before { + vertical-align: -10%; + font-size: 1.3333333333333333em; +} +.btn [class^="icon-"], +.nav [class^="icon-"], +.btn [class*=" icon-"], +.nav [class*=" icon-"] { + display: inline; + /* keeps button heights with and without icons the same */ + +} +.btn [class^="icon-"].icon-large, +.nav [class^="icon-"].icon-large, +.btn [class*=" icon-"].icon-large, +.nav [class*=" icon-"].icon-large { + line-height: .9em; +} +.btn [class^="icon-"].icon-spin, +.nav [class^="icon-"].icon-spin, +.btn [class*=" icon-"].icon-spin, +.nav [class*=" icon-"].icon-spin { + display: inline-block; +} +.nav-tabs [class^="icon-"], +.nav-pills [class^="icon-"], +.nav-tabs [class*=" icon-"], +.nav-pills [class*=" icon-"] { + /* keeps button heights with and without icons the same */ + +} +.nav-tabs [class^="icon-"], +.nav-pills [class^="icon-"], +.nav-tabs [class*=" icon-"], +.nav-pills [class*=" icon-"], +.nav-tabs [class^="icon-"].icon-large, +.nav-pills [class^="icon-"].icon-large, +.nav-tabs [class*=" icon-"].icon-large, +.nav-pills [class*=" icon-"].icon-large { + line-height: .9em; +} +li [class^="icon-"], +.nav li [class^="icon-"], +li [class*=" icon-"], +.nav li [class*=" icon-"] { + display: inline-block; + width: 1.25em; + text-align: center; +} +li [class^="icon-"].icon-large, +.nav li [class^="icon-"].icon-large, +li [class*=" icon-"].icon-large, +.nav li [class*=" icon-"].icon-large { + /* increased font size for icon-large */ + + width: 1.5625em; +} +ul.icons { + list-style-type: none; + text-indent: -0.75em; +} +ul.icons li [class^="icon-"], +ul.icons li [class*=" icon-"] { + width: .75em; +} +.icon-muted { + color: #eeeeee; +} +.icon-border { + border: solid 1px #eeeeee; + padding: .2em .25em .15em; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.icon-2x { + font-size: 2em; +} +.icon-2x.icon-border { + border-width: 2px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.icon-3x { + font-size: 3em; +} +.icon-3x.icon-border { + border-width: 3px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; +} +.icon-4x { + font-size: 4em; +} +.icon-4x.icon-border { + border-width: 4px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; +} +.pull-right { + float: right; +} +.pull-left { + float: left; +} +[class^="icon-"].pull-left, +[class*=" icon-"].pull-left { + margin-right: .3em; +} +[class^="icon-"].pull-right, +[class*=" icon-"].pull-right { + margin-left: .3em; +} +.btn [class^="icon-"].pull-left.icon-2x, +.btn [class*=" icon-"].pull-left.icon-2x, +.btn [class^="icon-"].pull-right.icon-2x, +.btn [class*=" icon-"].pull-right.icon-2x { + margin-top: .18em; +} +.btn [class^="icon-"].icon-spin.icon-large, +.btn [class*=" icon-"].icon-spin.icon-large { + line-height: .8em; +} +.btn.btn-small [class^="icon-"].pull-left.icon-2x, +.btn.btn-small [class*=" icon-"].pull-left.icon-2x, +.btn.btn-small [class^="icon-"].pull-right.icon-2x, +.btn.btn-small [class*=" icon-"].pull-right.icon-2x { + margin-top: .25em; +} +.btn.btn-large [class^="icon-"], +.btn.btn-large [class*=" icon-"] { + margin-top: 0; +} +.btn.btn-large [class^="icon-"].pull-left.icon-2x, +.btn.btn-large [class*=" icon-"].pull-left.icon-2x, +.btn.btn-large [class^="icon-"].pull-right.icon-2x, +.btn.btn-large [class*=" icon-"].pull-right.icon-2x { + margin-top: .05em; +} +.btn.btn-large [class^="icon-"].pull-left.icon-2x, +.btn.btn-large [class*=" icon-"].pull-left.icon-2x { + margin-right: .2em; +} +.btn.btn-large [class^="icon-"].pull-right.icon-2x, +.btn.btn-large [class*=" icon-"].pull-right.icon-2x { + margin-left: .2em; +} +.icon-spin { + display: inline-block; + -moz-animation: spin 2s infinite linear; + -o-animation: spin 2s infinite linear; + -webkit-animation: spin 2s infinite linear; + animation: spin 2s infinite linear; +} +@-moz-keyframes spin { + 0% { -moz-transform: rotate(0deg); } + 100% { -moz-transform: rotate(359deg); } +} +@-webkit-keyframes spin { + 0% { -webkit-transform: rotate(0deg); } + 100% { -webkit-transform: rotate(359deg); } +} +@-o-keyframes spin { + 0% { -o-transform: rotate(0deg); } + 100% { -o-transform: rotate(359deg); } +} +@-ms-keyframes spin { + 0% { -ms-transform: rotate(0deg); } + 100% { -ms-transform: rotate(359deg); } +} +@keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(359deg); } +} +@-moz-document url-prefix() { + .icon-spin { + height: .9em; + } + .btn .icon-spin { + height: auto; + } + .icon-spin.icon-large { + height: 1.25em; + } + .btn .icon-spin.icon-large { + height: .75em; + } +} +/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen + readers do not read off random characters that represent icons */ +.icon-glass:before { content: "\f000"; } +.icon-music:before { content: "\f001"; } +.icon-search:before { content: "\f002"; } +.icon-envelope:before { content: "\f003"; } +.icon-heart:before { content: "\f004"; } +.icon-star:before { content: "\f005"; } +.icon-star-empty:before { content: "\f006"; } +.icon-user:before { content: "\f007"; } +.icon-film:before { content: "\f008"; } +.icon-th-large:before { content: "\f009"; } +.icon-th:before { content: "\f00a"; } +.icon-th-list:before { content: "\f00b"; } +.icon-ok:before { content: "\f00c"; } +.icon-remove:before { content: "\f00d"; } +.icon-zoom-in:before { content: "\f00e"; } + +.icon-zoom-out:before { content: "\f010"; } +.icon-off:before { content: "\f011"; } +.icon-signal:before { content: "\f012"; } +.icon-cog:before { content: "\f013"; } +.icon-trash:before { content: "\f014"; } +.icon-home:before { content: "\f015"; } +.icon-file:before { content: "\f016"; } +.icon-time:before { content: "\f017"; } +.icon-road:before { content: "\f018"; } +.icon-download-alt:before { content: "\f019"; } +.icon-download:before { content: "\f01a"; } +.icon-upload:before { content: "\f01b"; } +.icon-inbox:before { content: "\f01c"; } +.icon-play-circle:before { content: "\f01d"; } +.icon-repeat:before { content: "\f01e"; } + +/* \f020 doesn't work in Safari. all shifted one down */ +.icon-refresh:before { content: "\f021"; } +.icon-list-alt:before { content: "\f022"; } +.icon-lock:before { content: "\f023"; } +.icon-flag:before { content: "\f024"; } +.icon-headphones:before { content: "\f025"; } +.icon-volume-off:before { content: "\f026"; } +.icon-volume-down:before { content: "\f027"; } +.icon-volume-up:before { content: "\f028"; } +.icon-qrcode:before { content: "\f029"; } +.icon-barcode:before { content: "\f02a"; } +.icon-tag:before { content: "\f02b"; } +.icon-tags:before { content: "\f02c"; } +.icon-book:before { content: "\f02d"; } +.icon-bookmark:before { content: "\f02e"; } +.icon-print:before { content: "\f02f"; } + +.icon-camera:before { content: "\f030"; } +.icon-font:before { content: "\f031"; } +.icon-bold:before { content: "\f032"; } +.icon-italic:before { content: "\f033"; } +.icon-text-height:before { content: "\f034"; } +.icon-text-width:before { content: "\f035"; } +.icon-align-left:before { content: "\f036"; } +.icon-align-center:before { content: "\f037"; } +.icon-align-right:before { content: "\f038"; } +.icon-align-justify:before { content: "\f039"; } +.icon-list:before { content: "\f03a"; } +.icon-indent-left:before { content: "\f03b"; } +.icon-indent-right:before { content: "\f03c"; } +.icon-facetime-video:before { content: "\f03d"; } +.icon-picture:before { content: "\f03e"; } + +.icon-pencil:before { content: "\f040"; } +.icon-map-marker:before { content: "\f041"; } +.icon-adjust:before { content: "\f042"; } +.icon-tint:before { content: "\f043"; } +.icon-edit:before { content: "\f044"; } +.icon-share:before { content: "\f045"; } +.icon-check:before { content: "\f046"; } +.icon-move:before { content: "\f047"; } +.icon-step-backward:before { content: "\f048"; } +.icon-fast-backward:before { content: "\f049"; } +.icon-backward:before { content: "\f04a"; } +.icon-play:before { content: "\f04b"; } +.icon-pause:before { content: "\f04c"; } +.icon-stop:before { content: "\f04d"; } +.icon-forward:before { content: "\f04e"; } + +.icon-fast-forward:before { content: "\f050"; } +.icon-step-forward:before { content: "\f051"; } +.icon-eject:before { content: "\f052"; } +.icon-chevron-left:before { content: "\f053"; } +.icon-chevron-right:before { content: "\f054"; } +.icon-plus-sign:before { content: "\f055"; } +.icon-minus-sign:before { content: "\f056"; } +.icon-remove-sign:before { content: "\f057"; } +.icon-ok-sign:before { content: "\f058"; } +.icon-question-sign:before { content: "\f059"; } +.icon-info-sign:before { content: "\f05a"; } +.icon-screenshot:before { content: "\f05b"; } +.icon-remove-circle:before { content: "\f05c"; } +.icon-ok-circle:before { content: "\f05d"; } +.icon-ban-circle:before { content: "\f05e"; } + +.icon-arrow-left:before { content: "\f060"; } +.icon-arrow-right:before { content: "\f061"; } +.icon-arrow-up:before { content: "\f062"; } +.icon-arrow-down:before { content: "\f063"; } +.icon-share-alt:before { content: "\f064"; } +.icon-resize-full:before { content: "\f065"; } +.icon-resize-small:before { content: "\f066"; } +.icon-plus:before { content: "\f067"; } +.icon-minus:before { content: "\f068"; } +.icon-asterisk:before { content: "\f069"; } +.icon-exclamation-sign:before { content: "\f06a"; } +.icon-gift:before { content: "\f06b"; } +.icon-leaf:before { content: "\f06c"; } +.icon-fire:before { content: "\f06d"; } +.icon-eye-open:before { content: "\f06e"; } + +.icon-eye-close:before { content: "\f070"; } +.icon-warning-sign:before { content: "\f071"; } +.icon-plane:before { content: "\f072"; } +.icon-calendar:before { content: "\f073"; } +.icon-random:before { content: "\f074"; } +.icon-comment:before { content: "\f075"; } +.icon-magnet:before { content: "\f076"; } +.icon-chevron-up:before { content: "\f077"; } +.icon-chevron-down:before { content: "\f078"; } +.icon-retweet:before { content: "\f079"; } +.icon-shopping-cart:before { content: "\f07a"; } +.icon-folder-close:before { content: "\f07b"; } +.icon-folder-open:before { content: "\f07c"; } +.icon-resize-vertical:before { content: "\f07d"; } +.icon-resize-horizontal:before { content: "\f07e"; } + +.icon-bar-chart:before { content: "\f080"; } +.icon-twitter-sign:before { content: "\f081"; } +.icon-facebook-sign:before { content: "\f082"; } +.icon-camera-retro:before { content: "\f083"; } +.icon-key:before { content: "\f084"; } +.icon-cogs:before { content: "\f085"; } +.icon-comments:before { content: "\f086"; } +.icon-thumbs-up:before { content: "\f087"; } +.icon-thumbs-down:before { content: "\f088"; } +.icon-star-half:before { content: "\f089"; } +.icon-heart-empty:before { content: "\f08a"; } +.icon-signout:before { content: "\f08b"; } +.icon-linkedin-sign:before { content: "\f08c"; } +.icon-pushpin:before { content: "\f08d"; } +.icon-external-link:before { content: "\f08e"; } + +.icon-signin:before { content: "\f090"; } +.icon-trophy:before { content: "\f091"; } +.icon-github-sign:before { content: "\f092"; } +.icon-upload-alt:before { content: "\f093"; } +.icon-lemon:before { content: "\f094"; } +.icon-phone:before { content: "\f095"; } +.icon-check-empty:before { content: "\f096"; } +.icon-bookmark-empty:before { content: "\f097"; } +.icon-phone-sign:before { content: "\f098"; } +.icon-twitter:before { content: "\f099"; } +.icon-facebook:before { content: "\f09a"; } +.icon-github:before { content: "\f09b"; } +.icon-unlock:before { content: "\f09c"; } +.icon-credit-card:before { content: "\f09d"; } +.icon-rss:before { content: "\f09e"; } + +.icon-hdd:before { content: "\f0a0"; } +.icon-bullhorn:before { content: "\f0a1"; } +.icon-bell:before { content: "\f0a2"; } +.icon-certificate:before { content: "\f0a3"; } +.icon-hand-right:before { content: "\f0a4"; } +.icon-hand-left:before { content: "\f0a5"; } +.icon-hand-up:before { content: "\f0a6"; } +.icon-hand-down:before { content: "\f0a7"; } +.icon-circle-arrow-left:before { content: "\f0a8"; } +.icon-circle-arrow-right:before { content: "\f0a9"; } +.icon-circle-arrow-up:before { content: "\f0aa"; } +.icon-circle-arrow-down:before { content: "\f0ab"; } +.icon-globe:before { content: "\f0ac"; } +.icon-wrench:before { content: "\f0ad"; } +.icon-tasks:before { content: "\f0ae"; } + +.icon-filter:before { content: "\f0b0"; } +.icon-briefcase:before { content: "\f0b1"; } +.icon-fullscreen:before { content: "\f0b2"; } + +.icon-group:before { content: "\f0c0"; } +.icon-link:before { content: "\f0c1"; } +.icon-cloud:before { content: "\f0c2"; } +.icon-beaker:before { content: "\f0c3"; } +.icon-cut:before { content: "\f0c4"; } +.icon-copy:before { content: "\f0c5"; } +.icon-paper-clip:before { content: "\f0c6"; } +.icon-save:before { content: "\f0c7"; } +.icon-sign-blank:before { content: "\f0c8"; } +.icon-reorder:before { content: "\f0c9"; } +.icon-list-ul:before { content: "\f0ca"; } +.icon-list-ol:before { content: "\f0cb"; } +.icon-strikethrough:before { content: "\f0cc"; } +.icon-underline:before { content: "\f0cd"; } +.icon-table:before { content: "\f0ce"; } + +.icon-magic:before { content: "\f0d0"; } +.icon-truck:before { content: "\f0d1"; } +.icon-pinterest:before { content: "\f0d2"; } +.icon-pinterest-sign:before { content: "\f0d3"; } +.icon-google-plus-sign:before { content: "\f0d4"; } +.icon-google-plus:before { content: "\f0d5"; } +.icon-money:before { content: "\f0d6"; } +.icon-caret-down:before { content: "\f0d7"; } +.icon-caret-up:before { content: "\f0d8"; } +.icon-caret-left:before { content: "\f0d9"; } +.icon-caret-right:before { content: "\f0da"; } +.icon-columns:before { content: "\f0db"; } +.icon-sort:before { content: "\f0dc"; } +.icon-sort-down:before { content: "\f0dd"; } +.icon-sort-up:before { content: "\f0de"; } + +.icon-envelope-alt:before { content: "\f0e0"; } +.icon-linkedin:before { content: "\f0e1"; } +.icon-undo:before { content: "\f0e2"; } +.icon-legal:before { content: "\f0e3"; } +.icon-dashboard:before { content: "\f0e4"; } +.icon-comment-alt:before { content: "\f0e5"; } +.icon-comments-alt:before { content: "\f0e6"; } +.icon-bolt:before { content: "\f0e7"; } +.icon-sitemap:before { content: "\f0e8"; } +.icon-umbrella:before { content: "\f0e9"; } +.icon-paste:before { content: "\f0ea"; } +.icon-lightbulb:before { content: "\f0eb"; } +.icon-exchange:before { content: "\f0ec"; } +.icon-cloud-download:before { content: "\f0ed"; } +.icon-cloud-upload:before { content: "\f0ee"; } + +.icon-user-md:before { content: "\f0f0"; } +.icon-stethoscope:before { content: "\f0f1"; } +.icon-suitcase:before { content: "\f0f2"; } +.icon-bell-alt:before { content: "\f0f3"; } +.icon-coffee:before { content: "\f0f4"; } +.icon-food:before { content: "\f0f5"; } +.icon-file-alt:before { content: "\f0f6"; } +.icon-building:before { content: "\f0f7"; } +.icon-hospital:before { content: "\f0f8"; } +.icon-ambulance:before { content: "\f0f9"; } +.icon-medkit:before { content: "\f0fa"; } +.icon-fighter-jet:before { content: "\f0fb"; } +.icon-beer:before { content: "\f0fc"; } +.icon-h-sign:before { content: "\f0fd"; } +.icon-plus-sign-alt:before { content: "\f0fe"; } + +.icon-double-angle-left:before { content: "\f100"; } +.icon-double-angle-right:before { content: "\f101"; } +.icon-double-angle-up:before { content: "\f102"; } +.icon-double-angle-down:before { content: "\f103"; } +.icon-angle-left:before { content: "\f104"; } +.icon-angle-right:before { content: "\f105"; } +.icon-angle-up:before { content: "\f106"; } +.icon-angle-down:before { content: "\f107"; } +.icon-desktop:before { content: "\f108"; } +.icon-laptop:before { content: "\f109"; } +.icon-tablet:before { content: "\f10a"; } +.icon-mobile-phone:before { content: "\f10b"; } +.icon-circle-blank:before { content: "\f10c"; } +.icon-quote-left:before { content: "\f10d"; } +.icon-quote-right:before { content: "\f10e"; } + +.icon-spinner:before { content: "\f110"; } +.icon-circle:before { content: "\f111"; } +.icon-reply:before { content: "\f112"; } +.icon-github-alt:before { content: "\f113"; } +.icon-folder-close-alt:before { content: "\f114"; } +.icon-folder-open-alt:before { content: "\f115"; } diff --git a/crm/src/main/webapp/FortAwesome/docs/assets/css/font-awesome.min.css b/crm/src/main/webapp/FortAwesome/docs/assets/css/font-awesome.min.css new file mode 100644 index 0000000..d4e45b3 --- /dev/null +++ b/crm/src/main/webapp/FortAwesome/docs/assets/css/font-awesome.min.css @@ -0,0 +1,33 @@ +/*! + * Font Awesome 3.0.2 + * the iconic font designed for use with Twitter Bootstrap + * ------------------------------------------------------- + * The full suite of pictographic icons, examples, and documentation + * can be found at: http://fortawesome.github.com/Font-Awesome/ + * + * License + * ------------------------------------------------------- + * - The Font Awesome font is licensed under the SIL Open Font License - http://scripts.sil.org/OFL + * - Font Awesome CSS, LESS, and SASS files are licensed under the MIT License - + * http://opensource.org/licenses/mit-license.html + * - The Font Awesome pictograms are licensed under the CC BY 3.0 License - http://creativecommons.org/licenses/by/3.0/ + * - Attribution is no longer required in Font Awesome 3.0, but much appreciated: + * "Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome" + + * Contact + * ------------------------------------------------------- + * Email: dave@davegandy.com + * Twitter: http://twitter.com/fortaweso_me + * Work: Lead Product Designer @ http://kyruus.com + */ + +@font-face{ + font-family:'FontAwesome'; + src:url('../font/fontawesome-webfont.eot?v=3.0.1'); + src:url('../font/fontawesome-webfont.eot?#iefix&v=3.0.1') format('embedded-opentype'), + url('../font/fontawesome-webfont.woff?v=3.0.1') format('woff'), + url('../font/fontawesome-webfont.ttf?v=3.0.1') format('truetype'); + font-weight:normal; + font-style:normal } + +[class^="icon-"],[class*=" icon-"]{font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;display:inline;width:auto;height:auto;line-height:normal;vertical-align:baseline;background-image:none;background-position:0 0;background-repeat:repeat;margin-top:0}.icon-white,.nav-pills>.active>a>[class^="icon-"],.nav-pills>.active>a>[class*=" icon-"],.nav-list>.active>a>[class^="icon-"],.nav-list>.active>a>[class*=" icon-"],.navbar-inverse .nav>.active>a>[class^="icon-"],.navbar-inverse .nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^="icon-"],.dropdown-submenu:hover>a>[class*=" icon-"]{background-image:none}[class^="icon-"]:before,[class*=" icon-"]:before{text-decoration:inherit;display:inline-block;speak:none}a [class^="icon-"],a [class*=" icon-"]{display:inline-block}.icon-large:before{vertical-align:-10%;font-size:1.3333333333333333em}.btn [class^="icon-"],.nav [class^="icon-"],.btn [class*=" icon-"],.nav [class*=" icon-"]{display:inline}.btn [class^="icon-"].icon-large,.nav [class^="icon-"].icon-large,.btn [class*=" icon-"].icon-large,.nav [class*=" icon-"].icon-large{line-height:.9em}.btn [class^="icon-"].icon-spin,.nav [class^="icon-"].icon-spin,.btn [class*=" icon-"].icon-spin,.nav [class*=" icon-"].icon-spin{display:inline-block}.nav-tabs [class^="icon-"],.nav-pills [class^="icon-"],.nav-tabs [class*=" icon-"],.nav-pills [class*=" icon-"],.nav-tabs [class^="icon-"].icon-large,.nav-pills [class^="icon-"].icon-large,.nav-tabs [class*=" icon-"].icon-large,.nav-pills [class*=" icon-"].icon-large{line-height:.9em}li [class^="icon-"],.nav li [class^="icon-"],li [class*=" icon-"],.nav li [class*=" icon-"]{display:inline-block;width:1.25em;text-align:center}li [class^="icon-"].icon-large,.nav li [class^="icon-"].icon-large,li [class*=" icon-"].icon-large,.nav li [class*=" icon-"].icon-large{width:1.5625em}ul.icons{list-style-type:none;text-indent:-0.75em}ul.icons li [class^="icon-"],ul.icons li [class*=" icon-"]{width:.75em}.icon-muted{color:#eee}.icon-border{border:solid 1px #eee;padding:.2em .25em .15em;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.icon-2x{font-size:2em}.icon-2x.icon-border{border-width:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.icon-3x{font-size:3em}.icon-3x.icon-border{border-width:3px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.icon-4x{font-size:4em}.icon-4x.icon-border{border-width:4px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.pull-right{float:right}.pull-left{float:left}[class^="icon-"].pull-left,[class*=" icon-"].pull-left{margin-right:.3em}[class^="icon-"].pull-right,[class*=" icon-"].pull-right{margin-left:.3em}.btn [class^="icon-"].pull-left.icon-2x,.btn [class*=" icon-"].pull-left.icon-2x,.btn [class^="icon-"].pull-right.icon-2x,.btn [class*=" icon-"].pull-right.icon-2x{margin-top:.18em}.btn [class^="icon-"].icon-spin.icon-large,.btn [class*=" icon-"].icon-spin.icon-large{line-height:.8em}.btn.btn-small [class^="icon-"].pull-left.icon-2x,.btn.btn-small [class*=" icon-"].pull-left.icon-2x,.btn.btn-small [class^="icon-"].pull-right.icon-2x,.btn.btn-small [class*=" icon-"].pull-right.icon-2x{margin-top:.25em}.btn.btn-large [class^="icon-"],.btn.btn-large [class*=" icon-"]{margin-top:0}.btn.btn-large [class^="icon-"].pull-left.icon-2x,.btn.btn-large [class*=" icon-"].pull-left.icon-2x,.btn.btn-large [class^="icon-"].pull-right.icon-2x,.btn.btn-large [class*=" icon-"].pull-right.icon-2x{margin-top:.05em}.btn.btn-large [class^="icon-"].pull-left.icon-2x,.btn.btn-large [class*=" icon-"].pull-left.icon-2x{margin-right:.2em}.btn.btn-large [class^="icon-"].pull-right.icon-2x,.btn.btn-large [class*=" icon-"].pull-right.icon-2x{margin-left:.2em}.icon-spin{display:inline-block;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg)}100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg)}100%{-o-transform:rotate(359deg)}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg)}100%{-ms-transform:rotate(359deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}}@-moz-document url-prefix(){.icon-spin{height:.9em}.btn .icon-spin{height:auto}.icon-spin.icon-large{height:1.25em}.btn .icon-spin.icon-large{height:.75em}}.icon-glass:before{content:"\f000"}.icon-music:before{content:"\f001"}.icon-search:before{content:"\f002"}.icon-envelope:before{content:"\f003"}.icon-heart:before{content:"\f004"}.icon-star:before{content:"\f005"}.icon-star-empty:before{content:"\f006"}.icon-user:before{content:"\f007"}.icon-film:before{content:"\f008"}.icon-th-large:before{content:"\f009"}.icon-th:before{content:"\f00a"}.icon-th-list:before{content:"\f00b"}.icon-ok:before{content:"\f00c"}.icon-remove:before{content:"\f00d"}.icon-zoom-in:before{content:"\f00e"}.icon-zoom-out:before{content:"\f010"}.icon-off:before{content:"\f011"}.icon-signal:before{content:"\f012"}.icon-cog:before{content:"\f013"}.icon-trash:before{content:"\f014"}.icon-home:before{content:"\f015"}.icon-file:before{content:"\f016"}.icon-time:before{content:"\f017"}.icon-road:before{content:"\f018"}.icon-download-alt:before{content:"\f019"}.icon-download:before{content:"\f01a"}.icon-upload:before{content:"\f01b"}.icon-inbox:before{content:"\f01c"}.icon-play-circle:before{content:"\f01d"}.icon-repeat:before{content:"\f01e"}.icon-refresh:before{content:"\f021"}.icon-list-alt:before{content:"\f022"}.icon-lock:before{content:"\f023"}.icon-flag:before{content:"\f024"}.icon-headphones:before{content:"\f025"}.icon-volume-off:before{content:"\f026"}.icon-volume-down:before{content:"\f027"}.icon-volume-up:before{content:"\f028"}.icon-qrcode:before{content:"\f029"}.icon-barcode:before{content:"\f02a"}.icon-tag:before{content:"\f02b"}.icon-tags:before{content:"\f02c"}.icon-book:before{content:"\f02d"}.icon-bookmark:before{content:"\f02e"}.icon-print:before{content:"\f02f"}.icon-camera:before{content:"\f030"}.icon-font:before{content:"\f031"}.icon-bold:before{content:"\f032"}.icon-italic:before{content:"\f033"}.icon-text-height:before{content:"\f034"}.icon-text-width:before{content:"\f035"}.icon-align-left:before{content:"\f036"}.icon-align-center:before{content:"\f037"}.icon-align-right:before{content:"\f038"}.icon-align-justify:before{content:"\f039"}.icon-list:before{content:"\f03a"}.icon-indent-left:before{content:"\f03b"}.icon-indent-right:before{content:"\f03c"}.icon-facetime-video:before{content:"\f03d"}.icon-picture:before{content:"\f03e"}.icon-pencil:before{content:"\f040"}.icon-map-marker:before{content:"\f041"}.icon-adjust:before{content:"\f042"}.icon-tint:before{content:"\f043"}.icon-edit:before{content:"\f044"}.icon-share:before{content:"\f045"}.icon-check:before{content:"\f046"}.icon-move:before{content:"\f047"}.icon-step-backward:before{content:"\f048"}.icon-fast-backward:before{content:"\f049"}.icon-backward:before{content:"\f04a"}.icon-play:before{content:"\f04b"}.icon-pause:before{content:"\f04c"}.icon-stop:before{content:"\f04d"}.icon-forward:before{content:"\f04e"}.icon-fast-forward:before{content:"\f050"}.icon-step-forward:before{content:"\f051"}.icon-eject:before{content:"\f052"}.icon-chevron-left:before{content:"\f053"}.icon-chevron-right:before{content:"\f054"}.icon-plus-sign:before{content:"\f055"}.icon-minus-sign:before{content:"\f056"}.icon-remove-sign:before{content:"\f057"}.icon-ok-sign:before{content:"\f058"}.icon-question-sign:before{content:"\f059"}.icon-info-sign:before{content:"\f05a"}.icon-screenshot:before{content:"\f05b"}.icon-remove-circle:before{content:"\f05c"}.icon-ok-circle:before{content:"\f05d"}.icon-ban-circle:before{content:"\f05e"}.icon-arrow-left:before{content:"\f060"}.icon-arrow-right:before{content:"\f061"}.icon-arrow-up:before{content:"\f062"}.icon-arrow-down:before{content:"\f063"}.icon-share-alt:before{content:"\f064"}.icon-resize-full:before{content:"\f065"}.icon-resize-small:before{content:"\f066"}.icon-plus:before{content:"\f067"}.icon-minus:before{content:"\f068"}.icon-asterisk:before{content:"\f069"}.icon-exclamation-sign:before{content:"\f06a"}.icon-gift:before{content:"\f06b"}.icon-leaf:before{content:"\f06c"}.icon-fire:before{content:"\f06d"}.icon-eye-open:before{content:"\f06e"}.icon-eye-close:before{content:"\f070"}.icon-warning-sign:before{content:"\f071"}.icon-plane:before{content:"\f072"}.icon-calendar:before{content:"\f073"}.icon-random:before{content:"\f074"}.icon-comment:before{content:"\f075"}.icon-magnet:before{content:"\f076"}.icon-chevron-up:before{content:"\f077"}.icon-chevron-down:before{content:"\f078"}.icon-retweet:before{content:"\f079"}.icon-shopping-cart:before{content:"\f07a"}.icon-folder-close:before{content:"\f07b"}.icon-folder-open:before{content:"\f07c"}.icon-resize-vertical:before{content:"\f07d"}.icon-resize-horizontal:before{content:"\f07e"}.icon-bar-chart:before{content:"\f080"}.icon-twitter-sign:before{content:"\f081"}.icon-facebook-sign:before{content:"\f082"}.icon-camera-retro:before{content:"\f083"}.icon-key:before{content:"\f084"}.icon-cogs:before{content:"\f085"}.icon-comments:before{content:"\f086"}.icon-thumbs-up:before{content:"\f087"}.icon-thumbs-down:before{content:"\f088"}.icon-star-half:before{content:"\f089"}.icon-heart-empty:before{content:"\f08a"}.icon-signout:before{content:"\f08b"}.icon-linkedin-sign:before{content:"\f08c"}.icon-pushpin:before{content:"\f08d"}.icon-external-link:before{content:"\f08e"}.icon-signin:before{content:"\f090"}.icon-trophy:before{content:"\f091"}.icon-github-sign:before{content:"\f092"}.icon-upload-alt:before{content:"\f093"}.icon-lemon:before{content:"\f094"}.icon-phone:before{content:"\f095"}.icon-check-empty:before{content:"\f096"}.icon-bookmark-empty:before{content:"\f097"}.icon-phone-sign:before{content:"\f098"}.icon-twitter:before{content:"\f099"}.icon-facebook:before{content:"\f09a"}.icon-github:before{content:"\f09b"}.icon-unlock:before{content:"\f09c"}.icon-credit-card:before{content:"\f09d"}.icon-rss:before{content:"\f09e"}.icon-hdd:before{content:"\f0a0"}.icon-bullhorn:before{content:"\f0a1"}.icon-bell:before{content:"\f0a2"}.icon-certificate:before{content:"\f0a3"}.icon-hand-right:before{content:"\f0a4"}.icon-hand-left:before{content:"\f0a5"}.icon-hand-up:before{content:"\f0a6"}.icon-hand-down:before{content:"\f0a7"}.icon-circle-arrow-left:before{content:"\f0a8"}.icon-circle-arrow-right:before{content:"\f0a9"}.icon-circle-arrow-up:before{content:"\f0aa"}.icon-circle-arrow-down:before{content:"\f0ab"}.icon-globe:before{content:"\f0ac"}.icon-wrench:before{content:"\f0ad"}.icon-tasks:before{content:"\f0ae"}.icon-filter:before{content:"\f0b0"}.icon-briefcase:before{content:"\f0b1"}.icon-fullscreen:before{content:"\f0b2"}.icon-group:before{content:"\f0c0"}.icon-link:before{content:"\f0c1"}.icon-cloud:before{content:"\f0c2"}.icon-beaker:before{content:"\f0c3"}.icon-cut:before{content:"\f0c4"}.icon-copy:before{content:"\f0c5"}.icon-paper-clip:before{content:"\f0c6"}.icon-save:before{content:"\f0c7"}.icon-sign-blank:before{content:"\f0c8"}.icon-reorder:before{content:"\f0c9"}.icon-list-ul:before{content:"\f0ca"}.icon-list-ol:before{content:"\f0cb"}.icon-strikethrough:before{content:"\f0cc"}.icon-underline:before{content:"\f0cd"}.icon-table:before{content:"\f0ce"}.icon-magic:before{content:"\f0d0"}.icon-truck:before{content:"\f0d1"}.icon-pinterest:before{content:"\f0d2"}.icon-pinterest-sign:before{content:"\f0d3"}.icon-google-plus-sign:before{content:"\f0d4"}.icon-google-plus:before{content:"\f0d5"}.icon-money:before{content:"\f0d6"}.icon-caret-down:before{content:"\f0d7"}.icon-caret-up:before{content:"\f0d8"}.icon-caret-left:before{content:"\f0d9"}.icon-caret-right:before{content:"\f0da"}.icon-columns:before{content:"\f0db"}.icon-sort:before{content:"\f0dc"}.icon-sort-down:before{content:"\f0dd"}.icon-sort-up:before{content:"\f0de"}.icon-envelope-alt:before{content:"\f0e0"}.icon-linkedin:before{content:"\f0e1"}.icon-undo:before{content:"\f0e2"}.icon-legal:before{content:"\f0e3"}.icon-dashboard:before{content:"\f0e4"}.icon-comment-alt:before{content:"\f0e5"}.icon-comments-alt:before{content:"\f0e6"}.icon-bolt:before{content:"\f0e7"}.icon-sitemap:before{content:"\f0e8"}.icon-umbrella:before{content:"\f0e9"}.icon-paste:before{content:"\f0ea"}.icon-lightbulb:before{content:"\f0eb"}.icon-exchange:before{content:"\f0ec"}.icon-cloud-download:before{content:"\f0ed"}.icon-cloud-upload:before{content:"\f0ee"}.icon-user-md:before{content:"\f0f0"}.icon-stethoscope:before{content:"\f0f1"}.icon-suitcase:before{content:"\f0f2"}.icon-bell-alt:before{content:"\f0f3"}.icon-coffee:before{content:"\f0f4"}.icon-food:before{content:"\f0f5"}.icon-file-alt:before{content:"\f0f6"}.icon-building:before{content:"\f0f7"}.icon-hospital:before{content:"\f0f8"}.icon-ambulance:before{content:"\f0f9"}.icon-medkit:before{content:"\f0fa"}.icon-fighter-jet:before{content:"\f0fb"}.icon-beer:before{content:"\f0fc"}.icon-h-sign:before{content:"\f0fd"}.icon-plus-sign-alt:before{content:"\f0fe"}.icon-double-angle-left:before{content:"\f100"}.icon-double-angle-right:before{content:"\f101"}.icon-double-angle-up:before{content:"\f102"}.icon-double-angle-down:before{content:"\f103"}.icon-angle-left:before{content:"\f104"}.icon-angle-right:before{content:"\f105"}.icon-angle-up:before{content:"\f106"}.icon-angle-down:before{content:"\f107"}.icon-desktop:before{content:"\f108"}.icon-laptop:before{content:"\f109"}.icon-tablet:before{content:"\f10a"}.icon-mobile-phone:before{content:"\f10b"}.icon-circle-blank:before{content:"\f10c"}.icon-quote-left:before{content:"\f10d"}.icon-quote-right:before{content:"\f10e"}.icon-spinner:before{content:"\f110"}.icon-circle:before{content:"\f111"}.icon-reply:before{content:"\f112"}.icon-github-alt:before{content:"\f113"}.icon-folder-close-alt:before{content:"\f114"}.icon-folder-open-alt:before{content:"\f115"} \ No newline at end of file diff --git a/crm/src/main/webapp/FortAwesome/docs/assets/css/prettify.css b/crm/src/main/webapp/FortAwesome/docs/assets/css/prettify.css new file mode 100644 index 0000000..aedd8d1 --- /dev/null +++ b/crm/src/main/webapp/FortAwesome/docs/assets/css/prettify.css @@ -0,0 +1,30 @@ +.com { color: #93a1a1; } +.lit { color: #195f91; } +.pun, .opn, .clo { color: #93a1a1; } +.fun { color: #dc322f; } +.str, .atv { color: #D14; } +.kwd, .linenums .tag { color: #1e347b; } +.typ, .atn, .dec, .var { color: teal; } +.pln { color: #48484c; } + +.prettyprint { + padding: 8px; + background-color: #f7f7f9; + border: 1px solid #e1e1e8; +} +.prettyprint.linenums { + -webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; + -moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; + box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; +} + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { + margin: 0 0 0 33px; /* IE indents via margin-left */ +} +ol.linenums li { + padding-left: 12px; + color: #bebec5; + line-height: 18px; + text-shadow: 0 1px 0 #fff; +} \ No newline at end of file diff --git a/crm/src/main/webapp/FortAwesome/docs/assets/css/site.css b/crm/src/main/webapp/FortAwesome/docs/assets/css/site.css new file mode 100644 index 0000000..954e0d8 --- /dev/null +++ b/crm/src/main/webapp/FortAwesome/docs/assets/css/site.css @@ -0,0 +1,9 @@ +/*! + * Bootstrap v2.2.2 + * + * Copyright 2012 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + */article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}a:hover,a:active{outline:0}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{max-width:100%;width:auto\9;height:auto;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic}#map_canvas img,.google-maps img{max-width:none}button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle}button,input{*overflow:visible;line-height:normal}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}label,select,button,input[type="button"],input[type="reset"],input[type="submit"],input[type="radio"],input[type="checkbox"]{cursor:pointer}input[type="search"]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none}textarea{overflow:auto;vertical-align:top}@media print{*{text-shadow:none!important;color:#000!important;background:transparent!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100%!important}@page{margin:.5cm}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:"";line-height:0}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}body{margin:0;font-family:proxima-nova,"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:20px;color:#333;background-color:#fff}a{color:#c83025;text-decoration:none}a:hover{color:#9d261d;text-decoration:underline}.img-rounded{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.img-polaroid{padding:4px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.1);box-shadow:0 1px 3px rgba(0,0,0,0.1)}.img-circle{-webkit-border-radius:500px;-moz-border-radius:500px;border-radius:500px}.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;content:"";line-height:0}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.span12{width:940px}.span11{width:860px}.span10{width:780px}.span9{width:700px}.span8{width:620px}.span7{width:540px}.span6{width:460px}.span5{width:380px}.span4{width:300px}.span3{width:220px}.span2{width:140px}.span1{width:60px}.offset12{margin-left:980px}.offset11{margin-left:900px}.offset10{margin-left:820px}.offset9{margin-left:740px}.offset8{margin-left:660px}.offset7{margin-left:580px}.offset6{margin-left:500px}.offset5{margin-left:420px}.offset4{margin-left:340px}.offset3{margin-left:260px}.offset2{margin-left:180px}.offset1{margin-left:100px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;content:"";line-height:0}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;float:left;margin-left:2.127659574468085%;*margin-left:2.074468085106383%}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.127659574468085%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.48936170212765%;*width:91.43617021276594%}.row-fluid .span10{width:82.97872340425532%;*width:82.92553191489361%}.row-fluid .span9{width:74.46808510638297%;*width:74.41489361702126%}.row-fluid .span8{width:65.95744680851064%;*width:65.90425531914893%}.row-fluid .span7{width:57.44680851063829%;*width:57.39361702127659%}.row-fluid .span6{width:48.93617021276595%;*width:48.88297872340425%}.row-fluid .span5{width:40.42553191489362%;*width:40.37234042553192%}.row-fluid .span4{width:31.914893617021278%;*width:31.861702127659576%}.row-fluid .span3{width:23.404255319148934%;*width:23.351063829787233%}.row-fluid .span2{width:14.893617021276595%;*width:14.840425531914894%}.row-fluid .span1{width:6.382978723404255%;*width:6.329787234042553%}.row-fluid .offset12{margin-left:104.25531914893617%;*margin-left:104.14893617021275%}.row-fluid .offset12:first-child{margin-left:102.12765957446808%;*margin-left:102.02127659574467%}.row-fluid .offset11{margin-left:95.74468085106382%;*margin-left:95.6382978723404%}.row-fluid .offset11:first-child{margin-left:93.61702127659574%;*margin-left:93.51063829787232%}.row-fluid .offset10{margin-left:87.23404255319149%;*margin-left:87.12765957446807%}.row-fluid .offset10:first-child{margin-left:85.1063829787234%;*margin-left:84.99999999999999%}.row-fluid .offset9{margin-left:78.72340425531914%;*margin-left:78.61702127659572%}.row-fluid .offset9:first-child{margin-left:76.59574468085106%;*margin-left:76.48936170212764%}.row-fluid .offset8{margin-left:70.2127659574468%;*margin-left:70.10638297872339%}.row-fluid .offset8:first-child{margin-left:68.08510638297872%;*margin-left:67.9787234042553%}.row-fluid .offset7{margin-left:61.70212765957446%;*margin-left:61.59574468085106%}.row-fluid .offset7:first-child{margin-left:59.574468085106375%;*margin-left:59.46808510638297%}.row-fluid .offset6{margin-left:53.191489361702125%;*margin-left:53.085106382978715%}.row-fluid .offset6:first-child{margin-left:51.063829787234035%;*margin-left:50.95744680851063%}.row-fluid .offset5{margin-left:44.68085106382979%;*margin-left:44.57446808510638%}.row-fluid .offset5:first-child{margin-left:42.5531914893617%;*margin-left:42.4468085106383%}.row-fluid .offset4{margin-left:36.170212765957444%;*margin-left:36.06382978723405%}.row-fluid .offset4:first-child{margin-left:34.04255319148936%;*margin-left:33.93617021276596%}.row-fluid .offset3{margin-left:27.659574468085104%;*margin-left:27.5531914893617%}.row-fluid .offset3:first-child{margin-left:25.53191489361702%;*margin-left:25.425531914893618%}.row-fluid .offset2{margin-left:19.148936170212764%;*margin-left:19.04255319148936%}.row-fluid .offset2:first-child{margin-left:17.02127659574468%;*margin-left:16.914893617021278%}.row-fluid .offset1{margin-left:10.638297872340425%;*margin-left:10.53191489361702%}.row-fluid .offset1:first-child{margin-left:8.51063829787234%;*margin-left:8.404255319148938%}[class*="span"].hide,.row-fluid [class*="span"].hide{display:none}[class*="span"].pull-right,.row-fluid [class*="span"].pull-right{float:right}.container{margin-right:auto;margin-left:auto;*zoom:1}.container:before,.container:after{display:table;content:"";line-height:0}.container:after{clear:both}.container-fluid{padding-right:20px;padding-left:20px;*zoom:1}.container-fluid:before,.container-fluid:after{display:table;content:"";line-height:0}.container-fluid:after{clear:both}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:21px;font-weight:200;line-height:30px}small{font-size:85%}strong{font-weight:bold}em{font-style:italic}cite{font-style:normal}.muted{color:#999}a.muted:hover{color:#808080}.text-warning{color:#c09853}a.text-warning:hover{color:#a47e3c}.text-error{color:#b94a48}a.text-error:hover{color:#953b39}.text-info{color:#3a87ad}a.text-info:hover{color:#2d6987}.text-success{color:#468847}a.text-success:hover{color:#356635}h1,h2,h3,h4,h5,h6{margin:10px 0;font-family:inherit;font-weight:bold;line-height:20px;color:inherit;text-rendering:optimizelegibility}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{font-weight:normal;line-height:1;color:#999}h1,h2,h3{line-height:40px}h1{font-size:38.5px}h2{font-size:31.5px}h3{font-size:24.5px}h4{font-size:17.5px}h5{font-size:14px}h6{font-size:11.9px}h1 small{font-size:24.5px}h2 small{font-size:17.5px}h3 small{font-size:14px}h4 small{font-size:14px}.page-header{padding-bottom:9px;margin:20px 0 30px;border-bottom:1px solid #eee}ul,ol{padding:0;margin:0 0 10px 25px}ul ul,ul ol,ol ol,ol ul{margin-bottom:0}li{line-height:20px}ul.unstyled,ol.unstyled{margin-left:0;list-style:none}ul.inline,ol.inline{margin-left:0;list-style:none}ul.inline>li,ol.inline>li{display:inline-block;padding-left:5px;padding-right:5px}dl{margin-bottom:20px}dt,dd{line-height:20px}dt{font-weight:bold}dd{margin-left:10px}.dl-horizontal{*zoom:1}.dl-horizontal:before,.dl-horizontal:after{display:table;content:"";line-height:0}.dl-horizontal:after{clear:both}.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}hr{margin:20px 0;border:0;border-top:1px solid #eee;border-bottom:1px solid #fff}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #999}abbr.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:0 0 0 15px;margin:0 0 20px;border-left:5px solid #eee}blockquote p{margin-bottom:0;font-size:16px;font-weight:300;line-height:25px}blockquote small{display:block;line-height:20px;color:#999}blockquote small:before{content:'\2014 \00A0'}blockquote.pull-right{float:right;padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0}blockquote.pull-right p,blockquote.pull-right small{text-align:right}blockquote.pull-right small:before{content:''}blockquote.pull-right small:after{content:'\00A0 \2014'}q:before,q:after,blockquote:before,blockquote:after{content:""}address{display:block;margin-bottom:20px;font-style:normal;line-height:20px}code,pre{padding:0 3px 2px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:12px;color:#333;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}code{padding:2px 4px;color:#d14;background-color:#f7f7f9;border:1px solid #e1e1e8;white-space:nowrap}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:20px;word-break:break-all;word-wrap:break-word;white-space:pre;white-space:pre-wrap;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}pre.prettyprint{margin-bottom:20px}pre code{padding:0;color:inherit;white-space:pre;white-space:pre-wrap;background-color:transparent;border:0}.pre-scrollable{max-height:340px;overflow-y:scroll}form{margin:0 0 20px}fieldset{padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:40px;color:#333;border:0;border-bottom:1px solid #e5e5e5}legend small{font-size:15px;color:#999}label,input,button,select,textarea{font-size:14px;font-weight:normal;line-height:20px}input,button,select,textarea{font-family:proxima-nova,"Helvetica Neue",Helvetica,Arial,sans-serif}label{display:block;margin-bottom:5px}select,textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{display:inline-block;height:20px;padding:4px 6px;margin-bottom:10px;font-size:14px;line-height:20px;color:#555;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;vertical-align:middle}input,textarea,.uneditable-input{width:206px}textarea{height:auto}textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{background-color:#fff;border:1px solid #ccc;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border linear .2s,box-shadow linear .2s;-moz-transition:border linear .2s,box-shadow linear .2s;-o-transition:border linear .2s,box-shadow linear .2s;transition:border linear .2s,box-shadow linear .2s}textarea:focus,input[type="text"]:focus,input[type="password"]:focus,input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="date"]:focus,input[type="month"]:focus,input[type="time"]:focus,input[type="week"]:focus,input[type="number"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="color"]:focus,.uneditable-input:focus{border-color:rgba(82,168,236,0.8);outline:0;outline:thin dotted \9;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.6)}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;*margin-top:0;margin-top:1px \9;line-height:normal}input[type="file"],input[type="image"],input[type="submit"],input[type="reset"],input[type="button"],input[type="radio"],input[type="checkbox"]{width:auto}select,input[type="file"]{height:30px;*margin-top:4px;line-height:30px}select{width:220px;border:1px solid #ccc;background-color:#fff}select[multiple],select[size]{height:auto}select:focus,input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.uneditable-input,.uneditable-textarea{color:#999;background-color:#fcfcfc;border-color:#ccc;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);cursor:not-allowed}.uneditable-input{overflow:hidden;white-space:nowrap}.uneditable-textarea{width:auto;height:auto}input:-moz-placeholder,textarea:-moz-placeholder{color:#999}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#999}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:#999}.radio,.checkbox{min-height:20px;padding-left:20px}.radio input[type="radio"],.checkbox input[type="checkbox"]{float:left;margin-left:-20px}.controls>.radio:first-child,.controls>.checkbox:first-child{padding-top:5px}.radio.inline,.checkbox.inline{display:inline-block;padding-top:5px;margin-bottom:0;vertical-align:middle}.radio.inline+.radio.inline,.checkbox.inline+.checkbox.inline{margin-left:10px}.input-mini{width:60px}.input-small{width:90px}.input-medium{width:150px}.input-large{width:210px}.input-xlarge{width:270px}.input-xxlarge{width:530px}input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"]{float:none;margin-left:0}.input-append input[class*="span"],.input-append .uneditable-input[class*="span"],.input-prepend input[class*="span"],.input-prepend .uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"],.row-fluid .input-prepend [class*="span"],.row-fluid .input-append [class*="span"]{display:inline-block}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:926px}input.span11,textarea.span11,.uneditable-input.span11{width:846px}input.span10,textarea.span10,.uneditable-input.span10{width:766px}input.span9,textarea.span9,.uneditable-input.span9{width:686px}input.span8,textarea.span8,.uneditable-input.span8{width:606px}input.span7,textarea.span7,.uneditable-input.span7{width:526px}input.span6,textarea.span6,.uneditable-input.span6{width:446px}input.span5,textarea.span5,.uneditable-input.span5{width:366px}input.span4,textarea.span4,.uneditable-input.span4{width:286px}input.span3,textarea.span3,.uneditable-input.span3{width:206px}input.span2,textarea.span2,.uneditable-input.span2{width:126px}input.span1,textarea.span1,.uneditable-input.span1{width:46px}.controls-row{*zoom:1}.controls-row:before,.controls-row:after{display:table;content:"";line-height:0}.controls-row:after{clear:both}.controls-row [class*="span"],.row-fluid .controls-row [class*="span"]{float:left}.controls-row .checkbox[class*="span"],.controls-row .radio[class*="span"]{padding-top:5px}input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{cursor:not-allowed;background-color:#eee}input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"][readonly],input[type="checkbox"][readonly]{background-color:transparent}.control-group.warning .control-label,.control-group.warning .help-block,.control-group.warning .help-inline{color:#c09853}.control-group.warning .checkbox,.control-group.warning .radio,.control-group.warning input,.control-group.warning select,.control-group.warning textarea{color:#c09853}.control-group.warning input,.control-group.warning select,.control-group.warning textarea{border-color:#c09853;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.warning input:focus,.control-group.warning select:focus,.control-group.warning textarea:focus{border-color:#a47e3c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e}.control-group.warning .input-prepend .add-on,.control-group.warning .input-append .add-on{color:#c09853;background-color:#fcf8e3;border-color:#c09853}.control-group.error .control-label,.control-group.error .help-block,.control-group.error .help-inline{color:#b94a48}.control-group.error .checkbox,.control-group.error .radio,.control-group.error input,.control-group.error select,.control-group.error textarea{color:#b94a48}.control-group.error input,.control-group.error select,.control-group.error textarea{border-color:#b94a48;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.error input:focus,.control-group.error select:focus,.control-group.error textarea:focus{border-color:#953b39;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392}.control-group.error .input-prepend .add-on,.control-group.error .input-append .add-on{color:#b94a48;background-color:#f2dede;border-color:#b94a48}.control-group.success .control-label,.control-group.success .help-block,.control-group.success .help-inline{color:#468847}.control-group.success .checkbox,.control-group.success .radio,.control-group.success input,.control-group.success select,.control-group.success textarea{color:#468847}.control-group.success input,.control-group.success select,.control-group.success textarea{border-color:#468847;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.success input:focus,.control-group.success select:focus,.control-group.success textarea:focus{border-color:#356635;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b}.control-group.success .input-prepend .add-on,.control-group.success .input-append .add-on{color:#468847;background-color:#dff0d8;border-color:#468847}.control-group.info .control-label,.control-group.info .help-block,.control-group.info .help-inline{color:#3a87ad}.control-group.info .checkbox,.control-group.info .radio,.control-group.info input,.control-group.info select,.control-group.info textarea{color:#3a87ad}.control-group.info input,.control-group.info select,.control-group.info textarea{border-color:#3a87ad;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.info input:focus,.control-group.info select:focus,.control-group.info textarea:focus{border-color:#2d6987;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3}.control-group.info .input-prepend .add-on,.control-group.info .input-append .add-on{color:#3a87ad;background-color:#d9edf7;border-color:#3a87ad}input:focus:invalid,textarea:focus:invalid,select:focus:invalid{color:#b94a48;border-color:#ee5f5b}input:focus:invalid:focus,textarea:focus:invalid:focus,select:focus:invalid:focus{border-color:#e9322d;-webkit-box-shadow:0 0 6px #f8b9b7;-moz-box-shadow:0 0 6px #f8b9b7;box-shadow:0 0 6px #f8b9b7}.form-actions{padding:19px 20px 20px;margin-top:20px;margin-bottom:20px;background-color:#f5f5f5;border-top:1px solid #e5e5e5;*zoom:1}.form-actions:before,.form-actions:after{display:table;content:"";line-height:0}.form-actions:after{clear:both}.help-block,.help-inline{color:#595959}.help-block{display:block;margin-bottom:10px}.help-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;padding-left:5px}.input-append,.input-prepend{margin-bottom:5px;font-size:0;white-space:nowrap}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input,.input-append .dropdown-menu,.input-prepend .dropdown-menu{font-size:14px}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input{position:relative;margin-bottom:0;*margin-left:0;vertical-align:top;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-append input:focus,.input-prepend input:focus,.input-append select:focus,.input-prepend select:focus,.input-append .uneditable-input:focus,.input-prepend .uneditable-input:focus{z-index:2}.input-append .add-on,.input-prepend .add-on{display:inline-block;width:auto;height:20px;min-width:16px;padding:4px 5px;font-size:14px;font-weight:normal;line-height:20px;text-align:center;text-shadow:0 1px 0 #fff;background-color:#eee;border:1px solid #ccc}.input-append .add-on,.input-prepend .add-on,.input-append .btn,.input-prepend .btn,.input-append .btn-group>.dropdown-toggle,.input-prepend .btn-group>.dropdown-toggle{vertical-align:top;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-append .active,.input-prepend .active{background-color:#a9dba9;border-color:#46a546}.input-prepend .add-on,.input-prepend .btn{margin-right:-1px}.input-prepend .add-on:first-child,.input-prepend .btn:first-child{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-append input,.input-append select,.input-append .uneditable-input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-append input+.btn-group .btn:last-child,.input-append select+.btn-group .btn:last-child,.input-append .uneditable-input+.btn-group .btn:last-child{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-append .add-on,.input-append .btn,.input-append .btn-group{margin-left:-1px}.input-append .add-on:last-child,.input-append .btn:last-child,.input-append .btn-group:last-child>.dropdown-toggle{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append input,.input-prepend.input-append select,.input-prepend.input-append .uneditable-input{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-prepend.input-append input+.btn-group .btn,.input-prepend.input-append select+.btn-group .btn,.input-prepend.input-append .uneditable-input+.btn-group .btn{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append .add-on:first-child,.input-prepend.input-append .btn:first-child{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-prepend.input-append .add-on:last-child,.input-prepend.input-append .btn:last-child{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append .btn-group:first-child{margin-left:0}input.search-query{padding-right:14px;padding-right:4px \9;padding-left:14px;padding-left:4px \9;margin-bottom:0;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.form-search .input-append .search-query,.form-search .input-prepend .search-query{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.form-search .input-append .search-query{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search .input-append .btn{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .search-query{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .btn{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search input,.form-inline input,.form-horizontal input,.form-search textarea,.form-inline textarea,.form-horizontal textarea,.form-search select,.form-inline select,.form-horizontal select,.form-search .help-inline,.form-inline .help-inline,.form-horizontal .help-inline,.form-search .uneditable-input,.form-inline .uneditable-input,.form-horizontal .uneditable-input,.form-search .input-prepend,.form-inline .input-prepend,.form-horizontal .input-prepend,.form-search .input-append,.form-inline .input-append,.form-horizontal .input-append{display:inline-block;*display:inline;*zoom:1;margin-bottom:0;vertical-align:middle}.form-search .hide,.form-inline .hide,.form-horizontal .hide{display:none}.form-search label,.form-inline label,.form-search .btn-group,.form-inline .btn-group{display:inline-block}.form-search .input-append,.form-inline .input-append,.form-search .input-prepend,.form-inline .input-prepend{margin-bottom:0}.form-search .radio,.form-search .checkbox,.form-inline .radio,.form-inline .checkbox{padding-left:0;margin-bottom:0;vertical-align:middle}.form-search .radio input[type="radio"],.form-search .checkbox input[type="checkbox"],.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:left;margin-right:3px;margin-left:0}.control-group{margin-bottom:10px}legend+.control-group{margin-top:20px;-webkit-margin-top-collapse:separate}.form-horizontal .control-group{margin-bottom:20px;*zoom:1}.form-horizontal .control-group:before,.form-horizontal .control-group:after{display:table;content:"";line-height:0}.form-horizontal .control-group:after{clear:both}.form-horizontal .control-label{float:left;width:160px;padding-top:5px;text-align:right}.form-horizontal .controls{*display:inline-block;*padding-left:20px;margin-left:180px;*margin-left:0}.form-horizontal .controls:first-child{*padding-left:180px}.form-horizontal .help-block{margin-bottom:0}.form-horizontal input+.help-block,.form-horizontal select+.help-block,.form-horizontal textarea+.help-block,.form-horizontal .uneditable-input+.help-block,.form-horizontal .input-prepend+.help-block,.form-horizontal .input-append+.help-block{margin-top:10px}.form-horizontal .form-actions{padding-left:180px}table{max-width:100%;background-color:transparent;border-collapse:collapse;border-spacing:0}.table{width:100%;margin-bottom:20px}.table th,.table td{padding:8px;line-height:20px;text-align:left;vertical-align:top;border-top:1px solid #ddd}.table th{font-weight:bold}.table thead th{vertical-align:bottom}.table caption+thead tr:first-child th,.table caption+thead tr:first-child td,.table colgroup+thead tr:first-child th,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child th,.table thead:first-child tr:first-child td{border-top:0}.table tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed th,.table-condensed td{padding:4px 5px}.table-bordered{border:1px solid #ddd;border-collapse:separate;*border-collapse:collapse;border-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.table-bordered th,.table-bordered td{border-left:1px solid #ddd}.table-bordered caption+thead tr:first-child th,.table-bordered caption+tbody tr:first-child th,.table-bordered caption+tbody tr:first-child td,.table-bordered colgroup+thead tr:first-child th,.table-bordered colgroup+tbody tr:first-child th,.table-bordered colgroup+tbody tr:first-child td,.table-bordered thead:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child td{border-top:0}.table-bordered thead:first-child tr:first-child>th:first-child,.table-bordered tbody:first-child tr:first-child>td:first-child{-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px;border-top-left-radius:4px}.table-bordered thead:first-child tr:first-child>th:last-child,.table-bordered tbody:first-child tr:first-child>td:last-child{-webkit-border-top-right-radius:4px;-moz-border-radius-topright:4px;border-top-right-radius:4px}.table-bordered thead:last-child tr:last-child>th:first-child,.table-bordered tbody:last-child tr:last-child>td:first-child,.table-bordered tfoot:last-child tr:last-child>td:first-child{-webkit-border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;border-bottom-left-radius:4px}.table-bordered thead:last-child tr:last-child>th:last-child,.table-bordered tbody:last-child tr:last-child>td:last-child,.table-bordered tfoot:last-child tr:last-child>td:last-child{-webkit-border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;border-bottom-right-radius:4px}.table-bordered tfoot+tbody:last-child tr:last-child td:first-child{-webkit-border-bottom-left-radius:0;-moz-border-radius-bottomleft:0;border-bottom-left-radius:0}.table-bordered tfoot+tbody:last-child tr:last-child td:last-child{-webkit-border-bottom-right-radius:0;-moz-border-radius-bottomright:0;border-bottom-right-radius:0}.table-bordered caption+thead tr:first-child th:first-child,.table-bordered caption+tbody tr:first-child td:first-child,.table-bordered colgroup+thead tr:first-child th:first-child,.table-bordered colgroup+tbody tr:first-child td:first-child{-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px;border-top-left-radius:4px}.table-bordered caption+thead tr:first-child th:last-child,.table-bordered caption+tbody tr:first-child td:last-child,.table-bordered colgroup+thead tr:first-child th:last-child,.table-bordered colgroup+tbody tr:first-child td:last-child{-webkit-border-top-right-radius:4px;-moz-border-radius-topright:4px;border-top-right-radius:4px}.table-striped tbody>tr:nth-child(odd)>td,.table-striped tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.table-hover tbody tr:hover td,.table-hover tbody tr:hover th{background-color:#f5f5f5}table td[class*="span"],table th[class*="span"],.row-fluid table td[class*="span"],.row-fluid table th[class*="span"]{display:table-cell;float:none;margin-left:0}.table td.span1,.table th.span1{float:none;width:44px;margin-left:0}.table td.span2,.table th.span2{float:none;width:124px;margin-left:0}.table td.span3,.table th.span3{float:none;width:204px;margin-left:0}.table td.span4,.table th.span4{float:none;width:284px;margin-left:0}.table td.span5,.table th.span5{float:none;width:364px;margin-left:0}.table td.span6,.table th.span6{float:none;width:444px;margin-left:0}.table td.span7,.table th.span7{float:none;width:524px;margin-left:0}.table td.span8,.table th.span8{float:none;width:604px;margin-left:0}.table td.span9,.table th.span9{float:none;width:684px;margin-left:0}.table td.span10,.table th.span10{float:none;width:764px;margin-left:0}.table td.span11,.table th.span11{float:none;width:844px;margin-left:0}.table td.span12,.table th.span12{float:none;width:924px;margin-left:0}.table tbody tr.success td{background-color:#dff0d8}.table tbody tr.error td{background-color:#f2dede}.table tbody tr.warning td{background-color:#fcf8e3}.table tbody tr.info td{background-color:#d9edf7}.table-hover tbody tr.success:hover td{background-color:#d0e9c6}.table-hover tbody tr.error:hover td{background-color:#ebcccc}.table-hover tbody tr.warning:hover td{background-color:#faf2cc}.table-hover tbody tr.info:hover td{background-color:#c4e3f3}[class^="icon-"],[class*=" icon-"]{display:inline-block;width:14px;height:14px;*margin-right:.3em;line-height:14px;vertical-align:text-top;background-image:url("../img/glyphicons-halflings.png");background-position:14px 14px;background-repeat:no-repeat;margin-top:1px}.icon-white,.nav-pills>.active>a>[class^="icon-"],.nav-pills>.active>a>[class*=" icon-"],.nav-list>.active>a>[class^="icon-"],.nav-list>.active>a>[class*=" icon-"],.navbar-inverse .nav>.active>a>[class^="icon-"],.navbar-inverse .nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^="icon-"],.dropdown-submenu:hover>a>[class*=" icon-"]{background-image:url("../img/glyphicons-halflings-white.png")}.icon-glass{background-position:0 0}.icon-music{background-position:-24px 0}.icon-search{background-position:-48px 0}.icon-envelope{background-position:-72px 0}.icon-heart{background-position:-96px 0}.icon-star{background-position:-120px 0}.icon-star-empty{background-position:-144px 0}.icon-user{background-position:-168px 0}.icon-film{background-position:-192px 0}.icon-th-large{background-position:-216px 0}.icon-th{background-position:-240px 0}.icon-th-list{background-position:-264px 0}.icon-ok{background-position:-288px 0}.icon-remove{background-position:-312px 0}.icon-zoom-in{background-position:-336px 0}.icon-zoom-out{background-position:-360px 0}.icon-off{background-position:-384px 0}.icon-signal{background-position:-408px 0}.icon-cog{background-position:-432px 0}.icon-trash{background-position:-456px 0}.icon-home{background-position:0 -24px}.icon-file{background-position:-24px -24px}.icon-time{background-position:-48px -24px}.icon-road{background-position:-72px -24px}.icon-download-alt{background-position:-96px -24px}.icon-download{background-position:-120px -24px}.icon-upload{background-position:-144px -24px}.icon-inbox{background-position:-168px -24px}.icon-play-circle{background-position:-192px -24px}.icon-repeat{background-position:-216px -24px}.icon-refresh{background-position:-240px -24px}.icon-list-alt{background-position:-264px -24px}.icon-lock{background-position:-287px -24px}.icon-flag{background-position:-312px -24px}.icon-headphones{background-position:-336px -24px}.icon-volume-off{background-position:-360px -24px}.icon-volume-down{background-position:-384px -24px}.icon-volume-up{background-position:-408px -24px}.icon-qrcode{background-position:-432px -24px}.icon-barcode{background-position:-456px -24px}.icon-tag{background-position:0 -48px}.icon-tags{background-position:-25px -48px}.icon-book{background-position:-48px -48px}.icon-bookmark{background-position:-72px -48px}.icon-print{background-position:-96px -48px}.icon-camera{background-position:-120px -48px}.icon-font{background-position:-144px -48px}.icon-bold{background-position:-167px -48px}.icon-italic{background-position:-192px -48px}.icon-text-height{background-position:-216px -48px}.icon-text-width{background-position:-240px -48px}.icon-align-left{background-position:-264px -48px}.icon-align-center{background-position:-288px -48px}.icon-align-right{background-position:-312px -48px}.icon-align-justify{background-position:-336px -48px}.icon-list{background-position:-360px -48px}.icon-indent-left{background-position:-384px -48px}.icon-indent-right{background-position:-408px -48px}.icon-facetime-video{background-position:-432px -48px}.icon-picture{background-position:-456px -48px}.icon-pencil{background-position:0 -72px}.icon-map-marker{background-position:-24px -72px}.icon-adjust{background-position:-48px -72px}.icon-tint{background-position:-72px -72px}.icon-edit{background-position:-96px -72px}.icon-share{background-position:-120px -72px}.icon-check{background-position:-144px -72px}.icon-move{background-position:-168px -72px}.icon-step-backward{background-position:-192px -72px}.icon-fast-backward{background-position:-216px -72px}.icon-backward{background-position:-240px -72px}.icon-play{background-position:-264px -72px}.icon-pause{background-position:-288px -72px}.icon-stop{background-position:-312px -72px}.icon-forward{background-position:-336px -72px}.icon-fast-forward{background-position:-360px -72px}.icon-step-forward{background-position:-384px -72px}.icon-eject{background-position:-408px -72px}.icon-chevron-left{background-position:-432px -72px}.icon-chevron-right{background-position:-456px -72px}.icon-plus-sign{background-position:0 -96px}.icon-minus-sign{background-position:-24px -96px}.icon-remove-sign{background-position:-48px -96px}.icon-ok-sign{background-position:-72px -96px}.icon-question-sign{background-position:-96px -96px}.icon-info-sign{background-position:-120px -96px}.icon-screenshot{background-position:-144px -96px}.icon-remove-circle{background-position:-168px -96px}.icon-ok-circle{background-position:-192px -96px}.icon-ban-circle{background-position:-216px -96px}.icon-arrow-left{background-position:-240px -96px}.icon-arrow-right{background-position:-264px -96px}.icon-arrow-up{background-position:-289px -96px}.icon-arrow-down{background-position:-312px -96px}.icon-share-alt{background-position:-336px -96px}.icon-resize-full{background-position:-360px -96px}.icon-resize-small{background-position:-384px -96px}.icon-plus{background-position:-408px -96px}.icon-minus{background-position:-433px -96px}.icon-asterisk{background-position:-456px -96px}.icon-exclamation-sign{background-position:0 -120px}.icon-gift{background-position:-24px -120px}.icon-leaf{background-position:-48px -120px}.icon-fire{background-position:-72px -120px}.icon-eye-open{background-position:-96px -120px}.icon-eye-close{background-position:-120px -120px}.icon-warning-sign{background-position:-144px -120px}.icon-plane{background-position:-168px -120px}.icon-calendar{background-position:-192px -120px}.icon-random{background-position:-216px -120px;width:16px}.icon-comment{background-position:-240px -120px}.icon-magnet{background-position:-264px -120px}.icon-chevron-up{background-position:-288px -120px}.icon-chevron-down{background-position:-313px -119px}.icon-retweet{background-position:-336px -120px}.icon-shopping-cart{background-position:-360px -120px}.icon-folder-close{background-position:-384px -120px}.icon-folder-open{background-position:-408px -120px;width:16px}.icon-resize-vertical{background-position:-432px -119px}.icon-resize-horizontal{background-position:-456px -118px}.icon-hdd{background-position:0 -144px}.icon-bullhorn{background-position:-24px -144px}.icon-bell{background-position:-48px -144px}.icon-certificate{background-position:-72px -144px}.icon-thumbs-up{background-position:-96px -144px}.icon-thumbs-down{background-position:-120px -144px}.icon-hand-right{background-position:-144px -144px}.icon-hand-left{background-position:-168px -144px}.icon-hand-up{background-position:-192px -144px}.icon-hand-down{background-position:-216px -144px}.icon-circle-arrow-right{background-position:-240px -144px}.icon-circle-arrow-left{background-position:-264px -144px}.icon-circle-arrow-up{background-position:-288px -144px}.icon-circle-arrow-down{background-position:-312px -144px}.icon-globe{background-position:-336px -144px}.icon-wrench{background-position:-360px -144px}.icon-tasks{background-position:-384px -144px}.icon-filter{background-position:-408px -144px}.icon-briefcase{background-position:-432px -144px}.icon-fullscreen{background-position:-456px -144px}.dropup,.dropdown{position:relative}.dropdown-toggle{*margin-bottom:-3px}.dropdown-toggle:active,.open .dropdown-toggle{outline:0}.caret{display:inline-block;width:0;height:0;vertical-align:top;border-top:4px solid #000;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.dropdown .caret{margin-top:8px;margin-left:2px}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);*border-right-width:2px;*border-bottom-width:2px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.dropdown-menu li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap}.dropdown-menu li>a:hover,.dropdown-menu li>a:focus,.dropdown-submenu:hover>a{text-decoration:none;color:#fff;background-color:#bf2e23;background-image:-moz-linear-gradient(top,#c83025,#b32b21);background-image:-webkit-gradient(linear,0 0,0 100%,from(#c83025),to(#b32b21));background-image:-webkit-linear-gradient(top,#c83025,#b32b21);background-image:-o-linear-gradient(top,#c83025,#b32b21);background-image:linear-gradient(to bottom,#c83025,#b32b21);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffc83025',endColorstr='#ffb32b21',GradientType=0)}.dropdown-menu .active>a,.dropdown-menu .active>a:hover{color:#fff;text-decoration:none;outline:0;background-color:#bf2e23;background-image:-moz-linear-gradient(top,#c83025,#b32b21);background-image:-webkit-gradient(linear,0 0,0 100%,from(#c83025),to(#b32b21));background-image:-webkit-linear-gradient(top,#c83025,#b32b21);background-image:-o-linear-gradient(top,#c83025,#b32b21);background-image:linear-gradient(to bottom,#c83025,#b32b21);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffc83025',endColorstr='#ffb32b21',GradientType=0)}.dropdown-menu .disabled>a,.dropdown-menu .disabled>a:hover{color:#999}.dropdown-menu .disabled>a:hover{text-decoration:none;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);cursor:default}.open{*z-index:1000}.open>.dropdown-menu{display:block}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid #000;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}.dropdown-submenu{position:relative}.dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px}.dropdown-submenu:hover>.dropdown-menu{display:block}.dropup .dropdown-submenu>.dropdown-menu{top:auto;bottom:0;margin-top:0;margin-bottom:-2px;-webkit-border-radius:5px 5px 5px 0;-moz-border-radius:5px 5px 5px 0;border-radius:5px 5px 5px 0}.dropdown-submenu>a:after{display:block;content:" ";float:right;width:0;height:0;border-color:transparent;border-style:solid;border-width:5px 0 5px 5px;border-left-color:#ccc;margin-top:5px;margin-right:-10px}.dropdown-submenu:hover>a:after{border-left-color:#fff}.dropdown-submenu.pull-left{float:none}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.dropdown .dropdown-menu .nav-header{padding-left:20px;padding-right:20px}.typeahead{z-index:1051;margin-top:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-large{padding:24px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.well-small{padding:9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.fade{opacity:0;-webkit-transition:opacity .15s linear;-moz-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;-moz-transition:height .35s ease;-o-transition:height .35s ease;transition:height .35s ease}.collapse.in{height:auto}.close{float:right;font-size:20px;font-weight:bold;line-height:20px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.btn{display:inline-block;*display:inline;*zoom:1;padding:4px 12px;margin-bottom:0;font-size:14px;line-height:20px;text-align:center;vertical-align:middle;cursor:pointer;color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe6e6e6',GradientType=0);border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#e6e6e6;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);border:1px solid #bbb;*border:0;border-bottom-color:#a2a2a2;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*margin-left:.3em;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05)}.btn:hover,.btn:active,.btn.active,.btn.disabled,.btn[disabled]{color:#333;background-color:#e6e6e6;*background-color:#d9d9d9}.btn:active,.btn.active{background-color:#ccc \9}.btn:first-child{*margin-left:0}.btn:hover{color:#333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05)}.btn.disabled,.btn[disabled]{cursor:default;background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-large{padding:11px 19px;font-size:17.5px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.btn-large [class^="icon-"],.btn-large [class*=" icon-"]{margin-top:4px}.btn-small{padding:2px 10px;font-size:11.9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-small [class^="icon-"],.btn-small [class*=" icon-"]{margin-top:0}.btn-mini [class^="icon-"],.btn-mini [class*=" icon-"]{margin-top:-1px}.btn-mini{padding:0 6px;font-size:10.5px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-block{display:block;width:100%;padding-left:0;padding-right:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active,.btn-inverse.active{color:rgba(255,255,255,0.75)}.btn{border-color:#c5c5c5;border-color:rgba(0,0,0,0.15) rgba(0,0,0,0.15) rgba(0,0,0,0.25)}.btn-primary{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#e7d785;background-image:-moz-linear-gradient(top,#fffeb8,#c49c38);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fffeb8),to(#c49c38));background-image:-webkit-linear-gradient(top,#fffeb8,#c49c38);background-image:-o-linear-gradient(top,#fffeb8,#c49c38);background-image:linear-gradient(to bottom,#fffeb8,#c49c38);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffffeb8',endColorstr='#ffc49c38',GradientType=0);border-color:#c49c38 #c49c38 #896d27;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#c49c38;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}.btn-primary:hover,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{color:#fff;background-color:#c49c38;*background-color:#b08c32}.btn-primary:active,.btn-primary.active{background-color:#9c7c2d \9}.btn-warning{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#faa732;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0);border-color:#f89406 #f89406 #ad6704;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#f89406;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}.btn-warning:hover,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled]{color:#fff;background-color:#f89406;*background-color:#df8505}.btn-warning:active,.btn-warning.active{background-color:#c67605 \9}.btn-danger{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#cc4036;background-image:-moz-linear-gradient(top,#dc4e44,#b32b21);background-image:-webkit-gradient(linear,0 0,0 100%,from(#dc4e44),to(#b32b21));background-image:-webkit-linear-gradient(top,#dc4e44,#b32b21);background-image:-o-linear-gradient(top,#dc4e44,#b32b21);background-image:linear-gradient(to bottom,#dc4e44,#b32b21);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdc4e44',endColorstr='#ffb32b21',GradientType=0);border-color:#b32b21 #b32b21 #721c15;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#b32b21;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}.btn-danger:hover,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled]{color:#fff;background-color:#b32b21;*background-color:#9d261d}.btn-danger:active,.btn-danger.active{background-color:#872119 \9}.btn-success{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#5bb75b;background-image:-moz-linear-gradient(top,#62c462,#51a351);background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#51a351));background-image:-webkit-linear-gradient(top,#62c462,#51a351);background-image:-o-linear-gradient(top,#62c462,#51a351);background-image:linear-gradient(to bottom,#62c462,#51a351);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff51a351',GradientType=0);border-color:#51a351 #51a351 #387038;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#51a351;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}.btn-success:hover,.btn-success:active,.btn-success.active,.btn-success.disabled,.btn-success[disabled]{color:#fff;background-color:#51a351;*background-color:#499249}.btn-success:active,.btn-success.active{background-color:#408140 \9}.btn-info{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#49afcd;background-image:-moz-linear-gradient(top,#5bc0de,#2f96b4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#2f96b4));background-image:-webkit-linear-gradient(top,#5bc0de,#2f96b4);background-image:-o-linear-gradient(top,#5bc0de,#2f96b4);background-image:linear-gradient(to bottom,#5bc0de,#2f96b4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff2f96b4',GradientType=0);border-color:#2f96b4 #2f96b4 #1f6377;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#2f96b4;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}.btn-info:hover,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled]{color:#fff;background-color:#2f96b4;*background-color:#2a85a0}.btn-info:active,.btn-info.active{background-color:#24748c \9}.btn-inverse{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#363636;background-image:-moz-linear-gradient(top,#444,#222);background-image:-webkit-gradient(linear,0 0,0 100%,from(#444),to(#222));background-image:-webkit-linear-gradient(top,#444,#222);background-image:-o-linear-gradient(top,#444,#222);background-image:linear-gradient(to bottom,#444,#222);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444',endColorstr='#ff222222',GradientType=0);border-color:#222 #222 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#222;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}.btn-inverse:hover,.btn-inverse:active,.btn-inverse.active,.btn-inverse.disabled,.btn-inverse[disabled]{color:#fff;background-color:#222;*background-color:#151515}.btn-inverse:active,.btn-inverse.active{background-color:#080808 \9}button.btn,input[type="submit"].btn{*padding-top:3px;*padding-bottom:3px}button.btn::-moz-focus-inner,input[type="submit"].btn::-moz-focus-inner{padding:0;border:0}button.btn.btn-large,input[type="submit"].btn.btn-large{*padding-top:7px;*padding-bottom:7px}button.btn.btn-small,input[type="submit"].btn.btn-small{*padding-top:3px;*padding-bottom:3px}button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-bottom:1px}.btn-link,.btn-link:active,.btn-link[disabled]{background-color:transparent;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-link{border-color:transparent;cursor:pointer;color:#c83025;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-link:hover{color:#9d261d;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover{color:#333;text-decoration:none}.btn-group{position:relative;display:inline-block;*display:inline;*zoom:1;font-size:0;vertical-align:middle;white-space:nowrap;*margin-left:.3em}.btn-group:first-child{*margin-left:0}.btn-group+.btn-group{margin-left:5px}.btn-toolbar{font-size:0;margin-top:10px;margin-bottom:10px}.btn-toolbar>.btn+.btn,.btn-toolbar>.btn-group+.btn,.btn-toolbar>.btn+.btn-group{margin-left:5px}.btn-group>.btn{position:relative;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group>.btn+.btn{margin-left:-1px}.btn-group>.btn,.btn-group>.dropdown-menu,.btn-group>.popover{font-size:14px}.btn-group>.btn-mini{font-size:10.5px}.btn-group>.btn-small{font-size:11.9px}.btn-group>.btn-large{font-size:17.5px}.btn-group>.btn:first-child{margin-left:0;-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px;border-top-left-radius:4px;-webkit-border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;border-bottom-left-radius:4px}.btn-group>.btn:last-child,.btn-group>.dropdown-toggle{-webkit-border-top-right-radius:4px;-moz-border-radius-topright:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;border-bottom-right-radius:4px}.btn-group>.btn.large:first-child{margin-left:0;-webkit-border-top-left-radius:6px;-moz-border-radius-topleft:6px;border-top-left-radius:6px;-webkit-border-bottom-left-radius:6px;-moz-border-radius-bottomleft:6px;border-bottom-left-radius:6px}.btn-group>.btn.large:last-child,.btn-group>.large.dropdown-toggle{-webkit-border-top-right-radius:6px;-moz-border-radius-topright:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;-moz-border-radius-bottomright:6px;border-bottom-right-radius:6px}.btn-group>.btn:hover,.btn-group>.btn:focus,.btn-group>.btn:active,.btn-group>.btn.active{z-index:2}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-left:8px;padding-right:8px;-webkit-box-shadow:inset 1px 0 0 rgba(255,255,255,.125),inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 1px 0 0 rgba(255,255,255,.125),inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 1px 0 0 rgba(255,255,255,.125),inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);*padding-top:5px;*padding-bottom:5px}.btn-group>.btn-mini+.dropdown-toggle{padding-left:5px;padding-right:5px;*padding-top:2px;*padding-bottom:2px}.btn-group>.btn-small+.dropdown-toggle{*padding-top:5px;*padding-bottom:4px}.btn-group>.btn-large+.dropdown-toggle{padding-left:12px;padding-right:12px;*padding-top:7px;*padding-bottom:7px}.btn-group.open .dropdown-toggle{background-image:none;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05)}.btn-group.open .btn.dropdown-toggle{background-color:#e6e6e6}.btn-group.open .btn-primary.dropdown-toggle{background-color:#c49c38}.btn-group.open .btn-warning.dropdown-toggle{background-color:#f89406}.btn-group.open .btn-danger.dropdown-toggle{background-color:#b32b21}.btn-group.open .btn-success.dropdown-toggle{background-color:#51a351}.btn-group.open .btn-info.dropdown-toggle{background-color:#2f96b4}.btn-group.open .btn-inverse.dropdown-toggle{background-color:#222}.btn .caret{margin-top:8px;margin-left:0}.btn-mini .caret,.btn-small .caret,.btn-large .caret{margin-top:6px}.btn-large .caret{border-left-width:5px;border-right-width:5px;border-top-width:5px}.dropup .btn-large .caret{border-bottom-width:5px}.btn-primary .caret,.btn-warning .caret,.btn-danger .caret,.btn-info .caret,.btn-success .caret,.btn-inverse .caret{border-top-color:#fff;border-bottom-color:#fff}.btn-group-vertical{display:inline-block;*display:inline;*zoom:1}.btn-group-vertical>.btn{display:block;float:none;max-width:100%;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group-vertical>.btn+.btn{margin-left:0;margin-top:-1px}.btn-group-vertical>.btn:first-child{-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.btn-group-vertical>.btn:last-child{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.btn-group-vertical>.btn-large:first-child{-webkit-border-radius:6px 6px 0 0;-moz-border-radius:6px 6px 0 0;border-radius:6px 6px 0 0}.btn-group-vertical>.btn-large:last-child{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.alert{padding:8px 35px 8px 14px;margin-bottom:20px;text-shadow:0 1px 0 rgba(255,255,255,0.5);background-color:#fcf8e3;border:1px solid #fbeed5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.alert,.alert h4{color:#c09853}.alert h4{margin:0}.alert .close{position:relative;top:-2px;right:-21px;line-height:20px}.alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#468847}.alert-success h4{color:#468847}.alert-danger,.alert-error{background-color:#f2dede;border-color:#eed3d7;color:#b94a48}.alert-danger h4,.alert-error h4{color:#b94a48}.alert-info{background-color:#d9edf7;border-color:#bce8f1;color:#3a87ad}.alert-info h4{color:#3a87ad}.alert-block{padding-top:14px;padding-bottom:14px}.alert-block>p,.alert-block>ul{margin-bottom:0}.alert-block p+p{margin-top:5px}.nav{margin-left:0;margin-bottom:20px;list-style:none}.nav>li>a{display:block}.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li>a>img{max-width:none}.nav>.pull-right{float:right}.nav-header{display:block;padding:3px 15px;font-size:11px;font-weight:bold;line-height:20px;color:#999;text-shadow:0 1px 0 rgba(255,255,255,0.5);text-transform:uppercase}.nav li+.nav-header{margin-top:9px}.nav-list{padding-left:15px;padding-right:15px;margin-bottom:0}.nav-list>li>a,.nav-list .nav-header{margin-left:-15px;margin-right:-15px;text-shadow:0 1px 0 rgba(255,255,255,0.5)}.nav-list>li>a{padding:3px 15px}.nav-list>.active>a,.nav-list>.active>a:hover{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.2);background-color:#c83025}.nav-list [class^="icon-"],.nav-list [class*=" icon-"]{margin-right:2px}.nav-list .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.nav-tabs,.nav-pills{*zoom:1}.nav-tabs:before,.nav-pills:before,.nav-tabs:after,.nav-pills:after{display:table;content:"";line-height:0}.nav-tabs:after,.nav-pills:after{clear:both}.nav-tabs>li,.nav-pills>li{float:left}.nav-tabs>li>a,.nav-pills>li>a{padding-right:12px;padding-left:12px;margin-right:2px;line-height:14px}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{margin-bottom:-1px}.nav-tabs>li>a{padding-top:8px;padding-bottom:8px;line-height:20px;border:1px solid transparent;-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>.active>a,.nav-tabs>.active>a:hover{color:#555;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent;cursor:default}.nav-pills>li>a{padding-top:8px;padding-bottom:8px;margin-top:2px;margin-bottom:2px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.nav-pills>.active>a,.nav-pills>.active>a:hover{color:#fff;background-color:#c83025}.nav-stacked>li{float:none}.nav-stacked>li>a{margin-right:0}.nav-tabs.nav-stacked{border-bottom:0}.nav-tabs.nav-stacked>li>a{border:1px solid #ddd;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.nav-tabs.nav-stacked>li:first-child>a{-webkit-border-top-right-radius:4px;-moz-border-radius-topright:4px;border-top-right-radius:4px;-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px;border-top-left-radius:4px}.nav-tabs.nav-stacked>li:last-child>a{-webkit-border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;border-bottom-right-radius:4px;-webkit-border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;border-bottom-left-radius:4px}.nav-tabs.nav-stacked>li>a:hover{border-color:#ddd;z-index:2}.nav-pills.nav-stacked>li>a{margin-bottom:3px}.nav-pills.nav-stacked>li:last-child>a{margin-bottom:1px}.nav-tabs .dropdown-menu{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.nav-pills .dropdown-menu{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.nav .dropdown-toggle .caret{border-top-color:#c83025;border-bottom-color:#c83025;margin-top:6px}.nav .dropdown-toggle:hover .caret{border-top-color:#9d261d;border-bottom-color:#9d261d}.nav-tabs .dropdown-toggle .caret{margin-top:8px}.nav .active .dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff}.nav-tabs .active .dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.nav>.dropdown.active>a:hover{cursor:pointer}.nav-tabs .open .dropdown-toggle,.nav-pills .open .dropdown-toggle,.nav>li.dropdown.open.active>a:hover{color:#fff;background-color:#999;border-color:#999}.nav li.dropdown.open .caret,.nav li.dropdown.open.active .caret,.nav li.dropdown.open a:hover .caret{border-top-color:#fff;border-bottom-color:#fff;opacity:1;filter:alpha(opacity=100)}.tabs-stacked .open>a:hover{border-color:#999}.tabbable{*zoom:1}.tabbable:before,.tabbable:after{display:table;content:"";line-height:0}.tabbable:after{clear:both}.tab-content{overflow:auto}.tabs-below>.nav-tabs,.tabs-right>.nav-tabs,.tabs-left>.nav-tabs{border-bottom:0}.tab-content>.tab-pane,.pill-content>.pill-pane{display:none}.tab-content>.active,.pill-content>.active{display:block}.tabs-below>.nav-tabs{border-top:1px solid #ddd}.tabs-below>.nav-tabs>li{margin-top:-1px;margin-bottom:0}.tabs-below>.nav-tabs>li>a{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.tabs-below>.nav-tabs>li>a:hover{border-bottom-color:transparent;border-top-color:#ddd}.tabs-below>.nav-tabs>.active>a,.tabs-below>.nav-tabs>.active>a:hover{border-color:transparent #ddd #ddd #ddd}.tabs-left>.nav-tabs>li,.tabs-right>.nav-tabs>li{float:none}.tabs-left>.nav-tabs>li>a,.tabs-right>.nav-tabs>li>a{min-width:74px;margin-right:0;margin-bottom:3px}.tabs-left>.nav-tabs{float:left;margin-right:19px;border-right:1px solid #ddd}.tabs-left>.nav-tabs>li>a{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.tabs-left>.nav-tabs>li>a:hover{border-color:#eee #ddd #eee #eee}.tabs-left>.nav-tabs .active>a,.tabs-left>.nav-tabs .active>a:hover{border-color:#ddd transparent #ddd #ddd;*border-right-color:#fff}.tabs-right>.nav-tabs{float:right;margin-left:19px;border-left:1px solid #ddd}.tabs-right>.nav-tabs>li>a{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.tabs-right>.nav-tabs>li>a:hover{border-color:#eee #eee #eee #ddd}.tabs-right>.nav-tabs .active>a,.tabs-right>.nav-tabs .active>a:hover{border-color:#ddd #ddd #ddd transparent;*border-left-color:#fff}.nav>.disabled>a{color:#999}.nav>.disabled>a:hover{text-decoration:none;background-color:transparent;cursor:default}.navbar{overflow:visible;margin-bottom:20px;*position:relative;*z-index:2}.navbar-inner{min-height:40px;padding-left:20px;padding-right:20px;background-color:#fafafa;background-image:-moz-linear-gradient(top,#fff,#f2f2f2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#f2f2f2));background-image:-webkit-linear-gradient(top,#fff,#f2f2f2);background-image:-o-linear-gradient(top,#fff,#f2f2f2);background-image:linear-gradient(to bottom,#fff,#f2f2f2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#fff2f2f2',GradientType=0);border:1px solid #d4d4d4;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 4px rgba(0,0,0,0.065);-moz-box-shadow:0 1px 4px rgba(0,0,0,0.065);box-shadow:0 1px 4px rgba(0,0,0,0.065);*zoom:1}.navbar-inner:before,.navbar-inner:after{display:table;content:"";line-height:0}.navbar-inner:after{clear:both}.navbar .container{width:auto}.nav-collapse.collapse{height:auto;overflow:visible}.navbar .brand{float:left;display:block;padding:10px 20px 10px;margin-left:-20px;font-size:20px;font-weight:200;color:#777;text-shadow:0 1px 0 #fff}.navbar .brand:hover{text-decoration:none}.navbar-text{margin-bottom:0;line-height:40px;color:#777}.navbar-link{color:#777}.navbar-link:hover{color:#333}.navbar .divider-vertical{height:40px;margin:0 9px;border-left:1px solid #f2f2f2;border-right:1px solid #fff}.navbar .btn,.navbar .btn-group{margin-top:5px}.navbar .btn-group .btn,.navbar .input-prepend .btn,.navbar .input-append .btn{margin-top:0}.navbar-form{margin-bottom:0;*zoom:1}.navbar-form:before,.navbar-form:after{display:table;content:"";line-height:0}.navbar-form:after{clear:both}.navbar-form input,.navbar-form select,.navbar-form .radio,.navbar-form .checkbox{margin-top:5px}.navbar-form input,.navbar-form select,.navbar-form .btn{display:inline-block;margin-bottom:0}.navbar-form input[type="image"],.navbar-form input[type="checkbox"],.navbar-form input[type="radio"]{margin-top:3px}.navbar-form .input-append,.navbar-form .input-prepend{margin-top:5px;white-space:nowrap}.navbar-form .input-append input,.navbar-form .input-prepend input{margin-top:0}.navbar-search{position:relative;float:left;margin-top:5px;margin-bottom:0}.navbar-search .search-query{margin-bottom:0;padding:4px 14px;font-family:proxima-nova,"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:1;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.navbar-static-top{position:static;margin-bottom:0}.navbar-static-top .navbar-inner{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030;margin-bottom:0}.navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{border-width:0 0 1px}.navbar-fixed-bottom .navbar-inner{border-width:1px 0 0}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding-left:0;padding-right:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.navbar-fixed-top{top:0}.navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{-webkit-box-shadow:0 1px 10px rgba(0,0,0,.1);-moz-box-shadow:0 1px 10px rgba(0,0,0,.1);box-shadow:0 1px 10px rgba(0,0,0,.1)}.navbar-fixed-bottom{bottom:0}.navbar-fixed-bottom .navbar-inner{-webkit-box-shadow:0 -1px 10px rgba(0,0,0,.1);-moz-box-shadow:0 -1px 10px rgba(0,0,0,.1);box-shadow:0 -1px 10px rgba(0,0,0,.1)}.navbar .nav{position:relative;left:0;display:block;float:left;margin:0 10px 0 0}.navbar .nav.pull-right{float:right;margin-right:0}.navbar .nav>li{float:left}.navbar .nav>li>a{float:none;padding:10px 15px 10px;color:#777;text-decoration:none;text-shadow:0 1px 0 #fff}.navbar .nav .dropdown-toggle .caret{margin-top:8px}.navbar .nav>li>a:focus,.navbar .nav>li>a:hover{background-color:transparent;color:#333;text-decoration:none}.navbar .nav>.active>a,.navbar .nav>.active>a:hover,.navbar .nav>.active>a:focus{color:#555;text-decoration:none;background-color:#e5e5e5;-webkit-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);-moz-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);box-shadow:inset 0 3px 8px rgba(0,0,0,0.125)}.navbar .btn-navbar{display:none;float:right;padding:7px 10px;margin-left:5px;margin-right:5px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#ededed;background-image:-moz-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#e5e5e5));background-image:-webkit-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:-o-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:linear-gradient(to bottom,#f2f2f2,#e5e5e5);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2',endColorstr='#ffe5e5e5',GradientType=0);border-color:#e5e5e5 #e5e5e5 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#e5e5e5;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.075);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.075)}.navbar .btn-navbar:hover,.navbar .btn-navbar:active,.navbar .btn-navbar.active,.navbar .btn-navbar.disabled,.navbar .btn-navbar[disabled]{color:#fff;background-color:#e5e5e5;*background-color:#d9d9d9}.navbar .btn-navbar:active,.navbar .btn-navbar.active{background-color:#ccc \9}.navbar .btn-navbar .icon-bar{display:block;width:18px;height:2px;background-color:#f5f5f5;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;-webkit-box-shadow:0 1px 0 rgba(0,0,0,0.25);-moz-box-shadow:0 1px 0 rgba(0,0,0,0.25);box-shadow:0 1px 0 rgba(0,0,0,0.25)}.btn-navbar .icon-bar+.icon-bar{margin-top:3px}.navbar .nav>li>.dropdown-menu:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:rgba(0,0,0,0.2);position:absolute;top:-7px;left:9px}.navbar .nav>li>.dropdown-menu:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;position:absolute;top:-6px;left:10px}.navbar-fixed-bottom .nav>li>.dropdown-menu:before{border-top:7px solid #ccc;border-top-color:rgba(0,0,0,0.2);border-bottom:0;bottom:-7px;top:auto}.navbar-fixed-bottom .nav>li>.dropdown-menu:after{border-top:6px solid #fff;border-bottom:0;bottom:-6px;top:auto}.navbar .nav li.dropdown>a:hover .caret{border-top-color:#555;border-bottom-color:#555}.navbar .nav li.dropdown.open>.dropdown-toggle,.navbar .nav li.dropdown.active>.dropdown-toggle,.navbar .nav li.dropdown.open.active>.dropdown-toggle{background-color:#e5e5e5;color:#555}.navbar .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#777;border-bottom-color:#777}.navbar .nav li.dropdown.open>.dropdown-toggle .caret,.navbar .nav li.dropdown.active>.dropdown-toggle .caret,.navbar .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.navbar .pull-right>li>.dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right{left:auto;right:0}.navbar .pull-right>li>.dropdown-menu:before,.navbar .nav>li>.dropdown-menu.pull-right:before{left:auto;right:12px}.navbar .pull-right>li>.dropdown-menu:after,.navbar .nav>li>.dropdown-menu.pull-right:after{left:auto;right:13px}.navbar .pull-right>li>.dropdown-menu .dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right .dropdown-menu{left:auto;right:100%;margin-left:0;margin-right:-1px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.navbar-inverse .navbar-inner{background-color:#1b1b1b;background-image:-moz-linear-gradient(top,#222,#111);background-image:-webkit-gradient(linear,0 0,0 100%,from(#222),to(#111));background-image:-webkit-linear-gradient(top,#222,#111);background-image:-o-linear-gradient(top,#222,#111);background-image:linear-gradient(to bottom,#222,#111);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222',endColorstr='#ff111111',GradientType=0);border-color:#252525}.navbar-inverse .brand,.navbar-inverse .nav>li>a{color:#999;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.navbar-inverse .brand:hover,.navbar-inverse .nav>li>a:hover{color:#fff}.navbar-inverse .brand{color:#999}.navbar-inverse .navbar-text{color:#999}.navbar-inverse .nav>li>a:focus,.navbar-inverse .nav>li>a:hover{background-color:transparent;color:#fff}.navbar-inverse .nav .active>a,.navbar-inverse .nav .active>a:hover,.navbar-inverse .nav .active>a:focus{color:#fff;background-color:#111}.navbar-inverse .navbar-link{color:#999}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .divider-vertical{border-left-color:#111;border-right-color:#222}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle{background-color:#111;color:#fff}.navbar-inverse .nav li.dropdown>a:hover .caret{border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#999;border-bottom-color:#999}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .navbar-search .search-query{color:#fff;background-color:#515151;border-color:#111;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1),0 1px 0 rgba(255,255,255,.15);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,.1),0 1px 0 rgba(255,255,255,.15);box-shadow:inset 0 1px 2px rgba(0,0,0,.1),0 1px 0 rgba(255,255,255,.15);-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}.navbar-inverse .navbar-search .search-query:-moz-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query:-ms-input-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query::-webkit-input-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query:focus,.navbar-inverse .navbar-search .search-query.focused{padding:5px 15px;color:#333;text-shadow:0 1px 0 #fff;background-color:#fff;border:0;-webkit-box-shadow:0 0 3px rgba(0,0,0,0.15);-moz-box-shadow:0 0 3px rgba(0,0,0,0.15);box-shadow:0 0 3px rgba(0,0,0,0.15);outline:0}.navbar-inverse .btn-navbar{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e0e0e;background-image:-moz-linear-gradient(top,#151515,#040404);background-image:-webkit-gradient(linear,0 0,0 100%,from(#151515),to(#040404));background-image:-webkit-linear-gradient(top,#151515,#040404);background-image:-o-linear-gradient(top,#151515,#040404);background-image:linear-gradient(to bottom,#151515,#040404);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff151515',endColorstr='#ff040404',GradientType=0);border-color:#040404 #040404 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#040404;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}.navbar-inverse .btn-navbar:hover,.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active,.navbar-inverse .btn-navbar.disabled,.navbar-inverse .btn-navbar[disabled]{color:#fff;background-color:#040404;*background-color:#000}.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active{background-color:#000 \9}.breadcrumb{padding:8px 15px;margin:0 0 20px;list-style:none;background-color:#f5f5f5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.breadcrumb>li{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 0 #fff}.breadcrumb>li>.divider{padding:0 5px;color:#ccc}.breadcrumb>.active{color:#999}.pagination{margin:20px 0}.pagination ul{display:inline-block;*display:inline;*zoom:1;margin-left:0;margin-bottom:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:0 1px 2px rgba(0,0,0,0.05);box-shadow:0 1px 2px rgba(0,0,0,0.05)}.pagination ul>li{display:inline}.pagination ul>li>a,.pagination ul>li>span{float:left;padding:4px 12px;line-height:20px;text-decoration:none;background-color:#fff;border:1px solid #ddd;border-left-width:0}.pagination ul>li>a:hover,.pagination ul>.active>a,.pagination ul>.active>span{background-color:#f5f5f5}.pagination ul>.active>a,.pagination ul>.active>span{color:#999;cursor:default}.pagination ul>.disabled>span,.pagination ul>.disabled>a,.pagination ul>.disabled>a:hover{color:#999;background-color:transparent;cursor:default}.pagination ul>li:first-child>a,.pagination ul>li:first-child>span{border-left-width:1px;-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px;border-top-left-radius:4px;-webkit-border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;border-bottom-left-radius:4px}.pagination ul>li:last-child>a,.pagination ul>li:last-child>span{-webkit-border-top-right-radius:4px;-moz-border-radius-topright:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;border-bottom-right-radius:4px}.pagination-centered{text-align:center}.pagination-right{text-align:right}.pagination-large ul>li>a,.pagination-large ul>li>span{padding:11px 19px;font-size:17.5px}.pagination-large ul>li:first-child>a,.pagination-large ul>li:first-child>span{-webkit-border-top-left-radius:6px;-moz-border-radius-topleft:6px;border-top-left-radius:6px;-webkit-border-bottom-left-radius:6px;-moz-border-radius-bottomleft:6px;border-bottom-left-radius:6px}.pagination-large ul>li:last-child>a,.pagination-large ul>li:last-child>span{-webkit-border-top-right-radius:6px;-moz-border-radius-topright:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;-moz-border-radius-bottomright:6px;border-bottom-right-radius:6px}.pagination-mini ul>li:first-child>a,.pagination-small ul>li:first-child>a,.pagination-mini ul>li:first-child>span,.pagination-small ul>li:first-child>span{-webkit-border-top-left-radius:3px;-moz-border-radius-topleft:3px;border-top-left-radius:3px;-webkit-border-bottom-left-radius:3px;-moz-border-radius-bottomleft:3px;border-bottom-left-radius:3px}.pagination-mini ul>li:last-child>a,.pagination-small ul>li:last-child>a,.pagination-mini ul>li:last-child>span,.pagination-small ul>li:last-child>span{-webkit-border-top-right-radius:3px;-moz-border-radius-topright:3px;border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;-moz-border-radius-bottomright:3px;border-bottom-right-radius:3px}.pagination-small ul>li>a,.pagination-small ul>li>span{padding:2px 10px;font-size:11.9px}.pagination-mini ul>li>a,.pagination-mini ul>li>span{padding:0 6px;font-size:10.5px}.pager{margin:20px 0;list-style:none;text-align:center;*zoom:1}.pager:before,.pager:after{display:table;content:"";line-height:0}.pager:after{clear:both}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.pager li>a:hover{text-decoration:none;background-color:#f5f5f5}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>span{color:#999;background-color:#fff;cursor:default}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop,.modal-backdrop.fade.in{opacity:.8;filter:alpha(opacity=80)}.modal{position:fixed;top:10%;left:50%;z-index:1050;width:560px;margin-left:-280px;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,0.3);*border:1px solid #999;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box;outline:0}.modal.fade{-webkit-transition:opacity .3s linear,top .3s ease-out;-moz-transition:opacity .3s linear,top .3s ease-out;-o-transition:opacity .3s linear,top .3s ease-out;transition:opacity .3s linear,top .3s ease-out;top:-25%}.modal.fade.in{top:10%}.modal-header{padding:9px 15px;border-bottom:1px solid #eee}.modal-header .close{margin-top:2px}.modal-header h3{margin:0;line-height:30px}.modal-body{position:relative;overflow-y:auto;max-height:400px;padding:15px}.modal-form{margin-bottom:0}.modal-footer{padding:14px 15px 15px;margin-bottom:0;text-align:right;background-color:#f5f5f5;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff;*zoom:1}.modal-footer:before,.modal-footer:after{display:table;content:"";line-height:0}.modal-footer:after{clear:both}.modal-footer .btn+.btn{margin-left:5px;margin-bottom:0}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.tooltip{position:absolute;z-index:1030;display:block;visibility:visible;padding:5px;font-size:11px;opacity:0;filter:alpha(opacity=0)}.tooltip.in{opacity:.8;filter:alpha(opacity=80)}.tooltip.top{margin-top:-3px}.tooltip.right{margin-left:3px}.tooltip.bottom{margin-top:3px}.tooltip.left{margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1010;display:none;width:236px;padding:1px;text-align:left;background-color:#fff;-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);white-space:normal}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{margin:0;padding:8px 14px;font-size:14px;font-weight:normal;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover .arrow,.popover .arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover .arrow{border-width:11px}.popover .arrow:after{border-width:10px;content:""}.popover.top .arrow{left:50%;margin-left:-11px;border-bottom-width:0;border-top-color:#999;border-top-color:rgba(0,0,0,0.25);bottom:-11px}.popover.top .arrow:after{bottom:1px;margin-left:-10px;border-bottom-width:0;border-top-color:#fff}.popover.right .arrow{top:50%;left:-11px;margin-top:-11px;border-left-width:0;border-right-color:#999;border-right-color:rgba(0,0,0,0.25)}.popover.right .arrow:after{left:1px;bottom:-10px;border-left-width:0;border-right-color:#fff}.popover.bottom .arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.popover.bottom .arrow:after{top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.popover.left .arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,0.25)}.popover.left .arrow:after{right:1px;border-right-width:0;border-left-color:#fff;bottom:-10px}.thumbnails{margin-left:-20px;list-style:none;*zoom:1}.thumbnails:before,.thumbnails:after{display:table;content:"";line-height:0}.thumbnails:after{clear:both}.row-fluid .thumbnails{margin-left:0}.thumbnails>li{float:left;margin-bottom:20px;margin-left:20px}.thumbnail{display:block;padding:4px;line-height:20px;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.055);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.055);box-shadow:0 1px 3px rgba(0,0,0,0.055);-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}a.thumbnail:hover{border-color:#c83025;-webkit-box-shadow:0 1px 4px rgba(0,105,214,0.25);-moz-box-shadow:0 1px 4px rgba(0,105,214,0.25);box-shadow:0 1px 4px rgba(0,105,214,0.25)}.thumbnail>img{display:block;max-width:100%;margin-left:auto;margin-right:auto}.thumbnail .caption{padding:9px;color:#555}.media,.media-body{overflow:hidden;*overflow:visible;zoom:1}.media,.media .media{margin-top:15px}.media:first-child{margin-top:0}.media-object{display:block}.media-heading{margin:0 0 5px}.media .pull-left{margin-right:10px}.media .pull-right{margin-left:10px}.media-list{margin-left:0;list-style:none}.label,.badge{display:inline-block;padding:2px 4px;font-size:11.844px;font-weight:bold;line-height:14px;color:#fff;vertical-align:baseline;white-space:nowrap;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#999}.label{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.badge{padding-left:9px;padding-right:9px;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px}.label:empty,.badge:empty{display:none}a.label:hover,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.label-important,.badge-important{background-color:#b94a48}.label-important[href],.badge-important[href]{background-color:#953b39}.label-warning,.badge-warning{background-color:#f89406}.label-warning[href],.badge-warning[href]{background-color:#c67605}.label-success,.badge-success{background-color:#468847}.label-success[href],.badge-success[href]{background-color:#356635}.label-info,.badge-info{background-color:#3a87ad}.label-info[href],.badge-info[href]{background-color:#2d6987}.label-inverse,.badge-inverse{background-color:#333}.label-inverse[href],.badge-inverse[href]{background-color:#1a1a1a}.btn .label,.btn .badge{position:relative;top:-1px}.btn-mini .label,.btn-mini .badge{top:0}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-moz-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-ms-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:0 0}to{background-position:40px 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{overflow:hidden;height:20px;margin-bottom:20px;background-color:#f7f7f7;background-image:-moz-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f5f5f5),to(#f9f9f9));background-image:-webkit-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-o-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:linear-gradient(to bottom,#f5f5f5,#f9f9f9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5',endColorstr='#fff9f9f9',GradientType=0);-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.progress .bar{width:0;height:100%;color:#fff;float:left;font-size:12px;text-align:center;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e90d2;background-image:-moz-linear-gradient(top,#149bdf,#0480be);background-image:-webkit-gradient(linear,0 0,0 100%,from(#149bdf),to(#0480be));background-image:-webkit-linear-gradient(top,#149bdf,#0480be);background-image:-o-linear-gradient(top,#149bdf,#0480be);background-image:linear-gradient(to bottom,#149bdf,#0480be);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf',endColorstr='#ff0480be',GradientType=0);-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width .6s ease;-moz-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress .bar+.bar{-webkit-box-shadow:inset 1px 0 0 rgba(0,0,0,.15),inset 0 -1px 0 rgba(0,0,0,.15);-moz-box-shadow:inset 1px 0 0 rgba(0,0,0,.15),inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 1px 0 0 rgba(0,0,0,.15),inset 0 -1px 0 rgba(0,0,0,.15)}.progress-striped .bar{background-color:#149bdf;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;-moz-background-size:40px 40px;-o-background-size:40px 40px;background-size:40px 40px}.progress.active .bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-moz-animation:progress-bar-stripes 2s linear infinite;-ms-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-danger .bar,.progress .bar-danger{background-color:#dd514c;background-image:-moz-linear-gradient(top,#ee5f5b,#c43c35);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#c43c35));background-image:-webkit-linear-gradient(top,#ee5f5b,#c43c35);background-image:-o-linear-gradient(top,#ee5f5b,#c43c35);background-image:linear-gradient(to bottom,#ee5f5b,#c43c35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffc43c35',GradientType=0)}.progress-danger.progress-striped .bar,.progress-striped .bar-danger{background-color:#ee5f5b;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-success .bar,.progress .bar-success{background-color:#5eb95e;background-image:-moz-linear-gradient(top,#62c462,#57a957);background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#57a957));background-image:-webkit-linear-gradient(top,#62c462,#57a957);background-image:-o-linear-gradient(top,#62c462,#57a957);background-image:linear-gradient(to bottom,#62c462,#57a957);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff57a957',GradientType=0)}.progress-success.progress-striped .bar,.progress-striped .bar-success{background-color:#62c462;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-info .bar,.progress .bar-info{background-color:#4bb1cf;background-image:-moz-linear-gradient(top,#5bc0de,#339bb9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#339bb9));background-image:-webkit-linear-gradient(top,#5bc0de,#339bb9);background-image:-o-linear-gradient(top,#5bc0de,#339bb9);background-image:linear-gradient(to bottom,#5bc0de,#339bb9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff339bb9',GradientType=0)}.progress-info.progress-striped .bar,.progress-striped .bar-info{background-color:#5bc0de;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-warning .bar,.progress .bar-warning{background-color:#faa732;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0)}.progress-warning.progress-striped .bar,.progress-striped .bar-warning{background-color:#fbb450;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.accordion{margin-bottom:20px}.accordion-group{margin-bottom:2px;border:1px solid #e5e5e5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.accordion-heading{border-bottom:0}.accordion-heading .accordion-toggle{display:block;padding:8px 15px}.accordion-toggle{cursor:pointer}.accordion-inner{padding:9px 15px;border-top:1px solid #e5e5e5}.carousel{position:relative;margin-bottom:20px;line-height:1}.carousel-inner{overflow:hidden;width:100%;position:relative}.carousel-inner>.item{display:none;position:relative;-webkit-transition:.6s ease-in-out left;-moz-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img{display:block;line-height:1}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:40%;left:15px;width:40px;height:40px;margin-top:-20px;font-size:60px;font-weight:100;line-height:30px;color:#fff;text-align:center;background:#222;border:3px solid #fff;-webkit-border-radius:23px;-moz-border-radius:23px;border-radius:23px;opacity:.5;filter:alpha(opacity=50)}.carousel-control.right{left:auto;right:15px}.carousel-control:hover{color:#fff;text-decoration:none;opacity:.9;filter:alpha(opacity=90)}.carousel-caption{position:absolute;left:0;right:0;bottom:0;padding:15px;background:#333;background:rgba(0,0,0,0.75)}.carousel-caption h4,.carousel-caption p{color:#fff;line-height:20px}.carousel-caption h4{margin:0 0 5px}.carousel-caption p{margin-bottom:0}.hero-unit{padding:60px;margin-bottom:30px;font-size:18px;font-weight:200;line-height:30px;color:inherit;background-color:#eee;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.hero-unit h1{margin-bottom:0;font-size:60px;line-height:1;color:inherit;letter-spacing:-1px}.hero-unit li{line-height:30px}.pull-right{float:right}.pull-left{float:left}.hide{display:none}.show{display:block}.invisible{visibility:hidden}.affix{position:fixed}@font-face{font-family:'museo-slab';src:url('../font/museo_slab_300-webfont.eot');src:url('../font/museo_slab_300-webfont.eot?#iefix') format('embedded-opentype'),url('../font/museo_slab_300-webfont.ttf') format('truetype');font-weight:normal;font-style:normal}@font-face{font-family:'museo-slab';src:url('../font/museo_slab_500-webfont.eot');src:url('../font/museo_slab_500-webfont.eot?#iefix') format('embedded-opentype'),url('../font/museo_slab_500-webfont.ttf') format('truetype');font-weight:bold;font-style:normal}@font-face{font-family:'proxima-nova';src:url('../font/proximanova-webfont.eot');src:url('../font/proximanova-webfont.eot?#iefix') format('embedded-opentype'),url('../font/proximanova-webfont.ttf') format('truetype');font-weight:normal;font-style:normal}@font-face{font-family:'proxima-nova';src:url('../font/proximanova-sbold-webfont.eot');src:url('../font/proximanova-sbold-webfont.eot?#iefix') format('embedded-opentype'),url('../font/proximanova-sbold-webfont.ttf') format('truetype');font-weight:bold;font-style:normal}.text-align-right{text-align:right}.text-align-center{text-align:center}.navbar .brand{color:#fff;font-family:museo-slab,"Helvetica Neue",Helvetica,Arial,sans-serif}.navbar .brand .icon-flag{padding-right:3px}.navbar .nav>li>a{padding:12px 10px 9px}h1,h2,h3,h4,h5,h6{font-family:museo-slab,"Helvetica Neue",Helvetica,Arial,sans-serif}#iconCarousel{font-size:280px;text-align:center;line-height:285px;text-shadow:2px 2px 3px #222}#iconCarousel a{color:#fff}#iconCarousel .carousel-control{top:313px;width:23px;height:23px;border-width:3px;font-size:17px;line-height:25px;left:117px}#iconCarousel .carousel-control.right{left:auto;right:117px}.jumbotron{background:#9d261d;border-bottom:1px solid #721c15;padding:90px 0 48px;text-shadow:2px 2px 2px #333}.jumbotron,.jumbotron h1{color:#fff}.jumbotron h1{font-size:80px;letter-spacing:-2px;line-height:1}.jumbotron p{margin-top:15px;margin-bottom:30px;font-size:30px;line-height:1.3}.jumbotron ul{margin-left:50px}.jumbotron ul li{font-size:15px;line-height:30px;text-shadow:1px 1px 1px #333}.jumbotron ul li.icon-large:before{text-indent:-2em;vertical-align:baseline}.jumbotron .btn-large{font-family:museo-slab,"Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:bold;font-size:18px;padding:13px 23px 13px 22px;margin-right:10px;text-align:left}.jumbotron .hero-content{text-align:center}.jumbotron .shameless-self-promotion{font-size:12px;margin-top:15px;color:#ce938e;text-shadow:none}.btn-github{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#e7e7e7;background-image:-moz-linear-gradient(top,#fff,#c4c4c4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#c4c4c4));background-image:-webkit-linear-gradient(top,#fff,#c4c4c4);background-image:-o-linear-gradient(top,#fff,#c4c4c4);background-image:linear-gradient(to bottom,#fff,#c4c4c4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffc4c4c4',GradientType=0);border-color:#c4c4c4 #c4c4c4 #9d9d9d;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#c4c4c4;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}.btn-github:hover,.btn-github:active,.btn-github.active,.btn-github.disabled,.btn-github[disabled]{color:#fff;background-color:#c4c4c4;*background-color:#b7b7b7}.btn-github:active,.btn-github.active{background-color:#aaa \9}.btn-primary,.btn-github{color:#333;text-shadow:0 -1px 0 rgba(255,255,255,0.25)}.btn-primary:hover,.btn-github:hover{text-shadow:0 -1px 0 rgba(255,255,255,0.25);color:#333}section{padding-top:40px}#social-buttons{padding:22px 0;text-align:center;background-color:#f5f5f5;border-top:1px solid #fff;border-bottom:1px solid #ddd}#social-buttons .btn{font-weight:bold;padding:0 5px;line-height:17px}#social-buttons .count.btn{background:#fff;font-weight:normal}#social-buttons .watch,#social-buttons .fork{margin-right:30px}.the-icons{list-style-type:none;margin:0}.the-icons li{cursor:pointer;line-height:32px;height:32px;padding-left:12px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.the-icons li [class^="icon-"],.the-icons li [class*=" icon-"]{width:32px;font-size:14px}.the-icons li:hover{background-color:#fbf4f4}.the-icons li:hover [class^="icon-"],.the-icons li:hover [class*=" icon-"]{*font-size:28px;*vertical-align:middle}.the-icons li:hover [class^="icon-"]:before,.the-icons li:hover [class*=" icon-"]:before{font-size:28px;vertical-align:-5px}#why .row,#whats-new .row{margin-bottom:20px}#why h4 [class^="icon-"],#whats-new h4 [class^="icon-"],#why h4 [class*=" icon-"],#whats-new h4 [class*=" icon-"]{vertical-align:-10%;font-size:28px;margin-right:5px}#examples .btn-toolbar{margin-top:0;margin-bottom:20px}#integration .row{margin-bottom:40px}#examples form,#code form{margin-bottom:25px}#examples form input,#code form input{line-height:1}#examples .rating,#code .rating{unicode-bidi:bidi-override;direction:rtl;font-size:30px}#examples .rating span.star,#code .rating span.star{font-family:FontAwesome;font-weight:normal;font-style:normal;display:inline-block}#examples .rating span.star:hover,#code .rating span.star:hover{cursor:pointer}#examples .rating span.star:before,#code .rating span.star:before{content:"\f006";padding-right:5px;color:#999}#examples .rating span.star:hover:before,#code .rating span.star:hover:before,#examples .rating span.star:hover ~ span.star:before,#code .rating span.star:hover ~ span.star:before{content:"\f005";color:#e3cf7a}#kyruus{color:#555;font-size:18px}#kyruus,#kyruus li{line-height:25px}#kyruus p{margin-bottom:22px}#kyruus p strong{color:#222}#kyruus ul{margin-top:5px;margin-bottom:22px}#kyruus ul li{margin-top:10px}#kyruus ul i{margin-top:5px;color:#007dbc}#kyruus .border{border:solid 10px #eee;padding:1em 1.5em;margin-left:.2em;-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px}#kyruus .border .icon-medkit{font-size:224px}#kyruus .border a:hover .icon-medkit{text-decoration:none}#kyruus a{font-weight:bold;color:#007dbc}#kyruus a:hover{color:#005f9b}.modal{width:560px;max-height:610px}.modal .modal-body{*overflow:hidden;max-height:none;padding-bottom:0}.modal .modal-body .row{margin-bottom:15px}.modal .modal-body div.thumbnail{text-align:center}.modal .modal-body div.thumbnail div{margin:8px}.modal .modal-body .icon6{width:330px}.modal .modal-body .icon6>div.thumbnail>div{line-height:308px;height:294px;text-align:center}.modal .modal-body .icon6>div.thumbnail>div i{font-size:280px}.modal .modal-body .icon5{width:180px}.modal .modal-body .icon5>div.thumbnail>div{line-height:154px;height:147px;text-align:center}.modal .modal-body .icon5>div.thumbnail>div i{font-size:140px}.modal .modal-body .icon4{width:215px}.modal .modal-body .icon4>div.thumbnail>div{line-height:123.20000000000002px;height:117.60000000000001px;text-align:center}.modal .modal-body .icon4>div.thumbnail>div i{font-size:112px}.modal .modal-body .icon3{width:120px}.modal .modal-body .icon3>div.thumbnail>div{line-height:61.60000000000001px;height:58.800000000000004px;text-align:center}.modal .modal-body .icon3>div.thumbnail>div i{font-size:56px}.modal .modal-body .icon2{width:75px}.modal .modal-body .icon2>div.thumbnail>div{line-height:30.800000000000004px;height:29.400000000000002px;text-align:center}.modal .modal-body .icon2>div.thumbnail>div i{font-size:28px}.modal .modal-body .icon1{width:60px}.modal .modal-body .icon1>div.thumbnail>div{line-height:15.400000000000002px;height:14.700000000000001px;text-align:center}.modal .modal-body .icon1>div.thumbnail>div i{font-size:14px}.label,.badge{background-color:#eee}.well.well-transparent{background-color:transparent}footer{background-color:#9d261d;border-top:1px solid #872119;color:#ddb3b0;text-shadow:0 -1px 0 rgba(0,0,0,0.25);margin-top:60px;padding-top:45px;padding-bottom:60px;*zoom:1}footer a{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}footer a:hover{color:#fff}footer ul{line-height:25px} \ No newline at end of file diff --git a/crm/src/main/webapp/FortAwesome/docs/assets/font/FontAwesome.otf b/crm/src/main/webapp/FortAwesome/docs/assets/font/FontAwesome.otf new file mode 100644 index 0000000..d13308e Binary files /dev/null and b/crm/src/main/webapp/FortAwesome/docs/assets/font/FontAwesome.otf differ diff --git a/crm/src/main/webapp/FortAwesome/docs/assets/font/fontawesome-webfont.eot b/crm/src/main/webapp/FortAwesome/docs/assets/font/fontawesome-webfont.eot new file mode 100644 index 0000000..7d81019 Binary files /dev/null and b/crm/src/main/webapp/FortAwesome/docs/assets/font/fontawesome-webfont.eot differ diff --git a/crm/src/main/webapp/FortAwesome/docs/assets/font/fontawesome-webfont.svg b/crm/src/main/webapp/FortAwesome/docs/assets/font/fontawesome-webfont.svg new file mode 100644 index 0000000..ba0afe5 --- /dev/null +++ b/crm/src/main/webapp/FortAwesome/docs/assets/font/fontawesome-webfont.svg @@ -0,0 +1,284 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/crm/src/main/webapp/FortAwesome/docs/assets/font/fontawesome-webfont.ttf b/crm/src/main/webapp/FortAwesome/docs/assets/font/fontawesome-webfont.ttf new file mode 100644 index 0000000..d461724 Binary files /dev/null and b/crm/src/main/webapp/FortAwesome/docs/assets/font/fontawesome-webfont.ttf differ diff --git a/crm/src/main/webapp/FortAwesome/docs/assets/font/fontawesome-webfont.woff b/crm/src/main/webapp/FortAwesome/docs/assets/font/fontawesome-webfont.woff new file mode 100644 index 0000000..3c89ae0 Binary files /dev/null and b/crm/src/main/webapp/FortAwesome/docs/assets/font/fontawesome-webfont.woff differ diff --git a/crm/src/main/webapp/FortAwesome/docs/assets/font/museo_slab_300-webfont.eot b/crm/src/main/webapp/FortAwesome/docs/assets/font/museo_slab_300-webfont.eot new file mode 100644 index 0000000..3324999 Binary files /dev/null and b/crm/src/main/webapp/FortAwesome/docs/assets/font/museo_slab_300-webfont.eot differ diff --git a/crm/src/main/webapp/FortAwesome/docs/assets/font/museo_slab_300-webfont.ttf b/crm/src/main/webapp/FortAwesome/docs/assets/font/museo_slab_300-webfont.ttf new file mode 100644 index 0000000..9248b9a Binary files /dev/null and b/crm/src/main/webapp/FortAwesome/docs/assets/font/museo_slab_300-webfont.ttf differ diff --git a/crm/src/main/webapp/FortAwesome/docs/assets/font/museo_slab_500-webfont.eot b/crm/src/main/webapp/FortAwesome/docs/assets/font/museo_slab_500-webfont.eot new file mode 100644 index 0000000..2eb7a89 Binary files /dev/null and b/crm/src/main/webapp/FortAwesome/docs/assets/font/museo_slab_500-webfont.eot differ diff --git a/crm/src/main/webapp/FortAwesome/docs/assets/font/museo_slab_500-webfont.ttf b/crm/src/main/webapp/FortAwesome/docs/assets/font/museo_slab_500-webfont.ttf new file mode 100644 index 0000000..bf78a2a Binary files /dev/null and b/crm/src/main/webapp/FortAwesome/docs/assets/font/museo_slab_500-webfont.ttf differ diff --git a/crm/src/main/webapp/FortAwesome/docs/assets/font/proximanova-sbold-webfont.eot b/crm/src/main/webapp/FortAwesome/docs/assets/font/proximanova-sbold-webfont.eot new file mode 100644 index 0000000..ecf0cb1 Binary files /dev/null and b/crm/src/main/webapp/FortAwesome/docs/assets/font/proximanova-sbold-webfont.eot differ diff --git a/crm/src/main/webapp/FortAwesome/docs/assets/font/proximanova-sbold-webfont.ttf b/crm/src/main/webapp/FortAwesome/docs/assets/font/proximanova-sbold-webfont.ttf new file mode 100644 index 0000000..564f1aa Binary files /dev/null and b/crm/src/main/webapp/FortAwesome/docs/assets/font/proximanova-sbold-webfont.ttf differ diff --git a/crm/src/main/webapp/FortAwesome/docs/assets/font/proximanova-webfont.eot b/crm/src/main/webapp/FortAwesome/docs/assets/font/proximanova-webfont.eot new file mode 100644 index 0000000..1f28b41 Binary files /dev/null and b/crm/src/main/webapp/FortAwesome/docs/assets/font/proximanova-webfont.eot differ diff --git a/crm/src/main/webapp/FortAwesome/docs/assets/font/proximanova-webfont.ttf b/crm/src/main/webapp/FortAwesome/docs/assets/font/proximanova-webfont.ttf new file mode 100644 index 0000000..e9aa413 Binary files /dev/null and b/crm/src/main/webapp/FortAwesome/docs/assets/font/proximanova-webfont.ttf differ diff --git a/crm/src/main/webapp/FortAwesome/docs/assets/ico/favicon.ico b/crm/src/main/webapp/FortAwesome/docs/assets/ico/favicon.ico new file mode 100644 index 0000000..742243e Binary files /dev/null and b/crm/src/main/webapp/FortAwesome/docs/assets/ico/favicon.ico differ diff --git a/crm/src/main/webapp/FortAwesome/docs/assets/img/contribution-sample.png b/crm/src/main/webapp/FortAwesome/docs/assets/img/contribution-sample.png new file mode 100644 index 0000000..fe7647f Binary files /dev/null and b/crm/src/main/webapp/FortAwesome/docs/assets/img/contribution-sample.png differ diff --git a/crm/src/main/webapp/FortAwesome/docs/assets/img/fort_awesome.jpg b/crm/src/main/webapp/FortAwesome/docs/assets/img/fort_awesome.jpg new file mode 100644 index 0000000..3542fae Binary files /dev/null and b/crm/src/main/webapp/FortAwesome/docs/assets/img/fort_awesome.jpg differ diff --git a/crm/src/main/webapp/FortAwesome/docs/assets/img/glyphicons-halflings-white.png b/crm/src/main/webapp/FortAwesome/docs/assets/img/glyphicons-halflings-white.png new file mode 100644 index 0000000..3bf6484 Binary files /dev/null and b/crm/src/main/webapp/FortAwesome/docs/assets/img/glyphicons-halflings-white.png differ diff --git a/crm/src/main/webapp/FortAwesome/docs/assets/img/glyphicons-halflings.png b/crm/src/main/webapp/FortAwesome/docs/assets/img/glyphicons-halflings.png new file mode 100644 index 0000000..a996999 Binary files /dev/null and b/crm/src/main/webapp/FortAwesome/docs/assets/img/glyphicons-halflings.png differ diff --git a/crm/src/main/webapp/FortAwesome/docs/assets/img/icon-flag.pdf b/crm/src/main/webapp/FortAwesome/docs/assets/img/icon-flag.pdf new file mode 100644 index 0000000..1c8913d Binary files /dev/null and b/crm/src/main/webapp/FortAwesome/docs/assets/img/icon-flag.pdf differ diff --git a/crm/src/main/webapp/FortAwesome/docs/assets/js/backbone.min.js b/crm/src/main/webapp/FortAwesome/docs/assets/js/backbone.min.js new file mode 100644 index 0000000..5846b32 --- /dev/null +++ b/crm/src/main/webapp/FortAwesome/docs/assets/js/backbone.min.js @@ -0,0 +1,37 @@ +// Backbone.js 0.9.1 + +// (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc. +// Backbone may be freely distributed under the MIT license. +// For all details and documentation: +// http://backbonejs.org +(function(){var i=this,r=i.Backbone,s=Array.prototype.slice,t=Array.prototype.splice,g;g="undefined"!==typeof exports?exports:i.Backbone={};g.VERSION="0.9.1";var f=i._;!f&&"undefined"!==typeof require&&(f=require("underscore"));var h=i.jQuery||i.Zepto||i.ender;g.setDomLibrary=function(a){h=a};g.noConflict=function(){i.Backbone=r;return this};g.emulateHTTP=!1;g.emulateJSON=!1;g.Events={on:function(a,b,c){for(var d,a=a.split(/\s+/),e=this._callbacks||(this._callbacks={});d=a.shift();){d=e[d]||(e[d]= +{});var f=d.tail||(d.tail=d.next={});f.callback=b;f.context=c;d.tail=f.next={}}return this},off:function(a,b,c){var d,e,f;if(a){if(e=this._callbacks)for(a=a.split(/\s+/);d=a.shift();)if(f=e[d],delete e[d],b&&f)for(;(f=f.next)&&f.next;)if(!(f.callback===b&&(!c||f.context===c)))this.on(d,f.callback,f.context)}else delete this._callbacks;return this},trigger:function(a){var b,c,d,e;if(!(d=this._callbacks))return this;e=d.all;for((a=a.split(/\s+/)).push(null);b=a.shift();)e&&a.push({next:e.next,tail:e.tail, +event:b}),(c=d[b])&&a.push({next:c.next,tail:c.tail});for(e=s.call(arguments,1);c=a.pop();){b=c.tail;for(d=c.event?[c.event].concat(e):e;(c=c.next)!==b;)c.callback.apply(c.context||this,d)}return this}};g.Events.bind=g.Events.on;g.Events.unbind=g.Events.off;g.Model=function(a,b){var c;a||(a={});b&&b.parse&&(a=this.parse(a));if(c=j(this,"defaults"))a=f.extend({},c,a);b&&b.collection&&(this.collection=b.collection);this.attributes={};this._escapedAttributes={};this.cid=f.uniqueId("c");if(!this.set(a, +{silent:!0}))throw Error("Can't create an invalid model");delete this._changed;this._previousAttributes=f.clone(this.attributes);this.initialize.apply(this,arguments)};f.extend(g.Model.prototype,g.Events,{idAttribute:"id",initialize:function(){},toJSON:function(){return f.clone(this.attributes)},get:function(a){return this.attributes[a]},escape:function(a){var b;if(b=this._escapedAttributes[a])return b;b=this.attributes[a];return this._escapedAttributes[a]=f.escape(null==b?"":""+b)},has:function(a){return null!= +this.attributes[a]},set:function(a,b,c){var d,e;f.isObject(a)||null==a?(d=a,c=b):(d={},d[a]=b);c||(c={});if(!d)return this;d instanceof g.Model&&(d=d.attributes);if(c.unset)for(e in d)d[e]=void 0;if(!this._validate(d,c))return!1;this.idAttribute in d&&(this.id=d[this.idAttribute]);var b=this.attributes,k=this._escapedAttributes,n=this._previousAttributes||{},h=this._setting;this._changed||(this._changed={});this._setting=!0;for(e in d)if(a=d[e],f.isEqual(b[e],a)||delete k[e],c.unset?delete b[e]:b[e]= +a,this._changing&&!f.isEqual(this._changed[e],a)&&(this.trigger("change:"+e,this,a,c),this._moreChanges=!0),delete this._changed[e],!f.isEqual(n[e],a)||f.has(b,e)!=f.has(n,e))this._changed[e]=a;h||(!c.silent&&this.hasChanged()&&this.change(c),this._setting=!1);return this},unset:function(a,b){(b||(b={})).unset=!0;return this.set(a,null,b)},clear:function(a){(a||(a={})).unset=!0;return this.set(f.clone(this.attributes),a)},fetch:function(a){var a=a?f.clone(a):{},b=this,c=a.success;a.success=function(d, +e,f){if(!b.set(b.parse(d,f),a))return!1;c&&c(b,d)};a.error=g.wrapError(a.error,b,a);return(this.sync||g.sync).call(this,"read",this,a)},save:function(a,b,c){var d,e;f.isObject(a)||null==a?(d=a,c=b):(d={},d[a]=b);c=c?f.clone(c):{};c.wait&&(e=f.clone(this.attributes));a=f.extend({},c,{silent:!0});if(d&&!this.set(d,c.wait?a:c))return!1;var k=this,h=c.success;c.success=function(a,b,e){b=k.parse(a,e);c.wait&&(b=f.extend(d||{},b));if(!k.set(b,c))return!1;h?h(k,a):k.trigger("sync",k,a,c)};c.error=g.wrapError(c.error, +k,c);b=this.isNew()?"create":"update";b=(this.sync||g.sync).call(this,b,this,c);c.wait&&this.set(e,a);return b},destroy:function(a){var a=a?f.clone(a):{},b=this,c=a.success,d=function(){b.trigger("destroy",b,b.collection,a)};if(this.isNew())return d();a.success=function(e){a.wait&&d();c?c(b,e):b.trigger("sync",b,e,a)};a.error=g.wrapError(a.error,b,a);var e=(this.sync||g.sync).call(this,"delete",this,a);a.wait||d();return e},url:function(){var a=j(this.collection,"url")||j(this,"urlRoot")||o();return this.isNew()? +a:a+("/"==a.charAt(a.length-1)?"":"/")+encodeURIComponent(this.id)},parse:function(a){return a},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return null==this.id},change:function(a){if(this._changing||!this.hasChanged())return this;this._moreChanges=this._changing=!0;for(var b in this._changed)this.trigger("change:"+b,this,this._changed[b],a);for(;this._moreChanges;)this._moreChanges=!1,this.trigger("change",this,a);this._previousAttributes=f.clone(this.attributes); +delete this._changed;this._changing=!1;return this},hasChanged:function(a){return!arguments.length?!f.isEmpty(this._changed):this._changed&&f.has(this._changed,a)},changedAttributes:function(a){if(!a)return this.hasChanged()?f.clone(this._changed):!1;var b,c=!1,d=this._previousAttributes,e;for(e in a)if(!f.isEqual(d[e],b=a[e]))(c||(c={}))[e]=b;return c},previous:function(a){return!arguments.length||!this._previousAttributes?null:this._previousAttributes[a]},previousAttributes:function(){return f.clone(this._previousAttributes)}, +isValid:function(){return!this.validate(this.attributes)},_validate:function(a,b){if(b.silent||!this.validate)return!0;var a=f.extend({},this.attributes,a),c=this.validate(a,b);if(!c)return!0;b&&b.error?b.error(this,c,b):this.trigger("error",this,c,b);return!1}});g.Collection=function(a,b){b||(b={});b.comparator&&(this.comparator=b.comparator);this._reset();this.initialize.apply(this,arguments);a&&this.reset(a,{silent:!0,parse:b.parse})};f.extend(g.Collection.prototype,g.Events,{model:g.Model,initialize:function(){}, +toJSON:function(){return this.map(function(a){return a.toJSON()})},add:function(a,b){var c,d,e,g,h,i={},j={};b||(b={});a=f.isArray(a)?a.slice():[a];for(c=0,d=a.length;c=b))this.iframe=h('':""),e._keyEvent=!1,B},_generateMonthYearHeader:function(e,t,n,r,i,s,o,u){var a=this._get(e,"changeMonth"),f=this._get(e,"changeYear"),l=this._get(e,"showMonthAfterYear"),c='
    ',h="";if(s||!a)h+=''+o[t]+"";else{var p=r&&r.getFullYear()==n,d=i&&i.getFullYear()==n;h+='"}l||(c+=h+(s||!a||!f?" ":""));if(!e.yearshtml){e.yearshtml="";if(s||!f)c+=''+n+"";else{var m=this._get(e,"yearRange").split(":"),g=(new Date).getFullYear(),y=function(e){var t=e.match(/c[+-].*/)?n+parseInt(e.substring(1),10):e.match(/[+-].*/)?g+parseInt(e,10):parseInt(e,10);return isNaN(t)?g:t},b=y(m[0]),w=Math.max(b,y(m[1]||""));b=r?Math.max(b,r.getFullYear()):b,w=i?Math.min(w,i.getFullYear()):w,e.yearshtml+='",c+=e.yearshtml,e.yearshtml=null}}return c+=this._get(e,"yearSuffix"),l&&(c+=(s||!a||!f?" ":"")+h),c+="
    ",c},_adjustInstDate:function(e,t,n){var r=e.drawYear+(n=="Y"?t:0),i=e.drawMonth+(n=="M"?t:0),s=Math.min(e.selectedDay,this._getDaysInMonth(r,i))+(n=="D"?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(r,i,s)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),(n=="M"||n=="Y")&&this._notifyChange(e)},_restrictMinMax:function(e,t){var n=this._getMinMaxDate(e,"min"),r=this._getMinMaxDate(e,"max"),i=n&&tr?r:i,i},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return t==null?[1,1]:typeof t=="number"?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return(new Date(e,t,1)).getDay()},_canAdjustMonth:function(e,t,n,r){var i=this._getNumberOfMonths(e),s=this._daylightSavingAdjust(new Date(n,r+(t<0?t:i[0]*i[1]),1));return t<0&&s.setDate(this._getDaysInMonth(s.getFullYear(),s.getMonth())),this._isInRange(e,s)},_isInRange:function(e,t){var n=this._getMinMaxDate(e,"min"),r=this._getMinMaxDate(e,"max");return(!n||t.getTime()>=n.getTime())&&(!r||t.getTime()<=r.getTime())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t=typeof t!="string"?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,n,r){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var i=t?typeof t=="object"?t:this._daylightSavingAdjust(new Date(r,n,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),i,this._getFormatConfig(e))}}),$.fn.datepicker=function(e){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find(document.body).append($.datepicker.dpDiv),$.datepicker.initialized=!0);var t=Array.prototype.slice.call(arguments,1);return typeof e!="string"||e!="isDisabled"&&e!="getDate"&&e!="widget"?e=="option"&&arguments.length==2&&typeof arguments[1]=="string"?$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this[0]].concat(t)):this.each(function(){typeof e=="string"?$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this].concat(t)):$.datepicker._attachDatepicker(this,e)}):$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this[0]].concat(t))},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.9.2",window["DP_jQuery_"+dpuuid]=$})(jQuery);(function(e,t){var n="ui-dialog ui-widget ui-widget-content ui-corner-all ",r={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},i={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};e.widget("ui.dialog",{version:"1.9.2",options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var n=e(this).css(t).offset().top;n<0&&e(this).css("top",t.top-n)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.oldPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.options.title=this.options.title||this.originalTitle;var t=this,r=this.options,i=r.title||" ",s,o,u,a,f;s=(this.uiDialog=e("
    ")).addClass(n+r.dialogClass).css({display:"none",outline:0,zIndex:r.zIndex}).attr("tabIndex",-1).keydown(function(n){r.closeOnEscape&&!n.isDefaultPrevented()&&n.keyCode&&n.keyCode===e.ui.keyCode.ESCAPE&&(t.close(n),n.preventDefault())}).mousedown(function(e){t.moveToTop(!1,e)}).appendTo("body"),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(s),o=(this.uiDialogTitlebar=e("
    ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").bind("mousedown",function(){s.focus()}).prependTo(s),u=e("").addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").click(function(e){e.preventDefault(),t.close(e)}).appendTo(o),(this.uiDialogTitlebarCloseText=e("")).addClass("ui-icon ui-icon-closethick").text(r.closeText).appendTo(u),a=e("").uniqueId().addClass("ui-dialog-title").html(i).prependTo(o),f=(this.uiDialogButtonPane=e("
    ")).addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),(this.uiButtonSet=e("
    ")).addClass("ui-dialog-buttonset").appendTo(f),s.attr({role:"dialog","aria-labelledby":a.attr("id")}),o.find("*").add(o).disableSelection(),this._hoverable(u),this._focusable(u),r.draggable&&e.fn.draggable&&this._makeDraggable(),r.resizable&&e.fn.resizable&&this._makeResizable(),this._createButtons(r.buttons),this._isOpen=!1,e.fn.bgiframe&&s.bgiframe(),this._on(s,{keydown:function(t){if(!r.modal||t.keyCode!==e.ui.keyCode.TAB)return;var n=e(":tabbable",s),i=n.filter(":first"),o=n.filter(":last");if(t.target===o[0]&&!t.shiftKey)return i.focus(1),!1;if(t.target===i[0]&&t.shiftKey)return o.focus(1),!1}})},_init:function(){this.options.autoOpen&&this.open()},_destroy:function(){var e,t=this.oldPosition;this.overlay&&this.overlay.destroy(),this.uiDialog.hide(),this.element.removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},close:function(t){var n=this,r,i;if(!this._isOpen)return;if(!1===this._trigger("beforeClose",t))return;return this._isOpen=!1,this.overlay&&this.overlay.destroy(),this.options.hide?this._hide(this.uiDialog,this.options.hide,function(){n._trigger("close",t)}):(this.uiDialog.hide(),this._trigger("close",t)),e.ui.dialog.overlay.resize(),this.options.modal&&(r=0,e(".ui-dialog").each(function(){this!==n.uiDialog[0]&&(i=e(this).css("z-index"),isNaN(i)||(r=Math.max(r,i)))}),e.ui.dialog.maxZ=r),this},isOpen:function(){return this._isOpen},moveToTop:function(t,n){var r=this.options,i;return r.modal&&!t||!r.stack&&!r.modal?this._trigger("focus",n):(r.zIndex>e.ui.dialog.maxZ&&(e.ui.dialog.maxZ=r.zIndex),this.overlay&&(e.ui.dialog.maxZ+=1,e.ui.dialog.overlay.maxZ=e.ui.dialog.maxZ,this.overlay.$el.css("z-index",e.ui.dialog.overlay.maxZ)),i={scrollTop:this.element.scrollTop(),scrollLeft:this.element.scrollLeft()},e.ui.dialog.maxZ+=1,this.uiDialog.css("z-index",e.ui.dialog.maxZ),this.element.attr(i),this._trigger("focus",n),this)},open:function(){if(this._isOpen)return;var t,n=this.options,r=this.uiDialog;return this._size(),this._position(n.position),r.show(n.show),this.overlay=n.modal?new e.ui.dialog.overlay(this):null,this.moveToTop(!0),t=this.element.find(":tabbable"),t.length||(t=this.uiDialogButtonPane.find(":tabbable"),t.length||(t=r)),t.eq(0).focus(),this._isOpen=!0,this._trigger("open"),this},_createButtons:function(t){var n=this,r=!1;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),typeof t=="object"&&t!==null&&e.each(t,function(){return!(r=!0)}),r?(e.each(t,function(t,r){var i,s;r=e.isFunction(r)?{click:r,text:t}:r,r=e.extend({type:"button"},r),s=r.click,r.click=function(){s.apply(n.element[0],arguments)},i=e("",r).appendTo(n.uiButtonSet),e.fn.button&&i.button()}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog)):this.uiDialog.removeClass("ui-dialog-buttons")},_makeDraggable:function(){function r(e){return{position:e.position,offset:e.offset}}var t=this,n=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(n,i){e(this).addClass("ui-dialog-dragging"),t._trigger("dragStart",n,r(i))},drag:function(e,n){t._trigger("drag",e,r(n))},stop:function(i,s){n.position=[s.position.left-t.document.scrollLeft(),s.position.top-t.document.scrollTop()],e(this).removeClass("ui-dialog-dragging"),t._trigger("dragStop",i,r(s)),e.ui.dialog.overlay.resize()}})},_makeResizable:function(n){function u(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}n=n===t?this.options.resizable:n;var r=this,i=this.options,s=this.uiDialog.css("position"),o=typeof n=="string"?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:i.maxWidth,maxHeight:i.maxHeight,minWidth:i.minWidth,minHeight:this._minHeight(),handles:o,start:function(t,n){e(this).addClass("ui-dialog-resizing"),r._trigger("resizeStart",t,u(n))},resize:function(e,t){r._trigger("resize",e,u(t))},stop:function(t,n){e(this).removeClass("ui-dialog-resizing"),i.height=e(this).height(),i.width=e(this).width(),r._trigger("resizeStop",t,u(n)),e.ui.dialog.overlay.resize()}}).css("position",s).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var e=this.options;return e.height==="auto"?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(t){var n=[],r=[0,0],i;if(t){if(typeof t=="string"||typeof t=="object"&&"0"in t)n=t.split?t.split(" "):[t[0],t[1]],n.length===1&&(n[1]=n[0]),e.each(["left","top"],function(e,t){+n[e]===n[e]&&(r[e]=n[e],n[e]=t)}),t={my:n[0]+(r[0]<0?r[0]:"+"+r[0])+" "+n[1]+(r[1]<0?r[1]:"+"+r[1]),at:n.join(" ")};t=e.extend({},e.ui.dialog.prototype.options.position,t)}else t=e.ui.dialog.prototype.options.position;i=this.uiDialog.is(":visible"),i||this.uiDialog.show(),this.uiDialog.position(t),i||this.uiDialog.hide()},_setOptions:function(t){var n=this,s={},o=!1;e.each(t,function(e,t){n._setOption(e,t),e in r&&(o=!0),e in i&&(s[e]=t)}),o&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",s)},_setOption:function(t,r){var i,s,o=this.uiDialog;switch(t){case"buttons":this._createButtons(r);break;case"closeText":this.uiDialogTitlebarCloseText.text(""+r);break;case"dialogClass":o.removeClass(this.options.dialogClass).addClass(n+r);break;case"disabled":r?o.addClass("ui-dialog-disabled"):o.removeClass("ui-dialog-disabled");break;case"draggable":i=o.is(":data(draggable)"),i&&!r&&o.draggable("destroy"),!i&&r&&this._makeDraggable();break;case"position":this._position(r);break;case"resizable":s=o.is(":data(resizable)"),s&&!r&&o.resizable("destroy"),s&&typeof r=="string"&&o.resizable("option","handles",r),!s&&r!==!1&&this._makeResizable(r);break;case"title":e(".ui-dialog-title",this.uiDialogTitlebar).html(""+(r||" "))}this._super(t,r)},_size:function(){var t,n,r,i=this.options,s=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),i.minWidth>i.width&&(i.width=i.minWidth),t=this.uiDialog.css({height:"auto",width:i.width}).outerHeight(),n=Math.max(0,i.minHeight-t),i.height==="auto"?e.support.minHeight?this.element.css({minHeight:n,height:"auto"}):(this.uiDialog.show(),r=this.element.css("height","auto").height(),s||this.uiDialog.hide(),this.element.height(Math.max(r,n))):this.element.height(Math.max(i.height-t,0)),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),e.extend(e.ui.dialog,{uuid:0,maxZ:0,getTitleId:function(e){var t=e.attr("id");return t||(this.uuid+=1,t=this.uuid),"ui-dialog-title-"+t},overlay:function(t){this.$el=e.ui.dialog.overlay.create(t)}}),e.extend(e.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:e.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(e){return e+".dialog-overlay"}).join(" "),create:function(t){this.instances.length===0&&(setTimeout(function(){e.ui.dialog.overlay.instances.length&&e(document).bind(e.ui.dialog.overlay.events,function(t){if(e(t.target).zIndex()").addClass("ui-widget-overlay");return e(document).bind("keydown.dialog-overlay",function(r){var i=e.ui.dialog.overlay.instances;i.length!==0&&i[i.length-1]===n&&t.options.closeOnEscape&&!r.isDefaultPrevented()&&r.keyCode&&r.keyCode===e.ui.keyCode.ESCAPE&&(t.close(r),r.preventDefault())}),n.appendTo(document.body).css({width:this.width(),height:this.height()}),e.fn.bgiframe&&n.bgiframe(),this.instances.push(n),n},destroy:function(t){var n=e.inArray(t,this.instances),r=0;n!==-1&&this.oldInstances.push(this.instances.splice(n,1)[0]),this.instances.length===0&&e([document,window]).unbind(".dialog-overlay"),t.height(0).width(0).remove(),e.each(this.instances,function(){r=Math.max(r,this.css("z-index"))}),this.maxZ=r},height:function(){var t,n;return e.ui.ie?(t=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),n=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight),t",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,e.proxy(function(e){this.options.disabled&&e.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(e){e.preventDefault()},"click .ui-state-disabled > a":function(e){e.preventDefault()},"click .ui-menu-item:has(a)":function(t){var r=e(t.target).closest(".ui-menu-item");!n&&r.not(".ui-state-disabled").length&&(n=!0,this.select(t),r.has(".ui-menu").length?this.expand(t):this.element.is(":focus")||(this.element.trigger("focus",[!0]),this.active&&this.active.parents(".ui-menu").length===1&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){var n=e(t.currentTarget);n.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(t,n)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var n=this.active||this.element.children(".ui-menu-item").eq(0);t||this.focus(e,n)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){e(t.target).closest(".ui-menu").length||this.collapseAll(t),n=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").andSelf().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){function a(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var n,r,i,s,o,u=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:u=!1,r=this.previousFilter||"",i=String.fromCharCode(t.keyCode),s=!1,clearTimeout(this.filterTimer),i===r?s=!0:i=r+i,o=new RegExp("^"+a(i),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return o.test(e(this).children("a").text())}),n=s&&n.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):n,n.length||(i=String.fromCharCode(t.keyCode),o=new RegExp("^"+a(i),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return o.test(e(this).children("a").text())})),n.length?(this.focus(t,n),n.length>1?(this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}u&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(e):this.select(e))},refresh:function(){var t,n=this.options.icons.submenu,r=this.element.find(this.options.menus);r.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),r=t.prev("a"),i=e("").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);r.attr("aria-haspopup","true").prepend(i),t.attr("aria-labelledby",r.attr("id"))}),t=r.add(this.element),t.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),t.children(":not(.ui-menu-item)").each(function(){var t=e(this);/[^\-—–\s]/.test(t.text())||t.addClass("ui-widget-content ui-menu-divider")}),t.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},focus:function(e,t){var n,r;this.blur(e,e&&e.type==="focus"),this._scrollIntoView(t),this.active=t.first(),r=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",r.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),e&&e.type==="keydown"?this._close():this.timer=this._delay(function(){this._close()},this.delay),n=t.children(".ui-menu"),n.length&&/^mouse/.test(e.type)&&this._startOpening(n),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var n,r,i,s,o,u;this._hasScroll()&&(n=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,r=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,i=t.offset().top-this.activeMenu.offset().top-n-r,s=this.activeMenu.scrollTop(),o=this.activeMenu.height(),u=t.height(),i<0?this.activeMenu.scrollTop(s+i):i+u>o&&this.activeMenu.scrollTop(s+i-o+u))},blur:function(e,t){t||clearTimeout(this.timer);if(!this.active)return;this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active})},_startOpening:function(e){clearTimeout(this.timer);if(e.attr("aria-hidden")!=="true")return;this.timer=this._delay(function(){this._close(),this._open(e)},this.delay)},_open:function(t){var n=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(n)},collapseAll:function(t,n){clearTimeout(this.timer),this.timer=this._delay(function(){var r=n?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));r.length||(r=this.element),this._close(r),this.blur(t),this.activeMenu=r},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,n){var r;this.active&&(e==="first"||e==="last"?r=this.active[e==="first"?"prevAll":"nextAll"](".ui-menu-item").eq(-1):r=this.active[e+"All"](".ui-menu-item").eq(0));if(!r||!r.length||!this.active)r=this.activeMenu.children(".ui-menu-item")[t]();this.focus(n,r)},nextPage:function(t){var n,r,i;if(!this.active){this.next(t);return}if(this.isLastItem())return;this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return n=e(this),n.offset().top-r-i<0}),this.focus(t,n)):this.focus(t,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())},previousPage:function(t){var n,r,i;if(!this.active){this.next(t);return}if(this.isFirstItem())return;this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return n=e(this),n.offset().top-r+i>0}),this.focus(t,n)):this.focus(t,this.activeMenu.children(".ui-menu-item").first())},_hasScroll:function(){return this.element.outerHeight()
    ").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(e){return e===t?this._value():(this._setOption("value",e),this)},_setOption:function(e,t){e==="value"&&(this.options.value=t,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),this._super(e,t)},_value:function(){var e=this.options.value;return typeof e!="number"&&(e=0),Math.min(this.options.max,Math.max(this.min,e))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var e=this.value(),t=this._percentage();this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),this.valueDiv.toggle(e>this.min).toggleClass("ui-corner-right",e===this.options.max).width(t.toFixed(0)+"%"),this.element.attr("aria-valuenow",e)}})})(jQuery);(function(e,t){var n=5;e.widget("ui.slider",e.ui.mouse,{version:"1.9.2",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var t,r,i=this.options,s=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),o="",u=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"+(i.disabled?" ui-slider-disabled ui-disabled":"")),this.range=e([]),i.range&&(i.range===!0&&(i.values||(i.values=[this._valueMin(),this._valueMin()]),i.values.length&&i.values.length!==2&&(i.values=[i.values[0],i.values[0]])),this.range=e("
    ").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(i.range==="min"||i.range==="max"?" ui-slider-range-"+i.range:""))),r=i.values&&i.values.length||1;for(t=s.length;tn&&(i=n,s=e(this),o=t)}),c.range===!0&&this.values(1)===c.min&&(o+=1,s=e(this.handles[o])),u=this._start(t,o),u===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,s.addClass("ui-state-active").focus(),a=s.offset(),f=!e(t.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=f?{left:0,top:0}:{left:t.pageX-a.left-s.width()/2,top:t.pageY-a.top-s.height()/2-(parseInt(s.css("borderTopWidth"),10)||0)-(parseInt(s.css("borderBottomWidth"),10)||0)+(parseInt(s.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,r),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},n=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,n),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,n,r,i,s;return this.orientation==="horizontal"?(t=this.elementSize.width,n=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,n=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),r=n/t,r>1&&(r=1),r<0&&(r=0),this.orientation==="vertical"&&(r=1-r),i=this._valueMax()-this._valueMin(),s=this._valueMin()+r*i,this._trimAlignValue(s)},_start:function(e,t){var n={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("start",e,n)},_slide:function(e,t,n){var r,i,s;this.options.values&&this.options.values.length?(r=this.values(t?0:1),this.options.values.length===2&&this.options.range===!0&&(t===0&&n>r||t===1&&n1){this.options.values[t]=this._trimAlignValue(n),this._refreshValue(),this._change(null,t);return}if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();r=this.options.values,i=arguments[0];for(s=0;s=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,n=(e-this._valueMin())%t,r=e-n;return Math.abs(n)*2>=t&&(r+=n>0?t:-t),parseFloat(r.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var t,n,r,i,s,o=this.options.range,u=this.options,a=this,f=this._animateOff?!1:u.animate,l={};this.options.values&&this.options.values.length?this.handles.each(function(r){n=(a.values(r)-a._valueMin())/(a._valueMax()-a._valueMin())*100,l[a.orientation==="horizontal"?"left":"bottom"]=n+"%",e(this).stop(1,1)[f?"animate":"css"](l,u.animate),a.options.range===!0&&(a.orientation==="horizontal"?(r===0&&a.range.stop(1,1)[f?"animate":"css"]({left:n+"%"},u.animate),r===1&&a.range[f?"animate":"css"]({width:n-t+"%"},{queue:!1,duration:u.animate})):(r===0&&a.range.stop(1,1)[f?"animate":"css"]({bottom:n+"%"},u.animate),r===1&&a.range[f?"animate":"css"]({height:n-t+"%"},{queue:!1,duration:u.animate}))),t=n}):(r=this.value(),i=this._valueMin(),s=this._valueMax(),n=s!==i?(r-i)/(s-i)*100:0,l[this.orientation==="horizontal"?"left":"bottom"]=n+"%",this.handle.stop(1,1)[f?"animate":"css"](l,u.animate),o==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[f?"animate":"css"]({width:n+"%"},u.animate),o==="max"&&this.orientation==="horizontal"&&this.range[f?"animate":"css"]({width:100-n+"%"},{queue:!1,duration:u.animate}),o==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[f?"animate":"css"]({height:n+"%"},u.animate),o==="max"&&this.orientation==="vertical"&&this.range[f?"animate":"css"]({height:100-n+"%"},{queue:!1,duration:u.animate}))}})})(jQuery);(function(e){function t(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.widget("ui.spinner",{version:"1.9.2",defaultElement:"",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t={},n=this.element;return e.each(["min","max","step"],function(e,r){var i=n.attr(r);i!==undefined&&i.length&&(t[r]=i)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){if(this.cancelBlur){delete this.cancelBlur;return}this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e)},mousewheel:function(e,t){if(!t)return;if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()},"mousedown .ui-spinner-button":function(t){function r(){var e=this.element[0]===this.document[0].activeElement;e||(this.element.focus(),this.previous=n,this._delay(function(){this.previous=n}))}var n;n=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),t.preventDefault(),r.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,r.call(this)});if(this._start(t)===!1)return;this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){if(!e(t.currentTarget).hasClass("ui-state-active"))return;if(this._start(t)===!1)return!1;this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var e=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=e.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(e.height()*.5)&&e.height()>0&&e.height(e.height()),this.options.disabled&&this.disable()},_keydown:function(t){var n=this.options,r=e.ui.keyCode;switch(t.keyCode){case r.UP:return this._repeat(null,1,t),!0;case r.DOWN:return this._repeat(null,-1,t),!0;case r.PAGE_UP:return this._repeat(null,n.page,t),!0;case r.PAGE_DOWN:return this._repeat(null,-n.page,t),!0}return!1},_uiSpinnerHtml:function(){return""},_buttonHtml:function(){return""+""+""+""+""},_start:function(e){return!this.spinning&&this._trigger("start",e)===!1?!1:(this.counter||(this.counter=1),this.spinning=!0,!0)},_repeat:function(e,t,n){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,n)},e),this._spin(t*this.options.step,n)},_spin:function(e,t){var n=this.value()||0;this.counter||(this.counter=1),n=this._adjustValue(n+e*this._increment(this.counter));if(!this.spinning||this._trigger("spin",t,{value:n})!==!1)this._value(n),this.counter++},_increment:function(t){var n=this.options.incremental;return n?e.isFunction(n)?n(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return this.options.min!==null&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=e.toString(),n=t.indexOf(".");return n===-1?0:t.length-n-1},_adjustValue:function(e){var t,n,r=this.options;return t=r.min!==null?r.min:0,n=e-t,n=Math.round(n/r.step)*r.step,e=t+n,e=parseFloat(e.toFixed(this._precision())),r.max!==null&&e>r.max?r.max:r.min!==null&&e1&&e.href.replace(r,"")===location.href.replace(r,"").replace(/\s/g,"%20")}var n=0,r=/#.*$/;e.widget("ui.tabs",{version:"1.9.2",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var t=this,n=this.options,r=n.active,i=location.hash.substring(1);this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",n.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs();if(r===null){i&&this.tabs.each(function(t,n){if(e(n).attr("aria-controls")===i)return r=t,!1}),r===null&&(r=this.tabs.index(this.tabs.filter(".ui-tabs-active")));if(r===null||r===-1)r=this.tabs.length?0:!1}r!==!1&&(r=this.tabs.index(this.tabs.eq(r)),r===-1&&(r=n.collapsible?!1:0)),n.active=r,!n.collapsible&&n.active===!1&&this.anchors.length&&(n.active=0),e.isArray(n.disabled)&&(n.disabled=e.unique(n.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.options.active!==!1&&this.anchors.length?this.active=this._findActive(this.options.active):this.active=e(),this._refresh(),this.active.length&&this.load(n.active)},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var n=e(this.document[0].activeElement).closest("li"),r=this.tabs.index(n),i=!0;if(this._handlePageNav(t))return;switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:r++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:i=!1,r--;break;case e.ui.keyCode.END:r=this.anchors.length-1;break;case e.ui.keyCode.HOME:r=0;break;case e.ui.keyCode.SPACE:t.preventDefault(),clearTimeout(this.activating),this._activate(r);return;case e.ui.keyCode.ENTER:t.preventDefault(),clearTimeout(this.activating),this._activate(r===this.options.active?!1:r);return;default:return}t.preventDefault(),clearTimeout(this.activating),r=this._focusNextTab(r,i),t.ctrlKey||(n.attr("aria-selected","false"),this.tabs.eq(r).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",r)},this.delay))},_panelKeydown:function(t){if(this._handlePageNav(t))return;t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){if(t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP)return this._activate(this._focusNextTab(this.options.active-1,!1)),!0;if(t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN)return this._activate(this._focusNextTab(this.options.active+1,!0)),!0},_findNextTab:function(t,n){function i(){return t>r&&(t=0),t<0&&(t=r),t}var r=this.tabs.length-1;while(e.inArray(i(),this.options.disabled)!==-1)t=n?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){if(e==="active"){this._activate(t);return}if(e==="disabled"){this._setupDisabled(t);return}this._super(e,t),e==="collapsible"&&(this.element.toggleClass("ui-tabs-collapsible",t),!t&&this.options.active===!1&&this._activate(0)),e==="event"&&this._setupEvents(t),e==="heightStyle"&&this._setupHeightStyle(t)},_tabId:function(e){return e.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,n=this.tablist.children(":has(a[href])");t.disabled=e.map(n.filter(".ui-state-disabled"),function(e){return n.index(e)}),this._processTabs(),t.active===!1||!this.anchors.length?(t.active=!1,this.active=e()):this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return e("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(n,r){var i,o,u,a=e(r).uniqueId().attr("id"),f=e(r).closest("li"),l=f.attr("aria-controls");s(r)?(i=r.hash,o=t.element.find(t._sanitizeSelector(i))):(u=t._tabId(f),i="#"+u,o=t.element.find(i),o.length||(o=t._createPanel(u),o.insertAfter(t.panels[n-1]||t.tablist)),o.attr("aria-live","polite")),o.length&&(t.panels=t.panels.add(o)),l&&f.data("ui-tabs-aria-controls",l),f.attr({"aria-controls":i.substring(1),"aria-labelledby":a}),o.attr("aria-labelledby",a)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.element.find("ol,ul").eq(0)},_createPanel:function(t){return e("
    ").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var n=0,r;r=this.tabs[n];n++)t===!0||e.inArray(n,t)!==-1?e(r).addClass("ui-state-disabled").attr("aria-disabled","true"):e(r).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var n={click:function(e){e.preventDefault()}};t&&e.each(t.split(" "),function(e,t){n[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,n),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var n,r,i=this.element.parent();t==="fill"?(e.support.minHeight||(r=i.css("overflow"),i.css("overflow","hidden")),n=i.height(),this.element.siblings(":visible").each(function(){var t=e(this),r=t.css("position");if(r==="absolute"||r==="fixed")return;n-=t.outerHeight(!0)}),r&&i.css("overflow",r),this.element.children().not(this.panels).each(function(){n-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,n-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):t==="auto"&&(n=0,this.panels.each(function(){n=Math.max(n,e(this).height("").height())}).height(n))},_eventHandler:function(t){var n=this.options,r=this.active,i=e(t.currentTarget),s=i.closest("li"),o=s[0]===r[0],u=o&&n.collapsible,a=u?e():this._getPanelForTab(s),f=r.length?this._getPanelForTab(r):e(),l={oldTab:r,oldPanel:f,newTab:u?e():s,newPanel:a};t.preventDefault();if(s.hasClass("ui-state-disabled")||s.hasClass("ui-tabs-loading")||this.running||o&&!n.collapsible||this._trigger("beforeActivate",t,l)===!1)return;n.active=u?!1:this.tabs.index(s),this.active=o?e():s,this.xhr&&this.xhr.abort(),!f.length&&!a.length&&e.error("jQuery UI Tabs: Mismatching fragment identifier."),a.length&&this.load(this.tabs.index(s),t),this._toggle(t,l)},_toggle:function(t,n){function o(){r.running=!1,r._trigger("activate",t,n)}function u(){n.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),i.length&&r.options.show?r._show(i,r.options.show,o):(i.show(),o())}var r=this,i=n.newPanel,s=n.oldPanel;this.running=!0,s.length&&this.options.hide?this._hide(s,this.options.hide,function(){n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),u()}):(n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),s.hide(),u()),s.attr({"aria-expanded":"false","aria-hidden":"true"}),n.oldTab.attr("aria-selected","false"),i.length&&s.length?n.oldTab.attr("tabIndex",-1):i.length&&this.tabs.filter(function(){return e(this).attr("tabIndex")===0}).attr("tabIndex",-1),i.attr({"aria-expanded":"true","aria-hidden":"false"}),n.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(t){var n,r=this._findActive(t);if(r[0]===this.active[0])return;r.length||(r=this.active),n=r.find(".ui-tabs-anchor")[0],this._eventHandler({target:n,currentTarget:n,preventDefault:e.noop})},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return typeof e=="string"&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeData("href.tabs").removeData("load.tabs").removeUniqueId(),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var t=e(this),n=t.data("ui-tabs-aria-controls");n?t.attr("aria-controls",n):t.removeAttr("aria-controls")}),this.panels.show(),this.options.heightStyle!=="content"&&this.panels.css("height","")},enable:function(n){var r=this.options.disabled;if(r===!1)return;n===t?r=!1:(n=this._getIndex(n),e.isArray(r)?r=e.map(r,function(e){return e!==n?e:null}):r=e.map(this.tabs,function(e,t){return t!==n?t:null})),this._setupDisabled(r)},disable:function(n){var r=this.options.disabled;if(r===!0)return;if(n===t)r=!0;else{n=this._getIndex(n);if(e.inArray(n,r)!==-1)return;e.isArray(r)?r=e.merge([n],r).sort():r=[n]}this._setupDisabled(r)},load:function(t,n){t=this._getIndex(t);var r=this,i=this.tabs.eq(t),o=i.find(".ui-tabs-anchor"),u=this._getPanelForTab(i),a={tab:i,panel:u};if(s(o[0]))return;this.xhr=e.ajax(this._ajaxSettings(o,n,a)),this.xhr&&this.xhr.statusText!=="canceled"&&(i.addClass("ui-tabs-loading"),u.attr("aria-busy","true"),this.xhr.success(function(e){setTimeout(function(){u.html(e),r._trigger("load",n,a)},1)}).complete(function(e,t){setTimeout(function(){t==="abort"&&r.panels.stop(!1,!0),i.removeClass("ui-tabs-loading"),u.removeAttr("aria-busy"),e===r.xhr&&delete r.xhr},1)}))},_ajaxSettings:function(t,n,r){var i=this;return{url:t.attr("href"),beforeSend:function(t,s){return i._trigger("beforeLoad",n,e.extend({jqXHR:t,ajaxSettings:s},r))}}},_getPanelForTab:function(t){var n=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+n))}}),e.uiBackCompat!==!1&&(e.ui.tabs.prototype._ui=function(e,t){return{tab:e,panel:t,index:this.anchors.index(e)}},e.widget("ui.tabs",e.ui.tabs,{url:function(e,t){this.anchors.eq(e).attr("href",t)}}),e.widget("ui.tabs",e.ui.tabs,{options:{ajaxOptions:null,cache:!1},_create:function(){this._super();var t=this;this._on({tabsbeforeload:function(n,r){if(e.data(r.tab[0],"cache.tabs")){n.preventDefault();return}r.jqXHR.success(function(){t.options.cache&&e.data(r.tab[0],"cache.tabs",!0)})}})},_ajaxSettings:function(t,n,r){var i=this.options.ajaxOptions;return e.extend({},i,{error:function(e,t){try{i.error(e,t,r.tab.closest("li").index(),r.tab[0])}catch(n){}}},this._superApply(arguments))},_setOption:function(e,t){e==="cache"&&t===!1&&this.anchors.removeData("cache.tabs"),this._super(e,t)},_destroy:function(){this.anchors.removeData("cache.tabs"),this._super()},url:function(e){this.anchors.eq(e).removeData("cache.tabs"),this._superApply(arguments)}}),e.widget("ui.tabs",e.ui.tabs,{abort:function(){this.xhr&&this.xhr.abort()}}),e.widget("ui.tabs",e.ui.tabs,{options:{spinner:"Loading…"},_create:function(){this._super(),this._on({tabsbeforeload:function(e,t){if(e.target!==this.element[0]||!this.options.spinner)return;var n=t.tab.find("span"),r=n.html();n.html(this.options.spinner),t.jqXHR.complete(function(){n.html(r)})}})}}),e.widget("ui.tabs",e.ui.tabs,{options:{enable:null,disable:null},enable:function(t){var n=this.options,r;if(t&&n.disabled===!0||e.isArray(n.disabled)&&e.inArray(t,n.disabled)!==-1)r=!0;this._superApply(arguments),r&&this._trigger("enable",null,this._ui(this.anchors[t],this.panels[t]))},disable:function(t){var n=this.options,r;if(t&&n.disabled===!1||e.isArray(n.disabled)&&e.inArray(t,n.disabled)===-1)r=!0;this._superApply(arguments),r&&this._trigger("disable",null,this._ui(this.anchors[t],this.panels[t]))}}),e.widget("ui.tabs",e.ui.tabs,{options:{add:null,remove:null,tabTemplate:"
  • #{label}
  • "},add:function(n,r,i){i===t&&(i=this.anchors.length);var s,o,u=this.options,a=e(u.tabTemplate.replace(/#\{href\}/g,n).replace(/#\{label\}/g,r)),f=n.indexOf("#")?this._tabId(a):n.replace("#","");return a.addClass("ui-state-default ui-corner-top").data("ui-tabs-destroy",!0),a.attr("aria-controls",f),s=i>=this.tabs.length,o=this.element.find("#"+f),o.length||(o=this._createPanel(f),s?i>0?o.insertAfter(this.panels.eq(-1)):o.appendTo(this.element):o.insertBefore(this.panels[i])),o.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").hide(),s?a.appendTo(this.tablist):a.insertBefore(this.tabs[i]),u.disabled=e.map(u.disabled,function(e){return e>=i?++e:e}),this.refresh(),this.tabs.length===1&&u.active===!1&&this.option("active",0),this._trigger("add",null,this._ui(this.anchors[i],this.panels[i])),this},remove:function(t){t=this._getIndex(t);var n=this.options,r=this.tabs.eq(t).remove(),i=this._getPanelForTab(r).remove();return r.hasClass("ui-tabs-active")&&this.anchors.length>2&&this._activate(t+(t+1=t?--e:e}),this.refresh(),this._trigger("remove",null,this._ui(r.find("a")[0],i[0])),this}}),e.widget("ui.tabs",e.ui.tabs,{length:function(){return this.anchors.length}}),e.widget("ui.tabs",e.ui.tabs,{options:{idPrefix:"ui-tabs-"},_tabId:function(t){var n=t.is("li")?t.find("a[href]"):t;return n=n[0],e(n).closest("li").attr("aria-controls")||n.title&&n.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF\-]/g,"")||this.options.idPrefix+i()}}),e.widget("ui.tabs",e.ui.tabs,{options:{panelTemplate:"
    "},_createPanel:function(t){return e(this.options.panelTemplate).attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)}}),e.widget("ui.tabs",e.ui.tabs,{_create:function(){var e=this.options;e.active===null&&e.selected!==t&&(e.active=e.selected===-1?!1:e.selected),this._super(),e.selected=e.active,e.selected===!1&&(e.selected=-1)},_setOption:function(e,t){if(e!=="selected")return this._super(e,t);var n=this.options;this._super("active",t===-1?!1:t),n.selected=n.active,n.selected===!1&&(n.selected=-1)},_eventHandler:function(){this._superApply(arguments),this.options.selected=this.options.active,this.options.selected===!1&&(this.options.selected=-1)}}),e.widget("ui.tabs",e.ui.tabs,{options:{show:null,select:null},_create:function(){this._super(),this.options.active!==!1&&this._trigger("show",null,this._ui(this.active.find(".ui-tabs-anchor")[0],this._getPanelForTab(this.active)[0]))},_trigger:function(e,t,n){var r,i,s=this._superApply(arguments);return s?(e==="beforeActivate"?(r=n.newTab.length?n.newTab:n.oldTab,i=n.newPanel.length?n.newPanel:n.oldPanel,s=this._super("select",t,{tab:r.find(".ui-tabs-anchor")[0],panel:i[0],index:r.closest("li").index()})):e==="activate"&&n.newTab.length&&(s=this._super("show",t,{tab:n.newTab.find(".ui-tabs-anchor")[0],panel:n.newPanel[0],index:n.newTab.closest("li").index()})),s):!1}}),e.widget("ui.tabs",e.ui.tabs,{select:function(e){e=this._getIndex(e);if(e===-1){if(!this.options.collapsible||this.options.selected===-1)return;e=this.options.selected}this.anchors.eq(e).trigger(this.options.event+this.eventNamespace)}}),function(){var t=0;e.widget("ui.tabs",e.ui.tabs,{options:{cookie:null},_create:function(){var e=this.options,t;e.active==null&&e.cookie&&(t=parseInt(this._cookie(),10),t===-1&&(t=!1),e.active=t),this._super()},_cookie:function(n){var r=[this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+ ++t)];return arguments.length&&(r.push(n===!1?-1:n),r.push(this.options.cookie)),e.cookie.apply(null,r)},_refresh:function(){this._super(),this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_eventHandler:function(){this._superApply(arguments),this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_destroy:function(){this._super(),this.options.cookie&&this._cookie(null,this.options.cookie)}})}(),e.widget("ui.tabs",e.ui.tabs,{_trigger:function(t,n,r){var i=e.extend({},r);return t==="load"&&(i.panel=i.panel[0],i.tab=i.tab.find(".ui-tabs-anchor")[0]),this._super(t,n,i)}}),e.widget("ui.tabs",e.ui.tabs,{options:{fx:null},_getFx:function(){var t,n,r=this.options.fx;return r&&(e.isArray(r)?(t=r[0],n=r[1]):t=n=r),r?{show:n,hide:t}:null},_toggle:function(e,t){function o(){n.running=!1,n._trigger("activate",e,t)}function u(){t.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),r.length&&s.show?r.animate(s.show,s.show.duration,function(){o()}):(r.show(),o())}var n=this,r=t.newPanel,i=t.oldPanel,s=this._getFx();if(!s)return this._super(e,t);n.running=!0,i.length&&s.hide?i.animate(s.hide,s.hide.duration,function(){t.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),u()}):(t.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),i.hide(),u())}}))})(jQuery);(function(e){function n(t,n){var r=(t.attr("aria-describedby")||"").split(/\s+/);r.push(n),t.data("ui-tooltip-id",n).attr("aria-describedby",e.trim(r.join(" ")))}function r(t){var n=t.data("ui-tooltip-id"),r=(t.attr("aria-describedby")||"").split(/\s+/),i=e.inArray(n,r);i!==-1&&r.splice(i,1),t.removeData("ui-tooltip-id"),r=e.trim(r.join(" ")),r?t.attr("aria-describedby",r):t.removeAttr("aria-describedby")}var t=0;e.widget("ui.tooltip",{version:"1.9.2",options:{content:function(){return e(this).attr("title")},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable()},_setOption:function(t,n){var r=this;if(t==="disabled"){this[n?"_disable":"_enable"](),this.options[t]=n;return}this._super(t,n),t==="content"&&e.each(this.tooltips,function(e,t){r._updateContent(t)})},_disable:function(){var t=this;e.each(this.tooltips,function(n,r){var i=e.Event("blur");i.target=i.currentTarget=r[0],t.close(i,!0)}),this.element.find(this.options.items).andSelf().each(function(){var t=e(this);t.is("[title]")&&t.data("ui-tooltip-title",t.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).andSelf().each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))})},open:function(t){var n=this,r=e(t?t.target:this.element).closest(this.options.items);if(!r.length||r.data("ui-tooltip-id"))return;r.attr("title")&&r.data("ui-tooltip-title",r.attr("title")),r.data("ui-tooltip-open",!0),t&&t.type==="mouseover"&&r.parents().each(function(){var t=e(this),r;t.data("ui-tooltip-open")&&(r=e.Event("blur"),r.target=r.currentTarget=this,n.close(r,!0)),t.attr("title")&&(t.uniqueId(),n.parents[this.id]={element:this,title:t.attr("title")},t.attr("title",""))}),this._updateContent(r,t)},_updateContent:function(e,t){var n,r=this.options.content,i=this,s=t?t.type:null;if(typeof r=="string")return this._open(t,e,r);n=r.call(e[0],function(n){if(!e.data("ui-tooltip-open"))return;i._delay(function(){t&&(t.type=s),this._open(t,e,n)})}),n&&this._open(t,e,n)},_open:function(t,r,i){function f(e){a.of=e;if(s.is(":hidden"))return;s.position(a)}var s,o,u,a=e.extend({},this.options.position);if(!i)return;s=this._find(r);if(s.length){s.find(".ui-tooltip-content").html(i);return}r.is("[title]")&&(t&&t.type==="mouseover"?r.attr("title",""):r.removeAttr("title")),s=this._tooltip(r),n(r,s.attr("id")),s.find(".ui-tooltip-content").html(i),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:f}),f(t)):s.position(e.extend({of:r},this.options.position)),s.hide(),this._show(s,this.options.show),this.options.show&&this.options.show.delay&&(u=setInterval(function(){s.is(":visible")&&(f(a.of),clearInterval(u))},e.fx.interval)),this._trigger("open",t,{tooltip:s}),o={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var n=e.Event(t);n.currentTarget=r[0],this.close(n,!0)}},remove:function(){this._removeTooltip(s)}};if(!t||t.type==="mouseover")o.mouseleave="close";if(!t||t.type==="focusin")o.focusout="close";this._on(!0,r,o)},close:function(t){var n=this,i=e(t?t.currentTarget:this.element),s=this._find(i);if(this.closing)return;i.data("ui-tooltip-title")&&i.attr("title",i.data("ui-tooltip-title")),r(i),s.stop(!0),this._hide(s,this.options.hide,function(){n._removeTooltip(e(this))}),i.removeData("ui-tooltip-open"),this._off(i,"mouseleave focusout keyup"),i[0]!==this.element[0]&&this._off(i,"remove"),this._off(this.document,"mousemove"),t&&t.type==="mouseleave"&&e.each(this.parents,function(t,r){e(r.element).attr("title",r.title),delete n.parents[t]}),this.closing=!0,this._trigger("close",t,{tooltip:s}),this.closing=!1},_tooltip:function(n){var r="ui-tooltip-"+t++,i=e("
    ").attr({id:r,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return e("
    ").addClass("ui-tooltip-content").appendTo(i),i.appendTo(this.document[0].body),e.fn.bgiframe&&i.bgiframe(),this.tooltips[r]=n,i},_find:function(t){var n=t.data("ui-tooltip-id");return n?e("#"+n):e()},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var t=this;e.each(this.tooltips,function(n,r){var i=e.Event("blur");i.target=i.currentTarget=r[0],t.close(i,!0),e("#"+n).remove(),r.data("ui-tooltip-title")&&(r.attr("title",r.data("ui-tooltip-title")),r.removeData("ui-tooltip-title"))})}})})(jQuery);jQuery.effects||function(e,t){var n=e.uiBackCompat!==!1,r="ui-effects-";e.effects={effect:{}},function(t,n){function p(e,t,n){var r=a[t.type]||{};return e==null?n||!t.def?null:t.def:(e=r.floor?~~e:parseFloat(e),isNaN(e)?t.def:r.mod?(e+r.mod)%r.mod:0>e?0:r.max")[0],c,h=t.each;l.style.cssText="background-color:rgba(1,1,1,.5)",f.rgba=l.style.backgroundColor.indexOf("rgba")>-1,h(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),o.fn=t.extend(o.prototype,{parse:function(r,i,s,a){if(r===n)return this._rgba=[null,null,null,null],this;if(r.jquery||r.nodeType)r=t(r).css(i),i=n;var f=this,l=t.type(r),v=this._rgba=[];i!==n&&(r=[r,i,s,a],l="array");if(l==="string")return this.parse(d(r)||c._default);if(l==="array")return h(u.rgba.props,function(e,t){v[t.idx]=p(r[t.idx],t)}),this;if(l==="object")return r instanceof o?h(u,function(e,t){r[t.cache]&&(f[t.cache]=r[t.cache].slice())}):h(u,function(t,n){var i=n.cache;h(n.props,function(e,t){if(!f[i]&&n.to){if(e==="alpha"||r[e]==null)return;f[i]=n.to(f._rgba)}f[i][t.idx]=p(r[e],t,!0)}),f[i]&&e.inArray(null,f[i].slice(0,3))<0&&(f[i][3]=1,n.from&&(f._rgba=n.from(f[i])))}),this},is:function(e){var t=o(e),n=!0,r=this;return h(u,function(e,i){var s,o=t[i.cache];return o&&(s=r[i.cache]||i.to&&i.to(r._rgba)||[],h(i.props,function(e,t){if(o[t.idx]!=null)return n=o[t.idx]===s[t.idx],n})),n}),n},_space:function(){var e=[],t=this;return h(u,function(n,r){t[r.cache]&&e.push(n)}),e.pop()},transition:function(e,t){var n=o(e),r=n._space(),i=u[r],s=this.alpha()===0?o("transparent"):this,f=s[i.cache]||i.to(s._rgba),l=f.slice();return n=n[i.cache],h(i.props,function(e,r){var i=r.idx,s=f[i],o=n[i],u=a[r.type]||{};if(o===null)return;s===null?l[i]=o:(u.mod&&(o-s>u.mod/2?s+=u.mod:s-o>u.mod/2&&(s-=u.mod)),l[i]=p((o-s)*t+s,r))}),this[r](l)},blend:function(e){if(this._rgba[3]===1)return this;var n=this._rgba.slice(),r=n.pop(),i=o(e)._rgba;return o(t.map(n,function(e,t){return(1-r)*i[t]+r*e}))},toRgbaString:function(){var e="rgba(",n=t.map(this._rgba,function(e,t){return e==null?t>2?1:0:e});return n[3]===1&&(n.pop(),e="rgb("),e+n.join()+")"},toHslaString:function(){var e="hsla(",n=t.map(this.hsla(),function(e,t){return e==null&&(e=t>2?1:0),t&&t<3&&(e=Math.round(e*100)+"%"),e});return n[3]===1&&(n.pop(),e="hsl("),e+n.join()+")"},toHexString:function(e){var n=this._rgba.slice(),r=n.pop();return e&&n.push(~~(r*255)),"#"+t.map(n,function(e){return e=(e||0).toString(16),e.length===1?"0"+e:e}).join("")},toString:function(){return this._rgba[3]===0?"transparent":this.toRgbaString()}}),o.fn.parse.prototype=o.fn,u.hsla.to=function(e){if(e[0]==null||e[1]==null||e[2]==null)return[null,null,null,e[3]];var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=e[3],s=Math.max(t,n,r),o=Math.min(t,n,r),u=s-o,a=s+o,f=a*.5,l,c;return o===s?l=0:t===s?l=60*(n-r)/u+360:n===s?l=60*(r-t)/u+120:l=60*(t-n)/u+240,f===0||f===1?c=f:f<=.5?c=u/a:c=u/(2-a),[Math.round(l)%360,c,f,i==null?1:i]},u.hsla.from=function(e){if(e[0]==null||e[1]==null||e[2]==null)return[null,null,null,e[3]];var t=e[0]/360,n=e[1],r=e[2],i=e[3],s=r<=.5?r*(1+n):r+n-r*n,o=2*r-s;return[Math.round(v(o,s,t+1/3)*255),Math.round(v(o,s,t)*255),Math.round(v(o,s,t-1/3)*255),i]},h(u,function(e,r){var s=r.props,u=r.cache,a=r.to,f=r.from;o.fn[e]=function(e){a&&!this[u]&&(this[u]=a(this._rgba));if(e===n)return this[u].slice();var r,i=t.type(e),l=i==="array"||i==="object"?e:arguments,c=this[u].slice();return h(s,function(e,t){var n=l[i==="object"?e:t.idx];n==null&&(n=c[t.idx]),c[t.idx]=p(n,t)}),f?(r=o(f(c)),r[u]=c,r):o(c)},h(s,function(n,r){if(o.fn[n])return;o.fn[n]=function(s){var o=t.type(s),u=n==="alpha"?this._hsla?"hsla":"rgba":e,a=this[u](),f=a[r.idx],l;return o==="undefined"?f:(o==="function"&&(s=s.call(this,f),o=t.type(s)),s==null&&r.empty?this:(o==="string"&&(l=i.exec(s),l&&(s=f+parseFloat(l[2])*(l[1]==="+"?1:-1))),a[r.idx]=s,this[u](a)))}})}),h(r,function(e,n){t.cssHooks[n]={set:function(e,r){var i,s,u="";if(t.type(r)!=="string"||(i=d(r))){r=o(i||r);if(!f.rgba&&r._rgba[3]!==1){s=n==="backgroundColor"?e.parentNode:e;while((u===""||u==="transparent")&&s&&s.style)try{u=t.css(s,"backgroundColor"),s=s.parentNode}catch(a){}r=r.blend(u&&u!=="transparent"?u:"_default")}r=r.toRgbaString()}try{e.style[n]=r}catch(l){}}},t.fx.step[n]=function(e){e.colorInit||(e.start=o(e.elem,n),e.end=o(e.end),e.colorInit=!0),t.cssHooks[n].set(e.elem,e.start.transition(e.end,e.pos))}}),t.cssHooks.borderColor={expand:function(e){var t={};return h(["Top","Right","Bottom","Left"],function(n,r){t["border"+r+"Color"]=e}),t}},c=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function i(){var t=this.ownerDocument.defaultView?this.ownerDocument.defaultView.getComputedStyle(this,null):this.currentStyle,n={},r,i;if(t&&t.length&&t[0]&&t[t[0]]){i=t.length;while(i--)r=t[i],typeof t[r]=="string"&&(n[e.camelCase(r)]=t[r])}else for(r in t)typeof t[r]=="string"&&(n[r]=t[r]);return n}function s(t,n){var i={},s,o;for(s in n)o=n[s],t[s]!==o&&!r[s]&&(e.fx.step[s]||!isNaN(parseFloat(o)))&&(i[s]=o);return i}var n=["add","remove","toggle"],r={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,n){e.fx.step[n]=function(e){if(e.end!=="none"&&!e.setAttr||e.pos===1&&!e.setAttr)jQuery.style(e.elem,n,e.end),e.setAttr=!0}}),e.effects.animateClass=function(t,r,o,u){var a=e.speed(r,o,u);return this.queue(function(){var r=e(this),o=r.attr("class")||"",u,f=a.children?r.find("*").andSelf():r;f=f.map(function(){var t=e(this);return{el:t,start:i.call(this)}}),u=function(){e.each(n,function(e,n){t[n]&&r[n+"Class"](t[n])})},u(),f=f.map(function(){return this.end=i.call(this.el[0]),this.diff=s(this.start,this.end),this}),r.attr("class",o),f=f.map(function(){var t=this,n=e.Deferred(),r=jQuery.extend({},a,{queue:!1,complete:function(){n.resolve(t)}});return this.el.animate(this.diff,r),n.promise()}),e.when.apply(e,f.get()).done(function(){u(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),a.complete.call(r[0])})})},e.fn.extend({_addClass:e.fn.addClass,addClass:function(t,n,r,i){return n?e.effects.animateClass.call(this,{add:t},n,r,i):this._addClass(t)},_removeClass:e.fn.removeClass,removeClass:function(t,n,r,i){return n?e.effects.animateClass.call(this,{remove:t},n,r,i):this._removeClass(t)},_toggleClass:e.fn.toggleClass,toggleClass:function(n,r,i,s,o){return typeof r=="boolean"||r===t?i?e.effects.animateClass.call(this,r?{add:n}:{remove:n},i,s,o):this._toggleClass(n,r):e.effects.animateClass.call(this,{toggle:n},r,i,s)},switchClass:function(t,n,r,i,s){return e.effects.animateClass.call(this,{add:n,remove:t},r,i,s)}})}(),function(){function i(t,n,r,i){e.isPlainObject(t)&&(n=t,t=t.effect),t={effect:t},n==null&&(n={}),e.isFunction(n)&&(i=n,r=null,n={});if(typeof n=="number"||e.fx.speeds[n])i=r,r=n,n={};return e.isFunction(r)&&(i=r,r=null),n&&e.extend(t,n),r=r||n.duration,t.duration=e.fx.off?0:typeof r=="number"?r:r in e.fx.speeds?e.fx.speeds[r]:e.fx.speeds._default,t.complete=i||n.complete,t}function s(t){return!t||typeof t=="number"||e.fx.speeds[t]?!0:typeof t=="string"&&!e.effects.effect[t]?n&&e.effects[t]?!1:!0:!1}e.extend(e.effects,{version:"1.9.2",save:function(e,t){for(var n=0;n
    ").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),i={width:t.width(),height:t.height()},s=document.activeElement;try{s.id}catch(o){s=document.body}return t.wrap(r),(t[0]===s||e.contains(t[0],s))&&e(s).focus(),r=t.parent(),t.css("position")==="static"?(r.css({position:"relative"}),t.css({position:"relative"})):(e.extend(n,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,r){n[r]=t.css(r),isNaN(parseInt(n[r],10))&&(n[r]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(i),r.css(n).show()},removeWrapper:function(t){var n=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===n||e.contains(t[0],n))&&e(n).focus()),t},setTransition:function(t,n,r,i){return i=i||{},e.each(n,function(e,n){var s=t.cssUnit(n);s[0]>0&&(i[n]=s[0]*r+s[1])}),i}}),e.fn.extend({effect:function(){function a(n){function u(){e.isFunction(i)&&i.call(r[0]),e.isFunction(n)&&n()}var r=e(this),i=t.complete,s=t.mode;(r.is(":hidden")?s==="hide":s==="show")?u():o.call(r[0],t,u)}var t=i.apply(this,arguments),r=t.mode,s=t.queue,o=e.effects.effect[t.effect],u=!o&&n&&e.effects[t.effect];return e.fx.off||!o&&!u?r?this[r](t.duration,t.complete):this.each(function(){t.complete&&t.complete.call(this)}):o?s===!1?this.each(a):this.queue(s||"fx",a):u.call(this,{options:t,duration:t.duration,callback:t.complete,mode:t.mode})},_show:e.fn.show,show:function(e){if(s(e))return this._show.apply(this,arguments);var t=i.apply(this,arguments);return t.mode="show",this.effect.call(this,t)},_hide:e.fn.hide,hide:function(e){if(s(e))return this._hide.apply(this,arguments);var t=i.apply(this,arguments);return t.mode="hide",this.effect.call(this,t)},__toggle:e.fn.toggle,toggle:function(t){if(s(t)||typeof t=="boolean"||e.isFunction(t))return this.__toggle.apply(this,arguments);var n=i.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)},cssUnit:function(t){var n=this.css(t),r=[];return e.each(["em","px","%","pt"],function(e,t){n.indexOf(t)>0&&(r=[parseFloat(n),t])}),r}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,n){t[n]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return e===0||e===1?e:-Math.pow(2,8*(e-1))*Math.sin(((e-1)*80-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){var t,n=4;while(e<((t=Math.pow(2,--n))-1)/11);return 1/Math.pow(4,3-n)-7.5625*Math.pow((t*3-2)/22-e,2)}}),e.each(t,function(t,n){e.easing["easeIn"+t]=n,e.easing["easeOut"+t]=function(e){return 1-n(1-e)},e.easing["easeInOut"+t]=function(e){return e<.5?n(e*2)/2:1-n(e*-2+2)/2}})}()}(jQuery);(function(e,t){var n=/up|down|vertical/,r=/up|left|vertical|horizontal/;e.effects.effect.blind=function(t,i){var s=e(this),o=["position","top","bottom","left","right","height","width"],u=e.effects.setMode(s,t.mode||"hide"),a=t.direction||"up",f=n.test(a),l=f?"height":"width",c=f?"top":"left",h=r.test(a),p={},d=u==="show",v,m,g;s.parent().is(".ui-effects-wrapper")?e.effects.save(s.parent(),o):e.effects.save(s,o),s.show(),v=e.effects.createWrapper(s).css({overflow:"hidden"}),m=v[l](),g=parseFloat(v.css(c))||0,p[l]=d?m:0,h||(s.css(f?"bottom":"right",0).css(f?"top":"left","auto").css({position:"absolute"}),p[c]=d?g:m+g),d&&(v.css(l,0),h||v.css(c,g+m)),v.animate(p,{duration:t.duration,easing:t.easing,queue:!1,complete:function(){u==="hide"&&s.hide(),e.effects.restore(s,o),e.effects.removeWrapper(s),i()}})}})(jQuery);(function(e,t){e.effects.effect.bounce=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"effect"),o=s==="hide",u=s==="show",a=t.direction||"up",f=t.distance,l=t.times||5,c=l*2+(u||o?1:0),h=t.duration/c,p=t.easing,d=a==="up"||a==="down"?"top":"left",v=a==="up"||a==="left",m,g,y,b=r.queue(),w=b.length;(u||o)&&i.push("opacity"),e.effects.save(r,i),r.show(),e.effects.createWrapper(r),f||(f=r[d==="top"?"outerHeight":"outerWidth"]()/3),u&&(y={opacity:1},y[d]=0,r.css("opacity",0).css(d,v?-f*2:f*2).animate(y,h,p)),o&&(f/=Math.pow(2,l-1)),y={},y[d]=0;for(m=0;m1&&b.splice.apply(b,[1,0].concat(b.splice(w,c+1))),r.dequeue()}})(jQuery);(function(e,t){e.effects.effect.clip=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=t.direction||"vertical",a=u==="vertical",f=a?"height":"width",l=a?"top":"left",c={},h,p,d;e.effects.save(r,i),r.show(),h=e.effects.createWrapper(r).css({overflow:"hidden"}),p=r[0].tagName==="IMG"?h:r,d=p[f](),o&&(p.css(f,0),p.css(l,d/2)),c[f]=o?d:0,c[l]=o?0:d/2,p.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){o||r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}})(jQuery);(function(e,t){e.effects.effect.drop=function(t,n){var r=e(this),i=["position","top","bottom","left","right","opacity","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=t.direction||"left",a=u==="up"||u==="down"?"top":"left",f=u==="up"||u==="left"?"pos":"neg",l={opacity:o?1:0},c;e.effects.save(r,i),r.show(),e.effects.createWrapper(r),c=t.distance||r[a==="top"?"outerHeight":"outerWidth"](!0)/2,o&&r.css("opacity",0).css(a,f==="pos"?-c:c),l[a]=(o?f==="pos"?"+=":"-=":f==="pos"?"-=":"+=")+c,r.animate(l,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}})(jQuery);(function(e,t){e.effects.effect.explode=function(t,n){function y(){c.push(this),c.length===r*i&&b()}function b(){s.css({visibility:"visible"}),e(c).remove(),u||s.hide(),n()}var r=t.pieces?Math.round(Math.sqrt(t.pieces)):3,i=r,s=e(this),o=e.effects.setMode(s,t.mode||"hide"),u=o==="show",a=s.show().css("visibility","hidden").offset(),f=Math.ceil(s.outerWidth()/i),l=Math.ceil(s.outerHeight()/r),c=[],h,p,d,v,m,g;for(h=0;h
    ").css({position:"absolute",visibility:"visible",left:-p*f,top:-h*l}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:f,height:l,left:d+(u?m*f:0),top:v+(u?g*l:0),opacity:u?0:1}).animate({left:d+(u?0:m*f),top:v+(u?0:g*l),opacity:u?1:0},t.duration||500,t.easing,y)}}})(jQuery);(function(e,t){e.effects.effect.fade=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"toggle");r.animate({opacity:i},{queue:!1,duration:t.duration,easing:t.easing,complete:n})}})(jQuery);(function(e,t){e.effects.effect.fold=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=s==="hide",a=t.size||15,f=/([0-9]+)%/.exec(a),l=!!t.horizFirst,c=o!==l,h=c?["width","height"]:["height","width"],p=t.duration/2,d,v,m={},g={};e.effects.save(r,i),r.show(),d=e.effects.createWrapper(r).css({overflow:"hidden"}),v=c?[d.width(),d.height()]:[d.height(),d.width()],f&&(a=parseInt(f[1],10)/100*v[u?0:1]),o&&d.css(l?{height:0,width:a}:{height:a,width:0}),m[h[0]]=o?v[0]:a,g[h[1]]=o?v[1]:0,d.animate(m,p,t.easing).animate(g,p,t.easing,function(){u&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()})}})(jQuery);(function(e,t){e.effects.effect.highlight=function(t,n){var r=e(this),i=["backgroundImage","backgroundColor","opacity"],s=e.effects.setMode(r,t.mode||"show"),o={backgroundColor:r.css("backgroundColor")};s==="hide"&&(o.opacity=0),e.effects.save(r,i),r.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),n()}})}})(jQuery);(function(e,t){e.effects.effect.pulsate=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"show"),s=i==="show",o=i==="hide",u=s||i==="hide",a=(t.times||5)*2+(u?1:0),f=t.duration/a,l=0,c=r.queue(),h=c.length,p;if(s||!r.is(":visible"))r.css("opacity",0).show(),l=1;for(p=1;p1&&c.splice.apply(c,[1,0].concat(c.splice(h,a+1))),r.dequeue()}})(jQuery);(function(e,t){e.effects.effect.puff=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"hide"),s=i==="hide",o=parseInt(t.percent,10)||150,u=o/100,a={height:r.height(),width:r.width(),outerHeight:r.outerHeight(),outerWidth:r.outerWidth()};e.extend(t,{effect:"scale",queue:!1,fade:!0,mode:i,complete:n,percent:s?o:100,from:s?a:{height:a.height*u,width:a.width*u,outerHeight:a.outerHeight*u,outerWidth:a.outerWidth*u}}),r.effect(t)},e.effects.effect.scale=function(t,n){var r=e(this),i=e.extend(!0,{},t),s=e.effects.setMode(r,t.mode||"effect"),o=parseInt(t.percent,10)||(parseInt(t.percent,10)===0?0:s==="hide"?0:100),u=t.direction||"both",a=t.origin,f={height:r.height(),width:r.width(),outerHeight:r.outerHeight(),outerWidth:r.outerWidth()},l={y:u!=="horizontal"?o/100:1,x:u!=="vertical"?o/100:1};i.effect="size",i.queue=!1,i.complete=n,s!=="effect"&&(i.origin=a||["middle","center"],i.restore=!0),i.from=t.from||(s==="show"?{height:0,width:0,outerHeight:0,outerWidth:0}:f),i.to={height:f.height*l.y,width:f.width*l.x,outerHeight:f.outerHeight*l.y,outerWidth:f.outerWidth*l.x},i.fade&&(s==="show"&&(i.from.opacity=0,i.to.opacity=1),s==="hide"&&(i.from.opacity=1,i.to.opacity=0)),r.effect(i)},e.effects.effect.size=function(t,n){var r,i,s,o=e(this),u=["position","top","bottom","left","right","width","height","overflow","opacity"],a=["position","top","bottom","left","right","overflow","opacity"],f=["width","height","overflow"],l=["fontSize"],c=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],h=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=e.effects.setMode(o,t.mode||"effect"),d=t.restore||p!=="effect",v=t.scale||"both",m=t.origin||["middle","center"],g=o.css("position"),y=d?u:a,b={height:0,width:0,outerHeight:0,outerWidth:0};p==="show"&&o.show(),r={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},t.mode==="toggle"&&p==="show"?(o.from=t.to||b,o.to=t.from||r):(o.from=t.from||(p==="show"?b:r),o.to=t.to||(p==="hide"?b:r)),s={from:{y:o.from.height/r.height,x:o.from.width/r.width},to:{y:o.to.height/r.height,x:o.to.width/r.width}};if(v==="box"||v==="both")s.from.y!==s.to.y&&(y=y.concat(c),o.from=e.effects.setTransition(o,c,s.from.y,o.from),o.to=e.effects.setTransition(o,c,s.to.y,o.to)),s.from.x!==s.to.x&&(y=y.concat(h),o.from=e.effects.setTransition(o,h,s.from.x,o.from),o.to=e.effects.setTransition(o,h,s.to.x,o.to));(v==="content"||v==="both")&&s.from.y!==s.to.y&&(y=y.concat(l).concat(f),o.from=e.effects.setTransition(o,l,s.from.y,o.from),o.to=e.effects.setTransition(o,l,s.to.y,o.to)),e.effects.save(o,y),o.show(),e.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),m&&(i=e.effects.getBaseline(m,r),o.from.top=(r.outerHeight-o.outerHeight())*i.y,o.from.left=(r.outerWidth-o.outerWidth())*i.x,o.to.top=(r.outerHeight-o.to.outerHeight)*i.y,o.to.left=(r.outerWidth-o.to.outerWidth)*i.x),o.css(o.from);if(v==="content"||v==="both")c=c.concat(["marginTop","marginBottom"]).concat(l),h=h.concat(["marginLeft","marginRight"]),f=u.concat(c).concat(h),o.find("*[width]").each(function(){var n=e(this),r={height:n.height(),width:n.width(),outerHeight:n.outerHeight(),outerWidth:n.outerWidth()};d&&e.effects.save(n,f),n.from={height:r.height*s.from.y,width:r.width*s.from.x,outerHeight:r.outerHeight*s.from.y,outerWidth:r.outerWidth*s.from.x},n.to={height:r.height*s.to.y,width:r.width*s.to.x,outerHeight:r.height*s.to.y,outerWidth:r.width*s.to.x},s.from.y!==s.to.y&&(n.from=e.effects.setTransition(n,c,s.from.y,n.from),n.to=e.effects.setTransition(n,c,s.to.y,n.to)),s.from.x!==s.to.x&&(n.from=e.effects.setTransition(n,h,s.from.x,n.from),n.to=e.effects.setTransition(n,h,s.to.x,n.to)),n.css(n.from),n.animate(n.to,t.duration,t.easing,function(){d&&e.effects.restore(n,f)})});o.animate(o.to,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){o.to.opacity===0&&o.css("opacity",o.from.opacity),p==="hide"&&o.hide(),e.effects.restore(o,y),d||(g==="static"?o.css({position:"relative",top:o.to.top,left:o.to.left}):e.each(["top","left"],function(e,t){o.css(t,function(t,n){var r=parseInt(n,10),i=e?o.to.left:o.to.top;return n==="auto"?i+"px":r+i+"px"})})),e.effects.removeWrapper(o),n()}})}})(jQuery);(function(e,t){e.effects.effect.shake=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"effect"),o=t.direction||"left",u=t.distance||20,a=t.times||3,f=a*2+1,l=Math.round(t.duration/f),c=o==="up"||o==="down"?"top":"left",h=o==="up"||o==="left",p={},d={},v={},m,g=r.queue(),y=g.length;e.effects.save(r,i),r.show(),e.effects.createWrapper(r),p[c]=(h?"-=":"+=")+u,d[c]=(h?"+=":"-=")+u*2,v[c]=(h?"-=":"+=")+u*2,r.animate(p,l,t.easing);for(m=1;m1&&g.splice.apply(g,[1,0].concat(g.splice(y,f+1))),r.dequeue()}})(jQuery);(function(e,t){e.effects.effect.slide=function(t,n){var r=e(this),i=["position","top","bottom","left","right","width","height"],s=e.effects.setMode(r,t.mode||"show"),o=s==="show",u=t.direction||"left",a=u==="up"||u==="down"?"top":"left",f=u==="up"||u==="left",l,c={};e.effects.save(r,i),r.show(),l=t.distance||r[a==="top"?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(r).css({overflow:"hidden"}),o&&r.css(a,f?isNaN(l)?"-"+l:-l:l),c[a]=(o?f?"+=":"-=":f?"-=":"+=")+l,r.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}})(jQuery);(function(e,t){e.effects.effect.transfer=function(t,n){var r=e(this),i=e(t.to),s=i.css("position")==="fixed",o=e("body"),u=s?o.scrollTop():0,a=s?o.scrollLeft():0,f=i.offset(),l={top:f.top-u,left:f.left-a,height:i.innerHeight(),width:i.innerWidth()},c=r.offset(),h=e('
    ').appendTo(document.body).addClass(t.className).css({top:c.top-u,left:c.left-a,height:r.innerHeight(),width:r.innerWidth(),position:s?"fixed":"absolute"}).animate(l,t.duration,t.easing,function(){h.remove(),n()})}})(jQuery); \ No newline at end of file diff --git a/crm/src/main/webapp/jquery-ui-bootstrap/old_index.html b/crm/src/main/webapp/jquery-ui-bootstrap/old_index.html new file mode 100644 index 0000000..a630c2a --- /dev/null +++ b/crm/src/main/webapp/jquery-ui-bootstrap/old_index.html @@ -0,0 +1,734 @@ + + + + + jQuery UI Bootstrap + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    + + +
    + + + +
    +

    +

    Welcome! This is a live preview of new the jQuery UI Bootstrap theme - a project I started to bring the beauty of Twitter's Bootstrap to jQuery UI widgets. +

    +

    + With this theme, not only do you get the ability to use Bootstrap-themed widgets, but you can now also use (most) of Twitter Bootstrap side-by-wide with it without components breaking visually.

    +

    + It's still a work-in-progress, but I hope you find it useful. Issues and pull requests are always welcome - @addyosmani +

    +

    +
    + + + + +

    Accordion

    +
    +
    +

    First

    +
    Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.
    +
    +
    +

    Second

    +
    Phasellus mattis tincidunt nibh.
    +
    +
    +

    Third

    +
    Nam dui erat, auctor a, dignissim quis.
    +
    +
    + + + +

    Dialog

    +

    Open Dialog +   + Open Modal Dialog +

    + + +

    Overlay and Shadow Classes

    +
    +

    Lorem ipsum dolor sit amet, Nulla nec tortor. Donec id elit quis purus consectetur consequat.

    Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante. Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci.

    Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam. Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat.

    Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante. Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci. Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam.

    Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat. Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante.

    Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci. Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam. Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat. Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi.

    + + +
    +
    +
    +

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

    +
    +
    + +
    + + + +
    +

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

    +
    + + + +

    Framework Icons (content color preview)

    +
      + +
    • +
    • +
    • + +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • + +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • + +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • + +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • + +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • + +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • + +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • + +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • + +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • + +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • + +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • + +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • + +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • + +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • + +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • + +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • + +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • + +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • + +
    • +
    • +
    • +
    • +
    • +
    + + +

    Tabs

    +
    + +
    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
    +
    Phasellus mattis tincidunt nibh. Cras orci urna, blandit id, pretium vel, aliquet ornare, felis. Maecenas scelerisque sem non nisl. Fusce sed lorem in enim dictum bibendum.
    +
    Nam dui erat, auctor a, dignissim quis, sollicitudin eu, felis. Pellentesque nisi urna, interdum eget, sagittis et, consequat vestibulum, lacus. Mauris porttitor ullamcorper augue.
    +
    + + + + + + +

     

    +
    + +

    Dynamic Tabs

    +
    +
    +
    + + + + +
    + +
    + + + +
    + +
    +

    Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.

    +
    +
    + +
    + +
    +

    Simple tabs adding and removing.

    +
    + + + +

    Combination examples

    +
    +
    + +
    +

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse eget diam nec urna hendrerit tempus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum aliquam ligula non nulla cursus volutpat. Aliquam malesuada felis nec turpis auctor interdum. Cras et lobortis dolor. Nam sodales, dolor eu cursus faucibus, justo leo vestibulum turpis, id malesuada erat ipsum et leo. Integer id aliquam augue. Proin quis risus magna.

    + Change +
    +
    Tab 2
    +
    Tab 3
    +
    +
    + +
    + + + + + + + +

     

    +

    FilamentGroup Date Range Picker

    +

     

    +

    + The date range picker plugin code is open source and available in a git repository, jQuery-UI-Date-Range-Picker. For demonstration sakes it is included in this theme pack with style updates. +

    +

    +

    Default Rangepicker

    +
    + +
    + +

    2 inputs Rangepicker

    +
    + + +
    + +

    + + +

    Tooltip

    +
    +

    Tooltips can be attached to any element. When you hover + the element with your mouse, the title attribute is displayed in a little box next to the element, just like a native tooltip.

    +

    But as it's not a native tooltip, it can be styled. Any themes built with + ThemeRoller + will also style tooltips accordingly.

    +

    Tooltips are also useful for form elements, to show some additional information in the context of each field.

    +

    +

    Hover the field to see the tooltip.

    +
    + +
    + + + +
    + + +

    Buttons

    +
    + + + + +
    +
    + + + Anchor + + + +
    + +
    + + +

    Button set

    +
    +
    + + + +
    +
    +
    + + + +
    +
    + + + + + + +

    File Input

    +
    + + + + + + +

    Horizontal Slider

    +
    + + + +

    Progressbar

    +
    + + + + +

    Highlight / Error

    +
    +
    +

    + Hey! Sample ui-state-highlight style.

    +
    +
    + +
    +
    +

    + Alert: Sample ui-state-error style.

    +
    +
    + + +
    +
    +

    + Hello: Sample ui-state-default style.

    +
    +
    + + + + + +

    Autocomplete

    + +
    + + +
    + + + + +

    Datepicker

    +
    + + + + + + +
    +

     

    +

    Simple toolbar

    +

    +
    + + + + + + + + + +
    +
    + + + + +

    Vertical Slider

    +

    + + Master volume +

    +

    + + +

    + +
    + + +

    Menu

    +

    + + +

    + +

    Spinner

    +

    + + +

    + +

    + + +

    + +

    + + +

    + +

    +
    + + +
    + +
    + + + +
    +

    +  

    +

    + Wijmo Menu

    +

    + This is an example of how to retheme one of the Wijmo jQuery UI components to match the Twitter Bootstrap theme. Whilst a menu component will be arriving to jQueryUI soon, you can find the menu in Wijmo Open.

    + + +
    + +
    +

    + +
    +

    This theme's support for more third-party widgets may improve over-time, based on requests and the popularity of the widgets.

    +
    +
    + +
    +

    jQuery UI Bootstrap © Addy Osmani 2012. Twitter Bootstrap © Twitter 2012

    +
    + +
    + + + +
    +

    + + Your files have downloaded successfully into the My Downloads folder. +

    +

    + Currently using 36% of your storage space. +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-Date-Range-Picker/css/ui.daterangepicker.css b/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-Date-Range-Picker/css/ui.daterangepicker.css new file mode 100644 index 0000000..9851f24 --- /dev/null +++ b/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-Date-Range-Picker/css/ui.daterangepicker.css @@ -0,0 +1,160 @@ +/*styles for jquery ui daterangepicker plugin */ + +.ui-daterangepickercontain { + position: absolute; + z-index: 999; +} +.ui-daterangepickercontain .ui-daterangepicker { + float: left; + padding: 5px !important; + width: auto; + display: inline; + background-image: none !important; + clear: left; +} +.ui-daterangepicker ul, .ui-daterangepicker .ranges, .ui-daterangepicker .range-start, .ui-daterangepicker .range-end { + float: left; + padding: 0; + margin: 0; +} +.ui-daterangepicker .ranges { + width: auto; + position: relative; + padding: 5px 5px 40px 0; + margin-left: 10px; +} +.ui-daterangepicker .range-start, .ui-daterangepicker .range-end { + margin-left: 5px; +} +.ui-daterangepicker button.btnDone { + + clear:both; + cursor:pointer; + position:absolute; + bottom:0; + right:0; + cursor: pointer; + display: inline-block; + background-color: #e6e6e6; + background-repeat: no-repeat; + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), color-stop(25%, #ffffff), to(#e6e6e6)); + background-image: -webkit-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); + background-image: -moz-linear-gradient(top, #ffffff, #ffffff 25%, #e6e6e6); + background-image: -ms-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); + background-image: -o-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); + background-image: linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0); + padding: 5px 14px 6px; + margin: 5px; + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); + color: #333; + font-size: 13px; + line-height: normal; + border: 1px solid #ccc; + border-bottom-color: #bbb; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + -webkit-transition: 0.1s linear background-image; + -moz-transition: 0.1s linear background-image; + -ms-transition: 0.1s linear background-image; + -o-transition: 0.1s linear background-image; + transition: 0.1s linear background-image; + overflow: visible; + +} +.ui-daterangepicker ul { + width: 17.6em; + background: none; + border: 0; +} +.ui-daterangepicker li { + list-style: none; + padding: 1px; + cursor: pointer; + margin: 1px 0; +} +.ui-daterangepicker .ui-widget-header{ + border:1px solid #ccc; +} + +.ui-daterangepicker .ui-state-hover{ + padding: 1px; + color: #ffffff; + background: #0064cd; + background-color: #0064cd; + background-repeat: repeat-x; + background-image: -khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd)); + background-image: -moz-linear-gradient(top, #049cdb, #0064cd); + background-image: -ms-linear-gradient(top, #049cdb, #0064cd); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd)); + background-image: -webkit-linear-gradient(top, #049cdb, #0064cd); + background-image: -o-linear-gradient(top, #049cdb, #0064cd); + background-image: linear-gradient(top, #049cdb, #0064cd); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#049cdb', endColorstr='#0064cd', GradientType=0); + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + border-color: #0064cd #0064cd #003f81; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); +} + +.ui-daterangepicker .ui-state-hover a{ + color:#fff; +} + +.ui-daterangepicker .ui-widget{ + padding-right:4px; +} +.ui-daterangepicker li.preset_0 { + margin-top: 1.5em !important; +} +.ui-daterangepicker .ui-widget-content a { + text-decoration: none !important; + font-weight:normal; +} +.ui-daterangepicker li a { + font-weight: normal; + margin: .3em .5em; + display: block; +} +.ui-daterangepicker li span { + float: right; + margin: .3em .2em; +} + +.ui-daterangepicker .title-start, .ui-daterangepicker .title-end { + display: block; + margin: 0 0 .2em; + font-size: 1em; + padding: 0 4px 2px; +} +.ui-daterangepicker .ui-datepicker-inline { + font-size: 1em; +} +.ui-daterangepicker-arrows { + padding: 2px; + width: 204px; + position: relative; +} +.ui-daterangepicker-arrows input.ui-rangepicker-input { + width: 158px; + margin: 0 2px 0 20px; + padding: 2px; + height: 1.1em; +} +.ui-daterangepicker-arrows .ui-daterangepicker-prev, .ui-daterangepicker-arrows .ui-daterangepicker-next { + position: absolute; + top: 2px; + padding: 1px; +} +.ui-daterangepicker-arrows .ui-daterangepicker-prev { + left: 2px; +} +.ui-daterangepicker-arrows .ui-daterangepicker-next { + right: 2px; +} +.ui-daterangepicker-arrows .ui-daterangepicker-prev:hover, +.ui-daterangepicker-arrows .ui-daterangepicker-next:hover, +.ui-daterangepicker-arrows .ui-daterangepicker-prev:focus, +.ui-daterangepicker-arrows .ui-daterangepicker-next:focus { + padding: 0; +} diff --git a/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-Date-Range-Picker/index.html b/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-Date-Range-Picker/index.html new file mode 100644 index 0000000..1aa877e --- /dev/null +++ b/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-Date-Range-Picker/index.html @@ -0,0 +1,66 @@ + + + + + Themeroller-Ready jQuery UI Range Picker + + + + + + + + + + + + + + + + + + +

    Default Rangepicker

    +
    + +
    + +

    2 inputs Rangepicker

    +
    + + +
    + +

    Rangepicker with arrows

    +
    + +
    + +

    Rangepicker opening to the right

    +
    + +
    + +

    Rangepicker with contraints

    +
    + +
    + + + + + diff --git a/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-Date-Range-Picker/js/date.js b/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-Date-Range-Picker/js/date.js new file mode 100644 index 0000000..24afe24 --- /dev/null +++ b/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-Date-Range-Picker/js/date.js @@ -0,0 +1,375 @@ +/** + * Version: 1.0 Alpha-1 + * Build Date: 13-Nov-2007 + * Copyright (c) 2006-2007, Coolite Inc. (http://www.coolite.com/). All rights reserved. + * License: Licensed under The MIT License. See license.txt and http://www.datejs.com/license/. + * Website: http://www.datejs.com/ or http://www.coolite.com/datejs/ + */ +Date.CultureInfo={name:"en-US",englishName:"English (United States)",nativeName:"English (United States)",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],shortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],firstLetterDayNames:["S","M","T","W","T","F","S"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],abbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],amDesignator:"AM",pmDesignator:"PM",firstDayOfWeek:0,twoDigitYearMax:2029,dateElementOrder:"mdy",formatPatterns:{shortDate:"M/d/yyyy",longDate:"dddd, MMMM dd, yyyy",shortTime:"h:mm tt",longTime:"h:mm:ss tt",fullDateTime:"dddd, MMMM dd, yyyy h:mm:ss tt",sortableDateTime:"yyyy-MM-ddTHH:mm:ss",universalSortableDateTime:"yyyy-MM-dd HH:mm:ssZ",rfc1123:"ddd, dd MMM yyyy HH:mm:ss GMT",monthDay:"MMMM dd",yearMonth:"MMMM, yyyy"},regexPatterns:{jan:/^jan(uary)?/i,feb:/^feb(ruary)?/i,mar:/^mar(ch)?/i,apr:/^apr(il)?/i,may:/^may/i,jun:/^jun(e)?/i,jul:/^jul(y)?/i,aug:/^aug(ust)?/i,sep:/^sep(t(ember)?)?/i,oct:/^oct(ober)?/i,nov:/^nov(ember)?/i,dec:/^dec(ember)?/i,sun:/^su(n(day)?)?/i,mon:/^mo(n(day)?)?/i,tue:/^tu(e(s(day)?)?)?/i,wed:/^we(d(nesday)?)?/i,thu:/^th(u(r(s(day)?)?)?)?/i,fri:/^fr(i(day)?)?/i,sat:/^sa(t(urday)?)?/i,future:/^next/i,past:/^last|past|prev(ious)?/i,add:/^(\+|after|from)/i,subtract:/^(\-|before|ago)/i,yesterday:/^yesterday/i,today:/^t(oday)?/i,tomorrow:/^tomorrow/i,now:/^n(ow)?/i,millisecond:/^ms|milli(second)?s?/i,second:/^sec(ond)?s?/i,minute:/^min(ute)?s?/i,hour:/^h(ou)?rs?/i,week:/^w(ee)?k/i,month:/^m(o(nth)?s?)?/i,day:/^d(ays?)?/i,year:/^y((ea)?rs?)?/i,shortMeridian:/^(a|p)/i,longMeridian:/^(a\.?m?\.?|p\.?m?\.?)/i,timezone:/^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt)/i,ordinalSuffix:/^\s*(st|nd|rd|th)/i,timeContext:/^\s*(\:|a|p)/i},abbreviatedTimeZoneStandard:{GMT:"-000",EST:"-0400",CST:"-0500",MST:"-0600",PST:"-0700"},abbreviatedTimeZoneDST:{GMT:"-000",EDT:"-0500",CDT:"-0600",MDT:"-0700",PDT:"-0800"}}; +Date.getMonthNumberFromName=function(name){var n=Date.CultureInfo.monthNames,m=Date.CultureInfo.abbreviatedMonthNames,s=name.toLowerCase();for(var i=0;idate)?1:(this=start.getTime()&&t<=end.getTime();};Date.prototype.addMilliseconds=function(value){this.setMilliseconds(this.getMilliseconds()+value);return this;};Date.prototype.addSeconds=function(value){return this.addMilliseconds(value*1000);};Date.prototype.addMinutes=function(value){return this.addMilliseconds(value*60000);};Date.prototype.addHours=function(value){return this.addMilliseconds(value*3600000);};Date.prototype.addDays=function(value){return this.addMilliseconds(value*86400000);};Date.prototype.addWeeks=function(value){return this.addMilliseconds(value*604800000);};Date.prototype.addMonths=function(value){var n=this.getDate();this.setDate(1);this.setMonth(this.getMonth()+value);this.setDate(Math.min(n,this.getDaysInMonth()));return this;};Date.prototype.addYears=function(value){return this.addMonths(value*12);};Date.prototype.add=function(config){if(typeof config=="number"){this._orient=config;return this;} +var x=config;if(x.millisecond||x.milliseconds){this.addMilliseconds(x.millisecond||x.milliseconds);} +if(x.second||x.seconds){this.addSeconds(x.second||x.seconds);} +if(x.minute||x.minutes){this.addMinutes(x.minute||x.minutes);} +if(x.hour||x.hours){this.addHours(x.hour||x.hours);} +if(x.month||x.months){this.addMonths(x.month||x.months);} +if(x.year||x.years){this.addYears(x.year||x.years);} +if(x.day||x.days){this.addDays(x.day||x.days);} +return this;};Date._validate=function(value,min,max,name){if(typeof value!="number"){throw new TypeError(value+" is not a Number.");}else if(valuemax){throw new RangeError(value+" is not a valid value for "+name+".");} +return true;};Date.validateMillisecond=function(n){return Date._validate(n,0,999,"milliseconds");};Date.validateSecond=function(n){return Date._validate(n,0,59,"seconds");};Date.validateMinute=function(n){return Date._validate(n,0,59,"minutes");};Date.validateHour=function(n){return Date._validate(n,0,23,"hours");};Date.validateDay=function(n,year,month){return Date._validate(n,1,Date.getDaysInMonth(year,month),"days");};Date.validateMonth=function(n){return Date._validate(n,0,11,"months");};Date.validateYear=function(n){return Date._validate(n,1,9999,"seconds");};Date.prototype.set=function(config){var x=config;if(!x.millisecond&&x.millisecond!==0){x.millisecond=-1;} +if(!x.second&&x.second!==0){x.second=-1;} +if(!x.minute&&x.minute!==0){x.minute=-1;} +if(!x.hour&&x.hour!==0){x.hour=-1;} +if(!x.day&&x.day!==0){x.day=-1;} +if(!x.month&&x.month!==0){x.month=-1;} +if(!x.year&&x.year!==0){x.year=-1;} +if(x.millisecond!=-1&&Date.validateMillisecond(x.millisecond)){this.addMilliseconds(x.millisecond-this.getMilliseconds());} +if(x.second!=-1&&Date.validateSecond(x.second)){this.addSeconds(x.second-this.getSeconds());} +if(x.minute!=-1&&Date.validateMinute(x.minute)){this.addMinutes(x.minute-this.getMinutes());} +if(x.hour!=-1&&Date.validateHour(x.hour)){this.addHours(x.hour-this.getHours());} +if(x.month!==-1&&Date.validateMonth(x.month)){this.addMonths(x.month-this.getMonth());} +if(x.year!=-1&&Date.validateYear(x.year)){this.addYears(x.year-this.getFullYear());} +if(x.day!=-1&&Date.validateDay(x.day,this.getFullYear(),this.getMonth())){this.addDays(x.day-this.getDate());} +if(x.timezone){this.setTimezone(x.timezone);} +if(x.timezoneOffset){this.setTimezoneOffset(x.timezoneOffset);} +return this;};Date.prototype.clearTime=function(){this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this;};Date.prototype.isLeapYear=function(){var y=this.getFullYear();return(((y%4===0)&&(y%100!==0))||(y%400===0));};Date.prototype.isWeekday=function(){return!(this.is().sat()||this.is().sun());};Date.prototype.getDaysInMonth=function(){return Date.getDaysInMonth(this.getFullYear(),this.getMonth());};Date.prototype.moveToFirstDayOfMonth=function(){return this.set({day:1});};Date.prototype.moveToLastDayOfMonth=function(){return this.set({day:this.getDaysInMonth()});};Date.prototype.moveToDayOfWeek=function(day,orient){var diff=(day-this.getDay()+7*(orient||+1))%7;return this.addDays((diff===0)?diff+=7*(orient||+1):diff);};Date.prototype.moveToMonth=function(month,orient){var diff=(month-this.getMonth()+12*(orient||+1))%12;return this.addMonths((diff===0)?diff+=12*(orient||+1):diff);};Date.prototype.getDayOfYear=function(){return Math.floor((this-new Date(this.getFullYear(),0,1))/86400000);};Date.prototype.getWeekOfYear=function(firstDayOfWeek){var y=this.getFullYear(),m=this.getMonth(),d=this.getDate();var dow=firstDayOfWeek||Date.CultureInfo.firstDayOfWeek;var offset=7+1-new Date(y,0,1).getDay();if(offset==8){offset=1;} +var daynum=((Date.UTC(y,m,d,0,0,0)-Date.UTC(y,0,1,0,0,0))/86400000)+1;var w=Math.floor((daynum-offset+7)/7);if(w===dow){y--;var prevOffset=7+1-new Date(y,0,1).getDay();if(prevOffset==2||prevOffset==8){w=53;}else{w=52;}} +return w;};Date.prototype.isDST=function(){return this.toString().match(/(E|C|M|P)(S|D)T/)[2]=="D";};Date.prototype.getTimezone=function(){return Date.getTimezoneAbbreviation(this.getUTCOffset,this.isDST());};Date.prototype.setTimezoneOffset=function(s){var here=this.getTimezoneOffset(),there=Number(s)*-6/10;this.addMinutes(there-here);return this;};Date.prototype.setTimezone=function(s){return this.setTimezoneOffset(Date.getTimezoneOffset(s));};Date.prototype.getUTCOffset=function(){var n=this.getTimezoneOffset()*-10/6,r;if(n<0){r=(n-10000).toString();return r[0]+r.substr(2);}else{r=(n+10000).toString();return"+"+r.substr(1);}};Date.prototype.getDayName=function(abbrev){return abbrev?Date.CultureInfo.abbreviatedDayNames[this.getDay()]:Date.CultureInfo.dayNames[this.getDay()];};Date.prototype.getMonthName=function(abbrev){return abbrev?Date.CultureInfo.abbreviatedMonthNames[this.getMonth()]:Date.CultureInfo.monthNames[this.getMonth()];};Date.prototype._toString=Date.prototype.toString;Date.prototype.toString=function(format){var self=this;var p=function p(s){return(s.toString().length==1)?"0"+s:s;};return format?format.replace(/dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?/g,function(format){switch(format){case"hh":return p(self.getHours()<13?self.getHours():(self.getHours()-12));case"h":return self.getHours()<13?self.getHours():(self.getHours()-12);case"HH":return p(self.getHours());case"H":return self.getHours();case"mm":return p(self.getMinutes());case"m":return self.getMinutes();case"ss":return p(self.getSeconds());case"s":return self.getSeconds();case"yyyy":return self.getFullYear();case"yy":return self.getFullYear().toString().substring(2,4);case"dddd":return self.getDayName();case"ddd":return self.getDayName(true);case"dd":return p(self.getDate());case"d":return self.getDate().toString();case"MMMM":return self.getMonthName();case"MMM":return self.getMonthName(true);case"MM":return p((self.getMonth()+1));case"M":return self.getMonth()+1;case"t":return self.getHours()<12?Date.CultureInfo.amDesignator.substring(0,1):Date.CultureInfo.pmDesignator.substring(0,1);case"tt":return self.getHours()<12?Date.CultureInfo.amDesignator:Date.CultureInfo.pmDesignator;case"zzz":case"zz":case"z":return"";}}):this._toString();}; +Date.now=function(){return new Date();};Date.today=function(){return Date.now().clearTime();};Date.prototype._orient=+1;Date.prototype.next=function(){this._orient=+1;return this;};Date.prototype.last=Date.prototype.prev=Date.prototype.previous=function(){this._orient=-1;return this;};Date.prototype._is=false;Date.prototype.is=function(){this._is=true;return this;};Number.prototype._dateElement="day";Number.prototype.fromNow=function(){var c={};c[this._dateElement]=this;return Date.now().add(c);};Number.prototype.ago=function(){var c={};c[this._dateElement]=this*-1;return Date.now().add(c);};(function(){var $D=Date.prototype,$N=Number.prototype;var dx=("sunday monday tuesday wednesday thursday friday saturday").split(/\s/),mx=("january february march april may june july august september october november december").split(/\s/),px=("Millisecond Second Minute Hour Day Week Month Year").split(/\s/),de;var df=function(n){return function(){if(this._is){this._is=false;return this.getDay()==n;} +return this.moveToDayOfWeek(n,this._orient);};};for(var i=0;i0&&!last){try{q=d.call(this,r[1]);}catch(ex){last=true;}}else{last=true;} +if(!last&&q[1].length===0){last=true;} +if(!last){var qx=[];for(var j=0;j0){rx[0]=rx[0].concat(p[0]);rx[1]=p[1];}} +if(rx[1].length1){args=Array.prototype.slice.call(arguments);}else if(arguments[0]instanceof Array){args=arguments[0];} +if(args){for(var i=0,px=args.shift();i2)?n:(n+(((n+2000)Date.getDaysInMonth(this.year,this.month)){throw new RangeError(this.day+" is not a valid value for days.");} +var r=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second);if(this.timezone){r.set({timezone:this.timezone});}else if(this.timezoneOffset){r.set({timezoneOffset:this.timezoneOffset});} +return r;},finish:function(x){x=(x instanceof Array)?flattenAndCompact(x):[x];if(x.length===0){return null;} +for(var i=0;i t2) ? 1 : 0; + }; + + this.equals = function (time) { + return (this.compareTo(time) === 0); + }; + + this.add = function (time) { + return (time === null) ? this : this.addSeconds(time.getTotalMilliseconds() / 1000); + }; + + this.subtract = function (time) { + return (time === null) ? this : this.addSeconds(-time.getTotalMilliseconds() / 1000); + }; + + this.addDays = function (n) { + return new TimeSpan(this.getTotalMilliseconds() + (n * 86400000)); + }; + + this.addHours = function (n) { + return new TimeSpan(this.getTotalMilliseconds() + (n * 3600000)); + }; + + this.addMinutes = function (n) { + return new TimeSpan(this.getTotalMilliseconds() + (n * 60000)); + }; + + this.addSeconds = function (n) { + return new TimeSpan(this.getTotalMilliseconds() + (n * 1000)); + }; + + this.addMilliseconds = function (n) { + return new TimeSpan(this.getTotalMilliseconds() + n); + }; + + this.get12HourHour = function () { + return (this.getHours() > 12) ? this.getHours() - 12 : (this.getHours() === 0) ? 12 : this.getHours(); + }; + + this.getDesignator = function () { + return (this.getHours() < 12) ? Date.CultureInfo.amDesignator : Date.CultureInfo.pmDesignator; + }; + + this.toString = function (format) { + this._toString = function () { + if (this.getDays() !== null && this.getDays() > 0) { + return this.getDays() + "." + this.getHours() + ":" + this.p(this.getMinutes()) + ":" + this.p(this.getSeconds()); + } + else { + return this.getHours() + ":" + this.p(this.getMinutes()) + ":" + this.p(this.getSeconds()); + } + }; + + this.p = function (s) { + return (s.toString().length < 2) ? "0" + s : s; + }; + + var me = this; + + return format ? format.replace(/dd?|HH?|hh?|mm?|ss?|tt?/g, + function (format) { + switch (format) { + case "d": + return me.getDays(); + case "dd": + return me.p(me.getDays()); + case "H": + return me.getHours(); + case "HH": + return me.p(me.getHours()); + case "h": + return me.get12HourHour(); + case "hh": + return me.p(me.get12HourHour()); + case "m": + return me.getMinutes(); + case "mm": + return me.p(me.getMinutes()); + case "s": + return me.getSeconds(); + case "ss": + return me.p(me.getSeconds()); + case "t": + return ((me.getHours() < 12) ? Date.CultureInfo.amDesignator : Date.CultureInfo.pmDesignator).substring(0, 1); + case "tt": + return (me.getHours() < 12) ? Date.CultureInfo.amDesignator : Date.CultureInfo.pmDesignator; + } + } + ) : this._toString(); + }; + return this; +}; + +/** + * Gets the time of day for this date instances. + * @return {TimeSpan} TimeSpan + */ +Date.prototype.getTimeOfDay = function () { + return new TimeSpan(0, this.getHours(), this.getMinutes(), this.getSeconds(), this.getMilliseconds()); +}; + +/* + * TimePeriod(startDate, endDate); + * TimePeriod(years, months, days, hours, minutes, seconds, milliseconds); + */ +var TimePeriod = function (years, months, days, hours, minutes, seconds, milliseconds) { + var attrs = "years months days hours minutes seconds milliseconds".split(/\s+/); + + var gFn = function (attr) { + return function () { + return this[attr]; + }; + }; + + var sFn = function (attr) { + return function (val) { + this[attr] = val; + return this; + }; + }; + + for (var i = 0; i < attrs.length ; i++) { + var $a = attrs[i], $b = $a.slice(0, 1).toUpperCase() + $a.slice(1); + TimePeriod.prototype[$a] = 0; + TimePeriod.prototype["get" + $b] = gFn($a); + TimePeriod.prototype["set" + $b] = sFn($a); + } + + if (arguments.length == 7) { + this.years = years; + this.months = months; + this.setDays(days); + this.setHours(hours); + this.setMinutes(minutes); + this.setSeconds(seconds); + this.setMilliseconds(milliseconds); + } else if (arguments.length == 2 && arguments[0] instanceof Date && arguments[1] instanceof Date) { + // startDate and endDate as arguments + + var d1 = years.clone(); + var d2 = months.clone(); + + var temp = d1.clone(); + var orient = (d1 > d2) ? -1 : +1; + + this.years = d2.getFullYear() - d1.getFullYear(); + temp.addYears(this.years); + + if (orient == +1) { + if (temp > d2) { + if (this.years !== 0) { + this.years--; + } + } + } else { + if (temp < d2) { + if (this.years !== 0) { + this.years++; + } + } + } + + d1.addYears(this.years); + + if (orient == +1) { + while (d1 < d2 && d1.clone().addDays(Date.getDaysInMonth(d1.getYear(), d1.getMonth()) ) < d2) { + d1.addMonths(1); + this.months++; + } + } + else { + while (d1 > d2 && d1.clone().addDays(-d1.getDaysInMonth()) > d2) { + d1.addMonths(-1); + this.months--; + } + } + + var diff = d2 - d1; + + if (diff !== 0) { + var ts = new TimeSpan(diff); + this.setDays(ts.getDays()); + this.setHours(ts.getHours()); + this.setMinutes(ts.getMinutes()); + this.setSeconds(ts.getSeconds()); + this.setMilliseconds(ts.getMilliseconds()); + } + } + return this; +}; \ No newline at end of file diff --git a/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-Date-Range-Picker/js/daterangepicker.jQuery.compressed.js b/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-Date-Range-Picker/js/daterangepicker.jQuery.compressed.js new file mode 100644 index 0000000..caa48ea --- /dev/null +++ b/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-Date-Range-Picker/js/daterangepicker.jQuery.compressed.js @@ -0,0 +1 @@ +(function(a){a.fn.daterangepicker=function(s){var d=a(this);var e=a.extend({presetRanges:[{text:"Today",dateStart:"today",dateEnd:"today"},{text:"Last 7 days",dateStart:"today-7days",dateEnd:"today"},{text:"Month to date",dateStart:function(){return Date.parse("today").moveToFirstDayOfMonth()},dateEnd:"today"},{text:"Year to date",dateStart:function(){var w=Date.parse("today");w.setMonth(0);w.setDate(1);return w},dateEnd:"today"},{text:"The previous Month",dateStart:function(){return Date.parse("1 month ago").moveToFirstDayOfMonth()},dateEnd:function(){return Date.parse("1 month ago").moveToLastDayOfMonth()}}],presets:{specificDate:"Specific Date",allDatesBefore:"All Dates Before",allDatesAfter:"All Dates After",dateRange:"Date Range"},rangeStartTitle:"Start date",rangeEndTitle:"End date",nextLinkText:"Next",prevLinkText:"Prev",target:d,doneButtonText:"Done",earliestDate:Date.parse("-15years"),latestDate:Date.parse("+15years"),constrainDates:false,rangeSplitter:"-",dateFormat:"m/d/yy",closeOnSelect:true,arrows:false,appendTo:"body",onClose:function(){},onOpen:function(){},onChange:function(){},datepickerOptions:null},s);var g={onSelect:function(A,z){var y=j.find(".range-start");var B=j.find(".range-end");if(j.find(".ui-daterangepicker-specificDate").is(".ui-state-active")){B.datepicker("setDate",y.datepicker("getDate"))}a(this).trigger("constrainOtherPicker");var x=b(y.datepicker("getDate"));var w=b(B.datepicker("getDate"));if(d.length==2){d.eq(0).val(x);d.eq(1).val(w)}else{d.val((x!=w)?x+" "+e.rangeSplitter+" "+w:x)}if(e.closeOnSelect){if(!j.find("li.ui-state-active").is(".ui-daterangepicker-dateRange")&&!j.is(":animated")){k()}a(this).trigger("constrainOtherPicker");e.onChange()}},defaultDate:+0};d.bind("change",e.onChange);e.datepickerOptions=(s)?a.extend(g,s.datepickerOptions):g;var m,l=Date.parse("today");var o,i;if(d.size()==2){o=Date.parse(d.eq(0).val());i=Date.parse(d.eq(1).val());if(o==null){o=i}if(i==null){i=o}}else{o=Date.parse(d.val().split(e.rangeSplitter)[0]);i=Date.parse(d.val().split(e.rangeSplitter)[1]);if(i==null){i=o}}if(o!=null){m=o}if(i!=null){l=i}var j=a('
    ');var u=(function(){var y=a('
      ').appendTo(j);a.each(e.presetRanges,function(){a('
    • '+this.text+"
    • ").data("dateStart",this.dateStart).data("dateEnd",this.dateEnd).appendTo(y)});var w=0;a.each(e.presets,function(x,z){a('
    • '+z+"
    • ").appendTo(y);w++});y.find("li").hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).click(function(){j.find(".ui-state-active").removeClass("ui-state-active");a(this).addClass("ui-state-active");q(a(this),j,n,f);return false});return y})();function b(y){if(!y.getDate()){return""}var x=y.getDate();var A=y.getMonth();var z=y.getFullYear();A++;var w=e.dateFormat;return a.datepicker.formatDate(w,y)}a.fn.restoreDateFromData=function(){if(a(this).data("saveDate")){a(this).datepicker("setDate",a(this).data("saveDate")).removeData("saveDate")}return this};a.fn.saveDateToData=function(){if(!a(this).data("saveDate")){a(this).data("saveDate",a(this).datepicker("getDate"))}return this};function t(){if(j.data("state")=="closed"){v();j.fadeIn(300).data("state","open");e.onOpen()}}function k(){if(j.data("state")=="open"){j.fadeOut(300).data("state","closed");e.onClose()}}function c(){if(j.data("state")=="open"){k()}else{t()}}function v(){var w=p||d;var A=w.offset(),y="left",z=A.left,x=a(window).width()-z-w.outerWidth();if(z>x){y="right",z=x}j.parent().css(y,z).css("top",A.top+w.outerHeight())}function q(z,y,A,w){if(z.is(".ui-daterangepicker-specificDate")){w.hide();A.show();y.find(".title-start").text(e.presets.specificDate);y.find(".range-start").restoreDateFromData().css("opacity",1).show(400);y.find(".range-end").restoreDateFromData().css("opacity",0).hide(400);setTimeout(function(){w.fadeIn()},400)}else{if(z.is(".ui-daterangepicker-allDatesBefore")){w.hide();A.show();y.find(".title-end").text(e.presets.allDatesBefore);y.find(".range-start").saveDateToData().datepicker("setDate",e.earliestDate).css("opacity",0).hide(400);y.find(".range-end").restoreDateFromData().css("opacity",1).show(400);setTimeout(function(){w.fadeIn()},400)}else{if(z.is(".ui-daterangepicker-allDatesAfter")){w.hide();A.show();y.find(".title-start").text(e.presets.allDatesAfter);y.find(".range-start").restoreDateFromData().css("opacity",1).show(400);y.find(".range-end").saveDateToData().datepicker("setDate",e.latestDate).css("opacity",0).hide(400);setTimeout(function(){w.fadeIn()},400)}else{if(z.is(".ui-daterangepicker-dateRange")){w.hide();A.show();y.find(".title-start").text(e.rangeStartTitle);y.find(".title-end").text(e.rangeEndTitle);y.find(".range-start").restoreDateFromData().css("opacity",1).show(400);y.find(".range-end").restoreDateFromData().css("opacity",1).show(400);setTimeout(function(){w.fadeIn()},400)}else{w.hide();y.find(".range-start, .range-end").css("opacity",0).hide(400,function(){A.hide()});var B=(typeof z.data("dateStart")=="string")?Date.parse(z.data("dateStart")):z.data("dateStart")();var x=(typeof z.data("dateEnd")=="string")?Date.parse(z.data("dateEnd")):z.data("dateEnd")();y.find(".range-start").datepicker("setDate",B).find(".ui-datepicker-current-day").trigger("click");y.find(".range-end").datepicker("setDate",x).find(".ui-datepicker-current-day").trigger("click")}}}}return false}var n=a('
      Start Date
      End Date
      ').appendTo(j);n.find(".range-start, .range-end").datepicker(e.datepickerOptions);n.find(".range-start").datepicker("setDate",m);n.find(".range-end").datepicker("setDate",l);n.find(".range-start, .range-end").bind("constrainOtherPicker",function(){if(e.constrainDates){if(a(this).is(".range-start")){j.find(".range-end").datepicker("option","minDate",a(this).datepicker("getDate"))}else{j.find(".range-start").datepicker("option","maxDate",a(this).datepicker("getDate"))}}}).trigger("constrainOtherPicker");var f=a('").click(function(){j.find(".ui-datepicker-current-day").trigger("click");k()}).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).appendTo(n);a(this).click(function(){c();return false});n.hide().find(".range-start, .range-end, .btnDone").hide();j.data("state","closed");n.find(".ui-datepicker").css("display","block");a(e.appendTo).append(j);j.wrap('
      ');if(e.arrows&&d.size()==1){var h=a(''+e.prevLinkText+"");var r=a(''+e.nextLinkText+"");a(this).addClass("ui-rangepicker-input ui-widget-content").wrap('
      ').before(h).before(r).parent().find("a").click(function(){var x=n.find(".range-start").datepicker("getDate");var w=n.find(".range-end").datepicker("getDate");var y=Math.abs(new TimeSpan(x-w).getTotalMilliseconds())+86400000;if(a(this).is(".ui-daterangepicker-prev")){y=-y}n.find(".range-start, .range-end ").each(function(){var z=a(this).datepicker("getDate");if(z==null){return false}a(this).datepicker("setDate",z.add({milliseconds:y})).find(".ui-datepicker-current-day").trigger("click")});return false}).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});var p=d.parent()}a(document).click(function(){if(j.is(":visible")){k()}});j.click(function(){return false}).hide();return this}})(jQuery); \ No newline at end of file diff --git a/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-Date-Range-Picker/js/daterangepicker.jQuery.js b/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-Date-Range-Picker/js/daterangepicker.jQuery.js new file mode 100644 index 0000000..be07671 --- /dev/null +++ b/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-Date-Range-Picker/js/daterangepicker.jQuery.js @@ -0,0 +1,380 @@ +(function ($) { + + /** + * -------------------------------------------------------------------- + * jQuery-Plugin "daterangepicker.jQuery.js" + * by Scott Jehl, scott@filamentgroup.com + * reference article: http://www.filamentgroup.com/lab/update_date_range_picker_with_jquery_ui/ + * demo page: http://www.filamentgroup.com/examples/daterangepicker/ + * + * Copyright (c) 2010 Filament Group, Inc + * Dual licensed under the MIT (filamentgroup.com/examples/mit-license.txt) and GPL (filamentgroup.com/examples/gpl-license.txt) licenses. + * + * Dependencies: jquery, jquery UI datepicker, date.js, jQuery UI CSS Framework + + * 12.15.2010 Made some fixes to resolve breaking changes introduced by jQuery UI 1.8.7 + * -------------------------------------------------------------------- + */ + $.fn.daterangepicker = function(settings){ + var rangeInput = $(this); + + //defaults + var options = $.extend({ + presetRanges: [ + {text: 'Today', dateStart: 'today', dateEnd: 'today' }, + {text: 'Last 7 days', dateStart: 'today-7days', dateEnd: 'today' }, + {text: 'Month to date', dateStart: function(){ return Date.parse('today').moveToFirstDayOfMonth(); }, dateEnd: 'today' }, + {text: 'Year to date', dateStart: function(){ var x= Date.parse('today'); x.setMonth(0); x.setDate(1); return x; }, dateEnd: 'today' }, + //extras: + {text: 'The previous Month', dateStart: function(){ return Date.parse('1 month ago').moveToFirstDayOfMonth(); }, dateEnd: function(){ return Date.parse('1 month ago').moveToLastDayOfMonth(); } } + //{text: 'Tomorrow', dateStart: 'Tomorrow', dateEnd: 'Tomorrow' }, + //{text: 'Ad Campaign', dateStart: '03/07/08', dateEnd: 'Today' }, + //{text: 'Last 30 Days', dateStart: 'Today-30', dateEnd: 'Today' }, + //{text: 'Next 30 Days', dateStart: 'Today', dateEnd: 'Today+30' }, + //{text: 'Our Ad Campaign', dateStart: '03/07/08', dateEnd: '07/08/08' } + ], + //presetRanges: array of objects for each menu preset. + //Each obj must have text, dateStart, dateEnd. dateStart, dateEnd accept date.js string or a function which returns a date object + presets: { + specificDate: 'Specific Date', + allDatesBefore: 'All Dates Before', + allDatesAfter: 'All Dates After', + dateRange: 'Date Range' + }, + rangeStartTitle: 'Start date', + rangeEndTitle: 'End date', + nextLinkText: 'Next', + prevLinkText: 'Prev', + target: rangeInput, + doneButtonText: 'Done', + earliestDate: Date.parse('-15years'), //earliest date allowed + latestDate: Date.parse('+15years'), //latest date allowed + constrainDates: false, + rangeSplitter: '-', //string to use between dates in single input + dateFormat: 'm/d/yy', // date formatting. Available formats: http://docs.jquery.com/UI/Datepicker/%24.datepicker.formatDate + closeOnSelect: true, //if a complete selection is made, close the menu + arrows: false, + appendTo: 'body', + onClose: function(){}, + onOpen: function(){}, + onChange: function(){}, + datepickerOptions: null //object containing native UI datepicker API options + }, settings); + + + + //custom datepicker options, extended by options + var datepickerOptions = { + onSelect: function(dateText, inst) { + var range_start = rp.find('.range-start'); + var range_end = rp.find('.range-end'); + + if(rp.find('.ui-daterangepicker-specificDate').is('.ui-state-active')){ + range_end.datepicker('setDate', range_start.datepicker('getDate') ); + } + + $(this).trigger('constrainOtherPicker'); + + var rangeA = fDate( range_start.datepicker('getDate') ); + var rangeB = fDate( range_end.datepicker('getDate') ); + + //send back to input or inputs + if(rangeInput.length == 2){ + rangeInput.eq(0).val(rangeA); + rangeInput.eq(1).val(rangeB); + } + else{ + rangeInput.val((rangeA != rangeB) ? rangeA+' '+ options.rangeSplitter +' '+rangeB : rangeA); + } + //if closeOnSelect is true + if(options.closeOnSelect){ + if(!rp.find('li.ui-state-active').is('.ui-daterangepicker-dateRange') && !rp.is(':animated') ){ + hideRP(); + } + + $(this).trigger('constrainOtherPicker'); + + options.onChange(); + } + }, + defaultDate: +0 + }; + + //change event fires both when a calendar is updated or a change event on the input is triggered + rangeInput.bind('change', options.onChange); + + //datepicker options from options + options.datepickerOptions = (settings) ? $.extend(datepickerOptions, settings.datepickerOptions) : datepickerOptions; + + //Capture Dates from input(s) + var inputDateA, inputDateB = Date.parse('today'); + var inputDateAtemp, inputDateBtemp; + if(rangeInput.size() == 2){ + inputDateAtemp = Date.parse( rangeInput.eq(0).val() ); + inputDateBtemp = Date.parse( rangeInput.eq(1).val() ); + if(inputDateAtemp == null){inputDateAtemp = inputDateBtemp;} + if(inputDateBtemp == null){inputDateBtemp = inputDateAtemp;} + } + else { + inputDateAtemp = Date.parse( rangeInput.val().split(options.rangeSplitter)[0] ); + inputDateBtemp = Date.parse( rangeInput.val().split(options.rangeSplitter)[1] ); + if(inputDateBtemp == null){inputDateBtemp = inputDateAtemp;} //if one date, set both + } + if(inputDateAtemp != null){inputDateA = inputDateAtemp;} + if(inputDateBtemp != null){inputDateB = inputDateBtemp;} + + + //build picker and + var rp = $('
      '); + var rpPresets = (function(){ + var ul = $('
        ').appendTo(rp); + $.each(options.presetRanges,function(){ + $('
      • '+ this.text +'
      • ') + .data('dateStart', this.dateStart) + .data('dateEnd', this.dateEnd) + .appendTo(ul); + }); + var x=0; + $.each(options.presets, function(key, value) { + $('
      • '+ value +'
      • ') + .appendTo(ul); + x++; + }); + + ul.find('li').hover( + function(){ + $(this).addClass('ui-state-hover'); + }, + function(){ + $(this).removeClass('ui-state-hover'); + }) + .click(function(){ + rp.find('.ui-state-active').removeClass('ui-state-active'); + $(this).addClass('ui-state-active'); + clickActions($(this),rp, rpPickers, doneBtn); + return false; + }); + return ul; + })(); + + //function to format a date string + function fDate(date){ + if(!date.getDate()){return '';} + var day = date.getDate(); + var month = date.getMonth(); + var year = date.getFullYear(); + month++; // adjust javascript month + var dateFormat = options.dateFormat; + return $.datepicker.formatDate( dateFormat, date ); + } + + + $.fn.restoreDateFromData = function(){ + if($(this).data('saveDate')){ + $(this).datepicker('setDate', $(this).data('saveDate')).removeData('saveDate'); + } + return this; + }; + $.fn.saveDateToData = function(){ + if(!$(this).data('saveDate')){ + $(this).data('saveDate', $(this).datepicker('getDate') ); + } + return this; + }; + + //show, hide, or toggle rangepicker + function showRP(){ + if(rp.data('state') == 'closed'){ + positionRP(); + rp.fadeIn(300).data('state', 'open'); + options.onOpen(); + } + } + function hideRP(){ + if(rp.data('state') == 'open'){ + rp.fadeOut(300).data('state', 'closed'); + options.onClose(); + } + } + function toggleRP(){ + if( rp.data('state') == 'open' ){ hideRP(); } + else { showRP(); } + } + function positionRP(){ + var relEl = riContain || rangeInput; //if arrows, use parent for offsets + var riOffset = relEl.offset(), + side = 'left', + val = riOffset.left, + offRight = $(window).width() - val - relEl.outerWidth(); + + if(val > offRight){ + side = 'right', val = offRight; + } + + rp.parent().css(side, val).css('top', riOffset.top + relEl.outerHeight()); + } + + + + //preset menu click events + function clickActions(el, rp, rpPickers, doneBtn){ + + if(el.is('.ui-daterangepicker-specificDate')){ + //Specific Date (show the "start" calendar) + doneBtn.hide(); + rpPickers.show(); + rp.find('.title-start').text( options.presets.specificDate ); + rp.find('.range-start').restoreDateFromData().css('opacity',1).show(400); + rp.find('.range-end').restoreDateFromData().css('opacity',0).hide(400); + setTimeout(function(){doneBtn.fadeIn();}, 400); + } + else if(el.is('.ui-daterangepicker-allDatesBefore')){ + //All dates before specific date (show the "end" calendar and set the "start" calendar to the earliest date) + doneBtn.hide(); + rpPickers.show(); + rp.find('.title-end').text( options.presets.allDatesBefore ); + rp.find('.range-start').saveDateToData().datepicker('setDate', options.earliestDate).css('opacity',0).hide(400); + rp.find('.range-end').restoreDateFromData().css('opacity',1).show(400); + setTimeout(function(){doneBtn.fadeIn();}, 400); + } + else if(el.is('.ui-daterangepicker-allDatesAfter')){ + //All dates after specific date (show the "start" calendar and set the "end" calendar to the latest date) + doneBtn.hide(); + rpPickers.show(); + rp.find('.title-start').text( options.presets.allDatesAfter ); + rp.find('.range-start').restoreDateFromData().css('opacity',1).show(400); + rp.find('.range-end').saveDateToData().datepicker('setDate', options.latestDate).css('opacity',0).hide(400); + setTimeout(function(){doneBtn.fadeIn();}, 400); + } + else if(el.is('.ui-daterangepicker-dateRange')){ + //Specific Date range (show both calendars) + doneBtn.hide(); + rpPickers.show(); + rp.find('.title-start').text(options.rangeStartTitle); + rp.find('.title-end').text(options.rangeEndTitle); + rp.find('.range-start').restoreDateFromData().css('opacity',1).show(400); + rp.find('.range-end').restoreDateFromData().css('opacity',1).show(400); + setTimeout(function(){doneBtn.fadeIn();}, 400); + } + else { + //custom date range specified in the options (no calendars shown) + doneBtn.hide(); + rp.find('.range-start, .range-end').css('opacity',0).hide(400, function(){ + rpPickers.hide(); + }); + var dateStart = (typeof el.data('dateStart') == 'string') ? Date.parse(el.data('dateStart')) : el.data('dateStart')(); + var dateEnd = (typeof el.data('dateEnd') == 'string') ? Date.parse(el.data('dateEnd')) : el.data('dateEnd')(); + rp.find('.range-start').datepicker('setDate', dateStart).find('.ui-datepicker-current-day').trigger('click'); + rp.find('.range-end').datepicker('setDate', dateEnd).find('.ui-datepicker-current-day').trigger('click'); + } + + return false; + } + + + //picker divs + var rpPickers = $('
        Start Date
        End Date
        ').appendTo(rp); + rpPickers.find('.range-start, .range-end') + .datepicker(options.datepickerOptions); + + + rpPickers.find('.range-start').datepicker('setDate', inputDateA); + rpPickers.find('.range-end').datepicker('setDate', inputDateB); + + rpPickers.find('.range-start, .range-end') + .bind('constrainOtherPicker', function(){ + if(options.constrainDates){ + //constrain dates + if($(this).is('.range-start')){ + rp.find('.range-end').datepicker( "option", "minDate", $(this).datepicker('getDate')); + } + else{ + rp.find('.range-start').datepicker( "option", "maxDate", $(this).datepicker('getDate')); + } + } + }) + .trigger('constrainOtherPicker'); + + var doneBtn = $('') + .click(function(){ + rp.find('.ui-datepicker-current-day').trigger('click'); + hideRP(); + }) + .hover( + function(){ + $(this).addClass('ui-state-hover'); + }, + function(){ + $(this).removeClass('ui-state-hover'); + } + ) + .appendTo(rpPickers); + + + + + //inputs toggle rangepicker visibility + $(this).click(function(){ + toggleRP(); + return false; + }); + //hide em all + rpPickers.hide().find('.range-start, .range-end, .btnDone').hide(); + + rp.data('state', 'closed'); + + //Fixed for jQuery UI 1.8.7 - Calendars are hidden otherwise! + rpPickers.find('.ui-datepicker').css("display","block"); + + //inject rp + $(options.appendTo).append(rp); + + //wrap and position + rp.wrap('
        '); + + //add arrows (only available on one input) + if(options.arrows && rangeInput.size()==1){ + var prevLink = $(''+ options.prevLinkText +''); + var nextLink = $(''+ options.nextLinkText +''); + + $(this) + .addClass('ui-rangepicker-input ui-widget-content') + .wrap('
        ') + .before( prevLink ) + .before( nextLink ) + .parent().find('a').click(function(){ + var dateA = rpPickers.find('.range-start').datepicker('getDate'); + var dateB = rpPickers.find('.range-end').datepicker('getDate'); + var diff = Math.abs( new TimeSpan(dateA - dateB).getTotalMilliseconds() ) + 86400000; //difference plus one day + if($(this).is('.ui-daterangepicker-prev')){ diff = -diff; } + + rpPickers.find('.range-start, .range-end ').each(function(){ + var thisDate = $(this).datepicker( "getDate"); + if(thisDate == null){return false;} + $(this).datepicker( "setDate", thisDate.add({milliseconds: diff}) ).find('.ui-datepicker-current-day').trigger('click'); + }); + return false; + }) + .hover( + function(){ + $(this).addClass('ui-state-hover'); + }, + function(){ + $(this).removeClass('ui-state-hover'); + }); + + var riContain = rangeInput.parent(); + } + + + $(document).click(function(){ + if (rp.is(':visible')) { + hideRP(); + } + }); + + rp.click(function(){return false;}).hide(); + return this; + } + +})(jQuery); diff --git a/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-FileInput/css/enhanced.css b/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-FileInput/css/enhanced.css new file mode 100644 index 0000000..c2d5089 --- /dev/null +++ b/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-FileInput/css/enhanced.css @@ -0,0 +1,47 @@ +/*custom upload elements*/ +.customfile-input { position: absolute; left: -999em; background: transparent; border: 0; opacity: 0; -moz-opacity: 0; filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);} + +.customfile { cursor: pointer; width: auto; display: inline-block; position: relative; } +.customfile.input-append .customfile-feedback { border-radius: 3px 0 0 3px; } +.customfile.input-prepend .customfile-feedback { border-radius: 0 3px 3px 0; } +.customfile.input-prepend .add-on, .customfile.input-append .add-on{ + color:#333; + cursor: pointer; + display: inline-block; + background-color: #e6e6e6; + background-repeat: no-repeat; + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), color-stop(25%, #ffffff), to(#e6e6e6)); + background-image: -webkit-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); + background-image: -moz-linear-gradient(top, #ffffff, #ffffff 25%, #e6e6e6); + background-image: -ms-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); + background-image: -o-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); + background-image: linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0); +} +.customfile-disabled { opacity: .5; filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0); cursor: default; } +.customfile-feedback { border: 1px solid #CCCCCC; color: #808080; display: inline-block; font-size: 13px; line-height: 18px; padding: 4px; + -webkit-transition: border linear 0.2s, box-shadow linear 0.2s; + -moz-transition: border linear 0.2s, box-shadow linear 0.2s; + -ms-transition: border linear 0.2s, box-shadow linear 0.2s; + -o-transition: border linear 0.2s, box-shadow linear 0.2s; + transition: border linear 0.2s, box-shadow linear 0.2s; + -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1); + -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1); + box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1); + +} +/* IE7 hack */ +*+html .customfile-feedback { margin-top: 1px;} +/* EO Hack */ +.customfile-feedback-populated { padding-left: 25px; background: url(../images/icon-generic.gif) 5px center no-repeat; white-space: nowrap; text-overflow: ellipsis; -o-text-overflow: ellipsis; overflow: hidden; } + +.customfile-button { /* IE7 and bellow hack*/ *margin-top: -1px; /* EO Hack */} +.customfile:hover .customfile-button, .customfile-focus .customfile-button { background-position: 0 -15px; color: #333; text-decoration: none;} +.customfile-focus .customfile-button {} + + +/*file type icons*/ +.customfile-ext-jpg, .customfile-ext-gif, .customfile-ext-png, .customfile-ext-jpeg, .customfile-ext-bmp { background-image: url(../images/icon-image.gif);} +.customfile-ext-mp3, .customfile-ext-mp4, .customfile-ext-mov, .customfile-ext-swf, .customfile-ext-wav, .customfile-ext-m4v { background-image: url(../images/icon-media.gif);} +.customfile-ext-zip, .customfile-ext-tar, .customfile-ext-sit { background-image: url(../images/icon-zip.gif);} + diff --git a/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-FileInput/images/icon-generic.gif b/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-FileInput/images/icon-generic.gif new file mode 100644 index 0000000..b6397cd Binary files /dev/null and b/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-FileInput/images/icon-generic.gif differ diff --git a/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-FileInput/images/icon-image.gif b/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-FileInput/images/icon-image.gif new file mode 100644 index 0000000..9492f5b Binary files /dev/null and b/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-FileInput/images/icon-image.gif differ diff --git a/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-FileInput/images/icon-media.gif b/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-FileInput/images/icon-media.gif new file mode 100644 index 0000000..8596c0c Binary files /dev/null and b/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-FileInput/images/icon-media.gif differ diff --git a/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-FileInput/images/icon-zip.gif b/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-FileInput/images/icon-zip.gif new file mode 100644 index 0000000..93e46e0 Binary files /dev/null and b/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-FileInput/images/icon-zip.gif differ diff --git a/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-FileInput/js/enhance.min.js b/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-FileInput/js/enhance.min.js new file mode 100644 index 0000000..2c87a35 --- /dev/null +++ b/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-FileInput/js/enhance.min.js @@ -0,0 +1,6 @@ +/* + * EnhanceJS version 1.1 - Test-Driven Progressive Enhancement + * http://enhancejs.googlecode.com/ + * Copyright (c) 2010 Filament Group, Inc, authors.txt + * Licensed under MIT (license.txt) +*/(function(a,b,c){function o(){return!!b.cookie}function p(){J(d.testName,"fail");a.location.reload()}function q(){J(d.testName,"pass");a.location.reload()}function r(){L(d.testName);a.location.reload()}function s(){f=b.createElement("body");i.insertBefore(f,i.firstChild);e=f}function t(){i.removeChild(f);e=b.body}function u(){var a=K(d.testName);if(a){if(a==="pass"){y();d.onPass()}else{d.onFail();x()}d.appendToggleLink&&v(function(){w(a)})}else{var b=!0;s();for(var c in d.tests){b=d.tests[c]();if(!b){d.alertOnFailure&&alert(c+" failed");break}}t();a=b?"pass":"fail";J(d.testName,a);if(b){y();d.onPass()}else{d.onFail();x()}d.appendToggleLink&&v(function(){w(a)})}}function v(b){if(g)b();else{var c=a.onload;a.onload=function(){c&&c();b()}}}function w(a){if(!d.appendToggleLink||!enhance.cookiesSupported)return;if(a){var c=b.createElement("a");c.href="#";c.className=d.testName+"_toggleResult";c.innerHTML=a==="pass"?d.forceFailText:d.forcePassText;c.onclick=a==="pass"?enhance.forceFail:enhance.forcePass;b.getElementsByTagName("body")[0].appendChild(c)}}function x(){i.className=i.className.replace(d.testName,"")}function y(){j=!0;d.loadStyles.length&&D();d.loadScripts.length?F():d.onScriptsLoaded()}function z(b,c){if(K(k)&&K(l)){L(k);L(l)}else{J(k,b);J(l,c)}a.location.reload()}function A(a){m.length==2&&(a==m[0]?a=m[1]:a==m[1]&&(a=m[0]));return a}function B(){var a=d.testName+"-incomplete";i.className.indexOf(a)===-1&&(i.className+=" "+a)}function C(a){if(a.constructor===Array){var b=!0;for(var c in a)b&&(b=!!a[c]);return b}return!!a}function D(){var a=-1,e;while(e=d.loadStyles[++a]){var f=b.createElement("link");f.type="text/css";f.rel="stylesheet";f.onerror=d.onLoadError;if(typeof e=="string"){f.href=e;h.appendChild(f)}else{if(e.media){e.media=A(e.media);d.media&&d.media[e.media]!==c&&(e.media=d.media[e.media])}e.excludemedia&&(e.excludemedia=A(e.excludemedia));var g=!0;e.media&&e.media!=="print"&&e.media!=="projection"&&e.media!=="speech"&&e.media!=="aural"&&e.media!=="braille"&&(g=n(e.media));g&&e.excludemedia&&(g=!n(e.excludemedia));g&&e.iecondition&&(g=E(e.iecondition));if(g&&e.ifsupported!==c){g=C(e.ifsupported);if(!g&&e.fallback!==c){e.href=e.fallback;g=!0}}if(g){for(var i in e)i!=="iecondition"&&i!=="excludemedia"&&i!=="ifsupported"&&i!=="fallback"&&f.setAttribute(i,e[i]);h.appendChild(f)}}}}function F(){d.queueLoading?G():H()}function G(){function b(){if(a.length===0)return!1;var c=a.shift(),e=I(c),f=!1;if(!e)return b();e.onload=e.onreadystatechange=function(){if(!f&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){f=!0;b()===!1&&d.onScriptsLoaded();this.onload=this.onreadystatechange=null}};h.insertBefore(e,h.firstChild)}var a=[].concat(d.loadScripts);b()}function H(){var a=-1,b;while(b=d.loadScripts[++a]){var c=I(b);c&&h.insertBefore(c,h.firstChild)}d.onScriptsLoaded()}function I(a){var e=b.createElement("script");e.type="text/javascript";e.onerror=d.onLoadError;if(typeof a=="string"){e.src=a;return e}if(a.media){a.media=A(a.media);d.media&&d.media[a.media]&&(a.media=d.media[a.media])}a.excludemedia&&(a.excludemedia=A(a.excludemedia));var f=!0;a.media&&(f=n(a.media));f&&a.excludemedia&&(f=!n(a.excludemedia));f&&a.iecondition&&(f=E(a.iecondition));if(f&&a.ifsupported!==c){f=C(a.ifsupported);if(!f&&a.fallback!==c){a.src=a.fallback;f=!0}}if(f){for(var g in a)g!=="iecondition"&&g!=="media"&&g!=="excludemedia"&&g!=="ifsupported"&&g!=="fallback"&&e.setAttribute(g,a[g]);return e}return!1}function J(a,c,d){d=d||90;var e=new Date;e.setTime(e.getTime()+d*24*60*60*1e3);var f="; expires="+e.toGMTString();b.cookie=a+"="+c+f+"; path=/"}function K(a){var c=a+"=",d=b.cookie.split(";");for(var e=0;e
        ";e.appendChild(c);var f=c.childNodes,g=f[0].offsetTop,h=f[1],i=h.offsetTop;if(g===i){h.style.clear="left";i=h.offsetTop;g!==i&&(a=!0)}e.removeChild(c);return a},heightOverflow:function(){var a=b.createElement("div");a.innerHTML='
        ';a.style.cssText="overflow: hidden; height: 0;";e.appendChild(a);var c=a.offsetHeight;e.removeChild(a);return c===0},ajax:function(){var a=!1,b=-1,c,d=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}];while(c=d[++b]){try{a=c()}catch(e){continue}break}return!!a},resize:function(){return a.onresize!=0},print:function(){return!!a.print}};enhance.defaultSettings={testName:"enhanced",loadScripts:[],loadStyles:[],queueLoading:!0,appendToggleLink:!0,forcePassText:"View high-bandwidth version",forceFailText:"View low-bandwidth version",tests:enhance.defaultTests,media:{"-ejs-desktop":enhance.query("screen and (max-device-width: 1024px)")?"not screen and (max-device-width: 1024px)":"screen","-ejs-handheld":"screen and (max-device-width: 1024px)"},addTests:{},alertOnFailure:!1,onPass:function(){},onFail:function(){},onLoadError:B,onScriptsLoaded:function(){}};enhance.cookiesSupported=o();enhance.cookiesSupported&&(enhance.forceFail=p);enhance.cookiesSupported&&(enhance.forcePass=q);enhance.cookiesSupported&&(enhance.reTest=r);enhance.toggleMedia=z;var E=function(){var a={},d;return function(e){return!1}}()})(window,document); \ No newline at end of file diff --git a/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-FileInput/js/fileinput.jquery.js b/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-FileInput/js/fileinput.jquery.js new file mode 100644 index 0000000..960520b --- /dev/null +++ b/crm/src/main/webapp/jquery-ui-bootstrap/third-party/jQuery-UI-FileInput/js/fileinput.jquery.js @@ -0,0 +1,139 @@ +/** + * -------------------------------------------------------------------- + * jQuery customfileinput plugin + * Author: Scott Jehl, scott@filamentgroup.com + * Copyright (c) 2009 Filament Group. Updated 2012. + * licensed under MIT (filamentgroup.com/examples/mit-license.txt) + * -------------------------------------------------------------------- + */ + +/** + * All credits go to the Author of this file, some additional customization was + * done for theme compat. purposes. + * + * Additional bugfixes/changes by smurfy + */ +!function ($) { + + "use strict"; // jshint ;_; + + /* FILEINPUT CLASS DEFINITION + * ====================== */ + + var CustomFileInput = function (content, options) { + var self = this; + this.$element = $(content); + + this.options = $.extend({ + classes : (this.$element.attr('class') ? this.$element.attr('class') : ''), + }, options); + + //create custom control container + this.$upload = $('
        '); + //create custom control feedback + this.$uploadFeedback = $('').appendTo(this.$upload); + //create custom control button + this.$uploadButton = $('').css({ float : this.options.button_position }); + + this.$element + .addClass('customfile-input') //add class for CSS + .on('focus', $.proxy(this.onFocus, this)) + .on('blur', $.proxy(this.onBlur, this)) + .on('disable', $.proxy(this.onDisable, this)) + .on('enable', $.proxy(this.onEnable, this)) + .on('checkChange', $.proxy(this.onCheckChange, this)) + .on('change', $.proxy(this.onChange, this)) + .on('click', $.proxy(this.onClick, this)); + + if ('right' === this.options.button_position) { + this.$uploadButton.insertAfter(this.$uploadFeedback); + } else { + this.$uploadButton.insertBefore(this.$uploadFeedback); + } + + //match disabled state + if (this.$element.is('[disabled]')) { + this.$element.trigger('disable'); + } else { + this.$upload.on('click', function () { self.$element.trigger('click'); }); + } + + //insert original input file in dom, css if hide it outside of screen + this.$upload.insertAfter(this.$element); + this.$element.insertAfter(this.$upload); + }; + + CustomFileInput.prototype = { + constructor: CustomFileInput, + + onClick : function() { + var self = this; + this.$element.data('val', this.$element.val()); + setTimeout(function(){ + self.$element.trigger('checkChange'); + } ,100); + }, + + onCheckChange: function() { + if(this.$element.val() && this.$element.val() != this.$element.data('val')){ + this.$element.trigger('change'); + } + }, + + onEnable: function() { + this.$element.removeAttr('disabled'); + this.$upload.removeClass('customfile-disabled'); + }, + + onDisable: function() { + this.$element.attr('disabled',true); + this.$upload.addClass('customfile-disabled'); + }, + + onFocus: function() { + this.$upload.addClass('customfile-focus'); + this.$element.data('val', this.$element.val()); + }, + + onBlur: function() { + this.$upload.removeClass('customfile-focus'); + this.$element.trigger('checkChange'); + }, + + onChange : function() { + //get file name + var fileName = this.$element.val().split(/\\/).pop(); + if (!fileName) { + this.$uploadFeedback + .val(this.options.feedback_text) //set feedback text to filename + .removeClass('customfile-feedback-populated'); //add class to show populated state + this.$uploadButton.text(this.options.button_text); + } else { + this.$uploadFeedback + .val(fileName) //set feedback text to filename + .addClass('customfile-feedback-populated'); //add class to show populated state + this.$uploadButton.text(this.options.button_change_text); + } + } + }; + + $.fn.customFileInput = function(option){ + return this.each(function () { + var $this = $(this); + var data = $this.data('customFileInput') + var options = $.extend({}, $.fn.customFileInput.defaults, $this.data(), typeof option == 'object' && option); + if (!data) { + $this.data('customFileInput', (data = new CustomFileInput(this, options))); + } + }) + }; + + $.fn.customFileInput.defaults = { + button_position : 'right', + feedback_text : 'No file selected...', + button_text : 'Browse', + button_change_text : 'Change' + } + +}(window.jQuery); + diff --git a/crm/src/main/webapp/jquery-ui-bootstrap/third-party/wijmo/jquery.bgiframe-2.1.3-pre.js b/crm/src/main/webapp/jquery-ui-bootstrap/third-party/wijmo/jquery.bgiframe-2.1.3-pre.js new file mode 100644 index 0000000..165aef4 --- /dev/null +++ b/crm/src/main/webapp/jquery-ui-bootstrap/third-party/wijmo/jquery.bgiframe-2.1.3-pre.js @@ -0,0 +1,39 @@ +/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net) + * Licensed under the MIT License (LICENSE.txt). + * + * Version 2.1.3-pre + */ + +(function($){ + +$.fn.bgiframe = ($.browser.msie && /msie 6\.0/i.test(navigator.userAgent) ? function(s) { + s = $.extend({ + top : 'auto', // auto == .currentStyle.borderTopWidth + left : 'auto', // auto == .currentStyle.borderLeftWidth + width : 'auto', // auto == offsetWidth + height : 'auto', // auto == offsetHeight + opacity : true, + src : 'javascript:false;' + }, s); + var html = '');if(typeof d==="string"&&d.length>0){b.element.addClass("wijmo-wijdialog-hasframe");c.attr("src",d);b.element.append(c);b.innerFrame=c}b.contentWrapper=b.element},_setOption:function(c,d){var b=this;a.ui.dialog.prototype._setOption.apply(b,arguments);if(c!=="captionButtons")if(c==="disabled")b._handleDisabledOption(d,b.element);else if(c==="contentUrl")if(b.innerFrame)b.innerFrame.attr("src",d);else b._checkUrl()},_createCaptionButtons:function(){var c=[],b=this,h=b.options,d,g={pin:{visible:true,click:b.pin,iconClassOn:"ui-icon-pin-w",iconClassOff:"ui-icon-pin-s"},refresh:{visible:true,click:b.refresh,iconClassOn:"ui-icon-refresh"},toggle:{visible:true,click:b.toggle,iconClassOn:"ui-icon-carat-1-n",iconClassOff:"ui-icon-carat-1-s"},minimize:{visible:true,click:b.minimize,iconClassOn:"ui-icon-minus"},maximize:{visible:true,click:b.maximize,iconClassOn:"ui-icon-extlink"},close:{visible:true,click:b.close,iconClassOn:"ui-icon-close"}},e=h.captionButtons,f=b.uiDialogTitlebar;f.children(".ui-dialog-titlebar-close, .wijmo-wijdialog-captionbutton").remove();a.each(g,function(b,d){e&&e[b]&&a.extend(d,e[b]);c.push({button:b,info:d})});b._trigger("buttonCreating",null,c);for(d=0;d");if(c.visible){if(i.size()===0){e.addClass("ui-icon "+c.iconClassOn).text(f.button);d=a('').append(e).addClass(h+" ui-corner-all wijmo-wijdialog-captionbutton").attr("role","button").hover(function(){d.addClass(b)},function(){d.removeClass(b)}).click(function(){if(e.hasClass(c.iconClassOff))e.removeClass(c.iconClassOff);else e.addClass(c.iconClassOff);a.isFunction(c.click)&&c.click.apply(j,arguments);return false});if(k)return d;else d.appendTo(g)}j[f.button+"Button"]=d}else i.remove()},pin:function(){var b=this.uiDialog,a=this.isPin;this._enableDisableDragger(!a);this.isPin=!a},refresh:function(){var a=this.innerFrame;a!==undefined&&a.attr("src",a.attr("src"))},toggle:function(){var a=this,b=a.toggleButton.children("span");if(!a.minimized)if(a.collapsed===undefined||!a.collapsed){a.collapsed=true;!b.hasClass("ui-icon-carat-1-s")&&b.addClass("ui-icon-carat-1-s");a._collapseDialogContent(true)}else{a.collapsed=false;b.hasClass("ui-icon-carat-1-s")&&b.removeClass("ui-icon-carat-1-s");a._expandDialogContent(true)}},_expandDialogContent:function(d){var b=this,e=b.options,c=e.expandingAnimation;b.uiDialog.height("auto");if(d&&c!==null)b.contentWrapper.show(c.animated,c.options,c.duration,function(d){b.uiDialog.css("height",b._toggleHeight);a.isFunction(c.callback)&&c.callback(d);b._enableDisableResizer(false)});else{b.contentWrapper.show();b._enableDisableResizer(false);b.uiDialog.css("height",b.toggleHeight)}},_collapseDialogContent:function(c){var a=this,d=a.options,b=d.collapsingAnimation;a._enableDisableResizer(true);a._toggleHeight=a.uiDialog[0].style.height;a.uiDialog.height("auto");if(c&&b!==null)a.contentWrapper.hide(b.animated,b.options,b.duration);else a.contentWrapper.hide();a._enableDisableDragger(a.isPin)},_enableDisableResizer:function(a){var b=this.uiDialog;b.resizable({disabled:a});a&&b.removeClass("ui-state-disabled")},_enableDisableDragger:function(a){var b=this.uiDialog;b.draggable({disabled:a});a&&b.removeClass("ui-state-disabled")},minimize:function(){var b=this,k=b.uiDialog,q=b.options,f=null,h=a("
        "),j=a("
        "),e,n,p,l,g={},o,i={},d="uiDialog",m;if(!b.minimized){l=b.uiDialog.position();g.width=b.uiDialog.width();g.height=b.uiDialog.height();m=b.getState();if(b.maximized){b.maximized=false;b.restoreButton.remove();a(window).unbind(".onWinResize")}else{b.collapsed&&b._expandDialogContent(false);b._saveNormalState()}b._enableDisableResizer(true);b.collapsed&&b._collapseDialogContent(false);h.appendTo(document.body).css({top:b.uiDialog.offset().top,left:b.uiDialog.offset().left,height:b.uiDialog.innerHeight(),width:b.uiDialog.innerWidth(),position:"absolute"});b.contentWrapper.hide();b.uiDialogButtonPane.length&&b.uiDialogButtonPane.hide();k.height("auto");k.width("auto");b._doButtonAction(b.minimizeButton,"hide");b._restoreButton(true,b.minimizeButton,"After");b._doButtonAction(b.pinButton,"hide");b._doButtonAction(b.refreshButton,"hide");b._doButtonAction(b.toggleButton,"hide");b._doButtonAction(b.maximizeButton,"show");a.browser.webkit&&a(".wijmo-wijdialog-captionbutton",b.uiDialog).css("float","left");if(b.innerFrame){d="copy";b[d]=b.uiDialog.clone();b[d].empty();b.uiDialogTitlebar.appendTo(b[d])}if(q.minimizeZoneElementId.length>0)f=a("#"+q.minimizeZoneElementId);if(f!==null&&f.size()>0)f.append(b[d]);else{e=a("."+c);if(e.size()===0){e=a('
        ');a(document.body).append(e)}e.append(b[d]).css("z-index",k.css("z-index"))}b[d].css("position","static");b[d].css("float","left");if(a.browser.msie&&a.browser.version==="6.0"){n=a(document).scrollTop();p=document.documentElement.clientHeight-e.height()+n;e.css({position:"absolute",left:"0px",top:p})}j.appendTo(document.body).css({top:b[d].offset().top,left:b[d].offset().left,height:b[d].innerHeight(),width:b[d].innerWidth(),position:"absolute"});b.uiDialog.hide();b.innerFrame&&b[d].hide();h.effect("transfer",{to:j,className:"ui-widget-content"},100,function(){h.remove();j.remove();b[d].show();b.minimized=true;o=b.uiDialog.position();i.width=b.uiDialog.width();i.height=b.uiDialog.height();b._enableDisableDragger(true);b._trigger("resize",null,{originalPosition:l,originalSize:g,position:o,size:i});b._trigger("stateChanged",null,{originalState:m,state:"minimized"})})}},_doButtonAction:function(a,c){if(a!==undefined){a.removeClass(b);a[c]()}},maximize:function(){var b=this,h=a(window),e,c={},f,d={},g;if(!b.maximized){b._enableDisableDragger(false);e=b.uiDialog.position();c.width=b.uiDialog.width();c.height=b.uiDialog.height();if(b.minimized)b.restore();else{b.collapsed&&b._expandDialogContent(false);b._saveNormalState();g="normal"}b.maximized=true;if(b.maximizeButton!==undefined){b.maximizeButton.hide();b._restoreButton(true,b.maximizeButton,"Before")}a.browser.webkit&&a(".wijmo-wijdialog-captionbutton").css("float","");b._onWinResize(b,h);b.collapsed&&b._collapseDialogContent(false);!b.collapsed&&b._enableDisableDragger(true);b.uiDialog.resizable({disabled:true});b.uiDialog.removeClass("ui-state-disabled");f=b.uiDialog.position();d.width=b.uiDialog.width();d.height=b.uiDialog.height();b._trigger("resize",null,{originalPosition:e,originalSize:c,position:f,size:d});g=="normal"&&b._trigger("stateChanged",null,{originalState:"normal",state:"maximized"})}},_bindWindowResize:function(){var b=this,d=a(window),f,e,c;d.resize(function(){b.maximized&&b._onWinResize(b,d)});a.browser.msie&&a.browser.version==="6.0"&&d.bind("scroll.wijdialog resize.wijdialog",function(){if(b.minimized){e=a(document).scrollTop();c=b.uiDialog.parent();f=document.documentElement.clientHeight-c.height()+e;c.css({top:f})}})},_saveNormalState:function(){var a=this,b=a.uiDialog,c=a.element;if(!a.maximized){a.normalWidth=b.css("width");a.normalLeft=b.css("left");a.normalTop=b.css("top");a.normalHeight=b.css("height");a.normalInnerHeight=c.css("height");a.normalInnerWidth=c.css("width");a.normalInnerMinWidth=c.css("min-width");a.normalInnerMinHeight=c.css("min-height")}},_onWinResize:function(a,b){a.uiDialog.css("top",b.scrollTop());a.uiDialog.css("left",b.scrollLeft());a.uiDialog.setOutWidth(b.width());a.uiDialog.setOutHeight(b.height());a._resizeDialog(a)},_restoreButton:function(c,f,e){var a=this,d={button:"restore",info:{visible:c,click:a.restore,iconClassOn:"ui-icon-newwin"}},b=a._createCaptionButton(d,a.uiDialogTitlebar,true);if(c){b["insert"+e](f);a.restoreButton=b}},restore:function(){var b=this,f=b.uiDialog,g,d={},h,e={},j=a("
        "),k=a("
        "),c="uiDialog",i;if(b.minimized){b.minimized=false;b._enableDisableDragger(false);if(b.innerFrame){c="copy";if(!b[c])c="uiDialog"}g=b[c].position();d.width=b[c].width();d.height=b[c].height();j.appendTo(document.body).css({top:b[c].offset().top,left:b[c].offset().left,height:b[c].innerHeight(),width:b[c].innerWidth(),position:"absolute"});f.css("position","absolute");f.css("float","");if(!b.innerFrame)f.appendTo(document.body);else{b.uiDialogTitlebar.prependTo(f);f.show()}b._enableDisableResizer(false);!b.isPin&&b._enableDisableDragger(false);b._restoreToNormal();b.contentWrapper.show();b.uiDialogButtonPane.length&&b.uiDialogButtonPane.show();k.appendTo(document.body).css({top:b.uiDialog.offset().top,left:b.uiDialog.offset().left,height:b.uiDialog.innerHeight(),width:b.uiDialog.innerWidth(),position:"absolute"});b.uiDialog.hide();j.effect("transfer",{to:k,className:"ui-widget-content"},150,function(){b.uiDialog.show();h=b.uiDialog.position();e.width=b.uiDialog.width();e.height=b.uiDialog.height();j.remove();k.remove();b.copy&&b.copy.remove();b._trigger("resize",null,{originalPosition:g,originalSize:d,position:h,size:e});i=b.getState();b._trigger("stateChanged",null,{originalState:"minimized",state:i})});b.collapsed&&b._collapseDialogContent();b._doButtonAction(b.minimizeButton,"show");b._doButtonAction(b.restoreButton,"remove");b._doButtonAction(b.pinButton,"show");b._doButtonAction(b.refreshButton,"show");b._doButtonAction(b.toggleButton,"show");a.browser.webkit&&a(".wijmo-wijdialog-captionbutton").css("float","")}else if(b.maximized){b.maximized=false;g=b.uiDialog.position();d.width=b.uiDialog.width();d.height=b.uiDialog.height();a(window).unbind(".onWinResize");b.collapsed&&b._expandDialogContent();b._enableDisableResizer(false);!b.isPin&&b._enableDisableDragger(false);b._restoreToNormal();b.contentWrapper.show();b.collapsed&&b._collapseDialogContent();if(b.maximizeButton!==undefined){b.maximizeButton.show();b._restoreButton(false,b.maximizeButton,"before")}h=b.uiDialog.position();e.width=b.uiDialog.width();e.height=b.uiDialog.height();b._trigger("resize",null,{originalPosition:g,originalSize:d,position:h,size:e});i=b.getState();b._trigger("stateChanged",null,{originalState:"maximized",state:i})}},getState:function(){var a=this;return a.minimized?"minimized":a.maximized?"maximized":"normal"},reset:function(){var a=this;a.normalWidth=a.normalLeft=a.normalTop=a.normalHeight=a.normalInnerHeight=a.normalInnerWidth=a.normalInnerMinWidth=a.normalInnerMinHeight=undefined;a._setOption("position",a.originalPosition)},open:function(){var b=this,c=b.options;if(!b.innerFrame)if(!b.minimized)a.ui.dialog.prototype.open.apply(b,arguments);else b.uiDialog.show();else{b.innerFrame.attr("src",c.contentUrl);if(!b.minimized)a.ui.dialog.prototype.open.apply(b,arguments);else b.uiDialogTitlebar.show()}b.collapsed&&b._collapseDialogContent();b.disabledDiv&&c.disabled&&b.disabledDiv.show()},close:function(){var b=this,c=b.options;if(a.ui.dialog.prototype.close.apply(b,arguments)){if(b.innerFrame){b.innerFrame.attr("src","");b.minimized&&b.uiDialogTitlebar.hide()}b.disabledDiv&&c.disabled&&b.disabledDiv.hide()}},_resizeDialog:function(a){a.options.width=a.uiDialog.width();a.options.height=a.uiDialog.height();a._size()},_restoreToNormal:function(){var a=this,b=a.uiDialog,c=a.element;b.css("width",a.normalWidth);b.css("left",a.normalLeft);b.css("top",a.normalTop);b.css("height",a.normalHeight);c.css("height",a.normalInnerHeight);c.css("width",a.normalInnerWidth);c.css("min-width",a.normalInnerMinWidth);c.css("min-height",a.normalInnerMinHeight);a.options.width=a.uiDialog.width();a.options.height=a.uiDialog.height()}});a.extend(a.ui.dialog.overlay,{height:function(){var b,c;if(a.browser.msie){b=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);c=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return b li > :first-child,> :not(li):even",requireOpenedPane:true,selectedIndex:0},_setOption:function(d,b){var c=this.options;if(c[d]!==b)switch(d){case"selectedIndex":this.activate(b);break;case"disabled":if(b)this.element.addClass("ui-state-disabled");else this.element.removeClass("ui-state-disabled");break;case"event":this._unbindLiveEvents();this.options.event=b;this._bindLiveEvents();break;case"header":this._handleHeaderChange(b,c.header);break;case"expandDirection":this._onDirectionChange(b,true,c.expandDirection)}a.Widget.prototype._setOption.apply(this,arguments)},_handleHeaderChange:function(b,a){var c=this.element.find(a);c.removeClass("ui-accordion-header ui-helper-reset ui-state-active "+this._triangleIconOpened).siblings(".ui-accordion-content").removeClass("ui-accordion-content ui-helper-reset ui-widget-content ui-accordion-content-active");this._initHeaders(b)},_initHeaders:function(a){var b=this.options;a=a?a:b.header;this.headers=this.element.find(a);this.headers.each(jQuery.proxy(this._initHeader,this))},_initHeader:function(e,f){var g=this.options,d=this.element.data("rightToLeft"),b=a(f),c=a(b.next()[0]);if(d){b.remove();b.insertAfter(c)}b.addClass("ui-accordion-header ui-helper-reset").attr("role","tab");c.attr("role","tabpanel");b.find("> a").length===0&&b.wrapInner('');b.find("> .ui-icon").length===0&&a('').insertBefore(a("> a",b)[0]);if(e===g.selectedIndex){b.addClass("ui-state-active").addClass(this._headerCornerOpened).attr({"aria-expanded":"true",tabIndex:0}).find("> .ui-icon").addClass(this._triangleIconOpened);c.addClass("ui-accordion-content-active").addClass(this._contentCornerOpened)}else{b.addClass("ui-state-default ui-corner-all").attr({"aria-expanded":"false",tabIndex:-1}).find("> .ui-icon").addClass(this._triangleIconClosed);c.hide()}c.addClass("ui-accordion-content ui-helper-reset ui-widget-content")},_create:function(){this.element.addClass("wijmo-wijaccordion ui-accordion ui-widget ui-accordion-icons ui-helper-reset ui-helper-clearfix");var a=this.options;a.disabled&&this.element.addClass("ui-state-disabled");this._onDirectionChange(a.expandDirection,false);this._initHeaders();this.element.attr("role","tablist")},_init:function(){this._bindLiveEvents()},destroy:function(){this._unbindLiveEvents();this.element.removeClass("wijmo-wijaccordion ui-accordion ui-widget ui-helper-reset ui-accordion-icons").removeAttr("role");a.Widget.prototype.destroy.apply(this,arguments)},activate:function(e){var b,c=this.options,n=this.element.children(".ui-accordion-header"),f=this.element.find(".ui-accordion-header.ui-state-active"),p=this.element.data("rightToLeft"),i,k,g,h,r,l,o,m,j,q,d;if(typeof e==="number")b=a(n[e]);else if(typeof e==="string"){e=parseInt(e,0);b=a(n[e])}else{b=a(e);e=n.index(e)}if(b.hasClass("ui-state-active")){if(c.requireOpenedPane)return false;f=b;b=a(null)}else if(!c.requireOpenedPane)f=a(null);i=a(".ui-accordion-header",this.element).index(b);k=a(".ui-accordion-header",this.element).index(f);g=p?b.prev(".ui-accordion-content"):b.next(".ui-accordion-content");h=p?f.prev(".ui-accordion-content"):f.next(".ui-accordion-content");if(f.length===0&&b.length===0)return false;if(!this._trigger("beforeSelectedIndexChanged",null,{newIndex:i,prevIndex:k}))return false;f.removeClass("ui-state-active").removeClass(this._headerCornerOpened).addClass("ui-state-default ui-corner-all").attr({"aria-expanded":"false",tabIndex:-1}).find("> .ui-icon").removeClass(this._triangleIconOpened).addClass(this._triangleIconClosed);b.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active").addClass(this._headerCornerOpened).attr({"aria-expanded":"true",tabIndex:0}).find("> .ui-icon").removeClass(this._triangleIconClosed).addClass(this._triangleIconOpened);if(c.animated){l={toShow:g,toHide:h,complete:jQuery.proxy(function(){h.removeClass("ui-accordion-content-active");g.addClass("ui-accordion-content-active");h.css("display","");g.css("display","");if(a.fn.wijlinechart){h.find(".wijmo-wijlinechart").wijlinechart("redraw");g.find(".wijmo-wijlinechart").wijlinechart("redraw")}this._trigger("selectedIndexChanged",null,{newIndex:i,prevIndex:k})},this),horizontal:this.element.hasClass("ui-helper-horizontal"),rightToLeft:this.element.data("rightToLeft"),down:i>k,autoHeight:c.autoHeight||c.fillSpace};o=c.animated;m=c.duration;if(a.isFunction(o))c.animated=o(l);if(a.isFunction(m))c.duration=m(l);j=a.wijmo.wijaccordion.animations;q=c.duration;d=c.animated;if(d&&!j[d]&&!a.easing[d])d="slide";if(!j[d])j[d]=function(a){this.slide(a,{easing:d,duration:q||700})};j[d](l)}else{f.length>0&&h.hide().removeClass("ui-accordion-content-active");b.length>0&&g.show().addClass("ui-accordion-content-active").addClass(this._contentCornerOpened);if(a.fn.wijlinechart){h.find(".wijmo-wijlinechart").wijlinechart("redraw");g.find(".wijmo-wijlinechart").wijlinechart("redraw")}this._trigger("selectedIndexChanged",null,{newIndex:i,prevIndex:k})}this.options.selectedIndex=i},_bindLiveEvents:function(){this.element.find(".ui-accordion-header").live(this.options.event+".wijaccordion",jQuery.proxy(this._onHeaderClick,this)).live("keydown.wijaccordion",jQuery.proxy(this._onHeaderKeyDown,this)).live("mouseenter.wijaccordion",function(){a(this).addClass("ui-state-hover")}).live("mouseleave.wijaccordion",function(){a(this).removeClass("ui-state-hover")}).live("focus.wijaccordion",function(){a(this).addClass("ui-state-focus")}).live("blur.wijaccordion",function(){a(this).removeClass("ui-state-focus")})},_unbindLiveEvents:function(){this.element.find(".ui-accordion-header").die("wijaccordion")},_onHeaderClick:function(a){!this.options.disabled&&this.activate(a.currentTarget);return false},_onHeaderKeyDown:function(d){if(this.options.disabled||d.altKey||d.ctrlKey)return;var b=a.ui.keyCode,g=this.options,f=this.element.find(".ui-accordion-header.ui-state-focus"),c,e=this.element.find(".ui-accordion-header");if(f.length>0){c=a(".ui-accordion-header",this.element).index(f);switch(d.keyCode){case b.RIGHT:case b.DOWN:if(e[c+1]){e[c+1].focus();return false}break;case b.LEFT:case b.UP:if(e[c-1]){e[c-1].focus();return false}break;case b.SPACE:case b.ENTER:this.activate(d.currentTarget);d.preventDefault()}}return true},_onDirectionChange:function(j,e,i){var b,g,f,d,c,h;if(e){g=this.element.find(".ui-accordion-header."+this._headerCornerOpened);g.removeClass(this._headerCornerOpened);f=this.element.find(".ui-accordion-content."+this._contentCornerOpened);f.removeClass(this._contentCornerOpened);d=this.element.find("."+this._triangleIconOpened);c=this.element.find("."+this._triangleIconClosed);d.removeClass(this._triangleIconOpened);c.removeClass(this._triangleIconClosed)}i!==null&&this.element.removeClass("ui-accordion-"+i);switch(j){case"top":this._headerCornerOpened="ui-corner-bottom";this._contentCornerOpened="ui-corner-top";this._triangleIconOpened="ui-icon-triangle-1-n";this._triangleIconClosed="ui-icon-triangle-1-e";b=true;this.element.removeClass("ui-helper-horizontal");this.element.addClass("ui-accordion-top");break;case"right":this._headerCornerOpened="ui-corner-left";this._contentCornerOpened="ui-corner-right";this._triangleIconOpened="ui-icon-triangle-1-e";this._triangleIconClosed="ui-icon-triangle-1-s";b=false;this.element.addClass("ui-helper-horizontal");this.element.addClass("ui-accordion-right");break;case"left":this._headerCornerOpened="ui-corner-right";this._contentCornerOpened="ui-corner-left";this._triangleIconOpened="ui-icon-triangle-1-w";this._triangleIconClosed="ui-icon-triangle-1-s";b=true;this.element.addClass("ui-helper-horizontal");this.element.addClass("ui-accordion-left");break;default:this._headerCornerOpened="ui-corner-top";this._contentCornerOpened="ui-corner-bottom";this._triangleIconOpened="ui-icon-triangle-1-s";this._triangleIconClosed="ui-icon-triangle-1-e";b=false;this.element.removeClass("ui-helper-horizontal");this.element.addClass("ui-accordion-bottom")}h=this.element.data("rightToLeft");this.element.data("rightToLeft",b);if(e){d.addClass(this._triangleIconOpened);c.addClass(this._triangleIconClosed);g.addClass(this._headerCornerOpened);f.addClass(this._contentCornerOpened)}e&&b!==h&&this.element.children(".ui-accordion-header").each(function(){var c=a(this),d;if(b){d=c.next(".ui-accordion-content");c.remove();c.insertAfter(d)}else{d=c.prev(".ui-accordion-content");c.remove();c.insertBefore(d)}})}});a.extend(a.wijmo.wijaccordion,{animations:{slide:function(b,h){b=a.extend({easing:"swing",duration:300},b,h);if(!b.toHide.size()){b.toShow.stop(true,true).animate(b.horizontal?{width:"show"}:{height:"show"},b);return}if(!b.toShow.size()){b.toHide.stop(true,true).animate(b.horizontal?{width:"hide"}:{height:"hide"},b);return}var i=b.toShow.css("overflow"),f=0,e={},g={},j=b.horizontal?["width","paddingLeft","paddingRight"]:["height","paddingTop","paddingBottom"],d,c=b.toShow;if(b.horizontal){d=c[0].style.height;c.height(parseInt(c.parent().height(),10)-parseInt(c.css("paddingTop"),10)-parseInt(c.css("paddingBottom"),10)-(parseInt(c.css("borderTopWidth"),10)||0)-(parseInt(c.css("borderBottomWidth"),10)||0))}else{d=c[0].style.width;c.width(parseInt(c.parent().width(),10)-parseInt(c.css("paddingLeft"),10)-parseInt(c.css("paddingRight"),10)-(parseInt(c.css("borderLeftWidth"),10)||0)-(parseInt(c.css("borderRightWidth"),10)||0))}a.each(j,function(f,d){g[d]="hide";var c=(""+a.css(b.toShow[0],d)).match(/^([\d+-.]+)(.*)$/);e[d]={value:c?c[1]:0,unit:c?c[2]||"px":"px"}});b.toShow.css(b.horizontal?{width:0,overflow:"hidden"}:{height:0,overflow:"hidden"}).stop(true,true).show();b.toHide.filter(":hidden").each(b.complete).end().filter(":visible").stop(true,true).animate(g,{step:function(c,a){if(a.prop===b.horizontal?"width":"height")f=a.end-a.start===0?0:(a.now-a.start)/(a.end-a.start);b.toShow[0].style[a.prop]=f*e[a.prop].value+e[a.prop].unit},duration:b.duration,easing:b.easing,complete:function(){!b.autoHeight&&b.toShow.css(b.horizontal?"width":"height","");b.toShow.css(b.horizontal?"height":"width",d);b.toShow.css({overflow:i});b.complete()}})},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1e3:200})}}})})(jQuery); +(function(a){"use strict";a.fn.extend({getBounds:function(){return a.extend({},a(this).offset(),{width:a(this).outerWidth(true),height:a(this).outerHeight(true)})},setBounds:function(b){a(this).css({left:b.left,top:b.top}).width(b.width).height(b.height);return this},getMaxZIndex:function(){var b=(a(this).css("z-index")=="auto"?0:a(this).css("z-index"))*1;a(this).siblings().each(function(d,c){b=Math.max(b,(a(c).css("z-index")=="auto"?0:a(c).css("z-index"))*1)});return b}});a.widget("wijmo.wijpopup",{options:{ensureOutermost:false,showEffect:"show",showOptions:{},showDuration:300,hideEffect:"hide",hideOptions:{},hideDuration:100,autoHide:false,position:{at:"left bottom",my:"left top"},showing:null,shown:null,hiding:null,hidden:null,posChanged:null},_create:function(){},_init:function(){if(!!this.options.ensureOutermost){var b=a("form");if(b.length===0)b=a(document.body);this.element.appendTo(b)}this.element.data("visible.wijpopup",false);this.element.css("position","absolute");this.element.position({of:a(document.body)});this.element.hide()},_setOption:function(c){a.Widget.prototype._setOption.apply(this,arguments);if(c==="autoHide"){var b=this.isVisible();this.hide();b&&this.show()}},destroy:function(){a.Widget.prototype.destroy.apply(this,arguments);this.isVisible()&&this.hide();if(a.browser.msie&&a.browser.version<7){jFrame=this.element.data("backframe.wijpopup");!jFrame&&jFrame.remove()}var b=this;this.element.unbind(".wijpopup");a.each(["visible","backframe","animating","width"],function(c,a){b.element.removeData(a+".wijpopup")})},isVisible:function(){return!!this.element.data("visible.wijpopup")&&this.element.is(":visible")},isAnimating:function(){return!!this.element.data("animating.wijpopup")},show:function(d){this._setPosition(d);if(this.isVisible())return;if(this._trigger("showing")===false)return;this.options.autoHide&&a(document.body).bind("mouseup.wijpopup",a.proxy(this._onDocMouseUp,this));var b=this.options.showEffect||"show",c=this.options.showDuration||300,e=this.options.showOptions||{};this.element.data("animating.wijpopup",true);if(a.effects&&a.effects[b])this.element.show(b,e,c,a.proxy(this._showCompleted,this));else this.element[b](b==="show"?null:c,a.proxy(this._showCompleted,this));(!b||!c||b==="show"||c<=0)&&this._showCompleted()},_showCompleted:function(){this.element.removeData("animating.wijpopup");this.element.data("visible.wijpopup",true);this._trigger("shown")},showAt:function(a,b){this.show({my:"left top",at:"left top",of:document.body,offset:""+a+" "+b})},hide:function(){if(!this.isVisible())return;if(this._trigger("hiding")===false)return;a(document.body).unbind("mouseup.wijpopup");var b=this.options.hideEffect||"hide",c=this.options.hideDuration||300,d=this.options.hideOptions||{};this.element.data("animating.wijpopup",true);if(a.effects&&a.effects[b])this.element.hide(b,d,c,a.proxy(this._hideCompleted,this));else this.element[b](b==="hide"?null:c,a.proxy(this._hideCompleted,this));(!b||!c||b==="hide"||c<=0)&&this._hideCompleted()},_hideCompleted:function(){if(this.element.data("width.wijpopup")!==undefined){this.element.width(this.element.data("width.wijpopup"));this.element.removeData("width.wijpopup")}this.element.unbind("move.wijpopup");this.element.removeData("animating.wijpopup");if(a.browser.msie&&a.browser.version<7){var b=this.element.data("backframe.wijpopup");b&&b.hide()}this._trigger("hidden")},_onDocMouseUp:function(b){var c=b.target?b.target:b.srcElement;if(this.isVisible()&&!!this.options.autoHide)c!=this.element.get(0)&&a(c).parents().index(this.element)<0&&this.hide()},_onMove:function(){var a=this.element.data("backframe.wijpopup");if(a){this.element.before(a);a.css({top:this.element.css("top"),left:this.element.css("left")})}},_addBackgroundIFrame:function(){if(a.browser.msie&&a.browser.version<7){var b=this.element.data("backframe.wijpopup");if(!b){b=jQuery("
        + Count +
        Zero
        One
        ' + data.firstName + '' + data.lastName + '' + data.jobTitle + '' + data.dob.getDate() + ' ' + months[data.dob.getMonth()] + ' ' + data.dob.getFullYear() +'' + data.status.name + '' + (i+1) + '.' + (j+1) + '