Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nicodim99 committed Oct 26, 2017
1 parent 5cde260 commit 13ee7ed
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cms/app/fileselect/Panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ Ext.define('Cetera.fileselect.Panel', {
me.centerPanel.insert(0,progress);

Cetera.Ajax.request({
url: 'include/action_files.php?action=upload&path='+path,
url: '/cms/include/action_files.php?action=upload&path='+path,
timeout: 1000000,
method: 'POST',
rawData: formData,
Expand Down
2 changes: 1 addition & 1 deletion cms/app/window/ImageCrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Ext.define('Cetera.window.ImageCrop', {
formData.append('file', blob, baseName);
me.setLoading(true);
Cetera.Ajax.request({
url: 'include/action_files.php?action=upload&overwrite=1&path='+path,
url: '/cms/include/action_files.php?action=upload&overwrite=1&path='+path,
timeout: 1000000,
method: 'POST',
rawData: formData,
Expand Down
2 changes: 1 addition & 1 deletion cms/app/window/Upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Ext.define('Cetera.window.Upload', {
var prefix = _('Загрузка')+': '+file.name;

Cetera.Ajax.request({
url: 'include/action_files.php?action=upload&path='+this.pathField.getValue(),
url: '/cms/include/action_files.php?action=upload&path='+this.pathField.getValue(),
timeout: 1000000,
method: 'POST',
rawData: formData,
Expand Down
3 changes: 2 additions & 1 deletion cms/include/action_files.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,9 @@ function check_file($file, $readonly = false)
}

if ($_REQUEST['action'] == 'upload_path') {
$s = $application->getSession();
$res['success'] = true;
$res['path'] = USER_UPLOAD_PATH . date('Ymd') . '/';
$res['path'] = isset($s->last_upload_path)?$s->last_upload_path:USER_UPLOAD_PATH.date('Ymd').'/';
}

if ($_REQUEST['action'] == 'delete') {
Expand Down
4 changes: 2 additions & 2 deletions cms/include/classes/Cetera/Catalog.php
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ public function delete()
while ($f = $r->fetch()) {
try {
$r1 = self::getDbConnection()->query('SELECT id FROM '.$f['alias'].' WHERE idcat='.$f['data_id']);
while ($f1 = $r1->fetch()) {
while ($f1 = $r1->fetch(\PDO::FETCH_NUM)) {
$m = Material::getById($f1[0], 0, $f['alias']);
$m->delete();
}
Expand Down Expand Up @@ -1232,7 +1232,7 @@ public function save()
$newtable = $conn->fetchColumn("SELECT alias from types where id=".$this->fields['typ']);
if ($newtable) {
$r = $conn->query("select B.alias,A.name from types_fields A, types B where B.id=A.id and A.type=".FIELD_LINKSET." and A.pseudo_type<>".PSEUDO_FIELD_CATOLOGS." and A.len=".$this->id);
while ($f = $r->fetch())
while ($f = $r->fetch(\PDO::FETCH_NUM))
$conn->executeQuery("alter table ".$f[0]."_".$this->materialsTable."_".$f[1]." rename ".$f[0]."_".$newtable."_".$f[1]);
}
}
Expand Down
4 changes: 2 additions & 2 deletions cms/include/classes/Cetera/DynamicFieldsObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ public function delete()
// удаление ссылок на этот материал
if (property_exists($this, 'idcat') && $this->idcat >= 0) {
$r = $this->getDbConnection()->query("select A.alias, B.name, B.type from types A, types_fields B where B.id=A.id and B.len=".$this->idcat." and (B.type=".FIELD_LINK." or B.type=".FIELD_LINKSET.")");
while ($f = $r->fetch()) {
while ($f = $r->fetch(\PDO::FETCH_NUM)) {
if ($f[2] == FIELD_LINK) {
$this->getDbConnection()->executeQuery("update $f[0] set $f[1]=0 where $f[1]=".$this->id);
} else {
Expand All @@ -702,7 +702,7 @@ public function delete()
}
} else {
$r = $this->getDbConnection()->query("select A.alias, B.name from types A, types_fields B where B.id=A.id and B.len = ".$this->objectDefinition->id." and B.type=".FIELD_MATSET);
while ($f = $r->fetch()) {
while ($f = $r->fetch(\PDO::FETCH_NUM)) {
$this->getDbConnection()->executeQuery("delete from $f[0]"."_".$this->table."_"."$f[1] where dest=".$this->id);
}
}
Expand Down
2 changes: 1 addition & 1 deletion cms/include/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function check_upload_file($name) {
}
}

* DEPRECATED
/* DEPRECATED
* Делает mysql_query() c контролем ошибок
*
* @param string $query SQL query
Expand Down
2 changes: 1 addition & 1 deletion cms/include/data_tree.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
if ($_GET['query'])
$where .= ' and name LIKE '.$application->getConn()->quote('%'.$_GET['query'].'%');
//$m = $c->getMaterials('name', $where, $matsort, '', 500, 0);
$m = $c->getMaterials()->where($where)->setItemsCountPerPage(500);
$m = $c->getMaterials()->where($where)->setItemCountPerPage(500);

foreach ($m as $material) {
$name = htmlspecialchars($material->name);
Expand Down

0 comments on commit 13ee7ed

Please sign in to comment.