Changes for page 新しい学校ページを作成
Last modified by Super Admin on 2026/03/22 00:39
From version
28.1
edited by Super Admin
on 2026/03/12 17:54
on 2026/03/12 17:54
Change comment:
There is no comment for this version
To version
26.1
edited by Super Admin
on 2026/03/10 22:25
on 2026/03/10 22:25
Change comment:
There is no comment for this version
Summary
Details
- Page properties
-
- Content
-
... ... @@ -37,6 +37,16 @@ 37 37 #set($newObj = $newDoc.getObject('SeitokaiCode.SchoolClass', $objNum)) 38 38 $newObj.set('schoolCode', $schoolCode) 39 39 $newObj.set('schoolName', $schoolName) 40 + ## 現在の年度を初期値として設定(4月始まり) 41 + #set($now = $datetool.date) 42 + #set($currentYear = $datetool.format('yyyy', $now)) 43 + #set($currentMonth = $mathtool.toInteger($datetool.format('MM', $now))) 44 + #if($currentMonth >= 4) 45 + #set($fiscalYear = $currentYear) 46 + #else 47 + #set($fiscalYear = $mathtool.sub($mathtool.toInteger($currentYear), 1).toString()) 48 + #end 49 + $newObj.set('fiscalYear', $fiscalYear) 40 40 $newDoc.saveWithProgrammingRights('学校ページを新規作成') 41 41 ## 作成後にビューにリダイレクト 42 42 $response.sendRedirect($xwiki.getURL($targetPage, 'view')) ... ... @@ -108,13 +108,6 @@ 108 108 109 109 <script> 110 110 (function() { 111 - // XSSエスケープ関数 112 - function escapeHtml(s) { 113 - var div = document.createElement('div'); 114 - div.appendChild(document.createTextNode(s)); 115 - return div.innerHTML; 116 - } 117 - 118 118 // 学校マスターデータをJSON APIから取得 119 119 var schools = []; 120 120 var schoolsLoaded = false; ... ... @@ -158,11 +158,11 @@ 158 158 var li = document.createElement('li'); 159 159 li.className = 'search-result-item'; 160 160 li.innerHTML = 161 - '<div class="search-result-name">' + escapeHtml(s.name)+ '</div>' +164 + '<div class="search-result-name">' + s.name + '</div>' + 162 162 '<div class="search-result-info">' + 163 - escapeHtml(s.pref)+ ' ' +escapeHtml(s.city)+ ' ・ ' +escapeHtml(s.type)+ '(' +escapeHtml(s.est)+ ')' +166 + s.pref + ' ' + s.city + ' ・ ' + s.type + '(' + s.est + ')' + 164 164 '</div>' + 165 - '<div class="search-result-code">' + escapeHtml(s.code)+ '</div>';168 + '<div class="search-result-code">' + s.code + '</div>'; 166 166 li.onclick = function() { selectSchool(s); }; 167 167 resultsList.appendChild(li); 168 168 });