Index: trunk/kernel/units/email_events/email_events_event_handler.php =================================================================== diff -u -N -r4674 -r4675 --- trunk/kernel/units/email_events/email_events_event_handler.php (.../email_events_event_handler.php) (revision 4674) +++ trunk/kernel/units/email_events/email_events_event_handler.php (.../email_events_event_handler.php) (revision 4675) @@ -12,7 +12,7 @@ parent::mapPermissions(); $permissions = Array( 'OnFrontOnly' => Array('self' => 'edit'), - 'OnSaveSelected' => Array('self' => 'add|edit'), + 'OnSaveSelected' => Array('self' => 'view'), ); $this->permMapping = array_merge($this->permMapping, $permissions); } @@ -26,6 +26,7 @@ { $module = $this->Application->GetVar('module'); $module = explode(':', $module, 2); + if (count($module) == 1) { $main_prefix = $this->Application->findModule('Name', $module[0], 'Var'); } @@ -34,6 +35,7 @@ $main_prefix = $exceptions[ $module[1] ]; } $section = $this->Application->getUnitOption($main_prefix.'.email', 'PermSection'); + $event->setEventParam('PermSection', $section); return parent::CheckPermission($event); } Index: trunk/core/units/email_events/email_events_event_handler.php =================================================================== diff -u -N -r4674 -r4675 --- trunk/core/units/email_events/email_events_event_handler.php (.../email_events_event_handler.php) (revision 4674) +++ trunk/core/units/email_events/email_events_event_handler.php (.../email_events_event_handler.php) (revision 4675) @@ -12,7 +12,7 @@ parent::mapPermissions(); $permissions = Array( 'OnFrontOnly' => Array('self' => 'edit'), - 'OnSaveSelected' => Array('self' => 'add|edit'), + 'OnSaveSelected' => Array('self' => 'view'), ); $this->permMapping = array_merge($this->permMapping, $permissions); } @@ -26,6 +26,7 @@ { $module = $this->Application->GetVar('module'); $module = explode(':', $module, 2); + if (count($module) == 1) { $main_prefix = $this->Application->findModule('Name', $module[0], 'Var'); } @@ -34,6 +35,7 @@ $main_prefix = $exceptions[ $module[1] ]; } $section = $this->Application->getUnitOption($main_prefix.'.email', 'PermSection'); + $event->setEventParam('PermSection', $section); return parent::CheckPermission($event); } Index: trunk/core/units/users/users_config.php =================================================================== diff -u -N -r4670 -r4675 --- trunk/core/units/users/users_config.php (.../users_config.php) (revision 4670) +++ trunk/core/units/users/users_config.php (.../users_config.php) (revision 4675) @@ -81,7 +81,7 @@ ), - 'PermSection' => Array('main' => 'in-portal:user_list', 'custom' => 'in-portal:user_custom'), + 'PermSection' => Array('main' => 'in-portal:user_list', 'email' => 'in-portal:user_email', 'custom' => 'in-portal:user_custom'), 'Sections' => Array( 'in-portal:users' => Array( @@ -118,7 +118,7 @@ 'parent' => 'in-portal:users', 'icon' => 'settings_email', 'label' => 'la_tab_ConfigE-mail', - 'url' => Array('index_file' => 'config/module_email.php', 'module' => 'In-Portal:Users', 'pass_section' => true, 'lpn' => 1, 'pass' => 'm'), + 'url' => Array('t' => 'config/config_email', 'module' => 'In-Portal:Users', 'pass_section' => true, 'pass' => 'm'), 'permissions' => Array('view', 'edit'), 'priority' => 4, 'type' => stTREE, Index: trunk/core/units/categories/categories_config.php =================================================================== diff -u -N -r4670 -r4675 --- trunk/core/units/categories/categories_config.php (.../categories_config.php) (revision 4670) +++ trunk/core/units/categories/categories_config.php (.../categories_config.php) (revision 4675) @@ -53,7 +53,7 @@ 'tree_site' => Array('format' => '!la_selecting_categories!'), ), - 'PermSection' => Array(/*'search' => 'in-portal:configuration_search',*/ 'custom' => 'in-portal:configuration_custom'), + 'PermSection' => Array(/*'search' => 'in-portal:configuration_search',*/ 'email' => 'in-portal:configuration_email', 'custom' => 'in-portal:configuration_custom'), 'Sections' => Array( // "Structure & Data" section @@ -122,7 +122,7 @@ 'parent' => 'in-portal:site', 'icon' => 'settings_email', 'label' => 'la_tab_ConfigE-mail', - 'url' => Array('index_file' => 'config/module_email.php', 'module' => 'In-Portal:Category', 'pass_section' => true, 'lpn' => 1, 'pass' => 'm'), + 'url' => Array('t' => 'config/config_email', 'module' => 'In-Portal:Category', 'pass_section' => true, 'pass' => 'm'), 'permissions' => Array('view', 'edit'), 'priority' => 6, 'type' => stTREE, Index: trunk/kernel/units/users/users_config.php =================================================================== diff -u -N -r4670 -r4675 --- trunk/kernel/units/users/users_config.php (.../users_config.php) (revision 4670) +++ trunk/kernel/units/users/users_config.php (.../users_config.php) (revision 4675) @@ -81,7 +81,7 @@ ), - 'PermSection' => Array('main' => 'in-portal:user_list', 'custom' => 'in-portal:user_custom'), + 'PermSection' => Array('main' => 'in-portal:user_list', 'email' => 'in-portal:user_email', 'custom' => 'in-portal:user_custom'), 'Sections' => Array( 'in-portal:users' => Array( @@ -118,7 +118,7 @@ 'parent' => 'in-portal:users', 'icon' => 'settings_email', 'label' => 'la_tab_ConfigE-mail', - 'url' => Array('index_file' => 'config/module_email.php', 'module' => 'In-Portal:Users', 'pass_section' => true, 'lpn' => 1, 'pass' => 'm'), + 'url' => Array('t' => 'config/config_email', 'module' => 'In-Portal:Users', 'pass_section' => true, 'pass' => 'm'), 'permissions' => Array('view', 'edit'), 'priority' => 4, 'type' => stTREE, Index: trunk/admin/config/edit_config.php =================================================================== diff -u -N --- trunk/admin/config/edit_config.php (revision 2853) +++ trunk/admin/config/edit_config.php (revision 0) @@ -1,107 +0,0 @@ -$value) -{ - $path = $pathtoroot.$value."admin/include/parser.php"; - if(file_exists($path)) - { - //echo ""; - @include_once($path); - } -} - -//Set Section -$section = $_GET["section"]; -$module = $_GET["module"]; -//echo $module." - ".$section."
\n"; -//Set Environment Variable -$envar = "env=" . BuildEnv()."§ion=$section&module=$module"; - $objCatToolBar = new clsToolBar(); - $objCatToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","if(SubmitFunc) { config_submit('edit_config'); } else document.edit_config.submit();","tool_select.gif"); - $objCatToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","history.back();","tool_cancel.gif"); - - -$sec = $objSections->GetSection($section); -$ParentSection = $sec->Get("parent"); -$ParentSec = $objSections->GetSection($ParentSection); -$ParentUrl = $ParentSec->URL(); -if($ParentSec->Get("parent")) -{ - //$SubmitUrl = $ParentUrl."§ion=$section&module=$module"; - $SubmitUrl = $ParentUrl; - //echo "Submitting Parent ($ParentUrl) to: $SubmitUrl
\n"; -} -else - $SubmitUrl = $_SERVER['PHP_SELF']."?".$envar; - - -$title = ''; -int_header($objCatToolBar,NULL,$title); -?> - - -Clear(); -$objAdmin->LoadItems(TRUE); - -$headings = $objAdmin->GetHeadingList(); - -for($i=0;$i<=count($headings);$i++) -{ - $h = $headings[$i]; - if(strlen($h)) - { - int_subsection_title(prompt_language($h)); - $Items = $objAdmin->GetHeadingItems($h); - foreach($Items as $c) - { - print "\n"; - print " \n"; - print " "; - if(is_object($c->NextItem)) - { - $n = $c->NextItem; - print " "; - } - else - print " \n"; - print "\n"; - } - } -} -?> - > - - -
".$c->GetPrompt(); - - if( IsDebugMode() ) - { - echo '
['.$c->DisplayOrder.'] '.$c->name.''; - } - - print "
".$c->ItemFormElement()."".$n->ItemFormElement()." 
- - - -
- Index: trunk/kernel/units/categories/categories_config.php =================================================================== diff -u -N -r4670 -r4675 --- trunk/kernel/units/categories/categories_config.php (.../categories_config.php) (revision 4670) +++ trunk/kernel/units/categories/categories_config.php (.../categories_config.php) (revision 4675) @@ -53,7 +53,7 @@ 'tree_site' => Array('format' => '!la_selecting_categories!'), ), - 'PermSection' => Array(/*'search' => 'in-portal:configuration_search',*/ 'custom' => 'in-portal:configuration_custom'), + 'PermSection' => Array(/*'search' => 'in-portal:configuration_search',*/ 'email' => 'in-portal:configuration_email', 'custom' => 'in-portal:configuration_custom'), 'Sections' => Array( // "Structure & Data" section @@ -122,7 +122,7 @@ 'parent' => 'in-portal:site', 'icon' => 'settings_email', 'label' => 'la_tab_ConfigE-mail', - 'url' => Array('index_file' => 'config/module_email.php', 'module' => 'In-Portal:Category', 'pass_section' => true, 'lpn' => 1, 'pass' => 'm'), + 'url' => Array('t' => 'config/config_email', 'module' => 'In-Portal:Category', 'pass_section' => true, 'pass' => 'm'), 'permissions' => Array('view', 'edit'), 'priority' => 6, 'type' => stTREE, Index: trunk/admin/config/module_email.php =================================================================== diff -u -N --- trunk/admin/config/module_email.php (revision 2853) +++ trunk/admin/config/module_email.php (revision 0) @@ -1,324 +0,0 @@ -$value) -{ - $path = $pathtoroot. $value."admin/include/parser.php"; - if(file_exists($path)) - { - include_once($path); - } -} - -unset($objEditItems); - -//$objEditItems = new clsPhraseList(); -//$objEditItems->SourceTable = $objSession->GetEditTable("Language"); - -/* -------------------------------------- Section configuration ------------------------------------------- */ -$section = $_GET["section"]; -$sec = $objSections->GetSection($section); - -$module = $_GET["module"]; -$envar = "env=" . BuildEnv()."&module=$module§ion=$section"; - -//$title = prompt_language("la_Text_Configuration")." - '".$module."' - ".prompt_language("la_tab_EmailEvents"); - -$SortFieldVar = "Event_LV_SortField"; -$SortOrderVar = "Event_LV_SortOrder"; -$DefaultSortField = "Description"; -$PerPageVar = "Perpage_Event"; -$CurrentPageVar = "Page_Event"; -$CurrentFilterVar = "EmailEvent_View"; - -$ListForm = "language"; -$CheckClass = "EmailChecks"; - - -//echo $envar."
\n"; -/* ------------------------------------- Configure the toolbar ------------------------------------------- */ -$objListToolBar = new clsToolBar(); -$objListToolBar->Set("section",$section); -$objListToolBar->Set("load_menu_func",""); -$objListToolBar->Set("CheckClass","EmailChecks"); -$objListToolBar->Set("CheckClass",$CheckClass); -$objListToolBar->Set("CheckForm",$ListForm); - -$listImages = array(); - -/* -$objListToolBar->Add("email_edit", "la_ToolTip_Edit","#","if (EmailChecks.itemChecked()) swap('email_edit','toolbar/tool_edit_f2.gif');", - "if (EmailChecks.itemChecked()) swap('email_edit', 'toolbar/tool_edit.gif');", - "EmailChecks.check_submit('email_edit', '');", - "tool_edit.gif"); -$listImages[] = "EmailChecks.addImage('email_edit','$imagesURL/toolbar/tool_edit.gif','$imagesURL/toolbar/tool_edit_f3.gif',1); "; -*/ - -$EditVar = "env=".BuildEnv(); - -$objListToolBar->Add("email_user", "la_ToolTip_Email_UserSelect","#","if (EmailChecks.itemChecked()) swap('email_user','toolbar/tool_usertogroup_f2.gif');", - "if (EmailChecks.itemChecked()) swap('email_user', 'toolbar/tool_usertogroup.gif');", - "OpenUserSelector('EventId',$CheckClass,'".$EditVar."&Selector=radio&destform=userpopup&destfield=FromUserId&IdField=PortalUserId&dosubmit=1');", - "tool_usertogroup.gif",TRUE,TRUE); - -$listImages[] = "EmailChecks.addImage('email_user','$imagesURL/toolbar/tool_usertogroup.gif','$imagesURL/toolbar/tool_usertogroup_f3.gif',1); "; - -$objListToolBar->Add("email_enable", "la_ToolTip_Email_Enable","#","if (EmailChecks.itemChecked()) swap('email_enable','toolbar/tool_approve_f2.gif');", - "if (EmailChecks.itemChecked()) swap('email_enable', 'toolbar/tool_approve.gif');", - "EmailChecks.check_submit('module_email', 'm_emailevent_enable');", - "tool_approve.gif",FALSE,TRUE); - -$listImages[] = "EmailChecks.addImage('email_enable','$imagesURL/toolbar/tool_approve.gif','$imagesURL/toolbar/tool_approve_f3.gif',1); "; - -$objListToolBar->Add("email_disable", "la_ToolTip_Email_Disable","#","if (EmailChecks.itemChecked()) swap('email_disable','toolbar/tool_deny_f2.gif');", - "if (EmailChecks.itemChecked()) swap('email_disable', 'toolbar/tool_deny.gif');", - "EmailChecks.check_submit('module_email', 'm_emailevent_disable');", - "tool_deny.gif",FALSE,TRUE); - -$listImages[] = "EmailChecks.addImage('email_disable','$imagesURL/toolbar/tool_deny.gif','$imagesURL/toolbar/tool_deny_f3.gif',1); "; - -$objListToolBar->Add("email_front", "la_ToolTip_Email_FrontOnly","#","if (EmailChecks.itemChecked()) swap('email_front','toolbar/tool_frontend_mail_f2.gif');", - "if (EmailChecks.itemChecked()) swap('email_front', 'toolbar/tool_frontend_mail.gif');", - "EmailChecks.check_submit('module_email', 'm_emailevent_frontonly');", - "tool_frontend_mail.gif",FALSE,TRUE); - -$listImages[] = "EmailChecks.addImage('email_front','$imagesURL/toolbar/tool_frontend_mail.gif','$imagesURL/toolbar/tool_frontend_mail_f3.gif',1); "; - - -$objListToolBar->Add("divider"); - -$objListToolBar->Add("viewmenubutton", "la_ToolTip_View","#","swap('viewmenubutton','toolbar/tool_view_f2.gif'); ", - "swap('viewmenubutton', 'toolbar/tool_view.gif');", - "ShowViewMenu();","tool_view.gif"); - - -$objListToolBar->AddToInitScript($listImages); -$objListToolBar->AddToInitScript("fwLoadMenus();"); - -$objEvents = new clsEventList(); -//$objEvents->SourceTable = $objSession->GetEditTable("Events"); - -$order = trim($objConfig->Get("Event_LV_SortField")." ".$objConfig->Get("Event_LV_SortOrder")); - -$SearchWords = $objSession->GetVariable("EmailEventSearchWord"); -$where = "(Module='$module')"; -if(strlen($SearchWords)) - $where .= ' AND '.$objEvents->AdminSearchWhereClause($SearchWords); - -/* ----------------------------------------- Set the View Filter ---------------------------------------- */ -$ViewNormal=1; -$Bit_Disabled=2; -$Bit_Enabled=1; -$Bit_FrontOnly=4; -$Bit_All = 7; -$FilterLabels[0] = admin_language("la_Text_Enabled"); -$FilterLabels[1] = admin_language("la_Text_Disabled"); -$FilterLabels[2] = admin_language("la_Text_FrontOnly"); - -/* determine current view menu settings */ -$MsgView = $objConfig->Get("EmailEvent_View"); - -$ViewNormal=0; - -if(!is_numeric($MsgView)) -{ - $MsgView = $Bit_All; //Set all bits ON - $MsgFilter = ""; -} -unset($Status); -$Status = array(); - -if($MsgView & $Bit_Disabled) - $Status[] = 0; - -if($MsgView & $Bit_Enabled) - $Status[] = 1; - -if($MsgView & $Bit_FrontOnly) - $Status[] = 2; - -if(count($Status)>0) -{ - $MsgFilter = "Enabled IN (".implode(",",$Status).")"; -} -else - $MsgFilter = "Enabled = -1"; - -$UserTable = GetTablePrefix()."PortalUser"; -$EventTable = GetTablePrefix()."Events"; -$MessageTable = GetTablePrefix()."EmailMessage"; - -$sql = "SELECT e.Description as Description, e.Module as Module, e.EventId as EventId, "; -$sql .="ELT(e.Enabled+1,'".admin_language("la_Text_Disabled")." ','".admin_language("la_Text_Enabled")."','".admin_language("la_Text_FrontOnly")." ') as EmailStatus, "; -$sql .="ELT(e.Type+1,'".admin_language("la_Text_User")." ','".admin_language("la_Text_Admin")." ') as EventType, "; -$sql .="u.Login as FromUser FROM $EventTable as e LEFT JOIN $UserTable as u ON (e.FromUserId=u.PortalUserId) WHERE $where "; -if(strlen($MsgFilter)) - $sql .= "AND $MsgFilter "; - -if(strlen(trim($objConfig->Get($SortFieldVar)))) -{ - $order = " ORDER BY ".$objConfig->Get($SortFieldVar)." ".$objConfig->Get($SortOrderVar); -} -else - $order = ""; - -if($objConfig->Get($CurrentPageVar)>0) -{ - $objEvents->Page = $objConfig->Get($CurrentPageVar); -} - -if($objConfig->Get($PerPageVar)>0) -{ - $objListView->PerPage = $objConfig->Get($PerPageVar); -} - -$sql .= $order." "; - -if($objSession->HasSystemPermission("DEBUG.LIST")) - echo htmlentities($sql,ENT_NOQUOTES)."
\n"; - -$objListView = new clsListView($objListToolBar); -$objListView->CurrentPageVar = $CurrentPageVar; -$objListView->PerPageVar = $PerPageVar; -$objListView->extra_env = '&module='.GetVar('module').'§ion='.GetVar('section'); - -$objEvents->Query_Item($sql, $objListView->GetLimitSQL() ); -//$itemcount = TableCount($objEvents->SourceTable, $where, 0); -$itemcount = QueryCount($sql); - -$objListView->SetListItems($objEvents); -$objListView->IdField = "EventId"; - -$order = $objConfig->Get($PerPageVar); - -$objListView->ColumnHeaders->Add("Description",admin_language("la_prompt_Description"),1,0,$order,"width=\"50%\"",$SortFieldVar,$SortOrderVar,"Description"); -//$objListView->ColumnHeaders->Add("Module",admin_language("la_prompt_Module"),1,0,$order,"width=\"10%\"","Email_LV_SortField","Email_LV_SortOrder","Module"); -$objListView->ColumnHeaders->Add("EventType",admin_language("la_prompt_Type"),1,0,$order,"width=\"10%\"",$SortFieldVar,$SortOrderVar,"EventType"); -$objListView->ColumnHeaders->Add("EmailStatus",admin_language("la_prompt_Status"),1,0,$order,"width=\"10%\"",$SortFieldVar,$SortOrderVar,"EmailStatus"); -$objListView->ColumnHeaders->Add("FromUser",admin_language("la_prompt_FromUser"),1,0,$order,"width=\"15%\"",$SortFieldVar,$SortOrderVar,"FromUser"); - -$objListView->ColumnHeaders->SetSort($objConfig->Get($SortFieldVar), $objConfig->Get($SortOrderVar)); - -$objListView->PrintToolBar = FALSE; -$objListView->checkboxes = TRUE; -$objListView->CheckboxName = "itemlist[]"; -$objListView->SearchBar = TRUE; -$objListView->SearchKeywords = $SearchWords; -$objListView->SearchAction="m_emailevent_search"; - -$objListView->TotalItemCount = 20; // $itemcount; - -$objListView->ConfigureViewMenu($SortFieldVar,$SortOrderVar,$DefaultSortField, - $CurrentFilterVar,$MsgView,$Bit_All); - -foreach($FilterLabels as $Bit=>$Label) -{ - $objListView->AddViewMenuFilter($Label,$Bit); -} - -for($i=0;$iItems);$i++) -{ - $e =& $objEvents->GetItemRefByIndex($i); - $e->Set("Description",prompt_language($e->Get("Description"))); -} -$filter = false; // always initialize variables before use -if($objSession->GetVariable("EmailEventSearchWord") != '') { - $filter = true; -} -else { - if ($MsgView != $Bit_All) { - $filter = true; - } -} - -$h = "\n\n\n"; -if( !isset($title) ) $title = ''; -int_header($objListToolBar,NULL, $title,NULL,$h); -if ($filter) { ?> - - - - -
- -
- -
" method=POST> - - -PrintList(); -?> - - - - - - > - - - -
-
- - -
" name="viewmenu"> - - - - -
-
"> - - -
- -
" ID="popup"> - - - - - - - -
- -
" ID="userpopup"> - - - -
- - - - Index: trunk/admin/config/config_general.php =================================================================== diff -u -N --- trunk/admin/config/config_general.php (revision 2853) +++ trunk/admin/config/config_general.php (revision 0) @@ -1,104 +0,0 @@ - -
- - - - Execute($sql); - while($rs & !$rs->EOF) - { - if($rs->fields["Section"]==$config_section) - { - $divleftimage=$imagesURL."/divider_left_sel.gif"; - $tab_bg="#E9D4CE"; - - $divrightimage=$imagesURL."/divider_sel_right.gif"; - } - else - { - $divleftimage=$imagesURL."/divider_dn.gif"; - $tab_bg="#E0E0DA"; - $divrightimage=$imagesURL."/divider_right.gif"; - } - $url="config_general.php?env=$envar&module=$config_module§ion=".$rs->fields["Section"]; - ?> - - - - - moveNext(); - } - ?> - - -
fields["Section"]; ?>
- - - - - -Execute($sql); - while($rs & !$rs->EOF) - { - echo " "; - echo ""; - echo ""; - echo ""; - echo "\n"; - $rs->moveNext(); - } -?> - > - - -
-
".$rs->fields["Prompt"]."fields["VariableName"]."\" VALUE=\"".$rs->fields["VariableValue"]."\">".$rs->fields["Description"]."
- - - - -
-
- -