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


PHP UpdateUtil::table方法代码示例

本文整理汇总了PHP中Cx\Lib\UpdateUtil::table方法的典型用法代码示例。如果您正苦于以下问题:PHP UpdateUtil::table方法的具体用法?PHP UpdateUtil::table怎么用?PHP UpdateUtil::table使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cx\Lib\UpdateUtil的用法示例。


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

示例1: _marketUpdate

/**
 * Cloudrexx
 *
 * @link      http://www.cloudrexx.com
 * @copyright Cloudrexx AG 2007-2015
 *
 * According to our dual licensing model, this program can be used either
 * under the terms of the GNU Affero General Public License, version 3,
 * or under a proprietary license.
 *
 * The texts of the GNU Affero General Public License with an additional
 * permission and of our proprietary license can be found at and
 * in the LICENSE file you have received along with this program.
 *
 * 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 Affero General Public License for more details.
 *
 * "Cloudrexx" is a registered trademark of Cloudrexx AG.
 * The licensing of the program under the AGPLv3 does not imply a
 * trademark license. Therefore any rights, title and interest in
 * our trademarks remain entirely with us.
 */
function _marketUpdate()
{
    global $objDatabase, $_ARRAYLANG;
    $query = "SELECT id FROM " . DBPREFIX . "module_market_settings WHERE name='codeMode'";
    $objCheck = $objDatabase->SelectLimit($query, 1);
    if ($objCheck !== false) {
        if ($objCheck->RecordCount() == 0) {
            $query = "INSERT INTO `" . DBPREFIX . "module_market_settings` ( `id` , `name` , `value` , `description` , `type` )\n                        VALUES ( NULL , 'codeMode', '1', 'TXT_MARKET_SET_CODE_MODE', '2')";
            if ($objDatabase->Execute($query) === false) {
                return _databaseError($query, $objDatabase->ErrorMsg());
            }
        }
    } else {
        return _databaseError($query, $objDatabase->ErrorMsg());
    }
    $arrColumns = $objDatabase->MetaColumns(DBPREFIX . 'module_market_mail');
    if ($arrColumns === false) {
        setUpdateMsg(sprintf($_ARRAYLANG['TXT_UNABLE_GETTING_DATABASE_TABLE_STRUCTURE'], DBPREFIX . 'module_market_mail'));
        return false;
    }
    if (!isset($arrColumns['MAILTO'])) {
        $query = "ALTER TABLE `" . DBPREFIX . "module_market_mail` ADD `mailto` VARCHAR( 10 ) NOT NULL AFTER `content`";
        if ($objDatabase->Execute($query) === false) {
            return _databaseError($query, $objDatabase->ErrorMsg());
        }
    }
    /*****************************************************************
     * EXTENSION:    New attributes 'color' and 'sort_id' for entries *
     * ADDED:        Contrexx v2.1.0                                  *
     *****************************************************************/
    $arrColumns = $objDatabase->MetaColumns(DBPREFIX . 'module_market');
    if ($arrColumns === false) {
        setUpdateMsg(sprintf($_ARRAYLANG['TXT_UNABLE_GETTING_DATABASE_TABLE_STRUCTURE'], DBPREFIX . 'module_market'));
        return false;
    }
    if (!isset($arrColumns['SORT_ID'])) {
        $query = "ALTER TABLE `" . DBPREFIX . "module_market` ADD `sort_id` INT( 4 ) NOT NULL DEFAULT '0' AFTER `paypal`";
        if ($objDatabase->Execute($query) === false) {
            return _databaseError($query, $objDatabase->ErrorMsg());
        }
    }
    if (!isset($arrColumns['COLOR'])) {
        $query = "ALTER TABLE `" . DBPREFIX . "module_market` ADD `color` VARCHAR(50) NOT NULL DEFAULT '' AFTER `description`";
        if ($objDatabase->Execute($query) === false) {
            return _databaseError($query, $objDatabase->ErrorMsg());
        }
    }
    try {
        // delete obsolete table  contrexx_module_market_access
        \Cx\Lib\UpdateUtil::drop_table(DBPREFIX . 'module_market_access');
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_market_spez_fields', array('id' => array('type' => 'INT(5)', 'notnull' => true, 'auto_increment' => true, 'primary' => true), 'name' => array('type' => 'VARCHAR(100)'), 'value' => array('type' => 'VARCHAR(100)'), 'type' => array('type' => 'INT(1)', 'notnull' => true, 'default' => '1'), 'lang_id' => array('type' => 'INT(2)', 'notnull' => true, 'default' => '0'), 'active' => array('type' => 'INT(1)', 'notnull' => true, 'default' => '0')));
    } catch (\Cx\Lib\UpdateException $e) {
        DBG::trace();
        return \Cx\Lib\UpdateUtil::DefaultActionHandler($e);
    }
    return true;
}
开发者ID:Niggu,项目名称:cloudrexx,代码行数:81,代码来源:market.php

示例2: _dataUpdate

function _dataUpdate()
{
    global $objDatabase;
    $arrTables = $objDatabase->MetaTables('TABLES');
    if (!sizeof($arrTables)) {
        return _databaseError("MetaTables('TABLES')", 'Could not read Table metadata');
    }
    // Create neccessary tables if not present
    $tables = array('module_data_categories' => "CREATE TABLE `" . DBPREFIX . "module_data_categories` (\n              `category_id` int(4) unsigned NOT NULL default '0',\n              `lang_id` int(2) unsigned NOT NULL default '0',\n              `is_active` enum('0','1') NOT NULL default '1',\n              `parent_id` int(10) unsigned NOT NULL default '0',\n              `name` varchar(100) NOT NULL default '',\n              `active` enum('0','1') NOT NULL default '1',\n              `cmd` int(10) unsigned NOT NULL default '1',\n              `action` enum('content','overlaybox','subcategories') NOT NULL default 'content',\n              `sort` int(10) unsigned NOT NULL default '1',\n              `box_height` int(10) unsigned NOT NULL default '500',\n              `box_width` int(11) NOT NULL default '350',\n              `template` text NOT NULL,\n              PRIMARY KEY (`category_id`,`lang_id`)\n            ) ENGINE=InnoDB", 'module_data_message_to_category' => "CREATE TABLE `" . DBPREFIX . "module_data_message_to_category` (\n              `message_id` int(6) unsigned NOT NULL default '0',\n              `category_id` int(4) unsigned NOT NULL default '0',\n              `lang_id` int(2) unsigned NOT NULL default '0',\n              PRIMARY KEY (`message_id`,`category_id`,`lang_id`),\n              KEY `category_id` (`category_id`)\n            ) ENGINE=InnoDB", 'module_data_messages' => "CREATE TABLE `" . DBPREFIX . "module_data_messages` (\n              `message_id` int(6) unsigned NOT NULL auto_increment,\n              `user_id` int(5) unsigned NOT NULL default '0',\n              `time_created` int(14) unsigned NOT NULL default '0',\n              `time_edited` int(14) unsigned NOT NULL default '0',\n              `hits` int(7) unsigned NOT NULL default '0',\n              `active` enum('0','1') NOT NULL default '1',\n              `sort` int(10) unsigned NOT NULL default '1',\n              `mode` set('normal','forward') NOT NULL default 'normal',\n              `release_time` int(15) NOT NULL default '0',\n              `release_time_end` int(15) NOT NULL default '0',\n              PRIMARY KEY (`message_id`)\n            ) ENGINE=InnoDB", 'module_data_settings' => "CREATE TABLE `" . DBPREFIX . "module_data_settings` (\n              `name` varchar(50) NOT NULL default '',\n              `value` text NOT NULL,\n              PRIMARY KEY (`name`)\n            ) ENGINE=InnoDB");
    ///////////////////////////////////////////////////////////////////
    // Create tables                                                 //
    ///////////////////////////////////////////////////////////////////
    foreach ($tables as $name => $query) {
        if (in_array(DBPREFIX . $name, $arrTables)) {
            continue;
        }
        if (!$objDatabase->Execute($query)) {
            return _databaseError($query, $objDatabase->ErrorMsg());
        }
        // TODO: Unused
        //        $installed[] = $name;
    }
    try {
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_data_placeholders', array('id' => array('type' => 'INT(10)', 'unsigned' => true, 'notnull' => true, 'auto_increment' => true, 'primary' => true), 'type' => array('type' => 'SET(\'cat\',\'entry\')', 'notnull' => true, 'default' => ''), 'ref_id' => array('type' => 'INT(11)', 'notnull' => true, 'default' => '0'), 'placeholder' => array('type' => 'VARCHAR(255)', 'notnull' => true, 'default' => '')), array('placeholder' => array('fields' => array('placeholder'), 'type' => 'UNIQUE'), 'type' => array('fields' => array('type', 'ref_id'), 'type' => 'UNIQUE')));
    } catch (\Cx\Lib\UpdateException $e) {
        return \Cx\Lib\UpdateUtil::DefaultActionHandler($e);
    }
    $settings_query = "\nINSERT INTO `" . DBPREFIX . "module_data_settings` (`name`, `value`) VALUES\n('data_block_activated', '0'),\n('data_block_messages', '3'),\n('data_comments_activated', '1'),\n('data_comments_anonymous', '1'),\n('data_comments_autoactivate', '1'),\n('data_comments_editor', 'wysiwyg'),\n('data_comments_notification', '1'),\n('data_comments_timeout', '30'),\n('data_entry_action', 'overlaybox'),\n('data_general_introduction', '150'),\n('data_rss_activated', '0'),\n('data_rss_comments', '10'),\n('data_rss_messages', '5'),\n('data_tags_hitlist', '5'),\n('data_target_cmd', '1'),\n('data_template_category',\n'<!-- BEGIN datalist_category -->\n<!-- this displays the category and the subcategories -->\n<div class=\\\"datalist_block\\\">\n<dl>\n  <!-- BEGIN category -->\n  <dt class=\\\"cattitle\\\"><div class=\\\"bg\\\"><h4>[[CATTITLE]]</h4></div></dt>\n  <dd class=\\\"catcontent\\\">\n    <dl>\n      <!-- BEGIN entry -->\n      <dt>[[TITLE]]</dt>\n      <dd>\n        [[IMAGE]] [[CONTENT]] <a href=\\\"[[HREF]]\\\" [[CLASS]] [[TARGET]]>[[TXT_MORE]]</a>\n        <br style=\\\"clear: both;\\\" />\n      </dd>\n      <!-- END entry -->\n    </dl>\n  </dd>\n  <!-- END category -->\n</dl>\n</div>\n<!-- END datalist_category -->\n<!-- BEGIN datalist_single_category-->\n<!-- this displays just the entries of the category -->\n<div class=\\\"datalist_block\\\">\n<dl>\n  <!-- BEGIN single_entry -->\n  <dt class=\\\"cattitle\\\"><div class=\\\"bg\\\"><h4>[[TITLE]]</h4></div></dt>\n  <dd class=\\\"catcontent2\\\">\n    [[IMAGE]] <p>[[CONTENT]] <a href=\\\"[[HREF]]\\\" [[CLASS]] [[TARGET]]>[[TXT_MORE]]</a></p>\n    <div style=\\\"clear: both;\\\" />\n  </dd>\n  <!-- END single_entry -->\n</dl>\n</div>\n<!-- END datalist_single_category -->\n'),\n('data_template_entry',\n'<!-- BEGIN datalist_entry-->\n<div class=\\\"datalist_block\\\">\n<dl>\n  <dt>[[TITLE]]</dt>\n  <dd>\n    [[IMAGE]] [[CONTENT]] <a href=\\\"[[HREF]]\\\" [[CLASS]]>[[TXT_MORE]]</a>\n    <br style=\\\"clear: both;\\\" />\n  </dd>\n</dl>\n</div>\n<!-- END datalist_entry -->\n    '),\n('data_template_thickbox',\n'<!-- BEGIN thickbox -->\n<dl class=\\\"data_module\\\">\n  <dt><h6 style=\\\"margin-bottom:10px;\\\">[[TITLE]]</h6></dt>\n  <dd style=\\\"clear:left;\\\">\n    <!-- BEGIN image -->\n    <img src=\\\"[[PICTURE]]\\\" style=\\\"float: left; margin-right: 5px;\\\" />\n    <!-- END image -->\n    [[CONTENT]]\n    <!-- BEGIN attachment -->\n    <img src=\\\"/themes/default/images/arrow.gif\\\" width=\\\"16\\\" height=\\\"8\\\" />\n    <a href=\\\"javascript:void(0);\\\" onclick=\\\"window.open(\\'[[HREF]]\\', \\'attachment\\');\\\">[[TXT_DOWNLOAD]]</a>\n    <!-- END attachment -->\n  </dd>\n</dl>\n<!--<br /><img src=\\\"/themes/default/images/arrow.gif\\\" width=\\\"16\\\" height=\\\"8\\\" /><a onclick=\\\"Javascript:window.print();\\\" style=\\\"cursor:pointer;\\\">Drucken</a>-->\n<!-- END thickbox -->\n'),\n('data_thickbox_height', '450'),\n('data_thickbox_width', '400'),\n('data_voting_activated', '0');\n";
    ///////////////////////////////////////////////////////////////////
    // data module settings                                          //
    ///////////////////////////////////////////////////////////////////
    $query = "SELECT COUNT(*) AS recordcount FROM `" . DBPREFIX . "module_data_settings`";
    $objResult = $objDatabase->Execute($query);
    if ($objResult === false) {
        return _databaseError($query, $objDatabase->ErrorMsg());
    }
    if ($objResult->fields['recordcount'] == 0) {
        // module_data_settings table is empty. Fill it with default data.
        if (!$objDatabase->Execute($settings_query)) {
            return _databaseError($settings_query, $objDatabase->ErrorMsg());
        }
    }
    /*********************************************************
     * EXTENSION:	Thunbmail Image & Attachment description *
     * ADDED:		Contrexx v2.1.0					         *
     *********************************************************/
    try {
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_data_messages_lang', array('message_id' => array('type' => 'INT(6)', 'unsigned' => true, 'notnull' => true, 'default' => '0', 'primary' => true), 'lang_id' => array('type' => 'INT(2)', 'unsigned' => true, 'notnull' => true, 'default' => '0', 'primary' => true), 'is_active' => array('type' => 'ENUM(\'0\',\'1\')', 'default' => '1'), 'subject' => array('type' => 'VARCHAR(250)', 'default' => ''), 'content' => array('type' => 'text'), 'tags' => array('type' => 'VARCHAR(250)', 'default' => ''), 'image' => array('type' => 'VARCHAR(250)', 'default' => ''), 'thumbnail' => array('type' => 'VARCHAR(250)'), 'thumbnail_type' => array('type' => 'ENUM(\'original\',\'thumbnail\')', 'default' => 'original', 'after' => 'thumbnail'), 'thumbnail_width' => array('type' => 'TINYINT(3)', 'unsigned' => true, 'notnull' => true, 'default' => '0'), 'thumbnail_height' => array('type' => 'TINYINT(3)', 'unsigned' => true, 'notnull' => true, 'default' => '0'), 'attachment' => array('type' => 'VARCHAR(255)', 'default' => ''), 'attachment_description' => array('type' => 'VARCHAR(255)', 'default' => ''), 'mode' => array('type' => 'SET(\'normal\',\'forward\')', 'default' => 'normal'), 'forward_url' => array('type' => 'VARCHAR(255)', 'default' => ''), 'forward_target' => array('type' => 'VARCHAR(40)', 'notnull' => false)), array(), 'InnoDB');
    } catch (\Cx\Lib\UpdateException $e) {
        return \Cx\Lib\UpdateUtil::DefaultActionHandler($e);
    }
    return true;
}
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:53,代码来源:data.php

