=== Persian Project Management ===
Contributors: syeedalireza
Tags: project-management, kanban, tasks, persian, jalali
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 2.1.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Persian-first RTL project workspace in wp-admin: projects, tasks, Kanban, Jalali calendar, dashboard KPIs, and CSV export.

== Description ==

**Persian Project Management** adds a complete project workspace **inside the WordPress admin**. It is built for Persian/Farsi teams: right-to-left layout, Vazirmatn typography, Jalali date pickers, and a Saturday-first work calendar — while dates stay Gregorian `Y-m-d` in the database for APIs and exports.

There is **no frontend UI**, no shortcode, and no Gutenberg block. Open **مدیریت پروژه** in the admin menu after activation.

**مخزن وردپرس / گیت‌هاب:** افزونه فضای مدیریت پروژه را داخل پیشخوان می‌آورد (پروژه، وظیفه، کانبان، تقویم شمسی، داشبورد و CSV). رابط فرانت، شورت‌کد و بلوک ندارد.

= Why use it =

* Stay in WordPress instead of a separate PM tool.
* Custom tables (`ppm_projects`, `ppm_tasks`) instead of posts, with explicit schema and `dbDelta` upgrades.
* Granular capabilities: view projects, manage projects, manage tasks (Administrator gets them on activation).
* Optional organization branding (logo, name, tagline) and per-screen background colors.

= Dashboard =

* User name and WordPress role.
* Quick search that opens the projects list.
* Shortcuts to projects, tasks, new project (if allowed), and team Kanban.
* KPI cards: all projects (including archived), active projects plus “created this month”, overdue (past end date), active projects without an owner, and a budget/spend card (fill via the `ppm_projects_total_budget_display` filter; otherwise it stays empty).
* Deadline alerts for projects ending in the next 7 days (overdue vs upcoming labels).
* Chart.js analytics: status distribution, active projects per owner (top 8), 12-month created vs completed trend, open vs closed tasks, plus average progress of active projects.
* Activity lists: your owned projects, recent open tasks, recently updated projects.
* CSV export of projects for managers.

= Projects =

* Create, edit, view, archive, delete (nonce-protected). Bulk archive. Unique slug from the title.
* Statuses: draft, planning, in progress, on hold, completed. Owner, start/end dates, progress 0–100, category, tags.
* **Grid and list** views (preference remembered in the browser). Grid cards show `#PRJ-xxx`, status, a five-step progress visual, progress bar, owner, due date.
* Search by title. Filters: status, category, owner (including unassigned), end-date range, archived / not archived / all. Sortable columns. Open-task count. Screen option for rows per page (default 20).
* Row actions: view, tasks, edit, archive, delete, copy edit link.
* KPI strip and deadline alerts on the projects screen as well.
* CSV export (UTF-8 with BOM, current filters, up to 5000 rows): id, title, status, owner, dates, progress, category, tags, archived.
* Deleting a project also deletes its tasks.

= Project notebook (new / archive / resources) =

* Multi-step **new project** flow: identity, five PM phases (initiation → closing) with Jalali pickers, team members with optional role labels, logo and brand colors, media attachments.
* **Save as draft** (untitled drafts allowed) or confirm and create. Empty start/end dates can be filled from phase dates.
* **Archive** notebook: browse archived projects, search, pagination, link to the filtered table.
* **Resources** notebook: WordPress users who can view or manage projects (avatar, role, email).
* View-only users see read-only summaries of extended fields on the project screen.

= Tasks =

* Hidden tasks screen (linked from dashboard, project rows, Kanban, calendar). Filter by project.
* Quick add (title + optional due date) when a project is selected.
* Open / closed, Kanban column, optional due date. Close or delete with nonces. 20 rows per page.

= Team Kanban =

* One board of **open** tasks across **non-archived** projects.
* Up to **12** columns (keys, titles, per-column quick-add). Defaults: waiting, in progress, review. Removing a column moves its open tasks to the first remaining column.
* Drag and drop (jQuery UI Sortable + AJAX). Click a card to edit title, project, and due date, or delete.
* Quick-add composer per column: project, title, due date.
* Cards show project tag, project progress, due date, link to that project’s tasks.
* Optional backdrop: solid color, image, or image with a color overlay. Reset from Settings.
* Users who can view the board can move/edit/delete cards. Saving column layout requires manage-tasks. GET fallbacks exist if JavaScript is blocked.

= Work calendar =

* Merges project date ranges and **open** task due dates.
* Jalali or Gregorian month view (preference remembered). Iranian week: Saturday first.
* Previous / today / next month, type filter (all / projects / tasks), project filter.
* Day details sidebar, color legend (in progress, planning, overdue project, task, overdue task).
* REST: `GET /wp-json/ppm/v1/calendar-events` (`from`, `to`, optional `project_id`, `types`). Permission: `ppm_view_projects`. Admin-ajax fallback `ppm_calendar_events` when REST or permalinks are awkward.
* Backend storage remains Gregorian `Y-m-d`.

= Settings =

Three tabs (saving requires manage-projects; viewing the screen requires view-projects):

1. **Sidebar** — show/hide the in-plugin nav per screen; logo (Site Icon / WordPress logo fallback); organization name; tagline.
2. **Kanban** — board background color and image; reset.
3. **Screens** — `#wpbody-content` background per plugin admin page; clear all colors.

A brand banner (logo + name + tagline) appears across plugin screens.

= Security =

