示例#1
0
 public static function getActivityStatus($activityId)
 {
     $db = new Model_ActivityStatus();
     return $db->getActivityStatus($activityId);
 }
示例#2
0
 public function updateReportingOrgAction()
 {
     $reportingOrgId = $this->_getParam('id');
     $activityId = $this->_getParam('activity_id');
     $model = new Model_ReportingOrg();
     $model->updateReportingOrg($reportingOrgId);
     $activityId = $model->getActivityIdById($reportingOrgId);
     //Update Activity Hash
     $activityHashModel = new Model_ActivityHash();
     $updated = $activityHashModel->updateActivityHash($activityId);
     if (!$updated) {
         $type = 'message';
         $message = "Already up to date. To make changes please change\n                values in 'Settings' and then update.";
     } else {
         //update the activity so that the last updated time is updated
         $this->updateActivityUpdatedDatetime($activityId);
         //change state to editing
         $db = new Model_ActivityStatus();
         $db->updateActivityStatus($activityId, Iati_WEP_ActivityState::STATUS_DRAFT);
         $type = 'message';
         $message = "Updated Reporting Organisation sucessfully";
     }
     $this->_helper->FlashMessenger->addMessage(array($type => $message));
     $this->_redirect("/activity/edit-element/?activity_id=" . $activityId . "&className=Activity_ReportingOrg");
 }