当前位置: 首页>>代码示例>>PHP>>正文


PHP include_lcm函数代码示例

本文整理汇总了PHP中include_lcm函数的典型用法代码示例。如果您正苦于以下问题:PHP include_lcm函数的具体用法?PHP include_lcm怎么用?PHP include_lcm使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了include_lcm函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init_default_config

function init_default_config()
{
    // default language of the site = installation language (cookie)
    // (if no cookie, then set to English)
    if (!($lang = $GLOBALS['lcm_lang'])) {
        $lang = 'en';
    }
    $meta_name_middle = 'no';
    if ($lang == 'bg' || $lang == 'pt_br') {
        $meta_name_middle = 'yes';
    }
    // Check whether database supports utf8
    $db_utf8 = 'no';
    if (!preg_match('/^MySQL (4\\.0|3\\.)/', lcm_sql_server_info())) {
        $db_utf8 = 'yes';
    }
    // c.f. http://www.lcm.ngo-bg.org/article28.html
    $list_meta = array('default_language' => $lang, 'site_open_subscription' => 'no', 'site_name' => 'title_software', 'site_description' => 'title_software_description', 'currency' => _T('currency_default_format'), 'case_default_read' => 'yes', 'case_default_write' => 'no', 'case_read_always' => 'no', 'case_write_always' => 'no', 'client_name_middle' => $meta_name_middle, 'client_citizen_number' => 'no', 'client_civil_status' => 'no', 'client_income' => 'no', 'client_hide_all' => 'no', 'client_share_read' => 'yes', 'client_share_write' => 'yes', 'client_date_birth' => 'no', 'person_name_format' => '1', 'org_hide_all' => 'no', 'org_share_read' => 'yes', 'org_share_write' => 'yes', 'case_court_archive' => 'no', 'case_assignment_date' => 'yes', 'case_alledged_crime' => 'yes_optional', 'case_legal_reason' => 'yes_optional', 'case_new_showorg' => 'no', 'case_allow_modif' => 'yes', 'fu_sum_billed' => 'no', 'fu_allow_modif' => 'yes', 'hide_emails' => 'no', 'db_utf8' => $db_utf8, 'charset' => 'UTF-8');
    $modifs = false;
    while (list($key, $value) = each($list_meta)) {
        if (!read_meta($key)) {
            write_meta($key, $value);
            $modifs = true;
        }
    }
    if ($modifs) {
        write_metas();
    }
    // Force the update list of available languages
    include_lcm('inc_lang');
    init_languages(true);
}
开发者ID:nyimbi,项目名称:legalcase,代码行数:32,代码来源:inc_meta_defaults.php

示例2: send_email

function send_email($email, $subject, $texte, $from = "", $headers = "")
{
    global $hebergeur, $queue_mails, $flag_wordwrap, $os_serveur;
    include_lcm('inc_filters');
    if (!$from) {
        $email_envoi = read_meta("email_sender");
        $from = is_valid_email($email_envoi) ? $email_envoi : $email;
    }
    if (!is_valid_email($email)) {
        return false;
    }
    lcm_debug("mail ({$email}): {$subject}");
    $charset = read_meta('charset');
    $headers = "From: {$from}\n" . "MIME-Version: 1.0\n" . "Content-Type: text/plain; charset={$charset}\n" . "Content-Transfer-Encoding: 8bit\n{$headers}";
    $texte = filtrer_entites($texte);
    $subject = filtrer_entites($subject);
    // fignoler ce qui peut l'etre...
    if ($charset != 'utf-8') {
        $texte = str_replace("’", "'", $texte);
        $subject = str_replace("’", "'", $subject);
    }
    // encoder le sujet si possible selon la RFC
    if ($GLOBALS['flag_multibyte'] and @mb_internal_encoding($charset)) {
        $subject = mb_encode_mimeheader($subject, $charset, 'Q');
    }
    if ($flag_wordwrap) {
        $texte = wordwrap($texte);
    }
    if ($os_serveur == 'windows') {
        $texte = preg_replace("/\r*\n/", "\r\n", $texte);
        $headers = preg_replace("/\r*\n/", "\r\n", $headers);
    }
    switch ($hebergeur) {
        case 'lycos':
            $queue_mails[] = array('email' => $email, 'sujet' => $subject, 'texte' => $texte, 'headers' => $headers);
            return true;
        case 'free':
            return false;
        case 'online':
            if (!($ret = @email('webmaster', $email, $subject, $texte))) {
                lcm_log("ERROR mail: (online) returned false");
            }
            return $ret;
        default:
            if (!($ret = @mail($email, $subject, $texte, $headers))) {
                lcm_log("ERROR mail: (default) returned false");
            }
            return $ret;
    }
}
开发者ID:nyimbi,项目名称:legalcase,代码行数:50,代码来源:inc_mail.php

示例3: printStartDoc

 function printStartDoc($title, $description, $helpref)
 {
     $title = trim($title);
     $description = trim($description);
     // Prepare the ZIP file
     /*
     @include("pear/Archive/Zip.php");
     
     if (! class_exists("Archive_Zip"))
     	lcm_panic("You must have PEAR installed (Archive/Zip.php)");
     */
     include_lcm('inc_pclzip');
     // Zip filename must use random ID, to avoid overwriting existing reports
     // not catastrophic if that happens, but annoyance nonetheless.
     $this->zipname = $this->dir . '.ods';
     // $this->zipfile = new Archive_Zip($this->zipname);
     $this->zipfile = new PclZip($this->zipname);
     $filename = preg_replace('/\\s+/', '_', $title);
     header("Content-Type: " . $this->mimetype);
     header('Content-Disposition: filename="' . $filename . '.ods"');
     header("Content-Description: " . ($description ? $description : $title));
     header("Content-Transfer-Encoding: binary");
     // TODO: show description in the XML, near $title
     //
     // Write the styles.xml file
     //
     $styles = '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . '<office:document-styles' . ' xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"' . ' xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"' . ' xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"' . ' xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"' . ' xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"' . ' xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"' . ' xmlns:xlink="http://www.w3.org/1999/xlink"' . ' xmlns:dc="http://purl.org/dc/elements/1.1/"' . ' xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"' . ' xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"' . ' xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"' . ' xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"' . ' xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"' . ' xmlns:math="http://www.w3.org/1998/Math/MathML"' . ' xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"' . ' xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"' . ' xmlns:ooo="http://openoffice.org/2004/office"' . ' xmlns:ooow="http://openoffice.org/2004/writer"' . ' xmlns:oooc="http://openoffice.org/2004/calc"' . ' xmlns:dom="http://www.w3.org/2001/xml-events"' . ' office:version="1.0">' . "\n";
     $styles .= '<office:styles>' . ' <number:currency-style style:name="N106P0" style:volatile="true">' . ' <number:number number:decimal-places="2" number:min-integer-digits="1" number:grouping="true" />' . ' <number:text></number:text>' . ' <number:currency-symbol' . ' number:language="' . $GLOBALS['lcm_lang'] . '"' . ' number:country="' . strtoupper($GLOBALS['lcm_lang']) . '">' . read_meta('currency') . '</number:currency-symbol>' . '</number:currency-style>' . '<number:currency-style style:name="N106">' . '<style:text-properties fo:color="#ff0000" />' . '<number:text>-</number:text>' . '<number:number number:decimal-places="2" number:min-integer-digits="1" number:grouping="true" />' . '<number:text></number:text>' . ' <number:currency-symbol' . ' number:language="' . $GLOBALS['lcm_lang'] . '"' . ' number:country="' . strtoupper($GLOBALS['lcm_lang']) . '">' . read_meta('currency') . '</number:currency-symbol>' . '<style:map style:condition="value()&gt;=0" style:apply-style-name="N106P0" />' . '</number:currency-style>' . '</office:styles>';
     $styles .= '</office:document-styles>' . "\n";
     $f = fopen($this->dir . '/styles.xml', 'w');
     fwrite($f, $styles);
     fclose($f);
     // content
     $content = '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . '<office:document-content xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"' . ' xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"' . ' xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"' . ' xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"' . ' xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"' . ' xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"' . ' xmlns:xlink="http://www.w3.org/1999/xlink"' . ' xmlns:dc="http://purl.org/dc/elements/1.1/"' . ' xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"' . ' xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"' . ' xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"' . ' xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"' . ' xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"' . ' xmlns:math="http://www.w3.org/1998/Math/MathML"' . ' xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"' . ' xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"' . ' xmlns:ooo="http://openoffice.org/2004/office"' . ' xmlns:ooow="http://openoffice.org/2004/writer"' . ' xmlns:oooc="http://openoffice.org/2004/calc"' . ' xmlns:dom="http://www.w3.org/2001/xml-events"' . ' xmlns:xforms="http://www.w3.org/2002/xforms"' . ' xmlns:xsd="http://www.w3.org/2001/XMLSchema"' . ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' . ' office:version="1.0">';
     $content .= '<office:scripts />' . '<office:font-face-decls>' . '<style:font-face style:name="Verdana1" svg:font-family="Verdana" style:font-pitch="variable" />' . '<style:font-face style:name="Verdana" svg:font-family="Verdana" style:font-family-generic="swiss" style:font-pitch="variable" />' . '</office:font-face-decls>' . '<office:automatic-styles>' . '<style:style style:name="co1" style:family="table-column">' . '<style:table-column-properties fo:break-before="auto" style:column-width="2.267cm" />' . '</style:style>' . '<style:style style:name="ro1" style:family="table-row">' . '<style:table-row-properties style:row-height="0.453cm" fo:break-before="auto" style:use-optimal-row-height="true" />' . '</style:style>' . '<style:style style:name="ta1" style:family="table" style:master-page-name="Default">' . '<style:table-properties table:display="true" style:writing-mode="lr-tb" />' . '</style:style>' . '<style:style style:name="ce1" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="N0" />' . '</office:automatic-styles>';
     $content .= '<office:body>' . '<office:spreadsheet>' . '<table:table table:name="Sheet1" table:style-name="ta1" table:print="false">' . '<table:table-column table:style-name="co1" table:number-columns-repeated="4" table:default-cell-style-name="Default" />' . '<table:table-row table:style-name="ro1">' . '<table:table-cell office:value-type="string">' . '<text:p>' . $title . '</text:p>' . '</table:table-cell>' . '<table:table-cell table:number-columns-repeated="3" />' . '</table:table-row>' . '<table:table-row table:style-name="ro1">' . '<table:table-cell table:number-columns-repeated="4" />' . '</table:table-row>';
     if (!($this->fcontent = fopen($this->dir . '/content.xml', 'w'))) {
         lcm_panic("Could not open content.xml. " . $GLOBALS['lcm_errormsg']);
     }
     fwrite($this->fcontent, $content);
     // leave $fcontent open until we are finished
 }
开发者ID:nyimbi,项目名称:legalcase,代码行数:42,代码来源:inc_obj_export_ods.php

示例4: typo

function typo($letexte)
{
    global $lcm_lang, $lang_typo;
    // escape <html>...</html> code, etc.
    list($letexte, $les_echap) = echappe_html($letexte, "SOURCETYPO");
    // Call the function for pre-processing
    $letexte = spip_avant_typo($letexte);
    if (!($lang = $lang_typo)) {
        include_lcm('inc_lang');
        $lang = lang_typo($lcm_lang);
    }
    if ($lang == 'fr') {
        $letexte = typo_fr($letexte);
    } else {
        $letexte = typo_en($letexte);
    }
    // Call the post-processing function
    $letexte = spip_apres_typo($letexte);
    // reintegrate the escaped text
    $letexte = echappe_retour($letexte, $les_echap, "SOURCETYPO");
    return $letexte;
}
开发者ID:nyimbi,项目名称:legalcase,代码行数:22,代码来源:inc_text.php

示例5: menu_languages

function menu_languages($select_name = 'var_lang_lcm', $default = '', $text = '', $herit = '')
{
    global $connect_id_auteur;
    $ret = '';
    if ($default == '') {
        $default = $GLOBALS['lcm_lang'];
    }
    if ($select_name == 'var_lang_lcm_all') {
        $languages = explode(',', $GLOBALS['all_langs']);
        // [ML] XXX because I need a normal var_lang_lcm, but with all
        // the languages, instead, the function parameters should be changed.
        $select_name = 'var_lang_lcm';
    } else {
        $languages = explode(',', read_meta('available_languages'));
    }
    // We do not offer a choice if there is only one language installed
    if (count($languages) <= 1) {
        return;
    }
    $lien = $GLOBALS['clean_link'];
    if ($select_name == 'var_lang_lcm') {
        include_lcm('inc_admin');
        $target = $lien->getUrl();
        if ($connect_id_auteur) {
            $post = "lcm_cookie.php?id_author={$connect_id_auteur}&amp;valeur=" . calculer_action_auteur('var_lang_lcm', $connect_id_auteur);
        } else {
            $post = "lcm_cookie.php";
        }
        $ret = "<form action='{$post}' method='post' style='margin:0px; padding:0px;'>";
        if ($target) {
            $ret .= "<input type='hidden' name='url' value='{$target}'/>";
        }
        if ($text) {
            $ret .= $text;
        }
        $style = "class='forml' style='vertical-align: top; max-height: 24px; margin-bottom: 5px; width: 120px;'";
        $postcomplet = new Link($post);
        if ($target) {
            $postcomplet->addvar('url', $target);
        }
        $ret .= "\n<select name='{$select_name}' {$style} onchange=\"document.location.href='" . $postcomplet->geturl() . "&amp;{$select_name}='+this.options[this.selectedIndex].value\">\n";
    } else {
        // XXX TODO FIXME
        // rename class 'forml' to 'form_lang' and adjust CSS
        $ret .= "\n<select class='sel_frm' name='{$select_name}'>\n";
    }
    sort($languages);
    while (list(, $l) = each($languages)) {
        if ($l == $default) {
            $selected = ' selected="selected"';
        } else {
            $selected = '';
        }
        if ($l == $herit) {
            $ret .= "<option class='maj-debut' style='font-weight: bold;' value='herit'{$selected}>" . translate_language_name($herit) . " (" . _T('info_multi_herit') . ")</option>\n";
        } else {
            $ret .= "<option class='maj-debut' value='{$l}'{$selected}>" . translate_language_name($l) . "</option>\n";
        }
    }
    $ret .= "</select>\n";
    if ($select_name == 'var_lang_lcm') {
        $ret .= "<noscript><input type='submit' name='Validate' value='&gt;&gt;'/></noscript>";
        $ret .= "</form>";
    }
    return $ret;
}
开发者ID:nyimbi,项目名称:legalcase,代码行数:66,代码来源:inc_lang.php

