• Resolved geohi

    (@geohi)


    what are the variables for the department field?

    I successfully added a column to the tableview when viewing the list of tickets.

    but i cant populate the column because your code is whacky and doesnt clearly state what the variable is for which department the ticket is under?

    is it $explode $exploder $exploded $department??? which is it?

    https://ww.wp.xz.cn/plugins/wpsc-support-tickets/

Viewing 5 replies - 1 through 5 (of 5 total)
  • No need to double post. Here is the other post, I will try to answer both here if that works for you.

    i am trying to populate a column of tickets and display the Department i have assigned them under.

    I have added the column, but i cant figure out why you have foreach within foreach within foreach within isset.. it doesnt make sense. can you just edit my code so i can display the DEPARTMENT column? thanks

    `$output.=’ src=”‘ . plugins_url(‘/images/page_edit.png’, __FILE__) . ‘” alt=”‘ . __(‘View’, ‘wpsc-support-tickets’) . ‘” /> ‘ . base64_decode($result[‘title’]) . ‘</td><td>’ . $resresolution . ‘</td><td>’ . date_i18n( get_option( ‘date_format’ ), $result[‘last_updated’]) . ‘ ‘ . __(‘by’, ‘wpsc-support-tickets’) . ‘ ‘ . $last_staff_reply . ‘ </td><td>’ . $EDIT_THIS_HERE_TO_SHOW_DEPARTMENT_PLEASE . ‘</td></tr>’;’

    I have to admit I actually think the code is very well organized, indented and commented. Clean and easy to read.

    To clarify. Neither of the code blocks you provided or the variables you provided are related to displaying your extra column. It seems like the ‘explode’ variables are used to break up strings, the ‘department’ variable will most likely store a list of department or a specific department.. even though I cannot seem to find this variable.

    Back to the question, could you answer the following questions please.
    Which view are you talking about? The frond-end or the back-end/admin panel? Did you add a custom field, or just added an extra column in the mark up? Are you trying to add a custom field column, or a column with the departments?

    A tip; watch out with editing plugins directly, if the author pushes an update (bug fix, security patch, etc.) and you decide to download that update you will loose all your custom made changes.

    Thanks,
    BTW, I am not affiliate or know the author of this plugin.

    Thread Starter geohi

    (@geohi)

    Thanks for the reply. I’m astonished you believe the code is “clean and easy to read” I haven’t seen a single commented line, and the breaks and tabs are.. random at best.

    To get back to you – I am talking about the front end where the users see the table of their currently open/closed tickets.

    Here’s the thing. In the backend options, admins have the options of setting up departments.. (remember the double pipes? ||)

    I have already created the column for Departments – that works, But now i want to populate that column with WHAT the department of that ticket is currently set to.

    So yes – that code i pasted IS the right location of the code. Because if i echo hello or put something random, that table column (in the right spot) does, indeed, populate.

    So, im trying to find the variable or the code to display that ticket’s department. any thoughts?

    [ No bumping please. ]

    Plugin Author jquindlen

    (@jquindlen)

    If you modify the plugin, you also need to have the knowledge to continue to modify the plugin for new versions of WordPress, and you must also back port any security or bug fixes I create in future versions to your version, or alternatively you must recreate your changes each time you download a new update to wpsc Support Tickets.

    Speaking of which, the department system has been completely rewritten in version 5. When upgrading from version 4.x to version 5, it will convert your existing departments to the new format. A new admin page is added specifically for departments, and this page allows you to assign staff to departments, including a department head, along with a ton of new department specific options. I mention this because any code you write now for departments is not going to work in newer versions of wpsc Support Tickets, so you may want to wait.

    What you really need from me are action hooks and filters in different places so that you can write you own plugin that modifies what wpsc Support Tickets displays. That’s the correct path in order to allow your changes to persist while at the same allowing you to update wpsc Support Tickets to the latest version.

    But to answer your question, you want to base64 decode the type field in the wpscst_tickets table, so if you’re iterating through $results as $result from that table, it would be:

    base64_decode($result['title'])

    Again, that code won’t work in version 5.

    Plugin Author jquindlen

    (@jquindlen)

    base64_decode($result['type']);

    is what I meant

    Thread Starter geohi

    (@geohi)

    already posted the solution. thanks tho

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘variable for Departments?’ is closed to new replies.