Commit 09c48dcf authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Template checkbox on view access page

parent 34994325
......@@ -233,4 +233,8 @@ $string['noartefactstochoosefrom'] = 'Sorry, no artefacts to choose from';
$string['access'] = 'Access';
$string['noaccesstoview'] = 'You do not have permission to access this view';
// Templates
$string['Template'] = 'Template';
$string['templatedescription'] = 'If you would like the people who can see your view to be able to make their own copies of it, check the Template box.';
?>
......@@ -55,6 +55,7 @@ class View {
private $dirtycolumns; // for when we change stuff
private $tags;
private $editingroles;
private $template;
public function __construct($id=0, $data=null) {
if (!empty($id)) {
......
......@@ -85,6 +85,12 @@ $form = array(
'type' => 'hidden',
'value' => $new,
),
'template' => array(
'type' => 'checkbox',
'title' => get_string('Template', 'view'),
'description' => get_string('templatedescription', 'view'),
'defaultvalue' => $view->get('template'),
),
'accesslist' => array(
'type' => 'viewacl',
'defaultvalue' => isset($view) ? $view->get_access() : null
......@@ -161,6 +167,7 @@ function editaccess_submit(Pieform $form, $values) {
$view->set('startdate', $values['startdate']);
$view->set('stopdate', $values['stopdate']);
$view->set('template', (int) $values['template']);
$view->commit();
if ($values['new']) {
......
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