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
de49a95f
Commit
de49a95f
authored
Mar 21, 2010
by
Penny Leach
Browse files
leap2a: improved the detection of reimporting contactinformation artefacts
Signed-off-by:
Penny Leach
<
penny@mjollnir.org
>
parent
aca3ae41
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/resume/lib.php
View file @
de49a95f
...
@@ -212,20 +212,15 @@ class ArtefactTypeContactinformation extends ArtefactTypeResume {
...
@@ -212,20 +212,15 @@ class ArtefactTypeContactinformation extends ArtefactTypeResume {
}
}
public
static
function
setup_new
(
$userid
)
{
public
static
function
setup_new
(
$userid
)
{
$code
=
get_random_key
(
10
,
range
(
0
,
9
));
try
{
try
{
$existing
=
artefact_instance_from_type
(
'contactinformation'
,
$userid
);
return
artefact_instance_from_type
(
'contactinformation'
,
$userid
);
throw
new
ParamOutOfRangeException
(
"Cannot create a new Contactinformation artefact for
$userid
- they already have one!"
,
$code
);
}
catch
(
ArtefactNotFoundException
$e
)
{
}
catch
(
Exception
$e
)
{
$artefact
=
new
ArtefactTypeContactinformation
(
null
,
array
(
if
(
$e
->
getCode
()
==
$code
)
{
// it is the exception we *just* threw
'owner'
=>
$userid
,
throw
$e
;
'title'
=>
get_string
(
'contactinformation'
,
'artefact.resume'
)
}
));
$artefact
->
commit
();
}
}
$artefact
=
new
ArtefactTypeContactinformation
(
null
,
array
(
'owner'
=>
$userid
,
'title'
=>
get_string
(
'contactinformation'
,
'artefact.resume'
)
));
$artefact
->
commit
();
return
$artefact
;
return
$artefact
;
}
}
...
...
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