示例3: _votingUpdate

/**
 * Cloudrexx
 *
 * @link      http://www.cloudrexx.com
 * @copyright Cloudrexx AG 2007-2015
 *
 * According to our dual licensing model, this program can be used either
 * under the terms of the GNU Affero General Public License, version 3,
 * or under a proprietary license.
 *
 * The texts of the GNU Affero General Public License with an additional
 * permission and of our proprietary license can be found at and
 * in the LICENSE file you have received along with this program.
 *
 * 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 Affero General Public License for more details.
 *
 * "Cloudrexx" is a registered trademark of Cloudrexx AG.
 * The licensing of the program under the AGPLv3 does not imply a
 * trademark license. Therefore any rights, title and interest in
 * our trademarks remain entirely with us.
 */
function _votingUpdate()
{
    try {
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'voting_system', array('id' => array('type' => 'INT', 'notnull' => true, 'primary' => true, 'auto_increment' => true), 'date' => array('type' => 'TIMESTAMP', 'notnull' => true, 'default_expr' => 'CURRENT_TIMESTAMP'), 'title' => array('type' => 'VARCHAR(60)', 'notnull' => true, 'default' => '', 'renamefrom' => 'name'), 'question' => array('type' => 'TEXT', 'notnull' => false), 'status' => array('type' => 'TINYINT(1)', 'notnull' => false, 'default' => 1), 'votes' => array('type' => 'INT(11)', 'notnull' => false, 'default' => 0), 'submit_check' => array('type' => "ENUM('cookie','email')", 'notnull' => true, 'default' => 'cookie'), 'additional_nickname' => array('type' => 'TINYINT(1)', 'notnull' => true, 'default' => 0), 'additional_forename' => array('type' => 'TINYINT(1)', 'notnull' => true, 'default' => 0), 'additional_surname' => array('type' => 'TINYINT(1)', 'notnull' => true, 'default' => 0), 'additional_phone' => array('type' => 'TINYINT(1)', 'notnull' => true, 'default' => 0), 'additional_street' => array('type' => 'TINYINT(1)', 'notnull' => true, 'default' => 0), 'additional_zip' => array('type' => 'TINYINT(1)', 'notnull' => true, 'default' => 0), 'additional_email' => array('type' => 'TINYINT(1)', 'notnull' => true, 'default' => 0), 'additional_city' => array('type' => 'TINYINT(1)', 'notnull' => true, 'default' => 0), 'additional_comment' => array('type' => 'TINYINT(1)', 'notnull' => true, 'default' => 0)));
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'voting_additionaldata', array('id' => array('type' => 'INT(11)', 'notnull' => true, 'auto_increment' => true, 'primary' => true), 'nickname' => array('type' => 'VARCHAR(80)', 'notnull' => true, 'default' => '', 'renamefrom' => 'name'), 'surname' => array('type' => 'VARCHAR(80)', 'notnull' => true, 'default' => ''), 'phone' => array('type' => 'VARCHAR(80)', 'notnull' => true, 'default' => ''), 'street' => array('type' => 'VARCHAR(80)', 'notnull' => true, 'default' => ''), 'zip' => array('type' => 'VARCHAR(30)', 'notnull' => true, 'default' => ''), 'city' => array('type' => 'VARCHAR(80)', 'notnull' => true, 'default' => ''), 'email' => array('type' => 'VARCHAR(80)', 'notnull' => true, 'default' => ''), 'comment' => array('type' => 'TEXT', 'after' => 'email'), 'voting_system_id' => array('type' => 'INT(11)', 'notnull' => true, 'default' => '0', 'renamefrom' => 'voting_sytem_id'), 'date_entered' => array('type' => 'TIMESTAMP', 'notnull' => true, 'default_expr' => 'CURRENT_TIMESTAMP', 'on_update' => 'CURRENT_TIMESTAMP'), 'forename' => array('type' => 'VARCHAR(80)', 'notnull' => true, 'default' => '')), array('voting_system_id' => array('fields' => array('voting_system_id'))));
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'voting_email', array('id' => array('type' => 'INT(10)', 'unsigned' => true, 'notnull' => true, 'auto_increment' => true, 'primary' => true), 'email' => array('type' => 'VARCHAR(255)'), 'valid' => array('type' => 'ENUM(\'0\',\'1\')', 'notnull' => true, 'default' => '0')), array('email' => array('fields' => array('email'), 'type' => 'UNIQUE')));
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'voting_rel_email_system', array('email_id' => array('type' => 'INT(10)', 'unsigned' => true, 'notnull' => true, 'default' => '0'), 'system_id' => array('type' => 'INT(10)', 'unsigned' => true, 'notnull' => true, 'default' => '0'), 'voting_id' => array('type' => 'INT(10)', 'unsigned' => true, 'notnull' => true, 'default' => '0'), 'valid' => array('type' => 'ENUM(\'0\',\'1\')', 'notnull' => true, 'default' => '0')), array('email_id' => array('fields' => array('email_id', 'system_id'), 'type' => 'UNIQUE')));
    } catch (\Cx\Lib\UpdateException $e) {
        return \Cx\Lib\UpdateUtil::DefaultActionHandler($e);
    }
    return true;
}
开发者ID:Niggu,项目名称:cloudrexx,代码行数:36,代码来源:voting.php

示例4: _downloadsUpdate

/**
 * Cloudrexx
 *
 * @link      http://www.cloudrexx.com
 * @copyright Cloudrexx AG 2007-2015
 *
 * According to our dual licensing model, this program can be used either
 * under the terms of the GNU Affero General Public License, version 3,
 * or under a proprietary license.
 *
 * The texts of the GNU Affero General Public License with an additional
 * permission and of our proprietary license can be found at and
 * in the LICENSE file you have received along with this program.
 *
 * 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 Affero General Public License for more details.
 *
 * "Cloudrexx" is a registered trademark of Cloudrexx AG.
 * The licensing of the program under the AGPLv3 does not imply a
 * trademark license. Therefore any rights, title and interest in
 * our trademarks remain entirely with us.
 */
function _downloadsUpdate()
{
    global $objDatabase, $_ARRAYLANG, $_CORELANG;
    try {
        \Cx\Lib\UpdateUtil::sql("UPDATE " . DBPREFIX . "module_downloads_download_locale l SET\n              l.source = (SELECT source FROM " . DBPREFIX . "module_downloads_download d WHERE d.id = l.download_id),\n              l.source_name = (SELECT source_name FROM " . DBPREFIX . "module_downloads_download d WHERE d.id = l.download_id);");
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_downloads_download', array('id' => array('type' => 'INT(10)', 'unsigned' => true, 'notnull' => true, 'auto_increment' => true), 'type' => array('type' => 'ENUM(\'file\',\'url\')', 'notnull' => true, 'default' => 'file', 'after' => 'id'), 'mime_type' => array('type' => 'ENUM(\'image\',\'document\',\'pdf\',\'media\',\'archive\',\'application\',\'link\')', 'notnull' => true, 'default' => 'image', 'after' => 'type'), 'icon' => array('type' => 'ENUM(\'_blank\',\'avi\',\'bmp\',\'css\',\'doc\',\'dot\',\'exe\',\'fla\',\'gif\',\'htm\',\'html\',\'inc\',\'jpg\',\'js\',\'mp3\',\'nfo\',\'pdf\',\'php\',\'png\',\'pps\',\'ppt\',\'rar\',\'swf\',\'txt\',\'wma\',\'xls\',\'zip\')', 'notnull' => true, 'default' => '_blank', 'after' => 'source_name'), 'size' => array('type' => 'INT(10)', 'unsigned' => true, 'notnull' => true, 'default' => '0', 'after' => 'icon'), 'image' => array('type' => 'VARCHAR(255)', 'notnull' => true, 'default' => '', 'after' => 'size'), 'owner_id' => array('type' => 'INT(5)', 'unsigned' => true, 'notnull' => true, 'default' => '0', 'after' => 'image'), 'access_id' => array('type' => 'INT(10)', 'unsigned' => true, 'notnull' => true, 'default' => '0', 'after' => 'owner_id'), 'license' => array('type' => 'VARCHAR(255)', 'notnull' => true, 'default' => '', 'after' => 'access_id'), 'version' => array('type' => 'VARCHAR(10)', 'notnull' => true, 'default' => '', 'after' => 'license'), 'author' => array('type' => 'VARCHAR(100)', 'notnull' => true, 'default' => '', 'after' => 'version'), 'website' => array('type' => 'VARCHAR(255)', 'notnull' => true, 'default' => '', 'after' => 'author'), 'ctime' => array('type' => 'INT(14)', 'unsigned' => true, 'notnull' => true, 'default' => '0', 'after' => 'website'), 'mtime' => array('type' => 'INT(14)', 'unsigned' => true, 'notnull' => true, 'default' => '0', 'after' => 'ctime'), 'is_active' => array('type' => 'TINYINT(3)', 'unsigned' => true, 'notnull' => true, 'default' => '0', 'after' => 'mtime'), 'visibility' => array('type' => 'TINYINT(1)', 'unsigned' => true, 'notnull' => true, 'default' => '1', 'after' => 'is_active'), 'order' => array('type' => 'INT(3)', 'unsigned' => true, 'notnull' => true, 'default' => '0', 'after' => 'visibility'), 'views' => array('type' => 'INT(10)', 'unsigned' => true, 'notnull' => true, 'default' => '0', 'after' => 'order'), 'download_count' => array('type' => 'INT(10)', 'unsigned' => true, 'notnull' => true, 'default' => '0', 'after' => 'views'), 'expiration' => array('type' => 'INT(14)', 'unsigned' => true, 'notnull' => true, 'default' => '0', 'after' => 'download_count'), 'validity' => array('type' => 'INT(10)', 'unsigned' => true, 'notnull' => true, 'default' => '0', 'after' => 'expiration')), array('is_active' => array('fields' => array('is_active')), 'visibility' => array('fields' => array('visibility'))));
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_downloads_download_locale', array('lang_id' => array('type' => 'INT(11)', 'unsigned' => true, 'notnull' => true, 'default' => '0'), 'download_id' => array('type' => 'INT(11)', 'unsigned' => true, 'notnull' => true, 'default' => '0', 'after' => 'lang_id'), 'name' => array('type' => 'VARCHAR(255)', 'notnull' => true, 'default' => '', 'after' => 'download_id'), 'source' => array('type' => 'VARCHAR(255)', 'after' => 'name'), 'source_name' => array('type' => 'VARCHAR(255)', 'after' => 'source'), 'description' => array('type' => 'text', 'after' => 'source_name')), array('name' => array('fields' => array('name'), 'type' => 'FULLTEXT'), 'description' => array('fields' => array('description'), 'type' => 'FULLTEXT')));
    } catch (\Cx\Lib\UpdateException $e) {
        // we COULD do something else here..
        return \Cx\Lib\UpdateUtil::DefaultActionHandler($e);
    }
    return true;
}
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:37,代码来源:downloads.php

