Skip to content

Commit

Permalink
Merge pull request #25 from gocodebox/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Benjamin R. Matthews committed Sep 25, 2015
2 parents 1778aed + c52b120 commit 2aaacb8
Show file tree
Hide file tree
Showing 12 changed files with 4,227 additions and 18 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ LIFTER LMS

CHANGELOG
=========
v1.3.7 - 2015/09/25
-------------------
+ Updates: Adds Spanish translation
+ Updates: Adds new filter 'lifterlms_single_payment_text' to customize single payment string on checkout
+ Updates: Student analytics now indicate which courses a student has completed
+ BugFixes: Resolved security issue with WordPress searches and lessons
+ BugFixes: Fixes analytics bug that potentially arises after a course is deleted

v1.3.6 - 2015/09/18
-------------------
+ BugFixes: Fixes pesky Zend Error that plagued some unfortunate victims
Expand Down
22 changes: 16 additions & 6 deletions includes/class.llms.analytics.php
Original file line number Diff line number Diff line change
Expand Up @@ -844,9 +844,16 @@ public static function get_user_enrollments( $user_id ) {

$post = get_post( $value->post_id );

$results[$key]->post_title = $post->post_title;
$results[$key]->post_type = $post->post_type;

if (isset($post))
{
$results[$key]->post_title = $post->post_title;
$results[$key]->post_type = $post->post_type;
}
else
{
$results[$key]->post_title = '';
$results[$key]->post_type = '';
}
}
}

Expand All @@ -872,9 +879,12 @@ public static function get_courses_by_user_table( $user ) {

$courses_array = array();

foreach ( $user->courses as $course ) {

$course_array = array( $course->post_title, LLMS_Date::db_date( $course->updated_date ), $course->meta_value );
foreach ( $user->courses as $course )
{
$c = new LLMS_Course($course->post_id);
$comp = $c->get_percent_complete($user->id);
$status = ($comp == '100') ? 'Completed' : 'Enrolled';
$course_array = array( $course->post_title, LLMS_Date::db_date( $course->updated_date ), $status );
array_push( $courses_array, $course_array);
}

Expand Down
9 changes: 7 additions & 2 deletions includes/class.llms.course.php
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,12 @@ public function get_lesson_ids() {
* Get the current percent complete by user
* @return int [numerical representation of % completion in course]
*/
public function get_percent_complete() {
public function get_percent_complete($user_id = '') {

if ($user_id == '')
{
$user_id = get_current_user_id();
}

$lesson_ids = $this->get_children_lessons();

Expand All @@ -453,7 +458,7 @@ public function get_percent_complete() {
}

foreach( $array as $key => $value ) {
$user_postmetas = $user->get_user_postmeta_data( get_current_user_id(), $value );
$user_postmetas = $user->get_user_postmeta_data( $user_id, $value );
if ( isset($user_postmetas['_is_complete']) ) {
if ( $user_postmetas['_is_complete']->meta_value === 'yes' ) {
$i++;
Expand Down
4 changes: 2 additions & 2 deletions includes/class.llms.post-types.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ public static function register_post_types() {
'show_ui' => true,
'map_meta_cap' => true,
'publicly_queryable' => true,
'exclude_from_search' => false,
'exclude_from_search' => true,
'hierarchical' => false,
'rewrite' => $course_permalink ? array( 'slug' => untrailingslashit( $course_permalink ), 'with_front' => false, 'feeds' => true ) : false,
'query_var' => true,
Expand Down Expand Up @@ -356,7 +356,7 @@ public static function register_post_types() {
'show_ui' => true,
'map_meta_cap' => true,
'publicly_queryable' => true,
'exclude_from_search' => false,
'exclude_from_search' => true,
'show_in_menu' => 'edit.php?post_type=course',
'show_in_admin_bar' => true,
'hierarchical' => false,
Expand Down
Binary file added languages/lifterlms-es_ES.mo
Binary file not shown.
Loading

0 comments on commit 2aaacb8

Please sign in to comment.