Commit f56c49a1 authored by Nigel McNie's avatar Nigel McNie
Browse files

The resume composites were broken when editing a resume (although they were...

The resume composites were broken when editing a resume (although they were working in the views). Fixed.
parent a61813e0
...@@ -458,7 +458,7 @@ abstract class ArtefactTypeResumeComposite extends ArtefactTypeResume { ...@@ -458,7 +458,7 @@ abstract class ArtefactTypeResumeComposite extends ArtefactTypeResume {
} }
public function render_self($options) { public function render_self($options) {
$suffix = substr(md5(microtime()), 0, 4); $suffix = '_' . substr(md5(microtime()), 0, 4);
$smarty = smarty(); $smarty = smarty();
$smarty->assign('hidetitle', true); $smarty->assign('hidetitle', true);
$smarty->assign('suffix', $suffix); $smarty->assign('suffix', $suffix);
...@@ -468,23 +468,23 @@ abstract class ArtefactTypeResumeComposite extends ArtefactTypeResume { ...@@ -468,23 +468,23 @@ abstract class ArtefactTypeResumeComposite extends ArtefactTypeResume {
'javascript' => 'javascript' =>
$this->get_showhide_composite_js() $this->get_showhide_composite_js()
." ."
var {$type}list_{$suffix} = new TableRenderer( var {$type}list{$suffix} = new TableRenderer(
'{$type}list_{$suffix}', '{$type}list{$suffix}',
'" . get_config('wwwroot') . "artefact/resume/composite.json.php', '" . get_config('wwwroot') . "artefact/resume/composite.json.php',
[ [
" . call_static_method(generate_artefact_class_name($type), 'get_tablerenderer_js') ." " . call_static_method(generate_artefact_class_name($type), 'get_tablerenderer_js') ."
] ]
); );
{$type}list_{$suffix}.type = '{$type}'; {$type}list{$suffix}.type = '{$type}';
{$type}list_{$suffix}.statevars.push('type'); {$type}list{$suffix}.statevars.push('type');
" . " .
(( array_key_exists('viewid', $options)) (( array_key_exists('viewid', $options))
? "{$type}list_{$suffix}.view = " . $options['viewid'] . "; ? "{$type}list{$suffix}.view = " . $options['viewid'] . ";
{$type}list_{$suffix}.statevars.push('view');" {$type}list{$suffix}.statevars.push('view');"
: "" : ""
) . " ) . "
{$type}list_{$suffix}.updateOnLoad(); {$type}list{$suffix}.updateOnLoad();
"); ");
return $content; return $content;
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
{contextualhelp plugintype='artefact' pluginname='resume' section='addbook'} {contextualhelp plugintype='artefact' pluginname='resume' section='addbook'}
{/if} {/if}
</h3>{/if} </h3>{/if}
<table id="booklist_{$suffix}" class="tablerenderer hidden resumefour"> <table id="booklist{$suffix}" class="tablerenderer hidden resumefour">
<thead> <thead>
<tr> <tr>
<th class="resumedate">{str tag='date' section='artefact.resume'}</th> <th class="resumedate">{str tag='date' section='artefact.resume'}</th>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
{contextualhelp plugintype='artefact' pluginname='resume' section='addcertification'} {contextualhelp plugintype='artefact' pluginname='resume' section='addcertification'}
{/if} {/if}
</h3>{/if} </h3>{/if}
<table id="certificationlist_{$suffix}" class="tablerenderer hidden resumefour"> <table id="certificationlist{$suffix}" class="tablerenderer hidden resumefour">
<thead> <thead>
<tr> <tr>
<th class="resumedate">{str tag='date' section='artefact.resume'}</th> <th class="resumedate">{str tag='date' section='artefact.resume'}</th>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
{contextualhelp plugintype='artefact' pluginname='resume' section='addeducationhistory'} {contextualhelp plugintype='artefact' pluginname='resume' section='addeducationhistory'}
{/if} {/if}
</h3>{/if} </h3>{/if}
<table id="educationhistorylist_{$suffix}" class="tablerenderer hidden resumefive"> <table id="educationhistorylist{$suffix}" class="tablerenderer hidden resumefive">
<thead> <thead>
<tr> <tr>
<th class="resumedate">{str tag='startdate' section='artefact.resume'}</th> <th class="resumedate">{str tag='startdate' section='artefact.resume'}</th>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
{contextualhelp plugintype='artefact' pluginname='resume' section='addemploymenthistory'} {contextualhelp plugintype='artefact' pluginname='resume' section='addemploymenthistory'}
{/if} {/if}
</h3>{/if} </h3>{/if}
<table id="employmenthistorylist_{$suffix}" class="tablerenderer hidden resumefive"> <table id="employmenthistorylist{$suffix}" class="tablerenderer hidden resumefive">
<thead> <thead>
<tr> <tr>
<th class="resumedate">{str tag='startdate' section='artefact.resume'}</th> <th class="resumedate">{str tag='startdate' section='artefact.resume'}</th>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
{contextualhelp plugintype='artefact' pluginname='resume' section='addmembership'} {contextualhelp plugintype='artefact' pluginname='resume' section='addmembership'}
{/if} {/if}
</h3>{/if} </h3>{/if}
<table id="membershiplist_{$suffix}" class="tablerenderer hidden resumefive"> <table id="membershiplist{$suffix}" class="tablerenderer hidden resumefive">
<thead> <thead>
<tr> <tr>
<th class="resumedate">{str tag='startdate' section='artefact.resume'}</th> <th class="resumedate">{str tag='startdate' section='artefact.resume'}</th>
......
Supports Markdown
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