Example #1
0
        //	} else {
        //		$AppUI->setMsg( 'deleted', UI_MSG_OK, true );
        //		$hditem->log_status(17);
        //		$AppUI->redirect('m=helpdesk&a=list');
        //	}
        //if ($del) {
        //	if (($msg = $hditem->delete())) {
        //		$AppUI->setMsg( $msg, UI_MSG_ERROR );
        //	} else {
        $hditem->delete();
        $AppUI->setMsg('deleted', UI_MSG_OK, true);
        $hditem->log_status(17);
        $AppUI->redirect('m=helpdesk&a=list');
        //	}
    } else {
        $status_log_id = $hditem->log_status_changes();
        if ($msg = $hditem->store()) {
            $AppUI->setMsg($msg, UI_MSG_ERROR);
        } else {
            if ($new_item) {
                $status_log_id = $hditem->log_status(0, $AppUI->_('Created'));
            }
            doWatchers(dPgetParam($_POST, 'watchers', 0), $hditem);
            $AppUI->setMsg($new_item ? $AppUI->_('Help Desk Item') . ' ' . $AppUI->_('added') : $AppUI->_('Help Desk Item') . ' ' . $AppUI->_('updated'), UI_MSG_OK, true);
            $AppUI->redirect('m=helpdesk&a=view&item_id=' . $hditem->item_id);
        }
    }
}
function doWatchers($list, $hditem)
{
    global $AppUI;