⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 card.java

📁 一个日本流行的,功能较全的开源Web办公管理(Groupware)系统。
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
		String usrid = (hsPara.get(CDCmd.PA_USER)!=null)?(String)(((String[])hsPara.get(CDCmd.PA_USER))[0]):Integer.toString(dftuid);
		//怴婯嶌惉夋柺僼儔僌
		int newFlg = hget.getInt(CDCmd.PA_NEWFLG);
		// 慜夋柺偺扴摉儐乕僓乕
		int tempUsr = hget.getInt(CDCmd.PA_TMPUSR);
		// 慜夋柺偺扴摉僌儖乕僾
		int tempGid = hget.getInt(CDCmd.PA_TMPGID);

		//怴婯嶌惉夋柺偱栠傞帪
		if ((hget.getStringArray("cansel.x") != null) &&
			(newFlg == 1)){
			gid = tempGid;
			uid = tempUsr;
			usrid = Integer.toString(tempUsr);
		}
		if (tempUsr == -1){
			tempUsr = uid;
		}
		if (tempGid == -1){
			tempGid = gid;
		}
		String helpUrl = hget.getString("help");
		String urlMap = (String)hsInitData.get(CDCmd.CD_MAP);
		String dataDir = (String)hsInitData.get(CDCmd.CD_DIR);
		String carddataDir = dataDir+CDCmd.CD_DATA+"/";
		carddataDir = carddataDir.replace('/',File.separatorChar);
		CreatePage page=null;
		String[] buf;
		String[] buf1;
		int[] buf2;

		//???
		String emid2 = "0";
		if (hsPara.get(CDCmd.PA_CID) != null){
			emid2 = (String)((String[])hsPara.get(CDCmd.PA_CID))[0];
		}

		// 愝掕僼傽僀儖庢摼
		uconf = new CDUserConfFile(dataDir,sessionUID.toString());
		uconf.Load();
		int maxpage = uconf.GetDisplayMax();
		int maxpagei = uconf.GetDisplay();
		uconf.Save();
		int intpage = 1;
		if(hsPara.get(CDCmd.PA_PAG)!=null)
			intpage = Integer.parseInt(((String[])hsPara.get(CDCmd.PA_PAG))[0]);

		/* 僄儔乕帪偺僷儔儊乕僞僙僢僩  2001/03/22 update  */
		String cdurl = GSTool.removeParaFormURI(req.getRequestURI());
		String nexturl = "";
		nexturl = cdurl + "?" + CDCmd.PA_CMD + "=" + Integer.toString(cmd)
			+ "&" + CDCmd.PA_MOD + "=" + Integer.toString(mod)
			+ "&" + CDCmd.PA_USER + "=" + Integer.toString(uid)
			+ "&" + CDCmd.PA_GROUP + "=" + Integer.toString(gid)
			+ "&" + CDCmd.PA_PAG + "=" + Integer.toString(intpage)
			+ "&" + CDCmd.PA_CID + "=" + emid2
			+ "&" + CDCmd.PA_IDX + "=" + Integer.toString(index);
		/* ----------------------------------------------- */

		// 傾僪儗僗挔偱巊梡
		MailAddress address = null;
		ADIndex indexs = null;
		String next_mail_url = "";
		RequestDispatcher dispatcher = null;

		switch(cmd){
		case CDCmd.CD_CARD1:// 柤巋乮夛幮乯
			buf = (String[])hsPara.get("pers.x");//屄恖愝掕
			if(buf!=null) {
				uconf = new CDUserConfFile(dataDir,sessionUID.toString());
				uconf.Load();
				int mailer = uconf.GetMailer();
				if(getMailerURL() != null)
					hsPara.put(CDCmd.PA_MAILERURL, "1");
				page = new Createcard_setting(hsInitData,hsPara,intpage,maxpagei,mod,index,uid,gid,mailer);
				break;
			} 

			buf = (String[])hsPara.get(CDCmd.PA_TOCID);
			if(buf!=null) {
				if(buf[0].length() > 0) {
					String backurl = "?"+CDCmd.PA_CMD+"="+Integer.toString(cmd)
						+"&"+CDCmd.PA_MOD+"="+Integer.toString(mod)
						+"&"+CDCmd.PA_USER+"="+Integer.toString(uid)
						+"&"+CDCmd.PA_GROUP+"="+Integer.toString(gid)
						+"&"+CDCmd.PA_PAG+"="+Integer.toString(intpage)
						+"&"+CDCmd.PA_CID+"="+emid2
						+"&"+CDCmd.PA_IDX+"="+Integer.toString(index);
					String[] cboxs = (String[])hsPara.get("cbox");
					if(cboxs != null) {
						for(int i=0; i < cboxs.length; i++) {
							backurl += "&cbox="+cboxs[i];
						}
					}

					try {
						CDCardFile cardfile = new CDCardFile(carddataDir, buf[0], 0);
						cardfile.Load();
						MailAddress toAddress = new MailAddress();
						toAddress.addTO(cardfile.getName(), cardfile.getMail());
						session.setAttribute(GSBase.SESSION_MAIL_ADDRESS, toAddress);

						backurl = req.getServletPath() + backurl;
						session.setAttribute(GSBase.SESSION_SENDBACK_URL, backurl);

						RequestDispatcher maildispatcher = req.getRequestDispatcher(getMailerURL());
						maildispatcher.forward(req, res);
						break;
					} catch(Exception e) {
						backurl = GSTool.removeParaFormURI(req.getRequestURI()) + backurl;
						page = new CreateErrorPage("儊乕儔乕夋柺偵堏摦偱偒傑偣傫偱偟偨丅", urlMap, backurl);
						break;
					}
				}
			}

			buf = (String[])hsPara.get("new.x");//怴婯柤巋
			if(buf!=null) {
				// temp僼傽僀儖嶌惉
				CDCardFile ctemp = new CDCardFile(dataDir+CDCmd.CD_IX_TN,sessionUID.toString(),1);
				ctemp.Delete();
				ctemp.CDCard(0,0,0,"","","","","","","","","","","","","","","","","0","0","");
				ctemp.Save();
				//page = new Createcard_new(hsInitData,hsPara,intpage,sessionUID.toString(),UM,CDCmd.CD_CARD1,index,gid);
				//page = new Createcard_new(hsPara,urlMap,dataDir,helpUrl,intpage,sessionUID.toString(),
				//						  UM,CDCmd.CD_CARD1,index,dfgid,tempUsr,tempGid);
				page = new Createcard_new(hsPara,urlMap,dataDir,(String)hsInitData.get("help"),intpage,sessionUID.toString(),UM,CDCmd.CD_CARD1,index,dfgid,tempUsr,tempGid);
				break; 
			} 
            
            /* 2002/04/01 update by a.matsubara ----------------------------------------------------------------  */
            buf = (String[])hsPara.get("del.x"); // 嶍彍乮堦棗乯
            if(buf!=null) {
            	buf1 = (String[])hsPara.get("cbox");
                if(buf1!=null) {
                	page = new Createcard_delList(hsInitData,intpage,index,UM,mod,buf1,uid,gid); // 嶍彍僼傽僀儖堦棗
                    break;
                }
            }
            /* -------------------------------------------------------------------------------------------------  */


			/* 2000/09/12 update by hideyuki kitade  -----------------------------------------------------------  */
			buf = (String[])hsPara.get("export.x");//僄僋僗億乕僩
			if(buf!=null) {
				buf1 = (String[])hsPara.get("cbox");
				if(buf1!=null) {
//					page = new Createcard_expList(hsInitData,hsPara,intpage,index,UM,mod,buf1,uid,gid); // 僄僋僗億乕僩僼傽僀儖堦棗
					page = new Createcard_expList(hsInitData,intpage,index,UM,mod,buf1,uid,gid); // 僄僋僗億乕僩僼傽僀儖堦棗
					break;
				}
			}

			buf = (String[])hsPara.get("import.x");//僀儞億乕僩
			if(buf!=null) {
				page = new Createcard_import(hsInitData,hsPara,UM,intpage,CDCmd.CD_CARD1,uid,gid,index);
				break;
			}
			/* -------------------------------------------------------------------------------------------------  */

			buf = (String[])hsPara.get("arl.x");//慜儁乕僕
			if(buf!=null) {
				intpage--;
			} 
			buf = (String[])hsPara.get("arr.x");//師儁乕僕
			if(buf!=null) {
				intpage++;
			} 

			buf = (String[])hsPara.get("reset.x");//慖戰夝彍
			if(buf!=null) {
				hsPara.remove("cbox");
			}

			// 儊僀儔乕敾掕
			if(getMailerURL() != null) {
				uconf = new CDUserConfFile(dataDir,sessionUID.toString());
				uconf.Load();
				if(uconf.GetMailer() == 0)
					hsPara.put(CDCmd.PA_MAILERURL, "1");
			}

			page = new Createcard_kaisha(hsInitData,hsPara,intpage,uconf.GetDisplayMax(),index,UM,uid);
			break;
		case CDCmd.CD_CARD2:// 柤巋乮柤慜乯
			buf = (String[])hsPara.get("pers.x");//屄恖愝掕
			if(buf!=null) {
				uconf = new CDUserConfFile(dataDir,sessionUID.toString());
				uconf.Load();
				int mailer = uconf.GetMailer();
				if(getMailerURL() != null)
					hsPara.put(CDCmd.PA_MAILERURL, "1");
				page = new Createcard_setting(hsInitData,hsPara,intpage,maxpagei,CDCmd.CD_CARD2,index,uid,gid,mailer);
				break; 
			} 

			buf = (String[])hsPara.get(CDCmd.PA_TOCID);
			if(buf!=null) {
				if(buf[0].length() > 0) {
					String backurl = "?"+CDCmd.PA_CMD+"="+Integer.toString(cmd)
						+"&"+CDCmd.PA_MOD+"="+Integer.toString(mod)
						+"&"+CDCmd.PA_USER+"="+Integer.toString(uid)
						+"&"+CDCmd.PA_GROUP+"="+Integer.toString(gid)
						+"&"+CDCmd.PA_PAG+"="+Integer.toString(intpage)
						+"&"+CDCmd.PA_CID+"="+emid2
						+"&"+CDCmd.PA_IDX+"="+Integer.toString(index);
					String[] cboxs = (String[])hsPara.get("cbox");
					if(cboxs != null) {
						for(int i=0; i < cboxs.length; i++) {
							backurl += "&cbox="+cboxs[i];
						}
					}

					try {
						CDCardFile cardfile = new CDCardFile(carddataDir, buf[0], 0);
						cardfile.Load();
						MailAddress toAddress = new MailAddress();
						toAddress.addTO(cardfile.getName(), cardfile.getMail());
						session.setAttribute(GSBase.SESSION_MAIL_ADDRESS, toAddress);

						backurl = req.getServletPath() + backurl;
						session.setAttribute(GSBase.SESSION_SENDBACK_URL, backurl);

						RequestDispatcher maildispatcher = req.getRequestDispatcher(getMailerURL());
						maildispatcher.forward(req, res);
						break;
					} catch(Exception e) {
						backurl = GSTool.removeParaFormURI(req.getRequestURI()) + backurl;
						page = new CreateErrorPage("儊乕儔乕夋柺偵堏摦偱偒傑偣傫偱偟偨丅", urlMap, backurl);
						break;
					}
				}
			}

			buf = (String[])hsPara.get("new.x");//怴婯柤巋
			if(buf!=null) {
				// temp僼傽僀儖嶌惉
				CDCardFile ctemp = new CDCardFile(dataDir+CDCmd.CD_IX_TN,sessionUID.toString(),1);
				ctemp.Delete();
				ctemp.CDCard(0,0,0,"","","","","","","","","","","","","","","","","0","0","");
				ctemp.Save();
				//page = new Createcard_new(hsInitData,hsPara,intpage,sessionUID.toString(),UM,CDCmd.CD_CARD2,index,gid);
				page = new Createcard_new(hsPara,urlMap,dataDir,helpUrl,intpage,sessionUID.toString(),
										  UM,CDCmd.CD_CARD2,index,dfgid,tempUsr,tempGid);
				break; 
			} 

            /* 2002/04/01 update by a.matsubara ----------------------------------------------------------------  */
            buf = (String[])hsPara.get("del.x"); // 嶍彍乮堦棗乯
            if(buf!=null) {
            	buf1 = (String[])hsPara.get("cbox");
                if(buf1!=null) {
                	page = new Createcard_delList(hsInitData,intpage,index,UM,mod,buf1,uid,gid); // 嶍彍僼傽僀儖堦棗
                    break;
                }
            }
            /* -------------------------------------------------------------------------------------------------  */

			buf = (String[])hsPara.get("arl.x");//慜儁乕僕
			if(buf!=null) {
				intpage--;
			} 
			buf = (String[])hsPara.get("arr.x");//師儁乕僕
			if(buf!=null) {
				intpage++;
			} 

			/* 2000/09/12 update by hideyuki kitade  ----------------------------------------------------- */
			buf = (String[])hsPara.get("export.x");//僄僋僗億乕僩
			if(buf!=null) {
				buf1 = (String[])hsPara.get("cbox");
				if(buf1!=null) {
//					page = new Createcard_expList(hsInitData,hsPara,intpage,index,UM,mod,buf1,uid,gid);  // 僄僋僗億乕僩僼傽僀儖堦棗
					page = new Createcard_expList(hsInitData,intpage,index,UM,mod,buf1,uid,gid); // 僄僋僗億乕僩僼傽僀儖堦棗
					break;
				}
			}

			buf = (String[])hsPara.get("import.x");//僀儞億乕僩
			if(buf!=null) {
				page = new Createcard_import(hsInitData,hsPara,UM,intpage,CDCmd.CD_CARD2,uid,gid,index);
				break;
			}
			/* --------------------------------------------------------------------------------------------- */

			buf = (String[])hsPara.get("reset.x");//慖戰夝彍
			if(buf!=null) {
				hsPara.remove("cbox");
			}

			// 儊僀儔乕敾掕
			if(getMailerURL() != null) {
				uconf = new CDUserConfFile(dataDir,sessionUID.toString());
				uconf.Load();
				if(uconf.GetMailer() == 0)
					hsPara.put(CDCmd.PA_MAILERURL, getMailerURL());
			}

			page = new Createcard_name(hsInitData,hsPara,intpage,uconf.GetDisplayMax(),index,UM);
			break;
 		case CDCmd.CD_CARD3:// 柤巋乮扴摉乯
			buf = (String[])hsPara.get("pers.x");//屄恖愝掕
			if(buf!=null) {
				uconf = new CDUserConfFile(dataDir,sessionUID.toString());
				uconf.Load();
				int mailer = uconf.GetMailer();
				if(getMailerURL() != null)
					hsPara.put(CDCmd.PA_MAILERURL, "1");
				page = new Createcard_setting(hsInitData,hsPara,intpage,maxpagei,CDCmd.CD_CARD3,index,uid,gid,mailer);
				break; 
			} 

			buf = (String[])hsPara.get(CDCmd.PA_TOCID);
			if(buf!=null) {
				if(buf[0].length() > 0) {
					String backurl = "?"+CDCmd.PA_CMD+"="+Integer.toString(cmd)
						+"&"+CDCmd.PA_MOD+"="+Integer.toString(mod)
						+"&"+CDCmd.PA_USER+"="+Integer.toString(uid)
						+"&"+CDCmd.PA_GROUP+"="+Integer.toString(gid)
						+"&"+CDCmd.PA_PAG+"="+Integer.toString(intpage)
						+"&"+CDCmd.PA_CID+"="+emid2
						+"&"+CDCmd.PA_IDX+"="+Integer.toString(index);
					String[] cboxs = (String[])hsPara.get("cbox");
					if(cboxs != null) {
						for(int i=0; i < cboxs.length; i++) {
							backurl += "&cbox="+cboxs[i];
						}
					}

					try {
						CDCardFile cardfile = new CDCardFile(carddataDir, buf[0], 0);
						cardfile.Load();
						MailAddress toAddress = new MailAddress();
						toAddress.addTO(cardfile.getName(), cardfile.getMail());
						session.setAttribute(GSBase.SESSION_MAIL_ADDRESS, toAddress);

						backurl = req.getServletPath() + backurl;
						session.setAttribute(GSBase.SESSION_SENDBACK_URL, backurl);

						RequestDispatcher maildispatcher = req.getRequestDispatcher(getMailerURL());
						maildispatcher.forward(req, res);
						break;
					} catch(Exception e) {
						backurl = GSTool.removeParaFormURI(req.getRequestURI()) + backurl;
						page = new CreateErrorPage("儊乕儔乕夋柺偵堏摦偱偒傑偣傫偱偟偨丅", urlMap, backurl);
						break;
					}
				}
			}

			buf = (String[])hsPara.get("new.x");//怴婯柤巋
			if(buf!=null) {

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -