From c4b39a0e3b8f87ae60a9658118c3f066f434189b Mon Sep 17 00:00:00 2001 From: Frederic Debuire Date: Thu, 17 Jan 2008 15:51:56 +0000 Subject: [PATCH] =?UTF-8?q?Ajout=20d'un=20calendrier=20qui=20marche.=20Con?= =?UTF-8?q?tinuation=20du=20CU=20cr=C3=A9er=20Conf...=20Policy=20failures:?= =?UTF-8?q?=20Code=20warning=20-=20failed=20on=20resource=20AddConferenceC?= =?UTF-8?q?ontroller.java.=20Reason:=20Map=20is=20a=20raw=20type.=20Refere?= =?UTF-8?q?nces=20to=20generic=20type=20Map=20should=20be=20parameter?= =?UTF-8?q?ized,=20line=2055=20-=20failed=20on=20resource=20AddConferenceC?= =?UTF-8?q?ontroller.java.=20Reason:=20The=20import=20java.util.HashMap=20?= =?UTF-8?q?is=20never=20used,=20line=203=20-=20failed=20on=20resource=20Ad?= =?UTF-8?q?dConferenceController.java.=20Reason:=20The=20local=20variable?= =?UTF-8?q?=20conference=20is=20never=20read,=20line=2080=20-=20failed=20o?= =?UTF-8?q?n=20resource=20AddConferenceController.java.=20Reason:=20The=20?= =?UTF-8?q?local=20variable=20conference=20is=20never=20read,=20line=2096?= =?UTF-8?q?=20-=20failed=20on=20resource=20addConference.jsp.=20Reason:=20?= =?UTF-8?q?Undefined=20attribute=20name=20(alignment).,=20line=2031=20...?= =?UTF-8?q?=20and=20more.=20Override=20reason:=20yeah?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org.eclipse.core.resources.prefs | 3 + .../WebContent/WEB-INF/jsp/addConference.jsp | 2 +- .../WebContent/WEB-INF/jsp/addConference2.jsp | 28 +- .../WebContent/WEB-INF/jsp/addConference3.jsp | 24 +- .../WebContent/WEB-INF/jsp/addConference4.jsp | 17 +- YACOSWeb/WebContent/WEB-INF/yacos-servlet.xml | 37 +- .../WebContent/stylesheets/arrowleftmonth.gif | Bin 701 -> 0 bytes .../stylesheets/arrowrightmonth.gif | Bin 699 -> 0 bytes YACOSWeb/WebContent/stylesheets/calendar.css | 44 ++ YACOSWeb/WebContent/stylesheets/calendar.js | 445 +++++++++--------- .../author/controller/SArticleController.java | 3 +- .../controller/AddConferenceController.java | 10 +- 12 files changed, 350 insertions(+), 263 deletions(-) create mode 100644 YACOSWeb/.settings/org.eclipse.core.resources.prefs delete mode 100644 YACOSWeb/WebContent/stylesheets/arrowleftmonth.gif delete mode 100644 YACOSWeb/WebContent/stylesheets/arrowrightmonth.gif create mode 100644 YACOSWeb/WebContent/stylesheets/calendar.css diff --git a/YACOSWeb/.settings/org.eclipse.core.resources.prefs b/YACOSWeb/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..c18245a --- /dev/null +++ b/YACOSWeb/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,3 @@ +#Thu Jan 17 16:46:41 CET 2008 +eclipse.preferences.version=1 +encoding//WebContent/stylesheets/calendar.js=UTF-8 diff --git a/YACOSWeb/WebContent/WEB-INF/jsp/addConference.jsp b/YACOSWeb/WebContent/WEB-INF/jsp/addConference.jsp index 5a68293..dc80659 100644 --- a/YACOSWeb/WebContent/WEB-INF/jsp/addConference.jsp +++ b/YACOSWeb/WebContent/WEB-INF/jsp/addConference.jsp @@ -6,7 +6,7 @@ <fmt:message key="title" /> - + diff --git a/YACOSWeb/WebContent/WEB-INF/jsp/addConference2.jsp b/YACOSWeb/WebContent/WEB-INF/jsp/addConference2.jsp index b0b42b3..2606d36 100644 --- a/YACOSWeb/WebContent/WEB-INF/jsp/addConference2.jsp +++ b/YACOSWeb/WebContent/WEB-INF/jsp/addConference2.jsp @@ -6,36 +6,36 @@ <fmt:message key="title" /> - + + + + - - + diff --git a/YACOSWeb/WebContent/WEB-INF/jsp/addConference3.jsp b/YACOSWeb/WebContent/WEB-INF/jsp/addConference3.jsp index 325d61b..673a627 100644 --- a/YACOSWeb/WebContent/WEB-INF/jsp/addConference3.jsp +++ b/YACOSWeb/WebContent/WEB-INF/jsp/addConference3.jsp @@ -24,14 +24,28 @@ -
Page 3 +
Information Page's numbers File's type :
+ +
+ +
+ +
- + Informations complémentaires : + +
+
+ -
- -
+
">Home diff --git a/YACOSWeb/WebContent/WEB-INF/jsp/addConference4.jsp b/YACOSWeb/WebContent/WEB-INF/jsp/addConference4.jsp index dcfeef4..5f33937 100644 --- a/YACOSWeb/WebContent/WEB-INF/jsp/addConference4.jsp +++ b/YACOSWeb/WebContent/WEB-INF/jsp/addConference4.jsp @@ -22,14 +22,19 @@ -
Page 4 - - +
Criteria Label : Notation : Between + and
+ + + +

+ + + -
- -
+
">Home diff --git a/YACOSWeb/WebContent/WEB-INF/yacos-servlet.xml b/YACOSWeb/WebContent/WEB-INF/yacos-servlet.xml index a7f6bee..7245bb4 100644 --- a/YACOSWeb/WebContent/WEB-INF/yacos-servlet.xml +++ b/YACOSWeb/WebContent/WEB-INF/yacos-servlet.xml @@ -61,19 +61,32 @@ - - - - - - - - + diff --git a/YACOSWeb/WebContent/stylesheets/arrowleftmonth.gif b/YACOSWeb/WebContent/stylesheets/arrowleftmonth.gif deleted file mode 100644 index 313b627354c54cc90f37ce9da55c42105f0e2a18..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 701 zcmW;J$xjne0D$pn!6H~fD^XF2Y>gDDMv(}DF`$B|7fm!OQ9+}KiX^B};xdI|j1Ugs zL5XpTBp7cT3?~jQfe?s|EG|_+mKNIAnKGT_&Ac~nW)#1_;Fo;+50n?~JZq=y)V!P0 zbX_-)VFStIM6p81oCHS!j|pb6KEbezqz5HqGQt}M;SfIgEGT1j z5|Wyp#S3qEP18h7Lb3{$7|Oh;1SB*E@r;0wPQtRf0MS4Ih=>%l3k$p=sc?pcgVPca zls`Z|_$V|hb5~yZISm%H@tRKlD99k>7f-5QfuADs%VZ45+h6X2r{V2bCb zM6rKXQ49lX+BnDk40Aq~7YzLe1A(fBv98MUcb1Q6_~;7`$cmz(yS*VlFSwexAs`O3 zf;SZXydZlS@uUAAQ~xTU?-Cvgg}r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.css b/YACOSWeb/WebContent/stylesheets/calendar.css new file mode 100644 index 0000000..5bdffc3 --- /dev/null +++ b/YACOSWeb/WebContent/stylesheets/calendar.css @@ -0,0 +1,44 @@ +.ds_box { + background-color: #FFF; + border: 1px solid #000; + position: absolute; + z-index: 32767; +} + +.ds_tbl { + background-color: #FFF; +} + +.ds_head { + background-color: #333; + color: #FFF; + font-family: Arial, Helvetica, sans-serif; + font-size: 13px; + font-weight: bold; + text-align: center; + letter-spacing: 2px; +} + +.ds_subhead { + background-color: #CCC; + color: #000; + font-size: 12px; + font-weight: bold; + text-align: center; + font-family: Arial, Helvetica, sans-serif; + width: 32px; +} + +.ds_cell { + background-color: #EEE; + color: #000; + font-size: 13px; + text-align: center; + font-family: Arial, Helvetica, sans-serif; + padding: 5px; + cursor: pointer; +} + +.ds_cell:hover { + background-color: #F3F3F3; +} /* This hover code won't work for IE */ \ No newline at end of file diff --git a/YACOSWeb/WebContent/stylesheets/calendar.js b/YACOSWeb/WebContent/stylesheets/calendar.js index 8d00fdd..7c22674 100644 --- a/YACOSWeb/WebContent/stylesheets/calendar.js +++ b/YACOSWeb/WebContent/stylesheets/calendar.js @@ -1,248 +1,253 @@ -/* --- Swazz Javascript Calendar --- -/* --- v 1.0 3rd November 2006 -By Oliver Bryant -http://calendar.swazz.org */ - -function getObj(objID) -{ - if (document.getElementById) {return document.getElementById(objID);} - else if (document.all) {return document.all[objID];} - else if (document.layers) {return document.layers[objID];} -} - -function checkClick(e) { - e?evt=e:evt=event; - CSE=evt.target?evt.target:evt.srcElement; - if (getObj('fc')) - if (!isChild(CSE,getObj('fc'))) - getObj('fc').style.display='none'; -} - -function isChild(s,d) { - while(s) { - if (s==d) - return true; - s=s.parentNode; - } - return false; -} - -function Left(obj) -{ - var curleft = 0; - if (obj.offsetParent) - { - while (obj.offsetParent) - { - curleft += obj.offsetLeft - obj = obj.offsetParent; - } - } - else if (obj.x) - curleft += obj.x; - return curleft; -} - -function Top(obj) -{ - var curtop = 0; - if (obj.offsetParent) - { - while (obj.offsetParent) - { - curtop += obj.offsetTop - obj = obj.offsetParent; - } - } - else if (obj.y) - curtop += obj.y; - return curtop; -} - -document.write(''); -document.write(''); -document.write(''); -for(var kk=1;kk<=6;kk++) { - document.write(''); - for(var tt=1;tt<=7;tt++) { - num=7 * (kk-1) - (-tt); - document.write(''); - } - document.write(''); -} +document.write(''); +document.write(''); document.write(''); -document.all?document.attachEvent('onclick',checkClick):document.addEventListener('click',checkClick,false); +var ds_i_date = new Date(); +ds_c_month = ds_i_date.getMonth() + 1; +ds_c_year = ds_i_date.getFullYear(); +// Get Element By Id +function ds_getel(id) { + return document.getElementById(id); +} -// Calendar script -var now = new Date; -var sccm=now.getMonth(); -var sccy=now.getFullYear(); -var ccm=now.getMonth(); -var ccy=now.getFullYear(); - -var updobj; -function lcs(ielem) { - updobj=ielem; - getObj('fc').style.left=Left(ielem); - getObj('fc').style.top=Top(ielem)+ielem.offsetHeight; - getObj('fc').style.display=''; - - // First check date is valid - curdt=ielem.value; - curdtarr=curdt.split('/'); - isdt=true; - for(var k=0;k' + + '' + + '<<' + + '<' + + '[Fermer]' + + '>' + + '>>' + + '' + + '' + + '' + t + '' + + '' + + ''; } -function f_cpps(obj) { - obj.style.background='#C4D3EA'; - obj.style.font='10px Arial'; - obj.style.color='#ABABAB'; - obj.style.textAlign='center'; - obj.style.textDecoration='line-through'; - obj.style.border='1px solid #6487AE'; - obj.style.cursor='default'; +function ds_template_day_row(t) { + return '' + t + ''; + // Define width in CSS, XHTML 1.0 Strict doesn't have width property for it. } -function f_hds(obj) { - obj.style.background='#FFF799'; - obj.style.font='bold 10px Arial'; - obj.style.color='#333333'; - obj.style.textAlign='center'; - obj.style.border='1px solid #6487AE'; - obj.style.cursor='pointer'; +function ds_template_new_week() { + return ''; } -// day selected -function prepcalendar(hd,cm,cy) { - now=new Date(); - sd=now.getDate(); - td=new Date(); - td.setDate(1); - td.setFullYear(cy); - td.setMonth(cm); - cd=td.getDay(); - getObj('mns').innerHTML=mn[cm]+ ' ' + cy; - marr=((cy%4)==0)?mnl:mnn; - for(var d=1;d<=42;d++) { - f_cps(getObj('v'+parseInt(d))); - if ((d >= (cd -(-1))) && (d<=cd-(-marr[cm]))) { - dip=((d-cd < sd)&&(cm==sccm)&&(cy==sccy)); - htd=((hd!='')&&(d-cd==hd)); - if (dip) - f_cpps(getObj('v'+parseInt(d))); - else if (htd) - f_hds(getObj('v'+parseInt(d))); - else - f_cps(getObj('v'+parseInt(d))); +function ds_template_blank_cell(colspan) { + return '' +} - getObj('v'+parseInt(d)).onmouseover=(dip)?null:cs_over; - getObj('v'+parseInt(d)).onmouseout=(dip)?null:cs_out; - getObj('v'+parseInt(d)).onclick=(dip)?null:cs_click; - - getObj('v'+parseInt(d)).innerHTML=d-cd; - calvalarr[d]=''+(d-cd)+'/'+(cm-(-1))+'/'+cy; +function ds_template_day(d, m, y) { + return '' + d + ''; + // Define width the day row. +} + +function ds_template_main_below() { + return '' + + ''; +} + +// This one draws calendar... +function ds_draw_calendar(m, y) { + // First clean the output buffer. + ds_ob_clean(); + // Here we go, do the header + ds_echo (ds_template_main_above(ds_monthnames[m - 1] + ' ' + y)); + for (i = 0; i < 7; i ++) { + ds_echo (ds_template_day_row(ds_daynames[i])); + } + // Make a date object. + var ds_dc_date = new Date(); + ds_dc_date.setMonth(m - 1); + ds_dc_date.setFullYear(y); + ds_dc_date.setDate(1); + if (m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12) { + days = 31; + } else if (m == 4 || m == 6 || m == 9 || m == 11) { + days = 30; + } else { + days = (y % 4 == 0) ? 29 : 28; + } + var first_day = ds_dc_date.getDay(); + var first_loop = 1; + // Start the first week + ds_echo (ds_template_new_week()); + // If sunday is not the first day of the month, make a blank cell... + if (first_day != 0) { + ds_echo (ds_template_blank_cell(first_day)); + } + var j = first_day; + for (i = 0; i < days; i ++) { + // Today is sunday, make a new week. + // If this sunday is the first day of the month, + // we've made a new row for you already. + if (j == 0 && !first_loop) { + // New week!! + ds_echo (ds_template_new_week()); } - else { - getObj('v'+d).innerHTML=' '; - getObj('v'+parseInt(d)).onmouseover=null; - getObj('v'+parseInt(d)).onmouseout=null; - getObj('v'+parseInt(d)).style.cursor='default'; - } + // Make a row of that day! + ds_echo (ds_template_day(i + 1, m, y)); + // This is not first loop anymore... + first_loop = 0; + // What is the next day? + j ++; + j %= 7; } + // Do the footer + ds_echo (ds_template_main_below()); + // And let's display.. + ds_ob_flush(); + // Scroll it into view. + ds_ce.scrollIntoView(); } -prepcalendar('',ccm,ccy); -//getObj('fc'+cc).style.visibility='hidden'; - -function caddm() { - marr=((ccy%4)==0)?mnl:mnn; - - ccm+=1; - if (ccm>=12) { - ccm=0; - ccy++; - } - cdayf(); - prepcalendar('',ccm,ccy); +// A function to show the calendar. +// When user click on the date, it will set the content of t. +function ds_sh(t) { + // Set the element to set... + ds_element = t; + // Make a new date, and set the current month and year. + var ds_sh_date = new Date(); + ds_c_month = ds_sh_date.getMonth() + 1; + ds_c_year = ds_sh_date.getFullYear(); + // Draw the calendar + ds_draw_calendar(ds_c_month, ds_c_year); + // To change the position properly, we must show it first. + ds_ce.style.display = ''; + // Move the calendar container! + the_left = ds_getleft(t); + the_top = ds_gettop(t) + t.offsetHeight; + ds_ce.style.left = the_left + 'px'; + ds_ce.style.top = the_top + 'px'; + // Scroll it into view. + ds_ce.scrollIntoView(); } -function csubm() { - marr=((ccy%4)==0)?mnl:mnn; - - ccm-=1; - if (ccm<0) { - ccm=11; - ccy--; - } - cdayf(); - prepcalendar('',ccm,ccy); +// Hide the calendar. +function ds_hi() { + ds_ce.style.display = 'none'; } -function cdayf() { -if ((ccy>sccy)|((ccy==sccy)&&(ccm>=sccm))) - return; -else { - ccy=sccy; - ccm=sccm; - cfd=scfd; +// Moves to the next month... +function ds_nm() { + // Increase the current month. + ds_c_month ++; + // We have passed December, let's go to the next year. + // Increase the current year, and set the current month to January. + if (ds_c_month > 12) { + ds_c_month = 1; + ds_c_year++; } -} + // Redraw the calendar. + ds_draw_calendar(ds_c_month, ds_c_year); +} + +// Moves to the previous month... +function ds_pm() { + ds_c_month = ds_c_month - 1; // Can't use dash-dash here, it will make the page invalid. + // We have passed January, let's go back to the previous year. + // Decrease the current year, and set the current month to December. + if (ds_c_month < 1) { + ds_c_month = 12; + ds_c_year = ds_c_year - 1; // Can't use dash-dash here, it will make the page invalid. + } + // Redraw the calendar. + ds_draw_calendar(ds_c_month, ds_c_year); +} + +// Moves to the next year... +function ds_ny() { + // Increase the current year. + ds_c_year++; + // Redraw the calendar. + ds_draw_calendar(ds_c_month, ds_c_year); +} + +// Moves to the previous year... +function ds_py() { + // Decrease the current year. + ds_c_year = ds_c_year - 1; // Can't use dash-dash here, it will make the page invalid. + // Redraw the calendar. + ds_draw_calendar(ds_c_month, ds_c_year); +} + +// Format the date to output. +function ds_format_date(d, m, y) { + // 2 digits month. + m2 = '00' + m; + m2 = m2.substr(m2.length - 2); + // 2 digits day. + d2 = '00' + d; + d2 = d2.substr(d2.length - 2); + // YYYY-MM-DD + return y + '-' + m2 + '-' + d2; +} + +// When the user clicks the day. +function ds_onclick(d, m, y) { + // Hide the calendar. + ds_hi(); + // Set the value of it, if we can. + if (typeof(ds_element.value) != 'undefined') { + ds_element.value = ds_format_date(d, m, y); + // Maybe we want to set the HTML in it. + } else if (typeof(ds_element.innerHTML) != 'undefined') { + ds_element.innerHTML = ds_format_date(d, m, y); + // I don't know how should we display it, just alert it to user. + } else { + alert (ds_format_date(d, m, y)); + } +} \ No newline at end of file diff --git a/YACOSWeb/src/org/yacos/web/author/controller/SArticleController.java b/YACOSWeb/src/org/yacos/web/author/controller/SArticleController.java index 603289f..7304fd0 100644 --- a/YACOSWeb/src/org/yacos/web/author/controller/SArticleController.java +++ b/YACOSWeb/src/org/yacos/web/author/controller/SArticleController.java @@ -68,8 +68,7 @@ public class SArticleController extends SimpleFormController { System.out.println(e); } - Article a = new Article(0, title, theme, nomFile, mainauthor, liste, 1); - articleManager.addArticle(a); + articleManager.addArticle(0, title, theme, nomFile, mainauthor, liste, 1); return new ModelAndView(new RedirectView(getSuccessView())); } diff --git a/YACOSWeb/src/org/yacos/web/chairman/controller/AddConferenceController.java b/YACOSWeb/src/org/yacos/web/chairman/controller/AddConferenceController.java index be39b3a..e044389 100644 --- a/YACOSWeb/src/org/yacos/web/chairman/controller/AddConferenceController.java +++ b/YACOSWeb/src/org/yacos/web/chairman/controller/AddConferenceController.java @@ -34,8 +34,14 @@ public class AddConferenceController extends AbstractWizardFormController { setPages(new String[] {"addConference", "addConference2", "addConference3", "addConference4", "addConference5"}); } - protected Object formBackingObject(HttpServletRequest request) throws ModelAndViewDefiningException { - FormConference conference = new FormConference(); + protected Object formBackingObject(HttpServletRequest request) throws ModelAndViewDefiningException { + logger.info("je passe ici"); + FormConference conference = (FormConference)request.getSession().getAttribute("conference"); + if (conference==null) { + conference = new FormConference(); + logger.info("je passe ici la 1ère fois"); + request.getSession().setAttribute("conference", conference); + } return conference; }