mateusznitka / protocolsmanager

GLPI Plugin to report users inventory
8 stars 13 forks source link

Add fields to content #13

Closed brusilva84 closed 4 years ago

brusilva84 commented 4 years ago

It should be possible to add fields to the content box, for example some information about the user or the asset(s) in question.

Speirs47 commented 4 years ago

Or maybe even current date. I modified inc/generate.class.php (for my use only) to replace _{curdate} with current date, like that:

if ($row = $req->next()) { $content = nl2br($row["content"]); $content = str_replace("{cur_date}", date("d.m.Y"), $content);

mateusznitka commented 4 years ago

Or maybe even current date. I modified inc/generate.class.php (for my use only) to replace _{curdate} with current date, like that:

if ($row = $req->next()) { $content = nl2br($row["content"]); $content = str_replace("{cur_date}", date("d.m.Y"), $content);

Nice idea. I will take a look into this in upcoming update.

brusilva84 commented 4 years ago

I’ve forked the project and just created a new template.php with my needs.

[cid:image002.png@01D5BF3B.7D885500]

Bruno Mendes. Supervisor Técnico

MCoutinho Corporate Rua 1º Maio, 28 . 4630-228 Marco de Canaveses Tel: 255538088 . Tlm: 932 008 012 www.mcoutinho.pthttp://www.mcoutinho.pt/

De: Mateusz Nitka notifications@github.com Enviada: 26 de junho de 2020 10:08 Para: mateusznitka/protocolsmanager protocolsmanager@noreply.github.com Cc: Bruno Mendes bruno.mendes@mcoutinho.pt; Author author@noreply.github.com Assunto: Re: [mateusznitka/protocolsmanager] Add fields to content (#13)

Or maybe even current date. I modified inc/generate.class.php (for my use only) to replace {cur_date} with current date, like that:

if ($row = $req->next()) { $content = nl2br($row["content"]); $content = str_replace("{cur_date}", date("d.m.Y"), $content);

Nice idea. I will take a look into this in upcoming update.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/mateusznitka/protocolsmanager/issues/13#issuecomment-650075473, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKEZOG562M5TRQNFP3AS73LRYRQQZANCNFSM4MG6XPQA.

Speirs47 commented 4 years ago

FYI, i did the same with owner's name $content = str_replace("{owner}", $owner, $content);

mateusznitka commented 4 years ago

Hi, I added this functionality to new release. Thanks @Speirs47 You can now use fields: {owner}, {admin} and {cur_date}.

Regards