mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-13 05:01:43 +00:00
- categories is no longer a comma separated list but an array
This commit is contained in:
parent
a0a4a37b85
commit
f99492d31a
|
@ -47,7 +47,7 @@ if ($document->getAccessMode($user) < M_READWRITE) {
|
||||||
$name = $_POST["name"];
|
$name = $_POST["name"];
|
||||||
$comment = $_POST["comment"];
|
$comment = $_POST["comment"];
|
||||||
$keywords = $_POST["keywords"];
|
$keywords = $_POST["keywords"];
|
||||||
$categories = preg_replace('/[^0-9,]+/', '', $_POST["categoryidform1"]);
|
$categories = $_POST["categories"];
|
||||||
$sequence = $_POST["sequence"];
|
$sequence = $_POST["sequence"];
|
||||||
if (!is_numeric($sequence)) {
|
if (!is_numeric($sequence)) {
|
||||||
$sequence="keep";
|
$sequence="keep";
|
||||||
|
@ -130,7 +130,7 @@ if (($oldkeywords = $document->getKeywords()) != $keywords) {
|
||||||
|
|
||||||
if($categories) {
|
if($categories) {
|
||||||
$categoriesarr = array();
|
$categoriesarr = array();
|
||||||
foreach(explode(',', $categories) as $catid) {
|
foreach($categories as $catid) {
|
||||||
if($cat = $dms->getDocumentCategory($catid)) {
|
if($cat = $dms->getDocumentCategory($catid)) {
|
||||||
$categoriesarr[] = $cat;
|
$categoriesarr[] = $cat;
|
||||||
}
|
}
|
||||||
|
@ -142,7 +142,7 @@ if($categories) {
|
||||||
$oldcatsids[] = $oldcategory->getID();
|
$oldcatsids[] = $oldcategory->getID();
|
||||||
|
|
||||||
if (count($categoriesarr) != count($oldcategories) ||
|
if (count($categoriesarr) != count($oldcategories) ||
|
||||||
array_diff(explode(',', $categories), $oldcatsids)) {
|
array_diff($categories, $oldcatsids)) {
|
||||||
if($document->setCategories($categoriesarr)) {
|
if($document->setCategories($categoriesarr)) {
|
||||||
} else {
|
} else {
|
||||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_occured"));
|
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_occured"));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user