I would like to recreate demo site http://arhak.s4w.biz/tracker for comment_driven module. In process of doing this I will do my best to write a tutorial on how to do this. I will of course need some help and tips.

As far as I know this are the modules used on that page:
- cck
- comment_driven
- comment_subject
- dhtml_menu
- hierarchical_select
- pathauto
- token
- views

I asume few things.
Cck is used for creating "ticket" content type. Taxonomy is used for "type", "priority" and "status" fileds. Each with its own vocabulary, "status" with 2 levels of terms (here hierarchical_select is used). But I don't know how "assigned" and "project" are connected to "ticket". I guess that "assigned" field is drupal standard users with proper role, but I'm not sure. Don't know what "project" is.
Views is used for displaying tickets, with expose option enabled for filtering ticked based on different fields value. And with arguments options for displaying tickets in paths like category/type/help-request. I think Views is heavily used for displaying tickets and I will have to see how to set
Pathauto is used for automaticaly creating paths like ticket/29 and project/1
As mentioned I don't know what "project" is in this case. I think that this is also custom content type but I don't know how it is related and connected to "ticket" type.
Are there any other things that I should apply in this process?

br,
gapa

[EDIT]
updated demo site URL
see #885554-51: How to build the demo ticket system site

Comments

arhak’s picture

Title: How to use comment_driven for ticket system site » How to build the demo ticket system site

I should be back to you soon

arhak’s picture

Step #1: Basic Drupal setup

1.1)
download and install
- drupal-6.19
(remember to setup cron or use poormanscron module)

1.2)
download following modules
and extract them under sites/all/modules
(beside them I'm writting the actual version used in the demo site)
- cck-6.x-2.8 (6.x-2.6)
- comment_driven-6.x-1.0-alpha3 (6.x-1.0-unstable3)
- comment_subject-6.x-2.0-beta1 (same)
- dhtml_menu-6.x-3.5 (same)
- driven-6.x-1.0-alpha3 (didn't existed at the time)
- hierarchical_select-6.x-3.6 (6.x-3.0)
- pathauto-6.x-1.5 (6.x-1.2)
- token-6.x-1.15 (6.x-1.12)
- views-6.x-2.11 (6.x-2.8)

1.3)
admin/build/modules
enable the following modules:
- CCK group
-- Content
-- Node Reference
-- Option Widgets
-- Text
-- User Reference
- "Core - optional" group
-- Contact (not required)
-- Path
-- Profile
-- Tracker (not required)
- Driven group
-- Comment driven
-- Driven API
-- Driven CCK properties
-- Driven difference API
-- Driven property manager
-- Driven taxonomy properties
- "Form Elements" group
-- Hierarchical Select
-- Hierarchical Select Taxonomy
- Other group
-- Comment subjects
-- DHTML Menu (not required)
-- Pathauto
-- Token
- Views group
-- Views
-- Views UI

1.4)
create the Project content type
admin/content/types/add
- Identification
-- Name: Project
-- Type: project
-- Description: A <em>project</em> to which <em>tickets</em> will be addressed for.
- Submission form settings
-- Title field label: Name
-- Body field label: Description
- Comments settings
-- Default comment setting: Disabled

1.5)
add custom fields to the Project content type
admin/content/node-type/project/fields
- Add - New field
-- Label: Manager
-- field_: manager
-- Type: User reference
-- Form element: Select list
drag it and place it right bellow the Name (above Menu settings)

1.6)
once saved, you'll land at
admin/content/node-type/project/fields/field_manager
- Ticket settings
-- Reverse link: checked
- Global settings
-- User roles that can be referenced: authenticated user (or any other role you might have previously created, e.g: project_manager at admin/user/roles)

1.7)
create the Ticket content type
admin/content/types/add
- Identification
-- Name: Ticket
-- Type: ticket
-- Description: A <em>ticket</em> addressing a <em>project</em>'s flaw.
- Submission form settings
-- Body field label: Description
- Workflow settings
-- Create new revision: checked (recommended)
- Comments settings
-- Default display order: Date - oldest first
-- Preview comment: Optional
-- Location of comment submission form: Display below post or comments
-- Comment subject field: Disabled
-- Default subject pattern: #[comment-auto-numbering]

1.8)
add custom fields to the Ticket content type
admin/content/node-type/ticket/fields
- Add - New field
-- Label: Project
-- field_: project
-- Type: Node reference
-- Form element: Select list
drag it and place it right bellow the Title (above Taxonomy)

1.9)
once saved, you'll land at
admin/content/node-type/ticket/fields/field_project
- Global settings
-- Content types that can be referenced: Project

1.10)
admin/content/node-type/ticket/fields
- Add - New field
-- Label: Assigned
-- field_: assigned
-- Type: User reference
-- Form element: Select list
drag it and place it right bellow the Taxonomy (above Menu settings)

1.11)
once saved, you'll land at
admin/content/node-type/ticket/fields/field_assigned
- Global settings
-- User roles that can be referenced: authenticated user (or any other role you might have previously created, e.g: developer at admin/user/roles)

1.12)
create taxonomy vocabularies
admin/content/taxonomy/add/vocabulary
- Identification
-- Vocabulary name: Type
- Content types
-- Content types: Ticket
- Settings
-- Required: checked
-- Weight: -5

1.13)
admin/content/taxonomy/add/vocabulary
- Identification
-- Vocabulary name: Priority
- Content types
-- Content types: Ticket
- Settings
-- Required: checked
-- Weight: -2

1.14)
admin/content/taxonomy/add/vocabulary
- Identification
-- Vocabulary name: Status
- Content types
-- Content types: Ticket
- Settings
-- Required: checked
-- Weight: 5

1.15)
add terms to vocabularies
admin/content/taxonomy/1/add/term (vid=1 should be Type, created in step 1.12)
- Identification
-- Term name: help request
- Advanced options
-- Weight: 0

once saved , you'll land at the same page to continue adding terms
- Identification
-- Term name: bug report
- Advanced options
-- Weight: 1

... and so on
you may chose to manually set the weights or use drag & drop at
admin/content/taxonomy/1

1.16)
admin/content/taxonomy/2/add/term (vid=2 should be Priority, created in step 1.13)
- Identification
-- Term name: critical
- Advanced options
-- Weight: 1

... and so on

1.17)
admin/content/taxonomy/3/add/term (vid=3 should be Status, created in step 1.14)
Note: in this case you don't want to use the drag & drop to reorder the terms
so it is important to individually set up the terms' weights
Also, in this case it will be a hierarchical vocabulary:
- opened .......... -10 (range starting from -10 up to zero)
-- active .......... -9
-- needs work ... -8
-- hold ............. -7
-- postponed .... -6
- fixed ............... 0 (range starting from zero up to 10)
-- needs review .. 1
-- buggy ........... 2
-- tested ........... 3
- canceled ......... 10 (range starting from 10)
-- duplicated ...... 11
-- expired .......... 12
-- invalid ........... 13
-- refused ......... 14

1.18)
edit the Status vocabulary
(after being created, hierarchical_select options become available)
admin/content/taxonomy/edit/vocabulary/3
- Use the Hierarchical Select form element for this vocabulary: checked
- Hierarchical Select configuration
-- Save lineage: Save term lineage
-- Resizable: Disabled

Note: if you see a PHP error when saving the vocabulary then you have the following choices:
- ignore it and continue (which is what I'll do right now)
- report the bug to hierarchical_select-6.x-3.6 ("array_shift() [function.array-shift]: The argument should be an array in .../includes/form.inc on line 1337")
- or use a previews version of HS (6.x-3.0 for instance, which is the one used in the demo site)

arhak’s picture

Step #2: setup comment_driven

Note: the following steps will describe the UI of version 6.x-alpha3,
but the demo site was (an can be) built using comment_driven-6.x-1.0-unstable3
and the process is pretty much the same, but its UI is far from being similar to the one described bellow,
first of all, its configuration will appear in a "Comment driven" fieldset for each content type (e.g: at admin/content/node-type/ticket)

2.1)
admin/content/node-type/ticket/driven-props/comment-driven
- Driven properties
-- Enable driven properties: checked
- CCK
-- Project: checked
-- Assigned: checked
- Taxonomy
-- Type: checked
-- Priority: checked
-- Status: checked

2.2)
if you don't like assertion messages go to
admin/settings/driven
- Assertions
-- Level: Log only

arhak’s picture

Step #3: setup pathauto

3.1)
go to your pathauto directory (under sites/all/modules)
and copy the file i18n-ascii.example.txt as i18n-ascii.txt
(refer to its INSTALL.txt for further understanding of "Transliteration support")

3.2)
admin/build/path/pathauto
- General settings
-- Transliterate prior to creating alias: checked
-- Reduce strings to letters and numbers from ASCII-96: checked
-- Strings to Remove: (blank, leave empty)
- Punctuation settings
-- Underscore _: Replace by separator
- Node paths
-- Default path pattern: (blank, leave empty)
-- Pattern for all Page paths: page/[title-raw]
-- Pattern for all Project paths: project/[nid]
-- Pattern for all Story paths: story/[title-raw]
-- Pattern for all Ticket paths: ticket/[nid]

arhak’s picture

Step #4: setup user profile pictures

4.1)
admin/user/settings
- Pictures
-- Picture support: Enabled

arhak’s picture

coming soon:
Step #5: setup views
Step #6: custom module for some tweaks

arhak’s picture

Step #5: setup views

Note: the exported view is also attached

5.1)
create all_tickets view
admin/build/views/add
View name: all_tickets
View tag: tracker
View type: Node

5.2)
- Basic settings
-- Title: Tickets
-- Style: Table
-- Use pager: Full pager (Yes)
-- Items epr page: 30
-- Distinct: Yes
-- Empty text: Could not find Tickets for the specified criteria. (Filtered HTML)

- Relationships
-- Add: Content: Assigned (field_assigned)
--- Label: Assigned
-- Add: Content: Project (field_project)
--- Label: Project

- Fields
-- Node: Nid
--- Relationship: Project
--- Label: project_id
--- Exclude from display: checked
--- Link this field to its node: NOT checked
-- Node: Title
--- Relationship: Project
--- Label: Project
--- Output this field as a link: checked
---- Link path: node/[nid]/tickets
-- Node: Nid
--- Relationship: Do not use a relationship
--- Label: ID
--- Exclude from display: checked
-- Node: Title
--- Relationship: Do not use a relationship
--- Label: Title
--- Link this field to its node: checked
-- Node: Has new content
--- Check for new comments as well: checked
-- Node: Updated/commented date
--- Label: Updated
--- Date format: Time ago
-- Node: Comment count
--- Label: Replies
--- Count the number 0 as empty: checked
-- Node: New comments
--- Link this field to new comments: checked
-- Taxonomy: All terms
--- Label: Type
--- Limit terms by vocabulary: Type
-- Taxonomy: All terms
--- Label: Priority
--- Limit terms by vocabulary: Priority
-- Taxonomy: All terms
--- Label: Status
--- Display type: Unordered list
--- Limit terms by vocabulary: Status
-- User: Uid
--- Relationship: Assigned
--- Label: assigned_id
--- Exclude from display: checked
--- Link this field to its user: NOT checked
-- User: Name
--- Relationship: Assigned
--- Label: Assigned
--- Output this field as a link: checked
---- Link path: user/[uid]/tickets
--- Link this field to its user: NOT checked
--- Overwrite the value to display for anonymous users: checked
---- Text to display for anonymous users: blank (leave empty)
-- User: Picture
--- Relationship: Assigned

- Filters
-- Node: Published or admin
-- Node: Type
--- Operator: Is one of
--- Node type: Ticket
-- Content: Project (field_project)
--- click Expose button
---- Filter identifier: project
---- Label: Project
---- Optional: checked
---- Force single: NOT checked
-- Taxonomy: Term (the one with description "The taxonomy term ID")
--- Vocabulary: Type
--- Selection type: Dropdown
--- click Update
--- Reduce duplicates: checked
--- click Expose button
---- Filter identifier: type
---- Label: Type
---- Optional: checked
---- Force single: NOT checked
-- Taxonomy: Term (the one with description "The taxonomy term ID")
--- Vocabulary: Priority
--- Selection type: Dropdown
--- click Update
--- Reduce duplicates: checked
--- click Expose button
---- Filter identifier: priority
---- Label: Priority
---- Optional: checked
---- Force single: NOT checked
-- Taxonomy: Term (the one with description "The taxonomy term ID")
--- Vocabulary: Status
--- Selection type: Dropdown
---- Show hierarchy in dropdown: checked
--- click Update
--- Reduce duplicates: checked
--- click Expose button
---- Filter identifier: status
---- Label: Status
---- Optional: checked
---- Force single: NOT checked
-- Content: Assigned (field_assigned)
--- click Expose button
---- Filter identifier: assigned
---- Label: Assigned
---- Optional: checked
---- Force single: NOT checked
-- Node: Nid
--- click Expose button
---- Filter identifier: id
---- Label: ID
-- Node: Title
--- Operator: Contains
--- Case sensitive: NOT checked
--- click Expose button
---- Filter identifier: title
---- Label: Title

