Commit cf73fd97 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Call pieform before smarty on institutions page (bug #627219)


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent b24dada3
...@@ -33,7 +33,6 @@ define('SECTION_PLUGINNAME', 'admin'); ...@@ -33,7 +33,6 @@ define('SECTION_PLUGINNAME', 'admin');
define('SECTION_PAGE', 'institutions'); define('SECTION_PAGE', 'institutions');
require_once('pieforms/pieform.php'); require_once('pieforms/pieform.php');
define('MENUITEM', 'manageinstitutions/institutions'); define('MENUITEM', 'manageinstitutions/institutions');
$smarty = smarty(array('lib/pieforms/static/core/pieforms.js', 'paginator'));
$institution = param_variable('i', ''); $institution = param_variable('i', '');
$add = param_boolean('add'); $add = param_boolean('add');
...@@ -359,6 +358,8 @@ else { ...@@ -359,6 +358,8 @@ else {
$showdefault = true; $showdefault = true;
} }
$data = build_institutions_html($filter, $showdefault, $query, $limit, $offset, $count); $data = build_institutions_html($filter, $showdefault, $query, $limit, $offset, $count);
$smarty = smarty(array('lib/pieforms/static/core/pieforms.js', 'paginator'));
$smarty->assign('results', $data); $smarty->assign('results', $data);
$smarty->assign('countinstitutions', $count); $smarty->assign('countinstitutions', $count);
...@@ -392,6 +393,10 @@ else { ...@@ -392,6 +393,10 @@ else {
EOF; EOF;
$smarty->assign('INLINEJAVASCRIPT', $js); $smarty->assign('INLINEJAVASCRIPT', $js);
$smarty->assign('siteadmin', $USER->get('admin'));
$smarty->assign('PAGEHEADING', get_string('admininstitutions', 'admin'));
$smarty->display('admin/users/institutions.tpl');
exit;
} }
function institution_validate(Pieform $form, $values) { function institution_validate(Pieform $form, $values) {
...@@ -615,14 +620,10 @@ function search_submit(Pieform $form, $values) { ...@@ -615,14 +620,10 @@ function search_submit(Pieform $form, $values) {
redirect('/admin/users/institutions.php' . (!empty($values['query']) ? '?query=' . urlencode($values['query']) : '')); redirect('/admin/users/institutions.php' . (!empty($values['query']) ? '?query=' . urlencode($values['query']) : ''));
} }
if (isset($institutionform)) { $smarty = smarty();
$smarty->assign('institution_form', $institutionform); $smarty->assign('institution_form', $institutionform);
$smarty->assign('instancestring', $instancestring); $smarty->assign('instancestring', $instancestring);
$smarty->assign('add', $add); $smarty->assign('add', $add);
}
else {
$smarty->assign('siteadmin', $USER->get('admin'));
}
if (isset($suspended)) { if (isset($suspended)) {
if ($suspended) { if ($suspended) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment