Exemplo n.º 1
0
 function setURL($url = '', $vars = '')
 {
     if ($url) {
         if (strpos($url, '?') === false) {
             $url .= '?';
         }
     } else {
         $url = THISPAGE . '?';
     }
     if ($vars && is_array($vars)) {
         $vars = Http::build_query($vars);
     }
     $this->url = $url . $vars;
 }
Exemplo n.º 2
0
 function __call($name, $args)
 {
     global $cfg;
     $rv = null;
     if ($this->user && is_callable(array($this->user, $name))) {
         $rv = $args ? call_user_func_array(array($this->user, $name), $args) : call_user_func(array($this->user, $name));
     }
     if ($rv) {
         return $rv;
     }
     $tag = substr($name, 3);
     switch (strtolower($tag)) {
         case 'ticket_link':
             return sprintf('%s/view.php?%s', $cfg->getBaseUrl(), Http::build_query(array('auth' => $this->getAuthToken()), false));
             break;
     }
     return false;
 }
Exemplo n.º 3
0
if($api && $_REQUEST['a']!='add'){
    $title=__('Update API Key');
    $action='update';
    $submit_text=__('Save Changes');
    $info=$api->getHashtable();
    $qs += array('id' => $api->getId());
}else {
    $title=__('Add New API Key');
    $action='add';
    $submit_text=__('Add Key');
    $info['isactive']=isset($info['isactive'])?$info['isactive']:1;
    $qs += array('a' => $_REQUEST['a']);
}
$info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
?>
<form action="apikeys.php?<?php echo Http::build_query($qs); ?>" method="post" id="save">
 <?php csrf_token(); ?>
 <input type="hidden" name="do" value="<?php echo $action; ?>">
 <input type="hidden" name="a" value="<?php echo Format::htmlchars($_REQUEST['a']); ?>">
 <input type="hidden" name="id" value="<?php echo $info['id']; ?>">
 <h2><?php echo __('API Key');?>
    <i class="help-tip icon-question-sign" href="#api_key"></i>
    </h2>
 <table class="form_table" width="940" border="0" cellspacing="0" cellpadding="2">
    <thead>
        <tr>
            <th colspan="2">
                <h4><?php echo $title; ?></h4>
                <em><?php echo __('API Key is auto-generated. Delete and re-add to change the key.');?></em>
            </th>
        </tr>
Exemplo n.º 4
0
            <a id="selectToggle" href="#ckb"><?php echo __('Toggle');?></a>&nbsp;&nbsp;
            <?php }else{
                echo '<i>';
                echo $ferror?Format::htmlchars($ferror):__('Query returned 0 results.');
                echo '</i>';
            } ?>
        </td>
     </tr>
    </tfoot>
    </table>
    <?php
    if ($num>0) { //if we actually had any tickets returned.
        echo '<div>&nbsp;'.__('Page').':'.$pageNav->getPageLinks().'&nbsp;';
        echo sprintf('<a class="export-csv no-pjax" href="?%s">%s</a>',
                Http::build_query(array(
                        'a' => 'export', 'h' => $hash,
                        'status' => $_REQUEST['status'])),
                __('Export'));
        echo '&nbsp;<i class="help-tip icon-question-sign" href="#export"></i></div>';
    } ?>
    </form>
</div>

<div style="display:none;" class="dialog" id="confirm-action">
    <h3><?php echo __('Please Confirm');?></h3>
    <a class="close" href=""><i class="icon-remove-circle"></i></a>
    <hr/>
    <p class="confirm-action" style="display:none;" id="mark_overdue-confirm">
        <?php echo __('Are you sure you want to flag the selected tickets as <font color="red"><b>overdue</b></font>?');?>
    </p>
    <div><?php echo __('Please confirm to continue.');?></div>
