Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
afd2ccb8
Commit
afd2ccb8
authored
Jan 25, 2008
by
Clare Lenihan
Committed by
Clare Lenihan
Jan 29, 2008
Browse files
changing mainform in resume to be four separate forms
parent
f5c76c85
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/resume/index.php
View file @
afd2ccb8
...
...
@@ -63,8 +63,8 @@ catch (Exception $e) { }
$contactinformation_value
=
$contactinformation
->
render_self
(
array
(
'editing'
=>
true
));
$contactinformation_value
=
$contactinformation_value
[
'html'
];
$form
=
array
(
'name'
=>
'
resumemainform
'
,
$
coverletter
form
=
array
(
'name'
=>
'
coverletter
'
,
'jsform'
=>
true
,
'plugintype'
=>
'artefact'
,
'pluginname'
=>
'account'
,
...
...
@@ -86,8 +86,25 @@ $form = array(
'defaultvalue'
=>
((
!
empty
(
$coverletter
))
?
$coverletter
->
get
(
'description'
)
:
null
),
'help'
=>
true
,
),
'save'
=>
array
(
'type'
=>
'submit'
,
'value'
=>
get_string
(
'save'
),
),
)
),
)
)
);
$interestsform
=
array
(
'name'
=>
'interests'
,
'jsform'
=>
true
,
'plugintype'
=>
'artefact'
,
'pluginname'
=>
'account'
,
'plugintype'
=>
'artefact'
,
'pluginname'
=>
'resume'
,
'jsform'
=>
true
,
'method'
=>
'post'
,
'elements'
=>
array
(
'interestsfs'
=>
array
(
'type'
=>
'fieldset'
,
'legend'
=>
get_string
(
'interest'
,
'artefact.resume'
),
...
...
@@ -101,8 +118,25 @@ $form = array(
'rows'
=>
10
,
'help'
=>
true
,
),
),
),
'save'
=>
array
(
'type'
=>
'submit'
,
'value'
=>
get_string
(
'save'
),
),
)
)
)
);
$contactinformationform
=
array
(
'name'
=>
'contactinformation'
,
'jsform'
=>
true
,
'plugintype'
=>
'artefact'
,
'pluginname'
=>
'account'
,
'plugintype'
=>
'artefact'
,
'pluginname'
=>
'resume'
,
'jsform'
=>
true
,
'method'
=>
'post'
,
'elements'
=>
array
(
'contactinformationfs'
=>
array
(
'type'
=>
'fieldset'
,
'legend'
=>
get_string
(
'contactinformation'
,
'artefact.resume'
),
...
...
@@ -114,8 +148,21 @@ $form = array(
'value'
=>
$contactinformation_value
,
'help'
=>
true
,
),
),
),
)
)
)
);
$personalinformationform
=
array
(
'name'
=>
'personalinformation'
,
'jsform'
=>
true
,
'plugintype'
=>
'artefact'
,
'pluginname'
=>
'account'
,
'plugintype'
=>
'artefact'
,
'pluginname'
=>
'resume'
,
'jsform'
=>
true
,
'method'
=>
'post'
,
'elements'
=>
array
(
'personalinformation'
=>
array
(
'type'
=>
'fieldset'
,
'legend'
=>
get_string
(
'personalinformation'
,
'artefact.resume'
),
...
...
@@ -168,12 +215,12 @@ $form = array(
?
$personalinformation
->
get_composite
(
'maritalstatus'
)
:
null
),
'title'
=>
get_string
(
'maritalstatus'
,
'artefact.resume'
),
),
),
)
,
'
sav
e'
=>
array
(
'type'
=>
'submit'
,
'value'
=>
get_string
(
'save'
),
)
,
'save'
=>
array
(
'type'
=>
'submit'
,
'
valu
e'
=>
get_string
(
'save'
),
)
,
)
)
)
);
...
...
@@ -189,10 +236,13 @@ $downstr = get_string('movedown', 'artefact.resume');
$wwwroot
=
get_config
(
'wwwroot'
);
$mainform
=
pieform
(
$form
);
$smarty
=
smarty
(
array
(
'tablerenderer'
));
$smarty
=
smarty
(
array
(
'tablerenderer'
),
pieform_element_calendar_get_headdata
(
pieform_element_calendar_configure
(
array
())));
$smarty
->
assign
(
'coverletterform'
,
pieform
(
$coverletterform
));
$smarty
->
assign
(
'interestsform'
,
pieform
(
$interestsform
));
$smarty
->
assign
(
'contactinformationform'
,
pieform
(
$contactinformationform
));
$smarty
->
assign
(
'personalinformationform'
,
pieform
(
$personalinformationform
));
$smarty
->
assign
(
'mainform'
,
$mainform
);
$inlinejs
=
<<<EOF
var tableRenderers = {};
...
...
@@ -325,7 +375,7 @@ $smarty->assign('compositeforms', $compositeforms);
$smarty
->
assign
(
'INLINEJAVASCRIPT'
,
$inlinejs
);
$smarty
->
display
(
'artefact:resume:index.tpl'
);
function
resumemainform
_submit
(
Pieform
$form
,
$values
)
{
function
coverletter
_submit
(
Pieform
$form
,
$values
)
{
global
$coverletter
,
$personalinformation
,
$interest
,
$USER
;
$userid
=
$USER
->
get
(
'id'
);
...
...
@@ -350,7 +400,24 @@ function resumemainform_submit(Pieform $form, $values) {
catch
(
Exception
$e
)
{
$errors
[
'coverletter'
]
=
true
;
}
if
(
empty
(
$errors
))
{
$form
->
json_reply
(
PIEFORM_OK
,
get_string
(
'resumesaved'
,
'artefact.resume'
));
}
else
{
$message
=
''
;
foreach
(
array_keys
(
$errors
)
as
$key
)
{
$message
.
=
get_string
(
'resumesavefailed'
,
'artefact.resume'
)
.
"
\n
"
;
}
$form
->
json_reply
(
PIEFORM_ERR
,
$message
);
}
}
function
interests_submit
(
Pieform
$form
,
$values
)
{
global
$coverletter
,
$personalinformation
,
$interest
,
$USER
;
$userid
=
$USER
->
get
(
'id'
);
$errors
=
array
();
try
{
if
(
empty
(
$interest
)
&&
!
empty
(
$values
[
'interest'
]))
{
$interest
=
new
ArtefactTypeInterest
(
0
,
array
(
...
...
@@ -371,6 +438,23 @@ function resumemainform_submit(Pieform $form, $values) {
$errors
[
'interest'
]
=
true
;
}
if
(
empty
(
$errors
))
{
$form
->
json_reply
(
PIEFORM_OK
,
get_string
(
'resumesaved'
,
'artefact.resume'
));
}
else
{
$message
=
''
;
foreach
(
array_keys
(
$errors
)
as
$key
)
{
$message
.
=
get_string
(
'resumesavefailed'
,
'artefact.resume'
)
.
"
\n
"
;
}
$form
->
json_reply
(
PIEFORM_ERR
,
$message
);
}
}
function
personalinformation_submit
(
Pieform
$form
,
$values
)
{
global
$personalinformation
,
$USER
;
$userid
=
$USER
->
get
(
'id'
);
$errors
=
array
();
try
{
if
(
empty
(
$personalinformation
))
{
$personalinformation
=
new
ArtefactTypePersonalinformation
(
0
,
array
(
...
...
@@ -389,7 +473,7 @@ function resumemainform_submit(Pieform $form, $values) {
if
(
empty
(
$errors
))
{
$form
->
json_reply
(
PIEFORM_OK
,
get_string
(
'resumesaved'
,
'artefact.resume'
));
}
}
else
{
$message
=
''
;
foreach
(
array_keys
(
$errors
)
as
$key
)
{
...
...
htdocs/artefact/resume/theme/default/index.tpl
View file @
afd2ccb8
...
...
@@ -5,7 +5,10 @@
</div>
{
include
file
=
"columnleftstart.tpl"
}
<h3>
{
str
tag
=
'myresume'
section
=
'artefact.resume'
}
</h3>
{
$mainform
}
{
$coverletterform
}
{
$interestsform
}
{
$contactinformationform
}
{
$personalinformationform
}
{
include
file
=
"artefact:resume:fragments/employmenthistory.tpl"
controls
=
"true"
}
{
include
file
=
"artefact:resume:fragments/educationhistory.tpl"
controls
=
"true"
}
{
include
file
=
"artefact:resume:fragments/certification.tpl"
controls
=
"true"
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment