[TASK] Verify compatibility with TYPO3 6.2 77/29977/2
authorFrancois Suter <francois@typo3.org>
Fri, 9 May 2014 14:33:51 +0000 (16:33 +0200)
committerFrancois Suter <francois@typo3.org>
Fri, 9 May 2014 14:35:46 +0000 (16:35 +0200)
Nothing special to do.

Fixed line endings in one sample file.

Resolves: #58680
Releases: 1.4
Change-Id: Iea0fdb602a9942fda0dd51bdd51a81147b6851da
Reviewed-on: https://review.typo3.org/29977
Reviewed-by: Francois Suter
Tested-by: Francois Suter
ChangeLog
Samples/Advanced.php
ext_emconf.php

index 5aa5fb4..c5dad24 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-05-09 Francois Suter (Cobweb)  <typo3@cobweb.ch>
+
+       * Verified compatibility with TYPO3 CMS 6.2, resolves #58680
+
 2013-06-21 Francois Suter (Cobweb)  <typo3@cobweb.ch>
 
        * Released to TER as version 1.3.0
index e5bd34c..cd3502e 100644 (file)
@@ -1 +1,238 @@
-<?php\r\r// Parameters\r$parameters = t3lib_div::_GP('tx_displaycontroller');\r\r// Default language of this website is 'fr'\r$language = 'fr';\rif (!empty($GLOBALS['TSFE']->tmpl->setup['config.']['language'])) {\r $language = $GLOBALS['TSFE']->tmpl->setup['config.']['language'];\r}\r\rsaveParameters($parameters);\r?>\r\r<h2><?php translate('search_result') ?></h2>\r\r<div class="row-fluid">\r    <div class="span4">\r            <?php numberOfResults($datastructure, $filter); ?>\r     </div>\r <div class="span8 pull-right">\r         <?php pageBrowser($datastructure, $filter); ?>\r </div>\r</div>\r\r<table class="table table-striped">\r     <thead>\r        <tr>\r           <th><?php translate('title');?></th>\r           <th><?php translate('location');?></th>\r                <th><?php translate('type');?></th>\r            <th><?php translate('companyType');?></th>\r             <th>\r                   <a href="<?php linkSort() ?>">\r                         <?php translate('date');?>\r                             <?php if ($parameters['sort'] == 'job_publicationdate' && $parameters['order'] == 'desc'): ?>\r                          <?php image('bullet_arrow_down.png'); ?>\r                               <?php elseif ($parameters['sort'] == 'job_publicationdate' && $parameters['order'] == 'asc'): ?>\r                               <?php image('bullet_arrow_up.png'); ?>\r                         <?php endif ?>\r                 </a>\r           </th>\r  </tr>\r  </thead>\r       <tbody>\r        <?php foreach ($datastructure['tx_manpower_jobs']['records'] as $job): ?>\r      <tr>\r           <td>\r                   <a href="<?php linkToDetail($job['uid']) ?>">\r                          <?php print $job['job_name'] ?>\r                        </a>\r           </td>\r          <td><?php puts($job, 'job_workingplace') ?></td>\r               <td><?php puts($job['__substructure']['tx_manpower_jobtypes']['records'][0], 'jobtype_name_' . $language); ?></td>\r             <td><?php puts($job['__substructure']['tx_manpower_businesssectors']['records'][0], 'businesssector_name_' . $language); ?></td>\r               <td><?php putsDate($job, 'job_publicationdate') ?></td>\r        </tr>\r          <?php endforeach ?>\r    </tbody>\r</table>\r\r\r<?php\r\r/**\r * Helper function for translating a key\r *\r * @param string $key\r */\rfunction translate($key) {\r        $extensionName = 'manpower_searchform';\r        print Tx_Extbase_Utility_Localization::translate($key, $extensionName);\r}\r\r/**\r * Helper function for displaying a key of a record\r *\r * @param array $record\r * @param string $key\r */\rfunction puts($record, $key) {\r if (!empty($record[$key])) {\r           print $record[$key];\r   }\r}\r\r/**\r * Helper function for displaying a key of a record\r *\r * @param array $record\r * @param string $key\r */\rfunction putsDate($record, $key) {\r   if (!empty($record[$key])) {\r           $value = $record[$key];\r                print date("d.m.Y", $value);\r   }\r}\r\r/**\r * Helper function for display an image from default location\r *\r * @param string $key\r */\rfunction image($key) {\r     $image = '<img src="/fileadmin/templates/general/images/%s" alt="" />';\r        print sprintf($image, $key);\r\r}\r\r/**\r * Helper function for displaying a key of a record\r */\rfunction linkSort() {\r\r    // Parameters\r  $parameters = t3lib_div::_GP('tx_displaycontroller');\r\r // Set default sorting value\r   if (empty($parameters['sort'])) {\r              $parameters['sort'] = 'job_publicationdate';\r   }\r\r     // Set ordering value\r  if (!empty($parameters['order']) && $parameters['order'] == 'asc') {\r           $parameters['order'] = 'desc';\r } else {\r               $parameters['order'] = 'asc';\r  }\r\r     $additionalParams = '';\r        foreach ($parameters as $parameter => $value) {\r                $additionalParams .= sprintf("&tx_displaycontroller[%s]=%s", $parameter, $value);\r      }\r\r     /** @var $contentObject tslib_cObj */\r  $contentObject = $GLOBALS['TSFE']->cObj;\r       $config['returnLast'] = 'url';\r $config['parameter'] = $GLOBALS['TSFE']->id;\r   $config['additionalParams'] = $additionalParams;\r       print $contentObject->typolink('', $config);\r}\r\r/**\r * @param $uid\r */\rfunction linkToDetail($uid) {\r   /** @var $contentObject tslib_cObj */\r  $contentObject = $GLOBALS['TSFE']->cObj;\r       $config = array();\r     $config['returnLast'] = 'url';\r $config['parameter'] = 314;\r    $config['useCacheHash'] = 1;\r   $config['additionalParams'] = '&tx_displaycontroller[job]=' . $uid;\r    print $contentObject->typolink('', $config);\r}\r\r/**\r * @param array $datastructure\r * @param array $filter\r */\rfunction numberOfResults($datastructure, $filter) {\r     $extensionName = 'manpower_searchform';\r\r       $total = $datastructure['tx_manpower_jobs']['totalCount'];\r     if ($datastructure['tx_manpower_jobs']['totalCount'] > ($filter['limit']['offset'] + 1) * $filter['limit']['max']) {\r           $total = ($filter['limit']['offset'] + 1) * $filter['limit']['max'];\r   }\r\r     print sprintf('%s %d-%d %s %d',\r                Tx_Extbase_Utility_Localization::translate('advertisements', $extensionName),\r          $filter['limit']['offset'] * $filter['limit']['max'] + 1,\r              $total,\r                Tx_Extbase_Utility_Localization::translate('on', $extensionName),\r              $datastructure['tx_manpower_jobs']['totalCount']\r       );\r}\r\r/**\r * Helper function to display the page browser\r *\r * @param array $datastructure\r * @param array $filter\r */\rfunction pageBrowser($datastructure, $filter) {\r\r        /** @var $contentObject tslib_cObj */\r  $contentObject = $GLOBALS['TSFE']->cObj;\r       $conf = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_pagebrowse_pi1.'];\r        $conf['pageParameterName'] = 'tx_displaycontroller|page';\r\r     // Adds limit to the query and calculates the number of pages.\r if ($filter['limit']['max'] != '' && $filter['limit']['max'] != '0') {\r\r                // Defines other possible pagebrowse configuration options\r             $conf['templateFile'] = 'fileadmin/templates/general/ext/pagebrowse_job.html';\r         $conf['numberOfPages'] = ceil($datastructure['tx_manpower_jobs']['totalCount'] / $filter['limit']['max']);\r             $conf['items_per_page'] = $filter['limit']['max'];\r             $conf['disableCacheHash'] = TRUE;\r              $conf['total_items'] = $datastructure['tx_manpower_jobs']['totalCount'];\r               $conf['total_pages'] = $conf['numberOfPages']; // duplicated, because $conf['numberOfPages'] is protected\r      } else {\r               $conf['numberOfPages'] = 1;\r    }\r\r     print $contentObject->cObjGetSingle('USER', $conf);\r}\r\r/**\r * Save parameters in Session\r *\r * NOTICE: One could argue Tesseract offers a mechanism to store filter in session as well\r * However, it turned out to be fairly complicated to write the correct syntax.\r * Consider the key below which contains a "0" index which is influenced by the position of the filter.\r *\r * E.g job_search|filters|score|0|value\r *\r * This could quickly become  error-prone.\r *\r * @param $parameters Array The parameters coming from the URL\r */\rfunction saveParameters($parameters) {\r   /** @var $user tslib_feUserAuth */\r     $user = $GLOBALS['TSFE']->fe_user;\r\r    if (empty($parameters['sort'])) {\r              $parameters['sort'] = 'no_filter.score';\r               $parameters['order'] = '';\r     }\r\r     $values = array();\r     foreach ($parameters as $parameter => $value) {\r                $values['filters'][$parameter] = $value;\r       }\r      $user->setKey('ses', 'job_search', $values);\r}\r\r?>
\ No newline at end of file
+<?php
+
+// Parameters
+$parameters = t3lib_div::_GP('tx_displaycontroller');
+
+// Default language of this website is 'fr'
+$language = 'fr';
+if (!empty($GLOBALS['TSFE']->tmpl->setup['config.']['language'])) {
+       $language = $GLOBALS['TSFE']->tmpl->setup['config.']['language'];
+}
+
+saveParameters($parameters);
+?>
+
+<h2><?php translate('search_result') ?></h2>
+
+<div class="row-fluid">
+       <div class="span4">
+               <?php numberOfResults($datastructure, $filter); ?>
+       </div>
+       <div class="span8 pull-right">
+               <?php pageBrowser($datastructure, $filter); ?>
+       </div>
+</div>
+
+<table class="table table-striped">
+       <thead>
+       <tr>
+               <th><?php translate('title');?></th>
+               <th><?php translate('location');?></th>
+               <th><?php translate('type');?></th>
+               <th><?php translate('companyType');?></th>
+               <th>
+                       <a href="<?php linkSort() ?>">
+                               <?php translate('date');?>
+                               <?php if ($parameters['sort'] == 'job_publicationdate' && $parameters['order'] == 'desc'): ?>
+                               <?php image('bullet_arrow_down.png'); ?>
+                               <?php elseif ($parameters['sort'] == 'job_publicationdate' && $parameters['order'] == 'asc'): ?>
+                               <?php image('bullet_arrow_up.png'); ?>
+                               <?php endif ?>
+                       </a>
+               </th>
+       </tr>
+       </thead>
+       <tbody>
+       <?php foreach ($datastructure['tx_employer_jobs']['records'] as $job): ?>
+       <tr>
+               <td>
+                       <a href="<?php linkToDetail($job['uid']) ?>">
+                               <?php print $job['job_name'] ?>
+                       </a>
+               </td>
+               <td><?php puts($job, 'job_workingplace') ?></td>
+               <td><?php puts($job['__substructure']['tx_employer_jobtypes']['records'][0], 'jobtype_name_' . $language); ?></td>
+               <td><?php puts($job['__substructure']['tx_employer_businesssectors']['records'][0], 'businesssector_name_' . $language); ?></td>
+               <td><?php putsDate($job, 'job_publicationdate') ?></td>
+       </tr>
+               <?php endforeach ?>
+       </tbody>
+</table>
+
+
+<?php
+
+/**
+ * Helper function for translating a key
+ *
+ * @param string $key
+ */
+function translate($key) {
+       $extensionName = 'employer_searchform';
+       print Tx_Extbase_Utility_Localization::translate($key, $extensionName);
+}
+
+/**
+ * Helper function for displaying a key of a record
+ *
+ * @param array $record
+ * @param string $key
+ */
+function puts($record, $key) {
+       if (!empty($record[$key])) {
+               print $record[$key];
+       }
+}
+
+/**
+ * Helper function for displaying a key of a record
+ *
+ * @param array $record
+ * @param string $key
+ */
+function putsDate($record, $key) {
+       if (!empty($record[$key])) {
+               $value = $record[$key];
+               print date("d.m.Y", $value);
+       }
+}
+
+/**
+ * Helper function for display an image from default location
+ *
+ * @param string $key
+ */
+function image($key) {
+       $image = '<img src="/fileadmin/templates/general/images/%s" alt="" />';
+       print sprintf($image, $key);
+
+}
+
+/**
+ * Helper function for displaying a key of a record
+ */
+function linkSort() {
+
+       // Parameters
+       $parameters = t3lib_div::_GP('tx_displaycontroller');
+
+       // Set default sorting value
+       if (empty($parameters['sort'])) {
+               $parameters['sort'] = 'job_publicationdate';
+       }
+
+       // Set ordering value
+       if (!empty($parameters['order']) && $parameters['order'] == 'asc') {
+               $parameters['order'] = 'desc';
+       } else {
+               $parameters['order'] = 'asc';
+       }
+
+       $additionalParams = '';
+       foreach ($parameters as $parameter => $value) {
+               $additionalParams .= sprintf("&tx_displaycontroller[%s]=%s", $parameter, $value);
+       }
+
+       /** @var $contentObject tslib_cObj */
+       $contentObject = $GLOBALS['TSFE']->cObj;
+       $config['returnLast'] = 'url';
+       $config['parameter'] = $GLOBALS['TSFE']->id;
+       $config['additionalParams'] = $additionalParams;
+       print $contentObject->typolink('', $config);
+}
+
+/**
+ * @param $uid
+ */
+function linkToDetail($uid) {
+       /** @var $contentObject tslib_cObj */
+       $contentObject = $GLOBALS['TSFE']->cObj;
+       $config = array();
+       $config['returnLast'] = 'url';
+       $config['parameter'] = 314;
+       $config['useCacheHash'] = 1;
+       $config['additionalParams'] = '&tx_displaycontroller[job]=' . $uid;
+       print $contentObject->typolink('', $config);
+}
+
+/**
+ * @param array $datastructure
+ * @param array $filter
+ */
+function numberOfResults($datastructure, $filter) {
+       $extensionName = 'employer_searchform';
+
+       $total = $datastructure['tx_employer_jobs']['totalCount'];
+       if ($datastructure['tx_employer_jobs']['totalCount'] > ($filter['limit']['offset'] + 1) * $filter['limit']['max']) {
+               $total = ($filter['limit']['offset'] + 1) * $filter['limit']['max'];
+       }
+
+       print sprintf('%s %d-%d %s %d',
+               Tx_Extbase_Utility_Localization::translate('advertisements', $extensionName),
+               $filter['limit']['offset'] * $filter['limit']['max'] + 1,
+               $total,
+               Tx_Extbase_Utility_Localization::translate('on', $extensionName),
+               $datastructure['tx_employer_jobs']['totalCount']
+       );
+}
+
+/**
+ * Helper function to display the page browser
+ *
+ * @param array $datastructure
+ * @param array $filter
+ */
+function pageBrowser($datastructure, $filter) {
+
+       /** @var $contentObject tslib_cObj */
+       $contentObject = $GLOBALS['TSFE']->cObj;
+       $conf = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_pagebrowse_pi1.'];
+       $conf['pageParameterName'] = 'tx_displaycontroller|page';
+
+       // Adds limit to the query and calculates the number of pages.
+       if ($filter['limit']['max'] != '' && $filter['limit']['max'] != '0') {
+
+               // Defines other possible pagebrowse configuration options
+               $conf['templateFile'] = 'fileadmin/templates/general/ext/pagebrowse_job.html';
+               $conf['numberOfPages'] = ceil($datastructure['tx_employer_jobs']['totalCount'] / $filter['limit']['max']);
+               $conf['items_per_page'] = $filter['limit']['max'];
+               $conf['disableCacheHash'] = TRUE;
+               $conf['total_items'] = $datastructure['tx_employer_jobs']['totalCount'];
+               $conf['total_pages'] = $conf['numberOfPages']; // duplicated, because $conf['numberOfPages'] is protected
+       } else {
+               $conf['numberOfPages'] = 1;
+       }
+
+       print $contentObject->cObjGetSingle('USER', $conf);
+}
+
+/**
+ * Save parameters in Session
+ *
+ * NOTICE: One could argue Tesseract offers a mechanism to store filter in session as well
+ * However, it turned out to be fairly complicated to write the correct syntax.
+ * Consider the key below which contains a "0" index which is influenced by the position of the filter.
+ *
+ * E.g job_search|filters|score|0|value
+ *
+ * This could quickly become  error-prone.
+ *
+ * @param $parameters Array The parameters coming from the URL
+ */
+function saveParameters($parameters) {
+       /** @var $user tslib_feUserAuth */
+       $user = $GLOBALS['TSFE']->fe_user;
+
+       if (empty($parameters['sort'])) {
+               $parameters['sort'] = 'no_filter.score';
+               $parameters['order'] = '';
+       }
+
+       $values = array();
+       foreach ($parameters as $parameter => $value) {
+               $values['filters'][$parameter] = $value;
+       }
+       $user->setKey('ses', 'job_search', $values);
+}
+
+?>
\ No newline at end of file
index 4364a2b..af0a0a3 100644 (file)
@@ -28,22 +28,22 @@ $EM_CONF[$_EXTKEY] = array (
   'lockType' => '',
   'author_company' => '',
   'version' => '1.3.0',
-  'constraints' => 
+  'constraints' =>
   array (
-    'depends' => 
+    'depends' =>
     array (
-      'typo3' => '4.5.0-6.1.99',
+      'typo3' => '4.5.0-6.2.99',
       'tesseract' => '1.7.0-0.0.0',
     ),
-    'conflicts' => 
+    'conflicts' =>
     array (
     ),
-    'suggests' => 
+    'suggests' =>
     array (
     ),
   ),
   '_md5_values_when_last_written' => 'a:16:{s:9:"ChangeLog";s:4:"3b70";s:10:"README.txt";s:4:"b948";s:23:"class.tx_phpdisplay.php";s:4:"e02b";s:32:"class.tx_phpdisplay_template.php";s:4:"1b68";s:16:"ext_autoload.php";s:4:"cb29";s:12:"ext_icon.gif";s:4:"9530";s:12:"ext_icon.png";s:4:"55ad";s:17:"ext_localconf.php";s:4:"fa6b";s:14:"ext_tables.php";s:4:"df7a";s:14:"ext_tables.sql";s:4:"b2b4";s:44:"Configuration/TCA/tx_phpdisplay_displays.php";s:4:"adef";s:43:"Resources/Private/Language/locallang_db.xml";s:4:"683d";s:50:"Resources/Public/images/tx_phpdisplay_displays.png";s:4:"55ad";s:14:"doc/manual.pdf";s:4:"f117";s:14:"doc/manual.sxw";s:4:"f7bf";s:17:"samples/dummy.php";s:4:"55a6";}',
-  'suggests' => 
+  'suggests' =>
   array (
   ),
   'comment' => 'Compatibility with TYPO3 6.0 and 6.1; FAL support.',