]> 91.132.146.200 Git - bibliotheca-php.git/commitdiff
fixed bulkedit
authorBanana <mail@bananas-playground.net>
Sun, 26 Nov 2023 11:37:08 +0000 (12:37 +0100)
committerBanana <mail@bananas-playground.net>
Sun, 26 Nov 2023 11:37:08 +0000 (12:37 +0100)
CHANGELOG
TODO
webclient/lib/manageentry.class.php
webclient/view/98/advancedsearch/advancedsearch.html
webclient/view/98/bulkedit/bulkedit.html [new file with mode: 0644]
webclient/view/default/advancedsearch/advancedsearch.php
webclient/view/default/bulkedit/bulkedit.php

index 2a2c3eac0100f0a828f630865868050be483c072..311f4f2af813f2a071df39df593ac0bb8ce7abd0 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -7,6 +7,7 @@
     * Fixed: #26 98 theme. max column with
     * Fixed: #25 98 design. Sort direction select does not show the correct selected option
     * Fixed: #23 basic search result order
+    * Fixed: Buledit in 98 theme and default
 
 1.5 - Sacred Passage 2023-05-01
     * Added google books parser. See upgrade file for more infos.
diff --git a/TODO b/TODO
index c75ceea2c03e098ff9b57047bb75677446292488..2dd355a6acfed4dad60e50f4b9f23bc514b6fa91 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,4 +1,3 @@
-* fix bulkedit
 * change multiple-attachment to a field which tells it is used for a image gallery
 * update JS and remove deprecations
 * complete profile view. Groups still missing.
index 70257177c7d75a9a8dff21e2731ea626271648bf..f1ea40684721d0ddd88445d0b45f88026aa266d6 100644 (file)
@@ -188,7 +188,7 @@ class Manageentry {
                                }
                        }
 
-                       if(DEBUG) Summoner::sysLog("[DEBUG] ".__METHOD__." queryData: ".Summoner::sysLog($queryData));
+                       if(DEBUG) Summoner::sysLog("[DEBUG] ".__METHOD__." queryData: ".Summoner::cleanForLog($queryData));
 
                        if(!empty($queryData['init']) || ($update !== false && is_numeric($update))) {
 
index aad8b148bc20f143a88bc2536ae1723953f76322..1ce7933ff8df2e07838baf7c6a872e26b5581d09 100644 (file)
                </form>
 
                <div class="sunken-panel">
-                       <table width="100">
+                       <table width="100%">
                                <thead>
                                <tr>
-                                       <th>View</th>
+                                       <th width="60px">View</th>
                                        <?php
                                        foreach($TemplateData['collectionFields'] as $f) {
                                                if(in_array($f['id'],$TemplateData['loadedCollection']['advancedSearchTableFields'])) {
diff --git a/webclient/view/98/bulkedit/bulkedit.html b/webclient/view/98/bulkedit/bulkedit.html
new file mode 100644 (file)
index 0000000..dbab5d3
--- /dev/null
@@ -0,0 +1,34 @@
+<h3 class="uk-h3">Bulkedit these entries in: <a href="index.php?p=colletions&collection<?php echo $TemplateData['loadedCollection']['id']; ?>"><?php echo $TemplateData['loadedCollection']['name']; ?></a></h3>
+
+<?php if(!empty($TemplateData['itemsToWorkWith'])) { ?>
+
+<ul>
+       <?php foreach($TemplateData['itemsToWorkWith'] as $entry) { ?>
+       <li><a href="index.php?p=entry&collection=<?php echo $TemplateData['loadedCollection']['id']; ?>&id=<?php echo $entry['id']; ?>"><?php echo $entry['title']; ?></a></li>
+       <?php } ?>
+</ul>
+
+<form class="maxSizeForm" method="post" enctype="multipart/form-data">
+       <?php foreach($TemplateData['itemsToWorkWith'] as $entry) { ?>
+       <input type="hidden" name="bulkedit[]" value="<?php echo $entry['id']; ?>" />
+       <?php } ?>
+
+<?php
+       foreach($TemplateData['editFields'] as $field) {
+               $field['bulkedit'] = true;
+               $_editFieldView = Summoner::themefile('manageentry/field-'.$field['type'].'.html', UI_THEME);
+               if(file_exists($_editFieldView)) {
+                       require $_editFieldView;
+               }
+               else {
+                       require $TemplateData['_editFieldViewDefault'];
+               }
+       }
+?>
+       <div class="field-row-stacked">
+               <input type="submit" name="submitForm" value="Save">
+       </div>
+
+</form>
+<script type="text/javascript" src="view/default/ui/js/suggest-tag.js"></script>
+<?php } ?>
index b1d6d5efc878b5dff83847355b1a99eb20aa279f..db96a3fc7e157d73f17596088ae9ee02aad14001 100644 (file)
@@ -56,7 +56,7 @@ if(!empty($_collection)) {
                                }
 
                                if (!empty($_search) && Summoner::validate($_search)) {
-                                       if (strstr($_search, ':')) { // field search
+                                       if (str_contains($_search, ':')) { // field search
                                                $_matches = array();
                                                if(preg_match_all("/(\p{L}+:)(?(?!\p{L}+:).)*/u",$_search, $_matches) !== false && !empty($_matches[0])) {
                                                        // $matches[0] has the identifier: and text
index 31b152d116417fb5d06c3a0f1c5bccfbc2bf6d47..056a10c6b472d782c43917dad9ff1f232826e613 100644 (file)
@@ -89,10 +89,10 @@ if(!empty($_collection)) {
                                                        switch ($data['bulkeditMethod']) {
                                                                case 'add':
                                                                        if(is_array($entry[$ident])) { // lookup multiple
-                                                                               $data['valueToSave'] = implode(",", $entry[$ident]) . $data['valueToSave'];
-                                                                       }
+                                                                               $data['valueToSave'] = implode(",", $entry[$ident]).",".$data['valueToSave'];
+                                    }
                                                                        else {
-                                                                               $data['valueToSave'] = $entry[$ident] . $data['valueToSave'];
+                                                                               $data['valueToSave'] = $entry[$ident].' '.$data['valueToSave'] ;
                                                                        }
                                                                break;
 
@@ -114,6 +114,8 @@ if(!empty($_collection)) {
                                                } else {
                                                        $_messages[] = "Entry could not be updated. See log for more details: ".$entry['id'];
                                                }
+
+                                               unset($data);
                                        }
 
                                        $TemplateData['message']['content'] = implode("<br />",$_messages);