5.3)
now that the view is pretty close to what we want, it is time to adjust the Table style
- Basic settings
-- Style: Table
you can click on the little gear icon, or click the link ("Table" in this case)
and read the last message which contains a "settings" link, which will also take you to the Style options
--- Style options
---- Has new content > Column: Title
---- Updated > Default sort: checked
---- Replies > Separator: <br />
---- New comments > Column: Replies
---- Picture > Column: Assigned
---- make them all Sortable: checked
---- Enable Drupal style "sticky" table headers (Javascript): checked
---- Default sort order: Descending

5.4)
Add a Page display
- Path settings
-- Path: tickets
-- Menu
--- Type: Normal menu entry
--- Title: Tickets
--- Menu: Primary links
Add a Feed display
- Basic settings
-- Row style: Node
- Feed settings
-- Path: tickets/rss
-- Attach to: Page

5.5)
make this view your front page
admin/settings/site-information
- Default front page: tickets

(this is only the main view)

arhak’s picture

StatusFileSize
new19.17 KB
arhak’s picture

Step #5: setup views (cont.)

5.6)
create project_tickets view
admin/build/views
we'll start by cloning previous all_tickets view
either click on its "Clone" link or directly navigate to:
admin/build/views/clone/all_tickets
View name: project_tickets
View tag: tracker

now it is just a matter of adapting the existing settings

5.7)
- Basic settings
-- Header: <a href="?q=tickets">View all tickets</a> (Filtered HTML)
--- Display even if view has no result: checked

- Arguments
-- Node: Nid
--- Relationship: Project
--- Title: Tickets for project %1
--- Validator: Node
---- Project: checked
---- Validate user has access to the node: checked (if needed, the demo site has no access policies)

- Fields
-- (Project) Node: Title
--- Remove (it can also be hid instead with Exclude from display: checked)

- Filters
-- Content: Project
--- Remove

5.8)
switch to its Page display
- Page settings
-- Path: node/%/tickets
-- Menu
--- Type: Menu tab
switch to its Feed display
- Feed settings
-- Path: node/%/tickets/rss

(now you can navigate to the homepage or ?q=tickets view, and click on a project name to navigate to its tickets)

arhak’s picture

StatusFileSize
new19.51 KB
arhak’s picture

Step #5: setup views (cont.)

5.9)
create user_tickets view
admin/build/views
we'll clone again the all_tickets view
either click on its "Clone" link or directly navigate to:
admin/build/views/clone/all_tickets
View name: user_tickets
View tag: tracker

now it is just a matter of adapting the existing settings

5.10)
- Basic settings
-- Header: <a href="?q=tickets">View all tickets</a> (Filtered HTML)
--- Display even if view has no result: checked

- Arguments
-- User: Uid
--- Relationship: Assigned
--- Title: Tickets assigned to %1
--- Validator: User
---- Restrict user based on role (can be used to restrict this view to the same role used in step 1.11)

- Fields
-- (Assigned) User: Name
--- Remove (it can also be hid instead with Exclude from display: checked)
-- (Assigned) User: Picture
--- Remove

- Filters
-- Content: Assigned
--- Remove

5.11)
switch to its Page display
- Page settings
-- Path: user/%/tickets
-- Menu
--- Type: Menu tab
switch to its Feed display
- Feed settings
-- Path: user/%/tickets/rss

(now you can navigate to the homepage or ?q=tickets view, and click on a assignee name to navigate to his/her tickets)

arhak’s picture

StatusFileSize
new18.72 KB
arhak’s picture

Step #5: setup views (cont.)

5.12)
create term_tickets view
admin/build/views
we'll clone again the all_tickets view
either click on its "Clone" link or directly navigate to:
admin/build/views/clone/all_tickets
View name: term_tickets
View tag: tracker

now it is just a matter of adapting the existing settings

5.13)
- Basic settings
-- Header: <a href="?q=tickets">View all tickets</a> (Filtered HTML)
--- Display even if view has no result: checked

