Initial commit.
This commit is contained in:
532
htdocs/wov/magicat/lib/acctsubj.sql
Normal file
532
htdocs/wov/magicat/lib/acctsubj.sql
Normal file
@@ -0,0 +1,532 @@
|
||||
BEGIN TRANSACTION;
|
||||
SET NAMES 'utf8';
|
||||
LOCK TABLE acctsubj IN ACCESS EXCLUSIVE MODE;
|
||||
DELETE FROM acctsubj;
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (372638070, NULL, '1', '資產', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (779709797, NULL, '2', '負債', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (309096272, NULL, '3', '業主權益', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (471592709, NULL, '4', '營業收入', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (923390793, NULL, '5', '營業成本', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (994752472, NULL, '6', '營業費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (962115884, NULL, '7', '營業外收入及費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (657609207, NULL, '8', '所得稅費用(或利益)', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (487023601, NULL, '9', '非經常營業損益', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (802972443, 372638070, '11', '流動資產', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (492735146, 372638070, '12', '流動資產', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (602662532, 372638070, '13', '基金及長期投資', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (601362886, 372638070, '14', '固定資產', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (463437233, 372638070, '15', '固定資產', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (813130827, 372638070, '16', '遞耗資產', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (888645287, 372638070, '17', '無形資產', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (314299094, 372638070, '18', '其他資產', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (613824503, 779709797, '21', '流動負債', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (125993341, 779709797, '22', '流動負債', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (434222646, 779709797, '23', '長期負債', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (741596219, 779709797, '28', '其他負債', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (714179679, 309096272, '31', '資本', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (931945860, 309096272, '32', '資本公積', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (926682414, 309096272, '33', '保留盈餘(或累積虧損)', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (676136047, 309096272, '34', '權益調整', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (793551134, 309096272, '35', '庫藏股', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (282449457, 309096272, '36', '少數股權', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (256854212, 471592709, '41', '銷貨收入', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (864303332, 471592709, '46', '勞務收入', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (685194984, 471592709, '47', '業務收入', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (585168046, 471592709, '48', '其他營業收入', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (776405888, 923390793, '51', '銷貨成本', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (484601714, 923390793, '56', '勞務成本製', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (656473437, 923390793, '57', '業務成本', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (526117422, 923390793, '58', '其他營業成本', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (847838836, 994752472, '61', '推銷費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (202779691, 994752472, '62', '管理及總務費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (390721534, 994752472, '63', '研究發展費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (613018617, 962115884, '71', '營業外收入', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (874636860, 962115884, '72', '營業外收入', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (933323474, 962115884, '73', '營業外收入', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (837668432, 962115884, '74', '營業外收入', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (658230315, 962115884, '75', '營業外費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (963623186, 962115884, '76', '營業外費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (726033439, 962115884, '77', '營業外費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (107974953, 962115884, '78', '營業外費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (531374062, 657609207, '81', '所得稅費用(或利益)', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (441557451, 487023601, '91', '停業部門損益', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (780750379, 487023601, '92', '非常損益', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (576655458, 487023601, '93', '會計原則變動累積影響數', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (403027649, 487023601, '94', '少數股權淨利', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (382831496, 802972443, '111', '現金及約當現金', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (405656198, 802972443, '112', '短期投資', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (274218035, 802972443, '113', '應收票據', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (236197229, 802972443, '114', '應收帳款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (990834888, 802972443, '118', '其他應收款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (802773250, 492735146, '121', '存貨', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (466973933, 492735146, '122', '存貨', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (434050648, 492735146, '125', '預付費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (349755763, 492735146, '126', '預付款項', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (336471657, 492735146, '128', '其他流動資產', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (956889094, 492735146, '129', '其他流動資產', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (425778949, 602662532, '131', '基金', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (640420175, 602662532, '132', '長期投資', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (410421689, 601362886, '141', '土地', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (503393820, 601362886, '142', '土地改良物', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (630438297, 601362886, '143', '房屋及建物', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (208976106, 601362886, '144', '機(器)具及設備', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (809268229, 601362886, '145', '機(器)具及設備', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (885610140, 601362886, '146', '機(器)具及設備', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (227011522, 463437233, '151', '租賃資產', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (733081973, 463437233, '152', '租賃權益改良', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (412438436, 463437233, '156', '未完工程及預付購置設備款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (373441509, 463437233, '158', '雜項固定資產', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (731330256, 813130827, '161', '遞耗資產', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (940611412, 888645287, '171', '商標權', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (138316570, 888645287, '172', '專利權', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (563900191, 888645287, '173', '特許權', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (423341137, 888645287, '174', '著作權', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (271146494, 888645287, '175', '電腦軟體', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (552238504, 888645287, '176', '商譽', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (207990296, 888645287, '177', '開辦費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (425720999, 888645287, '178', '其他無形資產', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (902673037, 314299094, '181', '遞延資產', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (966392319, 314299094, '182', '閒置資產', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (310547963, 314299094, '184', '長期應收票據及款項與催收帳款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (134097118, 314299094, '185', '出租資產', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (393449422, 314299094, '186', '存出保證金', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (464092583, 314299094, '188', '雜項資產', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (526855977, 613824503, '211', '短期借款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (974972811, 613824503, '212', '應付短期票券', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (862092008, 613824503, '213', '應付票據', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (705668893, 613824503, '214', '應付帳款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (815852043, 613824503, '216', '應付所得稅', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (287571641, 613824503, '217', '應付費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (574165963, 613824503, '218', '其他應付款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (674331210, 613824503, '219', '其他應付款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (889654543, 125993341, '226', '預收款項', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (815683575, 125993341, '227', '一年或一營業週期內到期長期負債', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (149212812, 125993341, '228', '其他流動負債', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (124114781, 125993341, '229', '其他流動負債', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (636315607, 434222646, '231', '應付公司債', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (663524372, 434222646, '232', '長期借款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (602970356, 434222646, '233', '長期應付票據及款項', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (319948252, 434222646, '234', '估計應付土地增值稅', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (489620321, 434222646, '235', '應計退休金負債', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (931718543, 434222646, '238', '其他長期負債', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (301894518, 741596219, '281', '遞延負債', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (753924220, 741596219, '286', '存入保證金', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (492886608, 741596219, '288', '雜項負債', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (354712237, 714179679, '311', '資本(或股本)', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (813886254, 931945860, '321', '股票溢價', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (369189273, 931945860, '323', '資產重估增值準備', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (708649341, 931945860, '324', '處分資產溢價公積', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (315953593, 931945860, '325', '合併公積', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (974832633, 931945860, '326', '受贈公積', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (981029756, 931945860, '328', '其他資本公積', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (782463283, 926682414, '331', '法定盈餘公積', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (511595327, 926682414, '332', '特別盈餘公積', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (266224620, 926682414, '335', '未分配盈餘(或累積虧損)', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (306542380, 676136047, '341', '長期股權投資未實現跌價損失', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (385524103, 676136047, '342', '累積換算調整數', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (764640716, 676136047, '343', '未認列為退休金成本之淨損失', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (277312763, 793551134, '351', '庫藏股', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (172889653, 282449457, '361', '少數股權', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (960138746, 256854212, '411', '銷貨收入', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (989545725, 256854212, '417', '銷貨退回', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (745165875, 256854212, '419', '銷貨折讓', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (788006197, 864303332, '461', '勞務收入', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (636092325, 685194984, '471', '業務收入', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (560294799, 585168046, '488', '其他營業收入—其他', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (868329781, 776405888, '511', '銷貨成本', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (715512696, 776405888, '512', '進貨', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (900537319, 776405888, '513', '進料', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (613686812, 776405888, '514', '直接人工', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (241828224, 776405888, '515', '製造費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (181591613, 776405888, '516', '製造費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (304113670, 776405888, '517', '製造費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (302614029, 776405888, '518', '製造費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (181853880, 484601714, '561', '勞務成本', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (760077428, 656473437, '571', '業務成本', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (100599165, 526117422, '588', '其他營業成本—其他', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (212916398, 847838836, '615', '推銷費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (193074244, 847838836, '616', '推銷費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (882721016, 847838836, '617', '推銷費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (514554832, 847838836, '618', '推銷費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (241184521, 202779691, '625', '管理及總務費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (776997540, 202779691, '626', '管理及總務費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (324522418, 202779691, '627', '管理及總務費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (543298708, 202779691, '628', '管理及總務費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (751717808, 390721534, '635', '研究發展費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (509842953, 390721534, '636', '研究發展費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (334520736, 390721534, '637', '研究發展費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (647304802, 390721534, '638', '研究發展費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (748583072, 613018617, '711', '利息收入', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (807935097, 613018617, '712', '投資收益', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (256128674, 613018617, '713', '兌換利益', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (902036208, 613018617, '714', '處分投資收益', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (206038830, 613018617, '715', '處分資產溢價收入', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (699454747, 837668432, '748', '其他營業外收入', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (988959446, 658230315, '751', '利息費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (548598499, 658230315, '752', '投資損失', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (947980201, 658230315, '753', '兌換損失', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (286649244, 658230315, '754', '處分投資損失', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (537384847, 658230315, '755', '處分資產損失', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (928820789, 107974953, '788', '其他營業外費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (687819205, 531374062, '811', '所得稅費用(或利益)', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (392121771, 441557451, '911', '停業部門損益—停業前營業損益', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (816367329, 441557451, '912', '停業部門損益—處分損益', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (749878410, 780750379, '921', '非常損益', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (575458948, 576655458, '931', '會計原則變動累積影響數', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (867926470, 403027649, '941', '少數股權淨利', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (709320418, 382831496, '1111', '庫存現金', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (135867103, 382831496, '1112', '零用金/週轉金', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (321673137, 382831496, '1113', '銀行存款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (914806389, 382831496, '1116', '在途現金', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (408077817, 382831496, '1117', '約當現金', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (269390224, 382831496, '1118', '其他現金及約當現金', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (114003147, 405656198, '1121', '短期投資—股票', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (420496091, 405656198, '1122', '短期投資—短期票券', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (494011567, 405656198, '1123', '短期投資—政府債券', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (249856724, 405656198, '1124', '短期投資—受益憑證', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (216784076, 405656198, '1125', '短期投資—公司債', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (816605640, 405656198, '1128', '短期投資—其他', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (719765760, 405656198, '1129', '備抵短期投資跌價損失', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (530499921, 274218035, '1131', '應收票據', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (983472201, 274218035, '1132', '應收票據貼現', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (460805176, 274218035, '1137', '應收票據—關係人', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (221108972, 274218035, '1138', '其他應收票據', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (190869303, 274218035, '1139', '備抵呆帳-應收票據', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (357244797, 236197229, '1141', '應收帳款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (138999680, 236197229, '1142', '應收分期帳款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (171512916, 236197229, '1147', '應收帳款—關係人', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (742536124, 236197229, '1149', '備抵呆帳-應收帳款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (508867657, 990834888, '1181', '應收出售遠匯款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (616644337, 990834888, '1182', '應收遠匯款—外幣', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (302006318, 990834888, '1183', '買賣遠匯折價', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (903867355, 990834888, '1184', '應收收益', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (854876598, 990834888, '1185', '應收退稅款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (641587374, 990834888, '1187', '其他應收款—關係人', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (654713656, 990834888, '1188', '其他應收款—其他', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (254902966, 990834888, '1189', '備抵呆帳—其他應收款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (517810159, 802773250, '1211', '商品存貨', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (856687013, 802773250, '1212', '寄銷商品', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (349662815, 802773250, '1213', '在途商品', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (949622536, 802773250, '1219', '備抵存貨跌價損失', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (269987198, 466973933, '1221', '製成品', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (339342377, 466973933, '1222', '寄銷製成品', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (795640862, 466973933, '1223', '副產品', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (713275114, 466973933, '1224', '在製品', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (237383628, 466973933, '1225', '委外加工', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (968977504, 466973933, '1226', '原料', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (712112558, 466973933, '1227', '物料', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (944100101, 466973933, '1228', '在途原物料', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (407577736, 466973933, '1229', '備抵存貨跌價損失', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (880958169, 434050648, '1251', '預付薪資', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (490823964, 434050648, '1252', '預付租金', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (917878000, 434050648, '1253', '預付保險費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (970366836, 434050648, '1254', '用品盤存', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (996500723, 434050648, '1255', '預付所得稅', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (473338112, 434050648, '1258', '其他預付費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (820572193, 349755763, '1261', '預付貨款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (739184995, 349755763, '1268', '其他預付款項', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (799510698, 336471657, '1281', '進項稅額', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (360348142, 336471657, '1282', '留抵稅額', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (108172724, 336471657, '1283', '暫付款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (331360768, 336471657, '1284', '代付款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (341189219, 336471657, '1285', '員工借支', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (576455206, 336471657, '1286', '存出保證金', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (777109496, 336471657, '1287', '受限制存款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (683845821, 956889094, '1291', '遞延所得稅資產', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (296452414, 956889094, '1292', '遞延兌換損失', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (961765736, 956889094, '1293', '業主(股東)往來', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (775706481, 956889094, '1294', '同業往來', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (114433500, 956889094, '1298', '其他流動資產—其他', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (329070757, 425778949, '1311', '償債基金', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (141049975, 425778949, '1312', '改良及擴充基金', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (263604680, 425778949, '1313', '意外損失準備基金', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (205596434, 425778949, '1314', '退休基金', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (477861646, 425778949, '1318', '其他基金', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (269517922, 640420175, '1321', '長期股權投資', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (237455794, 640420175, '1322', '長期債券投資', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (645642557, 640420175, '1323', '長期不動產投資', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (988732317, 640420175, '1324', '人壽保險現金解約價值', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (179029710, 640420175, '1328', '其他長期投資', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (557110012, 640420175, '1329', '備抵長期投資跌價損失', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (249470146, 410421689, '1411', '土地', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (247906429, 410421689, '1418', '土地—重估增值', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (852596764, 503393820, '1421', '土地改良物', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (885681227, 503393820, '1428', '土地改良物—重估增值', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (146158043, 503393820, '1429', '累積折舊—土地改良物', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (732874115, 630438297, '1431', '房屋及建物', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (961492609, 630438297, '1438', '房屋及建物—重估增值', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (472025359, 630438297, '1439', '累積折舊—房屋及建物', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (443132757, 208976106, '1441', '機(器)具', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (878642052, 208976106, '1448', '機(器)具—重估增值', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (176634779, 208976106, '1449', '累積折舊—機(器)具', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (167128653, 227011522, '1511', '租賃資產', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (894698061, 227011522, '1519', '累積折舊—租賃資產', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (848449822, 733081973, '1521', '租賃權益改良', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (752891550, 733081973, '1529', '累積折舊—租賃權益改良', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (852551772, 412438436, '1561', '未完工程', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (137095705, 412438436, '1562', '預付購置設備款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (917546730, 373441509, '1581', '雜項固定資產', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (615691173, 373441509, '1588', '雜項固定資產—重估增值', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (334353583, 373441509, '1589', '累積折舊—雜項固定資產', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (631601277, 731330256, '1611', '天然資源', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (494736884, 731330256, '1618', '天然資源—重估增值', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (708161453, 731330256, '1619', '累積折耗—天然資源', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (898829698, 940611412, '1711', '商標權', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (542872803, 138316570, '1721', '專利權', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (664609986, 563900191, '1731', '特許權', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (683710952, 423341137, '1741', '著作權', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (655011428, 271146494, '1751', '電腦軟體', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (491099730, 552238504, '1761', '商譽', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (780653448, 207990296, '1771', '開辦費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (623499301, 425720999, '1781', '遞延退休金成本', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (485309798, 425720999, '1782', '租賃權益改良', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (255497196, 425720999, '1788', '其他無形資產—其他', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (949323475, 902673037, '1811', '債券發行成本', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (985965124, 902673037, '1812', '長期預付租金', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (761148020, 902673037, '1813', '長期預付保險費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (783218271, 902673037, '1814', '遞延所得稅資產', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (542736097, 902673037, '1815', '預付退休金', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (442130454, 902673037, '1818', '其他遞延資產', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (440158264, 966392319, '1821', '閒置資產', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (814490947, 310547963, '1841', '長期應收票據', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (464584131, 310547963, '1842', '長期應收帳款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (246737265, 310547963, '1843', '催收帳款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (269841085, 310547963, '1847', '長期應收票據及款項與催收帳款—關係人', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (972215319, 310547963, '1848', '其他長期應收款項', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (273415222, 310547963, '1849', '備抵呆帳—長期應收票據及款項與催收帳款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (342664393, 134097118, '1851', '出租資產', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (967877399, 134097118, '1858', '出租資產—重估增值', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (465680425, 134097118, '1859', '累積折舊—出租資產', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (169304689, 393449422, '1861', '存出保證金', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (691103727, 464092583, '1881', '受限制存款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (408984785, 464092583, '1888', '雜項資產—其他', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (114592873, 526855977, '2111', '銀行透支', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (155572537, 526855977, '2112', '銀行借款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (679537588, 526855977, '2114', '短期借款—業主', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (113826174, 526855977, '2115', '短期借款—員工', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (535176493, 526855977, '2117', '短期借款—關係人', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (554436773, 526855977, '2118', '短期借款—其他', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (845861820, 974972811, '2121', '應付商業本票', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (937575852, 974972811, '2122', '銀行承兌匯票', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (626442033, 974972811, '2128', '其他應付短期票券', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (343837879, 974972811, '2129', '應付短期票券折價', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (602560682, 862092008, '2131', '應付票據', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (188954343, 862092008, '2137', '應付票據—關係人', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (716389216, 862092008, '2138', '其他應付票據', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (778146915, 705668893, '2141', '應付帳款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (277492307, 705668893, '2147', '應付帳款—關係人', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (458551240, 815852043, '2161', '應付所得稅', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (247253522, 287571641, '2171', '應付薪工', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (995680120, 287571641, '2172', '應付租金', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (655731761, 287571641, '2173', '應付利息', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (795817638, 287571641, '2174', '應付營業稅', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (701122645, 287571641, '2175', '應付稅捐—其他', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (415046011, 287571641, '2178', '其他應付費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (303499610, 574165963, '2181', '應付購入遠匯款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (784043626, 574165963, '2182', '應付遠匯款—外幣', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (855311038, 574165963, '2183', '買賣遠匯溢價', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (196069634, 574165963, '2184', '應付土地房屋款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (344246957, 574165963, '2185', '應付設備款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (522820430, 574165963, '2187', '其他應付款—關係人', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (256595974, 674331210, '2191', '應付股利', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (831657893, 674331210, '2192', '應付紅利', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (397555135, 674331210, '2193', '應付董監事酬勞', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (727862503, 674331210, '2198', '其他應付款—其他', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (968398485, 889654543, '2261', '預收貨款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (738337468, 889654543, '2262', '預收收入', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (563034212, 889654543, '2268', '其他預收款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (602636212, 815683575, '2271', '一年或一營業週期內到期公司債', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (661663180, 815683575, '2272', '一年或一營業週期內到期長期借款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (395722825, 815683575, '2273', '一年或一營業週期內到期長期應付票據及款項', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (658576158, 815683575, '2277', '一年或一營業週期內到期長期應付票據及款項—關係人', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (968075004, 815683575, '2278', '其他一年或一營業週期內到期長期負債', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (832790463, 149212812, '2281', '銷項稅額', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (520828967, 149212812, '2283', '暫收款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (900155521, 149212812, '2284', '代收款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (962885081, 149212812, '2285', '估計售後服務/保固負債', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (667554008, 124114781, '2291', '遞延所得稅負債', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (150466923, 124114781, '2292', '遞延兌換利益', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (229204760, 124114781, '2293', '業主(股東)往來', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (743752020, 124114781, '2294', '同業往來', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (963358650, 124114781, '2298', '其他流動負債—其他', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (994047310, 636315607, '2311', '應付公司債', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (564067541, 636315607, '2319', '應付公司債溢(折)價', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (332401391, 663524372, '2321', '長期銀行借款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (241134962, 663524372, '2324', '長期借款—業主', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (536628622, 663524372, '2325', '長期借款—員工', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (130108314, 663524372, '2327', '長期借款—關係人', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (324261557, 663524372, '2328', '長期借款—其他', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (448115003, 602970356, '2331', '長期應付票據', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (446205039, 602970356, '2332', '長期應付帳款', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (634999950, 602970356, '2333', '長期應付租賃負債', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (704803584, 602970356, '2337', '長期應付票據及款項—關係人', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (581989752, 602970356, '2338', '其他長期應付款項', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (324818500, 319948252, '2341', '估計應付土地增值稅', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (123105059, 489620321, '2351', '應計退休金負債', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (816932701, 931718543, '2388', '其他長期負債—其他', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (371625981, 301894518, '2811', '遞延收入', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (446449324, 301894518, '2814', '遞延所得稅負債', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (507605492, 301894518, '2818', '其他遞延負債', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (402582161, 753924220, '2861', '存入保證金', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (278544397, 492886608, '2888', '雜項負債—其他', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (828698884, 354712237, '3111', '普通股股本', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (328325342, 354712237, '3112', '特別股股本', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (459479972, 354712237, '3113', '預收股本', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (243470269, 354712237, '3114', '待分配股票股利', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (574499376, 354712237, '3115', '資本', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (774555174, 813886254, '3211', '普通股股票溢價', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (429550621, 813886254, '3212', '特別股股票溢價', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (783013002, 369189273, '3231', '資產重估增值準備', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (505504878, 708649341, '3241', '處分資產溢價公積', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (198451128, 315953593, '3251', '合併公積', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (677269224, 974832633, '3261', '受贈公積', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (740275783, 981029756, '3281', '權益法長期股權投資資本公積', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (153032059, 981029756, '3282', '資本公積—庫藏股票交易', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (898896606, 782463283, '3311', '法定盈餘公積', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (847258147, 511595327, '3321', '意外損失準備', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (140115980, 511595327, '3322', '改良擴充準備', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (214588543, 511595327, '3323', '償債準備', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (296533405, 511595327, '3328', '其他特別盈餘公積', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (972322693, 266224620, '3351', '累積盈虧', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (782859992, 266224620, '3352', '前期損益調整', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (464874427, 266224620, '3353', '本期損益', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (136762997, 306542380, '3411', '長期股權投資未實現跌價損失', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (361841681, 385524103, '3421', '累積換算調整數', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (800323292, 764640716, '3431', '未認列為退休金成本之淨損失', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (796953172, 277312763, '3511', '庫藏股', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (332969156, 172889653, '3611', '少數股權', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (650902163, 960138746, '4111', '銷貨收入', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (873610886, 960138746, '4112', '分期付款銷貨收入', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (480909546, 989545725, '4171', '銷貨退回', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (501414887, 745165875, '4191', '銷貨折讓', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (861798963, 788006197, '4611', '勞務收入', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (884801039, 636092325, '4711', '業務收入', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (859154718, 560294799, '4888', '其他營業收入—其他', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (491926593, 868329781, '5111', '銷貨成本', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (689575672, 868329781, '5112', '分期付款銷貨成本', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (513484217, 715512696, '5121', '進貨', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (746574640, 715512696, '5122', '進貨費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (804616176, 715512696, '5123', '進貨退出', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (704293010, 715512696, '5124', '進貨折讓', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (746290542, 900537319, '5131', '進料', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (993482623, 900537319, '5132', '進料費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (917839380, 900537319, '5133', '進料退出', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (685864530, 900537319, '5134', '進料折讓', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (802855875, 613686812, '5141', '直接人工', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (874928238, 241828224, '5151', '間接人工', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (571990586, 241828224, '5152', '租金支出', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (907852408, 241828224, '5153', '文具用品', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (487824813, 241828224, '5154', '旅費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (142992418, 241828224, '5155', '運費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (438547603, 241828224, '5156', '郵電費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (338883877, 241828224, '5157', '修繕費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (405956607, 241828224, '5158', '包裝費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (472485669, 181591613, '5161', '水電瓦斯費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (205274197, 181591613, '5162', '保險費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (372710710, 181591613, '5163', '加工費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (759488099, 181591613, '5166', '稅捐', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (624747656, 181591613, '5168', '折舊', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (373245274, 181591613, '5169', '各項耗竭及攤提', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (857831389, 304113670, '5172', '伙食費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (224729498, 304113670, '5173', '職工福利', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (380369895, 304113670, '5176', '訓練費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (756274240, 304113670, '5177', '間接材料', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (716532124, 302614029, '5188', '其他製造費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (152349985, 181853880, '5611', '勞務成本', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (757538860, 760077428, '5711', '業務成本', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (110601204, 100599165, '5888', '其他營業成本—其他', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (501745153, 212916398, '6151', '薪資支出', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (484688983, 212916398, '6152', '租金支出', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (347797343, 212916398, '6153', '文具用品', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (184863859, 212916398, '6154', '旅費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (982899606, 212916398, '6155', '運費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (548256289, 212916398, '6156', '郵電費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (201382357, 212916398, '6157', '修繕費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (945252074, 212916398, '6159', '廣告費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (912643138, 193074244, '6161', '水電瓦斯費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (482723373, 193074244, '6162', '保險費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (667516040, 193074244, '6164', '交際費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (696487087, 193074244, '6165', '捐贈', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (252695337, 193074244, '6166', '稅捐', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (464334795, 193074244, '6167', '呆帳損失', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (205262005, 193074244, '6168', '折舊', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (929323612, 193074244, '6169', '各項耗竭及攤提', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (615973093, 882721016, '6172', '伙食費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (584771226, 882721016, '6173', '職工福利', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (193536017, 882721016, '6175', '佣金支出', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (893417802, 882721016, '6176', '訓練費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (764382524, 514554832, '6188', '其他推銷費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (851874623, 241184521, '6251', '薪資支出', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (176861982, 241184521, '6252', '租金支出', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (329717777, 241184521, '6253', '文具用品', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (227243112, 241184521, '6254', '旅費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (489915115, 241184521, '6255', '運費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (930339612, 241184521, '6256', '郵電費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (928410985, 241184521, '6257', '修繕費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (128201317, 241184521, '6259', '廣告費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (570663854, 776997540, '6261', '水電瓦斯費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (433448958, 776997540, '6262', '保險費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (681610895, 776997540, '6264', '交際費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (521769517, 776997540, '6265', '捐贈', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (796674668, 776997540, '6266', '稅捐', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (829731934, 776997540, '6267', '呆帳損失', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (619404096, 776997540, '6268', '折舊', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (201420585, 776997540, '6269', '各項耗竭及攤提', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (761920757, 324522418, '6271', '外銷損失', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (666597144, 324522418, '6272', '伙食費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (893939737, 324522418, '6273', '職工福利', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (695670103, 324522418, '6274', '研究發展費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (617144018, 324522418, '6275', '佣金支出', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (356589445, 324522418, '6276', '訓練費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (469570957, 324522418, '6278', '勞務費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (877041170, 543298708, '6288', '其他管理及總務費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (285629796, 751717808, '6351', '薪資支出', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (255109839, 751717808, '6352', '租金支出', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (293609536, 751717808, '6353', '文具用品', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (870547203, 751717808, '6354', '旅費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (885107086, 751717808, '6355', '運費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (987987224, 751717808, '6356', '郵電費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (438300022, 751717808, '6357', '修繕費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (926725156, 509842953, '6361', '水電瓦斯費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (371394354, 509842953, '6362', '保險費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (690276284, 509842953, '6364', '交際費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (991739983, 509842953, '6366', '稅捐', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (871746448, 509842953, '6368', '折舊', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (895377402, 509842953, '6369', '各項耗竭及攤提', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (691533190, 334520736, '6372', '伙食費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (425563486, 334520736, '6373', '職工福利', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (730229601, 334520736, '6376', '訓練費', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (755843878, 334520736, '6378', '其他研究發展費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (935512761, 748583072, '7111', '利息收入', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (117472286, 807935097, '7121', '權益法認列之投資收益', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (740643479, 807935097, '7122', '股利收入', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (893347443, 807935097, '7123', '短期投資市價回升利益', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (788210158, 256128674, '7131', '兌換利益', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (164663168, 902036208, '7141', '處分投資收益', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (318252073, 206038830, '7151', '處分資產溢價收入', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (444183965, 699454747, '7481', '捐贈收入', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (428472055, 699454747, '7482', '租金收入', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (592692377, 699454747, '7483', '佣金收入', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (525102294, 699454747, '7484', '出售下腳及廢料收入', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (806095768, 699454747, '7485', '存貨盤盈', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (742624311, 699454747, '7486', '存貨跌價回升利益', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (666483691, 699454747, '7487', '壞帳轉回利益', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (753349254, 699454747, '7488', '其他營業外收入—其他', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (438653661, 988959446, '7511', '利息費用', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (647865532, 548598499, '7521', '權益法認列之投資損失', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (514482416, 548598499, '7523', '短期投資未實現跌價損失', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (929065316, 947980201, '7531', '兌換損失', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (869388482, 286649244, '7541', '處分投資損失', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (139281291, 537384847, '7551', '處分資產損失', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (222152959, 928820789, '7881', '停工損失', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (674468763, 928820789, '7882', '災害損失', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (922455040, 928820789, '7885', '存貨盤損', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (309527256, 928820789, '7886', '存貨跌價及呆滯損失', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (571194746, 928820789, '7888', '其他營業外費用—其他', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (792176665, 687819205, '8111', '所得稅費用(或利益)', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (958524871, 392121771, '9111', '停業部門損益—停業前營業損益', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (997358780, 816367329, '9121', '停業部門損益—處分損益', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (250404501, 749878410, '9211', '非常損益', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (334638274, 575458948, '9311', '會計原則變動累積影響數', now(), 923153018, now(), 923153018);
|
||||
INSERT INTO acctsubj (sn, parent, code, title, created, createdby, updated, updatedby) VALUES (474145902, 867926470, '9411', '少數股權淨利', now(), 923153018, now(), 923153018);
|
||||
COMMIT;
|
||||
70
htdocs/wov/magicat/lib/perl5/Selima/wov.pm
Normal file
70
htdocs/wov/magicat/lib/perl5/Selima/wov.pm
Normal file
@@ -0,0 +1,70 @@
|
||||
# Woman's Voice
|
||||
# wov.pm: Woman's Voice
|
||||
|
||||
# Copyright (c) 2003-2018 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Author: imacat <imacat@mail.imacat.idv.tw>
|
||||
# First written: 2003-04-06
|
||||
|
||||
package Selima::wov;
|
||||
use 5.008;
|
||||
use strict;
|
||||
use warnings;
|
||||
use base qw(Exporter);
|
||||
use vars qw(@EXPORT @EXPORT_OK);
|
||||
@EXPORT = qw();
|
||||
|
||||
# Import our site-specific subroutines
|
||||
use Selima::wov::Config;
|
||||
push @EXPORT, @Selima::wov::Config::EXPORT;
|
||||
use Selima::wov::DataVars qw(:all);
|
||||
push @EXPORT, @Selima::wov::DataVars::EXPORT_OK;
|
||||
use Selima::wov::HTML;
|
||||
push @EXPORT, @Selima::wov::HTML::EXPORT;
|
||||
use Selima::wov::Items;
|
||||
push @EXPORT, @Selima::wov::Items::EXPORT;
|
||||
use Selima::wov::Rebuild;
|
||||
push @EXPORT, @Selima::wov::Rebuild::EXPORT;
|
||||
|
||||
# Import our site-specific classess
|
||||
use Selima::wov::Checker::Guestbook;
|
||||
use Selima::wov::Checker::Guestbook::Public;
|
||||
use Selima::wov::Checker::Newslet;
|
||||
use Selima::wov::Checker::NLArt;
|
||||
use Selima::wov::Form::Guestbook;
|
||||
use Selima::wov::Form::Guestbook::Public;
|
||||
use Selima::wov::Form::Page;
|
||||
use Selima::wov::Form::LinkCat;
|
||||
use Selima::wov::Form::Newslet;
|
||||
use Selima::wov::Form::NLArt;
|
||||
use Selima::wov::L10N;
|
||||
use Selima::wov::List::Guestbook;
|
||||
use Selima::wov::List::Guestbook::Public;
|
||||
use Selima::wov::List::Newslets;
|
||||
use Selima::wov::List::NLArts;
|
||||
use Selima::wov::List::Search;
|
||||
use Selima::wov::Processor::Guestbook::Public;
|
||||
use Selima::wov::Processor::Page;
|
||||
use Selima::wov::Processor::LinkCat;
|
||||
use Selima::wov::Processor::Newslet;
|
||||
use Selima::wov::Processor::NLArt;
|
||||
|
||||
# Import our common modules
|
||||
use Selima;
|
||||
push @EXPORT, @Selima::EXPORT;
|
||||
|
||||
@EXPORT_OK = @EXPORT;
|
||||
|
||||
return 1;
|
||||
27
htdocs/wov/magicat/lib/perl5/Selima/wov/Checker/Guestbook.pm
Normal file
27
htdocs/wov/magicat/lib/perl5/Selima/wov/Checker/Guestbook.pm
Normal file
@@ -0,0 +1,27 @@
|
||||
# Woman's Voice
|
||||
# Guestbook.pm: The administrative guestbook form checker.
|
||||
|
||||
# Copyright (c) 2004-2018 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Author: imacat <imacat@mail.imacat.idv.tw>
|
||||
# First written: 2004-10-24
|
||||
|
||||
package Selima::wov::Checker::Guestbook;
|
||||
use 5.008;
|
||||
use strict;
|
||||
use warnings;
|
||||
use base qw(Selima::Checker::Guestbook);
|
||||
|
||||
return 1;
|
||||
@@ -0,0 +1,60 @@
|
||||
# Woman's Voice
|
||||
# Public.pm: The guestbook form checker.
|
||||
|
||||
# Copyright (c) 2004-2018 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Author: imacat <imacat@mail.imacat.idv.tw>
|
||||
# First written: 2004-10-24
|
||||
|
||||
package Selima::wov::Checker::Guestbook::Public;
|
||||
use 5.008;
|
||||
use utf8;
|
||||
use strict;
|
||||
use warnings;
|
||||
use base qw(Selima::Checker::Guestbook::Public);
|
||||
|
||||
use Selima::DataVars qw($DBH);
|
||||
use Selima::HTTP;
|
||||
use Selima::Logging;
|
||||
use Selima::ShortCut;
|
||||
|
||||
# _checkspam_local: Check the local content filter
|
||||
sub _checkspam_local : method {
|
||||
local ($_, %_);
|
||||
my ($self, $form);
|
||||
$self = $_[0];
|
||||
$form = $self->{"form"};
|
||||
# Block HiNet 61.224.20x till 2007-05-01, for 粉領上班族
|
||||
$self->_block_spam("_checkspam_local(): Suspicious spamming from 粉領上班族")
|
||||
if time <= 1177948800
|
||||
&& $ENV{"REMOTE_ADDR"} =~ /^61\.224\.20\d/;
|
||||
# OK
|
||||
return;
|
||||
}
|
||||
|
||||
# Old blocker
|
||||
# 清濤命理網站 http://click.twmis.net/
|
||||
# $self->_block_spam("_checkspam_local(): Suspicious spamming from http://click.twmis.net/.")
|
||||
# if $form->param("message") =~ /http:\/\/click\.twmis\.net/i
|
||||
# || $form->param("url") =~ /http:\/\/click\.twmis\.net/i
|
||||
# || $form->param("message") =~ /http:\/\/unn\.sexll\.com/i
|
||||
# || $form->param("url") =~ /http:\/\/unn\.sexll\.com/i
|
||||
# || $form->param("message") =~ /靈異節目(?:....)?老師/;
|
||||
# Icegirl
|
||||
# $self->_block_spam("_checkspam_local(): Suspicious spamming from Icegirl.")
|
||||
# if $ENV{"REMOTE_ADDR"} eq "218.166.124.90" || $ENV{"REMOTE_ADDR"} eq "218.166.125.76";
|
||||
|
||||
no utf8;
|
||||
return 1;
|
||||
139
htdocs/wov/magicat/lib/perl5/Selima/wov/Checker/NLArt.pm
Normal file
139
htdocs/wov/magicat/lib/perl5/Selima/wov/Checker/NLArt.pm
Normal file
@@ -0,0 +1,139 @@
|
||||
# Woman's Voice
|
||||
# NLArt.pm: The newsletter article form checker.
|
||||
|
||||
# Copyright (c) 2004-2018 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Author: imacat <imacat@mail.imacat.idv.tw>
|
||||
# First written: 2004-11-24
|
||||
|
||||
package Selima::wov::Checker::NLArt;
|
||||
use 5.008;
|
||||
use strict;
|
||||
use warnings;
|
||||
use base qw(Selima::Checker);
|
||||
|
||||
use Selima::CallForm;
|
||||
use Selima::ChkFunc;
|
||||
use Selima::ShortCut;
|
||||
|
||||
use Selima::wov::DataVars qw(:forms);
|
||||
|
||||
# new: Initialize the checker
|
||||
sub new : method {
|
||||
local ($_, %_);
|
||||
my ($class, $self);
|
||||
($class, @_) = @_;
|
||||
$_[1] = "nlarts" if scalar(@_) < 2 || !defined $_[1];
|
||||
$self = $class->SUPER::new(@_);
|
||||
return $self;
|
||||
}
|
||||
|
||||
# _check_author: Check the author
|
||||
# Use the default author checker
|
||||
|
||||
# _check_body_h: Check the HTML content body
|
||||
sub _check_body_h : method {
|
||||
local ($_, %_);
|
||||
my ($self, $form, $error);
|
||||
$self = $_[0];
|
||||
$form = $self->{"form"};
|
||||
# Check if it exists
|
||||
$error = $self->_missing("body_h");
|
||||
return $error if defined $error;
|
||||
# Regularize it
|
||||
$self->_trimtext("body_h");
|
||||
# Check if it is filled
|
||||
$form->param("body_h", "")
|
||||
if $form->param("body_h") eq __("Fill in the HTML content here.");
|
||||
return {"msg"=>N_("Please fill in the HTML content.")}
|
||||
if $form->param("body_h") eq "";
|
||||
# Check the length
|
||||
return {"msg"=>N_("This HTML content is too long. (Max. length [#,_1])"),
|
||||
"margs"=>[${$self->{"maxlens"}}{"body_h"}]}
|
||||
if length $form->param("body_h") > ${$self->{"maxlens"}}{"body_h"};
|
||||
# OK
|
||||
return;
|
||||
}
|
||||
|
||||
# _check_body_t: Check the plain text content body
|
||||
sub _check_body_t : method {
|
||||
local ($_, %_);
|
||||
my ($self, $form, $error);
|
||||
$self = $_[0];
|
||||
$form = $self->{"form"};
|
||||
# Check if it exists
|
||||
$error = $self->_missing("body_t");
|
||||
return $error if defined $error;
|
||||
# Regularize it
|
||||
$self->_trimtext("body_t");
|
||||
# Check if it is filled
|
||||
$form->param("body_t", "")
|
||||
if $form->param("body_t") eq __("Fill in the plain text content here.");
|
||||
return {"msg"=>N_("Please fill in the plain text content.")}
|
||||
if $form->param("body_t") eq "";
|
||||
# Check the length
|
||||
return {"msg"=>N_("This plain text content is too long. (Max. length [#,_1])"),
|
||||
"margs"=>[${$self->{"maxlens"}}{"body_t"}]}
|
||||
if length $form->param("body_t") > ${$self->{"maxlens"}}{"body_t"};
|
||||
# OK
|
||||
return;
|
||||
}
|
||||
|
||||
# _check_newslet: Check the newsletter
|
||||
sub _check_newslet : method {
|
||||
local ($_, %_);
|
||||
my ($self, $form, $error);
|
||||
$self = $_[0];
|
||||
$form = $self->{"form"};
|
||||
# Check if it exists
|
||||
$error = $self->_missing("newslet");
|
||||
return $error if defined $error;
|
||||
# Regularize it
|
||||
$self->_trim("newslet");
|
||||
# Check if it is filled
|
||||
return {"msg"=>N_("Please select a newsletter.")}
|
||||
if $form->param("newslet") eq "";
|
||||
# Check if the newsletter exists
|
||||
return {"msg"=>N_("This newsletter does not exist anymore. Please select another one.")}
|
||||
if !check_sn_in ${$form->param_fetch("newslet")}[0], "newslets";
|
||||
# OK
|
||||
return;
|
||||
}
|
||||
|
||||
# _check_title: Check the title
|
||||
# Use the default title checker
|
||||
|
||||
# _redir_selnewslet: Suspend and move to the newsletter selection form
|
||||
sub _redir_selnewslet : method {
|
||||
local ($_, %_);
|
||||
my $self;
|
||||
$self = $_[0];
|
||||
# Skip if not requested
|
||||
return if $self->_missing("selnewslet");
|
||||
call_form FORM_NEWSLETS, undef, "import_selnewslet";
|
||||
}
|
||||
|
||||
# _redir_delnewslet: Remove the newsletter
|
||||
sub _redir_delnewslet : method {
|
||||
local ($_, %_);
|
||||
my $self;
|
||||
$self = $_[0];
|
||||
# Skip if not requested
|
||||
return if $self->_missing("delnewslet");
|
||||
$self->{"form"}->delete("newslet");
|
||||
success_redirect undef;
|
||||
}
|
||||
|
||||
return 1;
|
||||
173
htdocs/wov/magicat/lib/perl5/Selima/wov/Checker/Newslet.pm
Normal file
173
htdocs/wov/magicat/lib/perl5/Selima/wov/Checker/Newslet.pm
Normal file
@@ -0,0 +1,173 @@
|
||||
# Woman's Voice
|
||||
# Newslet.pm: The newsletter form checker.
|
||||
|
||||
# Copyright (c) 2004-2018 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Author: imacat <imacat@mail.imacat.idv.tw>
|
||||
# First written: 2004-11-22
|
||||
|
||||
package Selima::wov::Checker::Newslet;
|
||||
use 5.008;
|
||||
use strict;
|
||||
use warnings;
|
||||
use base qw(Selima::Checker);
|
||||
|
||||
use CGI qw();
|
||||
|
||||
use Selima::ChkFunc;
|
||||
use Selima::DataVars qw(:dataman);
|
||||
use Selima::ShortCut;
|
||||
|
||||
use Selima::wov::Items;
|
||||
|
||||
use Selima::wov::Checker::NLArt;
|
||||
|
||||
# new: Initialize the checker
|
||||
sub new : method {
|
||||
local ($_, %_);
|
||||
my ($class, $self);
|
||||
($class, @_) = @_;
|
||||
$_[1] = "newslets" if scalar(@_) < 2 || !defined $_[1];
|
||||
$self = $class->SUPER::new(@_);
|
||||
return $self;
|
||||
}
|
||||
|
||||
# _check_arts: Check the articles
|
||||
sub _check_arts : method {
|
||||
local ($_, %_);
|
||||
my ($self, $form);
|
||||
$self = $_[0];
|
||||
$form = $self->{"form"};
|
||||
# Remove the default content
|
||||
foreach (grep /^art\d+body_t$/, $form->param) {
|
||||
$form->param($_, "")
|
||||
if $form->param($_) eq __("Fill in the plain text content here.");
|
||||
}
|
||||
foreach (grep /^art\d+body_h$/, $form->param) {
|
||||
$form->param($_, "")
|
||||
if $form->param($_) eq __("Fill in the HTML content here.");
|
||||
}
|
||||
# Loop each article
|
||||
for ($_ = 0; !$self->_missing("art$_" . "title"); $_++) {
|
||||
my ($subform, $checker, $error);
|
||||
# Skip unselected ones
|
||||
next if $self->_missing("art$_");
|
||||
# Regularize it
|
||||
$self->_trim("art$_" . "title");
|
||||
$self->_trim("art$_" . "author");
|
||||
$self->_trimtext("art$_" . "body_t");
|
||||
$self->_trimtext("art$_" . "body_h");
|
||||
# Check with the subform checker
|
||||
$subform = new CGI("");
|
||||
$subform->param("newslet", $self->{"sn"}) if $self->{"iscur"};
|
||||
$subform->param("title", $form->param("art$_" . "title"));
|
||||
$subform->param("author", $form->param("art$_" . "author"));
|
||||
$subform->param("body_t", $form->param("art$_" . "body_t"));
|
||||
$subform->param("body_h", $form->param("art$_" . "body_h"));
|
||||
$checker = new Selima::wov::Checker::NLArt($subform);
|
||||
$error = $checker->check("title", "author", "body_t", "body_h");
|
||||
return $error if defined $error;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
# _check_no: Check the issue number
|
||||
# Actually this is to set the issue number, but not to check it
|
||||
sub _check_no : method {
|
||||
local ($_, %_);
|
||||
my $self;
|
||||
$self = $_[0];
|
||||
# Current form
|
||||
if ($self->{"iscur"}) {
|
||||
$self->{"form"}->param("no", $CURRENT{"no"});
|
||||
return;
|
||||
}
|
||||
# Create a new issue for this new newsletter
|
||||
$self->{"form"}->param("no", new_nl_no);
|
||||
return;
|
||||
}
|
||||
|
||||
# _check_date: Check the date
|
||||
sub _check_date : method {
|
||||
local ($_, %_);
|
||||
my ($self, $form, $error);
|
||||
$self = $_[0];
|
||||
$form = $self->{"form"};
|
||||
# Check if it exists
|
||||
$error = $self->_missing("date");
|
||||
return $error if defined $error;
|
||||
# Regularize it
|
||||
$self->_trim("date");
|
||||
# Check if it is filled
|
||||
return {"msg"=>N_("Please fill in the date.")}
|
||||
if $form->param("date") eq "";
|
||||
# Check the length
|
||||
return {"msg"=>N_("Please fill in a valid date in YYYY-MM-DD format.")}
|
||||
if length $form->param("date") != ${$self->{"maxlens"}}{"date"};
|
||||
# Check the date format
|
||||
return {"msg"=>N_("Please fill in a valid date in YYYY-MM-DD format.")}
|
||||
if length $form->param("date") !~ /^(\d{4})-(\d{2})-(\d{2})$/;
|
||||
return {"msg"=>N_("Please fill in a valid date in YYYY-MM-DD format.")}
|
||||
unless defined check_date($1, $2, $3);
|
||||
# OK
|
||||
return;
|
||||
}
|
||||
|
||||
# _check_cred_t: Check the plain text credits
|
||||
sub _check_cred_t : method {
|
||||
local ($_, %_);
|
||||
my ($self, $form, $error);
|
||||
$self = $_[0];
|
||||
$form = $self->{"form"};
|
||||
# Check if it exists
|
||||
$error = $self->_missing("cred_t");
|
||||
return $error if defined $error;
|
||||
# Regularize it
|
||||
$self->_trimtext("cred_t");
|
||||
# Check if it is filled
|
||||
return {"msg"=>N_("Please fill in the plain text credits information.")}
|
||||
if $form->param("cred_t") eq "";
|
||||
# Check the length
|
||||
return {"msg"=>N_("This plain text credits information is too long. (Max. length [#,_1])"),
|
||||
"margs"=>[${$self->{"maxlens"}}{"cred_t"}]}
|
||||
if length $form->param("cred_t") > ${$self->{"maxlens"}}{"cred_t"};
|
||||
# OK
|
||||
return;
|
||||
}
|
||||
|
||||
# _check_cred_h: Check the HTML credits
|
||||
sub _check_cred_h : method {
|
||||
local ($_, %_);
|
||||
my ($self, $form, $error);
|
||||
$self = $_[0];
|
||||
$form = $self->{"form"};
|
||||
# Check if it exists
|
||||
$error = $self->_missing("cred_h");
|
||||
return $error if defined $error;
|
||||
# Regularize it
|
||||
$self->_trimtext("cred_h");
|
||||
# Check if it is filled
|
||||
return {"msg"=>N_("Please fill in the HTML credits information.")}
|
||||
if $form->param("cred_h") eq "";
|
||||
# Check the length
|
||||
return {"msg"=>N_("This HTML credits information is too long. (Max. length [#,_1])"),
|
||||
"margs"=>[${$self->{"maxlens"}}{"cred_h"}]}
|
||||
if length $form->param("cred_h") > ${$self->{"maxlens"}}{"cred_h"};
|
||||
# OK
|
||||
return;
|
||||
}
|
||||
|
||||
return 1;
|
||||
93
htdocs/wov/magicat/lib/perl5/Selima/wov/Config.pm
Normal file
93
htdocs/wov/magicat/lib/perl5/Selima/wov/Config.pm
Normal file
@@ -0,0 +1,93 @@
|
||||
# Woman's Voice
|
||||
# Config.pm: The web site configuration.
|
||||
|
||||
# Copyright (c) 2003-2020 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Author: imacat <imacat@mail.imacat.idv.tw>
|
||||
# First written: 2003-04-06
|
||||
|
||||
package Selima::wov::Config;
|
||||
use 5.008;
|
||||
use utf8;
|
||||
use strict;
|
||||
use warnings;
|
||||
use base qw(Exporter);
|
||||
use vars qw(@EXPORT @EXPORT_OK);
|
||||
BEGIN {
|
||||
@EXPORT = qw(siteconf page_replacements);
|
||||
@EXPORT_OK = @EXPORT;
|
||||
# Prototype declaration
|
||||
sub siteconf();
|
||||
sub page_replacements();
|
||||
}
|
||||
|
||||
# Get into the public variable space and initialize them
|
||||
use lib $ENV{"DOCUMENT_ROOT"} . qw(/../../lib/perl5);
|
||||
use Selima::CopyYear;
|
||||
use Selima::DataVars qw(:all);
|
||||
use Selima::ShortCut;
|
||||
|
||||
use Selima::wov::DataVars qw(:all);
|
||||
|
||||
# siteconf: Subroutine to initialize site configuration
|
||||
sub siteconf() {
|
||||
local ($_, %_);
|
||||
|
||||
# The package name and the package title
|
||||
$PACKAGE = "wov";
|
||||
$SITENAME_ABBR = "WOV";
|
||||
# The author and the copyright
|
||||
$AUTHOR = "小招, 依瑪貓";
|
||||
$COPYRIGHT = "© <!--selima:copyyear--> 《女聲》電子報。《女聲》電子報保有所有權利。";
|
||||
# Document root, the library and the l10n directories
|
||||
$DOC_ROOT = $ENV{"DOCUMENT_ROOT"};
|
||||
$SITE_LIBDIR = $DOC_ROOT . "/magicat/lib/perl5";
|
||||
$LOCALEDIR = $DOC_ROOT . "/magicat/locale";
|
||||
|
||||
# Tables to lock when rebuilding pages
|
||||
@REBUILD_TABLES = qw(linkcat links linkcatz);
|
||||
# The local rebuild type labels
|
||||
%REBUILD_LABELS = (
|
||||
"newslets" => N_("Newsletter"),
|
||||
);
|
||||
|
||||
# The languages
|
||||
$DEFAULT_LANG = "zh-tw";
|
||||
@ALL_LINGUAS = qw(zh-tw);
|
||||
|
||||
# The site data variables
|
||||
$SCRIPTS{FORM_NEWSLETS()} = "/magicat/cgi-bin/newslets.cgi",
|
||||
$SCRIPTS{FORM_NLARTS()} = "/magicat/cgi-bin/nlarts.cgi",
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
# page_replacements: Dynamic page elements to be replaced,
|
||||
# but not part of the content. Used by xfupdate_template().
|
||||
sub page_replacements() {
|
||||
return {
|
||||
"copyyear" => {
|
||||
"pattern" => "1999(?:-\\d{4})?",
|
||||
"content" => copyyear(1999),
|
||||
},
|
||||
"generator" => {
|
||||
"pattern" => "Selima \\d+\\.\\d+",
|
||||
"content" => "Selima $Selima::VERSION",
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
no utf8;
|
||||
return 1;
|
||||
58
htdocs/wov/magicat/lib/perl5/Selima/wov/DataVars.pm
Normal file
58
htdocs/wov/magicat/lib/perl5/Selima/wov/DataVars.pm
Normal file
@@ -0,0 +1,58 @@
|
||||
# Woman's Voice
|
||||
# DataVars.pm: The site-wide constants and variables.
|
||||
|
||||
# Copyright (c) 2004-2018 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Author: imacat <imacat@mail.imacat.idv.tw>
|
||||
# First written: 2004-11-25
|
||||
|
||||
package Selima::wov::DataVars;
|
||||
use 5.008;
|
||||
use strict;
|
||||
use warnings;
|
||||
use base qw(Exporter);
|
||||
use vars qw(@EXPORT %EXPORT_TAGS @EXPORT_OK);
|
||||
BEGIN {
|
||||
@EXPORT = qw();
|
||||
%EXPORT_TAGS = (
|
||||
forms => [qw(FORM_NEWSLETS FORM_NLARTS)],
|
||||
);
|
||||
@EXPORT_OK = qw();
|
||||
my %seen;
|
||||
%seen = qw();
|
||||
foreach my $tag (keys %EXPORT_TAGS) {
|
||||
push @EXPORT_OK, grep !$seen{$_}++, @{$EXPORT_TAGS{$tag}};
|
||||
}
|
||||
$EXPORT_TAGS{"all"} = [@EXPORT_OK];
|
||||
# Prototype declaration
|
||||
sub clear();
|
||||
}
|
||||
|
||||
use Selima::DataVars qw(:forms);
|
||||
|
||||
use constant FORM_NEWSLETS => 1001;
|
||||
use constant FORM_NLARTS => 1002;
|
||||
|
||||
# clear: Clear the data variables
|
||||
sub clear() {
|
||||
local ($_, %_);
|
||||
|
||||
delete $SCRIPTS{FORM_NEWSLETS()};
|
||||
delete $SCRIPTS{FORM_NLARTS()};
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
return 1;
|
||||
40
htdocs/wov/magicat/lib/perl5/Selima/wov/Form/Guestbook.pm
Normal file
40
htdocs/wov/magicat/lib/perl5/Selima/wov/Form/Guestbook.pm
Normal file
@@ -0,0 +1,40 @@
|
||||
# Woman's Voice
|
||||
# Guestbook.pm: The administrative guestbook form.
|
||||
|
||||
# Copyright (c) 2004-2018 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Author: imacat <imacat@mail.imacat.idv.tw>
|
||||
# First written: 2004-10-24
|
||||
|
||||
package Selima::wov::Form::Guestbook;
|
||||
use 5.008;
|
||||
use strict;
|
||||
use warnings;
|
||||
use base qw(Selima::Form::Guestbook);
|
||||
|
||||
use Selima::MarkAbbr;
|
||||
use Selima::ShortCut;
|
||||
|
||||
# _html_col_identity: The identity
|
||||
sub _html_col_identity : method {
|
||||
$_[0]->_html_coltmpl_text("identity", h_abbr(__("What kind of women you are?")));
|
||||
}
|
||||
|
||||
# _html_col_url: The website URL
|
||||
sub _html_col_url : method {
|
||||
$_[0]->_html_coltmpl_url("url", h_abbr(__("Website URL.:")));
|
||||
}
|
||||
|
||||
return 1;
|
||||
@@ -0,0 +1,66 @@
|
||||
# Woman's Voice
|
||||
# Public.pm: The guestbook form.
|
||||
|
||||
# Copyright (c) 2004-2018 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Author: imacat <imacat@mail.imacat.idv.tw>
|
||||
# First written: 2004-10-24
|
||||
|
||||
package Selima::wov::Form::Guestbook::Public;
|
||||
use 5.008;
|
||||
use utf8;
|
||||
use strict;
|
||||
use warnings;
|
||||
use base qw(Selima::Form::Guestbook::Public);
|
||||
|
||||
use Selima::HTTP;
|
||||
use Selima::MarkAbbr;
|
||||
use Selima::ShortCut;
|
||||
|
||||
# new: Initialize the HTML form table displayer
|
||||
sub new : method {
|
||||
local ($_, %_);
|
||||
my ($class, $status, $args, $self);
|
||||
($class, $status, $args) = @_;
|
||||
$args = {} if !defined $args;
|
||||
|
||||
# $args must be a hash reference
|
||||
http_500 "type of argument 2 must be a hash reference"
|
||||
if ref($args) ne "HASH";
|
||||
$$args{"prefmsg"} = [] if !exists $$args{"prefmsg"};
|
||||
push @{$$args{"prefmsg"}}, __("General commercial advertisements, articles unrelated to gender/sex or articles involving personal attacks are not welcomed. They may be deleted without notice. HTML is not supported.");
|
||||
$self = $class->SUPER::new($status, $args);
|
||||
return $self;
|
||||
}
|
||||
|
||||
# _html_col_identity: The identity
|
||||
sub _html_col_identity : method {
|
||||
$_[0]->_html_coltmpl_text("identity", h_abbr(__("What kind of women you are?")),
|
||||
h_abbr("(女工、女學生、粉領上班族、公私娼酒吧舞女、打工辣妹……)"));
|
||||
}
|
||||
|
||||
# _html_col_message: The message
|
||||
sub _html_col_message : method {
|
||||
$_[0]->_html_coltmpl_textarea("message", h_abbr(__("Message:")),
|
||||
h_abbr(__("Fill in your message here.")));
|
||||
}
|
||||
|
||||
# _html_col_url: The website URL
|
||||
sub _html_col_url : method {
|
||||
$_[0]->_html_coltmpl_url("url", h_abbr(__("Website URL.:")));
|
||||
}
|
||||
|
||||
no utf8;
|
||||
return 1;
|
||||
58
htdocs/wov/magicat/lib/perl5/Selima/wov/Form/LinkCat.pm
Normal file
58
htdocs/wov/magicat/lib/perl5/Selima/wov/Form/LinkCat.pm
Normal file
@@ -0,0 +1,58 @@
|
||||
# Woman's Voice
|
||||
# LinkCat.pm: The related-link category form.
|
||||
|
||||
# Copyright (c) 2006-2018 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Author: imacat <imacat@mail.imacat.idv.tw>
|
||||
# First written: 2006-04-05
|
||||
|
||||
package Selima::wov::Form::LinkCat;
|
||||
use 5.008;
|
||||
use strict;
|
||||
use warnings;
|
||||
use base qw(Selima::Form::LinkCat);
|
||||
|
||||
use Selima::FormFunc;
|
||||
use Selima::HTTP;
|
||||
|
||||
# new: Initialize the HTML form table displayer
|
||||
sub new : method {
|
||||
local ($_, %_);
|
||||
my ($class, $status, $args, $self);
|
||||
($class, $status, $args) = @_;
|
||||
$args = {} if !defined $args;
|
||||
|
||||
# $args must be a hash reference
|
||||
http_500 "type of argument 2 must be a hash reference"
|
||||
if ref($args) ne "HASH";
|
||||
$$args{"type"} = form_type
|
||||
if !exists $$args{"type"};
|
||||
if (!exists $$args{"cols"}) {
|
||||
# A form to create a new item
|
||||
if ($$args{"type"} eq "new") {
|
||||
$$args{"cols"} = [qw(parent id ord title title_en kw hid)];
|
||||
# A form to edit a current item
|
||||
# A form to delete a current item
|
||||
} elsif ($$args{"type"} eq "cur" || $$args{"type"} eq "del") {
|
||||
$$args{"cols"} = [qw(sn parent id ord title title_en kw hid
|
||||
scats links
|
||||
created createdby updated updatedby)];
|
||||
}
|
||||
}
|
||||
$self = $class->SUPER::new($status, $args);
|
||||
return $self;
|
||||
}
|
||||
|
||||
return 1;
|
||||
130
htdocs/wov/magicat/lib/perl5/Selima/wov/Form/NLArt.pm
Normal file
130
htdocs/wov/magicat/lib/perl5/Selima/wov/Form/NLArt.pm
Normal file
@@ -0,0 +1,130 @@
|
||||
# Woman's Voice
|
||||
# NLArt.pm: The newsletter article form.
|
||||
|
||||
# Copyright (c) 2004-2018 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Author: imacat <imacat@mail.imacat.idv.tw>
|
||||
# First written: 2004-11-24
|
||||
|
||||
package Selima::wov::Form::NLArt;
|
||||
use 5.008;
|
||||
use strict;
|
||||
use warnings;
|
||||
use base qw(Selima::Form);
|
||||
|
||||
use Selima::ChkFunc;
|
||||
use Selima::CommText;
|
||||
use Selima::FormFunc;
|
||||
use Selima::HTTP;
|
||||
use Selima::MarkAbbr;
|
||||
use Selima::ShortCut;
|
||||
use Selima::Unicode;
|
||||
|
||||
use Selima::wov::Items;
|
||||
|
||||
# new: Initialize the HTML form table displayer
|
||||
sub new : method {
|
||||
local ($_, %_);
|
||||
my ($class, $status, $args, $self);
|
||||
($class, $status, $args) = @_;
|
||||
$args = {} if !defined $args;
|
||||
|
||||
# $args must be a hash reference
|
||||
http_500 "type of argument 2 must be a hash reference"
|
||||
if ref($args) ne "HASH";
|
||||
$$args{"type"} = form_type
|
||||
if !exists $$args{"type"};
|
||||
$$args{"table"} = "nlarts"
|
||||
if !exists $$args{"table"};
|
||||
$$args{"deltext"} = __("Delete this article")
|
||||
if !exists $$args{"deltext"};
|
||||
if (!exists $$args{"summary"}) {
|
||||
# A form to create a new item
|
||||
if ($$args{"type"} eq "new") {
|
||||
$$args{"summary"} = __("This table provides you a form to write a new article.");
|
||||
# A form to edit a current item
|
||||
} elsif ($$args{"type"} eq "cur") {
|
||||
$$args{"summary"} = __("This table provides you a form to edit a current article.");
|
||||
# A form to delete a current item
|
||||
} elsif ($$args{"type"} eq "del") {
|
||||
$$args{"summary"} = __("This table provides you a form to delete a article.");
|
||||
}
|
||||
}
|
||||
if (!exists $$args{"cols"}) {
|
||||
# A form to create a new item
|
||||
if ($$args{"type"} eq "new") {
|
||||
$$args{"cols"} = [qw(newslet ord title author body_t body_h hid)];
|
||||
# A form to edit a current item
|
||||
# A form to delete a current item
|
||||
} elsif ($$args{"type"} eq "cur" || $$args{"type"} eq "del") {
|
||||
$$args{"cols"} = [qw(sn newslet ord title author body_t body_h hid
|
||||
created createdby updated updatedby)];
|
||||
}
|
||||
}
|
||||
if (!exists $$args{"title"}) {
|
||||
# A form to create a new item
|
||||
if ($$args{"type"} eq "new") {
|
||||
$$args{"title"} = __("Write a New Newsletter Article");
|
||||
# A form to edit a current item
|
||||
} elsif ($$args{"type"} eq "cur") {
|
||||
$$args{"title"} = __("Edit a Current Newsletter Article");
|
||||
# A form to delete a current item
|
||||
} elsif ($$args{"type"} eq "del") {
|
||||
$$args{"title"} = __("Delete a Newsletter Article");
|
||||
}
|
||||
}
|
||||
$self = $class->SUPER::new($status, $args);
|
||||
${$self->{"maxlens"}}{"ord"} = 2;
|
||||
return $self;
|
||||
}
|
||||
|
||||
# _html_col_body_t: The plain text body
|
||||
sub _html_col_body_t : method {
|
||||
$_[0]->_html_coltmpl_textarea("body_t", h_abbr(__("Content (text):")),
|
||||
h(__("Fill in the plain text content here.")));
|
||||
}
|
||||
|
||||
# _html_col_body_h: The HTML body
|
||||
sub _html_col_body_h : method {
|
||||
$_[0]->_html_coltmpl_textarea("body_h", h_abbr(__("Content (HTML):")),
|
||||
h(__("Fill in the HTML content here.")));
|
||||
}
|
||||
|
||||
# _html_col_hid: Hide?
|
||||
sub _html_col_hid : method {
|
||||
$_[0]->_html_coltmpl_bool("hid", h_abbr(__("Hide?")),
|
||||
h_abbr(__("Hide this article")), h_abbr(__("Show this article")),
|
||||
h_abbr(__("Hide this article currently.")));
|
||||
}
|
||||
|
||||
# _html_col_newslet: The newsletter
|
||||
sub _html_col_newslet : method {
|
||||
$_[0]->_html_coltmpl_call("newslet", h_abbr(__("Newsletter:")), \&newslet_title);
|
||||
}
|
||||
|
||||
# _html_col_ord: The order
|
||||
sub _html_col_ord : method {
|
||||
local ($_, %_);
|
||||
my ($self, $form);
|
||||
$self = $_[0];
|
||||
$form = $self->{"form"};
|
||||
# Set the default order to the half of the maximum
|
||||
$form->param("ord", 99)
|
||||
if $self->{"is_first_form"} && $self->{"type"} eq "new";
|
||||
$self->_html_coltmpl_text("ord", h_abbr(__("Order:")), undef,
|
||||
${$self->{"maxlens"}}{"ord"});
|
||||
}
|
||||
|
||||
return 1;
|
||||
408
htdocs/wov/magicat/lib/perl5/Selima/wov/Form/Newslet.pm
Normal file
408
htdocs/wov/magicat/lib/perl5/Selima/wov/Form/Newslet.pm
Normal file
@@ -0,0 +1,408 @@
|
||||
# Woman's Voice
|
||||
# Newslet.pm: The newsletter form.
|
||||
|
||||
# Copyright (c) 2004-2018 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Author: imacat <imacat@mail.imacat.idv.tw>
|
||||
# First written: 2004-11-17
|
||||
|
||||
package Selima::wov::Form::Newslet;
|
||||
use 5.008;
|
||||
use strict;
|
||||
use warnings;
|
||||
use base qw(Selima::Form);
|
||||
|
||||
use Selima::A2HTML;
|
||||
use Selima::ChkFunc;
|
||||
use Selima::CommText;
|
||||
use Selima::FormFunc;
|
||||
use Selima::HTTP;
|
||||
use Selima::MarkAbbr;
|
||||
use Selima::ShortCut;
|
||||
|
||||
use Selima::wov::Items;
|
||||
|
||||
# new: Initialize the HTML form table displayer
|
||||
sub new : method {
|
||||
local ($_, %_);
|
||||
my ($class, $status, $args, $self);
|
||||
($class, $status, $args) = @_;
|
||||
$args = {} if !defined $args;
|
||||
|
||||
# $args must be a hash reference
|
||||
http_500 "type of argument 2 must be a hash reference"
|
||||
if ref($args) ne "HASH";
|
||||
$$args{"type"} = form_type
|
||||
if !exists $$args{"type"};
|
||||
$$args{"table"} = "newslets"
|
||||
if !exists $$args{"table"};
|
||||
$$args{"deltext"} = __("Delete this newsletter")
|
||||
if !exists $$args{"deltext"};
|
||||
if (!exists $$args{"summary"}) {
|
||||
# A form to create a new item
|
||||
if ($$args{"type"} eq "new") {
|
||||
$$args{"summary"} = __("This table provides you a form to add a new newsletter.");
|
||||
# A form to edit a current item
|
||||
} elsif ($$args{"type"} eq "cur") {
|
||||
$$args{"summary"} = __("This table provides you a form to edit a current newsletter.");
|
||||
# A form to delete a current item
|
||||
} elsif ($$args{"type"} eq "del") {
|
||||
$$args{"summary"} = __("This table provides you a form to delete a newsletter.");
|
||||
}
|
||||
}
|
||||
$$args{"colspan"} = 3
|
||||
if !exists $$args{"colspan"};
|
||||
if (!exists $$args{"cols"}) {
|
||||
# A form to create a new item
|
||||
if ($$args{"type"} eq "new") {
|
||||
$$args{"cols"} = [qw(no date title cred_t cred_h kw arts hid)];
|
||||
# A form to edit a current item
|
||||
# A form to delete a current item
|
||||
} elsif ($$args{"type"} eq "cur" || $$args{"type"} eq "del") {
|
||||
$$args{"cols"} = [qw(sn no date title cred_t cred_h kw arts hid
|
||||
created createdby updated updatedby)];
|
||||
}
|
||||
}
|
||||
if (!exists $$args{"title"}) {
|
||||
# A form to create a new item
|
||||
if ($$args{"type"} eq "new") {
|
||||
$$args{"title"} = __("Add a New Newsletter");
|
||||
# A form to edit a current item
|
||||
} elsif ($$args{"type"} eq "cur") {
|
||||
$$args{"title"} = __("Edit a Current Newsletter");
|
||||
# A form to delete a current item
|
||||
} elsif ($$args{"type"} eq "del") {
|
||||
$$args{"title"} = __("Delete a Newsletter");
|
||||
}
|
||||
}
|
||||
if (!exists $$args{"preview"}) {
|
||||
$$args{"preview"} = 1;
|
||||
}
|
||||
if ($$args{"preview"} && !exists $$args{"prevmsg"}) {
|
||||
$$args{"prevmsg"} = __("Preview this newsletter.");
|
||||
}
|
||||
$self = $class->SUPER::new($status, $args);
|
||||
return $self;
|
||||
}
|
||||
|
||||
# _html_col_arts: The articles
|
||||
sub _html_col_arts : method {
|
||||
local ($_, %_);
|
||||
my ($self, $form, $current, $label, $orig, $new, $mark, $colspan, $cols, $rows);
|
||||
my ($col, $val, $no, $rowspan, $rows_cur, $rows_new, $count_new);
|
||||
my ($labeltitle, $labelauthor, $labelbody_t, $labelbody_h, $labelhid);
|
||||
my ($marktitle, $markauthor, $markbody_t, $markbody_h, $markhid);
|
||||
my ($hbody_tdef, $hbody_hdef, $texthid, $true, $false);
|
||||
$self = $_[0];
|
||||
$form = $self->{"form"};
|
||||
$current = $self->{"cur"};
|
||||
$mark = $self->_mark("arts");
|
||||
$colspan = $self->_colspan(-2);
|
||||
$cols = h($self->{"defsize"});
|
||||
$rows = h(10);
|
||||
$labeltitle = h_abbr(__("Title:"));
|
||||
$labelauthor = h_abbr(__("Author:"));
|
||||
$labelbody_t = h_abbr(__("Content (text):"));
|
||||
$labelbody_h = h_abbr(__("Content (HTML):"));
|
||||
$labelhid = h_abbr(__("Hide?"));
|
||||
$hbody_tdef = h(__("Fill in the plain text content here."));
|
||||
$hbody_hdef = h(__("Fill in the HTML content here."));
|
||||
$texthid = h(__("Hide this article currently."));
|
||||
$marktitle = $self->_mark("arttitle");
|
||||
$markauthor = $self->_mark("artauthor");
|
||||
$markbody_t = $self->_mark("artbody_t");
|
||||
$markbody_h = $self->_mark("artbody_h");
|
||||
$markhid = $self->_mark("arthid");
|
||||
$true = h(__("Hide this article"));
|
||||
$false = h(__("Show this article"));
|
||||
|
||||
# A form to create a new item
|
||||
if ($self->{"type"} eq "new") {
|
||||
# Find the last filled article
|
||||
for ($_ = 0; defined $form->param("art$_" . "title"); $_++) {}
|
||||
for ($_--; $_ >= 0
|
||||
&& $form->param("art$_" . "title") eq ""
|
||||
&& $form->param("art$_" . "author") eq ""
|
||||
&& $form->param("art$_" . "body_t") eq ""
|
||||
&& $form->param("art$_" . "body_h") eq ""; $_--) {}
|
||||
$count_new = $_ + 1 + 3;
|
||||
$rows_new = $count_new * 5;
|
||||
$rows_new = $rows_new > 1? " rowspan=\"" . h($rows_new) . "\"": "";
|
||||
$label = h_abbr(__("[numerate,_1,Article]:", 0));
|
||||
print << "EOT";
|
||||
<tr>
|
||||
<th class="th"$rows_new scope="row"><label for="art0title">$mark$label</label></th>
|
||||
EOT
|
||||
for ($_ = 0, @_ = qw(); $_ < $count_new; $_++) {
|
||||
my ($coltitle, $colauthor, $colbody_t, $colbody_h, $colhid);
|
||||
my ($valtitle, $valauthor, $valbody_t, $valbody_h, $valhid);
|
||||
$col = "art$_";
|
||||
$val = $self->_val_check($col);
|
||||
$valtitle = $self->_val_text($col . "title");
|
||||
$coltitle = h($col . "title");
|
||||
$valauthor = $self->_val_text($col . "author");
|
||||
$colauthor = h($col . "author");
|
||||
$valbody_t = $self->_val_textarea($col . "body_t", $hbody_tdef);
|
||||
$colbody_t = h($col . "body_t");
|
||||
$valbody_h = $self->_val_textarea($col . "body_h", $hbody_hdef);
|
||||
$colbody_h = h($col . "body_h");
|
||||
$valhid = $self->_val_check($col . "hid");
|
||||
$colhid = h($col . "hid");
|
||||
$col = h($col);
|
||||
push @_, << "EOT";
|
||||
<td rowspan="5"><input id="$col" type="checkbox" name="$col"$val /></td>
|
||||
<th class="th" scope="row"><label for="$coltitle">$marktitle$labeltitle</label></th>
|
||||
<td$colspan><input id="$coltitle" class="text" type="text" name="$coltitle"$valtitle /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="th" scope="row"><label for="$colauthor">$markauthor$labelauthor</label></th>
|
||||
<td$colspan><input id="$colauthor" class="text" type="text" name="$colauthor"$valauthor /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="th" scope="row"><label for="$colbody_t">$markbody_t$labelbody_t</label></th>
|
||||
<td$colspan><textarea id="$colbody_t" name="$colbody_t" cols="$cols" rows="$rows"
|
||||
onfocus="if (this.value == "$hbody_tdef") this.value = "";">$valbody_t</textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="th" scope="row"><label for="$colbody_h">$markbody_h$labelbody_h</label></th>
|
||||
<td$colspan><textarea id="$colbody_h" name="$colbody_h" cols="$cols" rows="$rows"
|
||||
onfocus="if (this.value == "$hbody_hdef") this.value = "";">$valbody_h</textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="th" scope="row"><label for="$colhid">$markhid$labelhid</label></th>
|
||||
<td$colspan><input id="$colhid" type="checkbox" name="$colhid"$valhid />
|
||||
<label for="$colhid">$texthid</label></td>
|
||||
EOT
|
||||
}
|
||||
print join("</tr>\n<tr>\n", @_);
|
||||
print << "EOT";
|
||||
</tr>
|
||||
EOT
|
||||
|
||||
# A form to edit a current item
|
||||
} elsif ($self->{"type"} eq "cur") {
|
||||
# Find the last filled article
|
||||
$rows_cur = $current->param("artcount") > 0?
|
||||
$current->param("artcount") * 5: 1;
|
||||
for ($_ = 0; defined $form->param("art$_" . "title"); $_++) {}
|
||||
for ($_-- ; $_ >= 0
|
||||
&& $form->param("art$_" . "title") eq ""
|
||||
&& $form->param("art$_" . "author") eq ""
|
||||
&& $form->param("art$_" . "body_t") eq ""
|
||||
&& $form->param("art$_" . "body_h") eq ""; $_--) {}
|
||||
$count_new = $_ + 1 + 3;
|
||||
$rows_new = $count_new * 5;
|
||||
$rowspan = $rows_cur + $rows_new;
|
||||
$rows_cur = $rows_cur > 1? " rowspan=\"" . h($rows_cur) . "\"": "";
|
||||
$rows_new = $rows_new > 1? " rowspan=\"" . h($rows_new) . "\"": "";
|
||||
$rowspan = $rowspan > 1? " rowspan=\"" . h($rowspan) . "\"": "";
|
||||
$label = h_abbr(__("[numerate,_1,Article]:", 0));
|
||||
$orig = h_abbr(__("Original:"));
|
||||
$new = h_abbr(__("New:"));
|
||||
print << "EOT";
|
||||
<tr>
|
||||
<th class="th"$rowspan scope="row"><label for="art0title">$mark$label</label></th>
|
||||
<th class="oldnew"$rows_cur scope="row">$orig</th>
|
||||
EOT
|
||||
for ($_ = 0, @_ = qw(); $_ < $current->param("artcount"); $_++) {
|
||||
my ($curtitle, $curauthor, $curbody_t, $curbody_h, $curhid);
|
||||
$no = h($_ + 1);
|
||||
$col = "art$_";
|
||||
$curtitle = h_abbr($current->param($col . "title"));
|
||||
$curauthor = h_abbr($current->param($col . "author"));
|
||||
$curbody_t = a2html($current->param($col . "body_t"));
|
||||
$curbody_h = a2html($current->param($col . "body_h"));
|
||||
$curhid = $self->{"cur"}->param($col . "hid")? $true: $false;
|
||||
push @_, << "EOT";
|
||||
<td rowspan="5" scope="row">$no</td>
|
||||
<th class="th" scope="row">$marktitle$labeltitle</th>
|
||||
<td$colspan>$curtitle</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="th" scope="row">$markauthor$labelauthor</th>
|
||||
<td$colspan>$curauthor</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="th" scope="row">$markbody_t$labelbody_t</th>
|
||||
<td$colspan>$curbody_t</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="th" scope="row">$markbody_h$labelbody_h</th>
|
||||
<td$colspan>$curbody_h</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="th" scope="row">$markhid$labelhid</th>
|
||||
<td$colspan>$curhid</td>
|
||||
EOT
|
||||
}
|
||||
print @_ > 0? join("</tr>\n<tr>\n", @_):
|
||||
" <td" . $self->_colspan . ">" . h_abbr(t_none) . "</td>\n";
|
||||
print << "EOT";
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="oldnew"$rows_new scope="row"><label for="art0title">$new</label></th>
|
||||
EOT
|
||||
for ($_ = 0, @_ = qw(); $_ < $count_new; $_++) {
|
||||
my ($coltitle, $colauthor, $colbody_t, $colbody_h, $colhid);
|
||||
my ($valtitle, $valauthor, $valbody_t, $valbody_h, $valhid);
|
||||
$col = "art$_";
|
||||
$val = $self->_val_check($col);
|
||||
$valtitle = $self->_val_text($col . "title");
|
||||
$coltitle = h($col . "title");
|
||||
$valauthor = $self->_val_text($col . "author");
|
||||
$colauthor = h($col . "author");
|
||||
$valbody_t = $self->_val_textarea($col . "body_t", $hbody_tdef);
|
||||
$colbody_t = h($col . "body_t");
|
||||
$valbody_h = $self->_val_textarea($col . "body_h", $hbody_hdef);
|
||||
$colbody_h = h($col . "body_h");
|
||||
$valhid = $self->_val_check($col . "hid");
|
||||
$colhid = h($col . "hid");
|
||||
$col = h($col);
|
||||
push @_, << "EOT";
|
||||
<td rowspan="5"><input id="$col" type="checkbox" name="$col"$val /></td>
|
||||
<th class="th" scope="row"><label for="$coltitle">$marktitle$labeltitle</label></th>
|
||||
<td$colspan><input id="$coltitle" class="text" type="text" name="$coltitle"$valtitle /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="th" scope="row"><label for="$colauthor">$markauthor$labelauthor</label></th>
|
||||
<td$colspan><input id="$colauthor" class="text" type="text" name="$colauthor"$valauthor /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="th" scope="row"><label for="$colbody_t">$markbody_t$labelbody_t</label></th>
|
||||
<td$colspan><textarea id="$colbody_t" name="$colbody_t" cols="$cols" rows="$rows"
|
||||
onfocus="if (this.value == "$hbody_tdef") this.value = "";">$valbody_t</textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="th" scope="row"><label for="$colbody_h">$markbody_h$labelbody_h</label></th>
|
||||
<td$colspan><textarea id="$colbody_h" name="$colbody_h" cols="$cols" rows="$rows"
|
||||
onfocus="if (this.value == "$hbody_hdef") this.value = "";">$valbody_h</textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="th" scope="row"><label for="$colhid">$markhid$labelhid</label></th>
|
||||
<td$colspan><input id="$colhid" type="checkbox" name="$colhid"$valhid />
|
||||
<label for="$colhid">$texthid</label></td>
|
||||
EOT
|
||||
}
|
||||
print join("</tr>\n<tr>\n", @_);
|
||||
print << "EOT";
|
||||
</tr>
|
||||
EOT
|
||||
|
||||
# A form to delete a current item
|
||||
} else {
|
||||
# Find the last filled article
|
||||
$rows_cur = $current->param("artcount") > 0?
|
||||
$current->param("artcount") * 5: 1;
|
||||
$rows_cur = $rows_cur > 1? " rowspan=\"" . h($rows_cur) . "\"": "";
|
||||
$label = h_abbr(__("[numerate,_1,Article]:", $current->param("artcount")));
|
||||
print << "EOT";
|
||||
<tr>
|
||||
<th class="th"$rows_cur scope="row">$mark$label</th>
|
||||
EOT
|
||||
for ($_ = 0, @_ = qw(); $_ < $current->param("artcount"); $_++) {
|
||||
my ($curtitle, $curauthor, $curbody_t, $curbody_h, $curhid);
|
||||
$no = h($_ + 1);
|
||||
$col = "art$_";
|
||||
$curtitle = h_abbr($current->param($col . "title"));
|
||||
$curauthor = h_abbr($current->param($col . "author"));
|
||||
$curbody_t = a2html($current->param($col . "body_t"));
|
||||
$curbody_h = a2html($current->param($col . "body_h"));
|
||||
$curhid = $self->{"cur"}->param($col . "hid")? $true: $false;
|
||||
push @_, << "EOT";
|
||||
<td rowspan="5">$no</td>
|
||||
<th class="th" scope="row">$marktitle$labeltitle</th>
|
||||
<td$colspan>$curtitle</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="th" scope="row">$markauthor$labelauthor</th>
|
||||
<td$colspan>$curauthor</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="th" scope="row">$markbody_t$labelbody_t</th>
|
||||
<td$colspan>$curbody_t</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="th" scope="row">$markbody_h$labelbody_h</th>
|
||||
<td$colspan>$curbody_h</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="th" scope="row">$markhid$labelhid</th>
|
||||
<td$colspan>$curhid</td>
|
||||
EOT
|
||||
}
|
||||
print @_ > 0? join("</tr>\n<tr>\n", @_):
|
||||
" <td" . $self->_colspan . ">" . h_abbr(t_none) . "</td>\n";
|
||||
print << "EOT";
|
||||
</tr>
|
||||
EOT
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
# _html_col_cred_t: The credits, in plain text
|
||||
sub _html_col_cred_t : method {
|
||||
$_[0]->_html_coltmpl_textarea("cred_t", h_abbr(__("Credits (text):")),
|
||||
h(__("Fill in the credits in plain text here.")));
|
||||
}
|
||||
|
||||
# _html_col_cred_h: The credits, in HTML
|
||||
sub _html_col_cred_h : method {
|
||||
$_[0]->_html_coltmpl_textarea("cred_h", h_abbr(__("Credits (HTML):")),
|
||||
h(__("Fill in the credits in HTML here.")));
|
||||
}
|
||||
|
||||
# _html_col_hid: Hide?
|
||||
sub _html_col_hid : method {
|
||||
$_[0]->_html_coltmpl_bool("hid", h_abbr(__("Hide?")),
|
||||
h_abbr(__("Hide this newsletter")), h_abbr(__("Show this newsletter")),
|
||||
h_abbr(__("Hide this newsletter currently.")));
|
||||
}
|
||||
|
||||
# _html_col_no: The issue number
|
||||
sub _html_col_no : method {
|
||||
local ($_, %_);
|
||||
my ($self, $label, $cur, $mark, $colspan, $thclass, $thcolspan);
|
||||
$self = $_[0];
|
||||
$label = h_abbr(__("Issue:"));
|
||||
$mark = $self->_mark("no");
|
||||
$colspan = $self->_colspan;
|
||||
|
||||
# A form to create a new item
|
||||
if ($self->{"type"} eq "new") {
|
||||
$cur = h_abbr(newslet_textno new_nl_no);
|
||||
print << "EOT"
|
||||
<tr>
|
||||
<th class="th" scope="row">$mark$label</th>
|
||||
<td$colspan>$cur</td>
|
||||
</tr>
|
||||
EOT
|
||||
|
||||
# A current or delete form
|
||||
} else {
|
||||
# A current form span for 2 columns
|
||||
$thclass = $self->{"type"} ne "cur"? " class=\"th\"": "";
|
||||
$thcolspan = $self->{"type"} eq "cur"? " colspan=\"2\"": "";
|
||||
$cur = h_abbr(newslet_textno scalar $self->{"cur"}->param("no"));
|
||||
print << "EOT";
|
||||
<tr>
|
||||
<th$thclass$thcolspan scope="row">$mark$label</th>
|
||||
<td$colspan>$cur</td>
|
||||
</tr>
|
||||
EOT
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
return 1;
|
||||
57
htdocs/wov/magicat/lib/perl5/Selima/wov/Form/Page.pm
Normal file
57
htdocs/wov/magicat/lib/perl5/Selima/wov/Form/Page.pm
Normal file
@@ -0,0 +1,57 @@
|
||||
# Woman's Voice
|
||||
# Page.pm: The web page form.
|
||||
|
||||
# Copyright (c) 2006-2018 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Author: imacat <imacat@mail.imacat.idv.tw>
|
||||
# First written: 2006-04-05
|
||||
|
||||
package Selima::wov::Form::Page;
|
||||
use 5.008;
|
||||
use strict;
|
||||
use warnings;
|
||||
use base qw(Selima::Form::Page);
|
||||
|
||||
use Selima::FormFunc;
|
||||
use Selima::HTTP;
|
||||
|
||||
# new: Initialize the HTML form table displayer
|
||||
sub new : method {
|
||||
local ($_, %_);
|
||||
my ($class, $status, $args, $self);
|
||||
($class, $status, $args) = @_;
|
||||
$args = {} if !defined $args;
|
||||
|
||||
# $args must be a hash reference
|
||||
http_500 "type of argument 2 must be a hash reference"
|
||||
if ref($args) ne "HASH";
|
||||
$$args{"type"} = form_type
|
||||
if !exists $$args{"type"};
|
||||
if (!exists $$args{"cols"}) {
|
||||
# A form to create a new item
|
||||
if ($$args{"type"} eq "new") {
|
||||
$$args{"cols"} = [qw(path ord title title_en body kw html hid)];
|
||||
# A form to edit a current item
|
||||
# A form to delete a current item
|
||||
} elsif ($$args{"type"} eq "cur" || $$args{"type"} eq "del") {
|
||||
$$args{"cols"} = [qw(sn path ord title title_en body kw html hid
|
||||
created createdby updated updatedby)];
|
||||
}
|
||||
}
|
||||
$self = $class->SUPER::new($status, $args);
|
||||
return $self;
|
||||
}
|
||||
|
||||
return 1;
|
||||
1152
htdocs/wov/magicat/lib/perl5/Selima/wov/HTML.pm
Normal file
1152
htdocs/wov/magicat/lib/perl5/Selima/wov/HTML.pm
Normal file
File diff suppressed because it is too large
Load Diff
130
htdocs/wov/magicat/lib/perl5/Selima/wov/Items.pm
Normal file
130
htdocs/wov/magicat/lib/perl5/Selima/wov/Items.pm
Normal file
@@ -0,0 +1,130 @@
|
||||
# Woman's Voice
|
||||
# Items.pm: The data record related subroutines.
|
||||
|
||||
# Copyright (c) 2004-2018 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Author: imacat <imacat@mail.imacat.idv.tw>
|
||||
# First written: 2004-11-23
|
||||
|
||||
package Selima::wov::Items;
|
||||
use 5.008;
|
||||
use utf8;
|
||||
use strict;
|
||||
use warnings;
|
||||
use base qw(Exporter);
|
||||
use vars qw(@EXPORT @EXPORT_OK);
|
||||
BEGIN {
|
||||
@EXPORT = qw();
|
||||
push @EXPORT, qw(new_nl_no newslet_textno newslet_title newslet_no);
|
||||
@EXPORT_OK = @EXPORT;
|
||||
# Prototype declaration
|
||||
sub new_nl_no();
|
||||
sub newslet_textno($);
|
||||
sub newslet_title($);
|
||||
sub newslet_no($);
|
||||
}
|
||||
|
||||
use Encode qw(encode);
|
||||
|
||||
use Selima::ChkFunc;
|
||||
use Selima::CommText;
|
||||
use Selima::DataVars qw(:db);
|
||||
|
||||
# new_nl_no: Get the issue number for a new newsletter
|
||||
sub new_nl_no() {
|
||||
local ($_, %_);
|
||||
my ($sql, $sth);
|
||||
$sql = "SELECT no FROM newslets"
|
||||
. " ORDER BY no DESC LIMIT 1;\n";
|
||||
$sth = $DBH->prepare($sql);
|
||||
$sth->execute;
|
||||
return 1 if $sth->rows < 1;
|
||||
return ${$sth->fetch}[0] + 1;
|
||||
}
|
||||
|
||||
# newslet_textno: Obtain the text representation of the issue number
|
||||
sub newslet_textno($) {
|
||||
local ($_, %_);
|
||||
$_ = $_[0];
|
||||
# Invalid - returned "as is"
|
||||
return $_ if !defined $_ || /\D/ || $_ < 0;
|
||||
# First issue
|
||||
return "創刊號" if $_ == 1;
|
||||
return sprintf "第%03d期", $_;
|
||||
}
|
||||
|
||||
# newslet_title: Obtain a newsletter title
|
||||
sub newslet_title($) {
|
||||
local ($_, %_);
|
||||
my ($sn, $sql, $sth);
|
||||
$sn = $_[0];
|
||||
# Bounce if there is any problem with $sn
|
||||
return t_notset if !defined $sn;
|
||||
|
||||
# Check the serial number first
|
||||
return t_na if !check_sn $sn;
|
||||
|
||||
# Query
|
||||
@_ = qw();
|
||||
$_ = "CASE no WHEN 1 THEN '創刊號' ELSE "
|
||||
. $DBH->strcat("'第'", "lpad(cast(no AS text), 3, 0)", "'期'") . " END";
|
||||
push @_, encode("UTF-8", $_);
|
||||
push @_, "' '";
|
||||
push @_, "title";
|
||||
push @_, "' '";
|
||||
push @_, "extract(year FROM date)";
|
||||
push @_, "'.'";
|
||||
push @_, "lpad(cast(extract(month FROM date) AS text), 2, 0)";
|
||||
push @_, "'.'";
|
||||
push @_, "lpad(cast(extract(day FROM date) AS text), 2, 0)";
|
||||
$_ = $DBH->strcat(@_) . " AS title";
|
||||
$sql = "SELECT $_ FROM newslets"
|
||||
. " WHERE sn=$sn;\n";
|
||||
$sth = $DBH->prepare($sql);
|
||||
$sth->execute;
|
||||
|
||||
# Not found
|
||||
return t_na unless $sth->rows == 1;
|
||||
|
||||
# Found
|
||||
return ${$sth->fetch}[0];
|
||||
}
|
||||
|
||||
# newslet_no: Obtain a newsletter number
|
||||
sub newslet_no($) {
|
||||
local ($_, %_);
|
||||
my ($sn, $sql, $sth);
|
||||
$sn = $_[0];
|
||||
# Bounce if there is any problem with $sn
|
||||
return t_notset if !defined $sn;
|
||||
|
||||
# Check the serial number first
|
||||
return t_na if !check_sn $sn;
|
||||
|
||||
# Query
|
||||
$sql = "SELECT no FROM newslets"
|
||||
. " WHERE sn=$sn;\n";
|
||||
$sth = $DBH->prepare($sql);
|
||||
$sth->execute;
|
||||
|
||||
# Not found
|
||||
return t_na unless $sth->rows == 1;
|
||||
|
||||
# Found
|
||||
return ${$sth->fetch}[0];
|
||||
}
|
||||
|
||||
no utf8;
|
||||
return 1;
|
||||
38
htdocs/wov/magicat/lib/perl5/Selima/wov/L10N.pm
Normal file
38
htdocs/wov/magicat/lib/perl5/Selima/wov/L10N.pm
Normal file
@@ -0,0 +1,38 @@
|
||||
# Woman's Voice
|
||||
# L10N.pm: The localization class.
|
||||
|
||||
# Copyright (c) 2003-2018 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Author: imacat <imacat@mail.imacat.idv.tw>
|
||||
# First written: 2003-04-26
|
||||
|
||||
package Selima::wov::L10N;
|
||||
use 5.008;
|
||||
use strict;
|
||||
use warnings;
|
||||
use base qw(Locale::Maketext::Gettext);
|
||||
|
||||
return 1;
|
||||
|
||||
# The Chinese (Taiwan) localized messages.
|
||||
package Selima::wov::L10N::zh_tw;
|
||||
use 5.008;
|
||||
use strict;
|
||||
use warnings;
|
||||
use base qw(Locale::Maketext::Gettext);
|
||||
|
||||
sub numerate : method { $_[2] }
|
||||
|
||||
return 1;
|
||||
47
htdocs/wov/magicat/lib/perl5/Selima/wov/List/Guestbook.pm
Normal file
47
htdocs/wov/magicat/lib/perl5/Selima/wov/List/Guestbook.pm
Normal file
@@ -0,0 +1,47 @@
|
||||
# Woman's Voice
|
||||
# Guestbook.pm: The administrative guestbook message list.
|
||||
|
||||
# Copyright (c) 2004-2018 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Author: imacat <imacat@mail.imacat.idv.tw>
|
||||
# First written: 2004-10-24
|
||||
|
||||
package Selima::wov::List::Guestbook;
|
||||
use 5.008;
|
||||
use strict;
|
||||
use warnings;
|
||||
use base qw(Selima::List::Guestbook);
|
||||
|
||||
use Selima::ShortCut;
|
||||
|
||||
# new: Initialize the handler
|
||||
sub new : method {
|
||||
local ($_, %_);
|
||||
my ($self, $class);
|
||||
($class, @_) = @_;
|
||||
$_[1] = "guestbook" if !defined $_[1];
|
||||
$self = $class->SUPER::new(@_);
|
||||
# The page title
|
||||
$self->{"title"} = $self->{"is_called_form"}?
|
||||
__("Select a Message"):
|
||||
__("Manage Your Voice");
|
||||
# Column labels
|
||||
$self->col_labels(
|
||||
"identity" => __("What kind of women you are?"),
|
||||
);
|
||||
return $self;
|
||||
}
|
||||
|
||||
return 1;
|
||||
@@ -0,0 +1,36 @@
|
||||
# Woman's Voice
|
||||
# Public.pm: The guestbook message list.
|
||||
|
||||
# Copyright (c) 2004-2018 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Author: imacat <imacat@mail.imacat.idv.tw>
|
||||
# First written: 2004-10-24
|
||||
|
||||
package Selima::wov::List::Guestbook::Public;
|
||||
use 5.008;
|
||||
use strict;
|
||||
use warnings;
|
||||
use base qw(Selima::List::Guestbook::Public);
|
||||
|
||||
# new: Initialize the handler
|
||||
sub new : method {
|
||||
local ($_, %_);
|
||||
my ($class, $self);
|
||||
($class, @_) = @_;
|
||||
$self = $class->SUPER::new(@_);
|
||||
return $self;
|
||||
}
|
||||
|
||||
return 1;
|
||||
99
htdocs/wov/magicat/lib/perl5/Selima/wov/List/NLArts.pm
Normal file
99
htdocs/wov/magicat/lib/perl5/Selima/wov/List/NLArts.pm
Normal file
@@ -0,0 +1,99 @@
|
||||
# Woman's Voice
|
||||
# NLArts.pm: The newsletter article list.
|
||||
|
||||
# Copyright (c) 2004-2018 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Author: imacat <imacat@mail.imacat.idv.tw>
|
||||
# First written: 2004-11-24
|
||||
|
||||
package Selima::wov::List::NLArts;
|
||||
use 5.008;
|
||||
use strict;
|
||||
use warnings;
|
||||
use base qw(Selima::List);
|
||||
|
||||
use Selima::ShortCut;
|
||||
|
||||
# new: Initialize the handler
|
||||
sub new : method {
|
||||
local ($_, %_);
|
||||
my ($self, $class);
|
||||
($class, @_) = @_;
|
||||
$_[1] = "nlarts" if !defined $_[1];
|
||||
$self = $class->SUPER::new(@_);
|
||||
# The page title
|
||||
$self->{"title"} = $self->{"is_called_form"}?
|
||||
__("Select a Newsletter Article"):
|
||||
__("Manage Newsletter Articles");
|
||||
# The default sort order
|
||||
$self->{"DEFAULT_SORTBY"} = "-newslet,ord";
|
||||
# Columns that should display its brief instead
|
||||
push @{$self->{"COLS_BRIEF"}}, qw(body_t body_h);
|
||||
# Column labels
|
||||
$self->col_labels(
|
||||
"newslet" => __("Newsletter"),
|
||||
"author" => __("Author"),
|
||||
"body_t" => __("Content (text)"),
|
||||
"body_h" => __("Content (HTML)"),
|
||||
);
|
||||
return $self;
|
||||
}
|
||||
|
||||
# html_newlink: Display a link to add a new item
|
||||
sub html_newlink : method {
|
||||
# Run the parent method
|
||||
return $_[0]->SUPER::html_newlink(__("Write a new article."));
|
||||
}
|
||||
|
||||
# html_search: Display the search box
|
||||
sub html_search : method {
|
||||
# Run the parent method
|
||||
return $_[0]->SUPER::html_search(__("Search for a article:"));
|
||||
}
|
||||
|
||||
# liststat_message: Return the current list statistics message
|
||||
sub liststat_message : method {
|
||||
local ($_, %_);
|
||||
my $self;
|
||||
$self = $_[0];
|
||||
|
||||
# No record to list
|
||||
if ($self->{"total"} == 0) {
|
||||
# Inherit the empty list statistics message
|
||||
return $self->SUPER::liststat_message;
|
||||
# Fit in one page
|
||||
} elsif ($self->{"total"} <= $self->{"pagesize"}) {
|
||||
# Result comes from a query
|
||||
if (defined $self->{"query"}) {
|
||||
return __("Your query found [*,_1,article].", $self->{"total"});
|
||||
# List result
|
||||
} else {
|
||||
return __("[*,_1,article].", $self->{"total"});
|
||||
}
|
||||
# More than one page
|
||||
} else {
|
||||
# Result comes from a query
|
||||
if (defined $self->{"query"}) {
|
||||
return __("Your query found [*,_1,article], listing [#,_2] to [#,_3].",
|
||||
$self->{"total"}, $self->{"startno"}+1, $self->{"endno"}+1);
|
||||
# List result
|
||||
} else {
|
||||
return __("[*,_1,article], listing [#,_2] to [#,_3].",
|
||||
$self->{"total"}, $self->{"startno"}+1, $self->{"endno"}+1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
98
htdocs/wov/magicat/lib/perl5/Selima/wov/List/Newslets.pm
Normal file
98
htdocs/wov/magicat/lib/perl5/Selima/wov/List/Newslets.pm
Normal file
@@ -0,0 +1,98 @@
|
||||
# Woman's Voice
|
||||
# Newslets.pm: The newsletter list.
|
||||
|
||||
# Copyright (c) 2004-2018 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Author: imacat <imacat@mail.imacat.idv.tw>
|
||||
# First written: 2004-11-17
|
||||
|
||||
package Selima::wov::List::Newslets;
|
||||
use 5.008;
|
||||
use strict;
|
||||
use warnings;
|
||||
use base qw(Selima::List);
|
||||
|
||||
use Selima::ShortCut;
|
||||
|
||||
# new: Initialize the handler
|
||||
sub new : method {
|
||||
local ($_, %_);
|
||||
my ($self, $class);
|
||||
($class, @_) = @_;
|
||||
$_[1] = "newslets" if !defined $_[1];
|
||||
$self = $class->SUPER::new(@_);
|
||||
# The page title
|
||||
$self->{"title"} = $self->{"is_called_form"}?
|
||||
__("Select a Newsletter"):
|
||||
__("Manage Newsletters");
|
||||
# The default sort order
|
||||
$self->{"DEFAULT_SORTBY"} = "-no";
|
||||
# Columns that should display its brief instead
|
||||
push @{$self->{"COLS_BRIEF"}}, qw(cred_t cred_h);
|
||||
# Column labels
|
||||
$self->col_labels(
|
||||
"no" => __("Issue"),
|
||||
"cred_t" => __("Credits (text)"),
|
||||
"cred_h" => __("Credits (HTML)"),
|
||||
);
|
||||
return $self;
|
||||
}
|
||||
|
||||
# html_newlink: Display a link to add a new item
|
||||
sub html_newlink : method {
|
||||
# Run the parent method
|
||||
return $_[0]->SUPER::html_newlink(__("Add a new newsletter."));
|
||||
}
|
||||
|
||||
# html_search: Display the search box
|
||||
sub html_search : method {
|
||||
# Run the parent method
|
||||
return $_[0]->SUPER::html_search(__("Search for a newsletter:"));
|
||||
}
|
||||
|
||||
# liststat_message: Return the current list statistics message
|
||||
sub liststat_message : method {
|
||||
local ($_, %_);
|
||||
my $self;
|
||||
$self = $_[0];
|
||||
|
||||
# No record to list
|
||||
if ($self->{"total"} == 0) {
|
||||
# Inherit the empty list statistics message
|
||||
return $self->SUPER::liststat_message;
|
||||
# Fit in one page
|
||||
} elsif ($self->{"total"} <= $self->{"pagesize"}) {
|
||||
# Result comes from a query
|
||||
if (defined $self->{"query"}) {
|
||||
return __("Your query found [*,_1,newsletter].", $self->{"total"});
|
||||
# List result
|
||||
} else {
|
||||
return __("[*,_1,newsletter].", $self->{"total"});
|
||||
}
|
||||
# More than one page
|
||||
} else {
|
||||
# Result comes from a query
|
||||
if (defined $self->{"query"}) {
|
||||
return __("Your query found [*,_1,newsletter], listing [#,_2] to [#,_3].",
|
||||
$self->{"total"}, $self->{"startno"}+1, $self->{"endno"}+1);
|
||||
# List result
|
||||
} else {
|
||||
return __("[*,_1,newsletter], listing [#,_2] to [#,_3].",
|
||||
$self->{"total"}, $self->{"startno"}+1, $self->{"endno"}+1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
194
htdocs/wov/magicat/lib/perl5/Selima/wov/List/Search.pm
Normal file
194
htdocs/wov/magicat/lib/perl5/Selima/wov/List/Search.pm
Normal file
@@ -0,0 +1,194 @@
|
||||
# Woman's Voice
|
||||
# Search.pm: The web site full-text search result list.
|
||||
|
||||
# Copyright (c) 2004-2018 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Author: imacat <imacat@mail.imacat.idv.tw>
|
||||
# First written: 2004-11-28
|
||||
|
||||
package Selima::wov::List::Search;
|
||||
use 5.008;
|
||||
use utf8;
|
||||
use strict;
|
||||
use warnings;
|
||||
use base qw(Selima::List);
|
||||
|
||||
use Selima::Logging;
|
||||
use Selima::ShortCut;
|
||||
|
||||
# new: Initialize the handler
|
||||
sub new : method {
|
||||
local ($_, %_);
|
||||
my ($self, $class);
|
||||
($class, @_) = @_;
|
||||
$self = $class->SUPER::new(@_);
|
||||
# The page title
|
||||
if (!defined $self->{"query"}) {
|
||||
$self->{"title"} = "女聲全文檢索";
|
||||
$self->{"etitle"} = "Website Search";
|
||||
} else {
|
||||
$self->{"title"} = "全文檢索結果";
|
||||
$self->{"etitle"} = "Search Result";
|
||||
}
|
||||
$self->{"view"} = "search_list";
|
||||
$self->{"COLS_NO_SEARCH"} = [qw(section path nlpath html piority)];
|
||||
return $self;
|
||||
}
|
||||
|
||||
# fetch: Fetch the current list
|
||||
sub fetch : method {
|
||||
local ($_, %_);
|
||||
my $self;
|
||||
$self = $_[0];
|
||||
# No search specified
|
||||
if (!defined $self->{"query"}) {
|
||||
$self->{"total"} = undef;
|
||||
return $self->{"error"};
|
||||
}
|
||||
# Check the query phrase
|
||||
# Regularize it
|
||||
$self->{"query"} =~ s/^\s*(.*?)\s*$/$1/;
|
||||
# Check if it is filled
|
||||
if ($self->{"query"} eq"") {
|
||||
$self->{"total"} = undef;
|
||||
$self->{"error"} = {"msg"=>N_("Please fill in your query.")};
|
||||
return $self->{"error"};
|
||||
}
|
||||
# Run the parent method
|
||||
$self->SUPER::fetch;
|
||||
# Add an activity log record
|
||||
actlog("Query with phrase \"" . $self->{"query"} . "\".");
|
||||
# Done
|
||||
return $self->{"error"};
|
||||
}
|
||||
|
||||
# sql_orderby: Get the SQL ORDER BY phase
|
||||
# Always return nothing
|
||||
sub sql_orderby : method { return ""; }
|
||||
|
||||
# html_newlink: Display a link to add a new item
|
||||
# Make it a null function
|
||||
sub html_newlink : method {}
|
||||
|
||||
# html_search: Display the search box
|
||||
sub html_search : method {
|
||||
# Run the parent method
|
||||
return $_[0]->SUPER::html_search(__("Search in the website:"));
|
||||
}
|
||||
|
||||
# liststat_message: Return the current list statistics message
|
||||
sub liststat_message : method {
|
||||
local ($_, %_);
|
||||
my $self;
|
||||
$self = $_[0];
|
||||
|
||||
# No record to list
|
||||
if ($self->{"total"} == 0) {
|
||||
# Inherit the empty list statistics message
|
||||
return $self->SUPER::liststat_message;
|
||||
# Fit in one page
|
||||
} elsif ($self->{"total"} <= $self->{"pagesize"}) {
|
||||
# Result comes from a query
|
||||
if (defined $self->{"query"}) {
|
||||
return __("Your query found [*,_1,article].", $self->{"total"});
|
||||
# List result
|
||||
} else {
|
||||
return __("[*,_1,article].", $self->{"total"});
|
||||
}
|
||||
# More than one page
|
||||
} else {
|
||||
# Result comes from a query
|
||||
if (defined $self->{"query"}) {
|
||||
return __("Your query found [*,_1,article], listing [#,_2] to [#,_3].",
|
||||
$self->{"total"}, $self->{"startno"}+1, $self->{"endno"}+1);
|
||||
# List result
|
||||
} else {
|
||||
return __("[*,_1,article], listing [#,_2] to [#,_3].",
|
||||
$self->{"total"}, $self->{"startno"}+1, $self->{"endno"}+1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# html_list: List the items
|
||||
sub html_list : method {
|
||||
local ($_, %_);
|
||||
my ($self);
|
||||
$self = $_[0];
|
||||
# Do not show the list
|
||||
return if !defined $self->{"total"};
|
||||
# No record to be listed
|
||||
return if $self->{"total"} == 0;
|
||||
|
||||
print << "EOT";
|
||||
<ol class="searchresult">
|
||||
EOT
|
||||
|
||||
# Print each record
|
||||
foreach my $current (@{$self->{"current"}}) {
|
||||
my ($url, $abstract);
|
||||
$url = h($$current{"path"});
|
||||
$abstract = $self->query_abstract($current);
|
||||
if ($$current{"section"} eq "newsletters") {
|
||||
my ($title, $author, $newsletter, $nlurl);
|
||||
$title = h($$current{"title"});
|
||||
$author = h($$current{"author"});
|
||||
$newsletter = h($$current{"newsletter"});
|
||||
$nlurl = h($$current{"nlpath"});
|
||||
|
||||
print << "EOT";
|
||||
<li><h3><a href="$url">$title</a> <span class="note">$author</span></h3>
|
||||
<address><a href="$nlurl">$newsletter</a></address>
|
||||
EOT
|
||||
} elsif ($$current{"section"} eq "guestbook") {
|
||||
my ($author, $date);
|
||||
$author = defined $$current{"author"}?
|
||||
" <span class=\"note\">" . h($$current{"author"}) . "</span>": "";
|
||||
$date = h($$current{"date"});
|
||||
|
||||
print << "EOT";
|
||||
<li><h3><a href="$url">$date 留言</a>$author</h3>
|
||||
<address><a href="/cgi-bin/guestbook.cgi">妳的女聲</a></address>
|
||||
EOT
|
||||
} elsif ($$current{"section"} eq "links") {
|
||||
my $title;
|
||||
$title = h($$current{"title"});
|
||||
|
||||
print << "EOT";
|
||||
<li><h3><a href="$url">$title</a></h3>
|
||||
<address><a href="/links/">女網牽手</a></address>
|
||||
EOT
|
||||
} elsif ($$current{"section"} eq "pages") {
|
||||
my $title;
|
||||
$title = h($$current{"title"});
|
||||
|
||||
print << "EOT";
|
||||
<li><h3><a href="$url">$title</a></h3>
|
||||
EOT
|
||||
}
|
||||
print "\n<p>$abstract</p>\n" if defined $abstract;
|
||||
print << "EOT";
|
||||
</li>
|
||||
|
||||
EOT
|
||||
}
|
||||
print << "EOT";
|
||||
</ol>
|
||||
|
||||
EOT
|
||||
return;
|
||||
}
|
||||
|
||||
no utf8;
|
||||
return 1;
|
||||
@@ -0,0 +1,142 @@
|
||||
# Woman's Voice
|
||||
# Public.pm: The guestbook data processor.
|
||||
|
||||
# Copyright (c) 2006-2018 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Author: imacat <imacat@mail.imacat.idv.tw>
|
||||
# First written: 2006-03-19
|
||||
|
||||
package Selima::wov::Processor::Guestbook::Public;
|
||||
use 5.008;
|
||||
use utf8;
|
||||
use strict;
|
||||
use warnings;
|
||||
use base qw(Selima::Processor::Guestbook);
|
||||
|
||||
use Selima::Country;
|
||||
use Selima::DataVars qw(:env :input :scptconf);
|
||||
use Selima::Format;
|
||||
use Selima::GeoIP;
|
||||
use Selima::Guest;
|
||||
use Selima::RemoHost;
|
||||
use Selima::Unicode;
|
||||
use Selima::ShortCut;
|
||||
|
||||
# new: Initialize the processor
|
||||
sub new : method {
|
||||
local ($_, %_);
|
||||
my ($self, $class);
|
||||
($class, @_) = @_;
|
||||
$_[0]->param("form", "new");
|
||||
$_[0]->param("confirm", 1);
|
||||
$self = $class->SUPER::new(@_);
|
||||
$self->{"notify"} = 1;
|
||||
$self->{"debug"} = 1;
|
||||
return $self;
|
||||
}
|
||||
|
||||
# _save_cols: Save the column deposit
|
||||
sub _save_cols : method {
|
||||
local ($_, %_);
|
||||
my $self;
|
||||
($self, @_) = @_;
|
||||
$self->SUPER::_save_cols(@_);
|
||||
$self->{"cols"}->{"login"} = 723676436;
|
||||
return;
|
||||
}
|
||||
|
||||
# _other_tasks: Perform tasks other than column updates
|
||||
sub _other_tasks : method {
|
||||
local ($_, %_);
|
||||
my ($self, $form);
|
||||
my ($mail, $body, $charset);
|
||||
$self = $_[0];
|
||||
return unless $self->{"notify"};
|
||||
$form = $self->{"form"};
|
||||
|
||||
# Compose the mail body
|
||||
$body = "";
|
||||
$body .= "若要編輯或刪除這則留言,請連上以下網址:\n";
|
||||
$body .= "http://" . $ENV{"SERVER_NAME"} . "/magicat/cgi-bin/guestbook.cgi"
|
||||
. "?form=cur&sn=" . $self->{"sn"} . "\n\n";
|
||||
$body .= "日期: " . fmttime . "\n";
|
||||
@_ = qw();
|
||||
push @_, ctname_zhtw country_lookup;
|
||||
push @_, remote_host if defined remote_host;
|
||||
$body .= "來自: " . $ENV{"REMOTE_ADDR"}
|
||||
. " (" . join(", ", @_) . ")\n";
|
||||
$body .= "簽名: " . $form->param("name") . "\n"
|
||||
if $form->param("name") ne "";
|
||||
$body .= "物種: " . $form->param("identity") . "\n"
|
||||
if $form->param("identity") ne "";
|
||||
$body .= "地點: " . $form->param("location") . "\n"
|
||||
if $form->param("location") ne "";
|
||||
$body .= "信箱: " . $form->param("email") . "\n"
|
||||
if $form->param("email") ne "";
|
||||
$body .= "網址: " . $form->param("url") . "\n"
|
||||
if $form->param("url") ne "" && $form->param("url") ne "http://";
|
||||
$body .= "留言:\n\n" . $form->param("message") . "\n\n";
|
||||
$body .= "原始內容:\n" . $USER_INPUT{"POST_RAWDATA"} . "\n";
|
||||
|
||||
# Collecting Debugging infomation
|
||||
if ($self->{"debug"}) {
|
||||
$body .= "\n";
|
||||
$body .= "===== Start Debugging Infomation =====\n";
|
||||
if ($IS_MODPERL) {
|
||||
$_ = $IS_MP2? Apache2::RequestUtil->request->as_string:
|
||||
Apache->request->as_string;
|
||||
s/^X-Selima-[^\n]+\n//mg;
|
||||
s/^((?:[^\n]+\n)+).+?$/$1/s;
|
||||
$body .= $_;
|
||||
} else {
|
||||
foreach (sort grep !/^HTTP_X_SELIMA_/, grep /^HTTP_/, keys %ENV) {
|
||||
my $hname;
|
||||
$hname = $_;
|
||||
$hname =~ s/^HTTP_//;
|
||||
$hname =~ s/_/-/g;
|
||||
$hname =~ s/(\w)(\w+)/$1 . lc $2/ge;
|
||||
$body .= "$hname: $ENV{$_}\n";
|
||||
}
|
||||
}
|
||||
$body .= "===== End Debugging Infomation =====\n";
|
||||
}
|
||||
|
||||
# Set the best appropriate output character set
|
||||
$charset = is_charset($body, "Big5")? "Big5": "UTF-8";
|
||||
|
||||
# Compose the mail
|
||||
$mail = new Selima::Mail;
|
||||
$mail->charset($charset);
|
||||
$mail->from($THIS_FILE . "\@" . $ENV{"SERVER_NAME"}, "女聲留言本");
|
||||
$mail->to("editors\@mail.wov.idv.tw", "女聲編輯");
|
||||
$mail->subject("[女聲] 留言本留言通知 " . fmtdate);
|
||||
$mail->body($body);
|
||||
# Send it
|
||||
$mail->send;
|
||||
return;
|
||||
}
|
||||
|
||||
# _actlog: Log the activity
|
||||
sub _actlog : method {
|
||||
local ($_, %_);
|
||||
my $self;
|
||||
$self = $_[0];
|
||||
# A form to create a new item
|
||||
return gactlog "Post a new message on " . fmtdate($self->{"date"})
|
||||
. " with s/n " . $self->{"sn"} . ".";
|
||||
}
|
||||
|
||||
no utf8;
|
||||
return 1;
|
||||
70
htdocs/wov/magicat/lib/perl5/Selima/wov/Processor/LinkCat.pm
Normal file
70
htdocs/wov/magicat/lib/perl5/Selima/wov/Processor/LinkCat.pm
Normal file
@@ -0,0 +1,70 @@
|
||||
# Woman's Voice
|
||||
# LinkCat.pm: The related-link category data processor.
|
||||
|
||||
# Copyright (c) 2006-2018 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Author: imacat <imacat@mail.imacat.idv.tw>
|
||||
# First written: 2006-04-05
|
||||
|
||||
package Selima::wov::Processor::LinkCat;
|
||||
use 5.008;
|
||||
use strict;
|
||||
use warnings;
|
||||
use base qw(Selima::Processor::LinkCat);
|
||||
|
||||
use Selima::DataVars qw(:addcol);
|
||||
|
||||
# _save_cols: Save the column deposit
|
||||
sub _save_cols : method {
|
||||
local ($_, %_);
|
||||
my ($self, $form, $cur);
|
||||
$self = $_[0];
|
||||
($form, $cur) = ($self->{"form"}, $self->{"cur"});
|
||||
if ($self->{"type"} ne "del") {
|
||||
# Set the "topmost" parent
|
||||
$form->delete("parent") if $form->param("topmost") eq "true";
|
||||
}
|
||||
# A form to create a new item
|
||||
if ($self->{"type"} eq "new") {
|
||||
$self->{"sn"} = $self->_new_sn;
|
||||
$self->{"cols"} = new Selima::AddCol($self->{"table"}, ADDCOL_INSERT);
|
||||
$self->{"cols"}->addnum("sn", $self->{"sn"});
|
||||
$self->{"cols"}->addnum("parent", $self->_form("parent"));
|
||||
$self->{"cols"}->addstr("id", $self->_form("id"));
|
||||
$self->{"cols"}->addnum("ord", $self->_form("ord"));
|
||||
$self->{"cols"}->addstr("title", $self->_form("title"));
|
||||
$self->{"cols"}->addstr("title_en", $self->_form("title_en"));
|
||||
$self->{"cols"}->addstr("kw", $self->_form("kw"));
|
||||
$self->{"cols"}->addbool("hid", $self->_form("hid"));
|
||||
# Automatic Traditional Chinese to Simplified Chinese conversion
|
||||
$self->_zhsync;
|
||||
|
||||
# A form to edit a current item
|
||||
} elsif ($self->{"type"} eq "cur") {
|
||||
$self->{"cols"} = new Selima::AddCol($self->{"table"}, ADDCOL_UPDATE);
|
||||
$self->{"cols"}->addnum("parent", $self->_form("parent"), scalar $cur->param("parent"));
|
||||
$self->{"cols"}->addstr("id", $self->_form("id"), scalar $cur->param("id"));
|
||||
$self->{"cols"}->addnum("ord", $self->_form("ord"), scalar $cur->param("ord"));
|
||||
$self->{"cols"}->addstr("title", $self->_form("title"), scalar $cur->param("title"));
|
||||
$self->{"cols"}->addstr("title_en", $self->_form("title_en"), scalar $cur->param("title_en"));
|
||||
$self->{"cols"}->addstr("kw", $self->_form("kw"), scalar $cur->param("kw"));
|
||||
$self->{"cols"}->addbool("hid", $self->_form("hid"), scalar $cur->param("hid"));
|
||||
# Automatic Traditional Chinese to Simplified Chinese conversion
|
||||
$self->_zhsync;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
return 1;
|
||||
151
htdocs/wov/magicat/lib/perl5/Selima/wov/Processor/NLArt.pm
Normal file
151
htdocs/wov/magicat/lib/perl5/Selima/wov/Processor/NLArt.pm
Normal file
@@ -0,0 +1,151 @@
|
||||
# Woman's Voice
|
||||
# NLArt.pm: The newsletter article processor.
|
||||
|
||||
# Copyright (c) 2006-2018 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Author: imacat <imacat@mail.imacat.idv.tw>
|
||||
# First written: 2006-03-19
|
||||
|
||||
package Selima::wov::Processor::NLArt;
|
||||
use 5.008;
|
||||
use strict;
|
||||
use warnings;
|
||||
use base qw(Selima::Processor);
|
||||
|
||||
use Selima::DataVars qw(:addcol);
|
||||
use Selima::Guest;
|
||||
use Selima::ShortCut;
|
||||
|
||||
use Selima::wov::Items;
|
||||
use Selima::wov::Rebuild;
|
||||
|
||||
# new: Initialize the processor
|
||||
sub new : method {
|
||||
local ($_, %_);
|
||||
my ($self, $class);
|
||||
($class, @_) = @_;
|
||||
$_[1] = "nlarts" if @_ < 2;
|
||||
$self = $class->SUPER::new(@_);
|
||||
return $self;
|
||||
}
|
||||
|
||||
# _save_cols: Save the column deposit
|
||||
sub _save_cols : method {
|
||||
local ($_, %_);
|
||||
my ($self, $form, $cur);
|
||||
$self = $_[0];
|
||||
($form, $cur) = ($self->{"form"}, $self->{"cur"});
|
||||
# A form to create a new item
|
||||
if ($self->{"type"} eq "new") {
|
||||
$self->{"sn"} = $self->_new_sn;
|
||||
$self->{"cols"} = new Selima::AddCol($self->{"table"}, ADDCOL_INSERT);
|
||||
$self->{"cols"}->addnum("sn", $self->{"sn"});
|
||||
$self->{"cols"}->addnum("newslet", $self->_form("newslet"));
|
||||
$self->{"cols"}->addnum("ord", $self->_form("ord"));
|
||||
$self->{"cols"}->addstr("title", $self->_form("title"));
|
||||
$self->{"cols"}->addstr("author", $self->_form("author"));
|
||||
$self->{"cols"}->addstr("body_t", $self->_form("body_t"));
|
||||
$self->{"cols"}->addstr("body_h", $self->_form("body_h"));
|
||||
$self->{"cols"}->addbool("hid", $self->_form("hid"));
|
||||
|
||||
# A form to edit a current item
|
||||
} elsif ($self->{"type"} eq "cur") {
|
||||
$self->{"cols"} = new Selima::AddCol($self->{"table"}, ADDCOL_UPDATE);
|
||||
$self->{"cols"}->addnum("newslet", $self->_form("newslet"), scalar $cur->param("newslet"));
|
||||
$self->{"cols"}->addnum("ord", $self->_form("ord"), scalar $cur->param("ord"));
|
||||
$self->{"cols"}->addstr("title", $self->_form("title"), scalar $cur->param("title"));
|
||||
$self->{"cols"}->addstr("author", $self->_form("author"), scalar $cur->param("author"));
|
||||
$self->{"cols"}->addstr("body_t", $self->_form("body_t"), scalar $cur->param("body_t"));
|
||||
$self->{"cols"}->addstr("body_h", $self->_form("body_h"), scalar $cur->param("body_h"));
|
||||
$self->{"cols"}->addbool("hid", $self->_form("hid"), scalar $cur->param("hid"));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
# _actlog: Log the activity
|
||||
sub _actlog : method {
|
||||
local ($_, %_);
|
||||
my ($self, $form, $cur);
|
||||
$self = $_[0];
|
||||
($form, $cur) = ($self->{"form"}, $self->{"cur"});
|
||||
# A form to create a new item
|
||||
return gactlog "Create a newsletter article " . $form->param("title")
|
||||
. " in newsletter No. " . newslet_no($form->param("newslet"))
|
||||
. " with s/n " . $self->{"sn"} . "."
|
||||
if $self->{"type"} eq "new";
|
||||
# A form to edit a current item
|
||||
return gactlog "Update the newsletter article " . $form->param("title")
|
||||
. " in newsletter No. " . newslet_no($form->param("newslet"))
|
||||
. " with s/n " . $self->{"sn"} . "."
|
||||
if $self->{"type"} eq "cur";
|
||||
# A form to delete a current item
|
||||
return gactlog "Delete the newsletter article " . $cur->param("title")
|
||||
. " in newsletter No. " . newslet_no($cur->param("newslet"))
|
||||
. " with s/n " . $self->{"sn"} . "."
|
||||
if $self->{"type"} eq "del";
|
||||
}
|
||||
|
||||
# _ret_status: Return the process status
|
||||
sub _ret_status : method {
|
||||
local ($_, %_);
|
||||
my $self;
|
||||
$self = $_[0];
|
||||
return {"msg"=>N_("This article was not modified."),
|
||||
"isform"=>0}
|
||||
if !$self->_modified;
|
||||
# A form to create a new item
|
||||
return {"msg"=>N_("This article has been successfully added."),
|
||||
"isform"=>0}
|
||||
if $self->{"type"} eq "new";
|
||||
# A form to edit a current item
|
||||
return {"msg"=>N_("This article has been successfully updated."),
|
||||
"isform"=>0}
|
||||
if $self->{"type"} eq "cur";
|
||||
# A form to delete a current item
|
||||
return {"msg"=>N_("This article has been successfully deleted."),
|
||||
"isform"=>0}
|
||||
if $self->{"type"} eq "del";
|
||||
}
|
||||
|
||||
# _rebuild_partial_pages: Rebuild a limited part of pages
|
||||
sub _rebuild_partial_pages : method {
|
||||
local ($_, %_);
|
||||
my ($self, $form, $cur);
|
||||
$self = $_[0];
|
||||
($form, $cur) = ($self->{"form"}, $self->{"cur"});
|
||||
|
||||
# Find the affected shown parts
|
||||
%_ = qw();
|
||||
# A form to create a new item
|
||||
if ($self->{"type"} eq "new") {
|
||||
$_{$form->param("newslet")} = 1 unless defined $form->param("hid");
|
||||
# A form to edit a current item
|
||||
} elsif ($self->{"type"} eq "cur") {
|
||||
$_{$form->param("newslet")} = 1 unless defined $form->param("hid");
|
||||
$_{$cur->param("newslet")} = 1 unless $cur->param("hid");
|
||||
# A form to delete a current item
|
||||
} elsif ($self->{"type"} eq "del") {
|
||||
$_{$cur->param("newslet")} = 1 unless $cur->param("hid");
|
||||
}
|
||||
@_ = keys %_;
|
||||
# Nothing to rebuild when no shown parts are seen
|
||||
return if @_ == 0;
|
||||
|
||||
# Rebuild the pages
|
||||
rebuild_newslets @_;
|
||||
return;
|
||||
}
|
||||
|
||||
return 1;
|
||||
263
htdocs/wov/magicat/lib/perl5/Selima/wov/Processor/Newslet.pm
Normal file
263
htdocs/wov/magicat/lib/perl5/Selima/wov/Processor/Newslet.pm
Normal file
@@ -0,0 +1,263 @@
|
||||
# Woman's Voice
|
||||
# Newslet.pm: The newsletter data processor.
|
||||
|
||||
# Copyright (c) 2006-2018 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Author: imacat <imacat@mail.imacat.idv.tw>
|
||||
# First written: 2006-03-19
|
||||
|
||||
package Selima::wov::Processor::Newslet;
|
||||
use 5.008;
|
||||
use strict;
|
||||
use warnings;
|
||||
use base qw(Selima::Processor);
|
||||
|
||||
use Selima::DataVars qw(:addcol :dataman);
|
||||
use Selima::Guest;
|
||||
use Selima::ShortCut;
|
||||
|
||||
use Selima::wov::Rebuild;
|
||||
|
||||
use Selima::wov::Processor::NLArt;
|
||||
use Selima::Processor::Deletion;
|
||||
|
||||
# new: Initialize the processor
|
||||
sub new : method {
|
||||
local ($_, %_);
|
||||
my ($self, $class);
|
||||
($class, @_) = @_;
|
||||
$_[1] = "newslets" if @_ < 2;
|
||||
$self = $class->SUPER::new(@_);
|
||||
return $self;
|
||||
}
|
||||
|
||||
# _save_cols: Save the column deposit
|
||||
sub _save_cols : method {
|
||||
local ($_, %_);
|
||||
my ($self, $form, $cur, $o);
|
||||
$self = $_[0];
|
||||
($form, $cur) = ($self->{"form"}, $self->{"cur"});
|
||||
# A form to create a new item
|
||||
if ($self->{"type"} eq "new") {
|
||||
$self->{"sn"} = $self->_new_sn;
|
||||
$self->{"cols"} = new Selima::AddCol($self->{"table"}, ADDCOL_INSERT);
|
||||
$self->{"cols"}->addnum("sn", $self->{"sn"});
|
||||
$self->{"cols"}->addnum("no", $self->_form("no"));
|
||||
$self->{"cols"}->adddate("date", $self->_form("date"));
|
||||
$self->{"cols"}->addstr("title", $self->_form("title"));
|
||||
$self->{"cols"}->addstr("cred_t", $self->_form("cred_t"));
|
||||
$self->{"cols"}->addstr("cred_h", $self->_form("cred_h"));
|
||||
$self->{"cols"}->addstr("kw", $self->_form("kw"));
|
||||
$self->{"cols"}->addbool("hid", $self->_form("hid"));
|
||||
|
||||
# Find the changed items
|
||||
for ($_ = 0, $o = 1; defined $form->param("art$_" . "title"); $_++) {
|
||||
my ($subform, $cols);
|
||||
# Not selected
|
||||
next unless defined $form->param("art$_");
|
||||
$subform = new CGI("");
|
||||
$subform->param("form", "new");
|
||||
$subform->param("newslet", $self->{"sn"});
|
||||
$subform->param("ord", $o++);
|
||||
$subform->param("title", $form->param("art$_" . "title"));
|
||||
$subform->param("author", $form->param("art$_" . "author"));
|
||||
$subform->param("body_t", $form->param("art$_" . "body_t"));
|
||||
$subform->param("body_h", $form->param("art$_" . "body_h"));
|
||||
$subform->param("hid", $form->param("art$_" . "hid"));
|
||||
$cols = new Selima::wov::Processor::NLArt($subform);
|
||||
$cols->_save_cols;
|
||||
push @{$self->{"subs"}}, $cols;
|
||||
}
|
||||
|
||||
# A form to edit a current item
|
||||
} elsif ($self->{"type"} eq "cur") {
|
||||
$self->{"cols"} = new Selima::AddCol($self->{"table"}, ADDCOL_UPDATE);
|
||||
$self->{"cols"}->addnum("no", $self->_form("no"), scalar $cur->param("no"));
|
||||
$self->{"cols"}->adddate("date", $self->_form("date"), scalar $cur->param("date"));
|
||||
$self->{"cols"}->addstr("title", $self->_form("title"), scalar $cur->param("title"));
|
||||
$self->{"cols"}->addstr("cred_t", $self->_form("cred_t"), scalar $cur->param("cred_t"));
|
||||
$self->{"cols"}->addstr("cred_h", $self->_form("cred_h"), scalar $cur->param("cred_h"));
|
||||
$self->{"cols"}->addstr("kw", $self->_form("kw"), scalar $cur->param("kw"));
|
||||
$self->{"cols"}->addbool("hid", $self->_form("hid"), scalar $cur->param("hid"));
|
||||
|
||||
# Find the changed items
|
||||
@_ = qw();
|
||||
for ( $_ = 0, $o = 1;
|
||||
$_ < $cur->param("artcount")
|
||||
|| defined $form->param("art$_" . "title");
|
||||
$_++) {
|
||||
# Added items to the current
|
||||
if ($_ >= $cur->param("artcount")) {
|
||||
my ($subform, $cols);
|
||||
# Not selected
|
||||
next unless defined $form->param("art$_");
|
||||
$subform = new CGI("");
|
||||
$subform->param("form", "new");
|
||||
$subform->param("newslet", $self->{"sn"});
|
||||
$subform->param("ord", $o++);
|
||||
$subform->param("title", $form->param("art$_" . "title"));
|
||||
$subform->param("author", $form->param("art$_" . "author"));
|
||||
$subform->param("body_t", $form->param("art$_" . "body_t"));
|
||||
$subform->param("body_h", $form->param("art$_" . "body_h"));
|
||||
$subform->param("hid", $form->param("art$_" . "hid"));
|
||||
$cols = new Selima::wov::Processor::NLArt($subform);
|
||||
$cols->_save_cols;
|
||||
push @{$self->{"subs"}}, $cols;
|
||||
|
||||
# Selected
|
||||
} elsif (defined $form->param("art$_")) {
|
||||
my ($subform, $cols, %CURRENT_SUP);
|
||||
%CURRENT_SUP = %CURRENT;
|
||||
%CURRENT = (
|
||||
"sn" => $cur->param("art$_" . "sn"),
|
||||
"newslet" => $self->{"sn"},
|
||||
"ord" => $cur->param("art$_" . "ord"),
|
||||
"title" => $cur->param("art$_" . "title"),
|
||||
"author" => $cur->param("art$_" . "author"),
|
||||
"body_t" => $cur->param("art$_" . "body_t"),
|
||||
"body_h" => $cur->param("art$_" . "body_h"),
|
||||
"hid" => $cur->param("art$_" . "hid"),
|
||||
);
|
||||
$subform = new CGI("");
|
||||
$subform->param("form", "cur");
|
||||
$subform->param("sn", $cur->param("art$_" . "sn"));
|
||||
$subform->param("newslet", $self->{"sn"});
|
||||
$subform->param("ord", $o++);
|
||||
$subform->param("title", $form->param("art$_" . "title"));
|
||||
$subform->param("author", $form->param("art$_" . "author"));
|
||||
$subform->param("body_t", $form->param("art$_" . "body_t"));
|
||||
$subform->param("body_h", $form->param("art$_" . "body_h"));
|
||||
$subform->param("hid", $form->param("art$_" . "hid"));
|
||||
$cols = new Selima::wov::Processor::NLArt($subform);
|
||||
$cols->_save_cols;
|
||||
push @{$self->{"subs"}}, $cols;
|
||||
%CURRENT = %CURRENT_SUP;
|
||||
|
||||
# Not selected
|
||||
} else {
|
||||
push @_, $cur->param("art$_" . "sn");
|
||||
}
|
||||
}
|
||||
if (@_ > 0) {
|
||||
my $subform;
|
||||
$_ = join " OR ", map "sn=$_", @_;
|
||||
$subform = new CGI("");
|
||||
$subform->param("cond", $_);
|
||||
# Delete first, to spare the order occupied
|
||||
unshift @{$self->{"subs"}}, new Selima::Processor::Deletion($subform, "nlarts");
|
||||
}
|
||||
|
||||
# A form to delete a current item
|
||||
} elsif ($self->{"type"} eq "del") {
|
||||
# Find the changed items
|
||||
$_ = new CGI("");
|
||||
$_->param("cond", "newslet=" . $self->{"sn"});
|
||||
push @{$self->{"subs"}}, new Selima::Processor::Deletion($_, "nlarts");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
# _actlog: Log the activity
|
||||
sub _actlog : method {
|
||||
local ($_, %_);
|
||||
my ($self, $form, $cur);
|
||||
$self = $_[0];
|
||||
($form, $cur) = ($self->{"form"}, $self->{"cur"});
|
||||
# A form to create a new item
|
||||
return gactlog "Create a newsletter No. " . $form->param("no")
|
||||
. " with s/n " . $self->{"sn"} . "."
|
||||
if $self->{"type"} eq "new";
|
||||
# A form to edit a current item
|
||||
return gactlog "Update the newsletter No. " . $form->param("no")
|
||||
. " with s/n " . $self->{"sn"} . "."
|
||||
if $self->{"type"} eq "cur";
|
||||
# A form to delete a current item
|
||||
return gactlog "Delete the newsletter No. " . $cur->param("no")
|
||||
. " with s/n " . $self->{"sn"} . "."
|
||||
if $self->{"type"} eq "del";
|
||||
}
|
||||
|
||||
# _ret_status: Return the process status
|
||||
sub _ret_status : method {
|
||||
local ($_, %_);
|
||||
my $self;
|
||||
$self = $_[0];
|
||||
return {"msg"=>N_("This newsletter was not modified."),
|
||||
"isform"=>0}
|
||||
if !$self->_modified;
|
||||
# A form to create a new item
|
||||
return {"msg"=>N_("This newsletter has been successfully added."),
|
||||
"isform"=>0}
|
||||
if $self->{"type"} eq "new";
|
||||
# A form to edit a current item
|
||||
return {"msg"=>N_("This newsletter has been successfully updated."),
|
||||
"isform"=>0}
|
||||
if $self->{"type"} eq "cur";
|
||||
# A form to delete a current item
|
||||
return {"msg"=>N_("This newsletter has been successfully deleted."),
|
||||
"isform"=>0}
|
||||
if $self->{"type"} eq "del";
|
||||
}
|
||||
|
||||
# _rebuild_partial_pages: Rebuild a limited part of pages
|
||||
sub _rebuild_partial_pages : method {
|
||||
local ($_, %_);
|
||||
my ($self, $form, $cur);
|
||||
my $build_me_only;
|
||||
$self = $_[0];
|
||||
($form, $cur) = ($self->{"form"}, $self->{"cur"});
|
||||
# Remove the unwanted pages
|
||||
$self->_remove_curfile;
|
||||
|
||||
# Check if there is any shown part affected
|
||||
# A form to create a new item
|
||||
if ($self->{"type"} eq "new") {
|
||||
return if defined $form->param("hid");
|
||||
$build_me_only = 0;
|
||||
# A form to edit a current item
|
||||
} elsif ($self->{"type"} eq "cur") {
|
||||
return if $cur->param("hid") && defined $form->param("hid");
|
||||
$build_me_only = (!$cur->param("hid") && !defined $form->param("hid"));
|
||||
# A form to delete a current item
|
||||
} elsif ($self->{"type"} eq "del") {
|
||||
return if $cur->param("hid");
|
||||
$build_me_only = 0;
|
||||
}
|
||||
|
||||
if ($build_me_only) {
|
||||
rebuild_newslets $self->{"sn"};
|
||||
# Rebuild everything, since the page bar changed
|
||||
} else {
|
||||
rebuild_newslets;
|
||||
}
|
||||
}
|
||||
|
||||
# _remove_curfile: Remove the unwanted page
|
||||
sub _remove_curfile : method {
|
||||
local ($_, %_);
|
||||
my ($self, $form, $cur);
|
||||
$self = $_[0];
|
||||
($form, $cur) = ($self->{"form"}, $self->{"cur"});
|
||||
# Nothing to remove if there is no current page
|
||||
return if $self->{"type"} eq "new" || $cur->param("hid");
|
||||
# A current page to be deleted or hidden
|
||||
return grmoldpage sprintf "/newsletters/wov%04d.html", $cur->param("no")
|
||||
if $self->{"type"} eq "del" || defined $form->param("hid");
|
||||
# A shown page update with a new page path to check with
|
||||
# Page path is not updated
|
||||
return;
|
||||
}
|
||||
|
||||
return 1;
|
||||
68
htdocs/wov/magicat/lib/perl5/Selima/wov/Processor/Page.pm
Normal file
68
htdocs/wov/magicat/lib/perl5/Selima/wov/Processor/Page.pm
Normal file
@@ -0,0 +1,68 @@
|
||||
# Woman's Voice
|
||||
# Page.pm: The web page form data processor.
|
||||
|
||||
# Copyright (c) 2006-2018 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Author: imacat <imacat@mail.imacat.idv.tw>
|
||||
# First written: 2006-04-05
|
||||
|
||||
package Selima::wov::Processor::Page;
|
||||
use 5.008;
|
||||
use strict;
|
||||
use warnings;
|
||||
use base qw(Selima::Processor::Page);
|
||||
|
||||
use Selima::DataVars qw(:addcol);
|
||||
|
||||
# _save_cols: Save the column deposit
|
||||
sub _save_cols : method {
|
||||
local ($_, %_);
|
||||
my ($self, $form, $cur);
|
||||
$self = $_[0];
|
||||
($form, $cur) = ($self->{"form"}, $self->{"cur"});
|
||||
# A form to create a new item
|
||||
if ($self->{"type"} eq "new") {
|
||||
$self->{"sn"} = $self->_new_sn;
|
||||
$self->{"cols"} = new Selima::AddCol($self->{"table"}, ADDCOL_INSERT);
|
||||
$self->{"cols"}->addnum("sn", $self->{"sn"});
|
||||
$self->{"cols"}->addstr("path", $self->_form("path"));
|
||||
$self->{"cols"}->addnum("ord", $self->_form("ord"));
|
||||
$self->{"cols"}->addstr("title", $self->_form("title"));
|
||||
$self->{"cols"}->addstr("title_en", $self->_form("title_en"));
|
||||
$self->{"cols"}->addstr("body", $self->_form("body"));
|
||||
$self->{"cols"}->addstr("kw", $self->_form("kw"));
|
||||
$self->{"cols"}->addbool("html", $self->_form("html"));
|
||||
$self->{"cols"}->addbool("hid", $self->_form("hid"));
|
||||
# Automatic Traditional Chinese to Simplified Chinese conversion
|
||||
$self->_zhsync;
|
||||
|
||||
# A form to edit a current item
|
||||
} elsif ($self->{"type"} eq "cur") {
|
||||
$self->{"cols"} = new Selima::AddCol($self->{"table"}, ADDCOL_UPDATE);
|
||||
$self->{"cols"}->addstr("path", $self->_form("path"), scalar $cur->param("path"));
|
||||
$self->{"cols"}->addnum("ord", $self->_form("ord"), scalar $cur->param("ord"));
|
||||
$self->{"cols"}->addstr("title", $self->_form("title"), scalar $cur->param("title"));
|
||||
$self->{"cols"}->addstr("title_en", $self->_form("title_en"), scalar $cur->param("title_en"));
|
||||
$self->{"cols"}->addstr("body", $self->_form("body"), scalar $cur->param("body"));
|
||||
$self->{"cols"}->addstr("kw", $self->_form("kw"), scalar $cur->param("kw"));
|
||||
$self->{"cols"}->addbool("html", $self->_form("html"), scalar $cur->param("html"));
|
||||
$self->{"cols"}->addbool("hid", $self->_form("hid"), scalar $cur->param("hid"));
|
||||
# Automatic Traditional Chinese to Simplified Chinese conversion
|
||||
$self->_zhsync;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
return 1;
|
||||
441
htdocs/wov/magicat/lib/perl5/Selima/wov/Rebuild.pm
Normal file
441
htdocs/wov/magicat/lib/perl5/Selima/wov/Rebuild.pm
Normal file
@@ -0,0 +1,441 @@
|
||||
# Woman's Voice
|
||||
# Rebuild.pm: The subroutines to rebuild the web pages.
|
||||
|
||||
# Copyright (c) 2004-2018 imacat.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Author: imacat <imacat@mail.imacat.idv.tw>
|
||||
# First written: 2004-11-02
|
||||
|
||||
package Selima::wov::Rebuild;
|
||||
use 5.008;
|
||||
use utf8;
|
||||
use strict;
|
||||
use warnings;
|
||||
use base qw(Exporter);
|
||||
use vars qw(@EXPORT @EXPORT_OK);
|
||||
BEGIN {
|
||||
@EXPORT = qw(rebuild_all rebuild_pages rebuild_links rebuild_newslets compose_page);
|
||||
@EXPORT_OK = @EXPORT;
|
||||
# Prototype declaration
|
||||
sub rebuild_all();
|
||||
sub rebuild_pages(;$);
|
||||
sub rebuild_links(;$);
|
||||
sub rebuild_newslets(@);
|
||||
sub compose_page($;$);
|
||||
}
|
||||
|
||||
use Data::Dumper qw();
|
||||
use Fcntl qw(:flock);
|
||||
use IO::NestedCapture qw(CAPTURE_STDOUT);
|
||||
|
||||
use Selima::DataVars qw($DBH :output :rebuild);
|
||||
use Selima::GetLang;
|
||||
use Selima::Guest;
|
||||
use Selima::PageFunc;
|
||||
use Selima::ShortCut;
|
||||
|
||||
use Selima::wov::HTML;
|
||||
use Selima::wov::Items;
|
||||
|
||||
use vars qw($PKGL10N);
|
||||
|
||||
# rebuild_all: Rebuild everything
|
||||
sub rebuild_all() {
|
||||
local ($_, %_);
|
||||
# Lock the required tables
|
||||
$DBH->lock(map { $_ => LOCK_SH } @REBUILD_TABLES);
|
||||
# Rebuild the pages
|
||||
rebuild_pages;
|
||||
# Rebuild the links
|
||||
rebuild_links;
|
||||
# Rebuild the newsletters
|
||||
rebuild_newslets;
|
||||
# Rebuild the index
|
||||
# To be done
|
||||
#rebuild_index;
|
||||
return;
|
||||
}
|
||||
|
||||
# rebuild_pages: Rebuild the pages
|
||||
sub rebuild_pages(;$) {
|
||||
local ($_, %_);
|
||||
my ($sql, $sth, $count, $rebuild_everything);
|
||||
my $lang;
|
||||
$sql = $_[0];
|
||||
|
||||
$lang = getlang;
|
||||
|
||||
# Rebuild everything
|
||||
$rebuild_everything = !defined $sql;
|
||||
if ($rebuild_everything) {
|
||||
$sql = "SELECT * FROM pages"
|
||||
. " WHERE NOT hid;\n";
|
||||
}
|
||||
|
||||
$sth = $DBH->prepare($sql);
|
||||
$sth->execute;
|
||||
$count = $sth->rows;
|
||||
# Bounce if no pages to build on a partial rebuild
|
||||
# This prevents needless sitemap rebuilding
|
||||
return if !$rebuild_everything && $count == 0;
|
||||
# Build each page
|
||||
for (my $i = 0; $i < $count; $i++) {
|
||||
my ($page, $html);
|
||||
$page = $sth->fetchrow_hashref;
|
||||
# Read the picture into the picture deposit
|
||||
# To be done
|
||||
|
||||
$html = compose_page($page, $lang);
|
||||
goutpage $html, $$page{"path"}, $lang
|
||||
if defined $html;
|
||||
|
||||
# Output related pictures only when rebuilding everything
|
||||
# To be done
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
# rebuild_links: Rebuild the links
|
||||
sub rebuild_links(;$) {
|
||||
local ($_, %_);
|
||||
my ($sql, $sth, $count, $FD, $rebuild_everything);
|
||||
my ($lang, $args, $html);
|
||||
$sql = $_[0];
|
||||
|
||||
$lang = getlang;
|
||||
|
||||
# Rebuild everything
|
||||
$rebuild_everything = !defined $sql;
|
||||
if ($rebuild_everything) {
|
||||
@_ = $DBH->cols("linkcat");
|
||||
push @_, $DBH->strcat("'/links'", "linkcat_path(sn, id, parent)")
|
||||
. " AS path";
|
||||
$sql = "SELECT " . join(", ", @_) . " FROM linkcat"
|
||||
. " WHERE linkcat_isshown(sn, hid, parent);\n";
|
||||
}
|
||||
|
||||
$sth = $DBH->prepare($sql);
|
||||
$sth->execute;
|
||||
$count = $sth->rows;
|
||||
for (my $i = 0; $i < $count; $i++) {
|
||||
my ($page, $sql1, $sth1, $count1, $row1);
|
||||
$page = $sth->fetchrow_hashref;
|
||||
|
||||
# Find the ancesters
|
||||
@_ = $DBH->cols("linkcat");
|
||||
push @_, $DBH->strcat("'/links'", "linkcat_path(sn, id, parent)")
|
||||
. " AS path";
|
||||
$sql1 = "SELECT " . join(", ", @_) . " FROM linkcat"
|
||||
. " WHERE linkcat_ischild(sn, " . $$page{"sn"} . ")"
|
||||
. " ORDER BY linkcat_fullord(parent, ord);\n";
|
||||
$sth1 = $DBH->prepare($sql1);
|
||||
$sth1->execute;
|
||||
$count1 = $sth1->rows;
|
||||
for (my $i = 0, $$page{"parents"} = []; $i < $count1; $i++) {
|
||||
push @{$$page{"parents"}}, $sth1->fetchrow_hashref;
|
||||
}
|
||||
|
||||
# Find the subcategories
|
||||
@_ = $DBH->cols("linkcat");
|
||||
push @_, $DBH->strcat("'/links'", "linkcat_path(sn, id, parent)")
|
||||
. " AS path";
|
||||
$sql1 = "SELECT " . join(", ", @_) . " FROM linkcat"
|
||||
. " WHERE parent=" . $$page{"sn"}
|
||||
. " AND linkcat_isshown(sn, hid, parent)"
|
||||
. " ORDER BY ord;\n";
|
||||
$sth1 = $DBH->prepare($sql1);
|
||||
$sth1->execute;
|
||||
$count1 = $sth1->rows;
|
||||
for (my $i = 0, $$page{"scats"} = []; $i < $count1; $i++) {
|
||||
my ($sql2, $sth2, $row2);
|
||||
$row1 = $sth1->fetchrow_hashref;
|
||||
# Find the belonging links
|
||||
$sql2 = "SELECT count(linkcatz.sn) AS count FROM linkcatz"
|
||||
. " INNER JOIN links ON linkcatz.link=links.sn"
|
||||
. " INNER JOIN linkcat ON linkcatz.cat=linkcat.sn"
|
||||
. " WHERE linkcatz.cat=" . $$row1{"sn"}
|
||||
. " AND NOT links.hid;\n";
|
||||
$sth2 = $DBH->prepare($sql2);
|
||||
$sth2->execute;
|
||||
$row2 = $sth2->fetchrow_hashref;
|
||||
$$row1{"links"} = $$row2{"count"};
|
||||
push @{$$page{"scats"}}, $row1;
|
||||
}
|
||||
|
||||
# Find the belonging links
|
||||
@_ = map "links.$_", $DBH->cols("links");
|
||||
$sql1 = "SELECT " . join(", ", @_) . " FROM links"
|
||||
. " INNER JOIN linkcatz ON linkcatz.link=links.sn"
|
||||
. " WHERE linkcatz.cat=" . $$page{"sn"}
|
||||
. " AND NOT links.hid;\n";
|
||||
$sth1 = $DBH->prepare($sql1);
|
||||
$sth1->execute;
|
||||
$count1 = $sth1->rows;
|
||||
for (my $i = 0, $$page{"links"} = []; $i < $count1; $i++) {
|
||||
push @{$$page{"links"}}, $sth1->fetchrow_hashref;
|
||||
}
|
||||
|
||||
$html = compose_page($page, $lang);
|
||||
goutpage $html, $$page{"path"}, $lang
|
||||
if defined $html;
|
||||
}
|
||||
|
||||
# Build the root index page
|
||||
@_ = $DBH->cols("linkcat");
|
||||
push @_, $DBH->strcat("'/links'", "linkcat_path(sn, id, parent)")
|
||||
. " AS path";
|
||||
$sql = "SELECT " . join(", ", @_) . " FROM linkcat"
|
||||
. " WHERE parent IS NULL"
|
||||
. " AND linkcat_isshown(sn, hid, parent)"
|
||||
. " ORDER BY ord;\n";
|
||||
$sth = $DBH->prepare($sql);
|
||||
$sth->execute;
|
||||
$count = $sth->rows;
|
||||
for ($_ = 0, @_ = qw(); $_ < $count; $_++) {
|
||||
my ($cat, $sql1, $sth1, $count1);
|
||||
$cat = $sth->fetchrow_hashref;
|
||||
|
||||
# Find the belonging links
|
||||
$sql1 = "SELECT count(linkcatz.sn) AS count FROM linkcatz"
|
||||
. " INNER JOIN links ON linkcatz.link=links.sn"
|
||||
. " INNER JOIN linkcat ON linkcatz.cat=linkcat.sn"
|
||||
. " WHERE linkcatz.cat=" . $$cat{"sn"}
|
||||
. " AND NOT links.hid;\n";
|
||||
$sth1 = $DBH->prepare($sql1);
|
||||
$sth1->execute;
|
||||
$$cat{"links"} = ${$sth1->fetch}[0];
|
||||
|
||||
push @_, $cat;
|
||||
}
|
||||
$ALT_PAGE_PARAM = {
|
||||
"path" => "/links/",
|
||||
"lang" => $lang,
|
||||
"keywords" => __("related links"),
|
||||
"class" => "links",
|
||||
"javascripts" => [qw(/scripts/links.js)],
|
||||
"static" => 1,
|
||||
"all_linguas" => [$lang]};
|
||||
$args = page_param;
|
||||
# Obtain the page
|
||||
IO::NestedCapture->start(CAPTURE_STDOUT);
|
||||
binmode IO::NestedCapture->instance->{"STDOUT_current"}[-1], ":utf8";
|
||||
html_header "女網牽手", "Woman Interconnect", $args;
|
||||
html_links_index @_, $args;
|
||||
html_footer $args;
|
||||
IO::NestedCapture->stop(CAPTURE_STDOUT);
|
||||
$FD = IO::NestedCapture->get_last_out;
|
||||
$html = join "", <$FD>;
|
||||
undef $ALT_PAGE_PARAM;
|
||||
goutpage $html, "/links/", $lang;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
# rebuild_newslets: Rebuild the newsletters
|
||||
sub rebuild_newslets(@) {
|
||||
local ($_, %_);
|
||||
my (@newslets, $sql, $sth, $count, $FD, $rebuild_everything);
|
||||
my ($lang, $args, $html, @allno);
|
||||
@newslets = @_;
|
||||
|
||||
$lang = getlang;
|
||||
|
||||
# Obtain all the pages
|
||||
{
|
||||
my ($sql, $sth, $count);
|
||||
$sql = "SELECT no FROM newslets"
|
||||
. " WHERE NOT hid ORDER BY no;\n";
|
||||
$sth = $DBH->prepare($sql);
|
||||
$sth->execute;
|
||||
$count = $sth->rows;
|
||||
for (my $i = 0, @allno = qw(); $i < $count; $i++) {
|
||||
push @allno, ${$sth->fetch}[0];
|
||||
}
|
||||
undef $sth;
|
||||
}
|
||||
|
||||
# Rebuild everything
|
||||
$rebuild_everything = (@newslets == 0);
|
||||
if ($rebuild_everything) {
|
||||
$sql = "SELECT * FROM newslets"
|
||||
. " WHERE NOT hid ORDER BY no;\n";
|
||||
} else {
|
||||
$_ = join " OR ", map "sn=$_", @newslets;
|
||||
$_ = "($_)" if @newslets > 1;
|
||||
$sql = "SELECT * FROM newslets"
|
||||
. " WHERE $_"
|
||||
. " AND NOT hid"
|
||||
. " ORDER BY no;\n";
|
||||
}
|
||||
|
||||
$sth = $DBH->prepare($sql);
|
||||
$sth->execute;
|
||||
$count = $sth->rows;
|
||||
for (my $i = 0; $i < $count; $i++) {
|
||||
my ($page, $sql1, $sth1, $count1, $row1, $title, $pagebar);
|
||||
$page = $sth->fetchrow_hashref;
|
||||
$$page{"path"} = sprintf "/newsletters/wov%04d.html", $$page{"no"};
|
||||
$title = newslet_textno($$page{"no"}) . " " . $$page{"title"};
|
||||
$$page{"allno"} = [@allno];
|
||||
|
||||
# Find the belonging articles
|
||||
$sql1 = "SELECT * FROM nlarts"
|
||||
. " WHERE newslet=" . $$page{"sn"}
|
||||
. " AND NOT hid"
|
||||
. " ORDER BY ord;\n";
|
||||
$sth1 = $DBH->prepare($sql1);
|
||||
$sth1->execute;
|
||||
$count1 = $sth1->rows;
|
||||
for (my $i = 0, $$page{"arts"} = []; $i < $count1; $i++) {
|
||||
push @{$$page{"arts"}}, $sth1->fetchrow_hashref;
|
||||
}
|
||||
|
||||
$html = compose_page($page, $lang);
|
||||
goutpage $html, $$page{"path"}, $lang;
|
||||
}
|
||||
|
||||
# Build the index page
|
||||
$sql = "SELECT sn, no, date, title FROM newslets"
|
||||
. " WHERE NOT hid ORDER BY no DESC;\n";
|
||||
$sth = $DBH->prepare($sql);
|
||||
$sth->execute;
|
||||
$count = $sth->rows;
|
||||
for ($_ = 0, @_ = qw(); $_ < $count; $_++) {
|
||||
my ($newslet, $sql1, $sth1, $count1);
|
||||
$newslet = $sth->fetchrow_hashref;
|
||||
|
||||
# Find the belonging articles
|
||||
$sql1 = "SELECT title, author FROM nlarts"
|
||||
. " WHERE newslet=" . $$newslet{"sn"}
|
||||
. " AND NOT hid"
|
||||
. " ORDER BY ord;\n";
|
||||
$sth1 = $DBH->prepare($sql1);
|
||||
$sth1->execute;
|
||||
$count1 = $sth1->rows;
|
||||
for (my $i = 0, $$newslet{"arts"} = []; $i < $count1; $i++) {
|
||||
push @{$$newslet{"arts"}}, $sth1->fetchrow_hashref;
|
||||
}
|
||||
|
||||
push @_, $newslet;
|
||||
}
|
||||
$ALT_PAGE_PARAM = {
|
||||
"path" => "/newsletters/",
|
||||
"lang" => $lang,
|
||||
"keywords" => "女聲電子報, 女性主義, 婦運, 性別, 小招, 依瑪貓",
|
||||
"javascripts" => [qw(/scripts/search.js)],
|
||||
"class" => "newsletters",
|
||||
"static" => 1,
|
||||
"all_linguas" => [$lang]};
|
||||
$args = page_param;
|
||||
# Obtain the page
|
||||
IO::NestedCapture->start(CAPTURE_STDOUT);
|
||||
binmode IO::NestedCapture->instance->{"STDOUT_current"}[-1], ":utf8";
|
||||
html_header "女聲各期目錄", "Index of WOVs", $args;
|
||||
html_nl_index @_, $args;
|
||||
html_footer $args;
|
||||
IO::NestedCapture->stop(CAPTURE_STDOUT);
|
||||
$FD = IO::NestedCapture->get_last_out;
|
||||
$html = join "", <$FD>;
|
||||
undef $ALT_PAGE_PARAM;
|
||||
goutpage $html, "/newsletters/", $lang;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
# compose_page: Compose a page
|
||||
sub compose_page($;$) {
|
||||
local ($_, %_);
|
||||
my ($page, $lang, $args, $title_en, $FD);
|
||||
($page, $lang) = @_;
|
||||
$lang = getlang if !defined $lang;
|
||||
|
||||
$ALT_PAGE_PARAM = {
|
||||
"path" => $$page{"path"},
|
||||
"lang" => $lang,
|
||||
"keywords" => $$page{"kw"},
|
||||
"static" => 1,
|
||||
"all_linguas" => [$lang],
|
||||
"no_auto_title" => exists $$page{"no_auto_title"}
|
||||
&& $$page{"no_auto_title"}};
|
||||
$$ALT_PAGE_PARAM{"preview"} = $page
|
||||
if exists $$page{"preview"};
|
||||
if (exists $$page{"class"} && defined $$page{"class"} && $$page{"class"} ne "") {
|
||||
$$ALT_PAGE_PARAM{"class"} = $$page{"class"};
|
||||
} elsif ($$page{"path"} =~ /^\/newsletters\//) {
|
||||
$$ALT_PAGE_PARAM{"class"} = "newsletters";
|
||||
} elsif ($$page{"path"} =~ /^\/links\//) {
|
||||
$$ALT_PAGE_PARAM{"class"} = "links";
|
||||
}
|
||||
if ($$page{"path"} eq "/subscribe.html") {
|
||||
$$ALT_PAGE_PARAM{"javascripts"} = ["/scripts/subscribe.js"];
|
||||
}
|
||||
$args = page_param;
|
||||
$title_en = exists $$page{"title_en"} && defined $$page{"title_en"}?
|
||||
$$page{"title_en"}: undef;
|
||||
|
||||
# Special rules for newsletters
|
||||
if ($$page{"path"} =~ /^\/newsletters\/wov\d{4}\.html$/) {
|
||||
$$args{"no_auto_title"} = 1;
|
||||
|
||||
# The relative pages
|
||||
$$args{"first"} = sprintf "/newsletters/wov%04d.html", ${$$page{"allno"}}[0];
|
||||
for ($_ = 0; $_ < @{$$page{"allno"}}; $_++) {
|
||||
last if ${$$page{"allno"}}[$_] == $$page{"no"};
|
||||
}
|
||||
$$args{"prev"} = sprintf "/newsletters/wov%04d.html", ${$$page{"allno"}}[$_ - 1]
|
||||
if $_ > 0;
|
||||
$$args{"next"} = sprintf "/newsletters/wov%04d.html", ${$$page{"allno"}}[$_ + 1]
|
||||
if $_ < $#{$$page{"allno"}};
|
||||
$$args{"last"} = sprintf "/newsletters/wov%04d.html", ${$$page{"allno"}}[$#{$$page{"allno"}}];
|
||||
|
||||
# Obtain the page bar
|
||||
IO::NestedCapture->start(CAPTURE_STDOUT);
|
||||
binmode IO::NestedCapture->instance->{"STDOUT_current"}[-1], ":utf8";
|
||||
html_nl_pagebar $_, @{$$page{"allno"}}, $args;
|
||||
IO::NestedCapture->stop(CAPTURE_STDOUT);
|
||||
$FD = IO::NestedCapture->get_last_out;
|
||||
$_ = join "", <$FD>;
|
||||
if ($_ ne "") {
|
||||
$$args{"header_html_nav"} = $_;
|
||||
$$args{"footer_html_nav"} = $_;
|
||||
}
|
||||
}
|
||||
|
||||
# Obtain the page
|
||||
IO::NestedCapture->start(CAPTURE_STDOUT);
|
||||
binmode IO::NestedCapture->instance->{"STDOUT_current"}[-1], ":utf8";
|
||||
html_header $$page{"title"}, $title_en, $args;
|
||||
if ($$page{"path"} =~ /^\/newsletters\/wov\d{4}\.html$/) {
|
||||
html_title "女聲", "Woman’s Voice";
|
||||
html_newslet $page, $args;
|
||||
} elsif ($$page{"path"} =~ /^\/links\/$/) {
|
||||
#html_links_index $page, $args;
|
||||
} elsif ($$page{"path"} =~ /^\/links\/.+$/) {
|
||||
html_links $page, $args;
|
||||
} else {
|
||||
html_body $page, $args;
|
||||
}
|
||||
html_footer $args;
|
||||
IO::NestedCapture->stop(CAPTURE_STDOUT);
|
||||
$FD = IO::NestedCapture->get_last_out;
|
||||
$_ = join "", <$FD>;
|
||||
|
||||
undef $ALT_PAGE_PARAM;
|
||||
return $_;
|
||||
}
|
||||
|
||||
no utf8;
|
||||
return 1;
|
||||
1468
htdocs/wov/magicat/lib/wov-semina.sql
Normal file
1468
htdocs/wov/magicat/lib/wov-semina.sql
Normal file
File diff suppressed because it is too large
Load Diff
1171
htdocs/wov/magicat/lib/wov.sql
Normal file
1171
htdocs/wov/magicat/lib/wov.sql
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user