Commit 8168051f authored by Martyn Smith's avatar Martyn Smith Committed by Martyn Smith
Browse files
parents a93fa035 68707829
......@@ -290,6 +290,7 @@ $smarty = smarty(array(), array(), array(
$smarty->assign('profileform', $profileform);
$smarty->assign('resumeinstalled', record_exists('artefact_installed', 'name', 'resume'));
$smarty->display('artefact:internal:index.tpl');
?>
......@@ -4,6 +4,9 @@
{include file="columnleftstart.tpl"}
<div class="fr leftrightlink"><a href="profileicons.php" id="editprofileicons">{str tag="editprofileicons" section="artefact.internal"} &raquo;</a></div>
{if $resumeinstalled}
<div class="fr leftrightlink"><a href="{$WWWROOT}artefact/resume/" id="profilegotoresume">{str tag="profilegotoresume" section="artefact.resume"} &raquo;</a></div>
{/if}
<div style="position: relative;">
<div style="position: absolute; top: 3.5em; right: 0;"><img src="{$WWWROOT}thumb.php?type=profileicon&size=100x100&id={$USER->get('id')}" alt=""></div>
</div>
......
......@@ -58,21 +58,21 @@ $gform = array(
'personalgoal' => array(
'type' => 'wysiwyg',
'rows' => 10,
'cols' => 50,
'cols' => 70,
'defaultvalue' => ((!empty($personal)) ? $personal->get('description') : null),
'title' => get_string('personalgoal', 'artefact.resume'),
),
'academicgoal' => array(
'type' => 'wysiwyg',
'rows' => 10,
'cols' => 50,
'cols' => 70,
'defaultvalue' => ((!empty($academic)) ? $academic->get('description') : null),
'title' => get_string('academicgoal', 'artefact.resume'),
),
'careergoal' => array(
'type' => 'wysiwyg',
'rows' => 10,
'cols' => 50,
'cols' => 70,
'defaultvalue' => ((!empty($career)) ? $career->get('description') : null),
'title' => get_string('careergoal', 'artefact.resume'),
),
......@@ -82,8 +82,8 @@ $gform = array(
),
),
);
$goalform = pieform($gform);
$smarty = smarty();
$smarty->assign('goalform', pieform($gform));
$smarty->assign('goalform', $goalform);
$smarty->display('artefact:resume:goals.tpl');
?>
......@@ -122,36 +122,24 @@ $form = array(
'defaultvalue' => ((!empty($personalinformation))
? strtotime($personalinformation->get_composite('dateofbirth')) : null),
'title' => get_string('dateofbirth', 'artefact.resume'),
'rules' => array(
'required' => true,
),
),
'placeofbirth' => array(
'type' => 'text',
'defaultvalue' => ((!empty($personalinformation))
? $personalinformation->get_composite('placeofbirth') : null),
'title' => get_string('placeofbirth', 'artefact.resume'),
'rules' => array(
'required' => true,
),
),
'citizenship' => array(
'type' => 'text',
'defaultvalue' => ((!empty($personalinformation))
? $personalinformation->get_composite('citizenship') : null),
'title' => get_string('citizenship', 'artefact.resume'),
'rules' => array(
'required' => true,
),
),
'visastatus' => array(
'type' => 'text',
'defaultvalue' => ((!empty($personalinformation))
? $personalinformation->get_composite('visastatus') : null),
'title' => get_string('visastatus', 'artefact.resume'),
'rules' => array(
'required' => true,
),
),
'gender' => array(
'type' => 'radio',
......@@ -162,18 +150,12 @@ $form = array(
'male' => get_string('male', 'artefact.resume'),
),
'title' => get_string('gender', 'artefact.resume'),
'rules' => array(
'required' => true,
),
),
'maritalstatus' => array(
'type' => 'text',
'defaultvalue' => ((!empty($personalinformation))
? $personalinformation->get_composite('maritalstatus') : null),
'title' => get_string('maritalstatus', 'artefact.resume'),
'rules' => array(
'required' => true,
),
),
),
),
......@@ -189,6 +171,9 @@ $addstr = get_string('add');
$editstr = get_string('edit');
$delstr = get_string('delete');
$confirmdelstr = get_string('compositedeleteconfirm', 'artefact.resume');
$confirmeditprofilestr = get_string('confirmeditprofile', 'artefact.resume');
$wwwroot = get_config('wwwroot');
$mainform = pieform($form);
$smarty = smarty(array('tablerenderer'));
......@@ -233,6 +218,13 @@ function deleteComposite(type, id, artefact) {
return false;
}
function editprofilebutton() {
if (confirm('{$confirmeditprofilestr}')) {
document.location='{$wwwroot}artefact/internal';
}
return false;
}
EOF;
$compositeforms = array();
foreach (ArtefactTypeResumeComposite::get_composite_artefact_types() as $compositetype) {
......
......@@ -75,4 +75,6 @@ $string['academicskill'] = 'Academic Skills';
$string['workskill'] = 'Work Skills';
$string['goalandskillsaved'] = 'Saved successfully';
$string['resume'] = 'Résumé';
$string['confirmeditprofile'] = 'If you continue to edit your profile now, you will lose any unsaved information in this area';
$string['profilegotoresume'] = 'Edit My Résumé';
?>
......@@ -219,7 +219,7 @@ class ArtefactTypePersonalinformation extends ArtefactTypeResume {
// only set it to dirty if it's changed
$this->dirty = true;
$this->mtime = time();
if ($field == 'dateofbirth') {
if ($field == 'dateofbirth' && !empty($value)) {
$value = db_format_timestamp($value);
}
$this->composites[$field] = $value;
......@@ -255,12 +255,12 @@ class ArtefactTypePersonalinformation extends ArtefactTypeResume {
public static function get_composite_fields() {
static $composites = array(
'dateofbirth' => '',
'placeofbirth' => '',
'citizenship' => '',
'visastatus' => '',
'gender' => '',
'maritalstatus' => '',
'dateofbirth' => null,
'placeofbirth' => null,
'citizenship' => null,
'visastatus' => null,
'gender' => null,
'maritalstatus' => null,
);
return $composites;
}
......
......@@ -58,21 +58,21 @@ $sform = array(
'personalskill' => array(
'type' => 'wysiwyg',
'rows' => 10,
'cols' => 50,
'cols' => 70,
'defaultvalue' => ((!empty($personal)) ? $personal->get('description') : null),
'title' => get_string('personalskill', 'artefact.resume'),
),
'academicskill' => array(
'type' => 'wysiwyg',
'rows' => 10,
'cols' => 50,
'cols' => 70,
'defaultvalue' => ((!empty($academic)) ? $academic->get('description') : null),
'title' => get_string('academicskill', 'artefact.resume'),
),
'workskill' => array(
'type' => 'wysiwyg',
'rows' => 10,
'cols' => 50,
'cols' => 70,
'defaultvalue' => ((!empty($work)) ? $work->get('description') : null),
'title' => get_string('workskill', 'artefact.resume'),
),
......@@ -82,8 +82,8 @@ $sform = array(
),
),
);
$skillform = pieform($sform);
$smarty = smarty();
$smarty->assign('skillform', pieform($sform));
$smarty->assign('skillform', $skillform);
$smarty->display('artefact:resume:skills.tpl');
?>
......@@ -32,6 +32,6 @@
<td>{$mobilenumber}</td>
</tr>
<tr>
<td colspan="2"> <button onClick="document.location='{$WWWROOT}/artefact/internal/';">{str tag='editprofile' section='artefact.internal'}</button></td>
<td colspan="2"> <button onClick="return editprofilebutton();">{str tag='editprofile' section='artefact.internal'}</button></td>
</tr>
</table>
......@@ -177,16 +177,16 @@ function sendjsonrequest(script, data, rtype, successcallback, errorcallback, qu
if (!quiet) {
displayMessage(data.message, errtype);
}
try { successcallback(data); } catch (e) { logError('sendjsonrequest() callback failed: ', data); }
try { successcallback(data); } catch (e) { logError('sendjsonrequest() callback failed: ', e, data); }
}
else if (data.message && typeof(data.message == 'object')) {
if (data.message.message && typeof(data.message.message == 'string') && !quiet) {
displayMessage(data.message.message, errtype);
}
try { successcallback(data.message); } catch (e) { logError('sendjsonrequest() callback failed: ', data); }
try { successcallback(data.message); } catch (e) { logError('sendjsonrequest() callback failed: ', e, data); }
}
else {
try { successcallback(data); } catch (e) { logError('sendjsonrequest() callback failed: ', data); }
try { successcallback(data); } catch (e) { logError('sendjsonrequest() callback failed: ', e, data); }
}
processingStop();
}
......
......@@ -49,9 +49,15 @@ function TableRenderer(target, source, columns, options) {
self.assertPager(self.offset, self.limit, self.count);
}
if (typeof(self.emptycontent) != 'undefined') {
self.emptycontent = DIV(null,self.emptycontent);
insertSiblingNodesBefore(self.table, self.emptycontent);
if (TableRendererPageLoaded) {
if (typeof(self.emptycontent) != 'undefined') {
self.emptycontent = DIV(null,self.emptycontent);
insertSiblingNodesBefore(self.table, self.emptycontent);
}
if (self.loadingMessage) {
removeElement(self.loadingMessage);
self.loadingMessage = null;
}
}
};
......
......@@ -62,7 +62,7 @@ results.updatecallback = function (d) {
results.linkspan = {$ncols};
if (!$('userfields')) {
appendChildNodes(results.thead, TR({'id':'userfields'},
map(partial(TD, null), userfieldstrings)));
map(partial(TH, null), userfieldstrings)));
}
}
else {
......@@ -82,12 +82,7 @@ results.rowfunction = function(r,n,d) {
var row = TR({'class':'r'+(n%2)},TD(null,A({'href':'user/view.php?id=' + r.id},r.name)));
for (var i = 0; i < userfields.length; i++) {
if (r[userfields[i]]) {
if (userfields[i] == 'email') {
appendChildNodes(row, TD(null, map(partial(DIV,null), r[userfields[i]])));
}
else {
appendChildNodes(row, TD(null, r[userfields[i]]));
}
appendChildNodes(row, TD(null, r[userfields[i]]));
}
else {
appendChildNodes(row, TD(null));
......@@ -106,12 +101,14 @@ function doSearch() {
EOF;
$smarty = smarty(array('tablerenderer'));
if (isset($_REQUEST['query'])) {
$javascript .= ' results.query = ' . json_encode($query) . ";\n";
$javascript .= " results.updateOnLoad();\n";
$smarty->assign('search_query_value', $query);
}
$smarty = smarty(array('tablerenderer'));
$smarty->assign('INLINEJAVASCRIPT', $javascript);
$smarty->display('search.tpl');
......
......@@ -354,7 +354,9 @@ tr.required th {
color: #FFF;
text-decoration: none;
}
#mainnav li.selected a {
#mainnav li.selected a:link,
#mainnav li.selected a:visited,
#mainnav li.selected a:active {
color: #FFF;
}
/* MAIN NAVIGATION ENDS */
......@@ -393,7 +395,9 @@ tr.required th {
padding: 0;
margin: 0 5px;
}
#subnav li.selected a {
#subnav li.selected a:link,
#subnav li.selected a:visited,
#subnav li.selected a:active {
color: #98bf10;
}
/* SUB NAVIGATION ENDS */
......@@ -941,6 +945,14 @@ table#installer {
font-weight: bold;
padding: 5px 20px 6px 45px;
}
.maincontent #profilegotoresume {
background: url(../images/btn_editprofileicons.gif) no-repeat;
width: 170px;
height: 24px;
color: #eef7d4;
font-weight: bold;
padding: 5px 20px 6px 35px;
}
.maincontent #backtoeditprofile {
background: url(../images/btn_editprofileicons.gif) no-repeat;
width: 170px;
......
......@@ -3,14 +3,16 @@
{include file="columnfullstart.tpl"}
<div class="searchform">
<h2>{str tag="search"}</h2>
<form action="" method="get" onsubmit="doSearch(); return false;">
<label>Query:
<input type="text" name="search_query" id="search_query">
<input type="text" name="search_query" id="search_query" value="{$search_query_value|escape}">
</label>
<select id="search_type">
<option value="user">{str tag=users}</option>
<option value="community">{str tag=communities}</option>
</select>
<button type="button" onclick="doSearch();">{str tag="go"}</button>
<input type="submit" class="submit" value="{str tag='go'}">
</form>
</div>
<div id="seachresults">
<h3>{str tag="results"}</h3>
......
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