- Arguments
-- Taxonomy: Term ID
--- Title: Tickets classified as %1
--- Validator: Taxonomy term
---- Type: checked
---- Priority: checked
---- Status: checked
--- Allow multiple terms per argument: checked
--- Reduce duplicates: checked
--- Set the breadcrumb for the term parents: checked

- Filters
-- Taxonomy: Term (there are three of them, remove them all)
--- Remove
-- Taxonomy: Term
--- Remove
-- Taxonomy: Term
--- Remove

5.14)
switch to its Page display
- Page settings
-- Path: taxonomy/term/%
-- Menu
--- Type: No menu entry
switch to its Feed display
- Feed settings
-- Path: taxonomy/term/%/rss

(now you can navigate to the homepage or ?q=tickets view, and click on any Type/Priority/Status term to navigate to its tickets)

arhak’s picture

StatusFileSize
new19.05 KB
tazus’s picture

Great post, thanks and subscribed.

arhak’s picture

Step #5: setup views (cont.)

Note: following projects view is unrelated to tickets views, so you can proceed with step 6 (which might be more interesting)

5.15)
create all_projects view
admin/build/views/add
View name: all_projects
View tag: tracker
View type: Node

5.16)
- Basic settings
-- Title: Projects
-- Style: Table
-- Use pager: Full pager (Yes)
-- Items epr page: 30

- Relationships
-- Add: Content: Manager (field_manager)
--- Label: Manager

- Fields
-- Node: Nid
--- Label: ID
--- Exclude from display: checked
--- Link this field to its node: NOT checked
-- Node: Title
--- Label: Name
--- Output this field as a link: checked
---- Link path: node/[nid]/tickets
-- User: Uid
--- Relationship: Manager
--- Label: manager_id
--- Exclude from display: checked
--- Link this field to its user: NOT checked
-- User: Name
--- Relationship: Manager
--- Label: Manager
--- Output this field as a link: checked
---- Link path: user/[uid]/tickets
--- Link this field to its user: NOT checked
--- Overwrite the value to display for anonymous users: checked
---- Text to display for anonymous users: blank (leave empty)
-- User: Picture
--- Relationship: Manager

- Filters
-- Node: Published or admin
-- Node: Type
--- Operator: Is one of
--- Node type: Project

5.17)
now that the view is pretty close to what we want, it is time to adjust the Table style
- Basic settings
-- Style: Table
you can click on the little gear icon, or click the link ("Table" in this case)
and read the last message which contains a "settings" link, which will also take you to the Style options
--- Style options
---- Name > Default sort: checked
---- Picture > Column: Manager
---- make them all Sortable: checked
---- Enable Drupal style "sticky" table headers (Javascript): checked
---- Default sort order: Ascending

5.18)
Add a Page display
- Path settings
-- Path: projects
-- Menu
--- Type: Normal menu entry
--- Title: Projects
--- Menu: Primary links
Add a Feed display
- Basic settings
-- Row style: Node
- Feed settings
-- Path: projects/rss
-- Attach to: Page

arhak’s picture

StatusFileSize
new6.83 KB
arhak’s picture

Step #6: custom module for some tweaks

Now in a custom module we are going to address some issues/customizations,
some of them can be handled in several ways,
the ones chosen might not be the best ones, but they will fit our needs.
I would be glad if someone posts better alternatives

Note: do not enable the module until having all the function implementations written down

6.1)
create the .info file

; $Id$
name = Ticket Tracker Tweaks
core = 6.x

6.2)
create the .module file

// $Id$

/**
 * Implements hook_enable().
 */
function tracker_tweaks_enable() {
}

/**
 * Implements hook_init().
 */
function tracker_tweaks_init() {
}

/**
 * Implements hook_theme().
 */
function tracker_tweaks_theme(&$cache, $type, $module_name, $module_path) {
  $theme = array();
  return $theme;
}

/**
 * Implements hook_form_alter().
 */
function tracker_tweaks_form_alter(&$form, $form_state, $form_id) {
}

/**
 * Implement hook_form_[form_id]_alter() for taxonomy_overview_terms.
 */
function tracker_tweaks_form_taxonomy_overview_terms_alter(&$form, &$form_state) {
}

/**
 * Our custom preprocess function for views_view_table.
 */
function tracker_tweaks_preprocess_views_view_table(&$vars) {
}