* Capabilities: `ppm_manage_projects`, `ppm_view_projects`, `ppm_manage_tasks`.
* Nonces on forms, AJAX, and CSV export. `wp_ajax_*` only (no logged-out AJAX). REST calendar requires a logged-in user with view permission.
* Attachment IDs and user IDs are validated. Hex colors sanitized. Redirects use `wp_safe_redirect`.

= Developers =

* Filter `ppm_projects_total_budget_display` — string/HTML for the budget KPI (empty = dash / “connect finance”).
* REST namespace `ppm/v1`, route `calendar-events`.
* AJAX: `ppm_calendar_events`, `ppm_kanban_move_card`, `ppm_kanban_save_card`, `ppm_kanban_delete_card`.
* Options include `ppm_db_version` (schema `1.3.0`), `ppm_kanban_column_layout`, `ppm_kanban_appearance`, `ppm_sidebar_screens`, logo/name/tagline, `ppm_screen_backgrounds`.
* Text domain: `persian-project-management`. Domain path: `/languages`. Default UI strings are Persian.

= Not in this release =

* **Team** and **Reports** admin menus are placeholders.
* No frontend, shortcode, or block.
* No built-in finance/budget storage (display filter only).
* No `uninstall.php`: deactivation does **not** drop custom tables or options.

Bundled third-party assets (no CDN): Vazirmatn 33.003, Chart.js 4.4.1, persian-date 1.1.0, jalalidatepicker 0.9.5. See `assets/vendor/`.

Homepage: [Aria Project Management](https://ariacoder.ir/aria-project-management/). Author: [Alireza Aminzadeh](https://ariacoder.ir). Source: [GitHub](https://github.com/alireza-aminzadeh/persian-project-management-wordpress-plugin).

== Installation ==

1. Upload the `persian-project-management` folder to `/wp-content/plugins/`, or install the ZIP from **Plugins → Add New → Upload Plugin**.
2. Activate **Persian Project Management** from the **Plugins** screen.
3. Tables `{prefix}ppm_projects` and `{prefix}ppm_tasks` are created; **Administrator** receives the plugin capabilities.
4. In the admin menu, open **مدیریت پروژه** (networking Dashicon, position 26).
5. Optionally grant `ppm_view_projects`, `ppm_manage_projects`, and `ppm_manage_tasks` to other roles with a role editor.
6. Under the plugin **Settings** screen, set logo, organization name, tagline, Kanban backdrop, and per-screen colors.

= نصب (فارسی) =

1. پوشه را در `wp-content/plugins/persian-project-management` قرار دهید یا ZIP را بارگذاری کنید.
2. افزونه را فعال کنید.
3. جداول ساخته می‌شود و مدیرکل قابلیت‌ها را می‌گیرد.
4. منوی **مدیریت پروژه** را باز کنید.
5. در صورت نیاز قابلیت‌ها را به نقش‌های دیگر بدهید.
6. برندینگ و رنگ‌ها را از تنظیمات داخل افزونه تنظیم کنید.

== Frequently Asked Questions ==

= Does this plugin show anything on the public site? =

No. It only adds **مدیریت پروژه** inside `wp-admin`. There are no shortcodes or blocks.

= Can Editors or other roles use it? =

Not until you assign `ppm_view_projects`, `ppm_manage_projects`, and/or `ppm_manage_tasks`. Activation grants those capabilities to **Administrator** only.

= Why is the budget card a dash? =

The plugin does not store financial data. Return a display string from `ppm_projects_total_budget_display` to populate the card.

= Are dates stored as Jalali? =

No. Date pickers and the calendar can show Jalali; the database and REST API use Gregorian `Y-m-d`.

= Why are Team and Reports empty? =

They are placeholder screens for a future release.

= CSV looks wrong in Excel =

Export is UTF-8 with a BOM. Use Excel’s text import if your locale still misreads the file.

= Where is data stored? =

Custom tables `{prefix}ppm_projects` and `{prefix}ppm_tasks`, plus WordPress options for branding, sidebar, Kanban columns/appearance, and screen colors. Attachments are Media Library IDs.

= What happens on deactivate? =

Tables and options remain. There is no uninstall routine that drops data.

= Does Kanban include closed or archived work? =

The board lists **open** tasks on **non-archived** projects only.

= Who can drag Kanban cards? =

Anyone who can view the board. Saving the column layout still requires `ppm_manage_tasks`.

== Changelog ==

= 2.1.2 =

* Version line `2.1.2` (plugin header and `PPM_VERSION`).

= 2.1.1 =

* Plugin URI set to the product page `https://ariacoder.ir/aria-project-management/` so it is distinct from Author URI (`https://ariacoder.ir`).

= 2.1.0 =

* Version line `2.1.0` (plugin header and `PPM_VERSION`).
* Documentation: GitHub README and this `readme.txt` now describe grid/list projects, notebook archive/resources, Kanban column editor, Jalali calendar toggle, stored options, privacy, and FAQ.

= 2.0.0 =

* Major version line set to `2.0.0`.

= 1.1.0 =

* Plugin header Description expanded for the WordPress Plugins screen (tables, capabilities, dashboard/Chart.js, lifecycle fields, Kanban AJAX, Jalali datepicker, work calendar REST + admin-ajax, branding, CSV, placeholders).

= 1.0.0 =

* Initial public release (from `0.1.0`).

== Upgrade Notice ==

= 2.1.2 =

Maintenance release for WordPress.org review. No database migration.

= 2.1.1 =

Plugin homepage URL updated. No database migration.

= 2.1.0 =

Documentation update for GitHub and WordPress.org. No required database migration beyond the existing `ppm_db_version` / `dbDelta` path already used on `plugins_loaded`.
