openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

ProjectlistHistoryAction.class.php (839B)


      1 <?php
      2 namespace cms\action\projectlist;
      3 use cms\action\Action;
      4 use cms\action\Method;
      5 use cms\action\ProjectlistAction;
      6 use cms\model\BaseObject;
      7 use cms\model\Permission;
      8 use cms\model\Project;
      9 
     10 class ProjectlistHistoryAction extends ProjectlistAction implements Method {
     11 
     12 
     13 	/**
     14 	 * History of a project.
     15 	 */
     16 	public function view() {
     17 
     18 		$result = Project::getAllLastChanges();
     19 
     20 		// Permission check
     21 		$result = array_filter( $result, function( $object ) {
     22 			$baseObject = new BaseObject($object['objectid']);
     23 			return $baseObject->hasRight( Permission::ACL_READ );
     24 		});
     25 
     26 		$this->setTemplateVar('timeline', $result);
     27     }
     28 
     29 
     30     public function post() {
     31 		throw new \BadMethodCallException();
     32     }
     33 
     34 
     35 	/**
     36 	 * Check permission. This is allowed to all users.
     37 	 * @return bool true
     38 	 */
     39 	function checkAccess()
     40 	{
     41 		return true;
     42 	}
     43 }