1

(13 replies, posted in Modules Add-on's)

Yes it work I am add like this in hook.php in module directory

function install_access()
    {
       
                $security_sections[SS_APWORKS] =    _(

2

(13 replies, posted in Modules Add-on's)

How about access level where put acc_file?

I mena custom access level for extension.

How add new extension in 2.3 i got it and work for me. Now a can add custome TAB's, menu it cool.

3

(13 replies, posted in Modules Add-on's)

One more question?

Add new TAB it work now?

4

(13 replies, posted in Modules Add-on's)

i make new file

PHP Fatal error:  Cannot redeclare install_hooks() in D:\webserver\htdocs\web\2.3-original-aimaks\modules\APworks\hooks.php on line 187

PHP Fatal error:  Cannot redeclare class hooks in D:\webserver\htdocs\web\2.3-original-aimaks\modules\APworks\hooks.php on line 21

but some wrong because hook.inc exist class and funcion like this. Do you have a little examlpe , new extension.

Top 10 Sold Items in fiscal year - graphic not display - āĀ Вот

Not work function imagettftext  latvia and russian in file class.graphic.inc.

Add some modification in file  class.graphic.inc.

line after 962

================
$out = '';
$string = mb_convert_encoding($string, 'HTML-ENTITIES',"UTF-8");
// Convert HTML entities into ISO-8859-1
$string = html_entity_decode($string,ENT_NOQUOTES, "ISO-8859-1");
// Convert characters > 127 into their hexidecimal equivalents
for($i = 0; $i < strlen($string); $i++) {
    $letter = $string[$i];
    $num = ord($letter);
    if($num>127) {
      $out .= "&#$num;";
    } else {
      $out .=  $letter;
    }
}

$string = $out;

==============
after this work fine.

6

(2 replies, posted in FA Modifications)

After this modification i have - any date in datebase in any languages.
A have in datebase - Rusian, English , Latvia - (&#1040;&#1075;&#1080;.(&#256;&#291;&#299;)) in one string.

Need Export all tables from mysql and  chnage this dump file to UTF-8.
Change in dump file where;  DEFAULT CHARSET=*** COLLATE=**** >-TO-> DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ;

Make new database with - DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ;

And import file with you date.

Than install Eny UTF-8 language in FA, Make this dafault. Take language file *.po *.mo from english - convert this files to files with UTF-8 encoding. And put files in you any UTF-8 language in FA.

Notepad++ work great for convert between encodind.

Than change down.


* ..\frontaccount\includes\db\connect_db.inc

function db_query($sql, $err_msg=null)

Add like this

//My change: for UTF-8
  mysql_query("SET NAMES 'utf8';");
  mysql_query("SET CHARACTER SET 'utf8';");
  mysql_query("SET SESSION collation_connection = 'utf8_general_ci';");
//My change: for UTF-8

-----------------
    * ..\frontaccount\includes\ui\ui_input.inc

Change
//htmlentities(strtr($name, array('.'=>'=2E',' '=>'=20','='=>'=3D','['=>'=5B')))......
htmlspecialchars(strtr($name, array('.'=>'=2E',' '=>'=20','='=>'=3D','['=>'=5B'))......

function button($name, $value, $title=false, $icon=false,  $aspect='')
{
    // php silently changes dots,spaces,'[' and characters 128-159
    // to underscore in POST names, to maintain compatibility with register_globals
    $rel = '';
    if ($aspect == 'selector') {
        $rel = " rel='$value'";
        $value = _("Select");
    }
    if (user_graphic_links() && $icon)
    {
        if ($value == _("Delete")) // Helper during implementation
            $icon = ICON_DELETE;
        return "<button type='submit' class='editbutton' name='".
            //htmlentities(strtr($name, array('.'=>'=2E',' '=>'=20','='=>'=3D','['=>'=5B')))
            htmlspecialchars(strtr($name, array('.'=>'=2E',' '=>'=20','='=>'=3D','['=>'=5B')), ENT_COMPAT, $_SESSION['language']->encoding )
            ."' value='1'" . ($title ? " title='$title'":" title='$value'")
            . ($aspect ? " aspect='$aspect'" : '')
            . $rel
            ." />".set_icon($icon)."\n";
    }
    else
        return "<input type='submit' class='editbutton' name='".
            //htmlentities(strtr($name, array('.'=>'=2E',' '=>'=20','='=>'=3D','['=>'=5B')))
            htmlspecialchars(strtr($name, array('.'=>'=2E',' '=>'=20','='=>'=3D','['=>'=5B')), ENT_COMPAT, $_SESSION['language']->encoding )
            ."' value='$value'"
            .($title ? " title='$title'":'')
            . ($aspect ? " aspect='$aspect'" : '')
            . $rel
            ." />\n";
}

---------------

..\frontaccount\inventory\manage\item_units.php

//MY change:       
    //  write_item_unit(htmlentities($selected_id), $_POST['abbr'], $_POST['description'], $_POST['decimals'] );
        write_item_unit(htmlspecialchars($selected_id), $_POST['abbr'], $_POST['description'], $_POST['decimals'], ENT_COMPAT, $_SESSION['language']->encoding );
       
//MY change:
----------------

May be also need config mysql

MySQL server my.cnf or Windows my.ini:   

[client] 

default-character-set= utf8   

[mysql]
collation_server = utf8_unicode_ci

character_set_server = utf8

default-character-set=utf8

init-connect='SET collation_connection = utf8_general_ci'

init-connect='SET NAMES utf8'

[mysqld]

default-character-set=utf8

7

(13 replies, posted in Modules Add-on's)

Thanks. I will try.

8

(13 replies, posted in Modules Add-on's)

Old system plugin removed ? How to write new extension ?

9

(4 replies, posted in Translations)

Linux have ru_RU,  ru_RU.utf8. A have interface Latvian, Russian, English but information in database Latvian, some Russian and english.

I am understante, what way replace gettext_() not so good. But for it work fine. if need upgate, i can againt raplate all _() in all file it quickle  and go work.

10

(4 replies, posted in Translations)

One more monent. is fail for translate ru_RU.po a change encoding: UTF-8

I use: English, Latvia, Russian in one page. If encoding page UTF-8 not problemm. if each has its own encoding is problem. For me right local UTF-8.

FrontAccouting have php_translate it fine for me.

11

(4 replies, posted in Translations)

In windows(Xampp) -
gettext_native - Work but all text no in rigth code. web-page in UTF-8, base utf-8. Text in ISO-8859-5. GetText in php on.
gettext_php_traslate - work fine and code is correct. But need OFF GetText in PHP.

LINUX(Ubuntu 8.04)
gettext is ok, I check with this script http://php.russofile.ru/resources/archives/0000/gettext_sample.zip. and is work.
In FrontAccounting not work. Need again turn off Gettext and ... .

AND how a change without OFF gettext

I am change function _('Test') in T_('Test').
in all files *.php and *.inc. '_(' in 'T_('  .

and change in frontaccount\includes\lang\gettext.php
line : 130 - 133. this TunON php_gettext ALLTIME
....
if (function_exists('gettext'))
            {
              //  return get_text::_support(new gettext_native_support());
                return get_text::_support(new gettext_php_support());
}
....

and change in frontaccount\includes\lang\language.php

if (!function_exists("_"))
{
    function T_($text)
       //function _($text)
    {
   
        $retVal = get_text::gettext($text);
        if ($retVal == "")
            return $text;
           
        return $retVal;
       
    }
}

//new function
function T_($text)
    {
   
        $retVal = get_text::gettext($text);
        if ($retVal == "")
            return $text;
           
        return $retVal;
       
    }
//new function