Synopsis

This module is related to a Todoist.com website. Todoist is a powerful task manager for personal or collaborative productivity that lets you manage your to do list. reminders are sent over email for Free users. This module enables user to do all this from Drupal website.

Similar projects and how they are different

Date Reminder: D7 version and its saved all the task to Drupal database and didn't use any 3rd party api whereas Todoist Api module brings ToDoist.com functionality to your Drupal site and uses 3rd party api to communicate with Todoist.com. It doesn't use Drupal database to saved task.

Requirements

No

Project Page

https://www.drupal.org/sandbox/manav/2531634

pareview.sh review

https://pareview.sh/node/949

Git Instructions

git clone --branch 7.x-1.x https://git.drupal.org/sandbox/Manav/2531634.git todoist_api

How to Use

Here are the steps to use ToDoist Api module:

Install:

  1. Clone/Download module to siltes/all/modules directory
  2. Enable ToDoist api module (via drush or by Drupal's Extend page)

Configure:

On Todoist website

  • First you have to signup or login on Todoist.com.
  • After sign-up/login on Todoist official website, please go to user account section and here you have to create an api key.

On your Drupal website

  • Copy the API key (which you have created on Todoist official website) and paste it to your Drupal website under Todoist configuration setting: 

    Administration » User interface » Todoist configuration

  • Now you get all your task, which you created on Todoist official website or you can able to edit/delete/complete task here.

    Administration » Content » Todoist

    You can also add new task here. Every time when you create new task or edited any task, this will save on your Todoist.com account automatically.

Manual reviews of other projects

Comments

Manav created an issue. See original summary.

manav’s picture

Issue summary: View changes
harishh’s picture

Status: Needs review » Needs work

Please add hook_uninstall and add variable_del for "todoist_api_user_token" variable.

yogeshmpawar’s picture

Title: ToDoist API [D7] » [D7] ToDoist API
manav’s picture

Assigned: Unassigned » manav
Status: Needs work » Needs review

Thanks @harish.h for your comment.
I have added the hook_uninstall() under .install file to uninstall 'todoist_api_user_token' variable.

manav’s picture

Assigned: manav » Unassigned
manav’s picture

jaykandari’s picture

Status: Needs review » Reviewed & tested by the community

HI @manav,

Awesome module. Integrates very well with Todoist.

Manual Review:

* Code Looks Good.
* Coder & https://pareview.sh/node/949 returned no issues.
* Installed and tested its functionality, works great.

Extra Suggestions:
* Add a documentation to look for "API Token" in todoist.com, which is under "todoist settings > Account > API token".
* Also, if you could change the description of API field at /admin/config/user-interface/todoistto be more specific from "Add Todoist user token" to "Add Todoist user API token"

Rest looks good to me. Thanks for contribution!

manav’s picture

Thanks @JayKandari
for your review and i have done the relevant changes.

poojasharmaece’s picture

Status: Reviewed & tested by the community » Needs work

Hi Manav ,

Nice Module and Working fine for me.

My findings are :

All user facing text should be passed through t().
Examples are :

      $header = array(
        array('data' => 'Task', 'sort' => 'asc'),
        array('data' => 'Task added date'),
        array('data' => 'Task due date'),
        array('data' => 'Action', 'colspan' => 3),
      );

!empty($node['date_string']) ? $node['date_string'] : 'No due date',

'empty' => 'No task created...',

And your hook_help data also.

manav’s picture

Assigned: Unassigned » manav

Thanks @poojasharmaece for your valuable comment.

manav’s picture

Assigned: manav » Unassigned
Status: Needs work » Needs review

@poojasharmaece i have done all the changes according to you.

jaykandari’s picture

Status: Needs review » Reviewed & tested by the community

Dear @manav,

re-tested the module, Looks good to me. Suggestions in #10 also implemented.

Thanks!

poojasharmaece’s picture

Hi Manav,

Still i can see : hook_help data is not passed through t()

$output .= '<p>This module intregate todoist api functionality in drupal
    project. Using this module user can access their todoist.com account basic
    functionality in drupal project. They can add, edit, delete and complete
    their task. They will get remender mail time to time sent by
    todoist.com.</p>';
    $output .= '<ul><li><b>On Todoist website</b>
    <ul><li>First you have to signup or login on Todoist.com.</li>
    <li>After sign-up/login on Todoist official website, please go to
    user account section and here you have to create an api key.
    <p>Settings > Account > API token</p></li></ul>
    </li>
    <li><b>On your Drupal website</b>
    <ul><li>Download this module under sites/all/module and enable it.</li>
    <li>Copy the API key (which you have created on Todoist official website)
    and paste it to your Drupal website under Todoist configuration setting.
    <p>Administration » User interface » Todoist configuration</p></li>
    <li>Now you get all your task, which you created pervious on Todoist
    official website or you can able to edit/delete task here
    <p>Administration » Content » Todoist</p> You can also add new task here.
    Every time when you create new task or edited any task, this will save
    on your Todoist.com account automatically.</li></ul>
    </li>
    </ul>';
manav’s picture

Assigned: Unassigned » manav

ohhk i do it. Thanks for your comment.

manav’s picture

Assigned: manav » Unassigned

Hi @poojasharmaece
I have done all the changes as mentioned in 14

jeetendrakumar’s picture

Status: Reviewed & tested by the community » Needs work

Hello Manav,

I have found some issues with application:

1. When I install module. It's show me following warning message:

User warning: The following modules is missing from the file system: todoist. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1128 of C:\xampp\htdocs\drupal\includes\bootstrap.inc).

