Exemplo n.º 1
0
function saveAgentNumberPattern($agentnumberpatternid = NULL)
{
    global $clientRoot;
    $result = "";
    $am = new AgentManager();
    if ($am->isAgentEditor()) {
        if (strlen($agentnumberpatternid) == 0) {
            $toSave = new agentnumberpattern();
            $toSave = $am->getAndChangeAgentNumberPatternFromRequest($agentnumberpatternid);
        } else {
            $toSave = $am->getAndChangeAgentNumberPatternFromRequest($agentnumberpatternid);
        }
        if ($toSave != null) {
            $result = $am->saveNewAgentNumberPattern($toSave);
        } else {
            $result = "Error in saving agent number pattern record.";
        }
    } else {
        $result = "You aren't authorized to edit agent records.";
    }
    return $result;
}