Skip to content

Commit

Permalink
changed all tag printing to go through the queue
Browse files Browse the repository at this point in the history
  • Loading branch information
RocketMan committed Jun 13, 2018
1 parent ae5ed61 commit 33554c4
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions ui/Editor.php
Expand Up @@ -245,7 +245,7 @@ public function queueList($validate) {
foreach($_POST as $key => $value) {
if(substr($key, 0, 3) == "tag" && $value == "on") {
$tag = substr($key, 3);
if($_REQUEST["print"])
if($_REQUEST["print"] && $this->session->isLocal())
$this->printTag($tag);
Engine::api(IEditor::class)->dequeueTag($tag, $this->session->getUser());
$this->skipVar("tag".$tag);
Expand Down Expand Up @@ -445,7 +445,7 @@ public function panelNull($validate) {
public function panelSearch($validate) {
if($validate) {
if($_REQUEST["print"] && $_REQUEST["seltag"]) {
$this->printTag($_REQUEST["seltag"]);
$this->enqueueTag($_REQUEST["seltag"]);
}
return ($_REQUEST["seltag"] || $_REQUEST["new"]) &&
!$_REQUEST["bup_x"] && !$_REQUEST["bdown_x"] &&
Expand Down Expand Up @@ -629,7 +629,7 @@ private function insertUpdateAlbum() {
if($result) {
if($_REQUEST["new"]) {
$_REQUEST["seltag"] = $album["tag"];
$this->printTag($_REQUEST["seltag"]);
$this->enqueueTag($_REQUEST["seltag"]);
}

$this->albumAdded = $_REQUEST["new"];
Expand Down Expand Up @@ -689,8 +689,7 @@ private function getTitle($seq) {
else if($this->albumUpdated)
$title = "Album Updated!";
if($this->tagPrinted) {
$printed = $this->session->isLocal()?"Printed":"Queued";
$title .= "&nbsp;&nbsp;<FONT CLASS=\"success\">Tag $printed</FONT>";
$title .= "&nbsp;&nbsp;<FONT CLASS=\"success\">Tag Queued</FONT>";
}
break;
case "details":
Expand All @@ -714,6 +713,8 @@ private function getTitle($seq) {
break;
case "select":
$title = "Select tags to print";
if($this->tagPrinted)
$title = "<FONT CLASS=\"success\">Tag(s) Printed</FONT>";
break;
case "print":
$title = "Place album tags on the label form";
Expand Down Expand Up @@ -1446,15 +1447,14 @@ public static function makeLabel($tag, $charset, $dark=1,

return $output;
}

private function enqueueTag($tag) {
// Enqueue tag for later printing
Engine::api(IEditor::class)->enqueueTag($tag, $this->session->getUser());
$this->tagPrinted = 1;
}

private function printTag($tag) {
if(!$this->session->isLocal()) {
// Enqueue tag for later printing
Engine::api(IEditor::class)->enqueueTag($tag, $this->session->getUser());
$this->tagPrinted = 1;
return;
}

$config = Engine::param('label_printer');
$charset = self::$charset[$config['charset']];

Expand Down

0 comments on commit 33554c4

Please sign in to comment.