sintattica / atk Goto Github PK
View Code? Open in Web Editor NEWObject-oriented full-stack PHP framework for developing business-oriented web applications
Home Page: http://atk-framework.com/
Object-oriented full-stack PHP framework for developing business-oriented web applications
Home Page: http://atk-framework.com/
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?
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?
on vendor/sintattica/atk/src/DataGrid/DataGrid.php
line 480
replace:
$this->addComponent('index', 'atk.datagrid.atkdgindex');
with:
$this->addComponent('index', __NAMESPACE__ . '\\DataGridIndex');
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"
# to avoid warning in atk/src/Core/TreeNode.php to match parent's copyDb method:
change:
public function copyDb(&$record, $mode = 'copy')
to:
public function copyDb(&$record, $mode = 'copy')
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
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);
}
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?
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!
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 = '*')
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
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();
Do you accept patches in order to add my fixes to your 8.2 branch? Or i can save my time?
I'm already in sync with your 8.2.
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);
}
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
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;
# 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
/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
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
Is the a basic sample App with AtK that i can use as a starting point
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.