6.3)
create an empty CSS file: tracker_tweaks.css

arhak’s picture

StatusFileSize
new872 bytes
arhak’s picture

6.4)
The first annoying issue we find is the "Vocabularies" fieldset wrapping all taxonomies together (particularly for tickets),
so lets get rid of it

/**
 * Implements hook_form_alter().
 */
function tracker_tweaks_form_alter(&$form, $form_state, $form_id) {
  // can't use hook_form_[form_id]_alter since it happens too early
  if (isset($form['#id']) && $form['#id'] == 'node-form') {
    // we don't wan't the fieldset 'Vocabularies'
    // wrapping all taxonomies together
    // (lets get rid of it for every content type)
    $form['taxonomy']['#type'] = 'markup';
  }  
}

Note that we turned it into an invisible element, but the wrapper shouldn't be removed, since core's taxonomy module relies on it

janis_lv’s picture

Thank you for the work, it's really amazing. And I got my views running with no problems (learned a lot from this issue)

I'm sorry for the dumb question, but where do I have to insert the code from 6.4?
into template.tpl or into the module from step 6?

Sorry, thanks.
Janis

arhak’s picture

but where do I have to insert the code from 6.4?
[...] into the module from step 6?

yes, into the module from step 6,

I'm gonna post the implementations for each function of the module, and once I finish I'll attach the resulting module
(nevertheless, this step by step is vital to understand why/what/where to modify it)

janis_lv’s picture

thank you for the prompt reply

arhak’s picture

6.5)
Now lets bring some CSS selectors to these table views so we can differentiate tickets by their taxonomy (i.e. status/priority/type)

We are going to set a custom preprocess function for theme hook views_view_table

/**
 * Implements hook_theme().
 */
function tracker_tweaks_theme(&$cache, $type, $module_name, $module_path) {
  $cache['views_view_table']['preprocess functions'][] = 'tracker_tweaks_preprocess_views_view_table';
  $theme = array();
  return $theme;
}

but this won't have effect unless our theme hook gets called AFTER views' (i.e. we need to be heavier than views module)

/**
 * Implements hook_enable().
 */
function tracker_tweaks_enable() {
  // heavier than views, to be able to alter its theme definition
  db_query("UPDATE {system} SET weight = 20 WHERE name = 'tracker_tweaks'");
}

Note: if this module was already enabled then it is REQUIRED to disabled it and re-enabled it, so its new weight can take place (in passing by theme registry will be re-created with our custom preprocess function included)

So far, we can perceive no effect, lets write down our preprocess function

/**
 * Our custom preprocess function for views_view_table.
 */
function tracker_tweaks_preprocess_views_view_table(&$vars) {
  $view = $vars['view'];

  $result = $view->result;
  $row_classes = &$vars['row_classes'];
  foreach ($view->field as $key => $handler) {
    if ($handler->definition['handler'] == 'views_handler_field_term_node_tid') {
      $items = &$handler->items;
      
      foreach ($result as $row_num => $row) {
        $node_vid = $row->node_vid;
        foreach ($items[$node_vid] as $item) {
          $term_name = $item['name'];
          $voc_name = $item['vocabulary'];
          
          // a double separator to avoid name clashes?
          // nay, no term will be at top level like vocabularies
          $class = $voc_name . '-' . $term_name;
          $class = preg_replace(array('![^a-zA-Z0-9]!'), '-', $class);
          $class = strtolower($class);
          
          // we want to insert our selector on front for two reasons
          // - want our selector to be more specific that those inserted by views
          // - if there are several terms, they are ordered by weight
          //   and the more weight it has, the more specific it should be
          //   (at least we are gonna assign weights this way)
          array_unshift($row_classes[$row_num], $class);
        }
      }
    }
  }
}

And yet, we can't see anything different, but CSS selector are already there (you can check it out by inspecting the DOM)

arhak’s picture

6.6)
to include our CSS file (which has no rules written yet)

/**
 * Implements hook_init().
 */
function tracker_tweaks_init() {
  $module_path = drupal_get_path('module', 'tracker_tweaks');
  drupal_add_css($module_path . '/tracker_tweaks.css');
}
arhak’s picture

6.7)
Now lets start making some differences by inserting custom style rules (into our CSS file)

tr.priority-urgent,
tr.priority-critical {
  font-weight: bold;
}