示例5: _galleryUpdate

function _galleryUpdate()
{
    global $objDatabase, $_ARRAYLANG;
    try {
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_gallery_categories', array('id' => array('type' => 'INT(11)', 'notnull' => true, 'auto_increment' => true, 'primary' => true), 'pid' => array('type' => 'INT(11)', 'notnull' => true, 'default' => '0'), 'sorting' => array('type' => 'INT(6)', 'notnull' => true, 'default' => '0'), 'status' => array('type' => 'SET(\'0\',\'1\')', 'notnull' => true, 'default' => '1'), 'comment' => array('type' => 'SET(\'0\',\'1\')', 'notnull' => true, 'default' => '0'), 'voting' => array('type' => 'SET(\'0\',\'1\')', 'notnull' => true, 'default' => '0'), 'backendProtected' => array('type' => 'INT(11)', 'notnull' => true, 'default' => '0'), 'backend_access_id' => array('type' => 'INT(11)', 'notnull' => true, 'default' => '0'), 'frontendProtected' => array('type' => 'INT(11)', 'notnull' => true, 'default' => '0'), 'frontend_access_id' => array('type' => 'INT(11)', 'notnull' => true, 'default' => '0')));
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_gallery_pictures', array('id' => array('type' => 'INT(11)', 'notnull' => true, 'auto_increment' => true, 'primary' => true), 'catid' => array('type' => 'INT(11)', 'notnull' => true, 'default' => '0'), 'validated' => array('type' => 'SET(\'0\',\'1\')', 'notnull' => true, 'default' => '0'), 'status' => array('type' => 'SET(\'0\',\'1\')', 'notnull' => true, 'default' => '1'), 'catimg' => array('type' => 'SET(\'0\',\'1\')', 'notnull' => true, 'default' => '0'), 'sorting' => array('type' => 'INT(6) UNSIGNED', 'notnull' => true, 'default' => '999'), 'size_show' => array('type' => 'SET(\'0\',\'1\')', 'notnull' => true, 'default' => '1'), 'path' => array('type' => 'TEXT', 'notnull' => true), 'link' => array('type' => 'TEXT', 'notnull' => true), 'lastedit' => array('type' => 'INT(14)', 'notnull' => true, 'default' => '0'), 'size_type' => array('type' => "SET('abs', 'proz')", 'notnull' => true, 'default' => 'proz'), 'size_proz' => array('type' => "INT(3)", 'notnull' => true, 'default' => '0'), 'size_abs_h' => array('type' => 'INT(11)', 'notnull' => true, 'default' => '0'), 'size_abs_w' => array('type' => 'INT(11)', 'notnull' => true, 'default' => '0'), 'quality' => array('type' => 'TINYINT(3)', 'notnull' => true, 'default' => '0')), array('galleryPicturesIndex' => array('type' => 'FULLTEXT', 'fields' => array('path'))));
    } catch (\Cx\Lib\UpdateException $e) {
        return \Cx\Lib\UpdateUtil::DefaultActionHandler($e);
    }
    $arrSettings = array('1' => array('name' => 'max_images_upload', 'value' => '10'), '2' => array('name' => 'standard_quality', 'value' => '95'), '3' => array('name' => 'standard_size_proz', 'value' => '25'), '4' => array('name' => 'standard_width_abs', 'value' => '140'), '6' => array('name' => 'standard_height_abs', 'value' => '0'), '7' => array('name' => 'standard_size_type', 'value' => 'abs'), '8' => array('name' => 'validation_show_limit', 'value' => '10'), '9' => array('name' => 'validation_standard_type', 'value' => 'all'), '11' => array('name' => 'show_names', 'value' => 'off'), '12' => array('name' => 'quality', 'value' => '95'), '13' => array('name' => 'show_comments', 'value' => 'off'), '14' => array('name' => 'show_voting', 'value' => 'off'), '15' => array('name' => 'enable_popups', 'value' => 'on'), '16' => array('name' => 'image_width', 'value' => '1200'), '17' => array('name' => 'paging', 'value' => '30'), '18' => array('name' => 'show_latest', 'value' => 'on'), '19' => array('name' => 'show_random', 'value' => 'on'), '20' => array('name' => 'header_type', 'value' => 'hierarchy'), '21' => array('name' => 'show_ext', 'value' => 'off'), '22' => array('name' => 'show_file_name', 'value' => 'on'), '23' => array('name' => 'slide_show', 'value' => 'slideshow'), '24' => array('name' => 'slide_show_seconds', 'value' => '3'));
    foreach ($arrSettings as $id => $arrSetting) {
        $query = "SELECT 1 FROM `" . DBPREFIX . "module_gallery_settings` WHERE `name`= '" . $arrSetting['name'] . "'";
        if (($objRS = $objDatabase->Execute($query)) === false) {
            return _databaseError($query, $objDatabase->ErrorMsg());
        }
        if ($objRS->RecordCount() == 0) {
            $query = "\n                INSERT INTO `" . DBPREFIX . "module_gallery_settings` (`id`, `name`, `value`)\n                VALUES (" . $id . ", '" . $arrSetting['name'] . "', '" . $arrSetting['value'] . "')\n                ON DUPLICATE KEY UPDATE `id` = `id`\n            ";
            if ($objDatabase->Execute($query) === false) {
                return _databaseError($query, $objDatabase->ErrorMsg());
            }
        }
    }
    /**************************************************************************
     * EXTENSION:   cleanup: delete translations, comments and                *
     *              votes of inexisting pictures                              *
     * ADDED:       Contrexx v3.0.1                                           *
     **************************************************************************/
    try {
        \Cx\Lib\UpdateUtil::sql('
            DELETE `language_pics`
            FROM `' . DBPREFIX . 'module_gallery_language_pics` as `language_pics` LEFT JOIN `' . DBPREFIX . 'module_gallery_pictures` as `pictures` ON `pictures`.`id` = `language_pics`.`picture_id`
            WHERE `pictures`.`id` IS NULL
        ');
        \Cx\Lib\UpdateUtil::sql('
            DELETE `comments`
            FROM `' . DBPREFIX . 'module_gallery_comments` as `comments` LEFT JOIN `' . DBPREFIX . 'module_gallery_pictures` as `pictures` ON `pictures`.`id` = `comments`.`picid`
            WHERE `pictures`.`id` IS NULL
        ');
        \Cx\Lib\UpdateUtil::sql('
            DELETE `votes`
            FROM `' . DBPREFIX . 'module_gallery_votes` as `votes` LEFT JOIN `' . DBPREFIX . 'module_gallery_pictures` as `pictures` ON `pictures`.`id` = `votes`.`picid`
            WHERE `pictures`.`id` IS NULL
        ');
    } catch (\Cx\Lib\UpdateException $e) {
        return \Cx\Lib\UpdateUtil::DefaultActionHandler($e);
    }
    // remove the script tag at the beginning of the gallery page
    \Cx\Lib\UpdateUtil::migrateContentPageUsingRegex(array('module' => 'gallery'), '/^\\s*(<script[^>]+>.+?Shadowbox.+?<\\/script>)+/sm', '', array('content'), '3.0.3');
    return true;
}
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:50,代码来源:gallery.php

示例6: _crmInstall

function _crmInstall()
{
    try {
        $result = \Cx\Lib\UpdateUtil::sql('SELECT `id` FROM `' . DBPREFIX . 'core_text` WHERE `section` = \'crm\'');
        if (!$result || $result->RecordCount() == 0) {
            // add core mail template table because it is possible it doesn't yet exist
            \Cx\Lib\UpdateUtil::table(DBPREFIX . 'core_mail_template', array('key' => array('type' => 'tinytext'), 'section' => array('type' => 'tinytext', 'after' => 'key'), 'text_id' => array('type' => 'INT(10)', 'unsigned' => true, 'after' => 'section'), 'html' => array('type' => 'TINYINT(1)', 'unsigned' => true, 'notnull' => true, 'default' => '0', 'after' => 'text_id'), 'protected' => array('type' => 'TINYINT(1)', 'unsigned' => true, 'notnull' => true, 'default' => '0', 'after' => 'html')), null, 'MyISAM', 'cx3upgrade');
            Cx\Lib\UpdateUtil::sql("\n                ALTER TABLE `" . DBPREFIX . "core_mail_template`\n                ADD PRIMARY KEY (`key` (32), `section` (32))\n            ");
            // migrate mail templates
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_text` (`id`, `lang_id`, `section`, `key`, `text`) VALUES(12, 1, \'crm\', \'core_mail_template_bcc\', \'\')');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_text` (`id`, `lang_id`, `section`, `key`, `text`) VALUES(12, 1, \'crm\', \'core_mail_template_cc\', \'\')');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_text` (`id`, `lang_id`, `section`, `key`, `text`) VALUES(12, 1, \'crm\', \'core_mail_template_from\', \'info@example.com\')');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_text` (`id`, `lang_id`, `section`, `key`, `text`) VALUES(12, 1, \'crm\', \'core_mail_template_message\', \'Guten Tag,\\r\\n\\r\\nNachfolgend erhalten Sie Ihre persönlichen Zugangsdaten zur Website http://www.example.com/\\r\\n\\r\\nBenutzername: [CRM_CONTACT_USERNAME]\\r\\nKennwort: [CRM_CONTACT_PASSWORD]\')');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_text` (`id`, `lang_id`, `section`, `key`, `text`) VALUES(12, 1, \'crm\', \'core_mail_template_message_html\', \'<div>Guten Tag,<br />\\r\\n<br />\\r\\nNachfolgend erhalten Sie Ihre pers&ouml;nlichen Zugangsdaten zur Website <a href="http://www.example.com/">http://www.example.com/</a><br />\\r\\n<br />\\r\\nBenutzername: [CRM_CONTACT_USERNAME]<br />\\r\\nKennwort: [CRM_CONTACT_PASSWORD]</div>\')');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_text` (`id`, `lang_id`, `section`, `key`, `text`) VALUES(12, 1, \'crm\', \'core_mail_template_name\', \'Benachrichtigung über Benutzerkonto\')');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_text` (`id`, `lang_id`, `section`, `key`, `text`) VALUES(12, 1, \'crm\', \'core_mail_template_reply\', \'info@example.com\')');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_text` (`id`, `lang_id`, `section`, `key`, `text`) VALUES(12, 1, \'crm\', \'core_mail_template_sender\', \'Ihr Firmenname\')');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_text` (`id`, `lang_id`, `section`, `key`, `text`) VALUES(12, 1, \'crm\', \'core_mail_template_subject\', \'Ihr persönlischer Zugang\')');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_text` (`id`, `lang_id`, `section`, `key`, `text`) VALUES(12, 1, \'crm\', \'core_mail_template_to\', \'[CRM_CONTACT_EMAIL]\')');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_text` (`id`, `lang_id`, `section`, `key`, `text`) VALUES(13, 1, \'crm\', \'core_mail_template_bcc\', \'\')');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_text` (`id`, `lang_id`, `section`, `key`, `text`) VALUES(13, 1, \'crm\', \'core_mail_template_cc\', \'\')');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_text` (`id`, `lang_id`, `section`, `key`, `text`) VALUES(13, 1, \'crm\', \'core_mail_template_from\', \'info@example.com\')');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_text` (`id`, `lang_id`, `section`, `key`, `text`) VALUES(13, 1, \'crm\', \'core_mail_template_message\', \'Der Mitarbeiter [CRM_TASK_CREATED_USER] hat eine neue Aufgabe erstellt und Ihnen zugewiesen: [CRM_TASK_URL]\\r\\n\\r\\nBeschreibung: [CRM_TASK_DESCRIPTION_TEXT_VERSION]\\r\\n\\r\\nFällig am: [CRM_TASK_DUE_DATE]\\r\\n\')');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_text` (`id`, `lang_id`, `section`, `key`, `text`) VALUES(13, 1, \'crm\', \'core_mail_template_message_html\', \'<div style="padding:0px; margin:0px; font-family:Tahoma, sans-serif; font-size:14px; width:620px; color: #333;">\\r\\n<div style="padding: 0px 20px; border:1px solid #e0e0e0; margin-bottom: 10px; width:618px;">\\r\\n<h1 style="background-color: #e0e0e0;color: #3d4a6b;font-size: 18px;font-weight: normal;padding: 15px 20px;margin-top: 0 !important;margin-bottom: 0 !important;margin-left: -20px !important;margin-right: -20px !important;-webkit-margin-before: 0 !important;-webkit-margin-after: 0 !important;-webkit-margin-start: -20px !important;-webkit-margin-end: -20px !important;">Neue Aufgabe wurde Ihnen zugewiesen</h1>\\r\\n\\r\\n<p style="margin-top: 20px;word-wrap: break-word !important;">Der Mitarbeiter [CRM_TASK_CREATED_USER] hat eine neue Aufgabe erstellt und Ihnen zugewiesen: [CRM_TASK_LINK]</p>\\r\\n\\r\\n<p style="margin-top: 20px;word-wrap: break-word !important;">Beschreibung: [CRM_TASK_DESCRIPTION_HTML_VERSION]<br />\\r\\nF&auml;llig am: [CRM_TASK_DUE_DATE]</p>\\r\\n</div>\\r\\n</div>\')');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_text` (`id`, `lang_id`, `section`, `key`, `text`) VALUES(13, 1, \'crm\', \'core_mail_template_name\', \'Neue Aufgabe\')');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_text` (`id`, `lang_id`, `section`, `key`, `text`) VALUES(13, 1, \'crm\', \'core_mail_template_reply\', \'info@example.com\')');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_text` (`id`, `lang_id`, `section`, `key`, `text`) VALUES(13, 1, \'crm\', \'core_mail_template_sender\', \'Ihr Firmenname\')');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_text` (`id`, `lang_id`, `section`, `key`, `text`) VALUES(13, 1, \'crm\', \'core_mail_template_subject\', \'Neue Aufgabe : [CRM_TASK_NAME]\')');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_text` (`id`, `lang_id`, `section`, `key`, `text`) VALUES(13, 1, \'crm\', \'core_mail_template_to\', \'[CRM_ASSIGNED_USER_EMAIL]\')');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_text` (`id`, `lang_id`, `section`, `key`, `text`) VALUES(14, 1, \'crm\', \'core_mail_template_bcc\', \'\')');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_text` (`id`, `lang_id`, `section`, `key`, `text`) VALUES(14, 1, \'crm\', \'core_mail_template_cc\', \'\')');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_text` (`id`, `lang_id`, `section`, `key`, `text`) VALUES(14, 1, \'crm\', \'core_mail_template_from\', \'info@example.com\')');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_text` (`id`, `lang_id`, `section`, `key`, `text`) VALUES(14, 1, \'crm\', \'core_mail_template_message\', \'Im CRM wurde ein neuer Kontakt erfasst: [CRM_CONTACT_DETAILS_URL]\')');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_text` (`id`, `lang_id`, `section`, `key`, `text`) VALUES(14, 1, \'crm\', \'core_mail_template_message_html\', \'<div style="padding:0px; margin:0px; font-family:Tahoma, sans-serif; font-size:14px; width:620px; color: #333;">\\r\\n<div style="padding: 0px 20px; border:1px solid #e0e0e0; margin-bottom: 10px; width:618px;">\\r\\n<h1 style="background-color: #e0e0e0;color: #3d4a6b;font-size: 18px;font-weight: normal;padding: 15px 20px;margin-top: 0 !important;margin-bottom: 0 !important;margin-left: -20px !important;margin-right: -20px !important;-webkit-margin-before: 0 !important;-webkit-margin-after: 0 !important;-webkit-margin-start: -20px !important;-webkit-margin-end: -20px !important;">Neuer Kontakt im CRM</h1>\\r\\n\\r\\n<p style="margin-top: 20px;word-wrap: break-word !important;">Neuer Kontakt: [CRM_CONTACT_DETAILS_LINK].</p>\\r\\n</div>\\r\\n</div>\\r\\n\')');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_text` (`id`, `lang_id`, `section`, `key`, `text`) VALUES(14, 1, \'crm\', \'core_mail_template_name\', \'Benachrichtigung an Mitarbeiter über neue Kontakte\')');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_text` (`id`, `lang_id`, `section`, `key`, `text`) VALUES(14, 1, \'crm\', \'core_mail_template_reply\', \'info@example.com\')');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_text` (`id`, `lang_id`, `section`, `key`, `text`) VALUES(14, 1, \'crm\', \'core_mail_template_sender\', \'Ihr Firmenname\')');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_text` (`id`, `lang_id`, `section`, `key`, `text`) VALUES(14, 1, \'crm\', \'core_mail_template_subject\', \'Neuer Kontakt erfasst\')');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_text` (`id`, `lang_id`, `section`, `key`, `text`) VALUES(14, 1, \'crm\', \'core_mail_template_to\', \'[CRM_ASSIGNED_USER_EMAIL]\')');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_mail_template` (`key`, `section`, `text_id`, `html`, `protected`) VALUES(\'crm_user_account_created\', \'crm\', 12, 1, 1)');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_mail_template` (`key`, `section`, `text_id`, `html`, `protected`) VALUES(\'crm_notify_staff_on_contact_added\', \'crm\', 14, 1, 1)');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_mail_template` (`key`, `section`, `text_id`, `html`, `protected`) VALUES(\'crm_task_assigned\', \'crm\', 13, 1, 1)');
            \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_setting` (`section`, `name`, `group`, `type`, `value`, `values`, `ord`) VALUES (\'crm\',\'numof_mailtemplate_per_page_backend\',\'config\',\'text\',\'25\',\'\',1001)');
        }
    } catch (\Cx\Lib\UpdateException $e) {
        return \Cx\Lib\UpdateUtil::DefaultActionHandler($e);
    }
}
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:48,代码来源:crm.php

示例7: _u2uUpdate

function _u2uUpdate()
{
    global $objDatabase;
    try {
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_u2u_address_list', array('id' => array('type' => 'INT(11)', 'notnull' => true, 'auto_increment' => true, 'primary' => true), 'user_id' => array('type' => 'INT(11)', 'notnull' => true, 'default' => '0'), 'buddies_id' => array('type' => 'INT(11)', 'notnull' => true, 'default' => '0')), array(), 'InnoDB');
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_u2u_message_log', array('message_id' => array('type' => 'INT(11) UNSIGNED', 'notnull' => true, 'primary' => true, 'auto_increment' => true), 'message_text' => array('type' => 'TEXT', 'notnull' => true), 'message_title' => array('type' => 'TEXT', 'notnull' => true)), array(), 'InnoDB');
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_u2u_sent_messages', array('id' => array('type' => 'INT(11)', 'unsigned' => true, 'notnull' => true, 'auto_increment' => true, 'primary' => true), 'userid' => array('type' => 'INT(11)', 'unsigned' => true, 'notnull' => true, 'default' => '0'), 'message_id' => array('type' => 'INT(11)', 'unsigned' => true, 'notnull' => true, 'default' => '0'), 'receiver_id' => array('type' => 'INT(11)', 'unsigned' => true, 'notnull' => true, 'default' => '0'), 'mesage_open_status' => array('type' => 'ENUM(\'0\',\'1\')', 'notnull' => true, 'default' => '0'), 'date_time' => array('type' => 'DATETIME', 'notnull' => true, 'default' => '0000-00-00 00:00:00')), array(), 'InnoDB');
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_u2u_settings', array('id' => array('type' => 'INT(11)', 'unsigned' => true, 'notnull' => true, 'auto_increment' => true, 'primary' => true), 'name' => array('type' => 'VARCHAR(50)'), 'value' => array('type' => 'TEXT')), array(), 'InnoDB');
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_u2u_settings', array('id' => array('type' => 'INT(11) UNSIGNED', 'notnull' => true, 'primary' => true, 'auto_increment' => true), 'name' => array('type' => 'VARCHAR(50)', 'notnull' => true), 'value' => array('type' => 'TEXT', 'notnull' => true)), array(), 'InnoDB');
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_u2u_user_log', array('id' => array('type' => 'INT(11)', 'unsigned' => true, 'notnull' => true, 'auto_increment' => true, 'primary' => true), 'userid' => array('type' => 'INT(11)', 'unsigned' => true, 'notnull' => true, 'default' => '0'), 'user_sent_items' => array('type' => 'INT(11)', 'unsigned' => true, 'notnull' => true, 'default' => '0'), 'user_unread_items' => array('type' => 'INT(11)', 'unsigned' => true, 'notnull' => true, 'default' => '0'), 'user_status' => array('type' => 'ENUM(\'0\',\'1\')', 'notnull' => true, 'default' => '1')), array(), 'InnoDB');
    } catch (\Cx\Lib\UpdateException $e) {
        // we COULD do something else here..
        return \Cx\Lib\UpdateUtil::DefaultActionHandler($e);
    }
    /******************************************************
     * EXTENSION:    Initial adding of the settings values *
     * ADDED:        Contrexx v2.1.2                       *
     *******************************************************/
    $arrSettings = array('max_posting_size' => '2000', 'max_posting_chars' => '2000', 'wysiwyg_editor' => '1', 'subject' => 'Eine neue Nachricht von [senderName]', 'from' => 'Contrexx U2U Nachrichtensystem', 'email_message' => 'Hallo <strong>[receiverName]</strong>,<br />\\r\\n<br />\\r\\n<strong>[senderName]</strong> hat Ihnen eine private Nachricht gesendet. Um die Nachricht zu lesen, folgen Sie bitte folgendem Link:<br />\\r\\n<br />\\r\\nhttp://[domainName]/index.php?section=u2u&amp;cmd=notification<br />\\r\\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />\\r\\n<br />');
    foreach ($arrSettings as $name => $value) {
        $query = "SELECT 1 FROM `" . DBPREFIX . "module_u2u_settings` WHERE `name` = '" . $name . "'";
        $objResult = $objDatabase->SelectLimit($query, 1);
        if ($objResult) {
            if ($objResult->RecordCount() == 0) {
                $query = "INSERT INTO `" . DBPREFIX . "module_u2u_settings` (`name`, `value`) VALUES ('" . $name . "', '" . $value . "')";
                if ($objDatabase->Execute($query) === false) {
                    return _databaseError($query, $objDatabase->ErrorMsg());
                }
            }
        } else {
            return _databaseError($query, $objDatabase->ErrorMsg());
        }
    }
    /********************************
     * EXTENSION:   Timezone        *
     * ADDED:       Contrexx v3.0.0 *
     ********************************/
    try {
        \Cx\Lib\UpdateUtil::sql('ALTER TABLE `' . DBPREFIX . 'module_u2u_sent_messages` CHANGE `date_time` `date_time` TIMESTAMP NOT NULL DEFAULT "0000-00-00 00:00:00"');
    } catch (\Cx\Lib\UpdateException $e) {
        return \Cx\Lib\UpdateUtil::DefaultActionHandler($e);
    }
    return true;
}
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:44,代码来源:u2u.php

