Skip to content

Commit

Permalink
Merge branch 'release/2.3.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-anne committed Jun 21, 2018
2 parents a7a89cc + e624aaa commit 5bf1f95
Show file tree
Hide file tree
Showing 17 changed files with 916 additions and 43 deletions.
2 changes: 1 addition & 1 deletion inc/model.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,7 @@ static function install($migration) {
SET `replace_contact_num`=`replace_contact`";
$DB->queryOrDie($query, "Fill replace_contact_num");
}
if (!FieldExists($table, 'raz_plugin_fields')) {
if (!$DB->fieldExists($table, 'raz_plugin_fields')) {
$migration->addField($table, 'raz_plugin_fields', "bool");
}

Expand Down
45 changes: 32 additions & 13 deletions inc/replace.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,13 @@ static function replace($type, $model_id, $tab_ids, $location) {
switch ($model->fields['replace_method']) {
case self::METHOD_PURGE:
// Retrieve, Compute && Update NEW comment field
$comment = self::getCommentsForReplacement($olditem, true);
if (!empty($newitem->fields['comment'])) {
$comment = stripslashes($newitem->fields['comment']);
} else {
$comment = "";
}

$comment.= self::getCommentsForReplacement($olditem, true);
$comment.="\n- " . __('See attached document', 'uninstall');
$newitem->update(['id' => $newitem_id,
'comment' => addslashes($comment)],
Expand All @@ -414,17 +420,30 @@ static function replace($type, $model_id, $tab_ids, $location) {

case self::METHOD_DELETE_AND_COMMENT:
case self::METHOD_KEEP_AND_COMMENT:
//Add comment on the new item first
$comment = self::getCommentsForReplacement($newitem, true);
// Retrieve && Compute comment for newitem (with olditem)
if (!empty($newitem->fields['comment'])) {
$commentnew = stripslashes($newitem->fields['comment']);
} else {
$commentnew = "";
}
$commentnew.= self::getCommentsForReplacement($olditem, true);

// Retrieve && Compute comment for olditem (with newitem)
if (!empty($olditem->fields['comment'])) {
$commentold = stripslashes($olditem->fields['comment']);
} else {
$commentold = "";
}
$commentold.= self::getCommentsForReplacement($newitem, false);

// Update comment for newitem
$newitem->update(['id' => $newitem_id,
'comment' => Toolbox::addslashes_deep($comment)],
'comment' => Toolbox::addslashes_deep($commentnew)],
false);

// Retrieve, Compute && Update OLD comment field
$comment = self::getCommentsForReplacement($olditem, false);

// Update comment for olditem
$olditem->update(['id' => $olditem_id,
'comment' => Toolbox::addslashes_deep($comment)],
'comment' => Toolbox::addslashes_deep($commentold)],
false);

// Delete OLD item from DB (not PURGE) only if delete is requested
Expand Down Expand Up @@ -462,11 +481,7 @@ static function replace($type, $model_id, $tab_ids, $location) {
**/
static function getCommentsForReplacement(CommonDBTM $item, $new=true, $display_message=true) {

if (!empty($item->fields['comment'])) {
$string = stripslashes($item->fields['comment']);
} else {
$string = "";
}
$string = "";

if ($display_message) {
if ($new) {
Expand All @@ -476,6 +491,10 @@ static function getCommentsForReplacement(CommonDBTM $item, $new=true, $display_
}
}

if ($item->isField('id')) {
$string.= "\n ".sprintf(__('%1$s: %2$s'), __('ID'), $item->getField('id'));
}

if ($item->isField('name')) {
$string.= "\n ".sprintf(__('%1$s: %2$s'), __('Name'), $item->getField('name'));
}
Expand Down
18 changes: 16 additions & 2 deletions inc/uninstall.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@ static function uninstall($type, $model_id, $tab_ids, $location) {
//Delete computer's volumes
self::purgeComputerVolumes($id);

//Delete computer antivirus
self::purgeComputerAntivirus($id);

if ($model->fields["raz_history"] == 1) {
//Delete history related to software
self::deleteHistory($id, false);
Expand Down Expand Up @@ -460,13 +463,24 @@ static function deleteFusionInventoryLink($itemtype, $items_id) {


static function purgeComputerVolumes($computers_id) {

$computerdisk = new ComputerDisk();
$computerdisk->dohistory = false;
$computerdisk->deleteByCriteria(array('computers_id' => $computers_id));
$computerdisk->deleteByCriteria(['computers_id' => $computers_id]);
}


/**
* Remove antivirus informations
* @since 2.3.0
*
* @param integer $computers_id the computer ID
*/
static function purgeComputerAntivirus($computers_id) {
$antivirus = new ComputerAntivirus();
$antivirus->dohistory = false;
$antivirus->deleteByCriteria(['computers_id' => $computers_id], true);
}

/**
* Remove all the computer software's history
*
Expand Down
Binary file added locales/cs_CZ.mo
Binary file not shown.
272 changes: 272 additions & 0 deletions locales/cs_CZ.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,272 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-09-22 12:03+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Pavel Borecki <[email protected]>, 2018\n"
"Language-Team: Czech (Czech Republic) (https://www.transifex.com/teclib/teams/28042/cs_CZ/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: cs_CZ\n"
"Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;\n"

#: front/action.php:55 inc/replace.class.php:447
msgid "Replacement successful"
msgstr "Nahrazení úspěšné"

#: front/action.php:96 inc/uninstall.class.php:315
msgid "Uninstallation successful"
msgstr "Odinstalace úspěšná"

#: hook.php:50 inc/uninstall.class.php:110 inc/uninstall.class.php:770
msgid "Uninstall"
msgstr "Odinstalovat"

#: ajax/locations.php:43 inc/replace.class.php:560 inc/preference.class.php:74
msgid "Keep previous location"
msgstr "Ponechat předchozí umístění"

#: ajax/locations.php:44 inc/replace.class.php:564 inc/preference.class.php:76
msgid "Empty location"
msgstr "Prázdné umístění"

#: inc/model.class.php:42
msgid "Uninstallation template"
msgstr "Šablona odinstalace"

#: inc/model.class.php:108 inc/model.class.php:880 inc/model.class.php:922
msgid "Uninstallation"
msgstr "Odinstalace"

#: inc/model.class.php:110 inc/model.class.php:882 inc/model.class.php:924
#: inc/replace.class.php:61 inc/replace.class.php:108
msgid "Replacement"
msgstr "Nahrazení"

#: inc/model.class.php:120
msgid "PDF Archiving"
msgstr "PDF archivace"

#: inc/model.class.php:122
msgid "CSV Archiving"
msgstr "CSV archivace"

#: inc/model.class.php:125
msgid "Purge"
msgstr "Trvale smazat"

#: inc/model.class.php:126
msgid "Delete + Comment"
msgstr "Smazat + komentovat"

#: inc/model.class.php:127
msgid "Keep + Comment"
msgstr "Ponechat + komentovat"

#: inc/model.class.php:168
msgid "Replacing data"
msgstr "Nahrazují se data"

#: inc/model.class.php:212 inc/model.class.php:766
msgid "Type of template"
msgstr "Typ šablony"

#: inc/model.class.php:221 inc/model.class.php:741
msgid "Transfer's model to use"
msgstr "Model přenosu který použít"

#: inc/model.class.php:241 inc/replace.class.php:574
msgid "New status of the computer"
msgstr "Nový stav počítače"

#: inc/model.class.php:253 inc/model.class.php:774
msgid "Action on group"
msgstr "Akce na skupině"

#: inc/model.class.php:265
msgid "New group"
msgstr "Nová skupina"

#: inc/model.class.php:286
msgid "Add template"
msgstr "Přidat šablonu"

#: inc/model.class.php:289
msgid "Manage templates"
msgstr "Spravovat šablony"

#: inc/model.class.php:300
msgid "Erase datas"
msgstr "Vymazat data"

#: inc/model.class.php:303 inc/model.class.php:684
msgid "Delete software history (computers)"
msgstr "Smazat historii software (počítače)"

#: inc/model.class.php:308 inc/model.class.php:787
msgid "Delete the whole history"
msgstr "Smazat celou historii"

#: inc/model.class.php:382 inc/model.class.php:432
msgid "Informations replacement"
msgstr "Nahrazení informací"

#: inc/model.class.php:383 inc/replace.class.php:520
msgid "General informations"
msgstr "Obecné informace"

#: inc/model.class.php:405 inc/replace.class.php:535
msgid "Overwrite informations (from old item to the new)"
msgstr "Přepsat informace (z původní položky do nové)"

#: inc/model.class.php:412 inc/model.class.php:781 inc/replace.class.php:538
msgid "Archiving method of the old material"
msgstr "Metoda archivace původního materiálu"

#: inc/model.class.php:422
msgid "Plugin PDF is installed and activated"
msgstr "Zásuvný modul pro PDF je nainstalovaný a zapnutý"

#: inc/model.class.php:425
msgid ""
"Plugin PDF is not installed, you won't be able to use PDF format for "
"archiving"
msgstr ""
"Zásuvný modul pro PDF není nainstalován, proto nebude možné pro archivaci "
"použít PDF formát"

#: inc/model.class.php:433 inc/replace.class.php:596
msgid "Connections with other materials"
msgstr "Propojení s ostatními materiály"

#: inc/model.class.php:507 inc/replace.class.php:631
msgid "Direct connections"
msgstr "Přímá propojení"

#: inc/model.class.php:580
msgid "OCSNG link"
msgid_plural "OCSNG links"
msgstr[0] "OCSNG odkaz"
msgstr[1] "OCSNG odkazy"
msgstr[2] "OCSNG odkazů"
msgstr[3] "OCSNG odkazy"

#: inc/model.class.php:582
msgid "These options only apply to computers coming from OCSNG"
msgstr "Tyto volby jsou uplatněny pouze na počítače pocházející z OCSNG"

#: inc/model.class.php:586 inc/model.class.php:755
msgid "Delete computer in OCSNG"
msgstr "Smazat počítač v OCSNG"

#: inc/model.class.php:592 inc/model.class.php:760
msgid "Delete link with computer in OCSNG"
msgstr "Smazat propojení s počítačem v OCSNG"

#: inc/model.class.php:606
msgid "Delete computer in FusionInventory"
msgstr "Smazat počítač ve FusionInventory"

#: inc/model.class.php:618
msgid "Additionnal fields"
msgstr "Další kolonky"

#: inc/model.class.php:622
msgid "Delete Fields plugin informations"
msgstr "Smazat informace zásuvného modulu Kolonky"

#: inc/model.class.php:887 inc/uninstall.class.php:717
msgid "Keep in the current group"
msgstr "Ponechat ve stávající skupině"

#: inc/replace.class.php:40
msgid "Item's replacement"
msgstr "Nahrazení položky"

#: inc/replace.class.php:65
msgid "Please wait, replacement is running..."
msgstr "Čekejte, probíhá nahrazení…"

#: inc/replace.class.php:130
msgid "This document is the archive of this replaced item"
msgstr "Tento dokument je archiv nahrazené položky"

#: inc/replace.class.php:135
msgid "Archive of old material"
msgstr "Archiv starého materiálu"

#: inc/replace.class.php:403
msgid "See attached document"
msgstr "Zobrazit přiložený dokument"

#: inc/replace.class.php:473
msgid "This item is a replacement for item"
msgstr "Tato položka je náhradou za položku"

#: inc/replace.class.php:475
msgid "This item was replaced by"
msgstr "Tato položka byla nahrazena"

#: inc/replace.class.php:519 inc/replace.class.php:595
msgid "Reminder of the replacement model"
msgstr "Připomínka modelu nahrazení"

#: inc/replace.class.php:557
msgid "New location of item"
msgstr "Nové umístění položky"

#: inc/replace.class.php:642
msgid "Choices for item to replace"
msgstr "Volby pro položky k nahrazení"

#: inc/replace.class.php:645
msgid "Old item"
msgstr "Původní položka"

#: inc/replace.class.php:655
msgid "New item"
msgstr "Nová položka"

#: inc/replace.class.php:687
msgid "Replace"
msgstr "Nahradit"

#: inc/uninstall.class.php:38 setup.php:83
msgid "Item's uninstallation"
msgstr "Odinstalace položky"

#: inc/uninstall.class.php:114
msgid "Please wait, uninstallation is running..."
msgstr "Čekejte, probíhá odinstalace…"

#: inc/uninstall.class.php:511
msgid "Item is now uninstalled"
msgstr "Položka je nyní odinstalovaná"

#: inc/uninstall.class.php:515
msgid "Item replaced by a new one"
msgstr "Položka je nahrazena novou"

#: inc/uninstall.class.php:519
msgid "Item replacing an old one"
msgstr "Položka nahrazující tu původní"

#: inc/uninstall.class.php:524
msgid "Removed from OCSNG with ID"
msgstr "Odebráno z OCSNG s identifikátorem"

#: inc/uninstall.class.php:635 inc/preference.class.php:54
msgid "Item's location after uninstall"
msgstr "Umístění položky po odinstalaci"

#: inc/uninstall.class.php:718
msgid "Affect to a new group"
msgstr "Přiřadit do nové skupiny"
Binary file modified locales/fr_FR.mo
Binary file not shown.
Loading

0 comments on commit 5bf1f95

Please sign in to comment.