コード例 #1
0
 function printStartDoc($title, $description, $helpref)
 {
     $title = trim($title);
     $description = trim($description);
     lcm_page_start($title, '', '', $helpref);
     if ($description) {
         echo '<p class="normal_text">' . $description . "</p>\n";
     }
 }
コード例 #2
0
ファイル: keywords.php プロジェクト: nyimbi/legalcase
function show_keyword_id($id_keyword = 0)
{
    if (!$id_keyword) {
        if (!intval($_REQUEST['id_group']) > 0) {
            lcm_panic("missing valid id_group for new keyword");
        }
        $kwg = get_kwg_from_id($_REQUEST['id_group']);
        // Suggest a keyword name: kwgnameNN, where NN = numeric sequence
        $all_kws = get_keywords_in_group_name($kwg['name'], false);
        $cpt = sprintf("%02d", count($all_kws) + 1);
        while (get_kw_from_name($kwg['name'], $kwg['name'] . $cpt)) {
            $cpt = sprintf("%02d", ++$cpt);
        }
        $kw['name'] = $kwg['name'] . $cpt;
        $kw['title'] = '';
        $kw['description'] = '';
        $kw['id_group'] = $kwg['id_group'];
        $kw['ac_author'] = 'Y';
        $kw['hasvalue'] = 'N';
        $kw['type'] = $kwg['type'];
        lcm_page_start(_T('title_keyword_new'));
    } else {
        $kw = get_kw_from_id($id_keyword);
        $kwg = get_kwg_from_id($kw['id_group']);
        lcm_page_start(_T('title_keyword_edit'));
    }
    echo show_all_errors($_SESSION['errors']);
    if (!$id_keyword) {
        echo "<ul style=\"padding-left: 0.5em; padding-top: 0.2; padding-bottom: 0.2; font-size: 12px;\">\n";
        echo '<li style="list-style-type: none;">' . _T('keywords_input_for_group') . " " . '<a class="content_link" href="keywords.php?action=edit_group&id_group=' . $kwg['id_group'] . '">' . _T($kwg['title']) . "</a></li>\n";
        echo "</ul>\n";
    }
    echo '<fieldset class="info_box">';
    echo '<form action="keywords.php" method="post">' . "\n";
    echo '<input type="hidden" name="action" value="update_keyword" />' . "\n";
    echo '<input type="hidden" name="id_keyword" value="' . $id_keyword . '" />' . "\n";
    echo '<input type="hidden" name="id_group" value="' . $kw['id_group'] . '" />' . "\n";
    // for new keyword only
    // Name (only for new keywords, must be unique and cannot be changed)
    echo "<strong>" . f_err_star('name') . _T('keywords_input_name') . "</strong> " . "(short identifier, unique to this keyword group)" . "<br />\n";
    // TRAD
    $disabled = isDisabled($id_keyword);
    echo '<input ' . $disabled . ' type="text" id="kw_name" name="kw_name" size="45" value="' . $kw['name'] . '" class="search_form_txt" />' . "\n";
    echo "<br /><br />\n";
    // Title
    echo "<strong>" . f_err_star('title') . _T('keywords_input_title') . "</strong><br />\n";
    echo "<input type='text' id='kw_title' name='kw_title' size='45' value='" . $kw['title'] . "' class='search_form_txt' />\n";
    echo "<br /><br />\n";
    // Description
    echo "<strong>" . _T('keywords_input_description') . "</strong><br />\n";
    echo "<textarea id='kw_desc' name='kw_desc' rows='2' cols='45' wrap='soft' class='frm_tarea'>";
    echo $kw['description'];
    echo "</textarea>\n";
    // Ac_author
    echo '<ul class="info">';
    echo '<li>' . _T('keywords_info_kw_ac_author') . ' ' . get_yes_no('kw_ac_author', $kw['ac_author']) . "</li>\n";
    if (!$id_keyword || $id_keyword && $kwg['type'] != 'system') {
        echo '<li>' . "Does the keyword have a specific value?" . ' ' . get_yes_no('kw_hasvalue', $kw['hasvalue']) . "</li>\n";
    }
    echo '<button name="submit" type="submit" value="submit" class="simple_form_btn">' . _T('button_validate') . "</button>\n";
    echo "</form>\n";
    echo '</fieldset>';
    // destroy error messages
    $_SESSION['errors'] = array();
    lcm_page_end();
    exit;
}
コード例 #3
0
ファイル: sel_org.php プロジェクト: nyimbi/legalcase
// Add search criteria if any
$find_org_string = _request('find_org_string');
if ($find_org_string) {
    // XXX add more criteria ? (id, tax num, etc.)
    // should be centralised with function, i.e. get_sql_find_org($string)
    $q .= " AND (name LIKE '%{$find_org_string}%')";
}
$q .= ")";
// Sort organisations by name
$order_name = 'ASC';
if (_request('order_name') == 'ASC' || _request('order_name') == 'DESC') {
    $order_name = _request('order_name');
}
$q .= " ORDER BY name " . $order_name;
$result = lcm_query($q);
lcm_page_start(_T('title_case_add_org'));
show_context_start();
show_context_case_title($case);
show_context_case_involving($case);
show_context_end();
// Get the number of rows in the result
$number_of_rows = lcm_num_rows($result);
// Check for correct start position of the list
$list_pos = intval(_request('list_pos', 0));
if ($list_pos >= $number_of_rows) {
    $list_pos = 0;
}
// Position to the page info start
if ($list_pos > 0) {
    if (!lcm_data_seek($result, $list_pos)) {
        die("Error seeking position {$list_pos} in the result");
コード例 #4
0
ファイル: edit_exp.php プロジェクト: nyimbi/legalcase
// Start page
//
if (_request('c')) {
    // comment
    if (!_request('expense')) {
        lcm_panic("Missing expense ID");
    }
    lcm_page_start(_T('title_expense_comment'), '', '', 'expenses');
} elseif (_request('expense')) {
    if (_request('submit') == 'set_exp_status') {
        lcm_page_start(_T('title_expense_comment'), '', '', 'expenses');
    } else {
        lcm_page_start(_T('title_expense_comment'), '', '', 'expenses');
    }
} else {
    lcm_page_start(_T('title_expense_new'), '', '', 'expenses');
}
/* TODO
show_context_start();
show_context_case_title($case, 'followups');
show_context_case_involving($case);
*/
show_context_end();
// Show the errors (if any)
echo show_all_errors();
echo '<form action="upd_exp.php" method="post">' . "\n";
$id_expense = _request('expense', 0);
$id_comment = _request('c', 0);
$status = _request('new_exp_status');
if ($status || $id_comment || _request('edit_comment')) {
    $obj_exp = new LcmExpenseInfoUI($id_expense);
コード例 #5
0
ファイル: listorgs.php プロジェクト: nyimbi/legalcase
	with this program; if not, write to the Free Software Foundation, Inc.,
	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;
コード例 #6
0
ファイル: edit_org.php プロジェクト: nyimbi/legalcase
        // Prepare query
        $q = "SELECT *\n\t\t\tFROM lcm_org\n\t\t\tWHERE id_org={$org}";
        $result = lcm_query($q);
        // Process the output of the query
        if ($row = lcm_fetch_array($result)) {
            // Get org details
            foreach ($row as $key => $value) {
                $_SESSION['form_data'][$key] = $value;
            }
        }
    }
}
if ($org) {
    lcm_page_start(_T('title_org_edit'), '', '', 'clients_neworg');
} else {
    lcm_page_start(_T('title_org_new'), '', '', 'clients_neworg');
}
echo show_all_errors($_SESSION['errors']);
echo '<form action="upd_org.php" method="post">' . "\n";
if (_request('attach_case')) {
    echo '<input type="hidden" name="attach_case" id="attach_case" value="' . _request('attach_case') . '" />' . "\n";
}
$obj_org = new LcmOrgInfoUI($org);
$obj_org->printEdit();
echo '<input type="hidden" name="ref_edit_org" value="' . _session('ref_edit_org') . '" />' . "\n";
echo '<p><button name="submit" type="submit" value="submit" class="simple_form_btn">' . _T('button_validate') . "</button></p>\n";
echo "</form>\n";
// Clear errors and form data
$_SESSION['errors'] = array();
$_SESSION['form_data'] = array();
$_SESSION['org_data'] = array();
コード例 #7
0
ファイル: edit_app.php プロジェクト: nyimbi/legalcase
        $_SESSION['authors'] = array();
        while ($row = lcm_fetch_array($result)) {
            $_SESSION['authors'][$row['id_author']] = $row;
        }
    }
}
// [ML] not clean hack, fix "delete" option
if (!empty($_SESSION['errors'])) {
    if ($_SESSION['form_data']['hidden']) {
        $_SESSION['form_data']['hidden'] = 'Y';
    }
}
if (_session('id_app', 0) > 0) {
    lcm_page_start(_T('title_app_edit'), '', '', 'tools_agenda');
} else {
    lcm_page_start(_T('title_app_new'), '', '', 'tools_agenda');
}
if (_session('id_case', 0) > 0) {
    // Show a bit of background on the case
    show_context_start();
    show_context_case_title(_session('id_case'));
    show_context_case_involving(_session('id_case'));
    show_context_end();
}
// Show the errors (if any)
echo show_all_errors();
// Disable inputs when edit is not allowed for the field
$ac = get_ac_app($app, _session('id_case'));
$admin = $ac['a'];
$write = $ac['w'];
$edit = $ac['e'];
コード例 #8
0
ファイル: edit_case.php プロジェクト: nyimbi/legalcase
    if (!isset($_SESSION['form_data']['title'])) {
        $_SESSION['form_data']['title'] = $client->getName();
    }
}
if ($attach_org) {
    $org = new LcmOrg($attach_org);
    // Leave empty if user did the error of leaving it blank
    if (!isset($_SESSION['form_data']['title'])) {
        $_SESSION['form_data']['title'] = $info['name'];
    }
}
// Start page and title
if ($id_case) {
    lcm_page_start(_T('title_case_edit'), '', '', 'cases_intro#edit');
} else {
    lcm_page_start(_T('title_case_new'), '', '', 'cases_intro#new');
}
// Show the errors (if any)
echo show_all_errors();
if ($attach_client || $attach_org) {
    show_context_start();
}
if ($attach_client) {
    $query = "SELECT id_client, name_first, name_middle, name_last\n\t\t\t\tFROM lcm_client\n\t\t\t\tWHERE id_client = " . $attach_client;
    $result = lcm_query($query);
    while ($row = lcm_fetch_array($result)) {
        // should be only once
        echo '<li style="list-style-type: none;">' . _Ti('fu_input_involving_clients') . get_person_name($row) . "</li>\n";
    }
}
if ($attach_org) {
コード例 #9
0
ファイル: author_det.php プロジェクト: nyimbi/legalcase
global $prefs;
global $author_session;
$author = intval(_request('author'));
if (!($author > 0)) {
    lcm_header("Location: listauthors.php");
    exit;
}
// Get author data
$q = "SELECT *\n\t\tFROM lcm_author\n\t\tWHERE id_author = {$author}";
$result = lcm_query($q);
if (!($author_data = lcm_fetch_array($result))) {
    lcm_header("Location: listauthors.php");
    exit;
}
$fullname = get_person_name($author_data);
lcm_page_start(_T('title_author_view') . ' ' . $fullname, '', '', 'authors_intro');
// Show tabs
if ($author == $author_session['id_author'] || $author_session['status'] == 'admin') {
    $groups = array('general' => array('name' => _T('generic_tab_general'), 'tooltip' => _T('generic_subtitle_general', array('author' => $fullname))), 'cases' => array('name' => _T('generic_tab_cases'), 'tooltip' => _T('author_subtitle_cases', array('author' => $fullname))), 'followups' => array('name' => _T('generic_tab_followups'), 'tooltip' => _T('author_subtitle_followups', array('author' => $fullname))), 'appointments' => array('name' => _T('generic_tab_agenda'), 'tooltip' => _T('author_subtitle_appointments', array('author' => $fullname))), 'times' => array('name' => _T('generic_tab_reports'), 'tooltip' => _T('author_subtitle_reports', array('author' => $fullname))), 'attachments' => array('name' => _T('generic_tab_documents'), 'tooltip' => _T('author_subtitle_attachments', array('author' => $fullname))));
} else {
    $groups = array('general' => array('name' => _T('generic_tab_general'), 'tooltip' => _T('generic_subtitle_general', array('author' => $fullname))), 'cases' => array('name' => _T('generic_tab_cases'), 'tooltip' => _T('author_subtitle_cases', array('author' => $fullname))));
}
$tab = isset($_GET['tab']) ? $_GET['tab'] : 'general';
// [ML] $_SERVER['REQUEST_URI']);
// [ML] Forcing 'author_det.php' else some vars really get carried for nothing (see fu tab + dates)
show_tabs($groups, $tab, "author_det.php?author={$author}");
echo '<fieldset class="info_box">';
switch ($tab) {
    //
    // General tab
    //
コード例 #10
0
ファイル: listfollowups.php プロジェクト: nyimbi/legalcase
	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: listfollowups.php,v 1.6 2006/02/20 02:55:17 mlutfy Exp $
*/
include 'inc/inc.php';
include_lcm('inc_acc');
include_lcm('inc_filters');
include_lcm('inc_keywords');
global $author_session;
lcm_page_start(_T('case_subtitle_recent_followups'));
//lcm_bubble('case_list');
//-----------------------------------------------
// Analyse parameters
//
// For "find followup"
$find_fu_string = '';
if (isset($_REQUEST['find_fu_string'])) {
    $find_fu_string = $_REQUEST['find_fu_string'];
    show_find_box('fu', $find_fu_string);
}
// For "Filter case owner"
$case_owner = 'my';
if (isset($_REQUEST['case_owner'])) {
    $case_owner = $_REQUEST['case_owner'];
}
コード例 #11
0
ファイル: listexps.php プロジェクト: nyimbi/legalcase
	This program is distributed in the hope that it will be useful, but 
	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"
//
コード例 #12
0
ファイル: listauthors.php プロジェクト: nyimbi/legalcase
	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: 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;
コード例 #13
0
ファイル: client_det.php プロジェクト: nyimbi/legalcase
	$Id: client_det.php,v 1.56 2007/01/12 17:37:04 mlutfy Exp $
*/
include 'inc/inc.php';
include_lcm('inc_contacts');
include_lcm('inc_obj_client');
$client = intval(_request('client'));
if (!($client > 0)) {
    lcm_header("Location: listclients.php");
    exit;
}
$q = "SELECT *\n\t\tFROM lcm_client as c\n\t\tWHERE c.id_client = {$client}";
$result = lcm_query($q);
if (!($row = lcm_fetch_array($result))) {
    die("ERROR: There is no such client in the database.");
}
lcm_page_start(_T('title_client_view') . ' ' . get_person_name($row), '', '', 'clients_intro');
/* Saved for future use
			// Check for access rights
			if (!($row['public'] || allowed($client,'r'))) {
				die("You don't have permission to view this client details!");
			}
			$edit = allowed($client,'w');
		*/
$edit = true;
// Show tabs
$groups = array('general' => array('name' => _T('generic_tab_general'), 'tooltip' => _T('generic_subtitle_general')), 'cases' => array('name' => _T('generic_tab_cases'), 'tooltip' => _T('client_subtitle_cases')), 'attachments' => array('name' => _T('generic_tab_documents'), 'tooltip' => _T('client_subtitle_attachments')));
$tab = isset($_GET['tab']) ? $_GET['tab'] : 'general';
show_tabs($groups, $tab, $_SERVER['REQUEST_URI']);
if ($c = intval(_request('attach_case', 0))) {
    $q = "SELECT title\n\t\t\t\t\tFROM lcm_case\n\t\t\t\t\tWHERE id_case = " . $c;
    $result = lcm_query($q);
コード例 #14
0
ファイル: org_det.php プロジェクト: nyimbi/legalcase
*/
include 'inc/inc.php';
include_lcm('inc_acc');
include_lcm('inc_contacts');
include_lcm('inc_obj_org');
$org = intval(_request('org'));
if (!($org > 0)) {
    lcm_header("Location: listorgs.php");
    exit;
}
$q = "SELECT *\n\t\tFROM lcm_org\n\t\tWHERE id_org = {$org}";
$result = lcm_query($q);
if (!($row = lcm_fetch_array($result))) {
    die("ERROR: There is no such organisation in the database.");
}
lcm_page_start(_T('title_org_view') . ' ' . $row['name'], '', '', 'clients_intro');
//
// Access control
//
$ac = get_ac_org($org);
if (!$ac['r']) {
    die("Access denied");
}
// Show tabs
$groups = array('general' => array('name' => _T('generic_tab_general'), 'tooltip' => _T('generic_subtitle_general')), 'cases' => array('name' => _T('generic_tab_cases'), 'tooltip' => _T('org_subtitle_cases')), 'attachments' => array('name' => _T('generic_tab_documents'), 'tooltip' => _T('org_subtitle_attachments')));
$tab = isset($_GET['tab']) ? $_GET['tab'] : 'general';
show_tabs($groups, $tab, $_SERVER['REQUEST_URI']);
if ($c = intval(_request('attach_case', 0))) {
    $q = "SELECT title\n\t\t\t\tFROM lcm_case\n\t\t\t\tWHERE id_case = " . $c;
    $result = lcm_query($q);
    while ($row1 = lcm_fetch_array($result)) {
コード例 #15
0
ファイル: listcases.php プロジェクト: nyimbi/legalcase
	This program is distributed in the hope that it will be useful, but 
	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"
//
コード例 #16
0
ファイル: case_det.php プロジェクト: nyimbi/legalcase
        //
        // Case attachments
        //
        case 'attachments':
            echo '<fieldset class="info_box">';
            show_page_subtitle(_T('case_subtitle_attachments'), 'tools_documents');
            echo '<form enctype="multipart/form-data" action="attach_file.php" method="post">' . "\n";
            echo '<input type="hidden" name="case" value="' . $case . '" />' . "\n";
            // List of attached files
            show_attachments_list('case', $case);
            // Attach new file form
            if ($add) {
                show_attachments_upload('case', $case, $_SESSION['user_file']['name'], $_SESSION['user_file']['description']);
            }
            echo '<input type="submit" name="submit" value="' . _T('button_validate') . '" class="search_form_btn" />' . "\n";
            echo "</form>\n";
            echo "</fieldset>\n";
            $_SESSION['user_file'] = array();
            break;
    }
} else {
    lcm_page_start(_T('title_error'));
    // [ML] Maybe not worth translating, since it should never happen. // TRAD
    echo "<p>" . _Ti('title_error') . 'The case no. "' . htmlspecialchars($case) . '" does not exist in the database.' . "</p>\n";
}
$_SESSION['errors'] = array();
$_SESSION['case_data'] = array();
// DEPRECATED
$_SESSION['form_data'] = array();
$_SESSION['fu_data'] = array();
lcm_page_end();
コード例 #17
0
ファイル: lcm_upgrade.php プロジェクト: nyimbi/legalcase
    lcm_page_start(_T('title_upgrade_database'));
    echo "\n<!-- Upgrading from {$current_version} to {$lcm_db_version} -->\n";
    $log = upgrade_database($current_version);
    // To be honest, in most cases, it will cause a lcm_panic() and this will
    // not show, altough we could (in the future) catch/interpret errors.
    if ($log) {
        echo "<div class='box_error'>\n";
        echo "<p>An error occured while upgrading the database: <br/>{$log}</p>\n";
        // TRAD
        echo "</div>\n";
        lcm_panic("upgrade error ({$log})");
    } else {
        echo "<div class='box_success'>\n";
        echo '<p class="normal_text">' . _T('info_upgrade_database3') . ' <a class="content_link" href="index.php">' . _T('info_upgrade_database5') . "</a></p>\n";
        echo "</div>\n";
    }
    lcm_page_end();
} else {
    global $author_session;
    lcm_page_start("No database upgrade needed");
    // TRAD
    // Small practical trick to refresh the report fields/filters
    if ($author_session['status'] == 'admin') {
        include_lcm('inc_db_upgrade');
        include_lcm('inc_repfields_defaults');
        $fields = get_default_repfields();
        create_repfields($fields);
    }
    echo '<p class="normal_text"><a class="content_link" href="index.php">' . _T('info_upgrade_database5') . "</a></p>\n";
    lcm_page_end();
}
コード例 #18
0
ファイル: sel_auth.php プロジェクト: nyimbi/legalcase
$list_pos = 0;
if (isset($_REQUEST['list_pos'])) {
    $list_pos = $_REQUEST['list_pos'];
}
if ($list_pos >= $number_of_rows) {
    $list_pos = 0;
}
// Position to the page info start
if ($list_pos > 0) {
    if (!lcm_data_seek($result, $list_pos)) {
        lcm_panic("Error seeking position {$list_pos} in the result");
    }
}
// Check if any author(s) available for selection
if ($find_author_string || lcm_num_rows($result) > 0) {
    lcm_page_start(_T('title_case_add_author'), '', '', 'cases_participants');
} else {
    // TODO: add $_SESSION['errors']['generic'] message?
    header('Location: ' . $dest_link->getUrlForHeader());
    exit;
}
show_context_start();
show_context_case_title($case);
show_context_case_involving($case);
show_context_end();
show_find_box('author', $find_author_string, '__self__');
echo '<form action="add_auth.php" method="post">' . "\n";
$headers = array();
$headers[0]['title'] = '';
$headers[0]['order'] = 'no_order';
$headers[1]['title'] = _Th('person_input_name');
コード例 #19
0
ファイル: edit_auth.php プロジェクト: nyimbi/legalcase
if (!($case > 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 
コード例 #20
0
ファイル: edit_rep.php プロジェクト: nyimbi/legalcase
if (_session('filecustom')) {
    if (!preg_match("/^[-_A-Za-z0-9]+\$/", _session('filecustom'))) {
        $_SESSION['errors']['filecustom'] = htmlspecialchars(_session('filecustom')) . ": " . "Report file name has illegal characters";
    } elseif (!include_custom_report_exists(_session('filecustom'))) {
        $_SESSION['errors']['filecustom'] = htmlspecialchars(_session('filecustom')) . ": " . "Report file does not exist";
    }
    // TRAD
    if ($_SESSION['errors']['filecustom']) {
        $_SESSION['form_data']['filecustom'] = '';
    }
}
// Start the page with the proper title
if (_session('id_report')) {
    lcm_page_start(_T('title_rep_edit') . " " . _session('title'), '', '', 'reports_intro');
} else {
    lcm_page_start(_T('title_rep_new'), '', '', 'reports_intro');
}
echo show_all_errors();
if ($_SESSION['form_data']['filecustom']) {
    include_custom_report($_SESSION['form_data']['filecustom']);
    $rep_specs = new CustomReportSpecs();
    echo '<p class="normal_text">';
    if (_session('id_report')) {
        echo "This report is using the custom report in '" . $_SESSION['form_data']['filecustom'] . "'";
    } else {
        echo "This report will use the custom report in '" . $_SESSION['form_data']['filecustom'] . "'";
    }
    // TRAD
    echo ": " . $rep_specs->getDescription() . "</p>\n";
}
echo "<fieldset class=\"info_box\">\n";
コード例 #21
0
ファイル: listreps.php プロジェクト: nyimbi/legalcase
global $author_session;
// Restrict page to administrators
if ($author_session['status'] != 'admin') {
    lcm_page_start(_T('title_report_list'), '', '', 'reports_intro');
    echo '<p class="normal_text">' . _T('warning_forbidden_not_admin') . "</p>\n";
    lcm_page_end();
    exit;
}
//
// For "find report"
//
$find_rep_string = '';
if (isset($_REQUEST['find_rep_string'])) {
    $find_rep_string = $_GET['find_rep_string'];
}
lcm_page_start(_T('title_report_list'), '', '', 'reports_intro');
// lcm_bubble('report_list');
show_find_box('rep', $find_rep_string);
$q = "SELECT id_report,title\n\t\tFROM lcm_report";
// Add search criteria if any
if (strlen($find_rep_string) > 1) {
    $q .= " WHERE (title LIKE '%{$find_rep_string}%')";
}
// Sort reports by nem
$order_title = 'ASC';
if (isset($_REQUEST['order_title'])) {
    if ($_REQUEST['order_title'] == 'ASC' || $_REQUEST['order_title'] == 'DESC') {
        $order_title = $_REQUEST['order_title'];
    }
}
$q .= " ORDER BY title " . $order_title;
コード例 #22
0
ファイル: edit_client.php プロジェクト: nyimbi/legalcase
    }
} else {
    // Fetch previously submitted values, if any
    if (!$_SESSION['form_data']['id_client']) {
        $_SESSION['form_data']['id_client'] = 0;
    }
    if (isset($_SESSION['form_data'])) {
        foreach ($_SESSION['form_data'] as $key => $value) {
            $form_data[$key] = $value;
        }
    }
}
if ($id_client > 0) {
    lcm_page_start(_T('title_client_edit') . ' ' . get_person_name($form_data), '', '', 'clients_newclient');
} else {
    lcm_page_start(_T('title_client_new'), '', '', 'clients_newclient');
}
echo show_all_errors();
echo '<form action="upd_client.php" method="post">' . "\n";
if (_request('attach_case')) {
    echo '<input type="hidden" name="attach_case" id="attach_case" value="' . _request('attach_case') . '" />' . "\n";
}
$obj_client = new LcmClientInfoUI($form_data['id_client']);
$obj_client->printEdit();
//
// Organisations this client represents
//
/* [ML] too confusing
	echo "<tr>\n";
	echo '<td colspan="2" align="center" valign="middle" class="heading">';
	echo '<h4>' . _T('client_subtitle_organisations') . '</h4>';
コード例 #23
0
ファイル: inc.php プロジェクト: nyimbi/legalcase
    // The REQUEST_URI should always be set, and point to the current page
    // we are being sent to (Ex: from config_author.php to listcases.php).
    // [ML] I used $lcm_lang because there are rare cases where the cookie
    // can disagree with $author_session['lang'] (e.g. login one user, set
    // cookie, logout, login other user, conflict).
    // [ML] Added $ref because some forms such as config_author.php expect it
    $ref = isset($_REQUEST['referer']) ? '&referer=' . urlencode($_REQUEST['referer']) : '';
    header("Location: lcm_cookie.php?var_lang_lcm=" . $lang . "&url=" . urlencode($_SERVER['REQUEST_URI']) . $ref);
    exit;
}
//
// Database version management
//
$installed_db_version = read_meta('lcm_db_version');
if ($installed_db_version < $lcm_db_version) {
    lcm_page_start(_T('title_upgrade_database'));
    echo "<div class='box_warning'>\n";
    echo '<p class="normal_text"><b>' . _T('title_technical_message') . "</b> " . _T('info_upgrade_database1') . ' ' . '<a class="content_link" href="lcm_upgrade.php">' . _T('info_upgrade_database2') . "</a>" . "</p>";
    echo "</div>\n";
    echo "<!-- VERSION installed = {$installed_db_version} ; should be = {$lcm_db_version} -->\n";
    lcm_log("Upgrade required: installed = {$installed_db_version}, should be = {$lcm_db_version}");
    lcm_page_end();
    exit;
}
// Fetch the administration cookie
// [ML] Where is this used and why? :-)
if (isset($_COOKIE['lcm_admin'])) {
    $cookie_admin = $_COOKIE['lcm_admin'];
} else {
    $cookie_admin = "";
}
コード例 #24
0
ファイル: app_det.php プロジェクト: nyimbi/legalcase
	$Id: app_det.php,v 1.25 2007/11/16 16:29:08 mlutfy Exp $
*/
include 'inc/inc.php';
$app = intval(_request('app'));
$ac = get_ac_app($app);
if (!$ac['r']) {
    die("access denied");
}
// Get the authors participating in the appointment
$q = "SELECT p.*, a.name_first, a.name_middle, a.name_last, c.title AS case_title\n\tFROM lcm_app as p\n\tLEFT JOIN lcm_case as c ON (c.id_case = p.id_case)\n\tLEFT JOIN lcm_author as a ON (a.id_author = p.id_author)\n\tWHERE p.id_app = {$app}";
$result = lcm_query($q);
if (!($row = lcm_fetch_array($result))) {
    die("There is no such appointment.");
}
lcm_page_start(_T('title_app_view') . ' ' . $row['title'], '', '', 'tools_agenda');
echo '<fieldset class="info_box">' . "\n";
echo '<p class="normal_text">' . "\n";
echo _Ti('app_input_title') . $row['title'] . "<br />\n";
echo _Ti('app_input_type') . _Tkw('appointments', $row['type']) . "<br />\n";
if ($row['hidden'] == 'Y') {
    echo '<p class="normal_text"><strong>' . _T('app_info_is_deleted') . "</strong>";
    if ($ac['a']) {
        echo " " . _T('app_info_is_deleted2');
    }
    echo "</p>\n";
}
show_page_subtitle(_T('generic_subtitle_general'), 'tools_agenda');
echo _Ti('app_input_description') . nl2br($row['description']) . "<br />\n";
echo "<br />\n";
echo _Ti('time_input_date_start') . format_date($row['start_time'], 'short');
コード例 #25
0
ファイル: sel_client.php プロジェクト: nyimbi/legalcase
}
$q2 .= ')';
// Add search criteria if any
$find_client_string = _request('find_client_string');
if (strlen($find_client_string) > 1) {
    $q2 .= " AND ((name_first LIKE '%{$find_client_string}%')" . " OR (name_middle LIKE '%{$find_client_string}%')" . " OR (name_last LIKE '%{$find_client_string}%'))";
}
$q2 .= ")";
// Sort client by name_first
$order_name = 'ASC';
if (_request('order_name') == 'ASC' || _request('order_name') == 'DESC') {
    $order_name = _request('order_name');
}
$q2 .= " ORDER BY name_first " . $order_name;
$result = lcm_query($q2);
lcm_page_start(_T('title_case_add_client'));
show_context_start();
show_context_case_title($case);
show_context_case_involving($case);
show_context_end();
// Get the number of rows in the result
$number_of_rows = lcm_num_rows($result);
// Check for correct start position of the list
$list_pos = intval(_request('list_pos', 0));
if ($list_pos >= $number_of_rows) {
    $list_pos = 0;
}
// Position to the page info start
if ($list_pos > 0) {
    if (!lcm_data_seek($result, $list_pos)) {
        die("Error seeking position {$list_pos} in the result");
コード例 #26
0
ファイル: exp_det.php プロジェクト: nyimbi/legalcase
	This program is distributed in the hope that it will be useful, but
	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: exp_det.php,v 1.4 2006/04/04 23:33:49 mlutfy Exp $
*/
include 'inc/inc.php';
include_lcm('inc_obj_exp');
$expense = intval(_request('expense'));
if (!($expense > 0)) {
    die("Missing id expense.");
}
lcm_page_start(_T('title_expense_view') . ' ' . _request('expense'), '', '', 'expenses_intro');
//
// Show general information
//
echo '<fieldset class="info_box">';
$obj_expense = new LcmExpenseInfoUI($expense);
$obj_expense->printGeneral();
$obj_exp_ac = new LcmExpenseAccess(0, 0, $obj_expense);
$obj_expense->printComments();
echo "</fieldset>\n";
// Clear session info
$_SESSION['form_data'] = array();
$_SESSION['errors'] = array();
lcm_page_end();
コード例 #27
0
ファイル: config_author.php プロジェクト: nyimbi/legalcase
        echo "</div>\n";
    }
}
//
// Main body
//
// Clear list of modifications
$log = array();
if (isset($_POST['author_ui_modified'])) {
    apply_author_ui_change();
}
if (isset($_POST['author_advanced_settings_modified'])) {
    apply_author_advanced_settings_change();
}
// Referer may be set by the form, but also by lcm_cookie.php which
// is called before config_author.php via inc.php (ahem..)
// [ML] If this is removed, the user will not be correctly sent to the
// referer when the language setting is changed
if (isset($_REQUEST['referer'])) {
    $target = new Link($_REQUEST['referer']);
    header('Location: ' . $target->getUrlForHeader());
    exit;
}
lcm_page_start(_T('title_authorconf'));
// Show tabs
$groups = array('interface' => _T('authorconf_tab_interface'), 'advanced' => _T('authorconf_tab_advanced'));
$tab = isset($_REQUEST['tab']) ? $_REQUEST['tab'] : 'interface';
//show_tabs($groups,$tab,$_SERVER['REQUEST_URI']);
show_tabs($groups, $tab, $_SERVER['SCRIPT_NAME'] . "?ref=" . urlencode(isset($_GET['ref']) ? urldecode(clean_input($_GET['ref'])) : $_SERVER['HTTP_REFERER']));
show_author_form($tab);
lcm_page_end();
コード例 #28
0
ファイル: calendar.php プロジェクト: nyimbi/legalcase
<?php

/***************************************************************************\
 *  SPIP, Systeme de publication pour l'internet                           *
 *                                                                         *
 *  Copyright (c) 2001-2005                                                *
 *  Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James  *
 *                                                                         *
 *  Ce programme est un logiciel libre distribue sous licence GNU/GPL.     *
 *  Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne.   *
\***************************************************************************/
include 'inc/inc.php';
include_lcm('inc_calendar');
lcm_page_start(_T('title_calendar_view'));
$afficher_bandeau_calendrier = true;
echo http_calendrier_init('', $_REQUEST['type']);
lcm_page_end();
コード例 #29
0
ファイル: edit_fu.php プロジェクト: nyimbi/legalcase
    $show_conclusion = true;
}
//
// Start page
//
if (isset($_SESSION['followup'])) {
    lcm_page_start(_T('title_fu_edit'), '', '', 'cases_followups');
} else {
    if (isset($_REQUEST['type'])) {
        if ($_REQUEST['type'] == 'stage_change') {
            lcm_page_start(_T('title_fu_change_stage'), '', '', 'cases_intro#stage');
        } else {
            lcm_page_start(_T('title_fu_change_status'), '', '', 'cases_intro#status');
        }
    } else {
        lcm_page_start(_T('title_fu_new'), '', '', 'cases_followups');
    }
}
show_context_start();
show_context_case_title($case, 'followups');
show_context_case_involving($case);
// For 'change status' // FIXME (for edit existing fu?)
if ($_REQUEST['submit'] == 'set_status') {
    show_context_item(_Ti('fu_input_current_status') . _T('case_status_option_' . $row['status']));
}
// For 'change stage'
if (isset($old_stage) && $old_stage) {
    show_context_item(_Ti('fu_input_current_stage') . _Tkw('stage', $old_stage));
}
// Show stage information [ML] Not very efficient, I know, but I prefer to avoid spagetti
if ($_SESSION['form_data']['case_stage']) {
コード例 #30
0
ファイル: rep_det.php プロジェクト: nyimbi/legalcase
// Previously, col_src_name/type were not stored, so calculate them
// if they are not present (old reports).
//
if (!$rep_info['col_src_type']) {
    $q = "SELECT f.table_name\n\t\tFROM lcm_fields as f, lcm_rep_col as c\n\t\tWHERE f.id_field = c.id_field\n\t\tAND c.id_report = " . $rep;
    $result = lcm_query($q);
    if (lcm_num_rows($result)) {
        $tmp_info = lcm_fetch_array($result);
        $rep_info['col_src_name'] = $tmp_info['table_name'];
        $rep_info['col_src_type'] = 'table';
    }
}
//
// Show info on the report
//
lcm_page_start(_T('title_rep_view') . " " . remove_number_prefix($rep_info['title']), '', '', 'reports_intro');
echo show_all_errors($_SESSION['errors']);
$edit = $GLOBALS['author_session']['status'] == 'admin' || $rep_info['id_author'] == $GLOBALS['author_session']['id_author'];
echo "<fieldset class='info_box'>";
show_page_subtitle(_T('generic_subtitle_general'), 'reports_intro');
echo '<ul class="info">';
echo '<li>' . '<span class="label1">' . _Ti('rep_input_id') . '</span>' . '<span class="value1">' . $rep_info['id_report'] . '</span>' . "</li>\n";
echo '<li>' . '<span class="label1">' . _Ti('rep_input_title') . '</span>' . '<span class="value1">' . remove_number_prefix($rep_info['title']) . '</span>' . "</li>\n";
echo '<li>' . '<span class="label2">' . _Ti('time_input_date_creation') . '</span>' . '<span class="value2">' . format_date($rep_info['date_creation']) . '</span>' . "</li>\n";
if ($rep_info['filecustom']) {
    echo '<li>' . '<span class="label2">' . 'Custom report: ' . '</span>' . '<span class="value2">' . $rep_info['filecustom'] . '</span>' . "</li>\n";
}
echo "</ul>\n";
if ($rep_info['description']) {
    echo '<p class="normal_text">' . $rep_info['description'] . '</p>' . "\n";
}