static function renderImportFromDirectory() { $html = '<div id="entryform">'; $html .= '<h1>' . translate('Import all .ics files of a directory') . '</h1>'; $html .= '<p>' . translate('This process will import each file in a directory named "username.ics" and create a user and calendar for each file to import.') . '</p>'; $data = (object) array('directory_path' => '/path/to/your/ics/files', 'calendar_path' => 'calendar'); $ef = new EntryForm($_SERVER['REQUEST_URI'], $data, true, true); $html .= "<table width=\"100%\" class=\"data\">\n"; $html .= $ef->StartForm(array("autocomplete" => "off")); $html .= $ef->DataEntryLine(translate("path to store your ics"), "%s", "text", "calendar_path", array("size" => 20, "title" => translate("Set the path to store your ics e.g. 'calendar' will be referenced as /caldav.php/username/calendar/"), "help" => translate("<b>WARNING: all events in this path will be deleted before inserting allof the ics file</b>")), ''); $html .= $ef->DataEntryLine(translate("Directory on the server"), "%s", "text", "directory_path", array("size" => 20, "title" => translate("The path on the server where your .ics files are."))); $html .= "</table>\n"; $html .= $ef->SubmitButton("import_from_directory", translate('Submit')); $html .= $ef->EndForm(); $html .= "</div>"; return $html; }
/** * Render the form / viewer as HTML to show the userclient * @return string An HTML fragment to display in the page. */ function Render() { global $c, $session; $html = ""; $session->Dbg("OrganisationPlus", "Render: type=insert"); $ef = new EntryForm($REQUEST_URI, $this->Values, $this->EditMode); $ef->NoHelp(); // Prefer this style, for the moment $onsubmit = $this->validation->func_name; // retrieve the name of the onsubmit javascript function $html .= $ef->StartForm(array("autocomplete" => "off", "onsubmit" => "return {$onsubmit}(this)")); $html .= "<table class=\"data\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\n"; $html .= $this->RenderOrganisationDetails($ef); $html .= $this->RenderDefaultSystem($ef); $html .= $this->RenderPrimaryUser($ef); // Render the Javascript validation rules for the form $html .= $this->validation->RenderJavascript(); $html .= "</table>\n"; $html .= '<div id="footer">'; $html .= $ef->SubmitButton("submit", "insert" == $this->WriteType ? "Create" : "Update"); $html .= '</div>'; $html .= $ef->EndForm(); if ($this->new_record) { // We have a small script here to toggle enablement of the password fields vs. invite field. $html .= <<<EOSCRIPT <script language="JavaScript"> function InviteChanged(invite) { invite.form.new_password.disabled = invite.checked; invite.form.confirm_password.disabled = invite.form.new_password.disabled; return true; } InviteChanged(document.getElementById('id_invite')); </script> EOSCRIPT; } return $html; }
$s .= " " . $stlink . "</p>"; $project->QAMSNotifyEmail("QAMS Activity Notice", $s, $subject, $recipients); } } } // null assignment } // assignment changed } } // Main content.. $s = ""; $ef = new EntryForm($RESPONSE->requested, $project, $have_admin ? 1 : 0); $ef->NoHelp(); if ($ef->editmode) { $s .= $ef->StartForm(); $s .= $ef->HiddenField("qa_action", "{$qa_action}"); if ($project->request_id > 0) { $s .= $ef->HiddenField("project_id", $project->request_id); $s .= $ef->HiddenField("step_id", "{$qastep->qa_step_id}"); } } // Start main table.. $s .= "<table width=\"100%\" class=\"data\" cellspacing=\"0\" cellpadding=\"0\">\n"; $s .= $ef->BreakLine("Quality Assurance Step"); $s .= "<tr><td height=\"15\" colspan=\"2\"> </td></tr>"; if ($this->project_manager_fullname != "") { $href = "/user.php?user_no={$this->project_manager}"; $link = "<a href=\"{$href}\">" . $this->project_manager_fullname . "</a>"; $s .= "<tr><td colspan=\"2\"><b>Project Manager:</b> " . $link . "</td></tr>"; }
/** * Render the form / viewer as HTML to show the user * @return string An HTML fragment to display in the page. */ function Render() { $html = ""; dbg_error_log("User", ":Render: type={$this->WriteType}, edit_mode={$this->EditMode}"); $ef = new EntryForm($REQUEST_URI, $this->Values, $this->EditMode); $ef->NoHelp(); // Prefer this style, for the moment if ($ef->EditMode) { $html .= $ef->StartForm(array("autocomplete" => "off")); if ($this->user_no > 0) { $html .= $ef->HiddenField("user_no", $this->user_no); } } $html .= "<table width=\"100%\" class=\"data\" cellspacing=\"0\" cellpadding=\"0\">\n"; $html .= $this->RenderFields($ef); $html .= $this->RenderRoles($ef); $html .= "</table>\n"; if ($ef->EditMode) { $html .= '<div id="footer">'; $html .= $ef->SubmitButton("submit", "insert" == $this->WriteType ? translate("Create") : translate("Update")); $html .= '</div>'; $html .= $ef->EndForm(); } return $html; }
/** * Return project QA Plan. If editable return as form fields with * the form tags, encapsulated in a nice table with all of the fields we * need to edit a project's QA plan. * @param integer $edit Flag, if 1 then editable fields in a form */ function RenderQAPlan($edit = 1) { global $qa_action; $s = ""; $ef = new EntryForm($REQUEST_URI, $this, $edit); $ef->NoHelp(); if ($ef->editmode) { $s .= $ef->StartForm(); if ($this->request_id > 0) { $s .= $ef->HiddenField("request_id", $this->request_id); $s .= $ef->HiddenField("post_action", "config_update"); $s .= $ef->HiddenField("qa_action", "qaplan"); $s .= $ef->HiddenField("edit", "1"); } } // Just the things we want created/updated in QAMS.. $s .= "<table width=\"100%\" class=\"data\" cellspacing=\"0\" cellpadding=\"0\">\n"; if (isset($this->qa_process)) { $s .= $ef->BreakLine("Quality Assurance Plan"); $s .= "<tr><td height=\"15\" colspan=\"2\"> </td></tr>\n"; // Project info.. $s .= "<tr><td colspan=\"2\"><b>Project:</b> " . $this->brief . "</td></tr>\n"; if ($this->project_manager_fullname != "") { $pmlink = "<a href=\"/user.php?user_no={$this->project_manager}\">"; $pmlink .= $this->project_manager_fullname; $pmlink .= "</a>"; $s .= "<tr><td colspan=\"2\"><b>Project Manager:</b> " . $pmlink . "</td></tr>"; } if ($this->qa_mentor_fullname != "") { $qalink = "<a href=\"/user.php?user_no={$this->qa_mentor}\">"; $qalink .= $this->qa_mentor_fullname; $qalink .= "</a>"; $s .= "<tr><td colspan=\"2\"><b>QA Mentor:</b> " . $qalink . "</td></tr>"; } $s .= "<tr><td height=\"15\" colspan=\"2\"> </td></tr>"; $s .= "<tr><td colspan=\"2\">" . $this->qa_process->QAPlan() . "</td></tr>"; } $s .= "<tr><td height=\"15\" colspan=\"2\"> </td></tr>"; $s .= "</table>\n"; $qaplan_status = $this->qa_process->overall_approval_status(STEP_ID_QAPLAN); if ($ef->editmode && $qaplan_status != "y" && $qaplan_status != "p") { $s .= $ef->SubmitButton("submit", "Update"); $s .= $ef->EndForm(); } return $s; }
function RenderSearchForm($target_url) { global $session, $theme, $search_record; $html = ""; $search_record = (object) array(); $org_code = intval($GLOBALS['org_code']); if ($org_code > 0) { $search_record->org_code = $org_code; } // $session->Log( 'DBG: isset($_POST[submit])=%s isset($_GET[saved_query])=%s', isset($_POST[submit]), isset($_GET['saved_query'] ) ); if (!isset($_POST['submit']) && isset($_GET['saved_query'])) { $qry = new PgQuery("SELECT query_params FROM saved_queries WHERE (user_no = ? OR public ) AND lower(query_name) = lower(?);", $session->user_no, $_GET['saved_query']); if ($qry->Exec('RenderSearchForm') && $qry->rows == 1 && ($row = $qry->Fetch())) { $_POST = unserialize($row->query_params); } } $ef = new EntryForm($REQUEST_URI, $search_record, true); // We do the formatting fairly carefully here... $ef->SimpleForm('<span style="white-space: nowrap"><span class="srchp">%s:</span><span class="srchf">%s</span></span> '); $html .= $ef->StartForm(array("autocomplete" => "off", "onsubmit" => "return CheckSearchForm();")); $html .= "<table border=0 cellspacing=2 cellpadding=0 align=center class=row0 width=100% style=\"border: 1px dashed #aaaaaa;\">\n"; $html .= "<tr><td width=100%><table border=0 cellspacing=0 cellpadding=0 width=100%><tr valign=middle><td width=100%>\n"; if (isset($_GET['search_for']) && !isset($_POST['search_for'])) { $_POST['search_for'] = $_GET['search_for']; } $html .= $ef->DataEntryLine("Find", "%s", "text", "search_for", array("size" => 10, "class" => "srchf", "title" => "Search for free text in the request or notes. Regular expressions are OK too.")); // Organisation drop-down if ($session->AllowedTo("Admin") || $session->AllowedTo("Support") || $session->AllowedTo("Contractor")) { $html .= $ef->DataEntryLine("Organisation", "", "lookup", "org_code", array("_sql" => SqlSelectOrganisations($org_code), "_null" => "-- All Organisations --", "onchange" => "OrganisationChanged();", "title" => "The organisation that this work will be done for.", "class" => "srchf", "style" => "width: 18em")); } // System (within Organisation) drop-down $html .= $ef->DataEntryLine("System", "", "lookup", "system_id", array("_sql" => SqlSelectSystems($org_code), "_null" => "-- All Systems --", "onchange" => "SystemChanged();", "title" => "The business system that this request applies to.", "class" => "srchf", "style" => "width: 18em")); $html .= $ef->DataEntryLine("Requester", "", "lookup", "requested_by", array("_sql" => SqlSelectRequesters($org_code), "_null" => "-- Any Requester --", "onchange" => "PersonChanged();", "title" => "The client who is requesting this, or who is in charge of ensuring it happens.", "class" => "srchf", "style" => "width: 12em")); $html .= $ef->DataEntryLine("Watching", "", "lookup", "interested_in", array("_sql" => SqlSelectSubscribers($org_code), "_null" => "-- Any Interested User --", "title" => "The client who is requesting this, or who is in charge of ensuring it happens.", "class" => "srchf", "style" => "width: 12em")); // Person Assigned to W/R $html .= $ef->DataEntryLine("ToDo", "", "lookup", "allocated_to", array("_sql" => SqlSelectSubscribers($org_code), "_null" => "-- Any Assigned User --", "_nobody" => "-- Not Yet Allocated --", "class" => "srchf", "title" => "A person who has been assigned to work on requests.", "style" => "width: 12em")); // Date range $html .= $ef->DataEntryLine("Last Action", "%s", "date", "from_date", array("size" => 10, "class" => "srchf", "title" => "Only show requests with action after this date.")); $html .= "<a href=\"javascript:show_calendar('forms.form.from_date');\" onmouseover=\"window.status='Date Picker';return true;\" onmouseout=\"window.status='';return true;\">" . $theme->Image("date-picker.gif") . "</a> \n"; $html .= $ef->DataEntryLine("To", "%s", "date", "to_date", array("size" => 10, "class" => "srchf", "title" => "Only show requests with action before this date.")); $html .= "<a href=\"javascript:show_calendar('forms.form.to_date');\" onmouseover=\"window.status='Date Picker';return true;\" onmouseout=\"window.status='';return true;\">" . $theme->Image("date-picker.gif") . "</a> \n"; // Type of Request $html .= $ef->DataEntryLine("Type", "%s", "lookup", "type_code", array("_type" => "request|request_type", "_null" => "-- All Types --", "class" => "srchf", "style" => "width: 8em", "title" => "Only show this type of request")); if ($session->AllowedTo("Admin")) { // $html .= "<div id=\"whereclause\">"; $html .= $ef->DataEntryLine("Where", "%s", "text", "where_clause", array("size" => 60, "class" => "srchf", "title" => "Add an SQL 'WHERE' clause to further refine the search - you will need to know what you are doing...")); // $html .= "</div>"; } $html .= "<table border='0' cellspacing='0' cellpadding='0' width='100%'><tr>"; $html .= "<td style=\"vertical-align: top; padding-top: 0.3em; white-space:wrap;\"><span class=\"srchp\">Status:</span></td><td valign='top'>\n"; $sql = "SELECT * FROM lookup_code WHERE source_table='request' "; $sql .= " AND source_field='status_code' "; $sql .= " ORDER BY source_table, source_field, lookup_seq, lookup_code "; $qry = new PgQuery($sql); if ($qry->Exec("RenderSearchForm") && $qry->rows > 0) { $i = 0; while ($status = $qry->Fetch()) { $ef->record->incstat[$status->lookup_code] = strpos($GLOBALS['default_search_statuses'], $status->lookup_code) != false ? 1 : ''; if ($i++ > 0) { $html .= " "; } $html .= $ef->DataEntryField("%s", "checkbox", "incstat[{$status->lookup_code}]", array("_label" => $status->lookup_desc, "class" => "srchf", "value" => 1)); // if ( $i++ == round($qry->rows / 2) ) $html .= "<br />"; } $html .= $ef->DataEntryField("%s", "checkbox", "inactive", array("_label" => "inactive", "class" => "srchf", "value" => 1)); $html .= "</td>\n"; } $html .= "</tr></table>\n"; $html .= RenderTagsPanel($ef); $html .= RenderColumnSelections($ef); // style="display: block; float:right; clear: left;" $html .= '<div id="savesearch">'; $html .= $ef->DataEntryLine("Save as", "%s", "text", "savelist", array("size" => 20, "class" => "srchf", "title" => "A name to use to refer to this query in the future.")); $html .= $ef->DataEntryField("%s", "checkbox", "save_query_order", array("_label" => "With Order?", "class" => "srchf", "value" => 1)); $html .= $ef->DataEntryField("%s", "checkbox", "save_public", array("_label" => "Public?", "class" => "srchf", "value" => 1)); $search_record->save_hotlist = 't'; $html .= $ef->DataEntryField("%s", "checkbox", "save_hotlist", array("_label" => "In my menu?", "class" => "srchf", "value" => 1)); $html .= $ef->SubmitButton("submit", "Save Query", array("title" => "Save this query so you can run it again.")); $html .= "</div>"; $html .= $ef->DataEntryLine("Max results", "%s", "text", "maxresults", array("size" => 6, "class" => "srchf", "title" => "The maximum number of rows to show in the listing")); $html .= $ef->SubmitButton("submit", "Run Query", array("title" => "Run a query with these settings")); $html .= "</td></tr></table>\n"; $html .= "</td></tr></table>\n"; $html .= $ef->EndForm(); return $html; }
if ($session->AllowedTo("Admin") || $session->AllowedTo("Support")) { $sql .= "OR organisation.org_type = 1 "; /** Primary Support Organisation */ } $sql .= ") "; if (!($session->AllowedTo("Admin") || $session->AllowedTo("Support"))) { $sql .= "AND usr.org_code='{$session->org_code}' "; } $sql .= " ORDER BY (1000 - lookup_seq), LOWER(fullname);"; $q = new PgQuery($sql, $system_id); // echo "<p>$q->querystring</p>"; $search_record = (object) array(); $ef = new EntryForm($REQUEST_URI, $search_record, true); $ef->NoHelp(); // Prefer this style, for the moment echo $ef->StartForm(array("autocomplete" => "off")); if ($q->Exec("SystemUsers::Users") && $q->rows) { // Build table of usrs found echo <<<TABLEHEADINGS <table border="0" cellpadding="2" cellspacing="1" align="center" width="100%"> <tr> <th class="cols">Full Name</th> <th class="cols">Organisation</th> <th class="cols">User Role</th> </tr> TABLEHEADINGS; $line_format = <<<LINEFORMAT <tr class="row%1d" title="%s"> <td class="sml"><a href="user.php?user_no=%d">%s</a></td> <td class="sml"><a href="org.php?org_code=%d">%s</a></td> <td class="sml" bgcolor="%s" align="center">%s</td>