tr.priority-tolerable,
tr.priority-dispensable {
  font-style: italic;
}

with these styles we can already note the difference according to ticket's priorities

arhak’s picture

6.8)
For coloring we can do the same as in previous step, but note that theme's style.css will have priority over our style rules, since our CSS file is included earlier, therefore, we are going to be using !important to overrule.

And this is how we bring some colors

/* parent statuses */

tr.status-opened {
  background-color: #FFFFFF !important;
}
tr.status-opened td.active {
  background-color: #F4F4F4 !important;
}

tr.status-fixed {
  background-color: #C0FFC0 !important;
}
tr.status-fixed td.active {
  background-color: #CCEECC !important;
}

tr.status-canceled {
  background-color: #DDDDDD !important;
}
tr.status-canceled td.active {
  background-color: #CCCCCC !important;
}


/* child statuses under "opened" */

tr.status-needs-work {
  background-color: #FFD9D9 !important;
}
tr.status-needs-work td.active {
  background-color: #EEC9C9 !important;
}

tr.status-postponed {
  background-color: #DDDDFF !important;
}
tr.status-postponed td.active {
  background-color: #CCCCEE !important;
}

tr.status-hold {
  background-color: #CEEDFF !important;
}
tr.status-hold td.active {
  background-color: #BDDBEE !important;
}


/* child statuses under "fixed" */

tr.status-needs-review {
  background-color: #FFFFE2 !important;
}
tr.status-needs-review td.active {
  background-color: #EEEECD !important;
}

tr.status-buggy {
  background-color: #FFC9C9 !important;
}
tr.status-buggy td.active {
  background-color: #EEB9B9 !important;
}

tr.status-tested {
  background-color: #E7FFDD !important;
}
tr.status-tested td.active {
  background-color: #D7EECC !important;
}

but we need to enhance rows' definition

/* straightened definition between rows */
td.views-field {
  border-bottom: 1px solid #AFBFC8;
}

and also enhance active links

/* li a.active, is used for local tabs */
/* th a.active, is used for JS sticky headers */
td.views-field li a.active, 
td.views-field a.active {
  color: #18557E !important;
}

Note: these style rules are addressing Garland, other themes might require other selectors

arhak’s picture

6.9)
Last style rules will adress the user pictures on the extreme right column

/* user profile pictures */

td.views-field-name * {
  float: right;
}

td.views-field-name div.picture {
  float: right;
  clear: right;
  padding: 0;
  margin: 0;
  display: inline;
  position: relative;
}

td.views-field-name div.picture img {
  height: 30px;
}
arhak’s picture

6.10)
Now that our styling rules depend on the proper weight of the status terms being set,
we can't affort to alter them via the administrative interface (which will brake their order)
so, we'll disable its re-ordering capabilities at admin/content/taxonomy/3

Note: vid=3 should be Status, created in step 1.14

/**
 * Implements hook_form_[form_id]_alter() for taxonomy_overview_terms.
 */
function tracker_tweaks_form_taxonomy_overview_terms_alter(&$form, &$form_state) {
  $voc = $form['#vocabulary'];
  if ($voc['vid'] == 3) {
    // we don't want to mess with hierarchical weight of "Status" vocabulary
    // don't like the way taxonomy_overview_terms_submit
    // resets the weights per branch
    // leading to undesired behavior
    // e.g. every first term with a parent will have zero weight!
    unset($form['reset_alphabetical']);
    unset($form['submit']);
    // display some information regarding the censure
    drupal_set_message(t('This vocabulary is hierarchical and we don\'t want to mess its terms weights. Therefore, submit buttons have been removed.'), 'notice');
  }
}
arhak’s picture

StatusFileSize
new2.56 KB
arhak’s picture

so.. this seems to be all of it

enjoy it!

arhak’s picture

PS: remember that a handbook page will be always welcome as well as any review or better approach to achieve any of these features

I also encourage the readers to help in other issues which would facilitate the exchange of configurations
#771590: preparing a frist draft for README.txt
#769128: Support for exportables and the Features module

janis_lv’s picture

oh my god, thank you arhak.
now I'm running to cinema, but this will be the next thing I'll do when I will get home :D

thanks for sharing your work.

janis_lv’s picture

enabling this module seems somehow to conflict with BlueDroplet Video project.
as the views for "videos" didn't render any images. :)

