.. You may want to use the usual include line. Uncomment and adjust the path. .. include:: ../Includes.txt ==================================== EXT: Table for Connector service SQL ==================================== :Created: 2010-02-18T17:33:18 :Changed by: Tomasz Krawczyk :Changed: 2013-08-20T12:08:40.390000000 :Classification: tk_svconsql_table :Keywords: external database, table, connector, service, sql, adodb, forAdmins, forDevelopers, forAdvanced :Author: Tomasz Krawczyk :Email: tomasz@typo3.pl :Info 4: :Language: en |img-1| |img-2| EXT: Table for Connector service SQL - tk\_svconsql\_table .. _EXT-Table-for-Connector-service-SQL: EXT: Table for Connector service SQL ==================================== Extension Key: tk\_svconsql\_table Language: en Keywords: external database, table, connector, service, sql, adodb, forAdmins, forDevelopers, forAdvanced Copyright 2013, Tomasz Krawczyk, This document is published under the Open Content License available from http://www.opencontent.org/opl.shtml The content of this document is related to TYPO3 \- a GNU/GPL CMS/Framework available from www.typo3.org .. _Table-of-Contents: Table of Contents ----------------- `EXT: Table for Connector service SQL 1 <#__RefHeading__596_1075316393>`_ **`Introduction 3 <#__RefHeading__598_1075316393>`_** `What does it do? 3 <#__RefHeading__600_1075316393>`_ `Features list 3 <#__RefHeading__1217_1368080041>`_ `Requirements 3 <#__RefHeading__1219_1368080041>`_ **`Users manual 4 <#__RefHeading__604_1075316393>`_** `Installation 4 <#__RefHeading__1221_1368080041>`_ `Usage 4 <#__RefHeading__1223_1368080041>`_ **`Configuration 6 <#__RefHeading__612_1075316393>`_** `Reference 6 <#__RefHeading__1225_1368080041>`_ **`Bug reports 8 <#__RefHeading__783_998949593>`_** .. _Introduction: Introduction ------------ .. _What-does-it-do: What does it do? ^^^^^^^^^^^^^^^^ This extension builds simple HTML table from data taken from an external database. For the connection with other databases extensions Connector SQL service and ADOdb are used. .. _Features-list: Features list ^^^^^^^^^^^^^ - You can define table class, caption, row and column classes, border, cellpadding and cellspacing. - You can hide some of cols. - Customizable data formatting. Additionally, you can use hook for extended formating. - Supports output caching with Caching Framework. - Caption can be taken from the first field of the first row of the SQL query result. - Database settings, table settings and caching settings configurable through TypoScript or FlexForm. .. _Requirements: Requirements ^^^^^^^^^^^^ This extension requires extensions: ADOdb (adodb), Connector Services (svconnector), Connector service - SQL (svconnector\_sql) to be installed. .. _Users-manual: Users manual ------------ .. _Installation: Installation ^^^^^^^^^^^^ - Download and install with Extension Manager. - Include extension static template - “Table for Connector service SQL (tk\_svconsql\_table)”. - Configure plugin TypoScript settings or configure settings on a page by the FlexForm. (The FlexForm settings are overwriting TypoScript settings). If you are using TYPO3 v4.5 then you have to turn on Caching Framework in your localconf.php by adding: :: $TYPO3_CONF_VARS['SYS']['useCachingFramework'] = true; .. _Usage: Usage ^^^^^ - In the Page module add General Plugin. - Go to the Plugin sheet and select plugin: Table for Connector SQL. - Go again to the Plugin sheet and fill plugin options. .. _Database-sheet: Database sheet """""""""""""" All fields on this sheet must be filled except field “init”. |img-3| Fetch mode field may have “Both” value. This extension doesn't work good if both values are send. In case of “mysql” database driver you may see repeated table balues. In general you have to test how it works with your db driver. .. _Table-sheet: Table sheet """"""""""" On this sheet you can set some table parameters. Most fields are self explanatory. - Column names list - coma delimited list. Column names used in table header. - Column formats list – coma delimited list. List of column data formats. Available formats are: string, int, dec, date and time. String is the default so you can skip the “string” name. - List of hidden column numbers - coma delimited list, starting from zero. - Row classes and Column classes – coma delimited list of classes. - Caption in first column – if you select this then table caption will be taken from the first field of the first row. Value of the Caption field will not be used. - Number of column containing change. Values fom this column are compared to 0. You can use this for additional styling. I used this in the table presenting quotations data. Values bigger than 0 was green color, lower than zero was red and values equal 0 was blue ;-) See formatOutputHook hook. .. _Cache-sheet: Cache sheet """"""""""" Here you can only set amount of seconds the output table is kept in cache (caching lifetime). .. _Configuration: Configuration ------------- .. _Reference: Reference ^^^^^^^^^ plugin.tx\_tksvconsqltable\_pi1.formatting .. ### BEGIN~OF~TABLE ### .. _dateFormat: dateFormat """""""""" .. container:: table-row Property dateFormat Data type string Description Date format for PHP function date(). Default Y-m-d .. _timeFormat: timeFormat """""""""" .. container:: table-row Property timeFormat Data type string Description Time format for PHP function date(). Default G:i .. _decimals: decimals """""""" .. container:: table-row Property decimals Data type string Description Number of decimals for PHP function number\_format(). Default 0 .. _dec-point: dec\_point """""""""" .. container:: table-row Property dec\_point Data type string Description Decimal separator for PHP function number\_format(). Default . .. _thousands-sep: thousands\_sep """""""""""""" .. container:: table-row Property thousands\_sep Data type string Description Thousands separator for PHP function number\_format(). Special value “space” can be used if you want to use this char as thousands separator. Default , .. ###### END~OF~TABLE ###### plugin.tx\_tksvconsqltable\_pi1.db .. ### BEGIN~OF~TABLE ### .. _driver: driver """""" .. container:: table-row Property driver Data type string Description Supported by ADOdb database driver name Default .. _server: server """""" .. container:: table-row Property server Data type string Description Server name Default .. _user: user """" .. container:: table-row Property user Data type string Description Database user name Default .. _password: password """""""" .. container:: table-row Property password Data type string Description Database user password. **NOTE!** Password is stored not encrypted. Default .. _database: database """""""" .. container:: table-row Property database Data type string Description Name of the database Default .. _query: query """"" .. container:: table-row Property query Data type string Description SQL query Default .. _init: init """" .. container:: table-row Property init Data type string Description DB initialization parameters. F.e. “SET NAMES utf8;” Default .. _fetchMode: fetchMode """"""""" .. container:: table-row Property fetchMode Data type Integer Description Defines result table type. Available are default, numerical, associative and both. Default 0 (default) .. ###### END~OF~TABLE ###### plugin.tx\_tksvconsqltable\_pi1.table .. ### BEGIN~OF~TABLE ### .. _templateFile: templateFile """""""""""" .. container:: table-row Property templateFile Data type String Description Path to HTML table template Default res/template.html .. _Border: Border """""" .. container:: table-row Property Border Data type Integer Description Table border Default 1 .. _cellPadding: cellPadding """"""""""" .. container:: table-row Property cellPadding Data type integer Description Table celppadding parameter Default 2 .. _cellspasing: cellspasing """"""""""" .. container:: table-row Property cellspasing Data type integer Description Table celpspacing parameter Default 1 .. _class: class """"" .. container:: table-row Property class Data type string Description Table CSS class name Default .. _caption: caption """"""" .. container:: table-row Property caption Data type string Description Table caption Default .. _caption-as-span: caption\_as\_span """"""""""""""""" .. container:: table-row Property caption\_as\_span Data type Integer Description Caption will be drawn before table in span Default 0 .. _colNames: colNames """""""" .. container:: table-row Property colNames Data type string Description Coma delimited list of column names – header. **NOTE!** Amount of column names must be equal to amount of column formats. Default .. _colFormats: colFormats """""""""" .. container:: table-row Property colFormats Data type string Description Coma delimited list of column formats which are used for date formatting. Available formats are: string, int, dec, date, time. Empty fields will be treated as strings. **NOTE!** Amount of column formats must be equal to amount of column names. Default .. _hiddenCols: hiddenCols """""""""" .. container:: table-row Property hiddenCols Data type string Description Coma delimited list of column numbers. Beginning from zero. Default .. _rowClasses: rowClasses """""""""" .. container:: table-row Property rowClasses Data type string Description Coma delimited list of row classes Default even,odd .. _colClasses: colClasses """""""""" .. container:: table-row Property colClasses Data type string Description Coma delimited list of column CSS classes Default .. _captionInFirstCol: captionInFirstCol """"""""""""""""" .. container:: table-row Property captionInFirstCol Data type boolean Description Set it to 1 if you want have table caption in the first field of the first row. **NOTE!** Caption parameter will not be used. Default 0 .. _change-col: change\_col """"""""""" .. container:: table-row Property change\_col Data type Integer Description Number of column containing value compared to zero. Default .. ###### END~OF~TABLE ###### lugin.tx\_tksvconsqltable\_pi1.cache .. ### BEGIN~OF~TABLE ### .. _lifetime: lifetime """""""" .. container:: table-row Property lifetime Data type integer Description Amount of seconds for output caching Default 3600 .. ###### END~OF~TABLE ###### .. _generated: ((generated)) """"""""""""" .. _Example: Example ~~~~~~~ :: page = PAGE page.typeNum = 0 page.10 < plugin.tx_tksvconsqltable_pi1 page.10 { cache.lifetime = 3600 formating { dateFormat = Y-m-d timeFormat = G:i decimals = 4 dec_point = . thousands_sep = , } db { driver = mssql server = 10.20.30.40 user = SomeUser password = your-secret-password database = SomeDB query = select field1, field2, field3 from sometable init > fetchMode = 1 } table { cellPadding = 2 cellSpacing = 1 class = someTableClass caption = This is my table colNames = Field1 Title, Field2 Title, Field3 Title, Field4 Title colFormats = ,date,time,dec hiddenCols = 1 rowClasses = ,alt colClasses = ,f1,f2,f3 captionInFirstCol = 0 change_col > } } .. _Bug-reports: Bug reports ----------- Report them here: `http://forge.typo3.org/projects/extension- tk\_svconsql\_table/issues `_ |img-2| 8 .. ######CUTTER_MARK_IMAGES###### .. |img-1| image:: img-1.png .. :align: left .. |img-2| image:: img-2.png .. :border: 0 .. :height: 21 .. :hspace: 9 .. :id: Grafik2 .. :name: Grafik2 .. :width: 87 .. |img-3| image:: img-3.png .. :align: left .. :border: 0 .. :height: 482 .. :id: grafika2 .. :name: grafika2 .. :width: 454