Ejemplo n.º 1
0
function show_import_form()
{
    lcm_page_start(_T('title_archives'), '', '', 'archives_import');
    global $tabs;
    show_tabs_links($tabs, 1);
    lcm_bubble('archive_restore');
    // Show the errors (if any)
    echo show_all_errors($_SESSION['errors']);
    // Upload backup form
    echo '<form enctype="multipart/form-data" action="import_db.php" method="post">' . "\n";
    echo '<input type="hidden" name="action" value="upload_file" />' . "\n";
    echo '<input type="hidden" name="MAX_FILE_SIZE" value="5000000" />' . "\n";
    echo "<fieldset class='info_box'>\n";
    show_page_subtitle(_T('archives_subtitle_upload'), 'archives_import', 'newrestore');
    echo '<p class="normal_text">' . _T('archives_info_how_to_upload') . "</p>\n";
    echo '<p class="normal_text">' . _Ti('file_input_name');
    echo '<input type="file" name="filename" size="40" value="" /> ';
    echo '<input type="submit" name="submit" id="btn_upload" value="' . _T('button_validate') . '" class="search_form_btn" />';
    echo "</p>\n";
    echo "</fieldset>\n";
    echo "</form>\n";
    // Restore backup form
    echo '<form action="import_db.php" method="post">' . "\n";
    echo '<input type="hidden" name="action" value="import" />' . "\n";
    echo "<fieldset class='info_box'>\n";
    show_page_subtitle(_T('archives_subtitle_restore'), 'archives_import', 'delrestore');
    echo "<strong>" . _Ti('archives_input_select_backup') . "</strong><br />";
    echo "<select name='file' class='sel_frm'>\n";
    lcm_debug("opendir: " . DIR_BACKUPS);
    $storage = opendir(DIR_BACKUPS);
    while ($file = readdir($storage)) {
        lcm_debug("file in opendir: {$file}");
        if (is_dir(DIR_BACKUPS . '/' . $file) && strpos($file, 'db-') === 0) {
            echo "\t\t<option value='" . substr($file, 3) . "'>" . substr($file, 3) . "</option>\n";
        }
    }
    echo "</select>\n";
    // Select restore type
    echo "<p class='normal_text'>\n";
    echo "<input type='radio' name='restore_type' value='clean' id='r1' /><label for='r1'>&nbsp;<strong>" . _T('archives_input_option_restore') . "</strong></label><br />" . _T('archives_info_option_restore') . "<br /><br />\n";
    // [ML] This is confusing as hell. I understand the aim from DB point of view
    // but I don't understand the aim from the admin's point of view.
    // echo "<input type='radio' name='restore_type' value='replace' id='r2' /><label for='r2'>&nbsp;<strong>Replace (experimental!)</strong></label><br /> Imported backup data will replace the existing. This is usefull to undo the changes made in the database since last backup, without losing the new information. Warning: This operation could break database integrity, especially if importing data between different LCM installations.<br /><br />\n";
    echo "<input type='radio' name='restore_type' value='ignore' id='r3' /><label for='r3'>&nbsp;<strong>" . _T('archives_input_option_sync') . " (experimental!)</strong></label><br /> Only backup data NOT existing in the database will be imported. This is usefull to import data lost since last backup, without changing the existing information. Warning: This operation could break database integrity, especially if importing data between different LCM installations.<br /><br />\n";
    // TRAD
    echo "<button type='submit' class='simple_form_btn'>" . _T('button_validate') . "</button>\n";
    echo "</p>\n";
    echo "</fieldset\n>";
    echo "</form>\n";
    lcm_page_end();
    $_SESSION['errors'] = array();
}
Ejemplo n.º 2
0
	59 Temple Place, Suite 330, Boston, MA  02111-1307, USA

	$Id: listorgs.php,v 1.20 2006/02/20 02:55:17 mlutfy Exp $
*/
include 'inc/inc.php';
include_lcm('inc_impex');
$find_org_string = '';
if (isset($_REQUEST['find_org_string'])) {
    $find_org_string = $_REQUEST['find_org_string'];
}
if (!empty($_REQUEST['export']) && $GLOBALS['author_session']['status'] == 'admin') {
    export('org', $_REQUEST['exp_format'], $find_org_string);
    exit;
}
lcm_page_start(_T('title_org_list'), '', '', 'clients_intro');
lcm_bubble('org_list');
show_find_box('org', $find_org_string, '', (string) ($GLOBALS['author_session']['status'] == 'admin'));
// List all organisations in the system + search criterion if any
$q = "SELECT id_org,name\n\t\tFROM lcm_org";
if (strlen($find_org_string) > 1) {
    $q .= " WHERE (name LIKE '%{$find_org_string}%')";
}
// Sort orgs by ID
$order_set = false;
$order_id = '';
if (isset($_REQUEST['order_id'])) {
    if ($_REQUEST['order_id'] == 'ASC' || $_REQUEST['order_id'] == 'DESC') {
        $order_id = $_REQUEST['order_id'];
        $q .= " ORDER BY id_org " . $order_id;
        $order_set = true;
    }
Ejemplo n.º 3
0
    lcm_page_start(_T('title_error'));
    echo "<p>" . _T('error_no_case_specified') . "</p>\n";
    lcm_page_end();
    exit;
}
if (!allowed($case, 'a')) {
    die("You don't have permission to edit this case's access rights.");
}
$q = "SELECT *\n\tFROM lcm_case_author,lcm_author\n\tWHERE (id_case={$case}\n\t  AND lcm_case_author.id_author=lcm_author.id_author";
if ($author > 0) {
    $q .= " AND lcm_author.id_author={$author}";
}
$q .= ')';
$result = lcm_query($q);
lcm_page_start(_T('title_case_edit_ac'));
lcm_bubble('case_ac');
show_context_start();
show_context_case_title($case);
show_context_case_involving($case);
show_context_end();
?>

<form action="upd_auth.php" method="post">
	<table border="0" class="tbl_usr_dtl" width="99%">
	<tr>
		<th align="center" class="heading"><?php 
echo _Th('case_input_author');
?>
</th>
		<th align="center" class="heading"><?php 
echo _Th('case_ac_input_rights');
Ejemplo n.º 4
0
	You should have received a copy of the GNU General Public License along
	with this program; if not, write to the Free Software Foundation, Inc.,
	59 Temple Place, Suite 330, Boston, MA  02111-1307, USA

	$Id: listclients.php,v 1.37 2006/05/26 06:54:07 mlutfy Exp $
