PHPackages                             rjzaar/workflow\_assignment - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. rjzaar/workflow\_assignment

ActiveDrupal-module[Utility &amp; Helpers](/categories/utility)

rjzaar/workflow\_assignment
===========================

A custom Drupal 10/11 module that provides a flexible workflow system where you can create workflow lists containing assigned users and/or groups, with resource locations designated by taxonomy tags.

v0.1(6mo ago)049GPL-2.0-or-laterPHPPHP &gt;=8.1CI failing

Since Nov 15Pushed 4mo agoCompare

[ Source](https://github.com/rjzaar/workflow_assignment)[ Packagist](https://packagist.org/packages/rjzaar/workflow_assignment)[ RSS](/packages/rjzaar-workflow-assignment/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (2)Used By (0)

Workflow Assignment Module - Improved Version
=============================================

[](#workflow-assignment-module---improved-version)

A streamlined Drupal 10+ module that provides a flexible workflow system with single assignment per workflow and color-coded display.

🆕 Key Features
--------------

[](#-key-features)

### Single Assignment Model

[](#single-assignment-model)

- Each workflow can be assigned to **ONE** entity:
    - **User** (Green) - Individual user assignment
    - **Group** (Blue) - Group assignment (requires Group module)
    - **Destination Location** (Orange) - Destination taxonomy term

### Enhanced Table Display

[](#enhanced-table-display)

- **Streamlined columns**: Workflow Name, Description, Assigned, Comments
- **Color-coded assignments**: Visual distinction by type
- **Expandable cells**: Click to expand description and comments
- **Inline editing**: Double-click description/comments to edit (future enhancement)

### No Resource Locations

[](#no-resource-locations)

- Simplified model - resource locations removed
- Focus on assignment and destination

Installation
------------

[](#installation)

```
# Copy module to Drupal
cp -r workflow_assignment /path/to/drupal/modules/custom/

# Enable module
drush en workflow_assignment -y

# Clear cache
drush cr

# Run database updates (if upgrading)
drush updatedb -y
```

Configuration
-------------

[](#configuration)

### Step 1: Enable Content Types

[](#step-1-enable-content-types)

1. Navigate to: `/admin/config/workflow/workflow-assignment`
2. Select content types for workflow support
3. Save configuration

### Step 2: Create Destination Locations

[](#step-2-create-destination-locations)

1. Navigate to: `/admin/structure/taxonomy/manage/destination_locations`
2. Default terms created:
    - Public
    - Private
3. Add custom destinations as needed

### Step 3: Create Workflows

[](#step-3-create-workflows)

1. Navigate to: `/admin/structure/workflow-list`
2. Click "Add Workflow List"
3. Fill in:
    - **Name**: Workflow name
    - **Description**: Detailed description (expandable in table)
    - **Assignment Type**: Choose User, Group, or Destination
    - **Assignment**: Select the specific entity
    - **Comments**: Additional notes (expandable in table)
4. Save

Usage
-----

[](#usage)

### Viewing Workflows

[](#viewing-workflows)

Navigate to any content with workflows enabled and click the "Workflow" tab.

**Table columns:**

- **Workflow Name**: Bold display of workflow name
- **Description**: Truncated with expand on click
- **Assigned**: Color-coded entity (Green=User, Blue=Group, Orange=Destination)
- **Comments**: Truncated with expand on click

### Color Coding

[](#color-coding)

```
/* Green for Users */
.assigned-user {
  background: #d4edda;
  color: #155724;
}

/* Blue for Groups */
.assigned-group {
  background: #d1ecf1;
  color: #0c5460;
}

/* Orange for Destinations */
.assigned-destination {
  background: #fff3cd;
  color: #856404;
}
```

### Expandable Cells

[](#expandable-cells)

- **Single Click**: Expand/collapse to see full text
- **Double Click**: Enter edit mode (when implemented with AJAX)
- **Visual Indicator**: Arrow shows expandable content

API Usage
---------

[](#api-usage)

### Create Workflow with Single Assignment

[](#create-workflow-with-single-assignment)

```
use Drupal\workflow_assignment\Entity\WorkflowList;

// Create workflow assigned to user
$workflow = WorkflowList::create([
  'id' => 'user_workflow',
  'label' => 'User Review Workflow',
  'description' => 'Workflow for user review process',
  'comments' => 'Requires manager approval',
]);
$workflow->setAssignment('user', 5); // User ID 5
$workflow->save();

// Create workflow assigned to group
$workflow = WorkflowList::create([
  'id' => 'group_workflow',
  'label' => 'Team Workflow',
]);
$workflow->setAssignment('group', 2); // Group ID 2
$workflow->save();

// Create workflow assigned to destination
$workflow = WorkflowList::create([
  'id' => 'public_workflow',
  'label' => 'Public Publishing',
]);
$workflow->setAssignment('destination', 1); // Term ID 1 (Public)
$workflow->save();
```

### Get Assignment Information

[](#get-assignment-information)

```
$workflow = WorkflowList::load('user_workflow');

// Get assignment type and ID
$type = $workflow->getAssignedType(); // 'user'
$id = $workflow->getAssignedId();     // 5

// Get human-readable label
$label = $workflow->getAssignedLabel(); // 'John Smith'

// Get comments
$comments = $workflow->getComments();
```

JavaScript Behaviors
--------------------

[](#javascript-behaviors)

The module includes JavaScript for expandable cells:

```
// Expandable cells behavior
Drupal.behaviors.workflowExpandableCells = {
  attach: function (context, settings) {
    $('.expandable-cell', context).once('expandable-cell').each(function () {
      // Click to expand/collapse
      // Double-click to edit (future)
    });
  }
};
```

Module Structure
----------------

[](#module-structure)

```
workflow_assignment/
├── src/
│   ├── Entity/
│   │   └── WorkflowList.php              # Single assignment entity
│   ├── Controller/
│   │   └── NodeWorkflowController.php    # Table display controller
│   ├── Form/
│   │   ├── WorkflowListForm.php          # Create/edit with single assignment
│   │   ├── QuickEditWorkflowForm.php     # Quick edit form
│   │   ├── NodeAssignWorkflowForm.php    # Assign to content
│   │   └── WorkflowAssignmentSettingsForm.php
│   ├── Plugin/
│   │   └── Field/
│   │       └── FieldWidget/
│   │           └── WorkflowListWidget.php
│   └── WorkflowListListBuilder.php       # Admin list display
├── css/
│   └── workflow-tab.css                  # Color coding & expandable cells
├── js/
│   └── workflow-tab.js                   # Expandable behavior
├── config/
│   └── schema/
│       └── workflow_assignment.schema.yml
├── workflow_assignment.info.yml
├── workflow_assignment.module
├── workflow_assignment.install
├── workflow_assignment.routing.yml
├── workflow_assignment.permissions.yml
├── workflow_assignment.links.task.yml
└── workflow_assignment.libraries.yml

```

Theming
-------

[](#theming)

### CSS Classes

[](#css-classes)

```
/* Assignment color coding */
.assigned-user { }      /* Green */
.assigned-group { }     /* Blue */
.assigned-destination { } /* Orange */

/* Expandable cells */
.expandable-cell { }
.expandable-cell.expanded { }
.expandable-cell.editing { }

/* Table styling */
.workflow-assignments-table { }
```

Permissions
-----------

[](#permissions)

- **administer workflow lists**: Full admin access
- **assign workflow lists to content**: Assign workflows
- **view workflow list assignments**: View workflow tab

Troubleshooting
---------------

[](#troubleshooting)

### Workflows not appearing

[](#workflows-not-appearing)

- Check permissions
- Clear cache: `drush cr`
- Verify content type enabled

### Colors not showing

[](#colors-not-showing)

- Check CSS is loaded
- Verify assignment type is set correctly

### Expandable cells not working

[](#expandable-cells-not-working)

- Check JavaScript is loaded
- Verify jQuery dependencies

Future Enhancements
-------------------

[](#future-enhancements)

- AJAX inline editing for description and comments
- Workflow status tracking
- Assignment history
- Email notifications
- Bulk operations

Requirements
------------

[](#requirements)

- Drupal 10.x or 11.x
- PHP 8.0+
- jQuery (core)
- Taxonomy module (core)
- Optional: Group module

License
-------

[](#license)

GPL-2.0-or-later

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance72

Regular maintenance activity

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

182d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2af27a59588ac1a57d6ea0cf1f4494fed28c79828e1bb36dcbd6e6451ba1a898?d=identicon)[rjzaar](/maintainers/rjzaar)

---

Top Contributors

[![rjzaar](https://avatars.githubusercontent.com/u/476862?v=4)](https://github.com/rjzaar "rjzaar (35 commits)")

### Embed Badge

![Health badge](/badges/rjzaar-workflow-assignment/health.svg)

```
[![Health](https://phpackages.com/badges/rjzaar-workflow-assignment/health.svg)](https://phpackages.com/packages/rjzaar-workflow-assignment)
```

###  Alternatives

[farmos/farmos

A web-based farm record keeping application.

1.2k6.7k1](/packages/farmos-farmos)[linnovate/openideal

OpenideaL - open source ideas and innovation management system

1262.8k2](/packages/linnovate-openideal)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
