diff --git a/public_html/create.php b/public_html/create.php index 812e596f..07f62327 100644 --- a/public_html/create.php +++ b/public_html/create.php @@ -83,14 +83,14 @@ if(LSsession :: startLSsession()) { if (isset($_REQUEST['ajax'])) { LSsession :: displayAjaxReturn ( array( - 'LSredirect' => 'view.php?LSobject='.$LSobject.'&dn='.urlencode($object -> getDn()) + 'LSredirect' => "object/$LSobject/".urlencode($object -> getDn()) ) ); exit(); } else { if (!LSdebugDefined()) { - LSsession :: redirect('view.php?LSobject='.$LSobject.'&dn='.urlencode($object -> getDn())); + LSurl :: redirect("object/$LSobject/".urlencode($object -> getDn())); } } } diff --git a/public_html/custom_action.php b/public_html/custom_action.php index 4712b3a0..e508f3ed 100644 --- a/public_html/custom_action.php +++ b/public_html/custom_action.php @@ -54,10 +54,10 @@ if(LSsession :: startLSsession()) { } } if ($config['redirectToObjectList']) { - LSsession :: redirect('view.php?LSobject='.$LSobject.'&refresh'); + LSurl :: redirect("object/$LSobject?refresh"); } else if (!isset($config['noRedirect']) || !$config['noRedirect']) { - LSsession :: redirect('view.php?LSobject='.$LSobject.'&dn='.urlencode($dn)); + LSurl :: redirect("object/$LSobject/".urlencode($dn)); } } else { diff --git a/public_html/custom_search_action.php b/public_html/custom_search_action.php index 3eaf903b..d4f8b47c 100644 --- a/public_html/custom_search_action.php +++ b/public_html/custom_search_action.php @@ -54,7 +54,7 @@ if(LSsession :: startLSsession()) { } } if (!isset($config['redirectToObjectList']) || $config['redirectToObjectList']) { - LSsession :: redirect('view.php?LSobject='.$LSobject.'&refresh'); + LSurl :: redirect("object/$LSobject?refresh"); } } else { diff --git a/public_html/global_search.php b/public_html/global_search.php index b6961984..316e40c0 100644 --- a/public_html/global_search.php +++ b/public_html/global_search.php @@ -93,7 +93,7 @@ if(LSsession :: startLSsession()) { } if ($onlyOne && $onlyOneObject && isset($_REQUEST['LSsearch_submit'])) { - LSsession :: redirect('view.php?LSobject='.$onlyOneObject['LSobject'].'&dn='.urlencode($onlyOneObject['dn'])); + LSurl :: redirect('object/'.$onlyOneObject['LSobject'].'/'.urlencode($onlyOneObject['dn'])); } LStemplate :: assign('pattern',$pattern); diff --git a/public_html/includes/class/class.LSrelation.php b/public_html/includes/class/class.LSrelation.php index dd49a20b..fac6c1c6 100644 --- a/public_html/includes/class/class.LSrelation.php +++ b/public_html/includes/class/class.LSrelation.php @@ -354,7 +354,7 @@ class LSrelation { else { $class=''; } - $data['html'].= "
@@ -42,7 +42,7 @@
- + {if $page.nbPages > 10} {if $page.nb > 5} {if $page.nb > $page.nbPages-6} @@ -141,21 +141,21 @@ {else} {assign var=start value=0} {/if} - < + < {foreach from=0|range:10 item=i} {if $page.nb==$start+$i} - {$page.nb+1} + {$page.nb+1} {else} - {$i+$start+1} + {$i+$start+1} {/if} {/foreach} - > + > {else} {section name=listpage loop=$page.nbPages step=1} {if $page.nb == $smarty.section.listpage.index} - {$page.nb+1} + {$page.nb+1} {else} - {$smarty.section.listpage.index+1} + {$smarty.section.listpage.index+1} {/if} {/section} {/if} diff --git a/public_html/view.php b/public_html/view.php deleted file mode 100644 index 860d1147..00000000 --- a/public_html/view.php +++ /dev/null @@ -1,226 +0,0 @@ - getType(); - $dn = LSsession :: getLSuserObjectDn(); - } - else { - $dn = isset($_REQUEST['dn'])?urldecode($_REQUEST['dn']):null; - } - - if (LSsession :: in_menu($LSobject) || LSsession :: canAccess($LSobject,$dn)) { - - if ( LSsession :: loadLSobject($LSobject) ) { - // Affichage d'un objet - if ( $dn!='' ) { - if (LSsession :: canAccess($LSobject,$dn)) { - if ( LSsession :: canEdit($LSobject,$dn) ) { - $LSview_actions[] = array( - 'label' => _('Modify'), - 'url' =>'modify.php?LSobject='.$LSobject.'&dn='.urlencode($dn), - 'action' => 'modify' - ); - } - - if (LSsession :: canCreate($LSobject)) { - $LSview_actions[] = array( - 'label' => _('Copy'), - 'url' =>'create.php?LSobject='.$LSobject.'&load='.urlencode($dn), - 'action' => 'copy' - ); - } - - if (LSsession :: canRemove($LSobject,$dn)) { - $LSview_actions[] = array( - 'label' => _('Delete'), - 'url' => 'remove.php?LSobject='.$LSobject.'&dn='.urlencode($dn), - 'action' => 'delete' - ); - } - - // Custum Actions - $customActionsConfig = LSconfig :: get('LSobjects.'.$LSobject.'.customActions'); - if (is_array($customActionsConfig)) { - foreach($customActionsConfig as $name => $config) { - if (LSsession :: canExecuteCustomAction($dn,$LSobject,$name)) { - $LSview_actions[] = array ( - 'label' => ((isset($config['label']))?__($config['label']):__($name)), - 'hideLabel' => ((isset($config['hideLabel']))?$config['hideLabel']:False), - 'helpInfo' => ((isset($config['helpInfo']))?__($config['helpInfo']):False), - 'url' => 'custom_action.php?LSobject='.$LSobject.'&dn='.urlencode($dn).'&customAction='.$name, - 'action' => ((isset($config['icon']))?$config['icon']:'generate'), - 'class' => 'LScustomActions'.(($config['noConfirmation'])?' LScustomActions_noConfirmation':'') - ); - } - } - } - - if (LSsession :: getLSuserObjectDn() != $dn) { - $object = new $LSobject(); - $object -> loadData($dn); - LStemplate :: assign('pagetitle',$object -> getDisplayName()); - } - else { - $object = LSsession :: getLSuserObject(); - LStemplate :: assign('pagetitle',_('My account')); - } - - LStemplate :: assign('LSldapObject',$object); - - $view = $object -> getView(); - $view -> displayView(); - - // LSrelations - if (LSsession :: loadLSclass('LSrelation')) { - LSrelation :: displayInLSview($object); - } - - LStemplate :: assign('LSview_actions',$LSview_actions); - LSsession :: setTemplate('view.tpl'); - } - else { - LSerror :: addErrorCode('LSsession_11'); - } - } - // Affichage d'une liste d'un type d'objet - elseif (LSsession :: loadLSclass('LSsearch')) { - $object = new $LSobject(); - LStemplate :: assign('pagetitle',$object -> getLabel()); - - $LSsearch = new LSsearch($LSobject, 'LSview', null, (isset($_REQUEST['reset']))); - $LSsearch -> setParam('extraDisplayedColumns',True); - $LSsearch -> setParamsFormPostData(); - - $searchForm = array ( - 'action' => $_SERVER['PHP_SELF'], - 'recursive' => (! LSsession :: isSubDnLSobject($LSobject) && LSsession :: subDnIsEnabled() ), - 'labels' => array ( - 'submit' => _('Search'), - 'approx' => _('Approximative search'), - 'recursive' => _('Recursive search') - ), - 'values' => array ( - 'pattern' => $LSsearch->getParam('pattern'), - 'approx' => $LSsearch->getParam('approx'), - 'recursive' => $LSsearch->getParam('recursive') - ), - 'names' => array ( - 'submit' => 'LSsearch_submit' - ), - 'hiddenFields' => $LSsearch -> getHiddenFieldForm(), - 'predefinedFilter' => $LSsearch->getParam('predefinedFilter') - ); - LStemplate :: assign('searchForm',$searchForm); - - $LSview_actions=array(); - if(LSsession :: canCreate($LSobject)) { - $LSview_actions['create'] = array ( - 'label' => _('New'), - 'url' => 'create.php?LSobject='.$LSobject, - 'action' => 'create' - ); - if ($object -> listValidIOformats()) { - $LSview_actions['import'] = array ( - 'label' => _('Import'), - 'url' => 'import.php?LSobject='.$LSobject, - 'action' => 'import' - ); - } - } - $LSview_actions['refresh'] = array ( - 'label' => _('Refresh'), - 'url' => 'view.php?LSobject='.$LSobject.'&refresh', - 'action' => 'refresh' - ); - $LSview_actions['reset'] = array ( - 'label' => _('Reset'), - 'url' => 'view.php?LSobject='.$LSobject.'&reset', - 'action' => 'reset' - ); - /*$LSview_actions['purge'] = array ( - 'label' => 'Purge the cache', - 'url' => 'view.php?LSobject='.$LSobject.'&LSsearchPurgeSession', - 'action' => 'delete' - );*/ - - // Custum Actions - $customActionsConfig = LSconfig :: get('LSobjects.'.$LSobject.'.LSsearch.customActions'); - if (is_array($customActionsConfig)) { - foreach($customActionsConfig as $name => $config) { - if (LSsession :: canExecuteLSsearchCustomAction($LSsearch,$name)) { - $LSview_actions[] = array ( - 'label' => ((isset($config['label']))?__($config['label']):__($name)), - 'hideLabel' => ((isset($config['hideLabel']))?$config['hideLabel']:False), - 'helpInfo' => ((isset($config['helpInfo']))?__($config['helpInfo']):False), - 'url' => 'custom_search_action.php?LSobject='.$LSobject.'&customAction='.$name, - 'action' => ((isset($config['icon']))?$config['icon']:'generate'), - 'class' => 'LScustomActions'.(($config['noConfirmation'])?' LScustomActions_noConfirmation':'') - ); - } - } - } - - LStemplate :: assign('LSview_actions',$LSview_actions); - - $LSsearch -> run(); - - $LSsearch -> redirectWhenOnlyOneResult(); - - $page=(isset($_REQUEST['page'])?(int)$_REQUEST['page']:0); - $page = $LSsearch -> getPage($page); - LStemplate :: assign('page',$page); - LStemplate :: assign('LSsearch',$LSsearch); - - if (LSsession :: loadLSclass('LSform')) { - LSform :: loadDependenciesDisplayView(); - } - - LSsession :: setTemplate('viewSearch.tpl'); - } - else { - LSsession :: addErrorCode('LSsession_05','LSsearch'); - } - } - } - else { - LSerror :: addErrorCode('LSsession_11'); - } - } - else { - LSerror :: addErrorCode('LSsession_12'); - } -} -else { - LSsession :: setTemplate('login.tpl'); -} -// Affichage des retours d'erreurs -LSsession :: displayTemplate(); - -if (isset($LSsearch)) { - $LSsearch->afterUsingResult(); -}