示例8: _knowledgeUpdate

function _knowledgeUpdate()
{
    global $objDatabase;
    try {
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_knowledge_article_content', array('id' => array('type' => 'INT(10)', 'notnull' => true, 'primary' => true, 'auto_increment' => true, 'unsigned' => true), 'article' => array('type' => 'INT(10)', 'notnull' => true, 'default' => 0, 'unsigned' => true), 'lang' => array('type' => 'INT(10)', 'notnull' => true, 'default' => 0, 'unsigned' => true), 'question' => array('type' => 'TEXT', 'notnull' => true, 'default' => 0), 'answer' => array('type' => 'TEXT', 'notnull' => true, 'default' => 0)), array('module_knowledge_article_content_lang' => array('fields' => array('lang')), 'module_knowledge_article_content_article' => array('fields' => array('article'))));
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_knowledge_articles', array('id' => array('type' => 'INT(10)', 'notnull' => true, 'primary' => true, 'auto_increment' => true, 'unsigned' => true), 'category' => array('type' => 'INT(10)', 'notnull' => true, 'default' => 0, 'unsigned' => true), 'active' => array('type' => 'TINYINT(1)', 'notnull' => true, 'default' => 1), 'hits' => array('type' => 'INT', 'notnull' => true, 'default' => 0), 'votes' => array('type' => 'INT', 'notnull' => true, 'default' => 0), 'votevalue' => array('type' => 'INT', 'notnull' => true, 'default' => 0), 'sort' => array('type' => 'INT', 'notnull' => true, 'default' => 0), 'date_created' => array('type' => 'INT(14)', 'notnull' => true, 'default' => 0), 'date_updated' => array('type' => 'INT(14)', 'notnull' => true, 'default' => 0)));
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_knowledge_categories', array('id' => array('type' => 'INT(10)', 'notnull' => true, 'primary' => true, 'auto_increment' => true, 'unsigned' => true), 'active' => array('type' => 'TINYINT(1)', 'notnull' => true, 'default' => 1, 'unsigned' => true), 'parent' => array('type' => 'INT(10)', 'notnull' => true, 'default' => 0, 'unsigned' => true), 'sort' => array('type' => 'INT(10)', 'notnull' => true, 'default' => 1, 'unsigned' => true)), array('module_knowledge_categories_sort' => array('fields' => array('sort')), 'module_knowledge_categories_parent' => array('fields' => array('parent'))));
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_knowledge_categories_content', array('id' => array('type' => 'INT(10)', 'notnull' => true, 'primary' => true, 'auto_increment' => true, 'unsigned' => true), 'category' => array('type' => 'INT(10)', 'notnull' => true, 'default' => 0, 'unsigned' => true), 'name' => array('type' => 'VARCHAR(255)', 'notnull' => true, 'default' => ''), 'lang' => array('type' => 'INT(11)', 'notnull' => true, 'default' => 1)));
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_knowledge_settings', array('id' => array('type' => 'INT(10)', 'notnull' => true, 'primary' => true, 'auto_increment' => true, 'unsigned' => true), 'name' => array('type' => 'VARCHAR(255)', 'notnull' => true, 'default' => ''), 'value' => array('type' => 'TEXT', 'notnull' => true, 'default' => 0)), array('module_knowledge_settings_name' => array('fields' => array('name'))));
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_knowledge_tags', array('id' => array('type' => 'INT(10)', 'notnull' => true, 'primary' => true, 'auto_increment' => true, 'unsigned' => true), 'name' => array('type' => 'VARCHAR(255)', 'notnull' => true, 'default' => ''), 'lang' => array('type' => 'INT(10)', 'notnull' => true, 'default' => 1, 'unsigned' => true)), array('module_knowledge_tags_name' => array('fields' => array('name'))));
        if (strpos(\Cx\Lib\UpdateUtil::sql('SHOW CREATE TABLE `' . DBPREFIX . 'module_knowledge_tags_articles`')->fields['Create Table'], 'UNIQUE KEY') === false) {
            \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_knowledge_tags_articles', array('id' => array('type' => 'INT(10)', 'notnull' => true, 'primary' => true, 'auto_increment' => true, 'unsigned' => true), 'article' => array('type' => 'INT(10)', 'notnull' => true, 'default' => 0, 'unsigned' => true), 'tag' => array('type' => 'INT(10)', 'notnull' => true, 'default' => 0, 'unsigned' => true)), array('module_knowledge_tags_articles_tag' => array('fields' => array('tag')), 'module_knowledge_tags_articles_article' => array('fields' => array('article'))));
        }
    } catch (\Cx\Lib\UpdateException $e) {
        // we COULD do something else here..
        return \Cx\Lib\UpdateUtil::DefaultActionHandler($e);
    }
    $arrSettings = array(array('name' => 'max_subcategories', 'value' => '5'), array('name' => 'column_number', 'value' => '2'), array('name' => 'max_rating', 'value' => '8'), array('name' => 'best_rated_sidebar_template', 'value' => '<h2>Bestbewertete Artikel</h2>\\r\\n<div class="clearfix">\\r\\n<ul class="knowledge_sidebar">\\r\\n<!-- BEGIN article -->\\r\\n<li><a href="[[URL]]">[[ARTICLE]]</a></li>\\r\\n<!-- END article -->\\r\\n</ul>\\r\\n</div>'), array('name' => 'best_rated_sidebar_length', 'value' => '82'), array('name' => 'best_rated_sidebar_amount', 'value' => '5'), array('name' => 'tag_cloud_sidebar_template', 'value' => '[[CLOUD]] <br style="clear: both;" />'), array('name' => 'most_read_sidebar_template', 'value' => '<h2>Bestbewertete Artikel 2</h2>\\r\\n<div class="clearfix">\\r\\n<ul class="knowledge_sidebar">\\r\\n<!-- BEGIN article -->\\r\\n<li><a href="[[URL]]">[[ARTICLE]]</a></li>\\r\\n<!-- END article -->\\r\\n</ul>\\r\\n</div>'), array('name' => 'most_read_sidebar_length', 'value' => '79'), array('name' => 'most_read_sidebar_amount', 'value' => '5'), array('name' => 'best_rated_siderbar_template', 'value' => ''), array('name' => 'most_read_amount', 'value' => '5'), array('name' => 'best_rated_amount', 'value' => '5'));
    foreach ($arrSettings as $arrSetting) {
        $query = "SELECT 1 FROM `" . DBPREFIX . "module_knowledge_settings` WHERE `name` = '" . $arrSetting['name'] . "'";
        $objResult = $objDatabase->SelectLimit($query, 1);
        if ($objResult !== false) {
            if ($objResult->RecordCount() == 0) {
                $query = "INSERT INTO `" . DBPREFIX . "module_knowledge_settings` (`name`, `value`) VALUES ('" . $arrSetting['name'] . "', '" . $arrSetting['value'] . "')";
                if ($objDatabase->Execute($query) === false) {
                    return _databaseError($query, $objDatabase->ErrorMsg());
                }
            }
        } else {
            return _databaseError($query, $objDatabase->ErrorMsg());
        }
    }
    /*******************************************
     * EXTENSION:    Duplicate entries clean up *
     * ADDED:        Contrexx v3.0.2            *
     *******************************************/
    try {
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_knowledge_tags_articles', array('article' => array('type' => 'INT(10)', 'unsigned' => true, 'notnull' => true, 'default' => '0'), 'tag' => array('type' => 'INT(10)', 'unsigned' => true, 'notnull' => true, 'default' => '0', 'after' => 'article')), array('article' => array('fields' => array('article', 'tag'), 'type' => 'UNIQUE', 'force' => true)), 'MyISAM');
    } catch (\Cx\Lib\UpdateException $e) {
        return \Cx\Lib\UpdateUtil::DefaultActionHandler($e);
    }
    return true;
}
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:43,代码来源:knowledge.php

示例9: _ecardUpdate

function _ecardUpdate()
{
    global $objDatabase, $_ARRAYLANG, $_CORELANG;
    try {
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_ecard_ecards', array('code' => array('type' => 'VARCHAR(35)', 'notnull' => true, 'default' => '', 'primary' => true), 'date' => array('type' => 'INT(10)', 'notnull' => true, 'default' => 0, 'unsigned' => true), 'TTL' => array('type' => 'INT(10)', 'notnull' => true, 'default' => 0, 'unsigned' => true), 'salutation' => array('type' => 'VARCHAR(100)', 'notnull' => true, 'default' => ''), 'senderName' => array('type' => 'VARCHAR(100)', 'notnull' => true, 'default' => ''), 'senderEmail' => array('type' => 'VARCHAR(100)', 'notnull' => true, 'default' => ''), 'recipientName' => array('type' => 'VARCHAR(100)', 'notnull' => true, 'default' => ''), 'recipientEmail' => array('type' => 'VARCHAR(100)', 'notnull' => true, 'default' => ''), 'message' => array('type' => 'TEXT', 'notnull' => true)));
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_ecard_settings', array('setting_name' => array('type' => 'VARCHAR(100)', 'notnull' => true, 'default' => '', 'primary' => true), 'setting_value' => array('type' => 'TEXT', 'notnull' => true, 'default' => 0)));
    } catch (\Cx\Lib\UpdateException $e) {
        return \Cx\Lib\UpdateUtil::DefaultActionHandler($e);
    }
    $ins_tpl = "\n        INSERT INTO " . DBPREFIX . "module_ecard_settings (setting_name, setting_value)\n        VALUES ('%s', '%s')\n        ON DUPLICATE KEY UPDATE `setting_name` = `setting_name`\n    ";
    $insert_values = array(array('maxCharacters', '100'), array('maxLines', '50'), array('motive_0', 'Bild_001.jpg'), array('motive_1', 'Bild_002.jpg'), array('motive_2', ''), array('motive_3', ''), array('motive_4', ''), array('motive_5', ''), array('motive_6', ''), array('motive_7', ''), array('motive_8', ''), array('maxHeight', '300'), array('validdays', '30'), array('maxWidth', '300'), array('maxHeightThumb', '80'), array('maxWidthThumb', '80'), array('subject', 'Sie haben eine E-Card erhalten!'), array('emailText', "[[ECARD_SENDER_NAME]] hat Ihnen eine E-Card geschickt.<br />\n Sie können diese während den nächsten [[ECARD_VALID_DAYS]] Tagen unter [[ECARD_URL]] abrufen."));
    foreach ($insert_values as $setting) {
        $query = sprintf($ins_tpl, addslashes($setting[0]), addslashes($setting[1]));
        if (!$objDatabase->Execute($query)) {
            return _databaseError($query, $objDatabase->ErrorMsg());
        }
    }
    /*     * **********************************************
     * BUGFIX:	Set write access to the image dir   *
     * ********************************************** */
    $arrImagePaths = array(array(ASCMS_DOCUMENT_ROOT . '/images/modules/ecard', ASCMS_PATH_OFFSET . '/images/modules/ecard'), array(ASCMS_ECARD_OPTIMIZED_PATH, ASCMS_ECARD_OPTIMIZED_WEB_PATH), array(ASCMS_ECARD_SEND_ECARDS_PATH, ASCMS_ECARD_SEND_ECARDS_WEB_PATH), array(ASCMS_ECARD_THUMBNAIL_PATH, ASCMS_ECARD_THUMBNAIL_WEB_PATH));
    foreach ($arrImagePaths as $arrImagePath) {
        if (\Cx\Lib\FileSystem\FileSystem::makeWritable($arrImagePath[0])) {
            if ($mediaDir = @opendir($arrImagePath[0])) {
                while ($file = readdir($mediaDir)) {
                    if ($file != '.' && $file != '..') {
                        if (!\Cx\Lib\FileSystem\FileSystem::makeWritable($arrImagePath[0] . '/' . $file)) {
                            setUpdateMsg(sprintf($_ARRAYLANG['TXT_SET_WRITE_PERMISSON_TO_FILE'], $arrImagePath[0] . '/' . $file, $_CORELANG['TXT_UPDATE_TRY_AGAIN']), 'msg');
                            return false;
                        }
                    }
                }
            } else {
                setUpdateMsg(sprintf($_ARRAYLANG['TXT_SET_WRITE_PERMISSON_TO_DIR_AND_CONTENT'], $arrImagePath[0] . '/', $_CORELANG['TXT_UPDATE_TRY_AGAIN']), 'msg');
                return false;
            }
        } else {
            setUpdateMsg(sprintf($_ARRAYLANG['TXT_SET_WRITE_PERMISSON_TO_DIR_AND_CONTENT'], $arrImagePath[0] . '/', $_CORELANG['TXT_UPDATE_TRY_AGAIN']), 'msg');
            return false;
        }
    }
    return true;
}
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:43,代码来源:ecard.php

示例10: _jobsUpdate

/**
 * Cloudrexx
 *
 * @link      http://www.cloudrexx.com
 * @copyright Cloudrexx AG 2007-2015
 *
 * According to our dual licensing model, this program can be used either
 * under the terms of the GNU Affero General Public License, version 3,
 * or under a proprietary license.
 *
 * The texts of the GNU Affero General Public License with an additional
 * permission and of our proprietary license can be found at and
 * in the LICENSE file you have received along with this program.
 *
 * 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 Affero General Public License for more details.
 *
 * "Cloudrexx" is a registered trademark of Cloudrexx AG.
 * The licensing of the program under the AGPLv3 does not imply a
 * trademark license. Therefore any rights, title and interest in
 * our trademarks remain entirely with us.
 */
