I created a view blocks that might be handy to ship along with Storm so people could keep up on what projects and tickets are open while mucking around in storm. I've attached them. The projects view has two blocks, one for on hold projects and another for open projects. The ticket view only has an open tickets block. On hold tickets didn't seem like a useful block to me, but it's easy enough to create.

I used the export view option to dump these, but I understand the code can be dropped right into module code for inclusion should this be deemed useful.

Comments

juliangb’s picture

Looks useful indeed. These bits of code plug into a stormticket.default-views.inc file or something similar.

The next stage is to plug those into a patch.

flickerfly’s picture

Status: Active » Needs review
StatusFileSize
new9.38 KB

Here's my shot at a patch. Thanks for indicating a file it should be in. That's what kept me from building a patch the first time.

juliangb’s picture

Status: Needs review » Needs work

Not quite as simple as that i'm afraid - will post in more detail later.

juliangb’s picture

This is the page that will explain all - http://views-help.doc.logrus.com/help/views/api-default-views - basically, the file needs some glue at the top and bottom to declare it as a php file, cvs header, and then to establish implement the right hook and return the view.

juliangb’s picture

Since some programs will panic about patching for a new file (although yours seems happy with it) - I've just committed empty views_default.inc files for both project and tickets.

zewa’s picture

Hi ... very usefull script ... how bout showing only the tickets assigned to the current logged in user?
I know it has to be done somehow with Arguments, and passing the $user->uid in but it wont work for me ... dunno how to make the connection between the person and ticket table.

Greetings
Zewa

flickerfly’s picture

Assigned: Unassigned » flickerfly

The new Dashboard has me digging up stuff I hadn't seen in awhile. I'm adding myself to this so I remember to come back when I have some time.

@Zewa, I'll play around with adding that once I've established a patch that meets juliangb's requirements.

zewa’s picture

i've managed the personal tickets by adding an attribute with following php code:

global $user;
$result = db_result(db_query("SELECT p.nid FROM stormperson p WHERE user_uid = %d", $user->uid));

$args[0] = $result;
return $args;
juliangb’s picture

A much better way would be to use the views module - Storm exposes all data as views fields.

For any views work, make sure to use the -dev version or 6.x-1.35 when released as there have been some changes since 6.x-1.34.

zewa’s picture

Well thats exactly what I'm using ... that code above is just the argument for the view, to show only personal tickets.

juliangb’s picture

Ah ok, sorry, I misunderstood.

Would it be possible to export the entire view and post as an attachment?

zewa’s picture

its exactly the one from the first topic + this argument added.
Can't export mine because i use some quite specific additions to it.

Hope its ok for you that way

cdracars’s picture

Ok I have attempted adding the argument as stated by zewa however I keep getting errors...

warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/usao/public_html/storm/includes/bootstrap.inc on line 857.

Not sure what I need to do but I would love to add this view to my storm system.

zewa’s picture

sounds like you have a multiple persons with the same uid or inside stormperson the same person more times.

Just to verify that change the sql statement to this

$result = db_result(db_query("SELECT p.nid FROM stormperson p WHERE user_uid = %d LIMIT 1", $user->uid));

I know its bad code because LIMIT is MySQL specific, but use it just to try out if it works. This would simply take the first person from if more are given.

juliangb’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
Assigned: flickerfly » Unassigned
Status: Needs work » Needs review
Issue tags: +storm-initiative-views

Tagging.

Plus, I want to review the posted patch again.

juliangb’s picture

#2: new_default_views.patch queued for re-testing.

francewhoa’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new145.28 KB

Confirming patch in comment 2 works. Thanks flickerfly and juliangb :)

Using
* Fresh Drupal 6.27
* Storm 2.x-1.x-dev 2012-Oct-20

francewhoa’s picture

I wrote a documentation at http://drupal.org/node/1887252

juliangb’s picture

Version: 6.x-2.x-dev » 7.x-1.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Thanks for testing.

Considering that we've started with the port to Drupal 7 now, we need to have a patch for D7 before D6.

Sorry for the inconvenience, but I'm sure you'll agree this is best practice for the longer term.

francewhoa’s picture

Make sense to me :)

Any volunteer to port this patch? I would be happy to contribute testing.