I'll try to play with above examples, and if I'll find a function which brakes the bd_video, I'll get back to you.

arhak’s picture

most likely the proposed preprocess function resulted too aggressive

disable the custom preprocess function
AND then clear cache to rebuild theme registry

there are several ways to disable the preprocess function
the simplest would be to comment out line 24
(you can also comment out the whole tracker_tweaks_theme hook)

function tracker_tweaks_theme(&$cache, $type, $module_name, $module_path) {
  //$cache['views_view_table']['preprocess functions'][] = 'tracker_tweaks_preprocess_views_view_table';
  $theme = array();
  return $theme;
}

Note: remember to clear the cache so this can take effect

te-brian’s picture

I am taking arhak's excellent tutorial and attempting to turn it into a features powered module with all the cck/views/settings/etc. included as exportables. I'll post back here if/when I have some success.

te-brian’s picture

Just to report in , I had some luck but a current deal-breaker is the taxonomies. The taxonomy_export module gave me a nice dump of them, and features support is supposedly slated for their v2.0. I even hacked in the creation of the terms. However, I am at a loss on how to sync the new terms with the views exports. If anyone has any ideas or experience with this, let me know.

te-brian’s picture

StatusFileSize
new12.93 KB

Alrighty, here is my first stab at the module.

Please test it out (not on production site). Let me know if you find any settings, etc. that were missed.

Like I said previously the taxonomy related stuff is a little hacky, but I did manage to get the views working by storing the vids of the vocabularies as variables and using those in the views default definitions.

te-brian’s picture

StatusFileSize
new12.98 KB

Bunch of bug fixes in this version.

Fixed hierarchical_select settings.
Fixed priority and status vocabularies having their names switched.

te-brian’s picture

Also, as a quick note, I use the bleeding edge version of modules for the above feature. So , for example, Views 3, pathauto dev tag, token dev tag, etc.

arhak’s picture

@te-brian: thanks for your effort

jpsala@gmail.com’s picture

Assigned: Unassigned » jpsala@gmail.com
Category: task » feature
Priority: Normal » Critical
Status: Active » Closed (works as designed)
Issue tags: +thanks

THANKS a lot, your work was/is very useful for me and I guess for a lot of us!

te-brian’s picture

I probably won't be doing much more work on the driven_tracker for the time being. If anyone wants to take it up, feel free. Also, if anyone wants to start a real project for it I'd be happy to help work on it and debug it when I get time.

arhak’s picture

Assigned: jpsala@gmail.com » Unassigned
Category: feature » support
Priority: Critical » Normal
Status: Closed (works as designed) » Closed (fixed)
Issue tags: -thanks

reverting issue state, changed unintentionally at #42

colorado’s picture

subscribing

rlnorthcutt’s picture

StatusFileSize
new18.52 KB

Thanks to both Brian and Arhat - I have taken their work and built out a fairly robust little ticket tracking system built around the Driven API. A few differences to note:
- I have included OG as "Projects" so that you can assign different workers and clients to different jobs.
- Notifications at the group level are included
- Some CSS changes
- Created an optional "Release" content type for organizing groups of tickets

I will be continuing to flesh this system out and probably adding some complimentary features for a calendar, user profiles and invoicing system. Let me know what you think and of any errors you find.

te-brian’s picture

You should create a git sandbox project for it :) It will be much easier for people to follow your progress and download the latest version and people can even submit issues (I think).

I'm not sure how packages of module work there, however, but I'm sure someone around here (or in IRC) can help.

rlnorthcutt’s picture

Thanks Brian - I set up a temporary feature server but I think setting it up on git is a great idea. I will do it!

rlnorthcutt’s picture

StatusFileSize
new18.75 KB

Setting up Git and a Demo site... should all be up by later tonight!

https://github.com/rlnorthcutt/Gexer-PM

http://demo.gexer.com

Also - attaching a slightly better version of the beta1. I won't be updating this thread anymore, so if you want the goodies, go to Git :)

te-brian’s picture

Great effort.. but don't forget Drupal has git sandboxes now too :)

arhak’s picture

NOTE
demo site was moved, it now resides at http://arhak.s4w.biz/tracker, however, if this new URL doesn't work then check the project page to know if it got moved again

arhak’s picture

Issue summary: View changes

updated demo site URL, now residing at http://arhak.s4w.biz/tracker