Last modified by Super Admin on 2026/04/05 18:59

From version Icon 40.1 Icon
edited by XWikiGuest
on 2026/03/10 22:20
Change comment: There is no comment for this version
To version Icon 43.1 Icon
edited by Super Admin
on 2026/03/12 17:54
Change comment: There is no comment for this version

Summary

Details

Icon Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.XWikiGuest
1 +XWiki.superadmin
Content
... ... @@ -65,9 +65,7 @@
65 65  #set($seitokaiYoutube = $doc.getValue('seitokaiYoutube'))
66 66  #set($seitokaiOtherSns = $doc.getValue('seitokaiOtherSns'))
67 67  
68 -## --- 年度アーカイブ ---
69 -#set($pageFiscalYear = $!doc.getValue('fiscalYear'))
70 -## 現在の年度を計算(4月始まり)
68 +## --- 現在の年度を計算(4月始まり) ---
71 71  #set($nowFY = $datetool.date)
72 72  #set($currentFYMonth = $mathtool.toInteger($datetool.format('MM', $nowFY)))
73 73  #set($currentFYYear = $mathtool.toInteger($datetool.format('yyyy', $nowFY)))
... ... @@ -76,10 +76,6 @@
76 76  #else
77 77   #set($currentFiscalYear = $mathtool.sub($currentFYYear, 1))
78 78  #end
79 -## fiscalYear 未設定時はデフォルトとして現在の年度を使う
80 -#if(!$pageFiscalYear || $pageFiscalYear == '')
81 - #set($pageFiscalYear = $currentFiscalYear.toString())
82 -#end
83 83  
84 84  ## --- 公開範囲フィールド ---
85 85  #set($visibilityOrgChart = $!doc.getValue('visibilityOrgChart'))
... ... @@ -947,59 +947,6 @@
947 947  {{/html}}
948 948  #end
949 949  
950 -## --- 年度アーカイブ セクション ---
951 -{{html clean="false"}}
952 -<div class="school-section-card school-archive-card">
953 - <h2 class="archive-section-title">
954 - <svg class="ico ico-md" viewBox="0 0 24 24"><path d="M19 21H5a2 2 0 01-2-2V5a2 2 0 012-2h11l5 5v11a2 2 0 01-2 2z"/><polyline points="17 21 17 13 7 13 7 21"/><polyline points="7 3 7 8 15 8"/></svg>
955 - 年度アーカイブ
956 - </h2>
957 - <div class="archive-meta">
958 - 現在のページ: <strong>${pageFiscalYear}年度</strong>
959 - #set($lyud = $!doc.getValue('lastYearUpdateDate'))
960 - #if($lyud && $lyud != '')
961 - | 最終年度更新: $!escapetool.xml($lyud) ($!escapetool.xml($!doc.getValue('lastYearUpdateBy')))
962 - #end
963 - </div>
964 -
965 - ## 過去アーカイブの検索
966 - #set($archiveQuery = $services.query.hql("where doc.fullName like :pattern and doc.fullName like '%Archive_%' order by doc.fullName desc").bindValue("pattern", "${doc.fullName}.Archive_%").setLimit(20))
967 - #set($archivePages = $archiveQuery.execute())
968 -
969 - #if($archivePages && $archivePages.size() > 0)
970 - <div class="archive-card-field-lg">
971 - <div class="archive-list-label">過去の年度アーカイブ</div>
972 - <div class="archive-list">
973 - #foreach($archPage in $archivePages)
974 - #set($archPageDoc = $xwiki.getDocument($archPage))
975 - #set($archPageObj = $archPageDoc.getObject('SeitokaiCode.SchoolClass'))
976 - #if($archPageObj)
977 - #set($archPageFY = $!archPageObj.getValue('fiscalYear'))
978 - <a href="$archPageDoc.getURL('view')" class="archive-link">
979 - <svg class="ico" viewBox="0 0 24 24"><path d="M19 21H5a2 2 0 01-2-2V5a2 2 0 012-2h11l5 5v11a2 2 0 01-2 2z"/><polyline points="17 21 17 13 7 13 7 21"/><polyline points="7 3 7 8 15 8"/></svg>
980 - ${archPageFY}年度
981 - </a>
982 - #end
983 - #end
984 - </div>
985 - </div>
986 - #else
987 - <div class="archive-empty">過去のアーカイブはまだありません</div>
988 - #end
989 -
990 - ## 新年度に移行ボタン(承認済み・管理者のみ)
991 - #if($viewerAccountType == 'admin' || $viewerAccountType == 'verified')
992 - <div class="archive-action">
993 - <a href="/bin/SeitokaiCode/YearArchiveAction?schoolPage=${doc.fullName}" class="btn-accent">
994 - <svg class="ico" viewBox="0 0 24 24" stroke-width="2.5"><path d="M19 21H5a2 2 0 01-2-2V5a2 2 0 012-2h11l5 5v11a2 2 0 01-2 2z"/><polyline points="17 21 17 13 7 13 7 21"/><polyline points="7 3 7 8 15 8"/></svg>
995 - ${pageFiscalYear}年度をアーカイブして新年度に移行
996 - </a>
997 - <div class="archive-action-hint">現在の学校情報を${pageFiscalYear}年度として保存し、新しい年度に移行します。</div>
998 - </div>
999 - #end
1000 -</div>
1001 -{{/html}}
1002 -
1003 1003  ## --- 年度タブ切り替え JavaScript ---
1004 1004  {{html clean="false"}}
1005 1005  <script>
... ... @@ -1022,9 +1022,6 @@
1022 1022   var defaultTab = document.querySelector('.activity-fy-tab.active');
1023 1023   if (defaultTab) { defaultTab.click(); }
1024 1024   // 保存成功時のトースト通知
1025 - if (window.location.search.indexOf('archived=1') !== -1) {
1026 - showToast('年度アーカイブを作成しました', 'success');
1027 - }
1028 1028   if (window.location.search.indexOf('saved=1') !== -1) {
1029 1029   showToast('学校情報を保存しました', 'success');
1030 1030   // URLパラメータをクリーンアップ(リロード時に再表示されないよう)
... ... @@ -1091,7 +1091,9 @@
1091 1091   var csrfEl = document.querySelector('input[name="form_token"]');
1092 1092   var csrfToken = csrfEl ? csrfEl.value : '';
1093 1093   var xhr = new XMLHttpRequest();
1094 - xhr.open('GET', '/bin/SeitokaiCode/EditPost?outputSyntax=plain&schoolPage=' + encodeURIComponent(schoolPage) + '&postObj=' + postObjNum + '&newContent=' + encodeURIComponent(newContent) + '&form_token=' + encodeURIComponent(csrfToken), true);
1032 + xhr.open('POST', '/bin/SeitokaiCode/EditPost?outputSyntax=plain', true);
1033 + xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
1034 + var editPostData = 'schoolPage=' + encodeURIComponent(schoolPage) + '&postObj=' + postObjNum + '&newContent=' + encodeURIComponent(newContent) + '&form_token=' + encodeURIComponent(csrfToken);
1095 1095   xhr.onload = function() {
1096 1096   try {
1097 1097   var res = JSON.parse(xhr.responseText);
... ... @@ -1104,7 +1104,7 @@
1104 1104   } catch(e) { alert('編集に失敗しました'); }
1105 1105   };
1106 1106   xhr.onerror = function() { alert('通信エラーが発生しました'); };
1107 - xhr.send();
1047 + xhr.send(editPostData);
1108 1108  }
1109 1109  
1110 1110  // 投稿の削除(確認ダイアログ付き)
... ... @@ -1111,7 +1111,9 @@
1111 1111  function confirmDeletePost(schoolPage, postObjNum, token) {
1112 1112   if (!confirm('この投稿を削除しますか?\\n削除後は「この投稿は削除されました」と表示されます。')) return;
1113 1113   var xhr = new XMLHttpRequest();
1114 - xhr.open('GET', '/bin/SeitokaiCode/DeletePost?outputSyntax=plain&schoolPage=' + encodeURIComponent(schoolPage) + '&postObj=' + postObjNum + '&form_token=' + encodeURIComponent(token), true);
1054 + xhr.open('POST', '/bin/SeitokaiCode/DeletePost?outputSyntax=plain', true);
1055 + xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
1056 + var deletePostData = 'schoolPage=' + encodeURIComponent(schoolPage) + '&postObj=' + postObjNum + '&form_token=' + encodeURIComponent(token);
1115 1115   xhr.onload = function() {
1116 1116   try {
1117 1117   var res = JSON.parse(xhr.responseText);
... ... @@ -1124,7 +1124,7 @@
1124 1124   } catch(e) { alert('削除に失敗しました'); }
1125 1125   };
1126 1126   xhr.onerror = function() { alert('通信エラーが発生しました'); };
1127 - xhr.send();
1069 + xhr.send(deletePostData);
1128 1128  }
1129 1129  </script>
1130 1130  {{/html}}