[Solved] Certificates not showing in module

  • Menzer
  • Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 2 months ago #11 by Menzer
Replied by Menzer on topic Certificates not showing in module
Anyone able to help with this... I have racked my brains now for the last 2 weeks, trying to figure out where and why the certificate module breaks, when conditional activity in moodle is activated.

I have now found that when 'conditional activity' is on in moodle,the conditional data of the course ie pass grade is then stored in a new table called mdl_course_availabilty but I do not know if this is the cause or not...

Any help on this would be appreciated I am sure I am not the only one with this issue
The topic has been locked.
More
13 years 2 months ago #12 by Antonio Durán
Replied by Antonio Durán on topic Certificates not showing in module
Hi Menzer.

Thanks for the detailed bug report.

I have been doing some testing, and I have a new implementation of the my_certificates function, which seems to be working. It would be great if you can test it.

Just replace my_certificates function in moodle/auth/joomdle/auth.php by this one:
Code:
function my_certificates ($username) { global $CFG, $DB; $username = utf8_decode ($username); $username = strtolower ($username); $user = get_complete_user_data ('username', $username); $user_id = $user->id; $cursos = enrol_get_users_courses ($user->id, true); if (!count ($cursos)) return array (); $c_ids = array (); foreach ($cursos as $curso) { $c_ids[] = $curso->id; } $ids_str = implode (',', $c_ids); $params = array ($user_id, $ids_str); $certs = $DB->get_records_sql("SELECT c.name, c.id FROM {$CFG->prefix}certificate c LEFT JOIN {$CFG->prefix}certificate_issues ci ON c.id = ci.certificateid WHERE ci.userid = ? AND c.course in (?) ORDER BY c.name DESC", $params); $c = array (); foreach ($certs as $cert) { $coursemodule = get_coursemodule_from_instance ("certificate", $cert->id); $certificate['id'] = $coursemodule->id; $certificate['name'] = $cert->name; $certificate['date'] = $cert->certdate; $c[] = $certificate; } return $c; }

Please test and let us know if it solves the problem.
The topic has been locked.
More
13 years 2 months ago #13 by Seby Paul
Replied by Seby Paul on topic Certificates not showing in module
Hey,
Thanks Antonio ,
Lemme Try working on it and will find the difficulties..

Regards,
Paul
The topic has been locked.
  • Menzer
  • Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 2 months ago #14 by Menzer
Replied by Menzer on topic Certificates not showing in module
YOU ARE THE MAN!!! This works a treat...

Couple of questions which I hope can help me.

1) I would like to add little features as I am learning OO PHP, I don't really want to hack your core code (to avoid updating issues), so what would you recommend the best way to do this is? also what is the best way to call functions in the auth.php file and view them? to see what the output is...

2) As you have good knowledge with webservices would you think about integrating SugarCRM CE into Joomdle, if not do you have links or docs on how to connect Joomla to SugarCRM
The topic has been locked.
More
13 years 2 months ago #15 by Seby Paul
Replied by Seby Paul on topic Certificates not showing in module
It works awsome..
Thanks & Regards,
Paul
The topic has been locked.
More
13 years 2 months ago #16 by Antonio Durán
Replied by Antonio Durán on topic Certificates not showing in module
Great to know it is working, thanks for all the feedback.

Menzer: please open a new thread for non related questions, so we can close this with the solution.
The topic has been locked.