Skip to content

Commit

Permalink
Merge branch '9.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
michelerota committed Sep 20, 2017
2 parents 059ea75 + 1643f23 commit 6cb9bd0
Show file tree
Hide file tree
Showing 14 changed files with 123 additions and 122 deletions.
6 changes: 6 additions & 0 deletions src/Core/Atk.php
Expand Up @@ -126,6 +126,12 @@ public function run()

/** @var IndexPage $indexPage */
$indexPage = new $indexPageClass($this);

$default_destination = Config::getGlobal('default_destination');
if(is_array($default_destination)) {
$indexPage->setDefaultDestination($default_destination);
}

$indexPage->generate();
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/Core/Config.php
Expand Up @@ -18,7 +18,9 @@ public static function init()
// Include the defaults
$defaultConfig = self::getConfigValues(__DIR__.'/../Resources/config/atk.php');
foreach ($defaultConfig as $key => $value) {
self::$s_globals[$key] = $value;
if(!array_key_exists($key, self::$s_globals)) {
self::$s_globals[$key] = $value;
}
}

// Get the application config
Expand Down
1 change: 1 addition & 0 deletions src/Relations/ManyToManySelectRelation.php
Expand Up @@ -468,6 +468,7 @@ protected function renderAdditionField($record, $fieldprefix, $mode)
$relation->addOnChangeHandler("ATK.ManyToManySelectRelation.add(el, '{$url}', {$hasPositionAttribute});");

$relation->setNoneLabel($this->text('select_none_obligatory'));
unset($record[$relation->fieldName()]);
$result = $relation->edit($record, $fieldprefix, $mode);
if ($result == $this->text('select_none_obligatory')) {
$result = '';
Expand Down
4 changes: 2 additions & 2 deletions src/Relations/ManyToOneRelation.php
Expand Up @@ -966,7 +966,7 @@ public function _getSelectLink($selname, $filter)
$linkname = Tools::atktext('select_a');
}

$result .= Tools::href(Tools::dispatch_url($this->m_destination, 'select', ['atkfilter' => $filter, 'atktarget' => $atktarget]),
$result .= Tools::href(Tools::dispatch_url($this->m_destination, 'select', ['atkfilter' => $filter ?: 'true', 'atktarget' => $atktarget]),
$linkname, SessionManager::SESSION_NESTED, $this->m_autocomplete_saveform, 'class="atkmanytoonerelation atkmanytoonerelation-link"');

return $result;
Expand Down Expand Up @@ -1632,7 +1632,7 @@ public function createFilter($record, $mode)
*/
public function isSelectableRecord($record = [], $mode = '')
{
if ($record[$this->fieldName()] == null) {
if (!isset($record[$this->fieldName()]) || $record[$this->fieldName()] == null) {
return false;
}

Expand Down
5 changes: 5 additions & 0 deletions src/Resources/config/atk.php
Expand Up @@ -451,6 +451,11 @@

'indexPage' => Sintattica\Atk\Ui\IndexPage::class,

/*
* ['Module.Node', 'action']
*/
'default_destination' => null,

/************************** MENU *********************************/

'menu' => Sintattica\Atk\Core\Menu::class,
Expand Down
5 changes: 3 additions & 2 deletions src/Resources/public/javascript/formsubmit.js
Expand Up @@ -43,8 +43,9 @@ ATK.FormSubmit = {

// call global submit function, which doesn't get called automatically
// when we call entryform.submit manually.
ATK.globalSubmit(document.entryform, standardSubmit);
document.entryform.submit();
var entryForm = jQuery("#entryform");
ATK.globalSubmit(entryForm, standardSubmit);
entryForm.submit();
},
preGlobalSubmit: function (formEl, bag, standardSubmit) {

Expand Down
155 changes: 69 additions & 86 deletions src/Resources/public/javascript/libs.min.js

Large diffs are not rendered by default.

Expand Up @@ -14,6 +14,7 @@ ATK.ManyToManySelectRelation = {

jQuery.post(url, params, function (responseText) {
li.before(responseText);
li.find('select.ManyToOneRelation').empty();
jQuery('<div>').html(responseText).find("script").each(function () {
var text = jQuery(this).text();
if(text) {
Expand Down
22 changes: 13 additions & 9 deletions src/Resources/public/styles/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Resources/public/styles/style.css.map

Large diffs are not rendered by default.

9 changes: 0 additions & 9 deletions src/Resources/src/Gruntfile.js
Expand Up @@ -15,15 +15,6 @@ module.exports = function (grunt) {
cwd: 'bower_components/font-awesome-sass/assets/fonts/',
src: ['**'],
dest: '../public/fonts/'
},
{
expand: true,
cwd: 'bower_components/smartmenus/src/addons/bootstrap/',
src: ['**/*.css'],
dest: 'bower_components/smartmenus/scss/',
rename: function (dest, src) {
return dest + '_' + src.replace(/\.css$/, ".scss");
}
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/src/bower.json
Expand Up @@ -22,6 +22,6 @@
"jquery": "2.2.4",
"select2": "4.0.3",
"select2-bootstrap-theme": "0.1.0-beta.8",
"smartmenus": "1.0.0",
"smartmenus": "1.1.0",
}
}
24 changes: 16 additions & 8 deletions src/Resources/src/sass/_stuff.scss
Expand Up @@ -56,6 +56,15 @@ span.form-control-static {
display: inline-block;
}

.atkfieldset .form-control-static {
padding-top: 0;
min-height: inherit;
}

.atkfieldset label.control-label {
padding-top: 0;
}

.error {
color: #A94442;
}
Expand All @@ -76,9 +85,7 @@ span.form-control-static {
.atkmessages_failure,
.atkmessages_warning {
margin-bottom: 1px;
padding: 3px;
padding-left: 6px;
padding-right: 6px;
padding: 3px 6px;
}

.atkmessages_general {
Expand All @@ -103,9 +110,7 @@ span.form-control-static {
.atkmessages_failure {
background-color: #ff0000;
color: #fff;
padding: 3px;
padding-left: 6px;
padding-right: 6px;
padding: 3px 6px;
}

.red {
Expand All @@ -130,9 +135,12 @@ span.form-control-static {
display: none !important;
}

.atkfieldset > .fieldset-form-group, .atkfieldset > .fieldset-form-group > div {
.atkfieldset > .fieldset-form-group,
.atkfieldset > .fieldset-form-group > div,
.atkfieldset > .fieldset-form-group input[type="file"]
{
display: inline;
vertical-align: middle;
// vertical-align: middle;
}

.atkfieldset label {
Expand Down
3 changes: 1 addition & 2 deletions src/Resources/src/sass/_styles.scss
Expand Up @@ -2,10 +2,9 @@

@import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap";
@import "../bower_components/font-awesome-sass/assets/stylesheets/font-awesome";
@import "../bower_components/smartmenus/scss/jquery.smartmenus.bootstrap";
@import "../bower_components/smartmenus/src/addons/bootstrap/jquery.smartmenus.bootstrap";
@import "../bower_components/select2/src/scss/core";
@import "../bower_components/select2-bootstrap-theme/src/select2-bootstrap";
//@import url("https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700,400italic,700italic&subset=latin,latin-ext");

@import "ColorPickerAttribute";
@import "DateAttribute";
Expand Down

0 comments on commit 6cb9bd0

Please sign in to comment.