CPF input

User profile fields ::: profilefield_cpf
Maintained by Willian Mano
A cpf profile field type for moodle
Latest release:
173 sites
184 downloads
10 fans
Current versions available: 2

This is a CPF field to user profiles into moodle.

The Cadastro de Pessoas Físicas (CPF) – Portuguese for Natural Persons Register – is a number attributed by the Brazilian revenue agency (Receita Federal – Federal Revenue) to both Brazilians and resident aliens who pay taxes or take part, directly or indirectly, in activities that provide revenue for any of the dozens of different types of taxes existing in Brazil.

More about CPF: http://en.wikipedia.org/wiki/Cadastro_de_Pessoas_F%C3%ADsicas

For Everyone

This plugin was made to add possibility to add CPF field in the user profile form.

Moodle documentation about profilefields -> http://docs.moodle.org/26/en/User_profile_fields

I recommend to insert a mask plugin to the CPF field. I did as follows:

- Added the Jquery masked Input plugin -> http://digitalbush.com/projects/masked-input-plugin/
- Added the follow code relative to the masked field into the selected theme file:
jQuery("#profilefield_cpf").mask("999.999.999-99");

Para Brasileiros

Como CPF é um padrão brasileiro, a explicação será em português. smile
Este plugin foi criado para possibilitar a inclusão do campo cpf nos formulários de criação de novos usuários e também na alteração dos dados do usuário.

Documentação de como utilizar os profilefields -> http://docs.moodle.org/26/en/User_profile_fields

Recomendo inserir um plugin de máscara para o campo CPF. Eu fiz da seguinte forma:
- Adicionei o plugin Jquery masked Input -> http://digitalbush.com/projects/masked-input-plugin/
- Adicionei o seguinte código referente à mascara do campo no tema utilizado:
jQuery("#profilefield_cpf").mask("999.999.999-99");

Screenshots

Screenshot #0

Contributors

