/** * Quick add checklist * * @param void * @return null */ function quick_add() { if (!Page::canAdd($this->logged_user, $this->active_project)) { $this->httpError(HTTP_ERR_FORBIDDEN, lang("You don't have permission for this action"), true, true); } // if $this->skip_layout = true; $page_data = $this->request->post('page'); if (!is_array($page_data)) { $page_data = array('visibility' => $this->active_project->getDefaultVisibility()); } // if $this->smarty->assign(array('page_data' => $page_data, 'quick_add_url' => assemble_url('project_pages_quick_add', array('project_id' => $this->active_project->getId())))); if ($this->request->isSubmitted()) { db_begin_work(); $this->active_page = new Page(); if (count($_FILES > 0)) { attach_from_files($this->active_page, $this->logged_user); } // if $this->active_page->setAttributes($page_data); $this->active_page->setBody(clean(array_var($page_data, 'body', null))); $this->active_page->setProjectId($this->active_project->getId()); $this->active_page->setCreatedBy($this->logged_user); $this->active_page->setState(STATE_VISIBLE); $save = $this->active_page->save(); if ($save && !is_error($save)) { $subscribers = array($this->logged_user->getId()); if (is_foreachable($this->request->post('notify_users'))) { $subscribers = array_merge($subscribers, $this->request->post('notify_users')); } else { $subscribers[] = $this->active_project->getLeaderId(); } // if if (!in_array($this->active_project->getLeaderId(), $subscribers)) { $subscribers[] = $this->active_project->getLeaderId(); } // if Subscriptions::subscribeUsers($subscribers, $this->active_page); db_commit(); $this->active_page->ready(); $this->smarty->assign(array('active_page' => $this->active_page, 'page_data' => array('visibility' => $this->active_project->getDefaultVisibility()), 'project_id' => $this->active_project->getId())); } else { db_rollback(); $this->httpError(HTTP_ERR_OPERATION_FAILED, $save->getErrorsAsString(), true, true); } // if } // if }
* it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ include "prepend.inc.php"; $Server = getData("Server", "integer"); $User = getData("User"); $proc = new Procedure($Server); $proc->getDatas($User); $html = "<H1> Database " . $DB->Name($Server) . " - Procedure overview of User {$User}</H1>\n"; $html .= "<TABLE BORDER=0>\n<TR><TH>Name</TH><TH>Created</TH><TH>Last Modified</TH><TH>Status</TH></TR>\n"; $x = 0; if (is_array($proc->datas[$User])) { foreach ($proc->datas[$User] as $procedure) { $html .= $x % 2 ? "<tr bgcolor=\"#EEEEEE\" valign=top>" : "<tr bgcolor=\"#CCCCCC\" valign=top>"; $html .= "<td class=data><b>" . $procedure["OBJECT_NAME"] . "</b></td>"; $html .= "<td>" . $procedure["CREATED"] . "</td>"; $html .= "<td>" . $procedure["LASTMODIFIED"] . "</td>"; $html .= "<td>" . $procedure["STATUS"] . "</td>"; $html .= "</tr>"; $x++; } } $html .= "</table>"; $page = new Page("Procedure Overview"); $page->setHead(); $page->setBody(); $page->setSQL(); $page->setBody($html); $page->Display();
default: trace(2, __LINE__, __FILE__, "wrong submode of mode connection"); } break; case "info": switch ($submode) { case "aboutform": $title = "About"; $head = ""; $body = "<BODY BGCOLOR=\"#FFFFFF\" TEXT=\"#000000\">"; $html = "<form name=\"form\" action=\"top.php?" . SID . "\" method=POST target=\"topmenu\">"; $html .= "<table><tr><td align=center valign=top colspan=2><img src=\"images/logo.gif\"></td></tr>"; $html .= "<tr><td colspan=2 align=left>About phpOracleAdmin:</td></tr>"; $html .= "<tr><td colspan=2>Version " . $GLOBALS["VERSION"] . "</td></tr>"; $html .= "<tr><td>Homepage</td><td><a href=\"http://phporacleadmin.org\">http://phporacleadmin.org</a></td></tr>"; $html .= "<tr><td>Developer:</td><td>Thomas Fromm</td></tr>"; $html .= "<tr><td>Logo:</td><td>Thomas Weinert</td></tr>"; $html .= "<tr><td colspan=2 align=center><input type=button value=\"Close\" onClick=\"window.close()\"></td></tr>" . "</table></form>"; break; default: trace(2, __LINE__, __FILE__, "wrong submode of mode info"); } break; default: trace(2, __LINE__, __FILE__, "wrong mode"); } $page = new Page($title); $page->setHead($head); $page->setBody($body); $page->setBody($html); $page->Display();
foreach ($view->names as $username => $names) { $usernameraw = rawurlencode($username); $user = $tree->addFolder($views, $username . " (" . count($names) . ")", "view_main.php?Server={$Server}&User={$usernameraw}&" . SID); if (is_array($names)) { foreach ($names as $name) { $tree->addDocument($user, $name, "view_detail.php?Server={$Server}&Viewname={$name}&User={$usernameraw}&" . SID); } } } $view->destruct(); } else { // insert one object $tree->addFolder($views, 0, 0); } } } // end foreach $tree->closeTree(); $page = new Page("phpOracleAdmin"); $page->setHead(); if ($jswarning) { $page->setHead($jswarning); } $page->setBody("<BODY BGCOLOR=\"#D0DCE0\">"); $page->setBody($tree->getTree()); $page->Display(FALSE); ?>
function convertToPage(&$logged_user, &$error) { db_begin_work(); $page = new Page(); $page->setProjectId($this->getProjectId()); $page->setName($this->getName()); $body = $this->getBody(); if (empty($body)) { $body = 'page Content missing'; } $page->setBody($body); $page->setState($this->getState()); $page->setVisibility($this->getVisibility()); $page->setPriority($this->getPriority()); $page->setCommentsCount($this->getCommentsCount()); $page->setIsLocked($this->getIsLocked()); $page->setCreatedById($logged_user->getId()); $page->setCreatedByName($logged_user->getName()); $page->setCreatedByEmail($logged_user->getEmail()); $save = $page->save(); if ($save && !is_error($save)) { db_commit(); $page->ready(); $link = mysql_connect(DB_HOST, DB_USER, DB_PASS); mysql_select_db(DB_NAME); $query = "update healingcrystals_project_objects set parent_id='" . $page->getId() . "', parent_type='Page' where parent_id='" . $this->getId() . "' and project_id='" . $this->getProjectId() . "' and type in ('Comment', 'Task')"; mysql_query($query); $query = "update healingcrystals_project_objects set parent_id=null, parent_type=null where parent_id='" . $this->getId() . "' and project_id='" . $this->getProjectId() . "' and type not in ('Comment', 'Task')"; mysql_query($query); $query = "select * from healingcrystals_assignments where object_id='" . $this->getId() . "'"; $result = mysql_query($query); while ($entry = mysql_fetch_assoc($result)) { $query = "insert into healingcrystals_assignments (user_id, object_id, is_owner) values ('" . $entry['user_id'] . "', '" . $page->getId() . "', '" . $entry['is_owner'] . "')"; mysql_query($query); } $query = "select * from healingcrystals_project_object_categories where object_id='" . $this->getId() . "'"; $result = mysql_query($query); while ($entry = mysql_fetch_assoc($result)) { $query = "insert ignore into healingcrystals_project_object_categories (object_id, category_id) values ('" . $page->getId() . "', '" . $entry['category_id'] . "')"; mysql_query($query); } mysql_close($link); $this->moveToTrash(); return $page->getId(); } else { db_rollback(); $error = $save; return ''; } }
break; case "info": switch ($submode) { case "about": $head = "<script language=\"JavaScript\">" . "<!--\n function phpOracleadminAskPopup()" . "{\n" . "var popupURL = \"popup.php?mode=info&submode=aboutform&" . SID . "\";" . "var popup = window.open(popupURL,\"About\",'toolbar=0,location=0," . "directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=250,height=300');\n" . "popup.location = popupURL;\n" . "popup.focus();\n" . "}\n" . "phpOracleadminAskPopup();\n" . "// --></script>"; break; default: } break; default: } $html = "<table width=\"100%\">\n<tr>\n<td align=left>\n"; $html .= "<table><tr><td align=center>"; $html .= "<a href=\"top.php?mode=connection&submode=addask&" . SID . "\" target=\"topmenu\">" . "<img border=0 src=\"images/user-menu.gif\" alt=\"Add Connection\" width=32 height=32><br>Add<br>Connection</a>"; $html .= "</td><td align=center>"; $html .= "<a href=\"top.php?mode=connection&submode=dropask&" . SID . "\" target=\"topmenu\">" . "<img border=0 src=\"images/drop.gif\" alt=\"Drop Connection\" width=32 height=32><br>Drop<br>Connection</a>"; $html .= "</td><td align=center>"; $html .= "<a href=\"configuration.php?" . SID . "\" target=\"phpmain\">" . "<img border=0 src=\"images/config.gif\" alt=\"Session Configuration\" width=32 height=32><br>Session<br>Configuration</a>"; $html .= "</td></tr></table>\n"; $html .= "</td><td align=right valign=top><a href=\"top.php?mode=info&submode=about&" . SID . "\" target=\"topmenu\"><b>About</b></a></td>\n</tr>\n</table>\n"; $page = new Page("Top Menu"); $page->setHead(); if ($head) { $page->setHead($head); } $page->setBody("<body bgcolor=\"#F5F5F5\" text=\"#000000\">"); $page->setBody($html); $page->Display(); ?>