Last modified by Super Admin on 2026/03/22 00:39

From version Icon 35.1 Icon
edited by Super Admin
on 2026/03/18 20:38
Change comment: There is no comment for this version
To version Icon 36.1 Icon
edited by Super Admin
on 2026/03/18 20:41
Change comment: There is no comment for this version

Summary

Details

Icon Page properties
Content
... ... @@ -222,16 +222,13 @@
222 222   .catch(function() { return false; });
223 223  
224 224   // 関連校チェック(他校の関連校として登録されているか確認)
225 - var affCheckUrl = restBase + '/query?q=' +
226 - encodeURIComponent("select doc.fullName, school.affiliatedSchoolName from Document doc, doc.object(SeitokaiCode.SchoolClass) school where school.affiliatedSchoolCode = :code") +
227 - '&type=hql&queryFilters=unique&parameters=code:' + encodeURIComponent(school.code);
228 - var affiliatedCheck = fetch(affCheckUrl, { headers: { 'Accept': 'application/json' } })
229 - .then(function(r) { return r.ok ? r.json() : []; })
230 - .catch(function() { return []; });
225 + var affiliatedCheck = fetch('$request.contextPath/bin/view/SeitokaiCode/CheckAffiliated?code=' + encodeURIComponent(school.code) + '&outputSyntax=plain')
226 + .then(function(r) { return r.ok ? r.json() : { found: false }; })
227 + .catch(function() { return { found: false }; });
231 231  
232 232   Promise.all([duplicateCheck, affiliatedCheck]).then(function(results) {
233 233   var isDuplicate = results[0];
234 - var affResults = results[1];
231 + var affData = results[1];
235 235   var affNotice = document.getElementById('affiliatedNotice');
236 236  
237 237   if (isDuplicate) {
... ... @@ -245,15 +245,10 @@
245 245   }
246 246  
247 247   // 関連校として登録されている場合
248 - if (affResults && affResults.length > 0) {
249 - var mainPageRef = affResults[0];
250 - var mainCode = '';
251 - if (typeof mainPageRef === 'string' && mainPageRef.indexOf('Schools.') === 0) {
252 - mainCode = mainPageRef.split('.')[1];
253 - }
254 - var linkHref = mainCode ? ('$request.contextPath/bin/Schools/' + mainCode + '/') : '#';
245 + if (affData && affData.found) {
246 + var linkHref = '$request.contextPath/bin/Schools/' + affData.mainCode + '/';
255 255   document.getElementById('affiliatedNoticeText').innerHTML =
256 - '別の学校ページに中高一貫校の関連校として統合されています。' +
248 + '<a href="' + escapeHtml(linkHref) + '">' + escapeHtml(affData.mainName) + '</a> に中高一貫校の関連校として統合されています。' +
257 257   '<a href="' + escapeHtml(linkHref) + '">統合先のページへ移動する →</a>';
258 258   affNotice.style.display = 'flex';
259 259   } else {