*/
include 'inc/inc.php';
include_lcm('inc_filters');
include_lcm('inc_impex');
$find_client_string = trim(_request('find_client_string'));
if (!empty($_REQUEST['export']) && $GLOBALS['author_session']['status'] == 'admin') {
    export('client', $_REQUEST['exp_format'], $find_client_string);
    exit;
}
lcm_page_start(_T('title_client_list'), '', '', 'clients_intro');
lcm_bubble('client_list');
show_find_box('client', $find_client_string, '', (string) ($GLOBALS['author_session']['status'] == 'admin'));
// List all clients in the system + search criterion if any
$q = "SELECT id_client,name_first,name_middle,name_last\n\t\tFROM lcm_client";
//
// Add search criteria
//
if ($find_client_string) {
    // remove useless spaces
    $find_client_string = preg_replace('/ +/', ' ', $find_client_string);
    $q .= " WHERE ((name_first LIKE '%{$find_client_string}%')\n\t\t\tOR (name_middle LIKE '%{$find_client_string}%')\n\t\t\tOR (name_last LIKE '%{$find_client_string}%')\n\t\t\tOR (CONCAT(name_first, ' ', name_middle, ' ', name_last) LIKE '%{$find_client_string}%')\n\t\t\tOR (CONCAT(name_first, ' ', name_last) LIKE '%{$find_client_string}%')\n\t\t) ";
}
// Sort clients by ID
$order_set = false;
$order_id = '';
if (isset($_REQUEST['order_id'])) {
Ejemplo n.º 5
0
	WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
	or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
	for more details.

	You should have received a copy of the GNU General Public License along 
	with this program; if not, write to the Free Software Foundation, Inc.,
	59 Temple Place, Suite 330, Boston, MA  02111-1307, USA

	$Id: listexps.php,v 1.5 2006/04/21 16:34:36 mlutfy Exp $
*/
include 'inc/inc.php';
include_lcm('inc_obj_exp');
global $author_session;
global $prefs;
lcm_page_start(_T('title_expenses'), '', '', 'expenses_intro');
lcm_bubble('expenses_list');
//
// For "find expense"
//
$find_exp_string = '';
if (_request('find_exp_string')) {
    $find_exp_string = _request('find_exp_string');
    // remove useless spaces
    $find_exp_string = trim($find_exp_string);
    $find_exp_string = preg_replace('/ +/', ' ', $find_exp_string);
}
show_find_box('exp', $find_exp_string);
//
// For "Filter expense owner"
//
$prefs_change = false;
Ejemplo n.º 6
0
	You should have received a copy of the GNU General Public License along
	with this program; if not, write to the Free Software Foundation, Inc.,
	59 Temple Place, Suite 330, Boston, MA  02111-1307, USA

	$Id: listauthors.php,v 1.33 2006/03/21 19:01:53 mlutfy Exp $
*/
include 'inc/inc.php';
include_lcm('inc_acc');
include_lcm('inc_filters');
$find_author_string = '';
if (isset($_REQUEST['find_author_string'])) {
    $find_author_string = $_REQUEST['find_author_string'];
}
lcm_page_start(_T('title_author_list'), '', '', 'authors_intro');
lcm_bubble('author_list');
show_find_box('author', $find_author_string);
$q = "SELECT id_author,name_first,name_middle,name_last,status\n\t\tFROM lcm_author\n\t\tWHERE (1=1 ";
// Add search criteria if any
if (strlen($find_author_string) > 1) {
    $q .= " AND ((name_first LIKE '%{$find_author_string}%')" . " OR (name_middle LIKE '%{$find_author_string}%')" . " OR (name_last LIKE '%{$find_author_string}%'))";
}
$q .= ")";
// Sort authors by status
$order_set = false;
$order_status = '';
if (isset($_REQUEST['order_status'])) {
    if ($_REQUEST['order_status'] == 'ASC' || $_REQUEST['order_status'] == 'DESC') {
        $order_status = $_REQUEST['order_status'];
        $q .= " ORDER BY status " . $order_status;
        $order_set = true;
Ejemplo n.º 7
0
	WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
	or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
	for more details.

	You should have received a copy of the GNU General Public License along 
	with this program; if not, write to the Free Software Foundation, Inc.,
	59 Temple Place, Suite 330, Boston, MA  02111-1307, USA

	$Id: listcases.php,v 1.74 2006/04/21 19:12:44 mlutfy Exp $
*/
include 'inc/inc.php';
include_lcm('inc_obj_case');
global $author_session;
global $prefs;
lcm_page_start(_T('title_my_cases'), '', '', 'cases_intro');
lcm_bubble('case_list');
//
// For "find case"
//
$find_case_string = '';
if (_request('find_case_string')) {
    $find_case_string = _request('find_case_string');
    // remove useless spaces
    $find_case_string = trim($find_case_string);
    $find_case_string = preg_replace('/ +/', ' ', $find_case_string);
    show_find_box('case', $find_case_string);
}
//
// For "Filter case owner"
//
$prefs_change = false;
Ejemplo n.º 8
0
        include_lcm('inc_keywords_default');
        $system_keyword_groups = get_default_keywords();
        create_groups($system_keyword_groups);
        write_metas();
        // regenerate inc/data/inc_meta_cache.php
        $_SESSION['info']['refresh'] = 'Keywords cache refreshed';
        // TRAD
        break;
    case '':
        // Do Nothing
        break;
    default:
        lcm_panic("No such action (" . _request('action') . ")");
}
lcm_page_start(_T('menu_admin_keywords'), '', '', 'keywords_intro');
lcm_bubble('keyword_list');
echo show_all_errors();
//
// Tabs
//
$groups = array('system' => _T('keywords_tab_system'), 'contact' => _T('keywords_tab_contact'), 'user' => _T('keywords_tab_user'), 'maint' => _T('keywords_tab_maintenance'));
$tab = _request('tab', 'system');
show_tabs($groups, $tab, $_SERVER['SCRIPT_NAME']);
switch ($tab) {
    case 'system':
    case 'user':
    case 'contact':
        show_all_keywords_type($tab);
        break;
    case 'maint':
        echo '<fieldset class="info_box">' . "\n";
Ejemplo n.º 9
0
function show_export_form()
{
    global $tabs;
    lcm_page_start(_T('title_archives'), '', '', 'archives_export');
    show_tabs_links($tabs, 0);
    lcm_bubble('archive_create');
    show_export_form_partial();
    lcm_page_end();
}