Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This is a patch for issue #1 #2

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

March-hare
Copy link

Please let me know if you have any questions, Thanks!

@jetherton
Copy link
Owner

The purpose of this plugin is to record when an event stopped. For example if there was a riot from 9pm to 11pm we would want to capture that information in a report. This way, people viewing the report after the riot had finished would know if the riot lasted all night, or just a couple of hours. For the purposes that the plugin was created it would be detrimental if the plugin removed the report from the map.

However, I can certainly see where you would want the report to be removed if the end time has passed.

What do you think of adding a setting that would allow the user to chose whether or not the reports are removed form the map once the end time has passed?

@March-hare
Copy link
Author

Great Idea, It seems that there are two separate use cases for this module. Therefore I suppose this should be a global setting and not an incident by incident setting. I will add this feature then submit a separate pull request.

@jetherton
Copy link
Owner

Also, I just realized that you don't add the schedule to the database, thus it will never be run.

@March-hare
Copy link
Author

Duh! Computers are hard to use! I did update libraries/entime_installer.php to do this on module install and un-install. It looks like I never checked it in. This will be included with the next pull request.

@jetherton
Copy link
Owner

No worries. I've done that before myself.

Mr. Evoltech added 5 commits December 13, 2011 22:47
  - Even though the incident is active it does not show up on the map?
  Something is setting it to be inactive too quickly and inacurately?
  It seems the scheduler is called on frontpage refreshes.  And it is
  incorrectly setting it inactive.  The problem is that the where
  query for comparing the time to now() is getting compared to the string
  'NOW()' I fixed this by getting the date from php ala
  date("Y-m-d H:i:s") instead of from mysql.  I am not sure if this
  will cause an issue with the application time zone settings vs the
  system time zone settings.  I am not even sure if there is such a
  thing in Ushahidi/Kohana.
cause multiple rows to be added to the scheduler table.
to track what the user wants to do when the incident reaches endtime
The first implemented feature is removing an incident from the map
by de-activating it.
@evoltech
Copy link

Ok this implements the ability to have an incident de-activated as configurable per incident. I think this is desirable because it allows for either option to happen on incident endtime. It also sets up the plugin to support other actions on endtime.

Possibly another solution could be this plugin invoking an action something like:
Event::run('endtime.ended')

But there is no way to pass arguments so it seems that effort would be duplicated by other modules "add"ing those events. I see the concept of triggering actions at incident endtime to be very useful and think the best place to implement those actions is in this plugin. What do you think?

@evoltech
Copy link

Also I dont see anyway to upgrade the schema's used by plugins the way ushahidi core maintains schema updates. I made a change to the plugins schema but have no idea how to provide an upgrade path for existing users. Do you?

@jetherton
Copy link
Owner

When I enable the plugin and go to /admin/reports/edit/7 I got an error saying:

The remain_on_map property does not exist in the Endtime_Model class.

This only happens when looking at a preexisting report, and not when creating a new report.

In terms of upgrading the database schema, I usually set it up so that ushahidi checks the tables and columns that are present and then runs the needed SQL as required. That way to upgrade you'd just disable, then re-enable a plugin.

@evoltech
Copy link

we are removing this additional functionality from our pull request and are currently working on a new branch that will be a lot less new features add, but will be a smaller set of changes that will allow someone to override the endtime module so that people extending it can still make use of your work, but can add features they want. I will submit a new pull request when we are done.

These commits allow the decayimage to extend some of the functionality
of the endtime module.  Later down the line this will be cleaned up and
all decayimage related code will be removed them we will submit another
pull request to jetherton.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants