diff --git a/admin/accounts.php b/admin/accounts.php index 791ed8f7b4..d8508203b3 100755 --- a/admin/accounts.php +++ b/admin/accounts.php @@ -12,18 +12,19 @@ /* $Id$ */ $phpgw_info = array(); - $phpgw_info['flags'] = array('currentapp' => 'admin', 'enable_nextmatchs_class' => True); + $phpgw_info['flags'] = array('currentapp' => 'admin', 'enable_nextmatchs_class' => True); include('../header.inc.php'); function account_total($query) { global $phpgw; - if ($query) { + if ($query) + { $querymethod = " AND (account_firstname LIKE '%$query%' OR account_lastname LIKE " - . "'%$query%' OR account_lid LIKE '%$query%') "; + . "'%$query%' OR account_lid LIKE '%$query%') "; } - + $phpgw->db->query("SELECT COUNT(*) FROM phpgw_accounts WHERE account_type='u'".$querymethod,__LINE__,__FILE__); $phpgw->db->next_record(); @@ -87,12 +88,12 @@ $p->set_var('row_firstname',$firstname); $p->set_var('row_lastname',$lastname); $p->set_var('row_edit',' ' . lang('Edit') . ' '); + . $account_id) . '"> ' . lang('Edit') . ' '); if ($phpgw_info['user']['userid'] != $account['account_lid']) { $p->set_var('row_delete',' '.lang('Delete').' '); + . $account_id) . '"> '.lang('Delete').' '); } else { @@ -100,7 +101,7 @@ } $p->set_var('row_view',' ' . lang('View') . ' '); + . $account_id) . '"> ' . lang('View') . ' '); $p->parse('rows','row',True); } diff --git a/admin/addcategory.php b/admin/addcategory.php index 6a3c8ae6d7..8665cbf2b2 100644 --- a/admin/addcategory.php +++ b/admin/addcategory.php @@ -11,68 +11,72 @@ \**************************************************************************/ /* $Id$ */ - $phpgw_info["flags"]["currentapp"] = 'admin'; - include('../header.inc.php'); + $phpgw_info['flags']['currentapp'] = 'admin'; + include('../header.inc.php'); - $t = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('admin')); - $t->set_file(array('form' => 'category_form.tpl')); - $t->set_block('form','add','addhandle'); - $t->set_block('form','edit','edithandle'); + $t = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('admin')); + $t->set_file(array('form' => 'category_form.tpl')); + $t->set_block('form','add','addhandle'); + $t->set_block('form','edit','edithandle'); - $c = CreateObject('phpgwapi.categories'); - $c->categories($phpgw_info['user']['account_id'],'phpgw'); + $c = CreateObject('phpgwapi.categories'); + $c->categories($phpgw_info['user']['account_id'],'phpgw'); - if ($submit) { - $errorcount = 0; + if ($submit) + { + $errorcount = 0; - if (!$cat_name) { $error[$errorcount++] = lang('Please enter a name for that category !'); } - if (!$error) { - if (!$cat_parent) { $exists = $c->exists('mains',$cat_name,$cat_id=''); } - else { $exists = $c->exists('subs',$cat_name,$cat_id=''); } - if ($exists == True) { $error[$errorcount++] = lang('That category name has been used already !'); } + if (!$cat_name) { $error[$errorcount++] = lang('Please enter a name for that category !'); } + if (!$error) + { + if (!$cat_parent) { $exists = $c->exists('mains',$cat_name,$cat_id=''); } + else { $exists = $c->exists('subs',$cat_name,$cat_id=''); } + if ($exists == True) { $error[$errorcount++] = lang('That category name has been used already !'); } + } + + if ($cat_main && $cat_parent) + { + $main = $c->return_main($cat_parent); + if ($main != $cat_main) { $error[$errorcount++] = lang('You selected an invalid main category !'); } + } + + if (!$error) + { + $cat_name = addslashes($cat_name); + $cat_description = addslashes($cat_description); + $cat_access = 'public'; + + $c->add($cat_name,$cat_parent,$cat_description,$cat_data,$cat_access,$cat_main); + } } - if ($cat_main && $cat_parent) { - $main = $c->return_main($cat_parent); - if ($main != $cat_main) { $error[$errorcount++] = lang('You selected an invalid main category !'); } - } + if ($errorcount) { $t->set_var('message',$phpgw->common->error_list($error)); } + if (($submit) && (! $error) && (! $errorcount)) { $t->set_var('message',lang('Category x has been added !', $cat_name)); } + if ((! $submit) && (! $error) && (! $errorcount)) { $t->set_var('message',''); } - if (! $error) { - $cat_name = addslashes($cat_name); - $cat_description = addslashes($cat_description); - $cat_access = 'public'; + $t->set_var('title_categories',lang('Add global category')); + $t->set_var('actionurl',$phpgw->link('/admin/addcategory.php')); + $t->set_var('doneurl',$phpgw->link('/admin/categories.php')); + $t->set_var('hidden_vars',''); - $c->add($cat_name,$cat_parent,$cat_description,$cat_data,$cat_access,$cat_main); - } - } + $t->set_var('lang_main',lang('Main category')); + $t->set_var('lang_new_main',lang('New main category')); + $t->set_var('main_category_list',$c->formated_list('select','mains',$cat_main)); + $t->set_var('lang_parent',lang('Parent category')); + $t->set_var('lang_select_parent',lang('Select parent category')); + $t->set_var('category_list',$c->formated_list('select','all',$cat_parent)); + $t->set_var('lang_name',lang('Category name')); + $t->set_var('lang_descr',lang('Category description')); + $t->set_var('cat_name',$cat_name); + $t->set_var('cat_description',$cat_description); + $t->set_var('lang_add',lang('Add')); + $t->set_var('lang_reset',lang('Clear Form')); + $t->set_var('lang_done',lang('Done')); - if ($errorcount) { $t->set_var('message',$phpgw->common->error_list($error)); } - if (($submit) && (! $error) && (! $errorcount)) { $t->set_var('message',lang('Category x has been added !', $cat_name)); } - if ((! $submit) && (! $error) && (! $errorcount)) { $t->set_var('message',''); } + $t->set_var('edithandle',''); + $t->set_var('addhandle',''); + $t->pparse('out','form'); + $t->pparse('addhandle','add'); - $t->set_var('title_categories',lang('Add global category')); - $t->set_var('actionurl',$phpgw->link('/admin/addcategory.php')); - $t->set_var('doneurl',$phpgw->link('/admin/categories.php')); - $t->set_var('hidden_vars',''); - - $t->set_var('lang_main',lang('Main category')); - $t->set_var('lang_new_main',lang('New main category')); - $t->set_var('main_category_list',$c->formated_list('select','mains',$cat_main)); - $t->set_var('lang_parent',lang('Parent category')); - $t->set_var('lang_select_parent',lang('Select parent category')); - $t->set_var('category_list',$c->formated_list('select','all',$cat_parent)); - $t->set_var('lang_name',lang('Category name')); - $t->set_var('lang_descr',lang('Category description')); - $t->set_var('cat_name',$cat_name); - $t->set_var('cat_description',$cat_description); - $t->set_var('lang_add',lang('Add')); - $t->set_var('lang_reset',lang('Clear Form')); - $t->set_var('lang_done',lang('Done')); - - $t->set_var('edithandle',''); - $t->set_var('addhandle',''); - $t->pparse('out','form'); - $t->pparse('addhandle','add'); - - $phpgw->common->phpgw_footer(); -?> \ No newline at end of file + $phpgw->common->phpgw_footer(); +?> diff --git a/admin/applications.php b/admin/applications.php index f1769395c9..4c04856de6 100644 --- a/admin/applications.php +++ b/admin/applications.php @@ -11,59 +11,73 @@ /* $Id$ */ - $phpgw_info = array(); - $phpgw_info["flags"] = array("currentapp" => "admin", "enable_nextmatchs_class" => True); - include("../header.inc.php"); + $phpgw_info = array(); + $phpgw_info['flags'] = array( + 'currentapp' => 'admin', + 'enable_nextmatchs_class' => True + ); + include('../header.inc.php'); - $p = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('admin')); - $p->set_file(array("list" => "applications.tpl", - "row" => "applications_row.tpl")); + $p = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('admin')); + $p->set_file(array( + 'list' => 'applications.tpl', + 'row' => 'applications_row.tpl' + )); - if ($order) { - $ordermethod = "order by $order $sort"; - } else { - $ordermethod = "order by app_title asc"; - } + if ($order) + { + $ordermethod = "order by $order $sort"; + } + else + { + $ordermethod = "order by app_title asc"; + } - if (! $sort) { - $sort = "desc"; - } + if (!$sort) + { + $sort = "desc"; + } - $p->set_var("lang_installed",lang("Installed applications")); - $p->set_var("bg_color",$phpgw_info["theme"]["bg_color"]); - $p->set_var("th_bg",$phpgw_info["theme"]["th_bg"]); + $p->set_var('lang_installed',lang('Installed applications')); + $p->set_var('bg_color',$phpgw_info['theme']['bg_color']); + $p->set_var('th_bg',$phpgw_info['theme']['th_bg']); - $p->set_var("sort_title",$phpgw->nextmatchs->show_sort_order($sort,"app_title",$order,"/admin/applications.php",lang("title"))); - $p->set_var("lang_edit",lang("Edit")); - $p->set_var("lang_delete",lang("Delete")); - $p->set_var("lang_enabled",lang("Enabled")); + $p->set_var('sort_title',$phpgw->nextmatchs->show_sort_order($sort,"app_title",$order,"/admin/applications.php",lang('title'))); + $p->set_var('lang_edit',lang('Edit')); + $p->set_var('lang_delete',lang('Delete')); + $p->set_var('lang_enabled',lang('Enabled')); - $phpgw->db->query("select * from phpgw_applications $ordermethod",__LINE__,__FILE__); - while ($phpgw->db->next_record()) { - $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color); - $name = $phpgw->db->f("app_title"); + $phpgw->db->query("select * from phpgw_applications $ordermethod",__LINE__,__FILE__); + while ($phpgw->db->next_record()) + { + $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color); + $name = $phpgw->db->f("app_title"); - if (! $phpgw->db->f("app_title")) $name = $phpgw->db->f("app_name"); - if (! $name) $name = " "; + if (! $phpgw->db->f('app_title')) $name = $phpgw->db->f('app_name'); + if (! $name) $name = " "; - $p->set_var("tr_color",$tr_color); - $p->set_var("name",$name); - $p->set_var("edit",' ' . lang("Edit") . ' '); - $p->set_var("delete",' ' . lang("Delete") . ' '); + $p->set_var('tr_color',$tr_color); + $p->set_var('name',$name); + $p->set_var('edit',' ' . lang('Edit') . ' '); + $p->set_var('delete',' ' . lang('Delete') . ' '); - if ($phpgw->db->f("app_enabled") != 0) { - $status = lang("Yes"); - } else { - $status = "" . lang("No") . ""; - } - $p->set_var("status",$status); + if ($phpgw->db->f('app_enabled') != 0) + { + $status = lang('Yes'); + } + else + { + $status = "" . lang('No') . ""; + } + $p->set_var('status',$status); - $p->parse("rows","row",True); - } + $p->parse('rows','row',True); + } - $p->set_var("new_action",$phpgw->link("/admin/newapplication.php")); - $p->set_var("lang_add",lang("add")); - - $p->pparse("out","list"); - $phpgw->common->phpgw_footer(); + $p->set_var('new_action',$phpgw->link('/admin/newapplication.php')); + $p->set_var('lang_add',lang('add')); + + $p->pparse('out','list'); + + $phpgw->common->phpgw_footer(); ?> diff --git a/admin/categories.php b/admin/categories.php index c636aa8ee7..6c2ebc2b55 100644 --- a/admin/categories.php +++ b/admin/categories.php @@ -11,122 +11,137 @@ \**************************************************************************/ /* $Id$ */ - $phpgw_info["flags"] = array('currentapp' => 'admin', - 'enable_nextmatchs_class' => True); + $phpgw_info['flags'] = array( + 'currentapp' => 'admin', + 'enable_nextmatchs_class' => True + ); - include('../header.inc.php'); + include('../header.inc.php'); - $t = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('admin')); + $t = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('admin')); - $t->set_file(array('cat_list_t' => 'listcats.tpl', - 'cat_list' => 'listcats.tpl')); - $t->set_block('cat_list_t','cat_list','list'); + $t->set_file(array( + 'cat_list_t' => 'listcats.tpl', + 'cat_list' => 'listcats.tpl' + )); + $t->set_block('cat_list_t','cat_list','list'); - $common_hidden_vars = "\n" - . "\n" - . "\n" - . "\n" - . "\n"; + $common_hidden_vars = "\n" + . "\n" + . "\n" + . "\n" + . "\n"; - $t->set_var('lang_action',lang('Category list')); - $t->set_var('add_action',$phpgw->link('/admin/addcategory.php')); - $t->set_var('lang_add',lang('Add')); - $t->set_var('title_categories',lang('Global categories')); - $t->set_var('lang_search',lang('Search')); - $t->set_var('actionurl',$phpgw->link('/admin/categories.php')); - $t->set_var('lang_done',lang('Done')); - $t->set_var('doneurl',$phpgw->link('/admin/index.php')); + $t->set_var('lang_action',lang('Category list')); + $t->set_var('add_action',$phpgw->link('/admin/addcategory.php')); + $t->set_var('lang_add',lang('Add')); + $t->set_var('title_categories',lang('Global categories')); + $t->set_var('lang_search',lang('Search')); + $t->set_var('actionurl',$phpgw->link('/admin/categories.php')); + $t->set_var('lang_done',lang('Done')); + $t->set_var('doneurl',$phpgw->link('/admin/index.php')); - if (! $start) { $start = 0; } + if (! $start) { $start = 0; } - if($phpgw_info['user']['preferences']['common']['maxmatchs'] && $phpgw_info['user']['preferences']['common']['maxmatchs'] > 0) { - $limit = $phpgw_info['user']['preferences']['common']['maxmatchs']; - } - else { $limit = 15; } + if($phpgw_info['user']['preferences']['common']['maxmatchs'] && $phpgw_info['user']['preferences']['common']['maxmatchs'] > 0) + { + $limit = $phpgw_info['user']['preferences']['common']['maxmatchs']; + } + else + { + $limit = 15; + } - $c = CreateObject('phpgwapi.categories'); - $c->categories($phpgw_info['user']['account_id'],'phpgw'); - $categories = $c->return_array('all',$start,$limit,$query,$sort,$order); + $c = CreateObject('phpgwapi.categories'); + $c->categories($phpgw_info['user']['account_id'],'phpgw'); + $categories = $c->return_array('all',$start,$limit,$query,$sort,$order); -//--------------------------------- nextmatch -------------------------------------------- + //--------------------------------- nextmatch -------------------------------------------- + $left = $phpgw->nextmatchs->left('/admin/categories.php',$start,$c->total_records); + $right = $phpgw->nextmatchs->right('/admin/categories.php',$start,$c->total_records); + $t->set_var('left',$left); + $t->set_var('right',$right); - $left = $phpgw->nextmatchs->left('/admin/categories.php',$start,$c->total_records); - $right = $phpgw->nextmatchs->right('/admin/categories.php',$start,$c->total_records); - $t->set_var('left',$left); - $t->set_var('right',$right); + if ($c->total_records > $limit) + { + $lang_showing=lang('showing x - x of x',($start + 1),($start + $limit),$c->total_records); + } + else + { + $lang_showing=lang('showing x',$c->total_records); + } + $t->set_var('lang_showing',$lang_showing); - if ($c->total_records > $limit) { - $lang_showing=lang("showing x - x of x",($start + 1),($start + $limit),$c->total_records); - } - else { $lang_showing=lang("showing x",$c->total_records); } - $t->set_var('lang_showing',$lang_showing); + // ------------------------------ end nextmatch ------------------------------------------ -// ------------------------------ end nextmatch ------------------------------------------ + //------------------- list header variable template-declarations ------------------------- + $t->set_var('th_bg',$phpgw_info['theme']['th_bg']); + $t->set_var('sort_name',$phpgw->nextmatchs->show_sort_order($sort,'cat_name',$order,'/admin/categories.php',lang('Name'))); + $t->set_var('sort_description',$phpgw->nextmatchs->show_sort_order($sort,'cat_description',$order,'/admin/categories.php',lang('Description'))); + $t->set_var('lang_edit',lang('Edit')); + $t->set_var('lang_delete',lang('Delete')); + // -------------------------- end header declaration -------------------------------------- -//------------------- list header variable template-declarations ------------------------- + for ($i=0;$inextmatchs->alternate_row_color($tr_color); + $t->set_var(tr_color,$tr_color); - $t->set_var('th_bg',$phpgw_info['theme']['th_bg']); - $t->set_var('sort_name',$phpgw->nextmatchs->show_sort_order($sort,'cat_name',$order,'/admin/categories.php',lang('Name'))); - $t->set_var('sort_description',$phpgw->nextmatchs->show_sort_order($sort,'cat_description',$order,'/admin/categories.php',lang('Description'))); - $t->set_var('lang_edit',lang('Edit')); - $t->set_var('lang_delete',lang('Delete')); - -// -------------------------- end header declaration -------------------------------------- + $cat_id = $categories[$i]['id']; + $owner = $categories[$i]['owner']; + $space = '  '; + $level = $categories[$i]['level']; - for ($i=0;$i 0) + { + $spaceset = str_repeat($space,$level); + $name = $spaceset . $phpgw->strip_html($categories[$i]['name']); + } - if ($categories[$i]['owner'] == $phpgw_info["user"]["account_id"] && $categories[$i]['app_name'] == 'phpgw') { + $descr = $phpgw->strip_html($categories[$i]['description']); + if (!$descr) { $descr = ' '; } - $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color); - $t->set_var(tr_color,$tr_color); + if ($level == 0) + { + $name = '' . $phpgw->strip_html($categories[$i]['name']) . ''; + $descr = '' . $descr . ''; + } - $cat_id = $categories[$i]['id']; - $owner = $categories[$i]['owner']; - $space = '  '; - $level = $categories[$i]['level']; + //-------------------------- template declaration for list records --------------------------- + $t->set_var(array( + 'name' => $name, + 'descr' => $descr + )); - if ($level > 0) { - $spaceset = str_repeat($space,$level); - $name = $spaceset . $phpgw->strip_html($categories[$i]['name']); - } + if ($categories[$i]["owner"] == $phpgw_info['user']['account_id']) + { + $t->set_var('edit',$phpgw->link('/admin/editcategory.php',"cat_id=$cat_id&start=$start&query=$query&sort=$sort&order=$order&filter=$filter")); + $t->set_var('lang_edit_entry',lang('Edit')); + } + else + { + $t->set_var('edit',''); + $t->set_var('lang_edit_entry',' '); + } + if ($categories[$i]["owner"] == $phpgw_info['user']['account_id']) + { + $t->set_var('delete',$phpgw->link('/admin/deletecategory.php',"cat_id=$cat_id&start=$start&query=$query&sort=$sort&order=$order&filter=$filter")); + $t->set_var('lang_delete_entry',lang('Delete')); + } + else + { + $t->set_var('delete',''); + $t->set_var('lang_delete_entry',' '); + } + $t->parse('list','cat_list',True); + } + } + // ---------------------------- end record declaration ----------------------------------------- - $descr = $phpgw->strip_html($categories[$i]['description']); - if (! $descr) { $descr = ' '; } + $t->parse('out','cat_list_t',True); + $t->p('out'); - if ($level == 0) { - $name = '' . $phpgw->strip_html($categories[$i]['name']) . ''; - $descr = '' . $descr . ''; - } - -//-------------------------- template declaration for list records --------------------------- - - $t->set_var(array('name' => $name, - 'descr' => $descr)); - - - if ($categories[$i]["owner"] == $phpgw_info["user"]["account_id"]) { - $t->set_var('edit',$phpgw->link('/admin/editcategory.php',"cat_id=$cat_id&start=$start&query=$query&sort=$sort&order=$order&filter=$filter")); - $t->set_var('lang_edit_entry',lang('Edit')); - } - else { - $t->set_var('edit',''); - $t->set_var('lang_edit_entry',' '); - } - if ($categories[$i]["owner"] == $phpgw_info["user"]["account_id"]) { - $t->set_var('delete',$phpgw->link('/admin/deletecategory.php',"cat_id=$cat_id&start=$start&query=$query&sort=$sort&order=$order&filter=$filter")); - $t->set_var('lang_delete_entry',lang('Delete')); - } - else { - $t->set_var('delete',''); - $t->set_var('lang_delete_entry',' '); - } - $t->parse('list','cat_list',True); - } - } -// ---------------------------- end record declaration ----------------------------------------- - - $t->parse('out','cat_list_t',True); - $t->p('out'); - - $phpgw->common->phpgw_footer(); -?> \ No newline at end of file + $phpgw->common->phpgw_footer(); +?> diff --git a/admin/deleteaccount.php b/admin/deleteaccount.php index 7f0296d461..9662dbace3 100755 --- a/admin/deleteaccount.php +++ b/admin/deleteaccount.php @@ -15,11 +15,14 @@ if ($delete_account || !$account_id) { - $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True); + $phpgw_info['flags'] = array( + 'noheader' => True, + 'nonavbar' => True + ); } - $phpgw_info["flags"]["currentapp"] = "admin"; - include("../header.inc.php"); + $phpgw_info['flags']['currentapp'] = 'admin'; + include('../header.inc.php'); // Make sure they are not attempting to delete their own account, or they have cancelled. // If they are, they should not reach this point anyway. if($cancel || $phpgw_info['user']['account_id'] == $account_id) @@ -30,7 +33,7 @@ if ($account_id && !$delete_account) { - $phpgw->template->set_file(array("form" => "delete_account.tpl")); + $phpgw->template->set_file(array('form' => 'delete_account.tpl')); $phpgw->template->set_var('form_action',$phpgw->link('/admin/deleteaccount.php')); $phpgw->template->set_var('account_id',$account_id); @@ -51,7 +54,7 @@ $phpgw->template->set_var('new_owner_select',$str); $phpgw->template->set_var('cancel',lang('cancel')); $phpgw->template->set_var('delete',lang('delete')); - $phpgw->template->pparse("out","form"); + $phpgw->template->pparse('out','form'); $phpgw->common->phpgw_footer(); } @@ -90,7 +93,7 @@ $cd = 29; } - Header("Location: " . $phpgw->link("/admin/accounts.php","cd=$cd")); + Header("Location: " . $phpgw->link('/admin/accounts.php',"cd=$cd")); $phpgw->common->phpgw_exit(); } ?> diff --git a/admin/deleteapplication.php b/admin/deleteapplication.php index f5f2bf477f..62ecf0bef2 100644 --- a/admin/deleteapplication.php +++ b/admin/deleteapplication.php @@ -11,29 +11,34 @@ /* $Id$ */ - $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True, "currentapp" => "admin"); + $phpgw_info['flags'] = array( + 'noheader' => True, + 'nonavbar' => True, + 'currentapp' => 'admin' + ); - if (! $app_name) { - Header("Location: " . $phpgw->link("/admin/applications.php")); - } - include("../header.inc.php"); - $phpgw->template->set_file(array("body" => "delete_common.tpl")); + if (! $app_name) + { + Header("Location: " . $phpgw->link('/admin/applications.php')); + } + include('../header.inc.php'); + $phpgw->template->set_file(array('body' => 'delete_common.tpl')); - if ($confirm) { - $phpgw->db->query("delete from phpgw_applications where app_name='$app_name'",__LINE__,__FILE__); + if ($confirm) + { + $phpgw->db->query("delete from phpgw_applications where app_name='$app_name'",__LINE__,__FILE__); - Header("Location: " . $phpgw->link("/admin/applications.php")); - $phpgw->common->phpgw_exit(); - } + Header("Location: " . $phpgw->link('/admin/applications.php')); + $phpgw->common->phpgw_exit(); + } - $phpgw->common->phpgw_header(); - echo parse_navbar(); + $phpgw->common->phpgw_header(); + echo parse_navbar(); - $phpgw->template->set_var("messages",lang("Are you sure you want to delete this application ?")); - $phpgw->template->set_var("no",'' . lang("No") . ''); - $phpgw->template->set_var("yes",'' . lang("Yes") . ''); - $phpgw->template->pparse("out","body"); + $phpgw->template->set_var('messages',lang('Are you sure you want to delete this application ?')); + $phpgw->template->set_var('no','' . lang('No') . ''); + $phpgw->template->set_var('yes','' . lang('Yes') . ''); + $phpgw->template->pparse('out','body'); - $phpgw->common->phpgw_footer(); + $phpgw->common->phpgw_footer(); ?> diff --git a/admin/deletecategory.php b/admin/deletecategory.php index ae55467bee..bee1f224de 100644 --- a/admin/deletecategory.php +++ b/admin/deletecategory.php @@ -2,7 +2,7 @@ /**************************************************************************\ * phpGroupWare - Admin * * (http://www.phpgroupware.org) * - * Written by Bettina Gille [ceb@phpgroupware.org] * + * Written by Bettina Gille [ceb@phpgroupware.org] * * ----------------------------------------------- * * This program is free software; you can redistribute it and/or modify it * * under the terms of the GNU General Public License as published by the * @@ -11,58 +11,66 @@ \**************************************************************************/ /* $Id$ */ - if ($confirm) { - $phpgw_info["flags"] = array('noheader' => True, - 'nonavbar' => True); - } + if ($confirm) + { + $phpgw_info['flags'] = array( + 'noheader' => True, + 'nonavbar' => True + ); + } - $phpgw_info["flags"]["currentapp"] = 'admin'; - include('../header.inc.php'); + $phpgw_info['flags']['currentapp'] = 'admin'; + include('../header.inc.php'); - $c = CreateObject('phpgwapi.categories'); - $c->categories($phpgw_info['user']['account_id'],'phpgw'); + $c = CreateObject('phpgwapi.categories'); + $c->categories($phpgw_info['user']['account_id'],'phpgw'); - if (! $cat_id) { - Header('Location: ' . $phpgw->link('/admin/categories.php')); - } + if (! $cat_id) + { + Header('Location: ' . $phpgw->link('/admin/categories.php')); + } - if ($confirm) { - if ($subs) { $c->delete($cat_id,'True'); } - else { $c->delete($cat_id); } - Header('Location: ' . $phpgw->link('/admin/categories.php',"start=$start&query=$query&sort=$sort&order=$order&filter=$filter")); - } - else { - $hidden_vars = "\n" - . "\n" - . "\n" - . "\n" - . "\n" - . "\n"; + if ($confirm) + { + if ($subs) { $c->delete($cat_id,'True'); } + else { $c->delete($cat_id); } + Header('Location: ' . $phpgw->link('/admin/categories.php',"start=$start&query=$query&sort=$sort&order=$order&filter=$filter")); + } + else + { + $hidden_vars = "\n" + . "\n" + . "\n" + . "\n" + . "\n" + . "\n"; - $t = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('admin')); - $t->set_file(array('category_delete' => 'delete_cat.tpl')); - $t->set_var('messages',lang('Are you sure you want to delete this category ?')); - $t->set_var('hidden_vars',$hidden_vars); - - $exists = $c->exists('subs',$cat_name='',$cat_id); - - if ($exists==True) { - $t->set_var('lang_subs',lang('Do you also want to delete all subcategories ?')); - $t->set_var('subs',''); - } - else { - $t->set_var('lang_subs',''); - $t->set_var('subs', ''); - } + $t = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('admin')); + $t->set_file(array('category_delete' => 'delete_cat.tpl')); + $t->set_var('messages',lang('Are you sure you want to delete this category ?')); + $t->set_var('hidden_vars',$hidden_vars); - $t->set_var('nolink',$phpgw->link('/admin/categories.php',"cat_id=$cat_id&start=$start&query=$query&sort=$sort&order=$order&filter=$filter")); - $t->set_var('lang_no',lang('No')); + $exists = $c->exists('subs',$cat_name='',$cat_id); - $t->set_var('action_url',$phpgw->link('/admin/deletecategory.php',"cat_id=$cat_id")); - $t->set_var('lang_yes',lang('Yes')); + if ($exists==True) + { + $t->set_var('lang_subs',lang('Do you also want to delete all subcategories ?')); + $t->set_var('subs',''); + } + else + { + $t->set_var('lang_subs',''); + $t->set_var('subs', ''); + } - $t->pparse('out','category_delete'); - } + $t->set_var('nolink',$phpgw->link('/admin/categories.php',"cat_id=$cat_id&start=$start&query=$query&sort=$sort&order=$order&filter=$filter")); + $t->set_var('lang_no',lang('No')); - $phpgw->common->phpgw_footer(); -?> \ No newline at end of file + $t->set_var('action_url',$phpgw->link('/admin/deletecategory.php',"cat_id=$cat_id")); + $t->set_var('lang_yes',lang('Yes')); + + $t->pparse('out','category_delete'); + } + +$phpgw->common->phpgw_footer(); +?> diff --git a/admin/deletegroup.php b/admin/deletegroup.php index e065441deb..4216be9342 100755 --- a/admin/deletegroup.php +++ b/admin/deletegroup.php @@ -11,89 +11,109 @@ /* $Id$ */ - $phpgw_info = array(); - $phpgw_info['flags'] = array('noheader' => True, 'nonavbar' => True, 'currentapp' => 'admin'); + $phpgw_info = array(); + $phpgw_info['flags'] = array( + 'noheader' => True, + 'nonavbar' => True, + 'currentapp' => 'admin' + ); - if (! $group_id) { - Header('Location: ' . $phpgw->link('/admin/groups.php')); - } - include('../header.inc.php'); - $p = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('admin')); - $p->set_file(array('body' => 'delete_common.tpl', - 'message_row' => 'message_row.tpl')); + if (! $group_id) + { + Header('Location: ' . $phpgw->link('/admin/groups.php')); + } + include('../header.inc.php'); - if ((($group_id) && ($confirm)) || $removeusers) { - if ($removeusers) { - $old_group_list = $phpgw->acl->get_ids_for_location(intval($group_id),1,'phpgw_group'); - @reset($old_group_list); - while($old_group_list && $id = each($old_group_list)) { - $phpgw->acl->delete_repository('phpgw_group',$group_id,intval($id[1])); - } - } + $p = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('admin')); + $p->set_file(array( + 'body' => 'delete_common.tpl', + 'message_row' => 'message_row.tpl' + )); - $group_name = $phpgw->accounts->id2name($group_id); + if ((($group_id) && ($confirm)) || $removeusers) + { + if ($removeusers) + { + $old_group_list = $phpgw->acl->get_ids_for_location(intval($group_id),1,'phpgw_group'); + @reset($old_group_list); + while($old_group_list && $id = each($old_group_list)) + { + $phpgw->acl->delete_repository('phpgw_group',$group_id,intval($id[1])); + } + } - $old_group_list = $phpgw->acl->get_ids_for_location(intval($group_id),1,'phpgw_group'); - if ($old_group_list) { - $phpgw->common->phpgw_header(); - echo parse_navbar(); + $group_name = $phpgw->accounts->id2name($group_id); - $p->set_var('message_display','' - . lang('Sorry, the follow users are still a member of the group x',$group_name) - . '
' . lang('They must be removed before you can continue') . ''); - $p->parse('messages','message_row',True); - - $p->set_var('message_display',''); - $p->parse('messages','message_row',True); + $old_group_list = $phpgw->acl->get_ids_for_location(intval($group_id),1,'phpgw_group'); + if ($old_group_list) + { + $phpgw->common->phpgw_header(); + echo parse_navbar(); + + $p->set_var('message_display',''); + $p->parse('messages','message_row',True); + + $p->set_var('message_display',''); + $p->parse('messages','message_row',True); + $p->set_var('yes',''); + $p->set_var('no',''); + $p->pparse('out','body'); + $phpgw->common->phpgw_footer(); + $phpgw->common->phpgw_exit(); + } + elseif ($removeusers && !$confirm) + { + Header('Location: ' . $phpgw->link('/admin/deletegroup.php','group_id='.$group_id.'&confirm=True')); + $phpgw->common->phpgw_exit(); + } + + if ($confirm) + { + $phpgw->db->lock(array('phpgw_accounts','phpgw_acl')); + $phpgw->db->query('DELETE FROM phpgw_accounts WHERE account_id='.$group_id,__LINE__,__FILE__); + $phpgw->acl->delete_repository('%%','run',intval($group_id)); + + $basedir = $phpgw_info['server']['files_dir'] . SEP . 'groups' . SEP; + + if (! @rmdir($basedir . $group_name)) + { + $cd = 38; + } + else + { + $cd = 32; + } + + $phpgw->db->unlock(); + + Header('Location: ' . $phpgw->link('/admin/groups.php','cd='.$cd)); + $phpgw->common->phpgw_exit(); + } + } + else + { + $phpgw->common->phpgw_header(); + echo parse_navbar(); + + $p->set_var('message_display',lang('Are you sure you want to delete this group ?')); + $p->parse('messages','message_row'); + $p->set_var('yes','' . lang('Yes') . ''); + $p->set_var('no','' . lang('No') . ''); + + $p->pparse('out','body'); - while (list(,$id) = each($old_group_list)) { - $p->set_var('message_display',''); - $p->parse('messages','message_row',True); - } - $p->set_var('message_display','
' + . lang('Sorry, the follow users are still a member of the group x',$group_name) + . '
' . lang('They must be removed before you can continue') . '
'); + $p->parse('messages','message_row',True); + + while (list(,$id) = each($old_group_list)) + { + $p->set_var('message_display',''); + $p->parse('messages','message_row',True); + } + $p->set_var('message_display','
' . $phpgw->common->grab_owner_name($id) . '
' + . '' . lang('Remove all users from this group') . '
' . $phpgw->common->grab_owner_name($id) . '
' - . '' . lang('Remove all users from this group') . ''); - $p->parse('messages','message_row',True); - $p->set_var('yes',''); - $p->set_var('no',''); - $p->pparse('out','body'); $phpgw->common->phpgw_footer(); - $phpgw->common->phpgw_exit(); - } elseif ($removeusers && !$confirm) { - Header('Location: ' . $phpgw->link('/admin/deletegroup.php','group_id='.$group_id.'&confirm=True')); - $phpgw->common->phpgw_exit(); - } - - if ($confirm) { - $phpgw->db->lock(array('phpgw_accounts','phpgw_acl')); - $phpgw->db->query('DELETE FROM phpgw_accounts WHERE account_id='.$group_id,__LINE__,__FILE__); - $phpgw->acl->delete_repository('%%','run',intval($group_id)); - - $basedir = $phpgw_info['server']['files_dir'] . SEP . 'groups' . SEP; - - if (! @rmdir($basedir . $group_name)) { - $cd = 38; - } else { - $cd = 32; - } - - $phpgw->db->unlock(); - - Header('Location: ' . $phpgw->link('/admin/groups.php','cd='.$cd)); - $phpgw->common->phpgw_exit(); - } - } else { - - $phpgw->common->phpgw_header(); - echo parse_navbar(); - - $p->set_var('message_display',lang('Are you sure you want to delete this group ?')); - $p->parse('messages','message_row'); - $p->set_var('yes','' . lang('Yes') . ''); - $p->set_var('no','' . lang('No') . ''); - - $p->pparse('out','body'); - - $phpgw->common->phpgw_footer(); - } + } ?> diff --git a/admin/editaccount.php b/admin/editaccount.php index f818f69f33..74aa8be18d 100755 --- a/admin/editaccount.php +++ b/admin/editaccount.php @@ -9,7 +9,7 @@ * option) any later version. * \**************************************************************************/ /* $Id$ */ - + $phpgw_info['flags'] = array( 'noheader' => True, 'nonavbar' => True, @@ -24,7 +24,7 @@ function createPageBody($_account_id,$_userData='',$_errors='') { global $phpgw, $phpgw_info; - + $t = new Template($phpgw->common->get_tpl_dir('admin')); $t->set_unknowns('remove'); @@ -405,18 +405,18 @@ } return; - ////////////////////////////////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////////////////////////////// // // the old code // - ///////////////////////////////////////////////////////////////////////////////////////// - + ///////////////////////////////////////////////////////////////////////////////////////// + // The following sets any default preferences needed for new applications.. // This is smart enough to know if previous preferences were selected, use them. $pref = CreateObject('phpgwapi.preferences',intval($account_id)); $t = $pref->get_preferences(); - + $docommit = False; $after_apps = explode(':',$apps_after); for ($i=1;$icommon->hook_single('update_user_data', $app[0]); - } + } $includedSomething = False; // start inlcuding other admin tools while($app = each($apps_after)) { $phpgw->common->hook_single('show_user_data', $app[0]); - } + } ?> diff --git a/admin/editapplication.php b/admin/editapplication.php index e007c212c9..cd9322b30b 100644 --- a/admin/editapplication.php +++ b/admin/editapplication.php @@ -11,120 +11,141 @@ /* $Id$ */ - $phpgw_info = array(); - if ($submit) { - $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True); - } + $phpgw_info = array(); + if ($submit) + { + $phpgw_info['flags'] = array( + 'noheader' => True, + 'nonavbar' => True + ); + } - $phpgw_info["flags"]["currentapp"] = "admin"; - $phpgw_info["flags"]["enable_nextmatchs_class"] = True; + $phpgw_info['flags']['currentapp'] = 'admin'; + $phpgw_info['flags']['enable_nextmatchs_class'] = True; - include("../header.inc.php"); + include('../header.inc.php'); - $p = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('admin')); + $p = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('admin')); - function display_row($label, $value) - { - global $phpgw,$p; - $p->set_var("tr_color",$phpgw->nextmatchs->alternate_row_color()); - $p->set_var("label",$label); - $p->set_var("value",$value); + function display_row($label, $value) + { + global $phpgw,$p; + $p->set_var('tr_color',$phpgw->nextmatchs->alternate_row_color()); + $p->set_var('label',$label); + $p->set_var('value',$value); - $p->parse("rows","row",True); - } + $p->parse('rows','row',True); + } $p->set_file(array( - "form" => "application_form.tpl", - "row" => "application_form_row.tpl" + 'form' => 'application_form.tpl', + 'row' => 'application_form_row.tpl' )); - if ($submit) { - if (! $app_order) { - $app_order = 0; - } + if ($submit) + { + if (! $app_order) + { + $app_order = 0; + } - $totalerrors = 0; - - if (! $n_app_name) - $error[$totalerrors++] = lang("You must enter an application name."); - - if (! $n_app_title) - $error[$totalerrors++] = lang("You must enter an application title."); + $totalerrors = 0; - if ($old_app_name != $n_app_name) { - $phpgw->db->query("select count(*) from phpgw_applications where app_name='" - . addslashes($n_app_name) . "'",__LINE__,__FILE__); - $phpgw->db->next_record(); - - if ($phpgw->db->f(0) != 0) { - $error[$totalerrors++] = lang("That application name already exists."); - } - } + if (! $n_app_name) + { + $error[$totalerrors++] = lang('You must enter an application name.'); + } + + if (! $n_app_title) + { + $error[$totalerrors++] = lang('You must enter an application title.'); + } + + if ($old_app_name != $n_app_name) + { + $phpgw->db->query("select count(*) from phpgw_applications where app_name='" + . addslashes($n_app_name) . "'",__LINE__,__FILE__); + $phpgw->db->next_record(); + + if ($phpgw->db->f(0) != 0) + { + $error[$totalerrors++] = lang('That application name already exists.'); + } + } - if (! $totalerrors) { - $phpgw->db->query("update phpgw_applications set app_name='" . addslashes($n_app_name) . "'," - . "app_title='" . addslashes($n_app_title) . "', app_enabled='" - . "$n_app_status',app_order='$app_order' where app_name='$old_app_name'",__LINE__,__FILE__); + if (! $totalerrors) + { + $phpgw->db->query("update phpgw_applications set app_name='" . addslashes($n_app_name) . "'," + . "app_title='" . addslashes($n_app_title) . "', app_enabled='" + . "$n_app_status',app_order='$app_order' where app_name='$old_app_name'",__LINE__,__FILE__); - if($n_app_anonymous) { - $phpgw->acl->add_repository($n_app_name,'everywhere',0,PHPGW_ACL_READ); - } else { - $phpgw->acl->delete_repository($n_app_name,'everywhere',0); - } + if($n_app_anonymous) + { + $phpgw->acl->add_repository($n_app_name,'everywhere',0,PHPGW_ACL_READ); + } + else + { + $phpgw->acl->delete_repository($n_app_name,'everywhere',0); + } - Header("Location: " . $phpgw->link("/admin/applications.php")); - $phpgw->common->phpgw_exit(); - } - } - $phpgw->db->query("select * from phpgw_applications where app_name='$app_name'",__LINE__,__FILE__); - $phpgw->db->next_record(); + Header("Location: " . $phpgw->link("/admin/applications.php")); + $phpgw->common->phpgw_exit(); + } + } - if ($totalerrors) { - $phpgw->common->phpgw_header(); - echo parse_navbar(); + $phpgw->db->query("select * from phpgw_applications where app_name='$app_name'",__LINE__,__FILE__); + $phpgw->db->next_record(); - $p->set_var("error","

" . $phpgw->common->error_list($error) . "

"); - } else { - $p->set_var("error",""); - - $n_app_name = $phpgw->db->f("app_name"); - $n_app_title = $phpgw->db->f("app_title"); - $n_app_status = $phpgw->db->f("app_enabled"); - $old_app_name = $phpgw->db->f("app_name"); - $app_order = $phpgw->db->f("app_order"); - $n_app_anonymous = $phpgw->acl->check('everywhere', PHPGW_ACL_READ, $n_app_name); - } + if ($totalerrors) + { + $phpgw->common->phpgw_header(); + echo parse_navbar(); + + $p->set_var('error',"

" . $phpgw->common->error_list($error) . "

"); + } + else + { + $p->set_var('error',''); + + $n_app_name = $phpgw->db->f('app_name'); + $n_app_title = $phpgw->db->f('app_title'); + $n_app_status = $phpgw->db->f('app_enabled'); + $old_app_name = $phpgw->db->f('app_name'); + $app_order = $phpgw->db->f('app_order'); + $n_app_anonymous = $phpgw->acl->check('everywhere', PHPGW_ACL_READ, $n_app_name); + } - $p->set_var("lang_header",lang("Edit application")); - $p->set_var("hidden_vars",''); - $p->set_var("th_bg",$phpgw_info["theme"]["th_bg"]); - $p->set_var("form_action",$phpgw->link("/admin/editapplication.php")); + $p->set_var('lang_header',lang('Edit application')); + $p->set_var('hidden_vars',''); + $p->set_var('th_bg',$phpgw_info['theme']['th_bg']); + $p->set_var('form_action',$phpgw->link('/admin/editapplication.php')); - display_row(lang("application name"),''); - display_row(lang("application title"),''); + display_row(lang('application name'),''); + display_row(lang('application title'),''); - $p->set_var("lang_status",lang("Status")); - $p->set_var("lang_submit_button",lang("edit")); + $p->set_var('lang_status',lang('Status')); + $p->set_var('lang_submit_button',lang('edit')); - $selected[$n_app_status] = " selected"; - $status_html = '' - . '' - . ''; + $selected[$n_app_status] = " selected"; + $status_html = '' + . '' + . ''; - display_row(lang("Status"),''); - display_row(lang("Select which location this app should appear on the navbar, lowest (left) to highest (right)"),''); + display_row(lang("Status"),''); + display_row(lang("Select which location this app should appear on the navbar, lowest (left) to highest (right)"),''); - $str = 'set_var("select_status",$status_html); + $str = 'pparse("out","form"); + display_row(lang('Allow Anonymous access to this app'),$str); - $phpgw->common->phpgw_footer(); + $p->set_var('select_status',$status_html); + + $p->pparse('out','form'); + + $phpgw->common->phpgw_footer(); ?> diff --git a/admin/editcategory.php b/admin/editcategory.php index fd6d796227..908f8f4247 100644 --- a/admin/editcategory.php +++ b/admin/editcategory.php @@ -11,87 +11,91 @@ \**************************************************************************/ /* $Id$ */ - $phpgw_info["flags"]["currentapp"] = 'admin'; - include('../header.inc.php'); - - if (! $cat_id) { - Header('Location: ' . $phpgw->link('/admin/categories.php',"sort=$sort&order=$order&query=$query&start=$start" - . "&filter=$filter")); - } + $phpgw_info['flags']['currentapp'] = 'admin'; + include('../header.inc.php'); - $t = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('admin')); - $t->set_file(array('form' => 'category_form.tpl')); - $t->set_block('form','add','addhandle'); - $t->set_block('form','edit','edithandle'); - - $c = CreateObject('phpgwapi.categories'); - $c->categories($phpgw_info['user']['account_id'],'phpgw'); - - $hidden_vars = "\n" - . "\n" - . "\n" - . "\n" - . "\n" - . "\n"; - - if ($submit) { - $errorcount = 0; - - if (!$cat_name) { $error[$errorcount++] = lang('Please enter a name for that category !'); } - - if (!$error) { - if (!$cat_parent) { $exists = $c->exists('mains',$cat_name,$cat_id); } - else { $exists = $c->exists('subs',$cat_name,$cat_id); } - if ($exists == True) { $error[$errorcount++] = lang('That category name has been used already !'); } + if (! $cat_id) + { + Header('Location: ' . $phpgw->link('/admin/categories.php',"sort=$sort&order=$order&query=$query&start=$start" + . "&filter=$filter")); } - if ($cat_main && $cat_parent) { - $main = $c->return_main($cat_parent); - if ($main != $cat_main) { $error[$errorcount++] = lang('You selected an invalid main category !'); } - } + $t = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('admin')); + $t->set_file(array('form' => 'category_form.tpl')); + $t->set_block('form','add','addhandle'); + $t->set_block('form','edit','edithandle'); - $cat_name = addslashes($cat_name); - $cat_description = addslashes($cat_description); - $cat_access = 'public'; + $c = CreateObject('phpgwapi.categories'); + $c->categories($phpgw_info['user']['account_id'],'phpgw'); - if (! $error) { $c->edit($cat_id,$cat_parent,$cat_name,$cat_description,$cat_data,$cat_access,$cat_main); } - } + $hidden_vars = "\n" + . "\n" + . "\n" + . "\n" + . "\n" + . "\n"; - if ($errorcount) { $t->set_var('message',$phpgw->common->error_list($error)); } - if (($submit) && (! $error) && (! $errorcount)) { $t->set_var('message',lang('Category x has been updated !',$cat_name)); } - if ((! $submit) && (! $error) && (! $errorcount)) { $t->set_var('message',''); } + if ($submit) + { + $errorcount = 0; - $cats = $c->return_single($cat_id); + if (!$cat_name) { $error[$errorcount++] = lang('Please enter a name for that category !'); } - $t->set_var('title_categories',lang('Edit global category')); - $t->set_var('lang_parent',lang('Parent category')); - $t->set_var('lang_select_parent',lang('Select parent category')); - $t->set_var('actionurl',$phpgw->link('/admin/editcategory.php')); - $t->set_var('deleteurl',$phpgw->link('/admin/deletecategory.php',"cat_id=$cat_id&start=$start&query=$query&sort=$sort&order=$order&filter=$filter")); - $t->set_var('doneurl',$phpgw->link('/admin/categories.php',"start=$start&query=$query&sort=$sort&order=$order&filter=$filter")); + if (!$error) + { + if (!$cat_parent) { $exists = $c->exists('mains',$cat_name,$cat_id); } + else { $exists = $c->exists('subs',$cat_name,$cat_id); } + if ($exists == True) { $error[$errorcount++] = lang('That category name has been used already !'); } + } - $t->set_var('hidden_vars',$hidden_vars); - $t->set_var('lang_name',lang('Category name')); - $t->set_var('lang_descr',lang('Category description')); - $t->set_var('lang_done',lang('Done')); - $t->set_var('lang_edit',lang('Edit')); - $t->set_var('lang_delete',lang('Delete')); + if ($cat_main && $cat_parent) + { + $main = $c->return_main($cat_parent); + if ($main != $cat_main) { $error[$errorcount++] = lang('You selected an invalid main category !'); } + } - $t->set_var('lang_main',lang('Main category')); - $t->set_var('lang_new_main',lang('New main category')); - $t->set_var('main_category_list',$c->formated_list('select','mains',$cats[0]['main'])); + $cat_name = addslashes($cat_name); + $cat_description = addslashes($cat_description); + $cat_access = 'public'; - $cat_id = $cats[0]['id']; + if (! $error) { $c->edit($cat_id,$cat_parent,$cat_name,$cat_description,$cat_data,$cat_access,$cat_main); } + } - $t->set_var('cat_name',$phpgw->strip_html($cats[0]['name'])); - $t->set_var('cat_description',$phpgw->strip_html($cats[0]['description'])); - $t->set_var('category_list',$c->formated_list('select','all',$cats[0]['parent'])); + if ($errorcount) { $t->set_var('message',$phpgw->common->error_list($error)); } + if (($submit) && (! $error) && (! $errorcount)) { $t->set_var('message',lang('Category x has been updated !',$cat_name)); } + if ((! $submit) && (! $error) && (! $errorcount)) { $t->set_var('message',''); } - $t->set_var('edithandle',''); - $t->set_var('addhandle',''); + $cats = $c->return_single($cat_id); - $t->pparse('out','form'); - $t->pparse('edithandle','edit'); + $t->set_var('title_categories',lang('Edit global category')); + $t->set_var('lang_parent',lang('Parent category')); + $t->set_var('lang_select_parent',lang('Select parent category')); + $t->set_var('actionurl',$phpgw->link('/admin/editcategory.php')); + $t->set_var('deleteurl',$phpgw->link('/admin/deletecategory.php',"cat_id=$cat_id&start=$start&query=$query&sort=$sort&order=$order&filter=$filter")); + $t->set_var('doneurl',$phpgw->link('/admin/categories.php',"start=$start&query=$query&sort=$sort&order=$order&filter=$filter")); - $phpgw->common->phpgw_footer(); -?> \ No newline at end of file + $t->set_var('hidden_vars',$hidden_vars); + $t->set_var('lang_name',lang('Category name')); + $t->set_var('lang_descr',lang('Category description')); + $t->set_var('lang_done',lang('Done')); + $t->set_var('lang_edit',lang('Edit')); + $t->set_var('lang_delete',lang('Delete')); + + $t->set_var('lang_main',lang('Main category')); + $t->set_var('lang_new_main',lang('New main category')); + $t->set_var('main_category_list',$c->formated_list('select','mains',$cats[0]['main'])); + + $cat_id = $cats[0]['id']; + + $t->set_var('cat_name',$phpgw->strip_html($cats[0]['name'])); + $t->set_var('cat_description',$phpgw->strip_html($cats[0]['description'])); + $t->set_var('category_list',$c->formated_list('select','all',$cats[0]['parent'])); + + $t->set_var('edithandle',''); + $t->set_var('addhandle',''); + + $t->pparse('out','form'); + $t->pparse('edithandle','edit'); + + $phpgw->common->phpgw_footer(); +?> diff --git a/admin/groups.php b/admin/groups.php index 48c449cdcc..92645f4291 100755 --- a/admin/groups.php +++ b/admin/groups.php @@ -12,8 +12,11 @@ /* $Id$ */ $phpgw_info = array(); - $phpgw_info["flags"] = array("currentapp" => "admin", "enable_nextmatchs_class" => True); - include("../header.inc.php"); + $phpgw_info['flags'] = array( + 'currentapp' => 'admin', + 'enable_nextmatchs_class' => True + ); + include('../header.inc.php'); function account_total($query) { @@ -39,15 +42,15 @@ $total = account_total($query); - $p->set_var("th_bg",$phpgw_info["theme"]["th_bg"]); + $p->set_var('th_bg',$phpgw_info['theme']['th_bg']); - $p->set_var("left_nextmatchs",$phpgw->nextmatchs->left("/admin/groups.php",$start,$total)); - $p->set_var("right_nextmatchs",$phpgw->nextmatchs->right("/admin/groups.php",$start,$total)); - $p->set_var("lang_groups",lang("user groups")); + $p->set_var('left_nextmatchs',$phpgw->nextmatchs->left('/admin/groups.php',$start,$total)); + $p->set_var('right_nextmatchs',$phpgw->nextmatchs->right('/admin/groups.php',$start,$total)); + $p->set_var('lang_groups',lang('user groups')); - $p->set_var("sort_name",$phpgw->nextmatchs->show_sort_order($sort,"account_lid",$order,"/admin/groups.php",lang("name"))); - $p->set_var("header_edit",lang("Edit")); - $p->set_var("header_delete",lang("Delete")); + $p->set_var('sort_name',$phpgw->nextmatchs->show_sort_order($sort,"account_lid",$order,"/admin/groups.php",lang("name"))); + $p->set_var('header_edit',lang('Edit')); + $p->set_var('header_delete',lang('Delete')); $account_info = $phpgw->accounts->get_list('groups',$start,$sort, $order, $query, $total); @@ -66,23 +69,23 @@ $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color); $p->set_var("tr_color",$tr_color); - if (! $group_name) $group_name = ' '; + if (! $group_name) { $group_name = ' '; } - $p->set_var("group_name",$group_name); - $p->set_var("edit_link",' ' . lang("Edit") . ' '); - $p->set_var("delete_link",' ' . lang("Delete") . ' '); - $p->parse("rows","row",True); + $p->set_var('group_name',$group_name); + $p->set_var('edit_link',' ' . lang('Edit') . ' '); + $p->set_var('delete_link',' ' . lang('Delete') . ' '); + $p->parse('rows','row',True); } } - $p->set_var("new_action",$phpgw->link("/admin/newgroup.php")); - $p->set_var("lang_add",lang("add")); + $p->set_var('new_action',$phpgw->link('/admin/newgroup.php')); + $p->set_var('lang_add',lang('add')); - $p->set_var("search_action",$phpgw->link("/admin/groups.php")); - $p->set_var("lang_search",lang("search")); + $p->set_var('search_action',$phpgw->link('/admin/groups.php')); + $p->set_var('lang_search',lang('search')); - $p->pparse("out","list"); + $p->pparse('out','list'); $phpgw->common->phpgw_footer(); ?> diff --git a/admin/index.php b/admin/index.php index 57b041bae7..d6893b717f 100755 --- a/admin/index.php +++ b/admin/index.php @@ -46,7 +46,7 @@ // (if they can get to the admin page, the admin app is enabled, hence it is shown) $phpgw->db->query("SELECT app_name FROM phpgw_applications WHERE app_enabled=1 OR app_enabled=2 ORDER BY app_title",__LINE__,__FILE__); - + // Stuff it in an array in the off chance the admin includes need the db while ($phpgw->db->next_record()) { diff --git a/admin/killsession.php b/admin/killsession.php index 5bf129a3df..38f28607b8 100755 --- a/admin/killsession.php +++ b/admin/killsession.php @@ -11,41 +11,44 @@ /* $Id$ */ - $phpgw_info = array(); - if ($confirm) { - $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True); - } - $phpgw_info["flags"]["currentapp"] = "admin"; - include("../header.inc.php"); - if ($ksessionid == $phpgw_info["user"]["sessionid"]) { - Header("Location: " . $phpgw->link("/admin/currentusers.php")); - $phpgw->common->phpgw_exit(); - } + $phpgw_info = array(); + if ($confirm) { + $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True); + } + $phpgw_info["flags"]["currentapp"] = "admin"; + include("../header.inc.php"); + if ($ksessionid == $phpgw_info["user"]["sessionid"]) + { + Header("Location: " . $phpgw->link("/admin/currentusers.php")); + $phpgw->common->phpgw_exit(); + } - if ($confirm) { - $phpgw->db->query("delete from phpgw_sessions where session_id='$ksession'"); - Header("Location: " . $phpgw->link("/admin/currentusers.php","cd=19")); - } else { - ?> + if ($confirm) + { + $phpgw->db->query("delete from phpgw_sessions where session_id='$ksession'"); + Header("Location: " . $phpgw->link("/admin/currentusers.php","cd=19")); + } + else + { +?>
- - -
- + + +
+
- " . lang("No"); ?> + ' . lang('No'); ?> - " . lang("Yes"); ?> + ' . lang('Yes'); ?>
common->phpgw_footer(); - } + $phpgw->common->phpgw_footer(); + } ?>