示例6: or

	Free Software Foundation; either version 2 of the License, or (at your
	option) any later version.

	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: sel_auth.php,v 1.12 2006/02/20 03:25:03 mlutfy Exp $
*/
include 'inc/inc.php';
include_lcm('inc_acc');
global $prefs;
$case = intval($_REQUEST['case']);
if (!($case > 0)) {
    lcm_page_start(_T('title_error'));
    echo "<p>" . _T('error_no_case_specified') . "</p>\n";
    lcm_page_end();
    exit;
}
$destination = "case_det.php?id_case=" . $case;
if (isset($_SERVER['HTTP_REFERER'])) {
    $destination = $_SERVER['HTTP_REFERER'];
}
$dest_link = new Link($destination);
if (!allowed($case, 'a')) {
    die("You don't have permission to add users to this case!");
开发者ID:nyimbi,项目名称:legalcase,代码行数:31,代码来源:sel_auth.php

示例7: send_registration_by_email

function send_registration_by_email()
{
    global $lcm_lang_left;
    $_SESSION['form_data'] = array();
    $_SESSION['errors'] = array();
    $kwg_email = get_kwg_from_name('+email_main');
    $form_items = array('name_first' => 'person_input_name_first', 'name_last' => 'person_input_name_last', 'email' => 'input_email', 'username' => 'authoredit_input_username');
    foreach ($form_items as $field => $trad) {
        $_SESSION['form_data'][$field] = _request($field);
        if (!_session($field)) {
            $_SESSION['errors'][$field] = _Ti($trad) . _T('warning_field_mandatory');
        }
    }
    if (count($_SESSION['errors'])) {
        lcm_header("Location: lcm_pass.php?register=yes");
        exit;
    }
    install_html_start(_T('pass_title_register'), 'login');
    // There is a risk that an author changes his e-mail after his account
    // is created, to the e-mail of another person, and therefore block the
    // other person from registering. But then.. this would allow the other
    // person to hijack the account, so it would be a stupid DoS.
    $query = "SELECT id_of_person, status FROM lcm_contact as c, lcm_author as a\n\t\tWHERE c.id_of_person = a.id_author\n\t\tAND value = '" . _session('email') . "'\n\t\tAND type_person = 'author'\n\t\tAND type_contact = " . $kwg_email['id_group'];
    $result = lcm_query($query);
    // Test if the user already exists
    if ($row = lcm_fetch_array($result)) {
        $id_author = $row['id_of_person'];
        $status = $row['status'];
        // TODO: if status = 'pending for validation by admin', show message
        if ($status == 'trash') {
            echo "<br />\n";
            echo "<div class='box_error'>" . _T('pass_registration_denied') . "</div>\n";
        } else {
            echo "<br />\n";
            echo "<div class=\"box_error\" align=\"{$lcm_lang_left}\">" . _T('pass_warning_already_registered') . "</div>\n";
            return;
        }
    }
    //
    // Send identifiers by e-mail
    //
    include_lcm('inc_access');
    include_lcm('inc_mail');
    $username = get_unique_username(_session('username'));
    $pass = create_random_password(8, $username);
    $mdpass = md5($pass);
    $open_subscription = read_meta("site_open_subscription");
    if (!($open_subscription == 'yes' || $open_subscription == 'moderated')) {
        lcm_panic("Subscriptions not permitted.");
    }
    $status = 'waiting';
    if ($open_subscription == 'yes') {
        $status = 'normal';
    }
    lcm_query("INSERT INTO lcm_author (name_first, name_last, username, password, status, date_creation, date_update) " . "VALUES ('" . _session('name_first') . "', '" . _session('name_last') . "', '{$username}', '{$mdpass}', 'normal', NOW(), NOW())");
    $id_author = lcm_insert_id('lcm_author', 'id_author');
    // Add e-mail to lcm_contact
    lcm_query("INSERT INTO lcm_contact (type_person, type_contact, id_of_person, value)\n\t\t\tVALUES ('author', " . $kwg_email['id_group'] . ", {$id_author}, '" . _session('email') . "')");
    // Prepare the e-mail to send to the user
    $site_name = _T(read_meta('site_name'));
    $site_address = read_meta('site_address');
    $message = _T('info_greetings') . ",\n\n";
    $message .= _T('pass_info_here_info', array('site_name' => $site_name, 'site_address' => $site_address)) . "\n\n";
    $message .= "- " . _Ti('login_login') . " {$username}\n";
    $message .= "- " . _Ti('login_password') . " {$pass}\n\n";
    if ($open_subscription == 'moderated') {
        $message .= _T('pass_info_moderated') . "\n\n";
    }
    $message .= _T('pass_info_automated_msg') . "\n\n";
    if (send_email(_session('email'), "[{$site_name}] " . _T('pass_title_personal_identifier'), $message)) {
        echo "<p>" . _T('pass_info_identifier_mail') . "</p>\n";
    } else {
        $email_admin = read_meta('email_sysadmin');
        echo "<div class=\"box_error\"><p>" . _T('pass_warning_mail_failure', array('email_admin' => $email_admin)) . "</p></div>\n";
    }
    // If moderated, send copy to site admin
    if ($open_subscription == 'moderated') {
        $email_admin = read_meta('email_sysadmin');
        send_email($email_admin, "[{$site_name}] " . _T('pass_title_personal_identifier'), $message);
    }
}
开发者ID:nyimbi,项目名称:legalcase,代码行数:81,代码来源:lcm_pass.php

示例8: include_lcm

	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: edit_exp.php,v 1.4 2007/03/20 14:16:59 mlutfy Exp $
*/
include 'inc/inc.php';
include_lcm('inc_acc');
include_lcm('inc_filters');
include_lcm('inc_obj_exp');
// Don't clear form data if comming back from upd_exp with errors
if (!isset($_SESSION['form_data'])) {
    $_SESSION['form_data'] = array();
}
// Set the returning page, usually, there should not be, therefore
// it will send back to "fu_det.php?followup=NNN" after update.
$_SESSION['form_data']['ref_edit_fu'] = _request('ref');
//
// Check for access rights
//
// TODO
$edit = 1;
$write = 1;
if (!($admin || $write)) {
    lcm_panic("You don't have permission to add follow-ups to this case");
开发者ID:nyimbi,项目名称:legalcase,代码行数:30,代码来源:edit_exp.php

示例9: install_step_3

function install_step_3()
{
    $db_address = _request('db_address');
    $db_login = _request('db_login');
    $db_password = _request('db_password');
    global $lcm_db_version;
    $install_log = "";
    $upgrade_log = "";
    // Possible errors will get trapped in the output buffer and displayed later,
    // so that they don't mess up with headers/html.
    ob_start();
    if (_request('db_choice') == "__manual__") {
        $sel_db = _request('manual_db');
    } else {
        $sel_db = _request('db_choice');
    }
    $link = lcm_connect_db($db_address, 0, $db_login, $db_password, $sel_db);
    $io_output = ob_get_contents();
    ob_end_clean();
    if (!$link) {
        install_html_start('AUTO', '', 3);
        lcm_panic("connection denied: " . lcm_sql_error());
    }
    //
    // TEMPORARY (used by testing the installer)
    /*
    lcm_query("DROP TABLE lcm_case", true);
    lcm_query("DROP TABLE lcm_case_attachment", true);
    lcm_query("DROP TABLE lcm_stage", true);
    lcm_query("DROP TABLE lcm_followup", true);
    lcm_query("DROP TABLE lcm_author", true);
    lcm_query("DROP TABLE lcm_client", true);
    lcm_query("DROP TABLE lcm_client_attachment", true);
    lcm_query("DROP TABLE lcm_org", true);
    lcm_query("DROP TABLE lcm_org_attachment", true);
    lcm_query("DROP TABLE lcm_contact", true);
    lcm_query("DROP TABLE lcm_keyword", true);
    lcm_query("DROP TABLE lcm_keyword_case", true);
    lcm_query("DROP TABLE lcm_keyword_client", true);
    lcm_query("DROP TABLE lcm_keyword_org", true);
    lcm_query("DROP TABLE lcm_keyword_group", true);
    lcm_query("DROP TABLE lcm_report", true);
    lcm_query("DROP TABLE lcm_fields", true);
    lcm_query("DROP TABLE lcm_filter", true);
    lcm_query("DROP TABLE lcm_app", true);
    lcm_query("DROP TABLE lcm_app_client_org", true);
    lcm_query("DROP TABLE lcm_app_fu", true);
    lcm_query("DROP TABLE lcm_author_app", true);
    lcm_query("DROP TABLE lcm_case_client_org", true);
    lcm_query("DROP TABLE lcm_case_author", true);
    lcm_query("DROP TABLE lcm_client_org", true);
    lcm_query("DROP TABLE lcm_rep_col", true);
    lcm_query("DROP TABLE lcm_rep_line", true);
    lcm_query("DROP TABLE lcm_rep_filters", true);
    lcm_query("DROP TABLE lcm_filter_conds", true);
    lcm_query("DROP TABLE lcm_rep_filter", true);
    lcm_query("DROP TABLE lcm_meta", true);
    */
    // Test if the software was already installed
    $result = lcm_query("SELECT * FROM lcm_meta", true);
    $already_installed = !lcm_sql_errno() && lcm_num_rows($result);
    $old_lcm_version = 'NONE';
    if ($already_installed) {
        lcm_log("LCM already installed", 'install');
        // Find the current database version
        $old_lcm_db_version = 0;
        $query = "SELECT value FROM lcm_meta WHERE name = 'lcm_db_version'";
        $result = lcm_query_db($query);
        while ($row = lcm_fetch_array($result)) {
            $old_lcm_db_version = $row['value'];
        }
        lcm_log("LCM version installed is {$old_lcm_db_version}", 'install');
        // Check if upgrade is needed
        if ($old_lcm_db_version < $lcm_db_version) {
            lcm_log("Calling the upgrade procedure (since < {$lcm_db_version})", 'install');
            include_lcm('inc_db_upgrade');
            $upgrade_log = upgrade_database($old_lcm_db_version);
        } else {
            lcm_log("Upgrade _not_ called, looks OK (= {$lcm_db_version})", 'install');
        }
    } else {
        lcm_log("Creating the database from scratch", 'install');
        include_lcm('inc_db_create');
        $install_log .= create_database();
        lcm_log("DB creation complete", 'install');
    }
    // Create default meta + keywords
    include_lcm('inc_meta');
    include_lcm('inc_keywords_default');
    include_lcm('inc_meta_defaults');
    init_default_config();
    init_languages();
    $skwg = get_default_keywords();
    create_groups($skwg);
    write_metas();
    // regenerate inc/data/inc_meta_cache.php
    // Test DB: not used for now..
    include_lcm('inc_db_test');
    $structure_ok = lcm_structure_test();
    if (!empty($install_log)) {
//.........这里部分代码省略.........
开发者ID:nyimbi,项目名称:legalcase,代码行数:101,代码来源:install.php

示例10: include_lcm

<?php

include 'inc/inc_version.php';
include_lcm('inc_presentation');
use_language_of_visitor();
function bad_dirs($bad_dirs, $test_dir, $install)
{
    install_html_start();
    if ($install) {
        $titre = _T('directories_setup_start');
    } else {
        $titre = _T('directories_setup_problem');
    }
    $bad_url = "lcm_test_dirs.php";
    if ($test_dir) {
        $bad_url .= '?test_dir=' . $test_dir;
    }
    echo "<h3>" . $titre . "</h3>\n";
    echo "<div align='right'>" . menu_languages('var_lang_lcm') . "</div>\n";
    echo "<div class='box_error'>\n";
    echo "<p>" . _T('directories_bad_rights') . "</p>\n";
    echo "<ul>" . $bad_dirs . "</ul>\n";
    echo "<p>" . _T('directories_bad_rights_cause') . lcm_help('install_permissions') . "</p>\n";
    echo "</div>\n";
    echo "<p>" . _T('directories_continue') . "</p>\n";
    echo "<form action='{$bad_urls}' method='get'>\n";
    echo "<div align='right'><button class='fondl' name='Validate'>" . _T('button_reload_page') . "</button></div>";
    echo "</form>";
    install_html_end();
}
function absent_dirs($bad_dirs, $test_dir)
开发者ID:nyimbi,项目名称:legalcase,代码行数:31,代码来源:lcm_test_dirs.php

示例11: define

	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: inc_obj_fu.php,v 1.27 2008/04/07 19:13:03 mlutfy Exp $
*/
// Execute this file only once
if (defined('_INC_OBJ_FU')) {
    return;
}
define('_INC_OBJ_FU', '1');
include_lcm('inc_db');
include_lcm('inc_obj_generic');
class LcmFollowup extends LcmObject
{
    // Note: Since PHP5 we should use "private", and generates a warning,
    // but we must support PHP >= 4.0.
    var $data;
    function LcmFollowup($id_fu = 0, $id_case = 0)
    {
        $id_fu = intval($id_fu);
        $id_case = intval($id_case);
        $this->data = array();
        if ($id_fu > 0) {
            $query = "SELECT fu.*, a.name_first, a.name_middle, a.name_last, " . lcm_query_subst_time('fu.date_start', 'fu.date_end') . " as length\n\t\t\t\t\tFROM lcm_followup as fu, lcm_author as a\n\t\t\t\t\tWHERE id_followup = {$id_fu}\n\t\t\t\t\t  AND fu.id_author = a.id_author";
            $result = lcm_query($query);
            if ($row = lcm_fetch_array($result)) {
                foreach ($row as $key => $val) {
开发者ID:nyimbi,项目名称:legalcase,代码行数:31,代码来源:inc_obj_fu.php

示例12: save

 function save()
 {
     $errors = $this->validate();
     if (count($errors)) {
         return $errors;
     }
     //
     // Update record in database
     //
     $cl = "name_first = '" . clean_input($this->getDataString('name_first')) . "',\n\t\t\t   name_middle = '" . clean_input($this->getDataString('name_middle')) . "',\n\t\t\t   name_last = '" . clean_input($this->getDataString('name_last')) . "',\n\t\t\t   gender = '" . clean_input($this->getDataString('gender')) . "',\n\t\t\t   notes = '" . clean_input($this->getDataString('notes')) . "'";
     // ,
     if ($this->getDataString('date_birth')) {
         $cl .= ", date_birth = '" . $this->getDataString('date_birth') . "'";
     }
     $cl .= ", citizen_number = '" . clean_input($this->getDataString('citizen_number')) . "'";
     $cl .= ", civil_status = '" . clean_input($this->getDataString('civil_status')) . "'";
     $cl .= ", income = '" . clean_input($this->getDataString('income')) . "'";
     if ($this->getDataInt('id_client') > 0) {
         $q = "UPDATE lcm_client\n\t\t\t\tSET date_update = NOW(), \n\t\t\t\t\t{$cl} \n\t\t\t\tWHERE id_client = " . $this->getDataInt('id_client', '__ASSERT__');
         lcm_query($q);
     } else {
         $q = "INSERT INTO lcm_client\n\t\t\t\t\tSET date_creation = NOW(),\n\t\t\t\t\t\tdate_update = NOW(),\n\t\t\t\t\t\t{$cl}";
         $result = lcm_query($q);
         $this->data['id_client'] = lcm_insert_id('lcm_client', 'id_client');
     }
     // Keywords
     update_keywords_request('client', $this->getDataInt('id_client'));
     if ($_SESSION['errors']) {
         $errors = array_merge($_SESSION['errors'], $errors);
     }
     // Insert/update client contacts
     include_lcm('inc_contacts');
     update_contacts_request('client', $this->getDataInt('id_client'));
     if ($_SESSION['errors']) {
         $errors = array_merge($_SESSION['errors'], $errors);
     }
     return $errors;
 }
开发者ID:nyimbi,项目名称:legalcase,代码行数:38,代码来源:inc_obj_client.php

示例13: lcm_page_start

    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();
}
开发者ID:nyimbi,项目名称:legalcase,代码行数:31,代码来源:lcm_upgrade.php

示例14: filtrer_ical

function filtrer_ical($texte)
{
    include_lcm('inc_charsets');
    $texte = html2unicode($texte);
    $texte = unicode2charset(charset2unicode($texte, read_meta('charset'), 1), 'utf-8');
    $texte = preg_replace("/\n/", " ", $texte);
    $texte = preg_replace("/,/", "\\,", $texte);
    return $texte;
}
开发者ID:nyimbi,项目名称:legalcase,代码行数:9,代码来源:inc_filters.php

示例15: include_lcm

<?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();
开发者ID:nyimbi,项目名称:legalcase,代码行数:17,代码来源:calendar.php


注:本文中的include_lcm函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。