diff --git a/Layer-0__Site_entry_point/doc/GNUHerds__SQL_Implementation.sql b/Layer-0__Site_entry_point/doc/GNUHerds__SQL_Implementation.sql
index f4fbc13..bcc56d3 100644
--- a/Layer-0__Site_entry_point/doc/GNUHerds__SQL_Implementation.sql
+++ b/Layer-0__Site_entry_point/doc/GNUHerds__SQL_Implementation.sql
@@ -357,9 +357,13 @@ CREATE TABLE E1_Entities ( -- This table keeps the 'Person', 'Company' and 'non-
CREATE TABLE A1_Alerts ( -- Alerts about anything: job offers, etc.
A1_E1_Id integer PRIMARY KEY REFERENCES E1_Entities(E1_Id) NOT NULL,
+ -- Alerts
A1_NewJobOffer bool NOT NULL DEFAULT 'true', -- Alert me when _any_ new job offer is added.
A1_NewDonationPledgeGroup bool NOT NULL DEFAULT 'false', -- Alert me when _any_ new donation-pledge-group is added.
- A1_NewLookForVolunteers bool NOT NULL DEFAULT 'false' -- Alert me when _any_ new look-for-volunteers is added.
+ A1_NewLookForVolunteers bool NOT NULL DEFAULT 'false', -- Alert me when _any_ new look-for-volunteers is added.
+
+ -- Alerts behavior
+ A1_AlertMeOnMyOwnNotices bool NOT NULL DEFAULT 'true' -- Determines if the entity should be alerted on its own notices too.
);
diff --git a/Layer-0__Site_entry_point/templates/Alerts_form.tpl b/Layer-0__Site_entry_point/templates/Alerts_form.tpl
index 4475e33..645f5cd 100644
--- a/Layer-0__Site_entry_point/templates/Alerts_form.tpl
+++ b/Layer-0__Site_entry_point/templates/Alerts_form.tpl
@@ -22,7 +22,7 @@ program in the COPYING file. If not, see
{t}Alerts via email on:{/t}
-
@@ -56,6 +56,27 @@ program in the COPYING file. If not, see |
{t}Alerts behavior:{/t}
+ +
+
+
+ + + |
+
diff --git a/Layer-0__Site_entry_point/themes/green_Davi/css/screen.css b/Layer-0__Site_entry_point/themes/green_Davi/css/screen.css
index 18e8c8a..aa394d8 100644
--- a/Layer-0__Site_entry_point/themes/green_Davi/css/screen.css
+++ b/Layer-0__Site_entry_point/themes/green_Davi/css/screen.css
@@ -401,9 +401,9 @@ border-top:none;
}
-/* content area: Setting for Create Entries */
+/* content area */
-#new_offer{
+.margin{
margin-left:30px;
}
diff --git a/Layer-0__Site_entry_point/themes/red_Danijel/css/screen.css b/Layer-0__Site_entry_point/themes/red_Danijel/css/screen.css
index 594482f..94ed84f 100644
--- a/Layer-0__Site_entry_point/themes/red_Danijel/css/screen.css
+++ b/Layer-0__Site_entry_point/themes/red_Danijel/css/screen.css
@@ -404,7 +404,7 @@ border-top:none;
/* content area: Setting for Create Entries */
-#new_offer{
+.margin{
margin-left:30px;
}
diff --git a/Layer-2__Business_logic/content/forms/Alerts_form.php b/Layer-2__Business_logic/content/forms/Alerts_form.php
index 1bd496d..6ae4117 100644
--- a/Layer-2__Business_logic/content/forms/Alerts_form.php
+++ b/Layer-2__Business_logic/content/forms/Alerts_form.php
@@ -87,6 +87,11 @@ class AlertsForm
else
$_POST['NewLookForVolunteers'] = "false";
+ if (isset($_POST['AlertMeOnMyOwnNotices']) and $_POST['AlertMeOnMyOwnNotices']=='on')
+ $_POST['AlertMeOnMyOwnNotices'] = "true";
+ else
+ $_POST['AlertMeOnMyOwnNotices'] = "false";
+
$this->manager->saveAlertsForEntity();
$this->processingResult .= "
".gettext('Updated successfully')." \n"; } @@ -111,6 +116,11 @@ class AlertsForm else $this->data['NewLookForVolunteers'] = "false"; + if($result['AlertMeOnMyOwnNotices'][0]=='t') + $this->data['AlertMeOnMyOwnNotices'] = "true"; + else + $this->data['AlertMeOnMyOwnNotices'] = "false"; + return true; } } diff --git a/Layer-5__DB_operation/Alerts.php b/Layer-5__DB_operation/Alerts.php index b2b732e..45b1a37 100644 --- a/Layer-5__DB_operation/Alerts.php +++ b/Layer-5__DB_operation/Alerts.php @@ -39,12 +39,13 @@ class Alerts public function getAlertsForEntity() { // The row have to be present in the data base, else we can be sure the data base is corrupted. - $sqlQuery = "PREPARE query(integer) AS SELECT A1_NewJobOffer,A1_NewDonationPledgeGroup,A1_NewLookForVolunteers FROM A1_Alerts WHERE A1_E1_Id=$1; EXECUTE query('{$_SESSION['EntityId']}');"; + $sqlQuery = "PREPARE query(integer) AS SELECT A1_NewJobOffer,A1_NewDonationPledgeGroup,A1_NewLookForVolunteers,A1_AlertMeOnMyOwnNotices FROM A1_Alerts WHERE A1_E1_Id=$1; EXECUTE query('{$_SESSION['EntityId']}');"; $result = $this->postgresql->getPostgreSQLObject($sqlQuery,1); $array['NewJobOffer'] = pg_fetch_all_columns($result, 0); $array['NewDonationPledgeGroup'] = pg_fetch_all_columns($result, 1); $array['NewLookForVolunteers'] = pg_fetch_all_columns($result, 2); + $array['AlertMeOnMyOwnNotices'] = pg_fetch_all_columns($result,3); return $array; } @@ -52,7 +53,7 @@ class Alerts public function saveAlertsForEntity() { // The row have to be present in the data base, else we can be sure the data base is corrupted. - $sqlQuery = "PREPARE query(bool,bool,bool,integer) AS UPDATE A1_Alerts SET A1_NewJobOffer=$1,A1_NewDonationPledgeGroup=$2,A1_NewLookForVolunteers=$3 WHERE A1_E1_Id=$4; EXECUTE query('{$_POST['NewJobOffer']}','{$_POST['NewDonationPledgeGroup']}','{$_POST['NewLookForVolunteers']}','{$_SESSION['EntityId']}');"; + $sqlQuery = "PREPARE query(bool,bool,bool,bool,integer) AS UPDATE A1_Alerts SET A1_NewJobOffer=$1,A1_NewDonationPledgeGroup=$2,A1_NewLookForVolunteers=$3,A1_AlertMeOnMyOwnNotices=$4 WHERE A1_E1_Id=$5; EXECUTE query('{$_POST['NewJobOffer']}','{$_POST['NewDonationPledgeGroup']}','{$_POST['NewLookForVolunteers']}','{$_POST['AlertMeOnMyOwnNotices']}','{$_SESSION['EntityId']}');"; $this->postgresql->execute($sqlQuery,1); } |