2. There are no title with configuration form and when we submit form without any data it does not display any error message. Please see attached image.

3. Please use define() for API URL or you can get this information from configuration form.

define('API_URL', "https://todoist.com/API/v7/sync?");

jeetendrakumar’s picture

StatusFileSize
new11.1 KB
manav’s picture

Assigned: Unassigned » manav
manav’s picture

Assigned: manav » Unassigned
Status: Needs work » Needs review

Hi jeetendrakumar,

I have solved all the issue please take pull of my latest code and review it again.

Thanks

PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

manojbisht_drupal’s picture

Status: Needs review » Reviewed & tested by the community

Module is working fine. Moving it to RTBC.

navneet0693’s picture

Status: Reviewed & tested by the community » Needs work

Manual Review

Filename: todoist_api.admin.inc

/**
 * Implements hook_form().
 */

It's not a proper comment. Refer here for all hooks information.

'#description' => t('Get your ToDoist API token from
      <a href="@token">todoist.com</a>.',
      array("@token" => "https://todoist.com/")),
    

You can use placeholders and l() function to achieve this, instead of using anchor tags. Like:

'#description' => t('Get your ToDoist API token from !todoist.', array(
      "!todoist" => l('todoist', "https://todoist.com/")
    )),

This can be improved at several places in module.

$form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
  );

/**
 * Implements Submit handler for todoist_config_form().
 */
function todoist_api_config_form_submit($form, $form_state) {
  if ($form_state['values']['todoist_api_user_token']) {
    variable_set('todoist_api_user_token', $form_state['values']['todoist_api_user_token']);
    drupal_set_message(t('Your configuration has been saved.'));
    $form_state['rebuild'] = TRUE;
  }
}

You can use return system_settings_form($form); instead of writing an additional submit handler until and unless you are trying to achieve something else. I assume here that you are only trying to save variable value from form.

if (!isset($form_state['values']['todoist_api_user_token']) || $form_state['values']['todoist_api_user_token'] == '') {

You can !empty() to achieve the same. Please refer here.

form_set_error('Token', t('Please enter ToDoist Api Token value.'));
form_set_error expects first parameter to be the name of form element, it should be: form_set_error('todoist_api_user_token', t('Please enter ToDoist Api Token value.'));.
Also you have used #required which will automatically do the end required task, else condition of validation will be just fine!

$http_result->status_message !== 'OK'
Suggestion: !=

$user_apicall = TODOIST_API;
  $user_apicall .= 'token=' . $token;
  $http_result = drupal_http_request($user_apicall);
  

You are using these more than once, I would recommend to make it as helper function which accepts $token as parameter. Or, if its possible use it only at the time of validation and not in module file :-) as you have already verified the token.

Filename: todoist.module

if (!($http_result->code == 0)) {
Suggestion: if ($http_result->code != 0)

Filename: todoist_api.inc

$form['cancel'] = array(
    '#type' => 'submit',
    '#value' => t('Cancel'),
  );

Cancel button will never act as cancel button. See attached screenshot.

$ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $apicall);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_exec($ch);

Can be moved to a helper function.

navneet0693’s picture

Status was changed to RTBC by Manoj while I was writing the reviews . So changed it again to Needs Work!

navneet0693’s picture

StatusFileSize
new53.3 KB

Forgot to add the screenshot, my bad.

manav’s picture

Assigned: Unassigned » manav
manav’s picture

I have done the changes.

manav’s picture

Assigned: manav » Unassigned
Status: Needs work » Needs review
navneet0693’s picture

Status: Needs review » Reviewed & tested by the community

Clear to go now :-), major blockers are resolved.

visabhishek’s picture

Status: Reviewed & tested by the community » Fixed

Review of the 7.x-1.x branch (commit c1c0bcf):

No automated test cases were found, did you consider writing Simpletests or PHPUnit tests? This is not a requirement but encouraged for professional software development.

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.

1: Update the message
drupal_set_message(t('1 task successfully edit.'));

like : 1 task updated successfully.

2: I can see the commit message are repeating
example :

Commit 317a945 on 7.x-1.x
by Manav

update all file with new changes according to the issue comment on project application page.

February 21, 2017 16:47
Commit e290d79 on 7.x-1.x
by Manav

update all file with new changes according to the issue comment on project application page.

February 21, 2017 16:40
Commit 9b82570 on 7.x-1.x
by Manav

update all file with new changes according to the issue comment on project application page.

Please follow the pattern : https://www.drupal.org/node/52287 for commit messages.

other wise all looks good for me.

Thanks for your contribution, Manav!

I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

visabhishek’s picture

Assigning Credits.

manav’s picture

Thanks @visabhishek Will review the materials you provided and continue to stay involved in the review process.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.