Jump to content

Custom Office Management CRM/Controlling Software


bernhard

Recommended Posts

9 hours ago, Sephiroth said:

This is a really BIG Project you should write an article around this especially a case study

Is this a ProcessWire friday happiness guest blog post request I'm reading?! :D 'cause it would be awesome.

  • Like 4
Link to comment
Share on other sites

Here's a fairly easy question:

With regard to the invoice GIF you shared, I hadn't ever seen auto-suggest/auto-fill links used before ... Is that a component built into core, an existing module, or something you customized?

Everything else shown is enormously impressive. I'd like to think that PW is still running blazingly fast, but I'll ask anyway: is PW still running efficiently for the client (and during your mockdata testing)?

  • Thanks 1
Link to comment
Share on other sites

9 minutes ago, BrendonKoz said:

With regard to the invoice GIF you shared, I hadn't ever seen auto-suggest/auto-fill links used before ... Is that a component built into core, an existing module, or something you customized?

it's one of many custom "hacks" ;)

all the items can be set by the client on a custom settings page. it's a regular repeater. then there is a hook that renders that items as field description and some javascript that adds the html to the ckeditor.

9 minutes ago, BrendonKoz said:

Everything else shown is enormously impressive. I'd like to think that PW is still running blazingly fast, but I'll ask anyway: is PW still running efficiently for the client (and during your mockdata testing)?

thanks. no problem at all. but there's not really a lot of data... the table showing all the revenues for different years is a custom DB-view because there's no built in possibility for such listings in pw. the pw alternative would be many many foreach loops and thats a no-go.

  • Like 2
Link to comment
Share on other sites

28 minutes ago, bernhard said:

it's one of many custom "hacks" ;)

all the items can be set by the client on a custom settings page. it's a regular repeater. then there is a hook that renders that items as field description and some javascript that adds the html to the ckeditor.

I would love to see that hack/hooks :-) 

I admire this PW community, showing their work, coming up with great ideas and helping other.

Link to comment
Share on other sites

32 minutes ago, matjazp said:

I would love to see that hack/hooks :-) 

nothing fancy here. you see it's not polished and some hardcoded values...

the javascript to handle the clicks:

$(document).on('click', '.ckesnippet', function() {
    // find correct ckeditor instance
    $field = $(this).closest('li.Inputfield');
    var id = $field.attr('id');
    var ckename = id.replace('wrap_','');

    var cke = CKEDITOR.instances[ckename];
    var data = cke.getData();
    cke.setData(data + $(this).data('snippet'));
    return false;
});

and the hook to modify the field:

$this->addHookBefore('InputfieldTextarea::render', $this, function($event) {
        $field = $event->object;
        if($field->name == 'rockinvoice_suffix') {
            $del = '';
            foreach($this->wire->pages->get(38967)->texttemplates as $item) {
                $field->entityEncodeText = false;
                $field->description .= $del . '<a href="#" class="ckesnippet" data-snippet="' . str_replace(PHP_EOL, '', $item->body) . '">' . $item->title . '</a>';
                $del = ' | ';
            }
        }
        elseif($field->name == 'rockinvoice_prefix') {
            $del = '';
            foreach($this->wire->pages->get(38967)->texttemplates_greeting as $item) {
                $field->entityEncodeText = false;
                $field->description .= $del . '<a href="#" class="ckesnippet" data-snippet="' . str_replace(PHP_EOL, '', $item->body) . '">' . $item->title . '</a>';
                $del = ' | ';
            }
        }

        $this->wire->modules->get('RockTools')->loadAsset('ckesnippets.js', 'HrDiamonds');
    });

and a repeater to setup the snippets:

59c40f340258d_2017-09-2121_12_03-EditPage_Einstellungencrm.hrdiamonds_com.png.4ed7e086f6048f0bfb2c4a0cfd47ba90.png

  • Like 7
Link to comment
Share on other sites

It's really amazing how much work can be done adding Hooks where needed and you can turn Process modules and Inputfields into powerful interfaces just understanding a bit of the source code, I now don't want to write app interfaces/data models anymore, just think how I can leverage ProcessWire to do anything I want, in a third of the time.

Hope everyone keeps sharing their awesome work!

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...