Giter VIP home page Giter VIP logo

atk's Introduction

ATK Framework

ATK Framework is a special purpose PHP framework targeted at business applications.

It's targeted at developers who wish to focus on business logic, instead of coding HTML. Where other application frameworks mainly provide a large set of utility classes, ATK provides a complete framework that requires only small amounts of code to get usable applications, while maintaining full flexibility.

Branches

ATK was originally developed by Ivo Jansch and iBuildings back in 2000. It's been actively developed until 2011 (version 6.6).

This repo is managed by Sintattica. We still have some active projects based on various versions of ATK. Since we didn't find a true alternative to ATK yet, we opted to keep it alive.

We currently have these branches:

  • main
  • master (deprecated)
  • 9.2
  • 9.1
  • 9.0
  • 8.2

main

The main branch contains the latest updates. It starts from v9.2 that was the branch that contained the rolling-releases

master (deprecated)

This branch is deprecated and is going to be deleted at the end of 2022. Please checkout main (contains breaking changes with respect to master).

9.2

This branch starts from v9.1, it contains an updated style based on AdminLte framework. We are making other changes that will be rolled out in the future, generally we will be work on fixing existing functionalities on the version 9 line.

Our primary objective in the version 9.x is to give a new layout to existing projects and update them at least to PHP7.2.

The second objective is to merge the layout updates of the 9.2.x versions with the changes made in the v10.x and put a base for the upcoming v11 of the ATK framework.

The third objective is to create a skeleton project and some documentation so everyone can get onboard and develop awesome ATK applications.

9.1

Version like 9.0, but with jQuery only Currently there's no documentation for v.9. Maybe we'll manage to write some docs in the future. If you have one, please tell us.

9.0

This is a deeply refactored version that's not backward compatible. It's been developed with the following objectives:

  • composer support and PSR-4 compatibility
  • a modern class system (PSR-1/PSR-2)
  • PHP7 compatibility
  • better handling of modules
  • removal of deprecated functions
  • no more themes, GUI is now Bootstrap-based
  • Smarty 3 integration
  • Select2 integration

8.2

The fine folks at iBuildings were kind enough to transfer the atk-framework.com domain to Sintattica and to give us the sources of two historically valuable resources for ATK: the forum and the wiki.

We call this the "classic" ATK, i.e. the closest to iBuildings' version. It's largely backward compatible, with no additional functions:

  • lots of bug fixes
  • added a Bootstrap theme
  • improvements to Steelblue/Stillblue themes
  • improvements to attributes (atkAttribute, atkDateAttribute, atkListAttribute, atkNumberAttribute, atkFieldSet...)
  • improvements to relations (especially atkManyToOneRelation)
  • improvements to search functionality
  • better handling of dependencies
  • better handling of form buttons and submit
  • refactoring of meta fetching
  • added a couple of utility functions

Contributions

Since we use both branches in production projects, pull requests for bug fixes are welcome, but we cannot guarantee to accept new features. Please get in touch before submitting such requests.

We kindly ask you to:

  • Make pull requests by creating a feature branch from 8.2 or 9.0 or main
  • Don't branch from master
  • Avoid redundant comments
  • Keep PSR-4 formatting
  • Make the PR's topic "tight", don't modify dozens of classes or the whole app
  • Only add or fix a well-defined feature, keeping your changes small


Thanks!

Team Sintattica

atk's People

Contributors

michelerota avatar ngjata avatar andreacattaneo avatar sanotto avatar filippo597 avatar phrozenbyte avatar dalers avatar wayneh avatar dangamba avatar ematrive avatar

Stargazers

Christina vongphit avatar  avatar Jaderson Barreto Sathler avatar Md. Sumon Islam avatar Remo Laubacher avatar Lenix avatar Roberto Ferrari avatar Silence Lamb avatar Elviss Strazdins avatar Jorge Garifuna avatar André Philip avatar Michael Corrado avatar Paul R. Zwiers avatar Vuong avatar Richard avatar Lis0 avatar Vali Draganescu avatar morgenstern avatar  avatar  avatar Luis González avatar Surendra Soni avatar Mila76 avatar Osh avatar  avatar  avatar  avatar  avatar  avatar Davide avatar Aruna Kulatunga avatar  avatar  avatar Leonardo Laureti avatar Zorobabel avatar  avatar  avatar Dharma Ferrari avatar Giorgio Pagnoni avatar Claudio Marchiori avatar

Watchers

André Philip avatar Roberto Ferrari avatar Claudio Marchiori avatar  avatar James Cloos avatar Jorge Garifuna avatar Surendra Soni avatar Davide avatar  avatar  avatar  avatar 7homas avatar Giorgio Pagnoni avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

atk's Issues

Fix to add default action template to renderAction()

When confirmAction() is called with a non-default action, the system crashes. The way legacy ATK dealt with this was by using the default template "action.tlp". Below is the fix for this for ATK 9.1+:

File: vendor/sintattica/atk/src/Ui/Ui.php

public function renderAction($action, $vars, $module = '')
{
    // Start: Added by Jorge Garifuna from legacy ATK and using "$this->m_smarty->templateExists" instead of "$this->m_theme->tplPath"
    $tpl = "action_$action.tpl";
    if (!$this->m_smarty->templateExists($tpl)) // no specific theme for this action
    {
        $tpl = "action.tpl";
    }

    // old code: return $this->render("action_$action.tpl", $vars, $module);
    return $this->render($tpl, $vars, $module);
}

Pop-up Calendar on Date Fields not working

When using the AF_DATE_STRING flag, the Pop-up calendar doesn't show.
The problem is that the javascript that shows the calendar

onclick="return showCalendar('fecha_de_cierre[date]', 'fecha_de_cierre[date]', 'dd/mm/y', false, false);"
is using the "Name" attribute and it should be using the id attribute in order to specify the element.
The code uses:
onclick="return showCalendar('fecha_de_cierre[date]', 'fecha_de_cierre[date]', 'dd/mm/y', false, false);" type="button">

Refering to this element:
<input id="Ctacte_Maestro_fecha_de_cierre" class="atkdateattribute form-control" name="fecha_de_cierre[date]" value="" size="10" type="text">
The code should be:

onclick="return showCalendar('Ctacte_Maestro_fecha_de_cierre', 'Ctacte_Maestro_fecha_de_cierre', 'dd/mm/y', false, false);" type="button">
The compromised code is in Attributes/DateAttribute in method "draw"

