From 600ce6fb825731148d3fd329a681dbe56ee09e9e Mon Sep 17 00:00:00 2001 From: jenpaff Date: Tue, 26 Aug 2014 22:17:19 +0200 Subject: [PATCH] fix opportunities-page * fix submit_opportunities available_until field * add_info optional --- application/controllers/opportunities.php | 8 +------- application/i18n | 2 +- sql/upgrade118-119.sql | 4 ++-- sql/ushahidi.sql | 4 ++-- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/application/controllers/opportunities.php b/application/controllers/opportunities.php index aba1a6ba..6cd5c15c 100755 --- a/application/controllers/opportunities.php +++ b/application/controllers/opportunities.php @@ -70,7 +70,6 @@ public function submit($id = FALSE, $saved = FALSE) // Copy the form as errors, so the errors will be stored with keys // corresponding to the form field names - //$captcha = Captcha::factory(); $errors = $form; $form_error = FALSE; $form_sent = FALSE; @@ -90,10 +89,8 @@ public function submit($id = FALSE, $saved = FALSE) $post->add_rules('available_from', 'required', 'date_mmddyyyy', 'length[3,10]'); $post->add_rules('available_until', 'required', 'date_mmddyyyy', 'length[3,10]'); $post->add_rules('contact', 'required', 'length[3,20]'); - $post->add_rules('add_info', 'required', 'length[3,50]'); + $post->add_rules('add_info', 'length[3,50]'); - // Test to see if things passed the rule checks - // Skip CSRF check since we have a CAPTCHA already if ($post->validate()) { // If valid post to Database @@ -126,9 +123,6 @@ public function submit($id = FALSE, $saved = FALSE) $this->template->content->form_error = $form_error; } - // Inline Javascript - // $this->template->content->date_picker_js = $this->_date_picker_js(); - /** * Opportunities Thanks Page */ diff --git a/application/i18n b/application/i18n index d24b157d..e7d72e34 160000 --- a/application/i18n +++ b/application/i18n @@ -1 +1 @@ -Subproject commit d24b157d3e9691cb4228ab34575fb3249d91e8e9 +Subproject commit e7d72e347902c7ea9e8551721dc893892dcd38f8 diff --git a/sql/upgrade118-119.sql b/sql/upgrade118-119.sql index d36b7671..8170ef41 100644 --- a/sql/upgrade118-119.sql +++ b/sql/upgrade118-119.sql @@ -10,8 +10,8 @@ CREATE TABLE IF NOT EXISTS `opportunities` ( `id` int(11) NOT NULL AUTO_INCREMENT, `resource_available` varchar(75) NOT NULL, `pcv_name` varchar(75) NOT NULL, - `available_from` datetime DEFAULT NULL, - `available_until` datetime DEFAULT NULL, + `available_from` varchar(75) DEFAULT NULL, + `available_until` varchar(75) DEFAULT NULL, `contact` varchar(75) NOT NULL, `add_info` text DEFAULT NULL, PRIMARY KEY (`id`) diff --git a/sql/ushahidi.sql b/sql/ushahidi.sql index 71b98f9e..4f80240f 100755 --- a/sql/ushahidi.sql +++ b/sql/ushahidi.sql @@ -1492,8 +1492,8 @@ CREATE TABLE IF NOT EXISTS `opportunities` ( `id` int(11) NOT NULL AUTO_INCREMENT, `resource_available` varchar(75) NOT NULL, `pcv_name` varchar(75) NOT NULL, - `available_from` datetime DEFAULT NULL, - `available_until` datetime DEFAULT NULL, + `available_from` varchar(75) DEFAULT NULL, + `available_until` varchar(75) DEFAULT NULL, `contact` varchar(75) NOT NULL, `add_info` text DEFAULT NULL, PRIMARY KEY (`id`)