When the published status of an Event is changed, the related ExtCal "approved" value is not updated. Add the following code to "admin.mls_events.php::changeMLS_events" to resolve. :) function changeMLS_events( $cid, $value, $type, $option ) { global $database, $my, $cnf_mls_events; $row = new mosMLS_events($database); $query = "UPDATE `#__mls_events` SET `".$type."`='".$value."' WHERE `".$row->_tbl_key."` IN (".implode(",",$cid).")"; $database->setQuery($query); $database->query(); if($type == "active" && $value == 1) { $query = "UPDATE `#__mls_events` SET `".$type."`='0' WHERE `".$row->_tbl_key."` NOT IN (".implode(",",$cid).")"; $database->setQuery($query); $database->query(); } if($type == "published") { foreach($cid as $id) { $database->setQuery( "UPDATE `#__menu` SET `published`='".$value."' WHERE `menutype`='eventmenu' AND `link` LIKE '%eventid=".$id."%'" ); $database->query(); } //ExtCal 2 integration if($cnf_mls_events["extcal_integration"]) { //Integration is enabled... switch($cnf_mls_events["extcal_approve_mode"]) { case 1: // Always Approve Enabled break; case 2: $database->setQuery( "SELECT `extcal_id` FROM `#__mls_events` WHERE `id` IN (".implode(",",$cid).")" ); $events = $database->loadObjectList(); foreach($events as $event) { $extids .= (!$extids)?$event->extcal_id:','.$event->extcal_id; } $database->setQuery( "UPDATE `#__extcal_events` SET `approved`='".$value."' WHERE `extid` IN ($extids)" ); $database->query(); break; } } } mosRedirect( "index2.php?option=$option" ); }
/Andrew |