mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-13 17:38:19 +01:00
Started cleaning up the templates
This commit is contained in:
parent
eb5b0f9ff8
commit
1a1f774680
@ -18,30 +18,29 @@
|
||||
include($phpgw_info["server"]["server_root"] . "/admin/inc/accounts_"
|
||||
. $phpgw_info["server"]["auth_type"] . ".inc.php");
|
||||
|
||||
$t = $phpgw->template; // Just temp (jengo)
|
||||
$t->set_file(array("header" => "accounts.tpl",
|
||||
$phpgw->template->set_file(array("header" => "accounts.tpl",
|
||||
"row" => "accounts.tpl",
|
||||
"footer" => "accounts.tpl"));
|
||||
|
||||
$t->set_block("header","row","footer");
|
||||
$phpgw->template->set_block("header","row","footer");
|
||||
|
||||
$total = account_total();
|
||||
$phpgw->templateotal = account_total();
|
||||
|
||||
$t->set_var("bg_color",$phpgw_info["theme"]["bg_color"]);
|
||||
$t->set_var("th_bg",$phpgw_info["theme"]["th_bg"]);
|
||||
$phpgw->template->set_var("bg_color",$phpgw_info["theme"]["bg_color"]);
|
||||
$phpgw->template->set_var("th_bg",$phpgw_info["theme"]["th_bg"]);
|
||||
|
||||
$t->set_var("left_next_matchs",$phpgw->nextmatchs->left("accounts.php",$start,$total));
|
||||
$t->set_var("lang_user_accounts",lang("user accounts"));
|
||||
$t->set_var("right_next_matchs",$phpgw->nextmatchs->right("accounts.php",$start,$total));
|
||||
$phpgw->template->set_var("left_next_matchs",$phpgw->nextmatchs->left("accounts.php",$start,$phpgw->templateotal));
|
||||
$phpgw->template->set_var("lang_user_accounts",lang("user accounts"));
|
||||
$phpgw->template->set_var("right_next_matchs",$phpgw->nextmatchs->right("accounts.php",$start,$phpgw->templateotal));
|
||||
|
||||
$t->set_var("lang_lastname",$phpgw->nextmatchs->show_sort_order($sort,"account_lastname",$order,"accounts.php",lang("last name")));
|
||||
$t->set_var("lang_firstname",$phpgw->nextmatchs->show_sort_order($sort,"account_firstname",$order,"accounts.php",lang("first name")));
|
||||
$phpgw->template->set_var("lang_lastname",$phpgw->nextmatchs->show_sort_order($sort,"account_lastname",$order,"accounts.php",lang("last name")));
|
||||
$phpgw->template->set_var("lang_firstname",$phpgw->nextmatchs->show_sort_order($sort,"account_firstname",$order,"accounts.php",lang("first name")));
|
||||
|
||||
$t->set_var("lang_edit",lang("Edit"));
|
||||
$t->set_var("lang_delete",lang("Delete"));
|
||||
$t->set_var("lang_view",lang("View"));
|
||||
$phpgw->template->set_var("lang_edit",lang("Edit"));
|
||||
$phpgw->template->set_var("lang_delete",lang("Delete"));
|
||||
$phpgw->template->set_var("lang_view",lang("View"));
|
||||
|
||||
$t->parse("out","header");
|
||||
$phpgw->template->parse("out","header");
|
||||
|
||||
$account_info = account_read($method,$start,$sort,$order);
|
||||
|
||||
@ -57,8 +56,8 @@
|
||||
$account_id = $account["account_id"];
|
||||
$loginid = $account["account_lid"];
|
||||
|
||||
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
|
||||
$t->set_var("tr_color",$tr_color);
|
||||
$phpgw->templater_color = $phpgw->nextmatchs->alternate_row_color($phpgw->templater_color);
|
||||
$phpgw->template->set_var("tr_color",$phpgw->templater_color);
|
||||
|
||||
// $lastname = $account["account_lastname"];
|
||||
// $firstname = $account["account_firstname"];
|
||||
@ -66,34 +65,34 @@
|
||||
if (! $lastname) $lastname = ' ';
|
||||
if (! $firstname) $firstname = ' ';
|
||||
|
||||
$t->set_var("row_firstname",$firstname);
|
||||
$t->set_var("row_lastname",$lastname);
|
||||
$t->set_var("row_edit",'<a href="'.$phpgw->link("editaccount.php","account_id="
|
||||
$phpgw->template->set_var("row_firstname",$firstname);
|
||||
$phpgw->template->set_var("row_lastname",$lastname);
|
||||
$phpgw->template->set_var("row_edit",'<a href="'.$phpgw->link("editaccount.php","account_id="
|
||||
. $account_id) . '"> ' . lang("Edit") . ' </a>');
|
||||
|
||||
if ($phpgw_info["user"]["userid"] != $account["account_lid"]) {
|
||||
$t->set_var("row_delete",'<a href="' . $phpgw->link("deleteaccount.php",'account_id='
|
||||
$phpgw->template->set_var("row_delete",'<a href="' . $phpgw->link("deleteaccount.php",'account_id='
|
||||
. $account_id) . '"> '.lang("Delete").' </a>');
|
||||
} else {
|
||||
$t->set_var("row_delete"," ");
|
||||
$phpgw->template->set_var("row_delete"," ");
|
||||
}
|
||||
|
||||
$t->set_var("row_view",'<a href="' . $phpgw->link("viewaccount.php", "account_id="
|
||||
$phpgw->template->set_var("row_view",'<a href="' . $phpgw->link("viewaccount.php", "account_id="
|
||||
. $account_id) . '"> ' . lang("View") . ' </a>');
|
||||
|
||||
if ($total == 1) {
|
||||
$t->set_var("output","");
|
||||
if ($phpgw->templateotal == 1) {
|
||||
$phpgw->template->set_var("output","");
|
||||
}
|
||||
if ($total != ++$i) {
|
||||
$t->parse("output","row",True);
|
||||
if ($phpgw->templateotal != ++$i) {
|
||||
$phpgw->template->parse("output","row",True);
|
||||
}
|
||||
}
|
||||
|
||||
$t->set_var("actionurl",$phpgw->link("newaccount.php"));
|
||||
$t->set_var("lang_add",lang("add"));
|
||||
$t->set_var("lang_search",lang("search"));
|
||||
$phpgw->template->set_var("actionurl",$phpgw->link("newaccount.php"));
|
||||
$phpgw->template->set_var("lang_add",lang("add"));
|
||||
$phpgw->template->set_var("lang_search",lang("search"));
|
||||
|
||||
$t->pparse("out","footer");
|
||||
$phpgw->template->pparse("out","footer");
|
||||
|
||||
$phpgw->common->phpgw_footer();
|
||||
|
||||
|
@ -14,12 +14,12 @@
|
||||
$phpgw_info["flags"]["currentapp"] = "admin";
|
||||
include("../header.inc.php");
|
||||
|
||||
$t = new Template($phpgw_info["server"]["template_dir"]);
|
||||
$t->set_file(array( "header" => "currentusers.tpl",
|
||||
$phpgw->template = new Template($phpgw_info["server"]["template_dir"]);
|
||||
$phpgw->template->set_file(array( "header" => "currentusers.tpl",
|
||||
"row" => "currentusers.tpl",
|
||||
"footer" => "currentusers.tpl" ));
|
||||
|
||||
$t->set_block("header","row","footer","output");
|
||||
$phpgw->template->set_block("header","row","footer","output");
|
||||
|
||||
if (! $start)
|
||||
$start = 0;
|
||||
@ -28,26 +28,26 @@
|
||||
$phpgw->db->query("select count(*) from sessions");
|
||||
$phpgw->db->next_record();
|
||||
|
||||
$total = $phpgw->db->f(0);
|
||||
$phpgw->templateotal = $phpgw->db->f(0);
|
||||
$limit = $phpgw->nextmatchs->sql_limit($start);
|
||||
|
||||
$t->set_var("lang_current_users",lang("List of current users"));
|
||||
$t->set_var("bg_color",$phpgw_info["theme"][bg_color]);
|
||||
$t->set_var("left_next_matchs",$phpgw->nextmatchs->left("currentusers.php",$start,$total));
|
||||
$t->set_var("right_next_matchs",$phpgw->nextmatchs->right("currentusers.php",$start,$total));
|
||||
$t->set_var("th_bg",$phpgw_info["theme"]["th_bg"]);
|
||||
$phpgw->template->set_var("lang_current_users",lang("List of current users"));
|
||||
$phpgw->template->set_var("bg_color",$phpgw_info["theme"][bg_color]);
|
||||
$phpgw->template->set_var("left_next_matchs",$phpgw->nextmatchs->left("currentusers.php",$start,$phpgw->templateotal));
|
||||
$phpgw->template->set_var("right_next_matchs",$phpgw->nextmatchs->right("currentusers.php",$start,$phpgw->templateotal));
|
||||
$phpgw->template->set_var("th_bg",$phpgw_info["theme"]["th_bg"]);
|
||||
|
||||
$t->set_var("sort_loginid",$phpgw->nextmatchs->show_sort_order($sort,"session_lid",$order,
|
||||
$phpgw->template->set_var("sort_loginid",$phpgw->nextmatchs->show_sort_order($sort,"session_lid",$order,
|
||||
"currentusers.php",lang("LoginID")));
|
||||
$t->set_var("sort_ip",$phpgw->nextmatchs->show_sort_order($sort,"session_ip",$order,
|
||||
$phpgw->template->set_var("sort_ip",$phpgw->nextmatchs->show_sort_order($sort,"session_ip",$order,
|
||||
"currentusers.php",lang("IP")));
|
||||
$t->set_var("sort_login_time",$phpgw->nextmatchs->show_sort_order($sort,"session_logintime",$order,
|
||||
$phpgw->template->set_var("sort_login_time",$phpgw->nextmatchs->show_sort_order($sort,"session_logintime",$order,
|
||||
"currentusers.php",lang("Login Time")));
|
||||
$t->set_var("sort_idle",$phpgw->nextmatchs->show_sort_order($sort,"session_dla",$order,
|
||||
$phpgw->template->set_var("sort_idle",$phpgw->nextmatchs->show_sort_order($sort,"session_dla",$order,
|
||||
"currentusers.php",lang("idle")));
|
||||
$t->set_var("lang_kill",lang("Kill"));
|
||||
$phpgw->template->set_var("lang_kill",lang("Kill"));
|
||||
|
||||
$t->parse("out","header");
|
||||
$phpgw->template->parse("out","header");
|
||||
|
||||
|
||||
if ($order) {
|
||||
@ -60,29 +60,29 @@
|
||||
|
||||
$i = 0;
|
||||
while ($phpgw->db->next_record()) {
|
||||
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
|
||||
$t->set_var("tr_color",$tr_color);
|
||||
$phpgw->templater_color = $phpgw->nextmatchs->alternate_row_color($phpgw->templater_color);
|
||||
$phpgw->template->set_var("tr_color",$phpgw->templater_color);
|
||||
|
||||
$t->set_var("row_loginid",$phpgw->db->f("session_lid"));
|
||||
$t->set_var("row_ip",$phpgw->db->f("session_ip"));
|
||||
$t->set_var("row_logintime",$phpgw->common->show_date($phpgw->db->f("session_logintime")));
|
||||
$t->set_var("row_idle",gmdate("G:i:s",(time() - $phpgw->db->f("session_dla"))));
|
||||
$phpgw->template->set_var("row_loginid",$phpgw->db->f("session_lid"));
|
||||
$phpgw->template->set_var("row_ip",$phpgw->db->f("session_ip"));
|
||||
$phpgw->template->set_var("row_logintime",$phpgw->common->show_date($phpgw->db->f("session_logintime")));
|
||||
$phpgw->template->set_var("row_idle",gmdate("G:i:s",(time() - $phpgw->db->f("session_dla"))));
|
||||
|
||||
if ($phpgw->db->f("session_id") != $phpgw_info["user"]["sessionid"]) {
|
||||
$t->set_var("row_kill",'<a href="' . $phpgw->link("killsession.php","ksession="
|
||||
$phpgw->template->set_var("row_kill",'<a href="' . $phpgw->link("killsession.php","ksession="
|
||||
. $phpgw->db->f("session_id") . "&kill=true\">" . lang("Kill")).'</a>');
|
||||
} else {
|
||||
$t->set_var("row_kill"," ");
|
||||
$phpgw->template->set_var("row_kill"," ");
|
||||
}
|
||||
|
||||
if ($phpgw->db->num_rows() == 1) {
|
||||
$t->set_var("output","");
|
||||
$phpgw->template->set_var("output","");
|
||||
}
|
||||
if ($phpgw->db->num_rows() != ++$i) {
|
||||
$t->parse("output","row",True);
|
||||
$phpgw->template->parse("output","row",True);
|
||||
}
|
||||
}
|
||||
|
||||
$t->pparse("out","footer");
|
||||
$phpgw->template->pparse("out","footer");
|
||||
$phpgw->common->phpgw_footer();
|
||||
?>
|
||||
|
@ -20,17 +20,16 @@
|
||||
$phpgw_info["flags"]["currentapp"] = "admin";
|
||||
include("../header.inc.php");
|
||||
|
||||
$t = new Template($phpgw_info["server"]["template_dir"]);
|
||||
$t->set_file(array("form" => "application_form.tpl"));
|
||||
$phpgw->template->set_file(array("form" => "application_form.tpl"));
|
||||
|
||||
if ($submit) {
|
||||
$totalerrors = 0;
|
||||
$phpgw->templateotalerrors = 0;
|
||||
|
||||
if (! $n_app_name)
|
||||
$error[$totalerrors++] = lang("You must enter an application name.");
|
||||
$error[$phpgw->templateotalerrors++] = lang("You must enter an application name.");
|
||||
|
||||
if (! $n_app_title)
|
||||
$error[$totalerrors++] = lang("You must enter an application title.");
|
||||
$error[$phpgw->templateotalerrors++] = lang("You must enter an application title.");
|
||||
|
||||
if ($old_app_name != $n_app_name) {
|
||||
$phpgw->db->query("select count(*) from applications where app_name='"
|
||||
@ -38,11 +37,11 @@
|
||||
$phpgw->db->next_record();
|
||||
|
||||
if ($phpgw->db->f(0) != 0) {
|
||||
$error[$totalerrors++] = lang("That application name already exsists.");
|
||||
$error[$phpgw->templateotalerrors++] = lang("That application name already exsists.");
|
||||
}
|
||||
}
|
||||
|
||||
if (! $totalerrors) {
|
||||
if (! $phpgw->templateotalerrors) {
|
||||
$phpgw->db->query("update applications set app_name='" . addslashes($n_app_name) . "',"
|
||||
. "app_title='" . addslashes($n_app_title) . "', app_enabled='"
|
||||
. "$n_app_enabled' where app_name='$old_app_name'");
|
||||
@ -54,13 +53,13 @@
|
||||
$phpgw->db->query("select * from applications where app_name='$app_name'");
|
||||
$phpgw->db->next_record();
|
||||
|
||||
if ($totalerrors) {
|
||||
if ($phpgw->templateotalerrors) {
|
||||
$phpgw->common->phpgw_header();
|
||||
$phpgw->common->navbar();
|
||||
|
||||
$t->set_var("error","<p><center>" . $phpgw->common->error_list($error) . "</center><br>");
|
||||
$phpgw->template->set_var("error","<p><center>" . $phpgw->common->error_list($error) . "</center><br>");
|
||||
} else {
|
||||
$t->set_var("error","");
|
||||
$phpgw->template->set_var("error","");
|
||||
|
||||
$n_app_name = $phpgw->db->f("app_name");
|
||||
$n_app_title = $phpgw->db->f("app_title");
|
||||
@ -68,20 +67,20 @@
|
||||
$old_app_name = $phpgw->db->f("app_name");
|
||||
}
|
||||
|
||||
$t->set_var("lang_header",lang("Edit application"));
|
||||
$t->set_var("hidden_vars",'<input type="hidden" name="old_app_name" value="' . $old_app_name . '">');
|
||||
$phpgw->template->set_var("lang_header",lang("Edit application"));
|
||||
$phpgw->template->set_var("hidden_vars",'<input type="hidden" name="old_app_name" value="' . $old_app_name . '">');
|
||||
|
||||
$t->set_var("form_action",$phpgw->link("editapplication.php"));
|
||||
$t->set_var("lang_app_name",lang("application name"));
|
||||
$t->set_var("lang_app_title",lang("application title"));
|
||||
$t->set_var("lang_enabled",lang("enabled"));
|
||||
$t->set_var("lang_submit_button",lang("edit"));
|
||||
$phpgw->template->set_var("form_action",$phpgw->link("editapplication.php"));
|
||||
$phpgw->template->set_var("lang_app_name",lang("application name"));
|
||||
$phpgw->template->set_var("lang_app_title",lang("application title"));
|
||||
$phpgw->template->set_var("lang_enabled",lang("enabled"));
|
||||
$phpgw->template->set_var("lang_submit_button",lang("edit"));
|
||||
|
||||
$t->set_var("app_name_value",$n_app_name);
|
||||
$t->set_var("app_title_value",$n_app_title);
|
||||
$t->set_var("app_enabled_checked",($n_app_enabled?" checked":""));
|
||||
$phpgw->template->set_var("app_name_value",$n_app_name);
|
||||
$phpgw->template->set_var("app_title_value",$n_app_title);
|
||||
$phpgw->template->set_var("app_enabled_checked",($n_app_enabled?" checked":""));
|
||||
|
||||
$t->pparse("out","form");
|
||||
$phpgw->template->pparse("out","form");
|
||||
|
||||
$phpgw->common->phpgw_footer();
|
||||
?>
|
||||
|
@ -24,9 +24,7 @@
|
||||
Header("Location: " . $phpgw->link("groups.php"));
|
||||
}
|
||||
|
||||
|
||||
$t = new Template($phpgw_info["server"]["template_dir"]);
|
||||
$t->set_file(array("form" => "groups_form.tpl"));
|
||||
$phpgw->template->set_file(array("form" => "groups_form.tpl"));
|
||||
|
||||
if ($submit) {
|
||||
$phpgw->db->query("select group_name from groups where group_id=$group_id");
|
||||
@ -85,13 +83,13 @@
|
||||
if ($error) {
|
||||
$phpgw->common->phpgw_header();
|
||||
$phpgw->common->navbar();
|
||||
$t->set_var("error","<p><center>$error</center>");
|
||||
$phpgw->template->set_var("error","<p><center>$error</center>");
|
||||
} else {
|
||||
$t->set_var("error","");
|
||||
$phpgw->template->set_var("error","");
|
||||
}
|
||||
|
||||
if ($submit) {
|
||||
$t->set_var("group_name_value",$n_group_name);
|
||||
$phpgw->template->set_var("group_name_value",$n_group_name);
|
||||
|
||||
for ($i=0; $i<count($n_users); $i++) {
|
||||
$selected_users[$n_user[$i]] = " selected";
|
||||
@ -104,7 +102,7 @@
|
||||
$phpgw->db->query("select group_name from groups where group_id=$group_id");
|
||||
$phpgw->db->next_record();
|
||||
|
||||
$t->set_var("group_name_value",$phpgw->db->f("group_name"));
|
||||
$phpgw->template->set_var("group_name_value",$phpgw->db->f("group_name"));
|
||||
|
||||
$phpgw->db->query("select account_id from accounts where account_groups like '%,$group_id:%'");
|
||||
|
||||
@ -122,22 +120,22 @@
|
||||
$phpgw->db->query("select * from groups where group_id=$group_id");
|
||||
$phpgw->db->next_record();
|
||||
|
||||
$t->set_var("form_action",$phpgw->link("editgroup.php"));
|
||||
$t->set_var("hidden_vars","<input type=\"hidden\" name=\"group_id\" value=\"" . $group_id . "\">");
|
||||
$phpgw->template->set_var("form_action",$phpgw->link("editgroup.php"));
|
||||
$phpgw->template->set_var("hidden_vars","<input type=\"hidden\" name=\"group_id\" value=\"" . $group_id . "\">");
|
||||
|
||||
$t->set_var("lang_group_name",lang("group name"));
|
||||
$t->set_var("group_name_value",$phpgw->db->f("group_name"));
|
||||
$phpgw->template->set_var("lang_group_name",lang("group name"));
|
||||
$phpgw->template->set_var("group_name_value",$phpgw->db->f("group_name"));
|
||||
|
||||
$phpgw->db->query("select count(*) from accounts where account_status !='L'");
|
||||
$phpgw->db->next_record();
|
||||
|
||||
if ($phpgw->db->f(0) < 5) {
|
||||
$t->set_var("select_size",$phpgw->db->f(0));
|
||||
$phpgw->template->set_var("select_size",$phpgw->db->f(0));
|
||||
} else {
|
||||
$t->set_var("select_size","5");
|
||||
$phpgw->template->set_var("select_size","5");
|
||||
}
|
||||
|
||||
$t->set_var("lang_include_user",lang("Select users for inclusion"));
|
||||
$phpgw->template->set_var("lang_include_user",lang("Select users for inclusion"));
|
||||
$phpgw->db->query("SELECT account_id,account_firstname,account_lastname,account_lid FROM accounts where "
|
||||
. "account_status != 'L' ORDER BY account_lastname,account_firstname,account_lid asc");
|
||||
while ($phpgw->db->next_record()) {
|
||||
@ -147,9 +145,9 @@
|
||||
$phpgw->db->f("account_firstname"),
|
||||
$phpgw->db->f("account_lastname")) . "</option>";
|
||||
}
|
||||
$t->set_var("user_list",$user_list);
|
||||
$phpgw->template->set_var("user_list",$user_list);
|
||||
|
||||
$t->set_var("lang_permissions",lang("Permissions this group has"));
|
||||
$phpgw->template->set_var("lang_permissions",lang("Permissions this group has"));
|
||||
while ($permission = each($phpgw_info["apps"])) {
|
||||
if ($permission[1]["enabled"]) {
|
||||
$permissions_list .= "<option value=\"" . $permission[0] . "\""
|
||||
@ -157,10 +155,10 @@
|
||||
. $permission[1]["title"] . "</option>";
|
||||
}
|
||||
}
|
||||
$t->set_var("permissions_list",$permissions_list);
|
||||
$t->set_var("lang_submit_button",lang("submit changes"));
|
||||
$phpgw->template->set_var("permissions_list",$permissions_list);
|
||||
$phpgw->template->set_var("lang_submit_button",lang("submit changes"));
|
||||
|
||||
$t->pparse("out","form");
|
||||
$phpgw->template->pparse("out","form");
|
||||
|
||||
$phpgw->common->phpgw_footer();
|
||||
?>
|
||||
|
@ -61,13 +61,13 @@
|
||||
$error[$totalerrors++] = lang("The two passwords are not the same");
|
||||
|
||||
if (count($new_permissions) == 0)
|
||||
$error[$totalerrors++] = lang("You must add at least 1 permission to this account");
|
||||
$error[$phpgw->templateotalerrors++] = lang("You must add at least 1 permission to this account");
|
||||
|
||||
if (count($n_groups) == 0)
|
||||
$error[$totalerrors++] = lang("Account must belong to at least 1 group");
|
||||
$error[$phpgw->templateotalerrors++] = lang("Account must belong to at least 1 group");
|
||||
|
||||
if (account_exsists($n_loginid)) {
|
||||
$error[$totalerrors++] = lang("That loginid has already been taken");
|
||||
$error[$phpgw->templateotalerrors++] = lang("That loginid has already been taken");
|
||||
}
|
||||
|
||||
if (! $error) {
|
||||
@ -81,37 +81,36 @@
|
||||
}
|
||||
}
|
||||
|
||||
$t = new Template($phpgw_info["server"]["template_dir"]);
|
||||
$t->set_file(array("form" => "account_form.tpl"));
|
||||
$phpgw->template->set_file(array("form" => "account_form.tpl"));
|
||||
|
||||
$phpgw->common->phpgw_header();
|
||||
$phpgw->common->navbar();
|
||||
|
||||
$t->set_var("lang_action",lang("Add new account"));
|
||||
$phpgw->template->set_var("lang_action",lang("Add new account"));
|
||||
|
||||
if ($totalerrors) {
|
||||
$t->set_var("error_messages","<center>" . $phpgw->common->error_list($error) . "</center>");
|
||||
if ($phpgw->templateotalerrors) {
|
||||
$phpgw->template->set_var("error_messages","<center>" . $phpgw->common->error_list($error) . "</center>");
|
||||
} else {
|
||||
$t->set_var("error_messages","");
|
||||
$phpgw->template->set_var("error_messages","");
|
||||
}
|
||||
|
||||
$t->set_var("form_action",$phpgw->link("newaccount.php"));
|
||||
$t->set_var("lang_loginid",lang("LoginID"));
|
||||
$t->set_var("n_loginid_value",$n_loginid);
|
||||
$phpgw->template->set_var("form_action",$phpgw->link("newaccount.php"));
|
||||
$phpgw->template->set_var("lang_loginid",lang("LoginID"));
|
||||
$phpgw->template->set_var("n_loginid_value",$n_loginid);
|
||||
|
||||
$t->set_var("lang_password",lang("Password"));
|
||||
$t->set_var("n_passwd_value",$n_passwd);
|
||||
$phpgw->template->set_var("lang_password",lang("Password"));
|
||||
$phpgw->template->set_var("n_passwd_value",$n_passwd);
|
||||
|
||||
$t->set_var("lang_reenter_password",lang("Re-Enter Password"));
|
||||
$t->set_var("n_passwd_2_value",$n_passwd_2);
|
||||
$phpgw->template->set_var("lang_reenter_password",lang("Re-Enter Password"));
|
||||
$phpgw->template->set_var("n_passwd_2_value",$n_passwd_2);
|
||||
|
||||
$t->set_var("lang_firstname",lang("First Name"));
|
||||
$t->set_var("n_firstname_value",$n_firstname);
|
||||
$phpgw->template->set_var("lang_firstname",lang("First Name"));
|
||||
$phpgw->template->set_var("n_firstname_value",$n_firstname);
|
||||
|
||||
$t->set_var("lang_lastname",lang("Last Name"));
|
||||
$t->set_var("n_lastname_value",$n_lastname);
|
||||
$phpgw->template->set_var("lang_lastname",lang("Last Name"));
|
||||
$phpgw->template->set_var("n_lastname_value",$n_lastname);
|
||||
|
||||
$t->set_var("lang_groups",lang("Groups"));
|
||||
$phpgw->template->set_var("lang_groups",lang("Groups"));
|
||||
$group_select = '<select name="n_groups[]" multiple>';
|
||||
$phpgw->db->query("select * from groups");
|
||||
while ($phpgw->db->next_record()) {
|
||||
@ -122,9 +121,9 @@
|
||||
$group_select .= ">" . $phpgw->db->f("group_name") . "</option>";
|
||||
}
|
||||
$group_select .= "</select>";
|
||||
$t->set_var("groups_select",$group_select);
|
||||
$phpgw->template->set_var("groups_select",$group_select);
|
||||
|
||||
$t->set_var("","");
|
||||
$phpgw->template->set_var("","");
|
||||
$i = 0;
|
||||
while ($permission = each($phpgw_info["apps"])) {
|
||||
if ($permission[1]["enabled"]) {
|
||||
@ -159,10 +158,10 @@
|
||||
|
||||
$i++;
|
||||
}
|
||||
$t->set_var("permissions_list",$perms_html);
|
||||
$phpgw->template->set_var("permissions_list",$perms_html);
|
||||
|
||||
$t->set_var("lang_button",Lang("Add"));
|
||||
$t->pparse("out","form");
|
||||
$phpgw->template->set_var("lang_button",Lang("Add"));
|
||||
$phpgw->template->pparse("out","form");
|
||||
|
||||
account_close();
|
||||
$phpgw->common->phpgw_footer();
|
||||
|
@ -18,28 +18,27 @@
|
||||
$phpgw_info["flags"]["currentapp"] = "admin";
|
||||
include("../header.inc.php");
|
||||
|
||||
$t = new Template($phpgw_info["server"]["template_dir"]);
|
||||
//$t->set_unknowns("remove");
|
||||
$t->set_file(array("form" => "application_form.tpl"));
|
||||
//$phpgw->template->set_unknowns("remove");
|
||||
$phpgw->template->set_file(array("form" => "application_form.tpl"));
|
||||
|
||||
if ($submit) {
|
||||
$totalerrors = 0;
|
||||
$phpgw->templateotalerrors = 0;
|
||||
|
||||
$phpgw->db->query("select count(*) from applications where app_name='"
|
||||
. addslashes($n_app_name) . "'");
|
||||
$phpgw->db->next_record();
|
||||
|
||||
if ($phpgw->db->f(0) != 0) {
|
||||
$error[$totalerrors++] = lang("That application name already exsists.");
|
||||
$error[$phpgw->templateotalerrors++] = lang("That application name already exsists.");
|
||||
}
|
||||
|
||||
if (! $n_app_name)
|
||||
$error[$totalerrors++] = lang("You must enter an application name.");
|
||||
$error[$phpgw->templateotalerrors++] = lang("You must enter an application name.");
|
||||
|
||||
if (! $n_app_title)
|
||||
$error[$totalerrors++] = lang("You must enter an application title.");
|
||||
$error[$phpgw->templateotalerrors++] = lang("You must enter an application title.");
|
||||
|
||||
if (! $totalerrors) {
|
||||
if (! $phpgw->templateotalerrors) {
|
||||
$phpgw->db->query("insert into applications (app_name,app_title,app_enabled) values('"
|
||||
. addslashes($n_app_name) . "','" . addslashes($n_app_title) . "',"
|
||||
. "$n_app_enabled)");
|
||||
@ -47,28 +46,28 @@
|
||||
Header("Location: " . $phpgw->link("applications.php"));
|
||||
exit;
|
||||
} else {
|
||||
$t->set_var("error","<p><center>" . $phpgw->common->error_list($error) . "</center><br>");
|
||||
$phpgw->template->set_var("error","<p><center>" . $phpgw->common->error_list($error) . "</center><br>");
|
||||
}
|
||||
} else { // else submit
|
||||
$t->set_var("error","");
|
||||
$phpgw->template->set_var("error","");
|
||||
}
|
||||
$phpgw->common->phpgw_header();
|
||||
$phpgw->common->navbar();
|
||||
|
||||
$t->set_var("lang_header",lang("Add new application"));
|
||||
$phpgw->template->set_var("lang_header",lang("Add new application"));
|
||||
|
||||
$t->set_var("hidden_vars","");
|
||||
$t->set_var("form_action",$phpgw->link("newapplication.php"));
|
||||
$t->set_var("lang_app_name",lang("application name"));
|
||||
$t->set_var("lang_app_title",lang("application title"));
|
||||
$t->set_var("lang_enabled",lang("enabled"));
|
||||
$t->set_var("lang_submit_button",lang("add"));
|
||||
$phpgw->template->set_var("hidden_vars","");
|
||||
$phpgw->template->set_var("form_action",$phpgw->link("newapplication.php"));
|
||||
$phpgw->template->set_var("lang_app_name",lang("application name"));
|
||||
$phpgw->template->set_var("lang_app_title",lang("application title"));
|
||||
$phpgw->template->set_var("lang_enabled",lang("enabled"));
|
||||
$phpgw->template->set_var("lang_submit_button",lang("add"));
|
||||
|
||||
$t->set_var("app_name_value",$n_app_name);
|
||||
$t->set_var("app_title_value",$n_app_value);
|
||||
$t->set_var("app_enabled_checked",($n_app_enabled?" checked":""));
|
||||
$phpgw->template->set_var("app_name_value",$n_app_name);
|
||||
$phpgw->template->set_var("app_title_value",$n_app_value);
|
||||
$phpgw->template->set_var("app_enabled_checked",($n_app_enabled?" checked":""));
|
||||
|
||||
$t->pparse("out","form");
|
||||
$phpgw->template->pparse("out","form");
|
||||
|
||||
$phpgw->common->phpgw_footer();
|
||||
?>
|
||||
|
@ -18,8 +18,7 @@
|
||||
$phpgw_info["flags"]["currentapp"] = "admin";
|
||||
include("../header.inc.php");
|
||||
|
||||
$t = new Template($phpgw_info["server"]["template_dir"]);
|
||||
$t->set_file(array("form" => "groups_form.tpl"));
|
||||
$phpgw->template->set_file(array("form" => "groups_form.tpl"));
|
||||
|
||||
if ($submit) {
|
||||
$phpgw->db->query("select count(*) from groups where group_name='" . $n_group . "'");
|
||||
@ -71,26 +70,26 @@
|
||||
if ($error) {
|
||||
$phpgw->common->phpgw_header();
|
||||
$phpgw->common->navbar();
|
||||
$t->set_var("error","<p><center>$error</center>");
|
||||
$phpgw->template->set_var("error","<p><center>$error</center>");
|
||||
} else {
|
||||
$t->set_var("error","");
|
||||
$phpgw->template->set_var("error","");
|
||||
}
|
||||
|
||||
$t->set_var("form_action",$phpgw->link("newgroup.php"));
|
||||
$t->set_var("hidden_vars","");
|
||||
$t->set_var("lang_group_name",lang("New group name"));
|
||||
$t->set_var("group_name_value","");
|
||||
$phpgw->template->set_var("form_action",$phpgw->link("newgroup.php"));
|
||||
$phpgw->template->set_var("hidden_vars","");
|
||||
$phpgw->template->set_var("lang_group_name",lang("New group name"));
|
||||
$phpgw->template->set_var("group_name_value","");
|
||||
|
||||
$phpgw->db->query("select count(*) from accounts where account_status !='L'");
|
||||
$phpgw->db->next_record();
|
||||
|
||||
if ($phpgw->db->f(0) < 5) {
|
||||
$t->set_var("select_size",$phpgw->db->f(0));
|
||||
$phpgw->template->set_var("select_size",$phpgw->db->f(0));
|
||||
} else {
|
||||
$t->set_var("select_size","5");
|
||||
$phpgw->template->set_var("select_size","5");
|
||||
}
|
||||
|
||||
$t->set_var("lang_include_user",lang("Select users for inclusion"));
|
||||
$phpgw->template->set_var("lang_include_user",lang("Select users for inclusion"));
|
||||
for ($i=0; $i<count($n_users); $i++) {
|
||||
$selected_users[$n_users[$i]] = " selected";
|
||||
}
|
||||
@ -104,9 +103,9 @@
|
||||
$phpgw->db->f("account_firstname"),
|
||||
$phpgw->db->f("account_lastname")) . "</option>";
|
||||
}
|
||||
$t->set_var("user_list",$user_list);
|
||||
$phpgw->template->set_var("user_list",$user_list);
|
||||
|
||||
$t->set_var("lang_permissions",lang("Select permissions this group will have"));
|
||||
$phpgw->template->set_var("lang_permissions",lang("Select permissions this group will have"));
|
||||
for ($i=0; $i<count($n_group_permissions); $i++) {
|
||||
$selected_permissions[$n_group_permissions[$i]] = " selected";
|
||||
}
|
||||
@ -118,10 +117,10 @@
|
||||
. $permission[1]["title"] . "</option>";
|
||||
}
|
||||
}
|
||||
$t->set_var("permissions_list",$permissions_list);
|
||||
$t->set_var("lang_submit_button",lang("Create Group"));
|
||||
$phpgw->template->set_var("permissions_list",$permissions_list);
|
||||
$phpgw->template->set_var("lang_submit_button",lang("Create Group"));
|
||||
|
||||
$t->pparse("out","form");
|
||||
$phpgw->template->pparse("out","form");
|
||||
|
||||
$phpgw->common->phpgw_footer();
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user