]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/job.c
Report all supported Job Creation attributes and their values (Issue #5340)
[thirdparty/cups.git] / scheduler / job.c
index 5ced0b9d1fc22387c4492c6735eeaa08a0bf161c..90aaccbf85ab8e91a32b3dd7b7eee71a36055173 100644 (file)
@@ -1,10 +1,11 @@
 /*
  * Job management routines for the CUPS scheduler.
  *
- * Copyright 2007-2017 by Apple Inc.
- * Copyright 1997-2007 by Easy Software Products, all rights reserved.
+ * Copyright © 2007-2018 by Apple Inc.
+ * Copyright © 1997-2007 by Easy Software Products, all rights reserved.
  *
- * Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+ * Licensed under Apache License v2.0.  See the file "LICENSE" for more
+ * information.
  */
 
 /*
@@ -3815,6 +3816,20 @@ get_options(cupsd_job_t *job,            /* I - Job */
       cupsdLogJob(job, CUPSD_LOG_DEBUG2, "After mapping finishings %s=%s", pwgppd->name, pwgppd->value);
   }
 
+ /*
+  * Map page-delivery values...
+  */
+
+  if ((attr = ippFindAttribute(job->attrs, "page-delivery", IPP_TAG_KEYWORD)) != NULL && !ippFindAttribute(job->attrs, "outputorder", IPP_TAG_ZERO))
+  {
+    const char *page_delivery = ippGetString(attr, 0, NULL);
+
+    if (!strncmp(page_delivery, "same-order", 10))
+      num_pwgppds = cupsAddOption("OutputOrder", "Normal", num_pwgppds, &pwgppds);
+    else if (!strncmp(page_delivery, "reverse-order", 13))
+      num_pwgppds = cupsAddOption("OutputOrder", "Reverse", num_pwgppds, &pwgppds);
+  }
+
  /*
   * Figure out how much room we need...
   */