Merged in cochalo/processmaker (pull request #470)

Correcion de validacion en PROJECTS
This commit is contained in:
Erik Amaru Ortiz
2014-05-07 17:00:11 -04:00
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.");
}