Commit 633c134d authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Include pieforms.js on more admin pages

parent e81153c5
......@@ -36,13 +36,12 @@ define('SECTION_PLUGINNAME', 'admin');
define('SECTION_PAGE', 'adminusers');
require_once('pieforms/pieform.php');
require_once('activity.php');
$smarty = smarty();
// Get users who are currently administrators
// @todo later, exclude the user with uid 1
$adminusers = get_column('usr', 'id', 'admin', 1, 'deleted', 0);
$form = array(
$form = pieform(array(
'name' => 'adminusers',
'elements' => array(
'users' => array(
......@@ -66,7 +65,7 @@ $form = array(
'value' => get_string('submit')
)
)
);
));
function adminusers_submit(Pieform $form, $values) {
global $SESSION;
......@@ -84,7 +83,8 @@ function adminusers_submit(Pieform $form, $values) {
redirect('/admin/users/admins.php');
}
$smarty->assign('adminusersform', pieform($form));
$smarty = smarty();
$smarty->assign('adminusersform', $form);
$smarty->assign('heading', get_string('adminusers', 'admin'));
$smarty->display('admin/users/admin.tpl');
......
......@@ -37,8 +37,9 @@ define('MENUITEM', 'manageinstitutions/institutionusers');
require_once('pieforms/pieform.php');
require_once('institution.php');
$institutionelement = get_institution_selector(false);
$smarty = smarty();
if (empty($institutionelement)) {
$smarty = smarty();
$smarty->display('admin/users/noinstitutions.tpl');
exit;
}
......@@ -226,6 +227,7 @@ addLoadEvent(function() {
});
EOF;
$smarty = smarty();
$smarty->assign('INLINEJAVASCRIPT', $js);
$smarty->assign('usertypeselector', $usertypeselector);
$smarty->assign('instructions', get_string('institutionusersinstructions'.$usertype, 'admin'));
......
......@@ -36,12 +36,11 @@ define('SECTION_PLUGINNAME', 'admin');
define('SECTION_PAGE', 'staffusers');
require_once('pieforms/pieform.php');
require_once('activity.php');
$smarty = smarty();
// Get users who are currently staff
$staffusers = get_column('usr', 'id', 'staff', 1, 'deleted', 0);
$form = array(
$form = pieform(array(
'name' => 'staffusers',
'elements' => array(
'users' => array(
......@@ -62,7 +61,7 @@ $form = array(
'value' => get_string('submit')
)
)
);
));
function staffusers_submit(Pieform $form, $values) {
global $SESSION;
......@@ -81,7 +80,8 @@ function staffusers_submit(Pieform $form, $values) {
redirect('/admin/users/staff.php');
}
$smarty->assign('staffusersform', pieform($form));
$smarty = smarty();
$smarty->assign('staffusersform', $form);
$smarty->assign('heading', get_string('staffusers', 'admin'));
$smarty->display('admin/users/staff.tpl');
......
......@@ -393,9 +393,11 @@ else {
);
}
$form = pieform($form);
$smarty = smarty();
$smarty->assign('uploadcsvpagedescription', $uploadcsvpagedescription);
$smarty->assign('uploadcsvform', pieform($form));
$smarty->assign('uploadcsvform', $form);
$smarty->display('admin/users/uploadcsv.tpl');
?>
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