From a13a98ce8025f82ace963a4346e78105d8fdc75b Mon Sep 17 00:00:00 2001 From: VoNZproject Date: Tue, 14 Mar 2017 14:47:29 +1300 Subject: [PATCH 01/24] Add files via upload --- controller/pagecontroller.php | 30 ++++++++++++++++++++++++++---- controller/settingscontroller.php | 24 ++++++++++++++++++++---- 2 files changed, 46 insertions(+), 8 deletions(-) diff --git a/controller/pagecontroller.php b/controller/pagecontroller.php index 8bd9908..8df80a0 100644 --- a/controller/pagecontroller.php +++ b/controller/pagecontroller.php @@ -5,8 +5,8 @@ * This file is licensed under the Affero General Public License version 3 or * later. See the COPYING file. * - * @author Shawn - * @copyright Shawn 2016 + * @author Shawn , A.Daugieras + * @copyright Shawn,Daugieras 2017 */ namespace OCA\Background\Controller; @@ -18,15 +18,20 @@ use OCP\AppFramework\Controller; use OCP\IUserSession; +use OCA\Background\db\backgroundinfo; +use OCA\Background\db\backgroundinfomapper; + class PageController extends Controller { + private $mapper; private $userId; private $config; - public function __construct($AppName, IRequest $request, IConfig $config, $UserId){ + public function __construct($AppName, IRequest $request, backgroundinfomapper $mapper, IConfig $config, $UserId){ parent::__construct($AppName, $request); $this->config = $config; - $this->userId = $UserId; + $this->userId = $userId; + $this->mapper = $mapper; } /** @@ -43,4 +48,21 @@ public function index() { $params = ['user' => $this->userId]; return new TemplateResponse('background', 'main', $params); // templates/main.php } + + public function create($name, $age, $gender, $addr, $eprofil, $etype, $eexposure, $edetail, $mprofil, $mtype, $mexposure, $mdetail) { + $background = new backgroundinfo(); + $background->setName($name); + $background->setAge($age); + $background->setGender($gender); + $background->setAddr($addr); + $background->setEprofil($eprofil); + $background->setEtype($etype); + $background->setEexposure($eexposure); + $background->setEdetail($edetail); + $background->setMprofil($mprofil); + $background->setMtype($mtype); + $background->setMexposure($mexposure); + $background->setMdetail($mdetail); + return new DataResponse($this->mapper->insert($background)); + } } diff --git a/controller/settingscontroller.php b/controller/settingscontroller.php index 14d9f3c..97ca154 100644 --- a/controller/settingscontroller.php +++ b/controller/settingscontroller.php @@ -5,8 +5,8 @@ * This file is licensed under the Affero General Public License version 3 or * later. See the COPYING file. * - * @author Shawn - * @copyright Shawn 2016 + * @author Shawn , A.Daugieras + * @copyright Shawn,Daugieras 2017 */ namespace OCA\Background\Controller; @@ -40,7 +40,15 @@ public function getUserValue() { $params = ['name' => $this->getItem('name'), 'age' => $this->getItem('age'), 'gender' => $this->getItem('gender'), - 'addr' => $this->getItem('addr')]; + 'addr' => $this->getItem('addr'), + 'eprofil' => $this->getItem('eprofil'), + 'etype' => $this->getItem('etype'), + 'eexposure' => $this->getItem('eexposure'), + 'edetail' => $this->getItem('edetail'), + 'mprofil' => $this->getItem('mprofil'), + 'mtype' => $this->getItem('mtype'), + 'mexposure' => $this->getItem('mexposure'), + 'mdetail' => $this->getItem('mdetail')]; return new TemplateResponse('background', 'main', $params); } @@ -61,11 +69,19 @@ protected function updateItem($key, $value){ * @NoAdminRequired * @NoCSRFRequired */ - public function setBackground($name, $age, $gender, $addr) { + public function setBackground($name, $age, $gender, $addr, $eprofil, $etype, $eexposure, $edetail, $mprofil, $mtype, $mexposure, $mdetail) { $this->updateItem('name', $name); $this->updateItem('age', $age); $this->updateItem('gender', $gender); $this->updateItem('addr', $addr); + $this->updateItem('eprofil', $eprofil); + $this->updateItem('etype', $etype); + $this->updateItem('eexposure', $eexposure); + $this->updateItem('edetail', $edetail); + $this->updateItem('mprofil', $mprofil); + $this->updateItem('mtype', $mtype); + $this->updateItem('mexposure', $mexposure); + $this->updateItem('mdetail', $mdetail); return $this->getUserValue(); // templates/main.php } } From 660531db98b5799ea211313323f4245758b4a4a8 Mon Sep 17 00:00:00 2001 From: VoNZproject Date: Tue, 14 Mar 2017 14:48:10 +1300 Subject: [PATCH 02/24] Add files via upload --- appinfo/info.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index a74a9f8..ba2ca73 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -2,10 +2,10 @@ background Background - My first ownCloud app + Application which allows to register informations on the users link to the use of recorder VoNZ application AGPL - Shawn - 0.0.1 + Shawn, A.Daugieras + 0.0.2 Background tool From d72de8ea2441ca260e283e1fdd090e1259d0be4b Mon Sep 17 00:00:00 2001 From: VoNZproject Date: Tue, 14 Mar 2017 14:48:39 +1300 Subject: [PATCH 03/24] Add files via upload --- db/backgroundinfo.php | 12 ++++++++++-- db/backgroundinfomapper.php | 8 ++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/db/backgroundinfo.php b/db/backgroundinfo.php index 35acd47..23aac01 100644 --- a/db/backgroundinfo.php +++ b/db/backgroundinfo.php @@ -1,14 +1,22 @@ addType('age', 'integer'); } diff --git a/db/backgroundinfomapper.php b/db/backgroundinfomapper.php index e6a1f31..c79329c 100644 --- a/db/backgroundinfomapper.php +++ b/db/backgroundinfomapper.php @@ -7,17 +7,17 @@ class BackgroundInforMapper extends Mapper { public function __construct(IDBConnection $db){ - parent::__construct($db, 'background_infor'); + parent::__construct($db,'background','\OCA\Background\Db\backgroundinfo'); } public function find($id){ - $sql = 'select * from *PERFIX*background_infor '. - 'where id = ?'; + $sql = 'SELECT * FROM *PREFIX*background '. + 'WHERE id = ?'; return $this->findEntity($sql, [$id]); } public function findAll($limit=null, $offset=null){ - $sql = 'select * from *PREFIX*background_infor'; + $sql = 'SELECT * FROM *PREFIX*background'; return $this->findEntities($sql, $limit, $offset); } } From 45327b02e2574e78d6a121d7ecf13f257f464794 Mon Sep 17 00:00:00 2001 From: VoNZproject Date: Tue, 14 Mar 2017 14:49:00 +1300 Subject: [PATCH 04/24] Add files via upload --- js/script.js | 82 +++++++++++++++++++++++++--------------------------- 1 file changed, 39 insertions(+), 43 deletions(-) diff --git a/js/script.js b/js/script.js index c1eebf8..9c8feb8 100644 --- a/js/script.js +++ b/js/script.js @@ -4,68 +4,64 @@ * This file is licensed under the Affero General Public License version 3 or * later. See the COPYING file. * - * @author Shawn - * @copyright Shawn 2016 + * @author Shawn , A.Daugieras + * @copyright Shawn,Daugieras 2017 */ (function ($, OC) { $(document).ready(function () { + + //allows to go on a other page (show one page and hide the two others) + $("#next").click(function(e){ + e.preventDefault(); + $('#Generaldata').addClass('hidden'); + $('#Maoriprofil').addClass('hidden'); + $('#Englishprofil').removeClass('hidden'); + }); + + $("#previous2").click(function(e){ + e.preventDefault(); + $('#Generaldata').removeClass('hidden'); + $('#Maoriprofil').addClass('hidden'); + $('#Englishprofil').addClass('hidden'); + }); + + $("#next2").click(function(e){ + e.preventDefault(); + $('#Generaldata').addClass('hidden'); + $('#Maoriprofil').removeClass('hidden'); + $('#Englishprofil').addClass('hidden'); + }); + + $("#previous3").click(function(e){ + e.preventDefault(); + $('#Generaldata').addClass('hidden'); + $('#Maoriprofil').addClass('hidden'); + $('#Englishprofil').removeClass('hidden'); + }); + function saveSettings() { - //OC.msg.startSaving('#activity_notifications_msg'); var post = $('#background').serialize(); var result = '#' + $(this).attr('name') + '-status'; $.post(OC.generateUrl('/apps/background/settings'), post) - .done(function() { - //alert( "second success" ); + .done(function() {; $(result).text("Saved!"); }) - .fail(function(xhr, textStatus, errorThrown) { + .fail(function() { $(result).text("Error!"); - //alert(xhr.responseText + "\n" + errorThrown); }) .always(function() { - //alert( "finished" ); }); } var $activityNotifications = $('#background'); + //savesetting when users add informations from input, select or textarea $activityNotifications.find('input').change(saveSettings); $activityNotifications.find('select').change(saveSettings); - -// $( "#name" ).change(function saveSettings() { -// alert( "Data Saved: " + $(this).attr('name') + $(this).val()); -// var jason = $.ajax({ -// cache: false, -// async: true, -// dataType : 'json', -// type: "POST", -// url: OC.generateUrl('/apps/background/settings'), -// data: "key=" + $(this).attr('name') -// + "&value=" + $(this).val(), -// success: function(msg){ -// alert( "Data Saved: " + msg + $(this).attr('name') + $(this).val()); -// }, -// error: function(jqXHR, textStatus, errorThrown){ -// console.log(errorThrown); -// console.log(jqXHR); -// } -// }); -// -// alert( "Data: " + jason); -// -//// var post = {key: $(this).attr('name'), value: $(this).val()}; -//// -//// $.post(OC.generateUrl('/apps/background/settings'), post) -//// .done(function() { -//// alert( "second success" ); -//// }) -//// .fail(function(xhr, textStatus, errorThrown) { -//// alert(xhr.responseText + "\n" + errorThrown); -//// }) -//// .always(function() { -//// alert( "finished" ); -//// }); -// }); + $activityNotifications.find('#addr').change(saveSettings); + $activityNotifications.find('#edetail').change(saveSettings); + $activityNotifications.find('#mdetail').change(saveSettings); }); + })(jQuery, OC); From 3111da63b6bb88bc086f2e8e3428541d44eba118 Mon Sep 17 00:00:00 2001 From: VoNZproject Date: Tue, 14 Mar 2017 14:49:35 +1300 Subject: [PATCH 05/24] Add files via upload --- templates/part.content.php | 181 ++++++++++++++++++++++++++++------ templates/part.navigation.php | 15 ++- 2 files changed, 155 insertions(+), 41 deletions(-) diff --git a/templates/part.content.php b/templates/part.content.php index 2c88fc4..b66dae1 100644 --- a/templates/part.content.php +++ b/templates/part.content.php @@ -1,36 +1,153 @@
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
+ +
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ + +
+
+ + +
diff --git a/templates/part.navigation.php b/templates/part.navigation.php index 2432c1c..85faabe 100644 --- a/templates/part.navigation.php +++ b/templates/part.navigation.php @@ -1,10 +1,7 @@ -
    -
  • First level entry
  • -
  • - First level container - -
  • + From e289b2a172170063821c8b3d3098b9ba0e99a57a Mon Sep 17 00:00:00 2001 From: VoNZproject Date: Wed, 15 Mar 2017 09:02:14 +1300 Subject: [PATCH 06/24] editing a writing mistake --- templates/part.content.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/part.content.php b/templates/part.content.php index b66dae1..b8bf97b 100644 --- a/templates/part.content.php +++ b/templates/part.content.php @@ -41,7 +41,7 @@ +
    + +
    + + +
    +
    From 8bcd69c88113da655e8641f7fd9021090a0cf671 Mon Sep 17 00:00:00 2001 From: VoNZproject Date: Thu, 13 Apr 2017 11:02:08 +1200 Subject: [PATCH 19/24] Add a new parameter --- db/backgroundinfo.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/db/backgroundinfo.php b/db/backgroundinfo.php index 615b1d8..74c3683 100644 --- a/db/backgroundinfo.php +++ b/db/backgroundinfo.php @@ -16,11 +16,13 @@ class BackgroundInfo extends Entity{ protected $mtype; protected $mexposure; protected $mdetail; + protected $nztime; // Here you can add some variables public function __construct(){ $this->addType('age', 'integer'); + $this->addType('nztime','integer'); //If types of new variables are different from text specify their types here } } From 788bac943fedb64807d0f5a212e0ff12f937b5e2 Mon Sep 17 00:00:00 2001 From: VoNZproject Date: Mon, 1 May 2017 09:27:08 +1200 Subject: [PATCH 20/24] add a new parameter --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 400f51f..e9ced6b 100644 --- a/README.md +++ b/README.md @@ -3,13 +3,13 @@ This is an application for owncloud who allows users to register some parameters in a database with an very simple interface. For now there are the following parameters : -name, age, gender, address, english profil, english type, english exposure, english detail, maori profil, maori type, maori exposure, maori detail +name, age, gender, address, english profil, english type, english exposure, english detail, maori profil, maori type, maori exposure, maori detail, nz time ## Installation Download the background repository and place this in **owncloud/apps/** -Attention : The name of the repository HAVE TO be background !! +Warning : The name of the repository HAVE TO be background !! ## How to change parameters of the database ? From c296d48a03c4f7978614d63c76140aa0d7bdfcf4 Mon Sep 17 00:00:00 2001 From: VoNZproject Date: Tue, 2 May 2017 16:01:01 +1200 Subject: [PATCH 21/24] Remove mistake --- templates/part.content.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/part.content.php b/templates/part.content.php index 2ad8f34..3bfd0cc 100644 --- a/templates/part.content.php +++ b/templates/part.content.php @@ -33,7 +33,7 @@ - + From a02813dd6586960fa977efdc8f263c51d1da19fe Mon Sep 17 00:00:00 2001 From: VoNZproject Date: Wed, 10 May 2017 14:41:36 +1200 Subject: [PATCH 22/24] Update part.content.php --- templates/part.content.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/part.content.php b/templates/part.content.php index 3bfd0cc..cd494ae 100644 --- a/templates/part.content.php +++ b/templates/part.content.php @@ -108,7 +108,7 @@
    - +
    From 26cea5ffabf1cb7d15a8f7fe7e3cc527719cacba Mon Sep 17 00:00:00 2001 From: VoNZproject Date: Thu, 11 May 2017 09:47:00 +1200 Subject: [PATCH 23/24] default parameters Changes to have 'other' as default parameter --- templates/part.content.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/part.content.php b/templates/part.content.php index cd494ae..d833b94 100644 --- a/templates/part.content.php +++ b/templates/part.content.php @@ -19,9 +19,9 @@
    @@ -30,6 +30,7 @@
    @@ -62,9 +62,9 @@
    @@ -73,6 +73,7 @@
    @@ -133,9 +133,9 @@
    @@ -144,9 +144,9 @@
    From 0710d245c496196a5d291fe71195686696704bf4 Mon Sep 17 00:00:00 2001 From: VoNZproject Date: Thu, 1 Jun 2017 09:36:26 +1200 Subject: [PATCH 24/24] improve view Replace L1/L2 by Mother tongue/Second language Add a unit to nztime Remove useless button --- templates/part.content.php | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/templates/part.content.php b/templates/part.content.php index d833b94..f8444c0 100644 --- a/templates/part.content.php +++ b/templates/part.content.php @@ -52,7 +52,6 @@
    -
    @@ -63,14 +62,14 @@
    - +
    @@ -108,7 +107,7 @@
    - +
    @@ -134,14 +133,14 @@
    - +
    @@ -173,7 +172,6 @@
    -