error(T('There are no products set up.')); } foreach (bugdar::$datastore['product'] AS $product) { if ($product['parentid']) { $components["$product[componentmother]"]["$product[productid]"] = $product; } else { $products["$product[productid]"] = $product; } } foreach (bugdar::$datastore['version'] AS $version) { $versions["$version[productid]"]["$version[versionid]"] = $version; } // global versions if (is_array($versions['0'])) { foreach ($versions['0'] as $version) { $tpl = new BSTemplate('explain_row'); $tpl->vars = array( 'left' => $version['version'], ); $globalversions .= $tpl->evaluate()->getTemplate(); } } foreach ($products as $product) { $tpl = new BSTemplate('explain_row'); $tpl->vars = array( 'left' => $product['title'], 'right' => $product['description'], 'trextra' => ' class="altcolor"' ); $productlist .= $tpl->evaluate()->getTemplate(); if (is_array($components["$product[productid]"])) { foreach ($components["$product[productid]"] as $component) { $tpl = new BSTemplate('explain_row'); $tpl->vars = array( 'left' => '  ›   ' . $component['title'], 'right' => $component['description'], ); $productlist .= $tpl->evaluate()->getTemplate(); } } } $tpl = new BSTemplate('explain_product'); $tpl->vars = array( 'globalversions' => $globalversions, 'productlist' => $productlist ); $tpl->evaluate()->flush(); } // ################################################################### if ($_REQUEST['do'] == 'automations') { $fields_fetch = $db->query(" SELECT bugfield.*, MAX(permission.mask) AS mask FROM " . TABLE_PREFIX . "bugfield AS bugfield LEFT JOIN " . TABLE_PREFIX . "bugfieldpermission AS permission ON (bugfield.fieldid = permission.fieldid) WHERE (permission.mask = 2 OR permission.mask = 1) AND permission.usergroupid IN (" . bugdar::$userinfo['usergroupid'] . (sizeof(bugdar::$userinfo['groupids']) != 0 ? ',' . implode(',', bugdar::$userinfo['groupids']) : '') . ") GROUP BY (bugfield.fieldid) "); foreach ($fields_fetch as $field) { $fields["$field[fieldid]"] = $field; } if (is_array(bugdar::$datastore['automation'])) { foreach (bugdar::$datastore['automation'] as $automation) { $automation['fieldchanges'] = unserialize($automation['fieldchanges']); $tpl = new BSTemplate('explain_row'); $tpl->vars = array( 'left' => $automation['name'], 'right' => $automation['description'], 'trextra' => ' class="listinghead"' ); $automations .= $tpl->evaluate()->getTemplate(); if ($automation['comment']) { $tpl = new BSTemplate('explain_row'); $tpl->vars = array( 'left' => T('Add Comment'), 'right' => $automation['comment'], 'trextra' => ' class="altcolor"' ); $automations .= $tpl->evaluate()->getTemplate(); } $trextra = ''; if (is_array($automation['fieldchanges']['builtin'])) { foreach ($automation['fieldchanges']['builtin'] AS $name => $value) { $tpl = new BSTemplate('explain_row'); $tpl->vars = array( 'left' => $name, 'right' => bugdar::$datastore["$name"]["$value"]["$name"], ); $automations .= $tpl->evaluate()->getTemplate(); } } if (is_array($automation['fieldchanges']['custom'])) { foreach ($automation['fieldchanges']['custom'] AS $id => $value) { if (!$fields["$id"]) { continue; } $tpl = new BSTemplate('explain_row'); $tpl->vars = array( 'left' => $fields["$id"]['name'] . ' ' . sprintf(T('(Custom #%1$d, type: %2$s)'), $id, $fields["$id"]['type']), 'right' => $value, ); $automations .= $tpl->evaluate()->getTemplate(); } } } } $tpl = new BSTemplate('explain_automation'); $tpl->vars = array('automations' => $automations); $tpl->evaluate()->flush(); } ?>