attr = ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_KEYWORD,
"job-hold-until", NULL, val);
}
- if (attr && strcmp(attr->values[0].string.text, "no-hold"))
+
+ if (printer->holding_new_jobs)
+ {
+ /*
+ * Hold all new jobs on this printer...
+ */
+
+ if (attr && strcmp(attr->values[0].string.text, "no-hold"))
+ cupsdSetJobHoldUntil(job, ippGetString(attr, 0, NULL), 0);
+ else
+ cupsdSetJobHoldUntil(job, "indefinite", 0);
+
+ job->state->values[0].integer = IPP_JOB_HELD;
+ job->state_value = IPP_JOB_HELD;
+
+ ippSetString(job->attrs, &job->reasons, 0, "job-held-on-create");
+ }
+ else if (attr && strcmp(attr->values[0].string.text, "no-hold"))
{
/*
* Hold job until specified time...
"Printer \"%s\" now printing pending/new jobs (\"%s\").",
printer->name, get_username(con));
+ cupsdCheckJobs();
+
/*
* Everything was ok, so return OK status...
*/
*pclass; /* Printer class destination */
ipp_attribute_t *attr; /* Job attribute */
time_t curtime; /* Current time */
+ const char *reasons; /* job-state-reasons value */
curtime = time(NULL);
((FilterLevel + job->pending_cost) < FilterLimit || FilterLevel == 0))
cupsdContinueJob(job);
+ /*
+ * Skip jobs that where held-on-create
+ */
+
+ reasons = ippGetString(job->reasons, 0, NULL);
+ if (reasons && !strcmp(reasons, "job-held-on-create"))
+ {
+ /*
+ * Check whether the printer is still holding new jobs...
+ */
+
+ printer = cupsdFindDest(job->dest);
+
+ if (printer->holding_new_jobs)
+ continue;
+
+ ippSetString(job->attrs, &job->reasons, 0, "none");
+ }
+
/*
* Start pending jobs if the destination is available...
*/
"Job aborted because the destination printer/class "
"has gone away.");
}
- else if (printer && !printer->holding_new_jobs)
+ else if (printer)
{
/*
* See if the printer is available or remote and not printing a job;