Correcion de validacion en PROJECTS

This commit is contained in:
Brayan Osmar Pereyra Suxo
2014-05-07 16:49:58 -04:00
parent 11251d1123
commit 3820428622
2 changed files with 5 additions and 2 deletions

View File

@@ -493,6 +493,10 @@ class BpmnWorkflow extends Project\Bpmn
public static function createFromStruct(array $projectData, $generateUid = true)
{
$projectData["prj_name"] = trim($projectData["prj_name"]);
if ($projectData["prj_name"] == '') {
throw new \Exception("`prj_name` is required but it is empty.");
}
if (\Process::existsByProTitle($projectData["prj_name"])) {
throw new \Exception("Project with name: {$projectData["prj_name"]}, already exists.");
}