function _jobsUpdate()
{
    global $objDatabase;
    try {
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_jobs', array('id' => array('type' => 'INT(6)', 'notnull' => true, 'primary' => true, 'auto_increment' => true, 'unsigned' => true), 'date' => array('type' => 'INT(14)', 'notnull' => false), 'title' => array('type' => 'VARCHAR(250)', 'notnull' => true, 'default' => ''), 'author' => array('type' => 'VARCHAR(150)', 'notnull' => true, 'default' => ''), 'text' => array('type' => 'MEDIUMTEXT'), 'workloc' => array('type' => 'VARCHAR(250)', 'notnull' => true, 'default' => ''), 'workload' => array('type' => 'VARCHAR(250)', 'notnull' => true, 'default' => ''), 'work_start' => array('type' => 'INT(14)', 'notnull' => true, 'default' => 0), 'catid' => array('type' => 'INT(2)', 'notnull' => true, 'default' => 0, 'unsigned' => true), 'lang' => array('type' => 'INT(2)', 'notnull' => true, 'default' => 0, 'unsigned' => true), 'userid' => array('type' => 'INT(6)', 'notnull' => true, 'default' => 0, 'unsigned' => true), 'startdate' => array('type' => 'DATE', 'notnull' => true, 'default' => '0000-00-00'), 'enddate' => array('type' => 'DATE', 'notnull' => true, 'default' => '0000-00-00'), 'status' => array('type' => 'TINYINT(4)', 'notnull' => true, 'default' => 1), 'changelog' => array('type' => 'INT(14)', 'notnull' => true, 'default' => 0)), array('newsindex' => array('fields' => array('title', 'text'), 'type' => 'fulltext')));
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_jobs_categories', array('catid' => array('type' => 'INT(2)', 'primary' => true, 'auto_increment' => true, 'unsigned' => true), 'name' => array('type' => 'VARCHAR(100)', 'default' => ''), 'lang' => array('type' => 'INT(2)', 'default' => 1, 'unsigned' => true), 'sort_style' => array('type' => "ENUM('alpha', 'date', 'date_alpha')", 'default' => 'alpha')));
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_jobs_location', array('id' => array('type' => 'INT(10)', 'primary' => true, 'auto_increment' => true, 'unsigned' => true), 'name' => array('type' => 'VARCHAR(100)', 'default' => '')));
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_jobs_rel_loc_jobs', array('job' => array('type' => 'INT(10)', 'unsigned' => true, 'notnull' => true, 'default' => '0', 'primary' => true), 'location' => array('type' => 'INT(10)', 'unsigned' => true, 'notnull' => true, 'default' => '0', 'primary' => true)));
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_jobs_settings', array('id' => array('type' => 'INT(10)', 'primary' => true, 'auto_increment' => true, 'unsigned' => true), 'name' => array('type' => 'VARCHAR(250)', 'default' => ''), 'value' => array('type' => 'TEXT', 'default' => '')));
    } catch (\Cx\Lib\UpdateException $e) {
        // we COULD do something else here..
        return \Cx\Lib\UpdateUtil::DefaultActionHandler($e);
    }
    $arrSettings = array(array('name' => 'footnote', 'value' => 'Hat Ihnen diese Bewerbung zugesagt? \\r\\nDann können Sie sich sogleich telefonisch, per E-mail oder Web Formular bewerben.'), array('name' => 'link', 'value' => 'Online für diese Stelle bewerben.'), array('name' => 'url', 'value' => 'index.php?section=contact&cmd=5&44=%URL%&43=%TITLE%'), array('name' => 'show_location_fe', 'value' => '1'));
    foreach ($arrSettings as $arrSetting) {
        $query = "SELECT 1 FROM `" . DBPREFIX . "module_jobs_settings` WHERE `name` = '" . $arrSetting['name'] . "'";
        $objResult = $objDatabase->SelectLimit($query, 1);
        if ($objResult !== false) {
            if ($objResult->RecordCount() == 0) {
                $query = "INSERT INTO `" . DBPREFIX . "module_jobs_settings` (`name`, `value`) VALUES ('" . $arrSetting['name'] . "', '" . $arrSetting['value'] . "')";
                if ($objDatabase->Execute($query) === false) {
                    return _databaseError($query, $objDatabase->ErrorMsg());
                }
            }
        } else {
            return _databaseError($query, $objDatabase->ErrorMsg());
        }
    }
    /********************************
     * EXTENSION:   Timezone        *
     * ADDED:       Contrexx v3.0.0 *
     ********************************/
    try {
        \Cx\Lib\UpdateUtil::sql('
            ALTER TABLE `' . DBPREFIX . 'module_jobs`
            CHANGE `startdate` `startdate` TIMESTAMP NOT NULL DEFAULT "0000-00-00 00:00:00",
            CHANGE `enddate` `enddate` TIMESTAMP NOT NULL DEFAULT "0000-00-00 00:00:00"
        ');
    } catch (\Cx\Lib\UpdateException $e) {
        return \Cx\Lib\UpdateUtil::DefaultActionHandler($e);
    }
    return true;
}
开发者ID:Niggu,项目名称:cloudrexx,代码行数:67,代码来源:jobs.php

示例11: _media1Update

/**
 * Cloudrexx
 *
 * @link      http://www.cloudrexx.com
 * @copyright Cloudrexx AG 2007-2015
 *
 * According to our dual licensing model, this program can be used either
 * under the terms of the GNU Affero General Public License, version 3,
 * or under a proprietary license.
 *
 * The texts of the GNU Affero General Public License with an additional
 * permission and of our proprietary license can be found at and
 * in the LICENSE file you have received along with this program.
 *
 * 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 Affero General Public License for more details.
 *
 * "Cloudrexx" is a registered trademark of Cloudrexx AG.
 * The licensing of the program under the AGPLv3 does not imply a
 * trademark license. Therefore any rights, title and interest in
 * our trademarks remain entirely with us.
 */
function _media1Update()
{
    global $_ARRAYLANG, $_CORELANG;
    /*    require_once ASCMS_FRAMEWORK_PATH.'/File.class.php';
        $objFile = new File();
    
        $paths = glob(ASCMS_DOCUMENT_ROOT.'/media/archive*');
        foreach ($paths as $path) {
            $path = "$path/";
            $web_path = preg_replace("#".ASCMS_DOCUMENT_ROOT."/media/#", ASCMS_PATH_OFFSET . '/media/', $path);
            $status = $objFile->delFile($path, $web_path, '.htaccess');
    
            if ($status == 'error') {
                setUpdateMsg(sprintf($_ARRAYLANG['TXT_SET_WRITE_PERMISSON_TO_DIR_AND_CONTENT'], "<pre>$web_path</pre>", $_CORELANG['TXT_UPDATE_TRY_AGAIN']));
                return false;
            }
            }*/
    try {
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_media_settings', array('name' => array('type' => 'VARCHAR(50)'), 'value' => array('type' => 'VARCHAR(250)', 'after' => 'name')), array('name' => array('fields' => array('name'))), 'InnoDB');
        $arrValues = array(array("media1_frontend_changable", "off"), array("media2_frontend_changable", "off"), array("media3_frontend_changable", "off"), array("media4_frontend_changable", "off"), array("media1_frontend_managable", "off"), array("media2_frontend_managable", "off"), array("media3_frontend_managable", "off"), array("media4_frontend_managable", "off"));
        for ($i = 0; $i < count($arrValues); $i++) {
            $rs = \Cx\Lib\UpdateUtil::sql('SELECT 1 FROM ' . DBPREFIX . 'module_media_settings WHERE name="' . $arrValues[$i][0] . '";');
            if ($rs->EOF) {
                \Cx\Lib\UpdateUtil::sql('INSERT INTO ' . DBPREFIX . 'module_media_settings VALUES ("' . $arrValues[$i][0] . '","' . $arrValues[$i][1] . '")');
            }
        }
    } catch (\Cx\Lib\UpdateException $e) {
        // we COULD do something else here..
        return \Cx\Lib\UpdateUtil::DefaultActionHandler($e);
    }
    $arrContentSites = array('media1', 'media2', 'media3', 'media4');
    // replace source url to image
    foreach ($arrContentSites as $module) {
        try {
            \Cx\Lib\UpdateUtil::migrateContentPage($module, '', 'images/modules/media/_base.gif', 'core_modules/media/View/Media/_base.gif', '3.1.2');
        } catch (\Cx\Lib\UpdateException $e) {
            return \Cx\Lib\UpdateUtil::DefaultActionHandler($e);
        }
    }
    return true;
}
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:65,代码来源:media1.php

示例12: _filesharingUpdate

function _filesharingUpdate()
{
    try {
        /*********************************
         * EXTENSION:   Initial creation *
         * ADDED:       Contrexx v3.0.0  *
         *********************************/
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_filesharing', array('id' => array('type' => 'INT(10)', 'notnull' => true, 'auto_increment' => true, 'primary' => true), 'file' => array('type' => 'VARCHAR(250)', 'notnull' => true, 'after' => 'id'), 'source' => array('type' => 'VARCHAR(250)', 'notnull' => true, 'after' => 'file'), 'cmd' => array('type' => 'VARCHAR(50)', 'notnull' => true, 'after' => 'source'), 'hash' => array('type' => 'VARCHAR(50)', 'notnull' => true, 'after' => 'cmd'), 'check' => array('type' => 'VARCHAR(50)', 'notnull' => true, 'after' => 'hash'), 'expiration_date' => array('type' => 'TIMESTAMP', 'notnull' => false, 'default' => NULL, 'after' => 'check'), 'upload_id' => array('type' => 'INT(10)', 'notnull' => false, 'default' => NULL, 'after' => 'expiration_date')));
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_filesharing_mail_template', array('id' => array('type' => 'INT(10)', 'notnull' => true, 'auto_increment' => true, 'primary' => true), 'lang_id' => array('type' => 'INT(1)', 'notnull' => true, 'after' => 'id'), 'subject' => array('type' => 'VARCHAR(250)', 'notnull' => true, 'after' => 'lang_id'), 'content' => array('type' => 'TEXT', 'notnull' => true, 'after' => 'subject')));
        \Cx\Lib\UpdateUtil::sql('
            INSERT INTO `' . DBPREFIX . 'module_filesharing_mail_template` (`id`, `lang_id`, `subject`, `content`)
            VALUES  (1, 1, "Jemand teilt eine Datei mit Ihnen", "Guten Tag,\\r\\n\\r\\nJemand hat auf [[DOMAIN]] eine Datei mit Ihnen geteilt.\\r\\n\\r\\n<!-- BEGIN filesharing_file -->\\r\\nDownload-Link: [[FILE_DOWNLOAD]]\\r\\n<!-- END filesharing_file -->\\r\\n\\r\\nDie Person hat eine Nachricht hinterlassen:\\r\\n[[MESSAGE]]\\r\\n\\r\\nFreundliche Grüsse"),
                    (2, 2, "Somebody is sharing a file with you", "Hi,\\r\\n\\r\\nSomebody shared a file with you on [[DOMAIN]].\\r\\n\\r\\n<!-- BEGIN filesharing_file -->\\r\\nDownload link: [[FILE_DOWNLOAD]]\\r\\n<!-- END filesharing_file -->\\r\\n\\r\\nThe person has left a message for you:\\r\\n[[MESSAGE]]\\r\\n\\r\\nBest regards")
            ON DUPLICATE KEY UPDATE `id` = `id`
        ');
        \Cx\Lib\UpdateUtil::sql('INSERT IGNORE INTO `' . DBPREFIX . 'core_setting` (`section`, `name`, `group`, `type`, `value`, `values`, `ord`)
                                    VALUES (\'filesharing\',\'permission\',\'config\',\'text\',\'off\',\'\',0)');
    } catch (\Cx\Lib\UpdateException $e) {
        return \Cx\Lib\UpdateUtil::DefaultActionHandler($e);
    }
}
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:21,代码来源:filesharing.php

示例13: _memberdirUpdate

function _memberdirUpdate()
{
    global $objDatabase, $_ARRAYLANG, $_CORELANG;
    try {
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_memberdir_directories', array('dirid' => array('type' => 'INT(10)', 'unsigned' => true, 'notnull' => true, 'auto_increment' => true, 'primary' => true), 'parentdir' => array('type' => 'INT(11)', 'notnull' => true, 'default' => '0'), 'active' => array('type' => 'SET(\'1\',\'0\')', 'notnull' => true, 'default' => '1'), 'name' => array('type' => 'VARCHAR(255)', 'notnull' => true, 'default' => ''), 'description' => array('type' => 'TEXT'), 'displaymode' => array('type' => 'SET(\'0\',\'1\',\'2\')', 'notnull' => true, 'default' => '0'), 'sort' => array('type' => 'INT(11)', 'notnull' => true, 'default' => '1'), 'pic1' => array('type' => 'SET(\'1\',\'0\')', 'notnull' => true, 'default' => '0'), 'pic2' => array('type' => 'SET(\'1\',\'0\')', 'notnull' => true, 'default' => '0'), 'lang_id' => array('type' => 'INT(2)', 'unsigned' => true, 'notnull' => true, 'default' => '1')), array('memberdir_dir' => array('fields' => array('name', 'description'), 'type' => 'FULLTEXT')));
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_memberdir_name', array('field' => array('type' => 'INT(10)', 'unsigned' => true, 'notnull' => true, 'default' => '0'), 'dirid' => array('type' => 'INT(10)', 'unsigned' => true, 'notnull' => true, 'default' => '0'), 'name' => array('type' => 'VARCHAR(255)', 'notnull' => true, 'default' => ''), 'active' => array('type' => 'SET(\'0\',\'1\')', 'notnull' => true, 'default' => ''), 'lang_id' => array('type' => 'INT(2)', 'unsigned' => true, 'notnull' => true, 'default' => '1')));
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_memberdir_settings', array('setid' => array('type' => 'INT(4)', 'unsigned' => true, 'notnull' => true, 'auto_increment' => true, 'primary' => true), 'setname' => array('type' => 'VARCHAR(255)', 'notnull' => true, 'default' => ''), 'setvalue' => array('type' => 'TEXT'), 'lang_id' => array('type' => 'INT(2)', 'unsigned' => true, 'notnull' => true, 'default' => '1')));
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_memberdir_values', array('id' => array('type' => 'INT(10)', 'unsigned' => true, 'notnull' => true, 'auto_increment' => true, 'primary' => true), 'dirid' => array('type' => 'INT(14)', 'notnull' => true, 'default' => '0'), 'pic1' => array('type' => 'VARCHAR(255)', 'notnull' => true, 'default' => ''), 'pic2' => array('type' => 'VARCHAR(255)', 'notnull' => true, 'default' => ''), '0' => array('type' => 'SMALLINT(5)', 'notnull' => true, 'unsigned' => true, 'default' => '0'), '1' => array('type' => 'TEXT'), '2' => array('type' => 'TEXT'), '3' => array('type' => 'TEXT'), '4' => array('type' => 'TEXT'), '5' => array('type' => 'TEXT'), '6' => array('type' => 'TEXT'), '7' => array('type' => 'TEXT'), '8' => array('type' => 'TEXT'), '9' => array('type' => 'TEXT'), '10' => array('type' => 'TEXT'), '11' => array('type' => 'TEXT'), '12' => array('type' => 'TEXT'), '13' => array('type' => 'TEXT'), '14' => array('type' => 'TEXT'), '15' => array('type' => 'TEXT'), '16' => array('type' => 'TEXT'), '17' => array('type' => 'TEXT'), '18' => array('type' => 'TEXT'), 'lang_id' => array('type' => 'INT(2)', 'unsigned' => true, 'notnull' => true, 'default' => '1')));
        $arrSettings = array('default_listing' => array('1', '1'), 'max_height' => array('400', '1'), 'max_width' => array('500', '1'));
        foreach ($arrSettings as $key => $arrSetting) {
            if (!\Cx\Lib\UpdateUtil::sql("SELECT 1 FROM `" . DBPREFIX . "module_memberdir_settings` WHERE `setname` = '" . $key . "'")->RecordCount()) {
                \Cx\Lib\UpdateUtil::sql("INSERT INTO `" . DBPREFIX . "module_memberdir_settings`\n                    SET `setname`    = '" . $key . "',\n                        `setvalue`   = '" . $arrSetting[0] . "',\n                        `lang_id`    = '" . $arrSetting[1] . "'\n                ");
            }
        }
    } catch (\Cx\Lib\UpdateException $e) {
        // we COULD do something else here..
        return \Cx\Lib\UpdateUtil::DefaultActionHandler($e);
    }
    if (!\Cx\Lib\FileSystem\FileSystem::makeWritable(ASCMS_MEDIA_PATH . '/memberdir')) {
        setUpdateMsg(sprintf($_ARRAYLANG['TXT_SET_WRITE_PERMISSON_TO_DIR_AND_CONTENT'], ASCMS_MEDIA_PATH . '/memberdir/', $_CORELANG['TXT_UPDATE_TRY_AGAIN']), 'msg');
        return false;
    }
    return true;
}
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:24,代码来源:memberdir.php

