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

From version Icon 31.1 Icon
edited by Super Admin
on 2026/03/10 13:42
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
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'))
... ... @@ -224,51 +224,22 @@
224 224   #end
225 225  #end
226 226  
227 -## --- 信頼性バッジ + ユーザー情報 ---
228 -<div class="seitokai-badge-container">
229 - ## 承認バッジ
230 - #if($authorAccountType == 'admin')
231 - <span class="badge badge-admin"><svg class="ico" viewBox="0 0 24 24"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg> 管理者</span>
232 - #elseif($authorAccountType == 'verified')
233 - <span class="badge badge-verified"><svg class="ico" viewBox="0 0 24 24" stroke-width="2.5"><path d="M20 6L9 17l-5-5"/></svg> 承認済み</span>
234 - #elseif($authorAccountType == 'referred')
235 - <span class="badge badge-referred"><svg class="ico" viewBox="0 0 24 24"><path d="M10 13a5 5 0 007.54.54l3-3a5 5 0 00-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 00-7.54-.54l-3 3a5 5 0 007.07 7.07l1.71-1.71"/></svg> 紹介</span>
236 - #else
237 - <span class="badge badge-general">一般</span>
238 - #end
239 - ## 役割バッジ
240 - #if($authorUserRole == 'student')
241 - <span class="badge badge-role-student"><svg class="ico" viewBox="0 0 24 24"><path d="M22 10l-10-5L2 10l10 5 10-5z"/><path d="M6 12v5c0 1.66 2.69 3 6 3s6-1.34 6-3v-5"/></svg> 生徒</span>
242 - #set($authorIsOfficer = $!lastAuthorDoc.getValue('isOfficer'))
243 - #if($authorIsOfficer == 'true')
244 - <span class="badge badge-role-officer"><svg class="ico" viewBox="0 0 24 24"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg> 役員</span>
245 - #end
246 - #elseif($authorUserRole == 'teacher')
247 - <span class="badge badge-role-teacher"><svg class="ico" viewBox="0 0 24 24"><path d="M4 19.5A2.5 2.5 0 016.5 17H20"/><path d="M6.5 2H20v20H6.5A2.5 2.5 0 014 19.5v-15A2.5 2.5 0 016.5 2z"/></svg> 教員</span>
248 - #elseif($authorUserRole == 'graduate')
249 - <span class="badge badge-role-graduate"><svg class="ico" viewBox="0 0 24 24"><path d="M22 10l-10-5L2 10l10 5 10-5z"/><path d="M6 12v5c0 1.66 2.69 3 6 3s6-1.34 6-3v-5"/></svg> 卒業生</span>
250 - #end
251 - ## 学年(生徒のみ公開)
252 - #if($authorGrade && $authorGrade != '')
253 - <span class="badge badge-grade">$authorGrade</span>
254 - #end
255 - ## 在籍状態(卒業・休学等の場合のみ表示)
256 - #if($authorUserStatus == 'graduated')
257 - <span class="badge badge-status-graduated"><svg class="ico" viewBox="0 0 24 24"><path d="M22 10l-10-5L2 10l10 5 10-5z"/><path d="M6 12v5c0 1.66 2.69 3 6 3s6-1.34 6-3v-5"/></svg> 卒業済み</span>
258 - #elseif($authorUserStatus == 'on_leave')
259 - <span class="badge badge-status-onleave"><svg class="ico" viewBox="0 0 24 24" fill="currentColor"><rect x="6" y="4" width="4" height="16" rx="1"/><rect x="14" y="4" width="4" height="16" rx="1"/></svg> 休学中</span>
260 - #elseif($authorUserStatus == 'transferred')
261 - <span class="badge badge-status-transferred"><svg class="ico" viewBox="0 0 24 24"><polyline points="23 4 23 10 17 10"/><polyline points="1 20 1 14 7 14"/><path d="M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15"/></svg> 転校済み</span>
262 - #end
263 - ## 編集ボタン(権限があるユーザーのみ表示)
264 - #set($canEditSchool = false)
265 - #if(!$isGuest && ($isViewerAdmin || $viewerSchoolCode == $schoolCode))
266 - #set($canEditSchool = true)
267 - #end
268 - #if($canEditSchool)
221 +## --- 学校名見出し(XWikiデフォルトタイトルを非表示にし、学校名を表示) ---
222 +#if($schoolName && $schoolName != '')
223 +<style>.document-header { display: none !important; }</style>
224 +<h1 class="school-page-title">$!escapetool.xml($schoolName)</h1>
225 +#end
226 +
227 +## --- 編集ボタン(権限があるユーザーのみ表示) ---
228 +#set($canEditSchool = false)
229 +#if(!$isGuest && ($isViewerAdmin || $viewerSchoolCode == $schoolCode))
230 + #set($canEditSchool = true)
231 +#end
232 +#if($canEditSchool)
233 +<div style="text-align:right; margin-bottom:12px;">
269 269   <a href="$doc.getURL('view', 'sheet=SeitokaiCode.SchoolEditForm')" class="btn-school-edit"><svg class="ico" viewBox="0 0 24 24"><path d="M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z"/></svg> 基本情報を編集</a>
270 - #end
271 271  </div>
236 +#end
272 272  
273 273  ## --- ① 学校基本情報 + 連絡先(左右グリッド・折りたたみ対応) ---
274 274  <div class="school-info-grid">
... ... @@ -944,10 +944,10 @@
944 944  
945 945   #if($xcontext.user != "XWiki.XWikiGuest")
946 946   <div class="thread-add-post">
947 - <a href="/bin/view/SeitokaiCode/ActivityPostForm?schoolPage=${doc.fullName}&activityIndex=${actIdx}&schoolCode=$!escapetool.url($schoolCode)&postType=report" class="btn-thread-add">
912 + <a href="/bin/SeitokaiCode/ActivityPostForm?schoolPage=${doc.fullName}&activityIndex=${actIdx}&schoolCode=$!escapetool.url($schoolCode)&postType=report" class="btn-thread-add">
948 948   + 活動報告を追加
949 949   </a>
950 - <a href="/bin/view/SeitokaiCode/ActivityPostForm?schoolPage=${doc.fullName}&activityIndex=${actIdx}&schoolCode=$!escapetool.url($schoolCode)&postType=comment" class="btn-thread-comment">
915 + <a href="/bin/SeitokaiCode/ActivityPostForm?schoolPage=${doc.fullName}&activityIndex=${actIdx}&schoolCode=$!escapetool.url($schoolCode)&postType=comment" class="btn-thread-comment">
951 951   <svg class="ico" viewBox="0 0 24 24"><path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/></svg> コメントを書く
952 952   </a>
953 953   </div>
... ... @@ -969,7 +969,7 @@
969 969  #if($xcontext.user != "XWiki.XWikiGuest")
970 970  {{html clean="false"}}
971 971  <div class="activity-add-section">
972 - <a href="/bin/view/SeitokaiCode/ActivityForm?schoolPage=${doc.fullName}&schoolCode=$!escapetool.url($schoolCode)" class="btn btn-primary btn-add-activity">
937 + <a href="/bin/SeitokaiCode/ActivityForm?schoolPage=${doc.fullName}&schoolCode=$!escapetool.url($schoolCode)" class="btn btn-primary btn-add-activity">
973 973   <svg class="ico" viewBox="0 0 24 24" stroke-width="2.5"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg> 活動を追加
974 974   </a>
975 975  </div>
... ... @@ -976,59 +976,6 @@
976 976  {{/html}}
977 977  #end
978 978  
979 -## --- 年度アーカイブ セクション ---
980 -{{html clean="false"}}
981 -<div class="school-section-card school-archive-card">
982 - <h2 class="archive-section-title">
983 - <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>
984 - 年度アーカイブ
985 - </h2>
986 - <div class="archive-meta">
987 - 現在のページ: <strong>${pageFiscalYear}年度</strong>
988 - #set($lyud = $!doc.getValue('lastYearUpdateDate'))
989 - #if($lyud && $lyud != '')
990 - | 最終年度更新: $!escapetool.xml($lyud) ($!escapetool.xml($!doc.getValue('lastYearUpdateBy')))
991 - #end
992 - </div>
993 -
994 - ## 過去アーカイブの検索
995 - #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))
996 - #set($archivePages = $archiveQuery.execute())
997 -
998 - #if($archivePages && $archivePages.size() > 0)
999 - <div class="archive-card-field-lg">
1000 - <div class="archive-list-label">過去の年度アーカイブ</div>
1001 - <div class="archive-list">
1002 - #foreach($archPage in $archivePages)
1003 - #set($archPageDoc = $xwiki.getDocument($archPage))
1004 - #set($archPageObj = $archPageDoc.getObject('SeitokaiCode.SchoolClass'))
1005 - #if($archPageObj)
1006 - #set($archPageFY = $!archPageObj.getValue('fiscalYear'))
1007 - <a href="$archPageDoc.getURL('view')" class="archive-link">
1008 - <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>
1009 - ${archPageFY}年度
1010 - </a>
1011 - #end
1012 - #end
1013 - </div>
1014 - </div>
1015 - #else
1016 - <div class="archive-empty">過去のアーカイブはまだありません</div>
1017 - #end
1018 -
1019 - ## 新年度に移行ボタン(承認済み・管理者のみ)
1020 - #if($viewerAccountType == 'admin' || $viewerAccountType == 'verified')
1021 - <div class="archive-action">
1022 - <a href="/bin/view/SeitokaiCode/YearArchiveAction?schoolPage=${doc.fullName}" class="btn-accent">
1023 - <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>
1024 - ${pageFiscalYear}年度をアーカイブして新年度に移行
1025 - </a>
1026 - <div class="archive-action-hint">現在の学校情報を${pageFiscalYear}年度として保存し、新しい年度に移行します。</div>
1027 - </div>
1028 - #end
1029 -</div>
1030 -{{/html}}
1031 -
1032 1032  ## --- 年度タブ切り替え JavaScript ---
1033 1033  {{html clean="false"}}
1034 1034  <script>
... ... @@ -1045,14 +1045,12 @@
1045 1045   }
1046 1046   });
1047 1047  }
1048 -// ページ読み込み時にデフォルトで現在年度を表示
960 +// ページ読み込み時の初期化
1049 1049  document.addEventListener('DOMContentLoaded', function() {
962 + // デフォルトで現在の年度を表示
1050 1050   var defaultTab = document.querySelector('.activity-fy-tab.active');
1051 1051   if (defaultTab) { defaultTab.click(); }
1052 1052   // 保存成功時のトースト通知
1053 - if (window.location.search.indexOf('archived=1') !== -1) {
1054 - showToast('年度アーカイブを作成しました', 'success');
1055 - }
1056 1056   if (window.location.search.indexOf('saved=1') !== -1) {
1057 1057   showToast('学校情報を保存しました', 'success');
1058 1058   // URLパラメータをクリーンアップ(リロード時に再表示されないよう)
... ... @@ -1119,7 +1119,9 @@
1119 1119   var csrfEl = document.querySelector('input[name="form_token"]');
1120 1120   var csrfToken = csrfEl ? csrfEl.value : '';
1121 1121   var xhr = new XMLHttpRequest();
1122 - xhr.open('GET', '/bin/view/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);
1123 1123   xhr.onload = function() {
1124 1124   try {
1125 1125   var res = JSON.parse(xhr.responseText);
... ... @@ -1132,7 +1132,7 @@
1132 1132   } catch(e) { alert('編集に失敗しました'); }
1133 1133   };
1134 1134   xhr.onerror = function() { alert('通信エラーが発生しました'); };
1135 - xhr.send();
1047 + xhr.send(editPostData);
1136 1136  }
1137 1137  
1138 1138  // 投稿の削除(確認ダイアログ付き)
... ... @@ -1139,7 +1139,9 @@
1139 1139  function confirmDeletePost(schoolPage, postObjNum, token) {
1140 1140   if (!confirm('この投稿を削除しますか?\\n削除後は「この投稿は削除されました」と表示されます。')) return;
1141 1141   var xhr = new XMLHttpRequest();
1142 - xhr.open('GET', '/bin/view/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);
1143 1143   xhr.onload = function() {
1144 1144   try {
1145 1145   var res = JSON.parse(xhr.responseText);
... ... @@ -1152,7 +1152,7 @@
1152 1152   } catch(e) { alert('削除に失敗しました'); }
1153 1153   };
1154 1154   xhr.onerror = function() { alert('通信エラーが発生しました'); };
1155 - xhr.send();
1069 + xhr.send(deletePostData);
1156 1156  }
1157 1157  </script>
1158 1158  {{/html}}