2008年2月25日 星期一

從基本得做起ooo_basic.php

ooo_basic.php位於x_schdule,目的是產生ooo檔案
function outputooofile($ooo_path,$filename,$temp_arr)
$ooo_path 解壓縮檔的位置
$filename 輸出的檔案名稱
$temp_arr 置換的tag名

原始碼
include_once "../x_base/sxsooo_class.php";
function outputooofile($ooo_path,$filename,$temp_arr) { //新增一個 zipfile 實例 $ttt = new zipfile;
if (is_dir($ooo_path)) { if ($dh = opendir($ooo_path)) { while (($file = readdir($dh)) !== false) { preg_match('/^(.)+\.odt$/',$file,$matches); if($file=="." or $file==".." or $file=="content.xml" or $matches[0]){ continue; }elseif(is_dir($ooo_path."/".$file)){ if($file=="Configurations2") $file_extname="odt"; if ($dh2 = opendir($ooo_path."/".$file)) { while (($file2 = readdir($dh2)) !== false) { if($file2=="." or $file2==".."){ continue; }else{ if($dh3 = opendir($ooo_path."/".$file."/".$file2)){ while (($file3 = readdir($dh3)) !== false) { if($file3=="." or $file3==".."){ //continue; }else{ $data = $ttt->read_file($ooo_path."/".$file."/".$file2."/".$file3); $ttt->add_file($data,$file."/".$file2."/".$file3); } } closedir($dh3); }else{ $data = $ttt->read_file($ooo_path."/".$file."/".$file2); $ttt->add_file($data,$file."/".$file2); } } } closedir($dh2); } }else{ $data = $ttt->read_file($ooo_path."/".$file); $ttt->add_file($data,$file); } } closedir($dh); } } //讀出 content.xml $data = $ttt->read_file($ooo_path."/content.xml"); if($file_extname=="odt") { $filename.=".odt"; } else { $filename.=".sxw"; } $replace_data = $ttt->change_temp($temp_arr,$data,0); $replace_data = $con_head.$replace_data.$con_foot;
//把一些多餘的標籤以空白取代 $pattern[]="/\{([^\}]*)\}/"; $replacement[]="";
$replace_data=preg_replace($pattern, $replacement, $replace_data); //$replace_data=str_replace ('
', '', $replace_data);
$ttt->add_file($replace_data,"content.xml");
//產生 zip 檔 $sss = $ttt->file();
//以串流方式送出 ooo.sxw if(strpos($_SERVER['HTTP_USER_AGENT'] , 'MSIE') strpos($_SERVER['HTTP_USER_AGENT'] , 'Opera')) $mimeType="application/x-download"; elseif($file_extname=="odt") $mimeType="application/vnd.oasis.opendocument.text"; else $mimeType="application/vnd.sun.xml.writer"; header("Content-disposition: attachment; filename=$filename"); header("Content-type: $mimeType ");
echo $sss;
exit;

2008年2月20日 星期三

Re: 最近修改的模組


附件是X導師更新版
麻煩在真實環境測試一下新功能
2008/02/18 00:00:01
tyc
shepherd99.php
增加 歷史成績(score_history.php)的查詢連結
增加 $xm_round 變數 取得 x_base裡設定的小數位數
修改 寫入和顯示具有分科的領域成績的小數點
修改 期末成績前n名以黃底標示(可於tyc設定n和顏色)
修改 僅顯示在籍學生
editscorea.php
修改 僅顯示在籍學生
progress.php
新增 定期考查的進步情形
score_lock.php
修改 和shepherd99.php的連結
增加 和progress.php的連結 (進步)
修改 成績前n名以黃底標示(可於tyc設定n和顏色)
score_history.php (歷史成績)
新增 查詢舊的成績(可於tyc設定顯示的學期數)
edit_credit.php (比重設定)
新增 管理者可一次全年級設定比重
function.php
admin/tyc_shepherd_set.php (管理區/tyc設定)
新增 設定功能
tnc
shepherd5.php, ooo_overhaul3.php, x_shepherd_class.php
美化日檢表的輸入和輸出(和tyc版無關)
附件是我最近修改的模組
其中 x_gscore(分組課程,增加導師設定學生的選課)和x_fitness(體適能,可匯入健康中心系統的身高體重)已經完成
x_shepherd差了一點設定(增加顯示前三名,進步獎等)
x_honours還差報表輸出和區塊(可以用)
x_importscore,x_scorem還差很多

2008年2月12日 星期二

x_base修改檢視

自20080102修改 mysql.sql之後的改變
===台南縣
UNZIP32.EXE
== 改用新版的UNZIP.EXE 解決解壓縮的問題
teacher_class.php
== teacher_data 的bug fix
sxsbase_class.php
== last_year_seme( $nowyear, $nowseme)
== school_gclass, school_grad => bug fix 'k'
== stud2sn =>bug fix
sxsseme_class.php
== 新增 get_cf_sn
course2.php
== 配合排課修正
tea_course.php
== 增加節數修改
ooo_person.php
== 符號轉換錯誤修正
subj_score.php
== 匯出修正
tea_course2.php
== bug fix
detail_stud_move.php
== 匯出修正
detail_stud_ident.php
== 匯出修正
===桃園縣
course3.php
== 顯示錯誤修正

get_cf_sn

此函數應該來自sxsseme_class 2008.1.12以後的版本
X課表的複製功能使用此函數所以要一並更新x_base模組

2008年2月2日 星期六

體適能修正

admin_1.php
全年級或某年級下載完成

fitness.php
空白欄位補上連結字元 

x_fitness修正

1. xoops_version
增加健康中心Web的偏好設定
$modversion['config'][2]['name'] = 'fitness_healthweb';
$modversion['config'][2]['title'] = '_MI_FITNESS_HEALTHWEB';
$modversion['config'][2]['description'] = '_MI_FITNESS_HEALTHWEB_DESC';
$modversion['config'][2]['formtype'] = 'textbox';
$modversion['config'][2]['valuetype'] = 'text';
$modversion['config'][2]['default'] = '';
2 .x_fitness
增加 從健康中心匯入和友善列印

預計增加管理介面的
1. 可以選擇年級
2. 可以匯出空白資料。