示例14: _checkoutUpdate

/**
 * Cloudrexx
 *
 * @link      http://www.cloudrexx.com
 * @copyright Cloudrexx AG 2007-2015
 *
 * According to our dual licensing model, this program can be used either
 * under the terms of the GNU Affero General Public License, version 3,
 * or under a proprietary license.
 *
 * The texts of the GNU Affero General Public License with an additional
 * permission and of our proprietary license can be found at and
 * in the LICENSE file you have received along with this program.
 *
 * 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 Affero General Public License for more details.
 *
 * "Cloudrexx" is a registered trademark of Cloudrexx AG.
 * The licensing of the program under the AGPLv3 does not imply a
 * trademark license. Therefore any rights, title and interest in
 * our trademarks remain entirely with us.
 */
function _checkoutUpdate()
{
    try {
        /*********************************
         * EXTENSION:   Initial creation *
         * ADDED:       Contrexx v3.0.0  *
         *********************************/
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_checkout_settings_general', array('id' => array('type' => 'INT(11)', 'notnull' => true, 'auto_increment' => true, 'primary' => true), 'name' => array('type' => 'VARCHAR(255)', 'notnull' => true, 'after' => 'id'), 'value' => array('type' => 'INT(1)', 'notnull' => true, 'default' => '0', 'after' => 'name')));
        \Cx\Lib\UpdateUtil::sql('INSERT INTO `' . DBPREFIX . 'module_checkout_settings_general` (`id`, `name`, `value`) VALUES (1, "epayment_status", 1) ON DUPLICATE KEY UPDATE `id` = `id`');
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_checkout_settings_mails', array('id' => array('type' => 'INT(11)', 'notnull' => true, 'auto_increment' => true, 'primary' => true), 'title' => array('type' => 'TEXT', 'notnull' => true, 'after' => 'id'), 'content' => array('type' => 'TEXT', 'notnull' => true, 'after' => 'title')));
        \Cx\Lib\UpdateUtil::sql('
            INSERT INTO `' . DBPREFIX . 'module_checkout_settings_mails` (`id`, `title`, `content`)
            VALUES  (1, "[[DOMAIN_URL]] - Neue Zahlung", "Guten Tag<br />\\r\\n<br />\\r\\nAuf [[DOMAIN_URL]] wurde eine neue Zahlung abgewickelt:<br />\\r\\n<br />\\r\\n<table border=\\"0\\" cellpadding=\\"0\\" cellspacing=\\"0\\">\\r\\n    <tbody>\\r\\n        <tr>\\r\\n            <td colspan=\\"2\\" nowrap=\\"nowrap\\" width=\\"150\\">\\r\\n                <strong>Angaben zur Transaktion</strong></td>\\r\\n        </tr>\\r\\n        <tr>\\r\\n            <td width=\\"150\\">\\r\\n                ID</td>\\r\\n            <td>\\r\\n                [[TRANSACTION_ID]]</td>\\r\\n        </tr>\\r\\n        <tr>\\r\\n            <td>\\r\\n                Status</td>\\r\\n            <td>\\r\\n                [[TRANSACTION_STATUS]]</td>\\r\\n        </tr>\\r\\n        <tr>\\r\\n            <td>\\r\\n                Datum und Uhrzeit</td>\\r\\n            <td>\\r\\n                [[TRANSACTION_TIME]]</td>\\r\\n        </tr>\\r\\n    </tbody>\\r\\n</table>\\r\\n<br />\\r\\n<table border=\\"0\\" cellpadding=\\"0\\" cellspacing=\\"0\\">\\r\\n    <tbody>\\r\\n        <tr>\\r\\n            <td colspan=\\"2\\" nowrap=\\"nowrap\\" width=\\"150\\">\\r\\n                <strong>Angaben zur beglichenen Rechnung</strong></td>\\r\\n        </tr>\\r\\n        <tr>\\r\\n            <td width=\\"150\\">\\r\\n                Nummer</td>\\r\\n            <td>\\r\\n                [[INVOICE_NUMBER]]</td>\\r\\n        </tr>\\r\\n        <tr>\\r\\n            <td>\\r\\n                Betrag</td>\\r\\n            <td>\\r\\n                [[INVOICE_AMOUNT]] [[INVOICE_CURRENCY]]</td>\\r\\n        </tr>\\r\\n    </tbody>\\r\\n</table>\\r\\n<br />\\r\\n<table border=\\"0\\" cellpadding=\\"0\\" cellspacing=\\"0\\">\\r\\n    <tbody>\\r\\n        <tr>\\r\\n            <td colspan=\\"2\\" nowrap=\\"nowrap\\" width=\\"150\\">\\r\\n                <strong>Angaben zur Kontaktperson</strong></td>\\r\\n        </tr>\\r\\n        <tr>\\r\\n            <td width=\\"150\\">\\r\\n                Anrede</td>\\r\\n            <td>\\r\\n                [[CONTACT_TITLE]]</td>\\r\\n        </tr>\\r\\n        <tr>\\r\\n            <td>\\r\\n                Vorname</td>\\r\\n            <td>\\r\\n                [[CONTACT_FORENAME]]</td>\\r\\n        </tr>\\r\\n        <tr>\\r\\n            <td>\\r\\n                Nachname</td>\\r\\n            <td>\\r\\n                [[CONTACT_SURNAME]]</td>\\r\\n        </tr>\\r\\n        <tr>\\r\\n            <td>\\r\\n                Firma</td>\\r\\n            <td>\\r\\n                [[CONTACT_COMPANY]]</td>\\r\\n        </tr>\\r\\n        <tr>\\r\\n            <td>\\r\\n                Strasse</td>\\r\\n            <td>\\r\\n                [[CONTACT_STREET]]</td>\\r\\n        </tr>\\r\\n        <tr>\\r\\n            <td>\\r\\n                PLZ</td>\\r\\n            <td>\\r\\n                [[CONTACT_POSTCODE]]</td>\\r\\n        </tr>\\r\\n        <tr>\\r\\n            <td>\\r\\n                Ort</td>\\r\\n            <td>\\r\\n                [[CONTACT_PLACE]]</td>\\r\\n        </tr>\\r\\n        <tr>\\r\\n            <td>\\r\\n                Land</td>\\r\\n            <td>\\r\\n                [[CONTACT_COUNTRY]]</td>\\r\\n        </tr>\\r\\n        <tr>\\r\\n            <td>\\r\\n                Telefon</td>\\r\\n            <td>\\r\\n                [[CONTACT_PHONE]]</td>\\r\\n        </tr>\\r\\n        <tr>\\r\\n            <td>\\r\\n                E-Mail-Adresse</td>\\r\\n            <td>\\r\\n                <a href=\\"[[CONTACT_EMAIL]]?csrf=ODg4MTM2Nzg1&amp;csrf=NDQzMzAwNjE0\\">[[CONTACT_EMAIL]]</a></td>\\r\\n        </tr>\\r\\n    </tbody>\\r\\n</table>\\r\\n<br />\\r\\nFreundliche Gr&uuml;sse<br />\\r\\nDas [[DOMAIN_URL]]&nbsp;Team"),
                    (2, "[[DOMAIN_URL]] - Zahlungsbestätigung", "Guten Tag<br />\\r\\n<br />\\r\\nGerne best&auml;tigen wir die erfolgreiche Abwicklung folgender Zahlung auf [[DOMAIN_URL]]:<br />\\r\\n<br />\\r\\n<table border=\\"0\\" cellpadding=\\"0\\" cellspacing=\\"0\\">\\r\\n    <tbody>\\r\\n        <tr>\\r\\n            <td colspan=\\"2\\" nowrap=\\"nowrap\\" width=\\"150\\">\\r\\n                <strong>Angaben zur Transaktion</strong></td>\\r\\n        </tr>\\r\\n        <tr>\\r\\n            <td width=\\"150\\">\\r\\n                ID</td>\\r\\n            <td>\\r\\n                [[TRANSACTION_ID]]</td>\\r\\n        </tr>\\r\\n        <tr>\\r\\n            <td>\\r\\n                Status</td>\\r\\n            <td>\\r\\n                [[TRANSACTION_STATUS]]</td>\\r\\n        </tr>\\r\\n        <tr>\\r\\n            <td>\\r\\n                Datum und Uhrzeit</td>\\r\\n            <td>\\r\\n                [[TRANSACTION_TIME]]</td>\\r\\n        </tr>\\r\\n    </tbody>\\r\\n</table>\\r\\n<br />\\r\\n<table border=\\"0\\" cellpadding=\\"0\\" cellspacing=\\"0\\">\\r\\n    <tbody>\\r\\n        <tr>\\r\\n            <td colspan=\\"2\\" nowrap=\\"nowrap\\" width=\\"150\\">\\r\\n                <strong>Angaben zur beglichenen Rechnung</strong></td>\\r\\n        </tr>\\r\\n        <tr>\\r\\n            <td width=\\"150\\">\\r\\n                Nummer</td>\\r\\n            <td>\\r\\n                [[INVOICE_NUMBER]]</td>\\r\\n        </tr>\\r\\n        <tr>\\r\\n            <td>\\r\\n                Betrag</td>\\r\\n            <td>\\r\\n                [[INVOICE_AMOUNT]] [[INVOICE_CURRENCY]]</td>\\r\\n        </tr>\\r\\n    </tbody>\\r\\n</table>\\r\\n<br />\\r\\n<table border=\\"0\\" cellpadding=\\"0\\" cellspacing=\\"0\\">\\r\\n    <tbody>\\r\\n        <tr>\\r\\n            <td colspan=\\"2\\" nowrap=\\"nowrap\\" width=\\"150\\">\\r\\n                <strong>Angaben zur Kontaktperson</strong></td>\\r\\n        </tr>\\r\\n        <tr>\\r\\n            <td width=\\"150\\">\\r\\n                Anrede</td>\\r\\n            <td>\\r\\n                [[CONTACT_TITLE]]</td>\\r\\n        </tr>\\r\\n        <tr>\\r\\n            <td>\\r\\n                Vorname</td>\\r\\n            <td>\\r\\n                [[CONTACT_FORENAME]]</td>\\r\\n        </tr>\\r\\n        <tr>\\r\\n            <td>\\r\\n                Nachname</td>\\r\\n            <td>\\r\\n                [[CONTACT_SURNAME]]</td>\\r\\n        </tr>\\r\\n        <tr>\\r\\n            <td>\\r\\n                Firma</td>\\r\\n            <td>\\r\\n                [[CONTACT_COMPANY]]</td>\\r\\n        </tr>\\r\\n        <tr>\\r\\n            <td>\\r\\n                Strasse</td>\\r\\n            <td>\\r\\n                [[CONTACT_STREET]]</td>\\r\\n        </tr>\\r\\n        <tr>\\r\\n            <td>\\r\\n                PLZ</td>\\r\\n            <td>\\r\\n                [[CONTACT_POSTCODE]]</td>\\r\\n        </tr>\\r\\n        <tr>\\r\\n            <td>\\r\\n                Ort</td>\\r\\n            <td>\\r\\n                [[CONTACT_PLACE]]</td>\\r\\n        </tr>\\r\\n        <tr>\\r\\n            <td>\\r\\n                Land</td>\\r\\n            <td>\\r\\n                [[CONTACT_COUNTRY]]</td>\\r\\n        </tr>\\r\\n        <tr>\\r\\n            <td>\\r\\n                Telefon</td>\\r\\n            <td>\\r\\n                [[CONTACT_PHONE]]</td>\\r\\n        </tr>\\r\\n        <tr>\\r\\n            <td>\\r\\n                E-Mail-Adresse</td>\\r\\n            <td>\\r\\n                <a href=\\"[[CONTACT_EMAIL]]?csrf=MTQ3ODg2NDkx&amp;csrf=ODg4NzYwNDE2\\">[[CONTACT_EMAIL]]</a></td>\\r\\n        </tr>\\r\\n    </tbody>\\r\\n</table>\\r\\n<br />\\r\\nFreundliche Gr&uuml;sse<br />\\r\\nDas [[DOMAIN_URL]]&nbsp;Team")
            ON DUPLICATE KEY UPDATE `id` = `id`
        ');
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_checkout_settings_yellowpay', array('id' => array('type' => 'INT(11)', 'notnull' => true, 'auto_increment' => true, 'primary' => true), 'name' => array('type' => 'TEXT', 'notnull' => true, 'after' => 'id'), 'value' => array('type' => 'TEXT', 'notnull' => true, 'after' => 'name')));
        \Cx\Lib\UpdateUtil::sql('
            INSERT INTO `' . DBPREFIX . 'module_checkout_settings_yellowpay` (`id`, `name`, `value`)
            VALUES  (1, "pspid", "demoShop"),
                    (2, "sha_in", "sech10zeichenminimum"),
                    (3, "sha_out", "sech10zeichenminimum"),
                    (4, "testserver", 1),
                    (5, "operation", "SAL")
            ON DUPLICATE KEY UPDATE `id` = `id`
        ');
        \Cx\Lib\UpdateUtil::table(DBPREFIX . 'module_checkout_transactions', array('id' => array('type' => 'INT(11)', 'notnull' => true, 'auto_increment' => true, 'primary' => true), 'time' => array('type' => 'INT(10)', 'notnull' => true, 'default' => '0', 'after' => 'id'), 'status' => array('type' => 'ENUM(\'confirmed\',\'waiting\',\'cancelled\')', 'notnull' => true, 'after' => 'time'), 'invoice_number' => array('type' => 'VARCHAR(255)', 'notnull' => true, 'after' => 'status'), 'invoice_currency' => array('type' => 'INT(11)', 'notnull' => true, 'default' => '1', 'after' => 'invoice_number'), 'invoice_amount' => array('type' => 'INT(15)', 'notnull' => true, 'after' => 'invoice_currency'), 'contact_title' => array('type' => 'ENUM(\'mister\',\'miss\')', 'notnull' => true, 'after' => 'invoice_amount'), 'contact_forename' => array('type' => 'VARCHAR(255)', 'notnull' => true, 'default' => '', 'after' => 'contact_title'), 'contact_surname' => array('type' => 'VARCHAR(255)', 'notnull' => true, 'default' => '', 'after' => 'contact_forename'), 'contact_company' => array('type' => 'VARCHAR(255)', 'notnull' => true, 'default' => '', 'after' => 'contact_surname'), 'contact_street' => array('type' => 'VARCHAR(255)', 'notnull' => true, 'default' => '', 'after' => 'contact_company'), 'contact_postcode' => array('type' => 'VARCHAR(255)', 'notnull' => true, 'default' => '', 'after' => 'contact_street'), 'contact_place' => array('type' => 'VARCHAR(255)', 'notnull' => true, 'default' => '', 'after' => 'contact_postcode'), 'contact_country' => array('type' => 'INT(11)', 'notnull' => true, 'default' => '204', 'after' => 'contact_place'), 'contact_phone' => array('type' => 'VARCHAR(255)', 'notnull' => true, 'default' => '', 'after' => 'contact_country'), 'contact_email' => array('type' => 'VARCHAR(255)', 'notnull' => true, 'default' => '', 'after' => 'contact_phone')));
        \Cx\Lib\UpdateUtil::sql('
            INSERT INTO `' . DBPREFIX . 'module_checkout_transactions` (`id`, `time`, `status`, `invoice_number`, `invoice_currency`, `invoice_amount`, `contact_title`, `contact_forename`, `contact_surname`, `contact_company`, `contact_street`, `contact_postcode`, `contact_place`, `contact_country`, `contact_phone`, `contact_email`)
            VALUES (1, 1346661560, "confirmed", 987654321, 1, 48000, "mister", "Hans", "Muster", "Musterfirma", "Musterstrasse 123", 1234, "Musterort", 204, "012 345 67 89", "info@example.com")
            ON DUPLICATE KEY UPDATE `id` = `id`
        ');
    } catch (\Cx\Lib\UpdateException $e) {
        return \Cx\Lib\UpdateUtil::DefaultActionHandler($e);
    }
}
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:60,代码来源:checkout.php

示例15: errorHandler

 /**
  * Handles database errors
  *
  * Also migrates text fields to the new structure
  * @return  boolean         False.  Always.
  * @static
  * @throws  Cx\Lib\Update_DatabaseException
  */
 static function errorHandler()
 {
     // Product
     // Fix the Text, Discount, and Manufacturer tables first
     \Text::errorHandler();
     //        Discount::errorHandler(); // Called by Customer::errorHandler();
     Manufacturer::errorHandler();
     $table_name = DBPREFIX . 'module_shop_products';
     $table_structure = array('id' => array('type' => 'INT(10)', 'unsigned' => true, 'auto_increment' => true, 'primary' => true), 'normalprice' => array('type' => 'DECIMAL(9,2)', 'default' => '0.00'), 'resellerprice' => array('type' => 'DECIMAL(9,2)', 'default' => '0.00'), 'discountprice' => array('type' => 'DECIMAL(9,2)', 'default' => '0.00'), 'discount_active' => array('type' => 'TINYINT(1)', 'unsigned' => true, 'default' => '0', 'renamefrom' => 'is_special_offer'), 'stock' => array('type' => 'INT(10)', 'default' => '10'), 'stock_visible' => array('type' => 'TINYINT(1)', 'unsigned' => true, 'default' => '1', 'renamefrom' => 'stock_visibility'), 'active' => array('type' => 'TINYINT(1)', 'unsigned' => true, 'default' => '1', 'renamefrom' => 'status'), 'b2b' => array('type' => 'TINYINT(1)', 'unsigned' => true, 'default' => '1'), 'b2c' => array('type' => 'TINYINT(1)', 'unsigned' => true, 'default' => '1'), 'date_start' => array('type' => 'TIMESTAMP', 'default' => '0000-00-00 00:00:00', 'renamefrom' => 'startdate'), 'date_end' => array('type' => 'TIMESTAMP', 'default' => '0000-00-00 00:00:00', 'renamefrom' => 'enddate'), 'weight' => array('type' => 'INT(10)', 'unsigned' => true, 'notnull' => false, 'default' => null), 'category_id' => array('type' => 'VARCHAR(255)', 'default' => '', 'renamefrom' => 'catid'), 'vat_id' => array('type' => 'INT(10)', 'unsigned' => true, 'notnull' => false, 'default' => null), 'manufacturer_id' => array('type' => 'INT(10)', 'unsigned' => true, 'notnull' => false, 'default' => null, 'renamefrom' => 'manufacturer'), 'group_id' => array('type' => 'INT(10)', 'unsigned' => true, 'notnull' => false, 'default' => null), 'article_id' => array('type' => 'INT(10)', 'unsigned' => true, 'notnull' => false, 'default' => null), 'usergroup_ids' => array('type' => 'VARCHAR(4096)', 'notnull' => false, 'default' => null), 'ord' => array('type' => 'INT(10)', 'default' => '0', 'renamefrom' => 'sort_order'), 'distribution' => array('type' => 'VARCHAR(16)', 'default' => '', 'renamefrom' => 'handler'), 'picture' => array('type' => 'VARCHAR(4096)', 'notnull' => false, 'default' => null), 'flags' => array('type' => 'VARCHAR(4096)', 'notnull' => false, 'default' => null), 'minimum_order_quantity' => array('type' => 'INT(10)', 'unsigned' => false, 'default' => '0'));
     $table_index = array('group_id' => array('fields' => array('group_id')), 'article_id' => array('fields' => array('article_id')), 'flags' => array('fields' => array('flags'), 'type' => 'FULLTEXT'));
     $default_lang_id = \FWLanguage::getDefaultLangId();
     if (\Cx\Lib\UpdateUtil::table_exist($table_name)) {
         if (\Cx\Lib\UpdateUtil::column_exist($table_name, 'title')) {
             // Migrate all Product strings to the Text table first
             \Text::deleteByKey('Shop', self::TEXT_NAME);
             \Text::deleteByKey('Shop', self::TEXT_SHORT);
             \Text::deleteByKey('Shop', self::TEXT_LONG);
             \Text::deleteByKey('Shop', self::TEXT_CODE);
             \Text::deleteByKey('Shop', self::TEXT_URI);
             \Text::deleteByKey('Shop', self::TEXT_KEYS);
             $query = "\n                    SELECT `id`, `title`, `shortdesc`, `description`,\n                           `product_id`, `external_link`, `keywords`\n                      FROM `{$table_name}`";
             $objResult = \Cx\Lib\UpdateUtil::sql($query);
             if (!$objResult) {
                 throw new \Cx\Lib\Update_DatabaseException("Failed to query Product strings", $query);
             }
             while (!$objResult->EOF) {
                 $id = $objResult->fields['id'];
                 $name = $objResult->fields['title'];
                 if (!\Text::replace($id, $default_lang_id, 'Shop', self::TEXT_NAME, $name)) {
                     throw new \Cx\Lib\Update_DatabaseException("Failed to migrate Product name '{$name}'");
                 }
                 $short = $objResult->fields['shortdesc'];
                 if (!\Text::replace($id, $default_lang_id, 'Shop', self::TEXT_SHORT, $short)) {
                     throw new \Cx\Lib\Update_DatabaseException("Failed to migrate Product short '{$short}'");
                 }
                 $long = $objResult->fields['description'];
                 if (!\Text::replace($id, $default_lang_id, 'Shop', self::TEXT_LONG, $long)) {
                     throw new \Cx\Lib\Update_DatabaseException("Failed to migrate Product long '{$long}'");
                 }
                 $code = $objResult->fields['product_id'];
                 if (!\Text::replace($id, $default_lang_id, 'Shop', self::TEXT_CODE, $code)) {
                     throw new \Cx\Lib\Update_DatabaseException("Failed to migrate Product code '{$code}'");
                 }
                 $uri = $objResult->fields['external_link'];
                 if (!\Text::replace($id, $default_lang_id, 'Shop', self::TEXT_URI, $uri)) {
                     throw new \Cx\Lib\Update_DatabaseException("Failed to migrate Product uri '{$uri}'");
                 }
                 $keys = $objResult->fields['keywords'];
                 if (!\Text::replace($id, $default_lang_id, 'Shop', self::TEXT_KEYS, $keys)) {
                     throw new \Cx\Lib\Update_DatabaseException("Failed to migrate Product keys '{$keys}'");
                 }
                 $objResult->MoveNext();
             }
         }
     }
     \Cx\Lib\UpdateUtil::table($table_name, $table_structure, $table_index);
     // Also fix Customer and some related tables
     Customer::errorHandler();
     // Always
     return false;
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:69,代码来源:Product.class.php


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