Browse Source

Editing an item with an event is now opeing the event edit form.

tags/3.4.3
Michael Vogel 3 years ago
parent
commit
316276cb6d
2 changed files with 10 additions and 3 deletions
  1. 4
    0
      mod/events.php
  2. 6
    3
      object/Item.php

+ 4
- 0
mod/events.php View File

@@ -154,6 +154,7 @@ function events_post(&$a) {
154 154
 	if(! $cid)
155 155
 		proc_run('php',"include/notifier.php","event","$item_id");
156 156
 
157
+	goaway($_SESSION['return_url']);
157 158
 }
158 159
 
159 160
 
@@ -165,6 +166,9 @@ function events_content(&$a) {
165 166
 		return;
166 167
 	}
167 168
 
169
+	if($a->argc == 1)
170
+		$_SESSION['return_url'] = $a->get_baseurl() . '/' . $a->cmd;
171
+
168 172
 	if(($a->argc > 2) && ($a->argv[1] === 'ignore') && intval($a->argv[2])) {
169 173
 		$r = q("update event set ignore = 1 where id = %d and uid = %d",
170 174
 			intval($a->argv[2]),

+ 6
- 3
object/Item.php View File

@@ -117,9 +117,12 @@ class Item extends BaseObject {
117 117
 			? t('Private Message')
118 118
 			: false);
119 119
 		$shareable = ((($conv->get_profile_owner() == local_user()) && ($item['private'] != 1)) ? true : false);
120
-		if(local_user() && link_compare($a->contact['url'],$item['author-link']))
121
-			$edpost = array($a->get_baseurl($ssl_state)."/editpost/".$item['id'], t("Edit"));
122
-		else
120
+		if(local_user() && link_compare($a->contact['url'],$item['author-link'])) {
121
+			if ($item["event-id"] != 0)
122
+				$edpost = array($a->get_baseurl($ssl_state)."/events/event/".$item['event-id'], t("Edit"));
123
+			else
124
+				$edpost = array($a->get_baseurl($ssl_state)."/editpost/".$item['id'], t("Edit"));
125
+		} else
123 126
 			$edpost = false;
124 127
 		if(($this->get_data_value('uid') == local_user()) || $this->is_visiting())
125 128
 			$dropping = true;

Loading…
Cancel
Save