Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Destination list for moving all jobs has no item when only a printer is registered. #3094

Closed
michaelrsweet opened this Issue Feb 8, 2009 · 3 comments

Comments

Projects
None yet
1 participant
@michaelrsweet
Copy link
Collaborator

michaelrsweet commented Feb 8, 2009

Version: 1.4-current
CUPS.org User: saitou-t

After I registered only one printer, I can select "Move All Jobs" menu on Web UI.
"Move All Jobs" page is shown after selecting the menu, but destination printers
list has no printers (and cleasses).
I think CUPS should show a error page for users in this case.
Because they cannot do it with "Move All Jobs" page which has no printers.

I attach a patch.

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

michaelrsweet commented Apr 29, 2009

CUPS.org User: mike

Fixed in Subversion repository.

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

michaelrsweet commented Apr 29, 2009

"nodest.patch":

406a407,426

 /*
  * If no destination is added, show error page.
  */
  if (i == 0)
  {
    if (job_id)
    {
      cgiStartHTML(cgiText(_("Move Job")));
      cgiSetVariable("ERROR", _("No destination for moving job!"));
    }
    else
    {
      cgiStartHTML(cgiText(_("Move All Jobs")));
      cgiSetVariable("ERROR", _("No destination for moving all jobs!"));
    }
    cgiCopyTemplateLang("error.tmpl");
    cgiEndHTML();
    return;
  }         
@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

michaelrsweet commented Apr 29, 2009

"str3094.patch":

Index: cgi-bin/ipp-var.c

--- cgi-bin/ipp-var.c (revision 8582)
+++ cgi-bin/ipp-var.c (working copy)
@@ -288,8 +288,7 @@

  • See who is logged in...
    */
  • if ((user = getenv("REMOTE_USER")) == NULL)
  • user = "guest";
  • user = getenv("REMOTE_USER");

/*

  • See if the user has already selected a new destination...
    @@ -374,9 +373,15 @@
    ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
    "requested-attributes", NULL, "printer-uri-supported");

  • ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,

  •             "requesting-user-name", NULL, user);
    
  • if (user)

  •  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
    
  •      "requesting-user-name", NULL, user);
    
  • ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_ENUM, "printer-type",

  •              CUPS_PRINTER_LOCAL);
    
  • ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_ENUM, "printer-type-mask",

  •              CUPS_PRINTER_SCANNER);
    

    if ((response = cupsDoRequest(http, request, "/")) != NULL)
    {
    for (i = 0, attr = ippFindAttribute(response, "printer-uri-supported",
    @@ -415,7 +420,18 @@
    else
    cgiStartHTML(cgiText(_("Move All Jobs")));

  • cgiCopyTemplateLang("job-move.tmpl");

  • if (cgiGetSize("JOB_PRINTER_NAME") > 0)

  •  cgiCopyTemplateLang("job-move.tmpl");
    
  • else

  • {

  •  if (job_id)
    
  • cgiSetVariable("MESSAGE", cgiText(_("Unable to move job")));

  •  else
    
  • cgiSetVariable("MESSAGE", cgiText(_("Unable to move jobs")));

  •  cgiSetVariable("ERROR", cgiText(_("No destinations added.")));
    
  •  cgiCopyTemplateLang("error.tmpl");
    
  • }
    }
    else
    {

@michaelrsweet michaelrsweet added this to the Stable milestone Mar 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.