From e2094c00b4691dcc78b4db8e94a020acdabb1057 Mon Sep 17 00:00:00 2001 From: emkael Date: Fri, 6 May 2016 17:47:43 +0200 Subject: * quick default status edit in calendar scaffold --- app/php/controls/CalendarScaffold.php | 9 +++++++++ app/php/controls/CalendarScaffold.tpl | 19 ++++++++++++++++--- app/php/controls/scripts/CalendarScaffold.js | 2 +- 3 files changed, 26 insertions(+), 4 deletions(-) (limited to 'app/php/controls') diff --git a/app/php/controls/CalendarScaffold.php b/app/php/controls/CalendarScaffold.php index b12f6aa..1a25cce 100644 --- a/app/php/controls/CalendarScaffold.php +++ b/app/php/controls/CalendarScaffold.php @@ -96,6 +96,15 @@ class CalendarScaffold extends FacadeTemplateControl { $this->_rebindData(); } + public function toggleDefaultState($sender, $param) { + $calendar = $this->getFacade()->get($sender->CustomData); + if ($calendar) { + $calendar[0]->Visible = $sender->Checked; + $calendar[0]->save(); + $this->_rebindData(TRUE); + } + } + public function uploadRowFile($sender, $param) { $fileType = $sender->getFileType(); if (preg_match('/^image\//', $fileType)) { diff --git a/app/php/controls/CalendarScaffold.tpl b/app/php/controls/CalendarScaffold.tpl index a92c3e6..5e15b92 100644 --- a/app/php/controls/CalendarScaffold.tpl +++ b/app/php/controls/CalendarScaffold.tpl @@ -26,9 +26,22 @@ DataValueField="CategoryID" ListValueField="ID" ListTextField="Name" /> - + + + + <%# $this->Parent->Data->Visible %> + <%# $this->Parent->Data->UID %> + + + + + <%# $this->Parent->Data->Visible %> + + + diff --git a/app/php/controls/scripts/CalendarScaffold.js b/app/php/controls/scripts/CalendarScaffold.js index 815a3da..d4b8ec5 100644 --- a/app/php/controls/scripts/CalendarScaffold.js +++ b/app/php/controls/scripts/CalendarScaffold.js @@ -1,6 +1,6 @@ $('body').on( 'click', - 'main .calendarScaffold tbody a[href^="javascript:;//"]', + 'main .calendarScaffold tbody a[href^="javascript:;//"], main .calendarScaffold tbody input.visibilityToggle', function(e) { var loader = $('
').addClass('calendarScaffoldLoader'); $('main .calendarScaffold div[id$="_Container"]').append(loader); -- cgit v1.2.3