bootstrap theme breaks tooltips and field dependency

  1. Tooltips are broken because the relative jquery UI library is missing
  2. field dependency (addDependee, addDependency) is broken because it replace the HTML in the "TD" with the field that in bootstrap theme is empty, since the field is elsewhere (AFAIK from what i've quickly seen);

Fix to bug in DataGrid/DataGrid.php

/vendor/sintattica/atk/src/DataGrid/DataGrid.php

    line: 480
        change: 
            $this->addComponent('index', 'atk.datagrid.atkdgindex'); // original generates error

        to:
            $this->addComponent('index', __NAMESPACE__ . '\\DataGridIndex'); // by Jorge Garifuna

Where is the ATK 9.1 installation guide?

At some point last year, there was an installation guide for ATK 9.1 somewhere in here. I found it very useful to migrate from ATK 6 to ATK 9.1. For some reason I can't find it anymore. Any ideas where I could find a reference to it?

FilEditor.php is not functional

Function select returns an array instead of a selector.
A new FileEditorSelector inheriting selector wiht getAllRows, getRowsCount overloaded is needed to make the class function properly.
Utils.zip

How do we get started with ATK 9.2?

Thank you so much for the release of ATK 9.2!!!
The addition of AdminLte is a much welcomed component to ATK.
I migrated all my modules last year from ATK 6 to ATK 9.0 and it was a very involved but worthy effort.

I'm wondering about the process to upgrade from 9.0 to 9.2.
I looked at the CHANGES files of both and they're identical. Github shows that there are over 700,000 lines added to the latest release. When I downloaded the files from , I see the "src" directory.

Is the "src" directory shown in ATK 9.2 expected to be a straight replacement for "vendor/sintattica/atk/src" of ATK 9.0?

Fix to bug in atk/src/Relations/ManyToOneTreeRelation.php

    # in edit() method:
        # to avoid ambiguity error
        change:
            $recordset = $this->m_destInstance->select($this->m_destInstance->m_primaryKey[0])->includes($tmp2)->getAllRows(); // original

        to:
            $recordset = $this->m_destInstance->select($this->m_destInstance->getTable() . '.' . $this->m_destInstance->m_primaryKey[0])->includes($tmp2)->getAllRows(); // by Jorge Garifuna

        # to have the correct selected value in the drop down list
        change:             
            $this->m_current = $this->m_ownerInstance->primaryKey($record); // original

        to:
            $this->m_current = $this->m_ownerInstance->primaryKey($record[$this->fieldName()]); // by Jorge Garifuna

Multilingual attributes, document templates and MetaNodes disappeared ?

Hello,

I've updated the atkdemo to a new demo for Atk9. I hit some regressions in Atk9, so I proposed patches (1, 2, 3 & 4)

But I was not able to reproduce lesson6 of the original demo (which was about MetaNodes, Nodes that get their Attributes based on the columns of the corresponding table, table name being guessed based on Node name), lesson7 (part with opendocument templates) and lesson8 (about Internationalization inside the database - row-based and column-based). These functionality disappeared ? If not, how to use them ?

Thanks for your wonderful work on Atk. Apart from this small difficulties, i consider atk9demo to be ready now. Would it be possible for you to take over it, or add a link into the documentation of Atk (or readme.md), after a review (as a beginner, I may not have done things "the right way") ? Thanks!

Update addToListArrayHeader in AggregatedColumn to match parent's definition

In:

atk/src/Attributes/AggregatedColumn.php

Update the following to match parent's definition:

public function addToListArrayHeader($action, &$arr, $fieldprefix, $flags, $atksearch, $atkorderby)

add:

use Sintattica\Atk\DataGrid\DataGrid;

Change to this:
public function addToListArrayHeader($action, &$arr, $fieldprefix, $flags, $atksearch, $atkorderby, DataGrid $grid = null, $column = '*')

Change legacy reference in DataGrid

on vendor/sintattica/atk/src/DataGrid/DataGrid.php
    line 480

    replace:

        $this->addComponent('index', 'atk.datagrid.atkdgindex');
    with:
        $this->addComponent('index', __NAMESPACE__ . '\\DataGridIndex');

Proposal, add new node flag NF_ADD_BUTTON

Similar to NF_ADD_LINK but renders a Button.
Implementation sugestions:
-Rename AF_NODE_SPECIFIC5 to NF_ADD_BUTTON (The NF_SPECIFIC* are only used in TreeNode only to NF_SPECIFIC4, so 5 is unused)

In Admin Handler's renderAdminPages Method:

 public function renderAdminPage()
    {
        $res = [];
        if ($this->m_node->hasFlag(Node::NF_NO_ADD) == false && $this->m_node->allowed('add')) {
                        if (!$this->m_node->hasFlag(Node::NF_ADD_LINK) and  !$this->m_node->hasFlag(Node::NF_ADD_BUTTON) ) { // otherwise, in adminPage, an add link will be added.
                // we could get here because of a reject.
                $record = $this->getRejectInfo();

                $res[] = $this->invoke('addPage', $record);
            }
        }
        $res[] = $this->invoke('adminPage');

        return $res;
    }```
in AdminHandler's getAddLinkMethod:

public function getAddLink()
{
$atk = Atk::getInstance();
$node = $atk->atkGetNode($this->invoke('getAddNodeType'));

    if (!$node->hasFlag(Node::NF_NO_ADD) && $node->allowed('add')) {
        $label = $node->text('link_'.$node->m_type.'_add', null, '', '', true);
        if (empty($label)) {
            // generic text
            $label = Tools::atktext('add', 'atk');
        }
        if ($node->hasFlag(Node::NF_ADD_LINK)) {
            $addurl = $this->invoke('getAddUrl', $node);
            return Tools::href($addurl, $label, SessionManager::SESSION_NESTED);
                    }
                    if ($node->hasFlag(Node::NF_ADD_BUTTON)) {
            $addurl = $this->invoke('getAddUrl', $node);
                            $label="<button type='button' class='btn btn_saveandclose atkdefaultbutton btn-primary'>".$label."</button>";
            return Tools::href($addurl, $label, SessionManager::SESSION_NESTED);
                    }



    }

    return '';
}
And in Node.php:

/**
* Specific node flag 4.
*/
const NF_SPECIFIC_4 = 268435456;

/**
 * Add Button.
 */
const NF_ADD_BUTTON = 536870912;

ATK skeleton for 9.9.9

Hi,

I used ATK in the past (and I even fixed some bugs to use MSSQL as a database).

Now I would try it again, but I wish to start from the latest version (9.9.9).

Is it possible to have an atk-skeleton for that version?

javascript function atksubmit does not work properly on chrome

The function function atkSubmit(target, standardSubmit) in formsubmit.js does not work properly on chrome (Versión 60.0.3112.113 (Build oficial) (32 bit) ) the code

    // call global submit function, which doesn't get called automatically
    // when we call entryform.submit manually.
    globalSubmit(document.entryform, standardSubmit);
    document.entryform.submit();

Should be

    // call global submit function, which doesn't get called automatically
    // when we call entryform.submit manually.
    globalSubmit(document.entryform, standardSubmit);
    //document.entryform.submit();
    var ef = document.getElementById("entryform");
    ef.submit();

PolymorphicOneToOneRelation default node handling problem

In PloymorphicOneToOneRelation the load method allway "builds" the destination URI, when the discriminator field is empty this leads to a URI in the form "module." (i.e. missing the node name).
When the field is empty it should direct you to the default node specified in the Class Creator.
The correct code for the load methos should be:

/**
     * Retrieve detail records from the database.
     *
     * Called by the framework to load the detail records.
     *
     * @param Db $db The database used by the node.
     * @param array $record The master record
     * @param string $mode The mode for loading (admin, select, copy, etc)
     *
     * @return array Sets the destination from the record and
     *               return the atkonetoone load function
     */
    public function load($db, $record, $mode)
    {
        if (!empty($record[$this->m_typefk][$this->m_discriminatorfield]))
        {
            $this->m_destination = $this->m_modulename.'.'.$record[$this->m_typefk][$this->m_discriminatorfield];
            $this->m_destInstance = $this->m_modulename.'.'.$record[$this->m_typefk][$this->m_discriminatorfield];
        }

        return parent::load($db, $record, $mode);
    }

Record Locking System

hi all, I'm wondering about the record locking system, i was involved in old atk projects and trying to learn and work on (maybe also help) your platform i cannot find any system to ensure data integrity for cuncurrent usage. thanks. PG

atk 9 render table

we are migrating an application from atk 6 to atk 9, we have did most of the changes but one its difficult to resolve. in the application have many reports and we use:
$tr = &atknew("atk.utils.atktablerenderer"); $output.= $tr->render($tableData, TBL_DATA, "recordlist"); return $output;
to create an html table, we try this on atk 9 but dosen't work:
$tr = new Ui(); $output .= $tr->renderList($tableData,'utenti'); return $output;

what wrong?
thanks

Archiving of the @atkphpframework organization

Hi,

just want to let you guys know that I've just archived the @atkphpframework organization (I was in some sort of an tidying spree 😆). All repos of the @atkphpframework organization got archived and I asked the GitHub support to create an redirect from the "original" atkphpframework/atk repo to your repo. By doing so the fork connection got removed and Sintattica/atk is now the root of its own network. Together with large deprecation notices in the archived @atkphpframework repos I hope that all remaining users of the ATK Framework are redirected directly to you guys. This is just for your interest, you don't have to do anything 👍

Keep up the great work you do, I wish you all the best! ❤️

Greetings,
Daniel

SETUP FOR Admin LTE Theme with 9.2 Version

I request guidance how to configure the theme for ark demo

I am able to install demo and work with demo but not able to get the theme set

I am running on IIS and php 7.2

My url is atkdemo.localhost

Please guide

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.