Skip to content

Commit

Permalink
4.10
Browse files Browse the repository at this point in the history
  • Loading branch information
gulaandrij committed May 26, 2016
1 parent de45b75 commit f4b02bb
Show file tree
Hide file tree
Showing 544 changed files with 97,413 additions and 1,238 deletions.
2 changes: 1 addition & 1 deletion application/config/cms.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
|
*/
$config['tpl_compile_path'] = PUBPATH . 'system/cache/templates_c/';
$config['tpl_force_compile'] = TRUE;
$config['tpl_force_compile'] = FALSE;
$config['tpl_compiled_ttl'] = 84600;
$config['tpl_compress_output'] = TRUE;
$config['tpl_use_filemtime'] = TRUE;
Expand Down
29 changes: 29 additions & 0 deletions application/libraries/Permitions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1003,4 +1003,33 @@ public function makeRolesArray($controller_types, $locale) {
return $result;
}

private function filterShopPrivileges() {
$privilegesPOST = $this->input->post('Privileges');
$skipPrivileges = $this->db->like('name', 'Shop')->get('shop_rbac_privileges');
if ($skipPrivileges) {
$skipPrivileges = $skipPrivileges->result_array();
$skipPrivilegesIds = [];
array_map(
function ($privilege) use (&$skipPrivilegesIds) {
$skipPrivilegesIds[$privilege['id']] = $privilege;
},
$skipPrivileges
);
}

$privilegesPOSTIds = array_filter(
$privilegesPOST,
function ($id) use (&$skipPrivilegesIds, &$privilegesPOST) {
return !$skipPrivilegesIds[$id] ? true : false;
}
);
return $privilegesPOSTIds;
}

private function error404($message) {
$this->template->assign('message', $message);
$this->template->show('404');
exit;
}

}
2 changes: 1 addition & 1 deletion application/libraries/lib_init.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function __construct() {

} catch (Exception $ex) {
log_message('error', $ex->getMessage());
show_error('Init error', 500);
show_error('Init error - ' . $ex->getMessage(), 500);
}
}

Expand Down
6 changes: 3 additions & 3 deletions application/modules/admin/language/ru_RU/LC_MESSAGES/admin.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-05-12 04:28+0300\n"
"PO-Revision-Date: 2016-05-12 04:28+0300\n"
"POT-Creation-Date: 2016-05-16 03:54+0300\n"
"PO-Revision-Date: 2016-05-16 03:54+0300\n"
"Last-Translator: <>\n"
"Language-Team: <>\n"
"Language: \n"
Expand All @@ -28,7 +28,7 @@ msgstr ""

#: templates/administrator/dashboard.tpl:124
msgid "Check version update"
msgstr ""
msgstr "Обновление системы"

#: templates/administrator/login_page.tpl:71
msgid "Update the code"
Expand Down
Binary file not shown.
23 changes: 0 additions & 23 deletions application/modules/admin/rbac.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,4 @@ public function index() {

}

