function editBannerClient($clientid, $option)
{
    global $database, $my;
    $row = new mosBannerClient($database);
    $row->load((int) $clientid);
    // fail if checked out not by 'me'
    if ($row->checked_out && $row->checked_out != $my->id) {
        $msg = 'O Cliente [ ' . $row->name . ' ] está, sendo editado atualmente por outra pessoa.';
        mosRedirect('index2.php?option=' . $option . '&task=listclients', $msg);
    }
    if ($clientid) {
        // do stuff for existing record
        $row->checkout($my->id);
    } else {
        // do stuff for new record
        $row->published = 0;
        $row->approved = 0;
    }
    HTML_bannerClient::bannerClientForm($row, $option);
}
Esempio n. 2
0
function editBannerClient($clientid, $option)
{
    global $database, $my;
    $row = new mosBannerClient($database);
    $row->load($clientid);
    // fail if checked out not by 'me'
    if ($row->checked_out && $row->checked_out != $my->id) {
        $msg = sprintf(T_('The client [ %s ] is currently being edited by another person.'), $row->name);
        mosRedirect('index2.php?option=' . $option . '&task=listclients', $msg);
    }
    if ($clientid) {
        // do stuff for existing record
        $row->checkout($my->id);
    } else {
        // do stuff for new record
        $row->published = 0;
        $row->approved = 0;
    }
    HTML_bannerClient::bannerClientForm($row, $option);
}
Esempio n. 3
0
function editBannerClient($clientid, $option)
{
    global $database, $my, $adminLanguage;
    $row = new mosBannerClient($database);
    $row->load($clientid);
    // fail if checked out not by 'me'
    if ($row->checked_out && $row->checked_out != $my->id) {
        mosRedirect("index2.php?option={$option}&task=listclients", $adminLanguage->A_COMP_BANNERS_COMP . " " . $row->title . " " . $adminLanguage->A_COMP_BANNERS_EDITED);
    }
    if ($clientid) {
        // do stuff for existing record
        $row->checkout($my->id);
    } else {
        // do stuff for new record
        $row->published = 0;
        $row->approved = 0;
    }
    HTML_bannerClient::bannerClientForm($row, $option);
}