Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Change primary ticket button - post reply / internal note

Hi together,

in our daily work we mostly just update the ticket by using the internal note function,
often with informations that should be only readed by internal staff.
Unfortunately the first present field is "post reply", so sometimes it happens that
we send informations to customers they shouldnt read.

Actual i was not able to find a function to change this in the osticket configuration.
I would be very thankfull if somebody had an idea how to change or modificate osticket
to have "internal note" as primary input field?

Thanks for all reply!

Comments

  • Hi,

    you need only change two lines in include\staff\ticket-wiev.inc.php as follow:

    Original:
    <?php
            if($thisstaff->canPostReply()) { ?>
            <li><a id="reply_tab" href="#reply"><?php echo __('Post Reply');?></a></li>
            <?php
            } ?>
            <li><a id="note_tab" href="#note"><?php echo __('Post Internal Note');?></a></li>
            <?php

    Updated:
    <?php
            if($thisstaff->canPostReply()) { ?>
            <li><a id="note_tab" href="#note"><?php echo __('Post Internal Note');?></a></li>
            <?php
            } ?>
            <li><a id="reply_tab" href="#reply"><?php echo __('Post Reply');?></a></li>
            <?php

    Viel Spass
    Pavel
  • edited November 2016
    Hi Pavel,

    thanks!
    I`ve found a little bit different code in the file include\staff\ticket-view.inc.php
    maybe you tried at an older osticket version.
    But anyway on that way i changed it like the following and it works :-)

    Line 525 - 536

    Original:
        <ul class="tabs" id="response-tabs">
            <?php
            if ($role->hasPerm(TicketModel::PERM_REPLY)) { ?>
            <li class="active <?php
                echo isset($errors['reply']) ? 'error' : ''; ?>"><a
                href="#reply" id="post-reply-tab"><?php echo __('Post Reply');?></a></li>
            <?php
            } ?>
            <li><a href="#note" <?php
                echo isset($errors['postnote']) ?  'class="error"' : ''; ?>
                id="post-note-tab"><?php echo __('Post Internal Note');?></a></li>
        </ul>

    Updated:
        <ul class="tabs" id="response-tabs">
            <?php
            if ($role->hasPerm(TicketModel::PERM_REPLY)) { ?>
            <li class="active <?php
                echo isset($errors['postnote']) ? 'error' : ''; ?>"><a
                href="#note" id="post-note-tab"><?php echo __('Post Internal Note');?></a></li>
            <?php
            } ?>
            <li><a href="#reply" <?php
                echo isset($errors['reply']) ?  'class="error"' : ''; ?>
                id="post-reply-tab"><?php echo __('Post Reply');?></a></li>
        </ul>

    Thanks again!
  • Hi Skychef,

    I use 1.9.12. But you are found the right place in your version.
    I think, you made a security mistake in your change.
    As i see, right is as follow:

    <ul class="tabs" id="response-tabs">
            <li><a href="#note" <?php
                echo isset($errors['postnote']) ?  'class="error"' : ''; ?>
                id="post-note-tab"><?php echo __('Post Internal Note');?></a></li>
            <?php
            if ($role->hasPerm(TicketModel::PERM_REPLY)) { ?>
            <li class="active <?php
                echo isset($errors['reply']) ? 'error' : ''; ?>"><a
                href="#reply" id="post-reply-tab"><?php echo __('Post Reply');?></a></li>
            <?php
            } ?>
    </ul>

    But don´t  be sad. This miste make I too in my first answer.
  • So i was happy to early,
    after changing like i posted the buttons are switched,
    so first "Post Internal Note" and second "Post Reply"
    but the view from "Post Internal Note" is similar to the view of "Post Reply"
    only if you click again to "Post Internal Note" you get shown the proper view...

    So the solution is not finished ;-)

    Actual i cant follow your post, what have you changed in your code that might be a security mistake?
  • Security mistake was on content IF ... Then command. 
    IF user can post reply THEN allow post reply. Mistake was on: IF user can post reply THEN allow post internal note :-).
  • Hi, I'm using osticket v1.10 and I can't select internal note as default tab with this instructions... I think the code you've published doesn't run in the last version... Any suggestions? My knowledge is very limited.

    Thanks in advance
  • edited July 18
    Tested successfully in v1.9.14, just before the end of /scp/js/ticket.js:

       if($(this).val() == 0)
                $cc.hide();
       else
       $cc.show();
         });
       $('#note_tab').trigger('click');
    };
    $(ticket_onload);
  • For 1.10, I wrote a plugin for that: https://github.com/clonemeagain/osticket-plugin-notefirst

    It has several possible bootstrap methods, because of $ost and how it bootstraps.. read the readme for more info. 
  • Hi Grizly,

    thanks for your plugin, i will try it soon!
  • Works fine! Thank you :-)
  • No worries mate. :-)
Sign In or Register to comment.