public function filterShopPrivileges() {
$privilegesPOST = $this->input->post('Privileges');
$skipPrivileges = $this->db->like('name', 'Shop')->get('shop_rbac_privileges');
if ($skipPrivileges) {
$skipPrivileges = $skipPrivileges->result_array();
$skipPrivilegesIds = [];
array_map(
function ($privilege) use (&$skipPrivilegesIds) {
$skipPrivilegesIds[$privilege['id']] = $privilege;
},
$skipPrivileges
);
}

$privilegesPOSTIds = array_filter(
$privilegesPOST,
function ($id) use (&$skipPrivilegesIds, &$privilegesPOST) {
return !$skipPrivilegesIds[$id] ? true : false;
}
);
return $privilegesPOSTIds;
}

}
15 changes: 8 additions & 7 deletions application/modules/admin/sys_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ public function index() {
* initiate update process
*/
public function do_update() {
chmod(DOCUMENT_ROOT . '/backup.sql', 777);
unlink(DOCUMENT_ROOT . '/backup.sql');

chmod(DOCUMENT_ROOT . DIRECTORY_SEPARATOR . 'backup.sql', 777);
unlink(DOCUMENT_ROOT . DIRECTORY_SEPARATOR . 'backup.sql');

set_time_limit(99999999999999);

Expand Down Expand Up @@ -162,7 +163,7 @@ public function update($sort_by = 'create_date', $order = 'asc') {
}

/**
*
* @return void
*/
public function restore() {

Expand All @@ -176,7 +177,7 @@ public function restore() {
}

/**
*
* @return void
*/
public function renderFile() {

Expand All @@ -189,7 +190,7 @@ public function renderFile() {
}

/**
*
* @return void
*/
public function properties() {

Expand All @@ -212,7 +213,7 @@ public function properties() {
}

/**
*
* @return void
*/
public function get_license() {

Expand All @@ -229,7 +230,7 @@ public function get_license() {
}

/**
*
* @return void
*/
public function backup() {

Expand Down
48 changes: 24 additions & 24 deletions application/modules/cmsemail/classes/ParentEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ class ParentEmail extends MY_Controller
* @var array
*/
public $accepted_params = [
'name',
'from',
'from_email',
'theme',
'type',
'user_message',
'user_message_active',
'admin_message',
'admin_message_active',
'admin_email',
'description',
];
'name',
'from',
'from_email',
'theme',
'type',
'user_message',
'user_message_active',
'admin_message',
'admin_message_active',
'admin_email',
'description',
];

/**
* Attachment file
Expand Down Expand Up @@ -373,12 +373,12 @@ public function sendEmail($send_to, $pattern_name, $variables, $attachment = FAL
//Registering event is success
Events::create()->registerEvent(
[
'from' => $this->from,
'from_email' => $this->from_email,
'send_to' => $this->send_to,
'theme' => $this->theme,
'message' => $this->message,
],
'from' => $this->from,
'from_email' => $this->from_email,
'send_to' => $this->send_to,
'theme' => $this->theme,
'message' => $this->message
],
'ParentEmail:userSend'
);
Events::runFactory();
Expand All @@ -405,12 +405,12 @@ public function sendEmail($send_to, $pattern_name, $variables, $attachment = FAL
//Registering event is success
Events::create()->registerEvent(
[
'from' => $this->from,
'from_email' => $this->from_email,
'send_to' => $this->send_to,
'theme' => $this->theme,
'message' => $this->message,
],
'from' => $this->from,
'from_email' => $this->from_email,
'send_to' => $this->send_to,
'theme' => $this->theme,
'message' => $this->message
],
'ParentEmail:adminSend'
);
Events::runFactory();
Expand Down
25 changes: 19 additions & 6 deletions application/modules/comments/models/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
exit('No direct script access allowed');
}

/**
* @property CI_DB_active_record $db
* Class Base
*/
class Base extends CI_Model
{

Expand Down Expand Up @@ -170,20 +174,29 @@ public function setVoutesAfterDelete() {
->where('rate >', 0)
->get();

$rate = 0;
$votes = 0;
/** Если значений больше 0 вставляем их в rate и votes */
if ($query->num_rows() > 0) {
list($rate, $votes) = array_values($query->row_array());
$mod_shop = $this->db->get_where('comments', ['item_id' => $item, 'module' => 'shop']);

/* Если коментарии относятся к shop тогда записываем рейтинг */
if ($mod_shop->num_rows() > 0) {

$rate = 0;
$votes = 0;

/** Если значений больше 0 вставляем их в rate и votes */
if ($query->num_rows() > 0) {
list($rate, $votes) = array_values($query->row_array());

}

}
$products = SProductsRatingQuery::create()
->findOneByProductId($item);
$products->setVotes($votes);
$products->setRating($rate);
$products->save();

}
}

}

/**
Expand Down
16 changes: 8 additions & 8 deletions application/modules/exchange/classes/ExchangeBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ protected function insertBatch($tableName, $data) {
}
// gathering statistics
ExchangeBase::$stats[] = [
'query type' => 'insert',
'table name' => $tableName,
'affected rows' => count($data),
];
'query type' => 'insert',
'table name' => $tableName,
'affected rows' => count($data)
];
}

public function setXml(SimpleXMLElement $xml) {
Expand All @@ -140,10 +140,10 @@ protected function updateBatch($tableName, array $data, $keyToComare) {

// gathering statistics
ExchangeBase::$stats[] = [
'query type' => 'update',
'table name' => $tableName,
'affected rows' => count($data),
];
'query type' => 'update',
'table name' => $tableName,
'affected rows' => count($data)
];
}

/**
Expand Down
Loading

0 comments on commit f4b02bb

Please sign in to comment.