| 
						
						
						
					 | 
					 | 
					@ -1,5 +1,10 @@ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					<?php | 
					 | 
					 | 
					 | 
					<?php | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					/* For licensing terms, see /license.txt */ | 
					 | 
					 | 
					 | 
					/* For licensing terms, see /license.txt */ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					use Chamilo\UserBundle\Entity\User; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					use Chamilo\CoreBundle\Entity\SkillRelUser; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					use Chamilo\CoreBundle\Entity\SkillRelUserComment; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					/** | 
					 | 
					 | 
					 | 
					/** | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 * Show information about all issued badges with same skill by user | 
					 | 
					 | 
					 | 
					 * Show information about all issued badges with same skill by user | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 * | 
					 | 
					 | 
					 | 
					 * | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -58,8 +63,9 @@ $skillInfo = [ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					]; | 
					 | 
					 | 
					 | 
					]; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					$allUserBadges = []; | 
					 | 
					 | 
					 | 
					$allUserBadges = []; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					/** @var SkillRelUser $skillIssue */ | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					foreach ($userSkills as $index => $skillIssue) { | 
					 | 
					 | 
					 | 
					foreach ($userSkills as $index => $skillIssue) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    /** @var User $currentUser */ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    $currentUser = $em->find('ChamiloUserBundle:User', $currentUserId); | 
					 | 
					 | 
					 | 
					    $currentUser = $em->find('ChamiloUserBundle:User', $currentUserId); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    $allowDownloadExport = $currentUser ? $currentUser->getId() === $user->getId() : false; | 
					 | 
					 | 
					 | 
					    $allowDownloadExport = $currentUser ? $currentUser->getId() === $user->getId() : false; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    $allowComment = $currentUser ? Skill::userCanAddFeedbackToUser($currentUser, $user) : false; | 
					 | 
					 | 
					 | 
					    $allowComment = $currentUser ? Skill::userCanAddFeedbackToUser($currentUser, $user) : false; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -98,7 +104,6 @@ foreach ($userSkills as $index => $skillIssue) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    foreach ($skillIssueComments as $comment) { | 
					 | 
					 | 
					 | 
					    foreach ($skillIssueComments as $comment) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $commentDate = api_get_local_time($comment->getFeedbackDateTime()); | 
					 | 
					 | 
					 | 
					        $commentDate = api_get_local_time($comment->getFeedbackDateTime()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $skillIssueInfo['comments'][] = [ | 
					 | 
					 | 
					 | 
					        $skillIssueInfo['comments'][] = [ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            'text' => $comment->getFeedbackText(), | 
					 | 
					 | 
					 | 
					            'text' => $comment->getFeedbackText(), | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            'value' => $comment->getFeedbackValue(), | 
					 | 
					 | 
					 | 
					            'value' => $comment->getFeedbackValue(), | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -108,11 +113,9 @@ foreach ($userSkills as $index => $skillIssue) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    $acquiredLevel = []; | 
					 | 
					 | 
					 | 
					    $acquiredLevel = []; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    $profile = $skillRepo->find($skillId)->getProfile(); | 
					 | 
					 | 
					 | 
					    $profile = $skillRepo->find($skillId)->getProfile(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if (!$profile) { | 
					 | 
					 | 
					 | 
					    if (!$profile) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $skillRelSkill = new SkillRelSkill(); | 
					 | 
					 | 
					 | 
					        $skillRelSkill = new SkillRelSkill(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $parents = $skillRelSkill->get_skill_parents($skillId); | 
					 | 
					 | 
					 | 
					        $parents = $skillRelSkill->get_skill_parents($skillId); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -174,7 +177,11 @@ foreach ($userSkills as $index => $skillIssue) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        exit; | 
					 | 
					 | 
					 | 
					        exit; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    $form = new FormValidator('comment'.$skillIssue->getId(), 'post', $skillIssue->getIssueUrlAll()); | 
					 | 
					 | 
					 | 
					    $form = new FormValidator( | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        'comment'.$skillIssue->getId(), | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        'post', | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        $skillIssue->getIssueUrlAll() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    ); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    $form->addTextarea('comment', get_lang('NewComment'), ['rows' => 4]); | 
					 | 
					 | 
					 | 
					    $form->addTextarea('comment', get_lang('NewComment'), ['rows' => 4]); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    $form->applyFilter('comment', 'trim'); | 
					 | 
					 | 
					 | 
					    $form->applyFilter('comment', 'trim'); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    $form->addRule('comment', get_lang('ThisFieldIsRequired'), 'required'); | 
					 | 
					 | 
					 | 
					    $form->addRule('comment', get_lang('ThisFieldIsRequired'), 'required'); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -190,7 +197,7 @@ foreach ($userSkills as $index => $skillIssue) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if ($form->validate() && $allowComment) { | 
					 | 
					 | 
					 | 
					    if ($form->validate() && $allowComment) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $values = $form->exportValues(); | 
					 | 
					 | 
					 | 
					        $values = $form->exportValues(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $skillUserComment = new Chamilo\CoreBundle\Entity\SkillRelUserComment(); | 
					 | 
					 | 
					 | 
					        $skillUserComment = new SkillRelUserComment(); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $skillUserComment | 
					 | 
					 | 
					 | 
					        $skillUserComment | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            ->setFeedbackDateTime(new DateTime) | 
					 | 
					 | 
					 | 
					            ->setFeedbackDateTime(new DateTime) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            ->setFeedbackGiver($currentUser) | 
					 | 
					 | 
					 | 
					            ->setFeedbackGiver($currentUser) | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -210,7 +217,6 @@ foreach ($userSkills as $index => $skillIssue) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if ($allowDownloadExport) { | 
					 | 
					 | 
					 | 
					    if ($allowDownloadExport) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $backpack = 'https://backpack.openbadges.org/'; | 
					 | 
					 | 
					 | 
					        $backpack = 'https://backpack.openbadges.org/'; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $configBackpack = api_get_setting('openbadges_backpack'); | 
					 | 
					 | 
					 | 
					        $configBackpack = api_get_setting('openbadges_backpack'); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if (strcmp($backpack, $configBackpack) !== 0) { | 
					 | 
					 | 
					 | 
					        if (strcmp($backpack, $configBackpack) !== 0) { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -264,7 +270,6 @@ foreach ($userSkills as $index => $skillIssue) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    $allUserBadges[$index]['acquired_level_form'] = $formAcquiredLevel->returnForm(); | 
					 | 
					 | 
					 | 
					    $allUserBadges[$index]['acquired_level_form'] = $formAcquiredLevel->returnForm(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    $allUserBadges[$index]['badge_error'] = $badgeInfoError; | 
					 | 
					 | 
					 | 
					    $allUserBadges[$index]['badge_error'] = $badgeInfoError; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    $allUserBadges[$index]['personal_badge'] = $personalBadge; | 
					 | 
					 | 
					 | 
					    $allUserBadges[$index]['personal_badge'] = $personalBadge; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					$template = new Template(get_lang('IssuedBadgeInformation')); | 
					 | 
					 | 
					 | 
					$template = new Template(get_lang('IssuedBadgeInformation')); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |