Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n #263

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open

i18n #263

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ docker/data/*
docker/persist/*
vendor/*
attachments/*
distr/*
temp/*
21 changes: 21 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
DirectoryIndex index.php

#RewriteEngine On
#RewriteBase /
#RewriteRule ^(.*)$ /index.php?$1 [L,QSA]
#RewriteRule . /index.php [L]

<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ats/index.php?route=$1 [L,QSA]
</IfModule>

<FilesMatch "\.(js)$">
AddHandler application/x-httpd-php .js
</FilesMatch>
#<FilesMatch "\.(css)$">
#AddHandler application/x-httpd-php .css
#</FilesMatch>
1 change: 1 addition & 0 deletions INSTALL_BLOCKs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This file prevents the installer from running. Remove this file to edit or reset your CATS installation.
12 changes: 10 additions & 2 deletions QueueCLI.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
ob_start();
/*
* CATS
* Asynchroneous Queue Processor
Expand Down Expand Up @@ -50,6 +51,7 @@
include_once('./lib/TemplateUtility.php'); /* Depends: ModuleUtility, Hooks */
include_once('./lib/QueueProcessor.php');
include_once('./modules/queue/constants.php');
//include_once('./ats/sys/globalFuncs.php');

/* Give the session a unique name to avoid conflicts and start the session. */
@session_name(CATS_SESSION_NAME);
Expand All @@ -76,6 +78,9 @@
$taskedModules = ModuleUtility::registerModuleTasks();

print_r($taskedModules);
//vd(array(
// '$taskedModules'=>$taskedModules,
//));

// Execute the next appropriate (if available) queue and return a status code
$retVal = QueueProcessor::startNextTask();
Expand All @@ -98,7 +103,7 @@
QueueProcessor::cleanUpOldQueues();
}

echo "CATS Queue Processor status: ";
echo "ATS Queue Processor status: ";
switch($retVal)
{
case TASKRET_ERROR:
Expand All @@ -118,5 +123,8 @@
break;
}
echo "\n";
$cnt = ob_get_contents();
ob_end_clean();
echo $cnt;
file_put_contents(dirname(__FILE__).'/queue.log',$cnt);

?>
148 changes: 12 additions & 136 deletions ajax.php
Original file line number Diff line number Diff line change
@@ -1,136 +1,12 @@
<?php
/*
* CATS
* AJAX Delegation Module
*
* CATS Version: 0.9.4 Countach
*
* Copyright (C) 2005 - 2007 Cognizo Technologies, Inc.
*
*
* The contents of this file are subject to the CATS Public License
* Version 1.1a (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.catsone.com/.
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is "CATS Standard Edition".
*
* The Initial Developer of the Original Code is Cognizo Technologies, Inc.
* Portions created by the Initial Developer are Copyright (C) 2005 - 2007
* (or from the year in which this file was created to the year 2007) by
* Cognizo Technologies, Inc. All Rights Reserved.
*
*
* A properly formatted POST string will look like this:
*
* f=myFunction&arg=myArgument&...
*
*
* $Id: ajax.php 3431 2007-11-06 21:10:12Z will $
*/


include_once('./config.php');
include_once('./constants.php');
include_once('./lib/DatabaseConnection.php');
include_once('./lib/Session.php'); /* Depends: MRU, Users, DatabaseConnection. */
include_once('./lib/AJAXInterface.php');
include_once('./lib/CATSUtility.php');


header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');

/* Make sure we aren't getting screwed over by magic quotes. */
if (get_magic_quotes_runtime())
{
set_magic_quotes_runtime(0);
}
if (get_magic_quotes_gpc())
{
$_GET = array_map('stripslashes', $_GET);
$_POST = array_map('stripslashes', $_POST);
$_REQUEST = array_map('stripslashes', $_REQUEST);
}

if (!isset($_REQUEST['f']) || empty($_REQUEST['f']))
{
header('Content-type: text/xml');
echo '<?xml version="1.0" encoding="', AJAX_ENCODING, '"?>', "\n";
echo(
"<data>\n" .
" <errorcode>-1</errorcode>\n" .
" <errormessage>No function specified.</errormessage>\n" .
"</data>\n"
);

die();
}

if (strpos($_REQUEST['f'], ':') === false)
{
$function = preg_replace("/[^A-Za-z0-9]/", "", $_REQUEST['f']);

$filename = sprintf('ajax/%s.php', $function);
}
else
{
/* Split function parameter into module name and function name. */
$parameters = explode(':', $_REQUEST['f']);

$module = preg_replace("/[^A-Za-z0-9]/", "", $parameters[0]);
$function = preg_replace("/[^A-Za-z0-9]/", "", $parameters[1]);

$filename = sprintf('modules/%s/ajax/%s.php', $module, $function);
}

if (!is_readable($filename))
{
header('Content-type: text/xml');
echo '<?xml version="1.0" encoding="', AJAX_ENCODING, '"?>', "\n";
echo(
"<data>\n" .
" <errorcode>-1</errorcode>\n" .
" <errormessage>Invalid function name.</errormessage>\n" .
"</data>\n"
);

die();
}

$filters = array();

if (!isset($_REQUEST['nobuffer']))
{
include_once('./lib/Hooks.php');

ob_start();
include($filename);
$output = ob_get_clean();

if (!eval(Hooks::get('AJAX_HOOK'))) return;

if (!isset($_REQUEST['nospacefilter']))
{
$output = preg_replace('/^\s+/m', '', $output);
}

foreach ($filters as $filter)
{
eval($filter);
}

echo($output);
}
else
{
include($filename);
}


?>
<?php

//cho 'test';
$_GET['route']='ajax';
$_REQUEST['route']='ajax';
include_once('ats/index.php');
//b_start();
//include_once('ats/index.php');
//$cnt = ob_get_contents();ob_end_clean();
//echo '.'.trim($cnt).'.';
//include_once('ajax_cats.php');
?>
7 changes: 3 additions & 4 deletions ajax/editActivity.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,9 @@
}

/* Convert formatted time to UNIX timestamp. */
$time = strtotime(
sprintf('%s:%s %s', $activityHour, $activityMinute, $activityAMPM)
);
$time = evCatsTimeToUTime($activityHour,$activityMinute,$activityAMPM);

//cho 'time:'.$time;
/* Create MySQL date string w/ 24hr time (YYYY-MM-DD HH:MM:SS). */
$date = sprintf(
'%s %s',
Expand Down Expand Up @@ -130,7 +129,7 @@
" <typedescription>" . $activityEntry['typeDescription'] . "</typedescription>\n" .
" <notes>" . htmlspecialchars($activityEntry['notes']) . "</notes>\n" .
" <regarding>" . htmlspecialchars($activityEntry['regarding']) . "</regarding>\n" .
" <date>" . htmlspecialchars($activityEntry['dateCreated']) . "</date>\n" .
" <date>" . htmlspecialchars(evConvertDateDbToDateTime($activityEntry['dateCreatedSort'])) . "</date>\n" .
"</data>\n"
);

Expand Down