Example #1
0
if (isset($_REQUEST['email_id'])) {
    $sugarbean->email_id = $_REQUEST['email_id'];
}
if (!$sugarbean->ACLAccess('Save')) {
    ACLController::displayNoAccess(true);
    sugar_cleanup(true);
}
if (!isset($sugarbean->name) || is_null($sugarbean->name)) {
    $sugarbean->name = $sugarbean->generateName($sugarbean->id);
}
$sugarbean->save($GLOBALS['check_notify']);
$return_id = $sugarbean->id;
$pressLine1 = new Pressline();
$pressLine1->mark_deletedByPressid($return_id);
$count = count($_POST);
$keys = array_keys($_POST);
for ($i = 0; $i < $count; $i++) {
    if (substr_count($keys[$i], "layout_id_") > 0) {
        $index = substr($keys[$i], -1, 1);
        $layout_id = $_POST["layout_id_" . $index];
        $layout_name = $_POST["layout_name_" . $index];
        $part = $_POST["part_" . $index];
        $pressLine = new Pressline();
        $pressLine->layout_id = $layout_id;
        $pressLine->layout_name = $layout_name;
        $pressLine->part = $part;
        $pressLine->press_id = $sugarbean->id;
        $pressLine->save();
    }
}
handleRedirect($return_id, 'Press');