Using data parent for organization, project and task fields in books of doks or notes

This commit is contained in:
Manuel Cillero 2017-09-05 10:39:43 +02:00
parent 99e96a895a
commit 1371a4bec5
6 changed files with 38 additions and 3 deletions

View file

@ -1,5 +1,6 @@
name = Storm Dok
description = "Allows creation of documents about organizations, projects or tasks."
dependencies[] = book
dependencies[] = storm
dependencies[] = stormorganization
dependencies[] = stormproject

View file

@ -355,6 +355,24 @@ function stormdok_form(&$node) {
drupal_set_breadcrumb($breadcrumb);
if (arg(1)=='add') {
if (array_key_exists('parent', $_GET)) {
$book_parent = book_link_load($_GET['parent']);
if (isset($book_parent)) {
$parent = node_load($book_parent['nid']);
if (!empty($parent->organization_nid)) {
$_GET['organization_nid'] = $parent->organization_nid;
}
if (!empty($parent->project_nid)) {
$_GET['project_nid'] = $parent->project_nid;
}
elseif ($parent->type == 'stormproject') {
$_GET['project_nid'] = $parent->nid;
}
if (!empty($parent->task_nid)) {
$_GET['task_nid'] = $parent->task_nid;
}
}
}
if (array_key_exists('organization_nid', $_GET) && !$node->organization_nid) {
$node->organization_nid = $_GET['organization_nid'];
}

View file

@ -1,5 +1,6 @@
name = Storm Note
description = "Allows creation of notes about organizations, projects or tasks."
dependencies[] = book
dependencies[] = storm
dependencies[] = stormorganization
dependencies[] = stormproject

View file

@ -221,6 +221,21 @@ function stormnote_form(&$node) {
drupal_set_breadcrumb($breadcrumb);
if (arg(1)=='add') {
if (array_key_exists('parent', $_GET)) {
$book_parent = book_link_load($_GET['parent']);
if (isset($book_parent)) {
$parent = node_load($book_parent['nid']);
if (!empty($parent->organization_nid)) {
$_GET['organization_nid'] = $parent->organization_nid;
}
if (!empty($parent->project_nid)) {
$_GET['project_nid'] = $parent->project_nid;
}
if (!empty($parent->task_nid)) {
$_GET['task_nid'] = $parent->task_nid;
}
}
}
if (array_key_exists('organization_nid', $_GET) && !$node->organization_nid) {
$node->organization_nid = $_GET['organization_nid'];
}

View file

@ -36,8 +36,8 @@ ul.inline li {
list-style: none;
}
@media (max-width: 529px) { /* MINW = 530px */
.node .content ul, .node .content ol {
padding-left: 10% !important;
.node .content td > ul, .node .content td > ol {
padding-left: 10%;
}
}

View file

@ -1,6 +1,6 @@
name = SuiteDesk Theme
description = SuiteDesk Theme Zen.
version = 0.2.55
version = 0.2.56
screenshot = screenshot.png