Willian Mano (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Comments

  • Anthony Borrow
    Wed, 23 Apr 2014, 3:33 AM
    Willian - Obrigado por compartilhar this plugin with the Moodle community. I would encourage you to at least add a brief explanation in the README in English and possibly include a reference to http://en.wikipedia.org/wiki/Cadastro_de_Pessoas_F%C3%ADsicas or something similar that explains what the CPF field is. I was successfully able to install the plugin ad it appears to function as expected.

    Please review http://docs.moodle.org/dev/Plugin_validation#Recommended_URLs and then edit the plugin entry to provide the source, tracker, and documentation URLs that will enable others in the community to more actively participate in using and maintaining this plugin.

    From your previous contribution I was able to find your Github repositories which led me to https://github.com/willianmano/profilefield_cpf. In order to provide a consistent experience for Modle developers and site administrators, it is recommended to follow the repository naming convention for Moodle plugins, namely, moodle-{plugintype}_{pluginname}. The recommended repository name for this plugin would be:

    moodle-profilefield_cpf

    Would you consider renaming your Github repository so that it conforms with the naming convention? I do my best to encourage following the naming convention for consistency and to have that name correct before we approve the plugin. With the ranking block, you are using Moodle Tracker for tracking issues. Would you like me to create a component for this plugin as well. Similarly, you created a page in Moodle Docs and I would encourage you to do the same for this one; however, given the simplicity of user profile fields, you may just want to point to the README url.

    Please consider adding a screen shot of your plugin to help folks get an idea of what it looks like when installed.

    It is encouraged to follow Moodle's coding style as outlined in:

    http://docs.moodle.org/dev/Coding_style
    http://docs.modle.org/dev/Coding

    The code checker plugin can be quite helpful in fine tuning your code and can be found at:

    https://moodle.org/plugins/view.php?plugin=ocal_odechecker

    You may wish to consider using that tool to further improve your plugin. Below, are the initial results:

    Files found: 6

    user/profile/field/cpf/define.class.php - 3 error(s) and 0 warning(s)
    user/profile/field/cpf/lang/pt_br/profilefield_cpf.php - 2 error(s) and 0 warning(s)
    user/profile/field/cpf/lang/en/profilefield_cpf.php - 2 error(s) and 0 warning(s)
    user/profile/field/cpf/version.php - 1 error(s) and 0 warning(s)
    user/profile/field/cpf/field.class.php - 21 error(s) and 1 warning(s)
    user/profile/field/cpf/README.txt - 1 error(s) and 1 warning(s)

    Total: 30 error(s) and 2 warning(s)

    Most of them seemed to be white space related so nothing major or needing urgent attention.

    Overall, things look pretty good. Once we get the source, tracker and documentation URLs setup I think we can go ahead and approve this plugin. Please do not hesitate to let me know if there is anything I can do to be supportive of your efforts. Peace - Anthony
  • Anthony Borrow
    Wed, 23 Apr 2014, 5:02 AM
    For now, I am going to mark this plugin as needing more work until we get the above issues resolved.
  • Anthony Borrow
    Wed, 23 Apr 2014, 5:03 AM
    oops, the link for code checker should be https://moodle.org/plugins/view.php?plugin=local_codechecker
  • Willian Mano
    Sat, 3 May 2014, 6:44 AM
    Hey Anthony, it's very good see you again. xD

    Please, if you can, create the bug tracker for that plugin.

    In code checker i could not solve the problem with the first line of the script. If you can help me i will be very happy.
  • Plugins bot
    Mon, 26 May 2014, 5:32 AM
    Thanks for sharing this plugin with the Moodle community. Some formal issues were detected and reported by our automated plugin checker tool. Please review all the plugin checker results and fix the issues mentioned, if possible. These changes are typically pretty easy to make but if you have any questions just let us know.
  • Anthony Borrow
    Mon, 26 May 2014, 12:48 PM
    Willian,

    I have created the tracker component and added the link. Many thanks for addressing the other issues. I am going to approve this. Peace - Anthony

    p.s. - As for the extra line at the beginning of the file I would add the boilerplate to those files so that you get something like:
    <?php
    // This file is part of Moodle - http://moodle.org/
    //
    // Moodle is free software: you can redistribute it and/or modify
    // it under the terms of the GNU General Public License as published by
    // the Free Software Foundation, either version 3 of the License, or
    // (at your option) any later version.

    that should resolve the issue for you.
  • Weber Ribeiro
    Mon, 2 Mar 2015, 8:09 PM
    Olá Willian bom dia! Rapaz, mto bacana sua contribuição, mas me tira uma dúvida, esse plugin faz tb validação do CPF? Pq eu abri o código fonte e teoricamente deveria fazer, mas na prática não está funcionando, é isso mesmo, ou existe algum bug?

    Mias uma fez obrigado.
  • Diego Macêdo
    Thu, 10 Mar 2016, 6:21 AM
    Oi Willian! Boa iniciativa! Sem atualizações para a versão 3.0?
    Abs!!
  • Murilo Timo Neto
    Mon, 28 Nov 2016, 7:03 AM
    Willian como vc acrecentou o javascript? vc utilizou o módulo amd?

    tem como mandar um exemplo?
  • eduk ead
    Sun, 1 Nov 2020, 12:18 AM
    Olá William, existe a possibilidade de colcoar o CPF como base para que o aluno faça login e senha através do CPF?
  • Willian Mano
    Wed, 4 Nov 2020, 9:46 PM
    eduk ead use o cpf no campo username
  • Cintya Souza
    Wed, 24 Aug 2022, 5:50 AM
    É possível usar esse plugin no IOMAD?
  • Willian Mano
    Thu, 15 Sept 2022, 9:25 AM
    É possível sim.
  • Leonardo Chaves dos Santos
    Thu, 31 Aug 2023, 8:44 PM
    Acredito que não esteja 100% compatível com o moodle 4.1, apesar de passar na validação da instalação houve problemas ao editar o campo e ao realizar login na plataforma.
  • Willian Mano
    Thu, 31 Aug 2023, 10:07 PM
    Leonardo Chaves dos Santos o campo é para adicionar a informação de cpf no perfil do usuário, ele não serve para fazer login na plataforma.
Please login to post comments