Exemplo n.º 5
0
    $action='update';
    $submit_text=__('Save Changes');
    $info=$template->getInfo();
    $info['tpl_id']=$template->getId();
    $qs += array('tpl_id' => $template->getId());
}else {
    $title=__('Add New Template');
    $action='add';
    $submit_text=__('Add Template');
    $info['isactive']=isset($info['isactive'])?$info['isactive']:0;
    $info['lang_id'] = $cfg->getSystemLanguage();
    $qs += array('a' => $_REQUEST['a']);
}
$info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
?>
<form action="templates.php?<?php echo Http::build_query($qs); ?>" method="post" id="save">
 <?php csrf_token(); ?>
 <input type="hidden" name="do" value="<?php echo $action; ?>">
 <input type="hidden" name="a" value="<?php echo Format::htmlchars($_REQUEST['a']); ?>">
 <input type="hidden" name="tpl_id" value="<?php echo $info['tpl_id']; ?>">
 <h2><?php echo __('Email Template');?></h2>
 <table class="form_table" width="940" border="0" cellspacing="0" cellpadding="2">
    <thead>
        <tr>
            <th colspan="2">
                <h4><?php echo $title; ?></h4>
                <em><?php echo __('Template information');?></em>
            </th>
        </tr>
    </thead>
    <tbody>
Exemplo n.º 6
0
    $action='update';
    $submit_text=__('Update');
    $info=$rule->getInfo();
    $info['id']=$rule->getId();
    $qs += array('id' => $rule->getId());
}else {
    $title=__('Add New Email Address to Ban List');
    $action='add';
    $submit_text=__('Add');
    $info['isactive']=isset($info['isactive'])?$info['isactive']:1;
    $qs += array('a' => $_REQUEST['a']);
}

$info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
?>
<form action="banlist.php?<?php echo Http::build_query($qs); ?>" method="post" id="save">
 <?php csrf_token(); ?>
 <input type="hidden" name="do" value="<?php echo $action; ?>">
 <input type="hidden" name="a" value="<?php echo Format::htmlchars($_REQUEST['a']); ?>">
 <input type="hidden" name="id" value="<?php echo $info['id']; ?>">
 <h2><?php echo __('Manage Email Ban Rule');?>
    <i class="help-tip icon-question-sign" href="#ban_list"></i>
    </h2>
 <table class="form_table" width="940" border="0" cellspacing="0" cellpadding="2">
    <thead>
        <tr>
            <th colspan="2">
                <h4><?php echo $title; ?></h4>
                <em><?php echo __('Valid email address required');?></em>
            </th>
        </tr>
    <span style="color:lightgray">|</span>
    <?php 
    }
}
if ($closedTickets) {
    ?>
    &nbsp;
    <i class="icon-file-text"></i>
    <a class="state <?php 
    if ($status == 'closed') {
        echo 'active';
    }
    ?>
"
        href="?<?php 
    echo Http::build_query(array('a' => 'search', 'status' => 'closed'));
    ?>
">
    <?php 
    echo __('Closed');
    if ($closedTickets > 0) {
        echo sprintf(' (%d)', $closedTickets);
    }
    ?>
    </a>
<?php 
}
?>
    </small>
</div>
</h1>
Exemplo n.º 8
0
    $info=$topic->getInfo();
    $info['id']=$topic->getId();
    $info['pid']=$topic->getPid();
    $qs += array('id' => $topic->getId());
} else {
    $title=__('Add New Help Topic');
    $action='create';
    $submit_text=__('Add Topic');
    $info['isactive']=isset($info['isactive'])?$info['isactive']:1;
    $info['ispublic']=isset($info['ispublic'])?$info['ispublic']:1;
    $info['form_id'] = Topic::FORM_USE_PARENT;
    $qs += array('a' => $_REQUEST['a']);
}
$info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
?>
<form action="helptopics.php?<?php echo Http::build_query($qs); ?>" method="post" id="save">
 <?php csrf_token(); ?>
 <input type="hidden" name="do" value="<?php echo $action; ?>">
 <input type="hidden" name="a" value="<?php echo Format::htmlchars($_REQUEST['a']); ?>">
 <input type="hidden" name="id" value="<?php echo $info['id']; ?>">
 <h2><?php echo __('Help Topic');?></h2>
 <table class="form_table" width="940" border="0" cellspacing="0" cellpadding="2">
    <thead>
        <tr>
            <th colspan="2">
                <h4><?php echo $title; ?></h4>
                <em><?php echo __('Help Topic Information');?>
                &nbsp;<i class="help-tip icon-question-sign" href="#help_topic_information"></i></em>
            </th>
        </tr>
    </thead>
Exemplo n.º 9
0
    if (!($page = $config->hasCustomConfig())) {
        if ($config)
            $form = $config->getForm();
        if ($form && $_POST)
            $form->isValid();
    }
    $title = __('Update Plugin');
    $action = 'update';
    $submit_text = __('Save Changes');
    $info = $plugin->ht;
}

$info = Format::htmlchars(($errors && $_POST) ? $_POST : $info);
?>

<form action="?<?php echo Http::build_query(array('id' => $_REQUEST['id'])); ?>" method="post" id="save">
    <?php csrf_token(); ?>
    <input type="hidden" name="do" value="<?php echo $action; ?>">
    <input type="hidden" name="id" value="<?php echo $info['id']; ?>">
    <h2><?php echo __('Manage Plugin'); ?>
        <br/><small><?php echo $plugin->getName(); ?></small></h2>

    <h3><?php echo __('Configuration'); ?></h3>
<?php
if ($page)
    $config->renderCustomConfig();
elseif ($form) { ?>
    <table class="form_table" width="940" border="0" cellspacing="0" cellpadding="2">
    <tbody>
<?php $form->render(); ?>
    </tbody></table>
Exemplo n.º 10
0
    $qs += array('id' => $dept->getId());
} else {
    $title=__('Add New Department');
    $action='create';
    $submit_text=__('Create Dept');
    $info['ispublic']=isset($info['ispublic'])?$info['ispublic']:1;
    $info['ticket_auto_response']=isset($info['ticket_auto_response'])?$info['ticket_auto_response']:1;
    $info['message_auto_response']=isset($info['message_auto_response'])?$info['message_auto_response']:1;
    if (!isset($info['group_membership']))
        $info['group_membership'] = 1;

    $qs += array('a' => $_REQUEST['a']);
}
$info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
?>
<form action="departments.php?<?php echo Http::build_query($qs); ?>" method="post" id="save">
 <?php csrf_token(); ?>
 <input type="hidden" name="do" value="<?php echo $action; ?>">
 <input type="hidden" name="a" value="<?php echo Format::htmlchars($_REQUEST['a']); ?>">
 <input type="hidden" name="id" value="<?php echo $info['id']; ?>">
 <h2><?php echo __('Department');?></h2>
 <table class="form_table" width="940" border="0" cellspacing="0" cellpadding="2">
    <thead>
        <tr>
            <th colspan="2">
                <h4><?php echo $title; ?></h4>
                <em><?php echo __('Department Information');?></em>
            </th>
        </tr>
    </thead>
    <tbody>
Exemplo n.º 11
0
    $info['id']=$canned->getId();
    $qs += array('id' => $canned->getId());
    // Replace cid: scheme with downloadable URL for inline images
    $info['response'] = $canned->getResponseWithImages();
    $info['notes'] = Format::viewableImages($info['notes']);
}else {
    $title=__('Add New Canned Response');
    $action='create';
    $submit_text=__('Add Response');
    $info['isenabled']=isset($info['isenabled'])?$info['isenabled']:1;
    $qs += array('a' => $_REQUEST['a']);
}
$info=Format::htmlchars(($errors && $_POST)?$_POST:$info);

?>
<form action="canned.php?<?php echo Http::build_query($qs); ?>" method="post" id="save" enctype="multipart/form-data">
 <?php csrf_token(); ?>
 <input type="hidden" name="do" value="<?php echo $action; ?>">
 <input type="hidden" name="a" value="<?php echo Format::htmlchars($_REQUEST['a']); ?>">
 <input type="hidden" name="id" value="<?php echo $info['id']; ?>">
 <h2><?php echo __('Canned Response')?>
 &nbsp;<i class="help-tip icon-question-sign" href="#canned_response"></i></h2>
 <table class="form_table fixed" width="940" border="0" cellspacing="0" cellpadding="2">
    <thead>
        <tr><td></td><td></td></tr> <!-- For fixed table layout -->
        <tr>
            <th colspan="2">
                <h4><?php echo $title; ?></h4>
                <em><?php echo __('Canned response settings');?></em>
            </th>
        </tr>
Exemplo n.º 12
0
    $submit_text=__('Save Changes');
    $info=$group->getInfo();
    $info['id']=$group->getId();
    $info['depts']=$group->getDepartments();
    $qs += array('id' => $group->getId());
}else {
    $title=__('Add New Group');
    $action='create';
    $submit_text=__('Create Group');
    $info['isactive']=isset($info['isactive'])?$info['isactive']:1;
    $info['can_create_tickets']=isset($info['can_create_tickets'])?$info['can_create_tickets']:1;
    $qs += array('a' => $_REQUEST['a']);
}
$info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
?>
<form action="groups.php?<?php echo Http::build_query($qs); ?>" method="post" id="save" name="group">
 <?php csrf_token(); ?>
 <input type="hidden" name="do" value="<?php echo $action; ?>">
 <input type="hidden" name="a" value="<?php echo Format::htmlchars($_REQUEST['a']); ?>">
 <input type="hidden" name="id" value="<?php echo $info['id']; ?>">
 <h2><?php echo __('Group Access and Permissions');?></h2>
 <table class="form_table" width="940" border="0" cellspacing="0" cellpadding="2">
    <thead>
        <tr>
            <th colspan="2">
                <h4><?php echo $title; ?></h4>
                <em><strong><?php echo __('Group Information');?></strong>: <?php echo __("Disabled group will limit agents' access. Admins are exempted.");?></em>
            </th>
        </tr>
    </thead>
    <tbody>
            <?php 
} else {
    echo '<i>';
    echo $ferror ? Format::htmlchars($ferror) : __('Query returned 0 results.');
    echo '</i>';
}
?>
        </td>
     </tr>
    </tfoot>
    </table>
    <?php 
if ($num > 0) {
    //if we actually had any tickets returned.
    echo '<div>&nbsp;' . __('Page') . ':' . $pageNav->getPageLinks() . '&nbsp;';
    echo sprintf('<a class="export-csv no-pjax" href="?%s">%s</a>', Http::build_query(array('a' => 'export', 'h' => $hash, 'status' => $_REQUEST['status'])), __('Export'));
    echo '&nbsp;<i class="help-tip icon-question-sign" href="#export"></i></div>';
}
?>
    </form>
</div>

<div style="display:none;" class="dialog" id="confirm-action">
    <h3><?php 
echo __('Please Confirm');
?>
</h3>
    <a class="close" href=""><i class="icon-remove-circle"></i></a>
    <hr/>
    <p class="confirm-action" style="display:none;" id="mark_overdue-confirm">
        <?php 
Exemplo n.º 14
0
            $form = $config->getForm();
        }
        if ($form && $_POST) {
            $form->isValid();
        }
    }
    $title = __('Update Plugin');
    $action = 'update';
    $submit_text = __('Save Changes');
    $info = $plugin->ht;
}
$info = Format::htmlchars($errors && $_POST ? $_POST : $info);
?>

<form action="?<?php 
echo Http::build_query(array('id' => $_REQUEST['id']));
?>
" method="post" id="save">
    <?php 
csrf_token();
?>
    <input type="hidden" name="do" value="<?php 
echo $action;
?>
">
    <input type="hidden" name="id" value="<?php 
echo $info['id'];
?>
">
    <h2><?php 
echo __('Manage Plugin');
Exemplo n.º 15
0
}
$order_column = $order_column ? $order_column : 'canned.title';
if ($_REQUEST['order'] && $orderWays[strtoupper($_REQUEST['order'])]) {
    $order = $orderWays[strtoupper($_REQUEST['order'])];
}
$order = $order ? $order : 'ASC';
if ($order_column && strpos($order_column, ',')) {
    $order_column = str_replace(',', " {$order},", $order_column);
}
$x = $sort . '_sort';
${$x} = ' class="' . strtolower($order) . '" ';
$order_by = "{$order_column} {$order} ";
$total = db_count('SELECT count(*) FROM ' . CANNED_TABLE . ' canned ');
$page = $_GET['p'] && is_numeric($_GET['p']) ? $_GET['p'] : 1;
$pageNav = new Pagenate($total, $page, PAGE_LIMIT);
$qstr = '&amp;' . Http::build_query($qs);
$qs += array('sort' => $_REQUEST['sort'], 'order' => $_REQUEST['order']);
$pageNav->setURL('canned.php', $qs);
//Ok..lets roll...create the actual query
$qstr .= '&order=' . ($order == 'DESC' ? 'ASC' : 'DESC');
$query = "{$sql} GROUP BY canned.canned_id ORDER BY {$order_by} LIMIT " . $pageNav->getStart() . "," . $pageNav->getLimit();
$res = db_query($query);
if ($res && ($num = db_num_rows($res))) {
    $showing = $pageNav->showing() . ' ' . _N('premade response', 'premade responses', $total);
} else {
    $showing = __('No premade responses found!');
}
?>
<div class="pull-left" style="width:700px;padding-top:5px;">
 <h2><?php 
echo __('Canned Responses');
Exemplo n.º 16
0
    $info['topics'] = $faq->getHelpTopicsIds();
    $info['answer'] = Format::viewableImages($faq->getAnswer());
    $info['notes'] = Format::viewableImages($faq->getNotes());
    $qs += array('id' => $faq->getId());
} else {
    $title = __('Add New FAQ');
    $action = 'create';
    $submit_text = __('Add FAQ');
    if ($category) {
        $qs += array('cid' => $category->getId());
        $info['category_id'] = $category->getId();
    }
}
//TODO: Add attachment support.
$info = Format::htmlchars($errors && $_POST ? $_POST : $info);
$qstr = Http::build_query($qs);
?>
<form action="faq.php?<?php 
echo $qstr;
?>
" method="post" id="save" enctype="multipart/form-data">
 <?php 
csrf_token();
?>
 <input type="hidden" name="do" value="<?php 
echo $action;
?>
">
 <input type="hidden" name="a" value="<?php 
echo Format::htmlchars($_REQUEST['a']);
?>
Exemplo n.º 17
0
    if (!$info['mail_fetchmax']) {
        $info['mail_fetchmax'] = 10;
    }
    if (!isset($info['smtp_auth'])) {
        $info['smtp_auth'] = 1;
    }
    $qs += array('a' => $_REQUEST['a']);
}
$info = Format::htmlchars($errors && $_POST ? $_POST : $info);
?>
<h2><?php 
echo __('Email Address');
?>
</h2>
<form action="emails.php?<?php 
echo Http::build_query($qs);
?>
" method="post" id="save">
 <?php 
csrf_token();
?>
 <input type="hidden" name="do" value="<?php 
echo $action;
?>
">
 <input type="hidden" name="a" value="<?php 
echo Format::htmlchars($_REQUEST['a']);
?>
">
 <input type="hidden" name="id" value="<?php 
echo $info['id'];
Exemplo n.º 18
0
    $action='create';
    $submit_text=__('Add Agent');
    $passwd_text=__('Temporary password required only for "Local" authentication');
    //Some defaults for new staff.
    $info['change_passwd']=1;
    $info['welcome_email']=1;
    $info['isactive']=1;
    $info['isvisible']=1;
    $info['isadmin']=0;
    $info['timezone_id'] = $cfg->getDefaultTimezoneId();
    $info['daylight_saving'] = $cfg->observeDaylightSaving();
    $qs += array('a' => 'add');
}
$info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
?>
<form action="staff.php?<?php echo Http::build_query($qs); ?>" method="post" id="save" autocomplete="off">
 <?php csrf_token(); ?>
 <input type="hidden" name="do" value="<?php echo $action; ?>">
 <input type="hidden" name="a" value="<?php echo Format::htmlchars($_REQUEST['a']); ?>">
 <input type="hidden" name="id" value="<?php echo $info['id']; ?>">
 <h2><?php echo __('Agent Account');?></h2>
 <table class="form_table" width="940" border="0" cellspacing="0" cellpadding="2">
    <thead>
        <tr>
            <th colspan="2">
                <h4><?php echo $title; ?></h4>
                <em><strong><?php echo __('User Information');?></strong></em>
            </th>
        </tr>
    </thead>
    <tbody>