mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-20 08:21:29 +01:00
Work on BOM templates
This commit is contained in:
@@ -183,16 +183,6 @@ elseif ($action == 'set_BOM_FREE_TEXT')
|
||||
{
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
} elseif ($action=="setshippableiconinlist") {
|
||||
// Activate Set Shippable Icon In List
|
||||
$setshippableiconinlist = GETPOST('value', 'int');
|
||||
$res = dolibarr_set_const($db, "SHIPPABLE_BOM_ICON_IN_LIST", $setshippableiconinlist, 'yesno', 0, '', $conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
if (! $error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -314,23 +304,21 @@ foreach ($dirmodels as $reldir)
|
||||
print "</table><br>\n";
|
||||
|
||||
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||
{
|
||||
/*
|
||||
/*
|
||||
* Document templates generators
|
||||
*/
|
||||
|
||||
print load_fiche_titre($langs->trans("BOMsModelModule"), '', '');
|
||||
print load_fiche_titre($langs->trans("BOMsModelModule"), '', '');
|
||||
|
||||
// Load array def with activated templates
|
||||
$def = array();
|
||||
$sql = "SELECT nom";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."document_model";
|
||||
$sql.= " WHERE type = '".$type."'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
// Load array def with activated templates
|
||||
$def = array();
|
||||
$sql = "SELECT nom";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."document_model";
|
||||
$sql.= " WHERE type = '".$type."'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$i = 0;
|
||||
$num_rows=$db->num_rows($resql);
|
||||
while ($i < $num_rows)
|
||||
@@ -339,27 +327,27 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||
array_push($def, $array[0]);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print "<table class=\"noborder\" width=\"100%\">\n";
|
||||
print "<tr class=\"liste_titre\">\n";
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
|
||||
print '<td class="center" width="60">'.$langs->trans("Default")."</td>\n";
|
||||
print '<td class="center" width="38">'.$langs->trans("ShortInfo").'</td>';
|
||||
print '<td class="center" width="38">'.$langs->trans("Preview").'</td>';
|
||||
print "</tr>\n";
|
||||
print "<table class=\"noborder\" width=\"100%\">\n";
|
||||
print "<tr class=\"liste_titre\">\n";
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
|
||||
print '<td class="center" width="60">'.$langs->trans("Default")."</td>\n";
|
||||
print '<td class="center" width="38">'.$langs->trans("ShortInfo").'</td>';
|
||||
print '<td class="center" width="38">'.$langs->trans("Preview").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
clearstatcache();
|
||||
clearstatcache();
|
||||
|
||||
foreach ($dirmodels as $reldir)
|
||||
{
|
||||
foreach ($dirmodels as $reldir)
|
||||
{
|
||||
foreach (array('','/doc') as $valdir)
|
||||
{
|
||||
$dir = dol_buildpath($reldir."core/modules/bom".$valdir);
|
||||
@@ -438,12 +426,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||
}
|
||||
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
||||
$htmltooltip.='<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
|
||||
$htmltooltip.='<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1);
|
||||
$htmltooltip.='<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
|
||||
//$htmltooltip.='<br>'.$langs->trans("Discounts").': '.yn($module->option_escompte,1,1);
|
||||
//$htmltooltip.='<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1);
|
||||
$htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftBOMs").': '.yn($module->option_draft_watermark, 1, 1);
|
||||
|
||||
|
||||
@@ -471,87 +454,67 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print "<br>";
|
||||
print '</table>';
|
||||
print "<br>";
|
||||
|
||||
/*
|
||||
/*
|
||||
* Other options
|
||||
*/
|
||||
|
||||
print load_fiche_titre($langs->trans("OtherOptions"), '', '');
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Parameter").'</td>';
|
||||
print '<td class="center" width="60">'.$langs->trans("Value").'</td>';
|
||||
print "<td> </td>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
$substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2);
|
||||
$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
|
||||
$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
|
||||
foreach($substitutionarray as $key => $val) $htmltext.=$key.'<br>';
|
||||
$htmltext.='</i>';
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="set_BOM_FREE_TEXT">';
|
||||
print '<tr class="oddeven"><td colspan="2">';
|
||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnBOMs"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||
$variablename='BOM_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
|
||||
{
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
}
|
||||
else
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td><td class="right">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||
print "</td></tr>\n";
|
||||
print '</form>';
|
||||
|
||||
//Use draft Watermark
|
||||
|
||||
print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"set_BOM_DRAFT_WATERMARK\">";
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("WatermarkOnDraftBOMs"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
|
||||
print '</td><td>';
|
||||
print '<input class="flat minwidth200" type="text" name="BOM_DRAFT_WATERMARK" value="'.$conf->global->BOM_DRAFT_WATERMARK.'">';
|
||||
print '</td><td class="right">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||
print "</td></tr>\n";
|
||||
print '</form>';
|
||||
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
/*
|
||||
* Notifications
|
||||
*/
|
||||
/*
|
||||
print load_fiche_titre($langs->trans("Notifications"), '', '');
|
||||
print load_fiche_titre($langs->trans("OtherOptions"), '', '');
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Parameter").'</td>';
|
||||
print '<td class="center" width="60"></td>';
|
||||
print '<td width="80"> </td>';
|
||||
print '<td class="center" width="60">'.$langs->trans("Value").'</td>';
|
||||
print "<td> </td>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
$substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2);
|
||||
$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
|
||||
$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
|
||||
foreach($substitutionarray as $key => $val) $htmltext.=$key.'<br>';
|
||||
$htmltext.='</i>';
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="set_BOM_FREE_TEXT">';
|
||||
print '<tr class="oddeven"><td colspan="2">';
|
||||
print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'<br>';
|
||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnBOMs"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||
$variablename='BOM_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
|
||||
{
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
}
|
||||
else
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td><td class="right">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||
print "</td></tr>\n";
|
||||
print '</form>';
|
||||
|
||||
//Use draft Watermark
|
||||
|
||||
print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"set_BOM_DRAFT_WATERMARK\">";
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("WatermarkOnDraftBOMs"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
|
||||
print '</td><td>';
|
||||
print '<input class="flat minwidth200" type="text" name="BOM_DRAFT_WATERMARK" value="'.$conf->global->BOM_DRAFT_WATERMARK.'">';
|
||||
print '</td><td class="right">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||
print "</td></tr>\n";
|
||||
print '</form>';
|
||||
|
||||
print '</table>';
|
||||
*/
|
||||
print '<br>';
|
||||
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
|
||||
@@ -662,14 +662,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '<a name="builddoc"></a>'; // ancre
|
||||
|
||||
// Documents
|
||||
/*$objref = dol_sanitizeFileName($object->ref);
|
||||
$relativepath = $comref . '/' . $comref . '.pdf';
|
||||
$objref = dol_sanitizeFileName($object->ref);
|
||||
$relativepath = $objref . '/' . $objref . '.pdf';
|
||||
$filedir = $conf->bom->dir_output . '/' . $objref;
|
||||
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
|
||||
$genallowed = $user->rights->bom->read; // If you can read, you can build the PDF to read content
|
||||
$delallowed = $user->rights->bom->create; // If you can create/edit, you can remove a file on card
|
||||
print $formfile->showdocuments('bom', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
|
||||
*/
|
||||
$delallowed = $user->rights->bom->write; // If you can create/edit, you can remove a file on card
|
||||
print $formfile->showdocuments('bom', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $mysoc->default_lang);
|
||||
|
||||
// Show links to link elements
|
||||
$linktoelem = $form->showLinkToObjectBlock($object, null, array('bom'));
|
||||
@@ -693,17 +692,15 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
}
|
||||
|
||||
//Select mail models is same action as presend
|
||||
/*
|
||||
if (GETPOST('modelselected')) $action = 'presend';
|
||||
|
||||
// Presend form
|
||||
$modelmail='inventory';
|
||||
$modelmail='bom';
|
||||
$defaulttopic='InformationMessage';
|
||||
$diroutput = $conf->product->dir_output.'/inventory';
|
||||
$trackid = 'stockinv'.$object->id;
|
||||
$diroutput = $conf->bom->dir_output;
|
||||
$trackid = 'bom'.$object->id;
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
|
||||
*/
|
||||
}
|
||||
|
||||
// End of page
|
||||
|
||||
@@ -688,7 +688,7 @@ class FormFile
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($this->db, 'Bad value for modulepart');
|
||||
dol_print_error($this->db, "Bad value for modulepart '".$modulepart."' in showdocuments");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,14 +85,7 @@ class doc_generic_bom_odt extends ModelePDFBOMs
|
||||
$this->marge_haute=0;
|
||||
$this->marge_basse=0;
|
||||
|
||||
$this->option_logo = 1; // Affiche logo
|
||||
$this->option_tva = 0; // Gere option tva COMMANDE_TVAOPTION
|
||||
$this->option_modereg = 0; // Affiche mode reglement
|
||||
$this->option_condreg = 0; // Affiche conditions reglement
|
||||
$this->option_codeproduitservice = 0; // Affiche code produit-service
|
||||
$this->option_multilang = 1; // Dispo en plusieurs langues
|
||||
$this->option_escompte = 0; // Affiche si il y a eu escompte
|
||||
$this->option_credit_note = 0; // Support credit notes
|
||||
$this->option_freetext = 1; // Support add of a personalised text
|
||||
$this->option_draft_watermark = 0; // Support add of a watermark on drafts
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // requir
|
||||
/**
|
||||
* Parent class for boms models
|
||||
*/
|
||||
abstract class ModelePDFBoms extends CommonDocGenerator
|
||||
abstract class ModelePDFBom extends CommonDocGenerator
|
||||
{
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
|
||||
@@ -121,7 +121,7 @@ class modBom extends DolibarrModules
|
||||
// 1=>array('BILLOFMATERIALS_MYNEWCONST2','chaine','myvalue','This is another constant to add',0, 'current', 1)
|
||||
// );
|
||||
$this->const = array(
|
||||
1=>array('BOM_ADDON_PDF', 'chaine', 'avalue', 'Name of PDF model of BOM', 0),
|
||||
1=>array('BOM_ADDON_PDF', 'chaine', 'alpha', 'Name of PDF model of BOM', 0),
|
||||
2=>array('BOM_ADDON', 'chaine', 'mod_bom_standard', 'Name of numbering rules of BOM', 0),
|
||||
3=>array('BOM_ADDON_PDF_ODT_PATH', 'chaine', 'DOL_DATA_ROOT/doctemplates/boms', '', 0)
|
||||
);
|
||||
@@ -317,6 +317,8 @@ class modBom extends DolibarrModules
|
||||
*/
|
||||
public function init($options = '')
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$result=$this->_load_tables('/bom/sql/');
|
||||
if ($result < 0) return -1; // Do not activate module if not allowed errors found on module SQL queries (the _load_table run sql with run_sql with error allowed parameter to 'default')
|
||||
|
||||
@@ -330,8 +332,35 @@ class modBom extends DolibarrModules
|
||||
//$result4=$extrafields->addExtraField('myattr4', "New Attr 4 label", 'select', 1, 3, 'thirdparty', 0, 1, '', array('options'=>array('code1'=>'Val1','code2'=>'Val2','code3'=>'Val3')), 1,'', 0, 0, '', '', 'mrp', '$conf->bom->enabled');
|
||||
//$result5=$extrafields->addExtraField('myattr5', "New Attr 5 label", 'text', 1, 10, 'user', 0, 0, '', '', 1, '', 0, 0, '', '', 'mrp', '$conf->bom->enabled');
|
||||
|
||||
|
||||
// Permissions
|
||||
$this->remove($options);
|
||||
|
||||
$sql = array();
|
||||
|
||||
// ODT template
|
||||
$src=DOL_DOCUMENT_ROOT.'/install/doctemplates/boms/template_bom.odt';
|
||||
$dirodt=DOL_DATA_ROOT.'/doctemplates/boms';
|
||||
$dest=$dirodt.'/template_bom.odt';
|
||||
|
||||
if (file_exists($src) && ! file_exists($dest))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
dol_mkdir($dirodt);
|
||||
$result=dol_copy($src, $dest, 0, 0);
|
||||
if ($result < 0)
|
||||
{
|
||||
$langs->load("errors");
|
||||
$this->error=$langs->trans('ErrorFailToCopyFile', $src, $dest);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
$sql = array(
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape('alpha')."' AND type = 'bom' AND entity = ".$conf->entity,
|
||||
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape('alpha')."', 'bom', ".$conf->entity.")"
|
||||
);
|
||||
|
||||
return $this->_init($sql, $options);
|
||||
}
|
||||
|
||||
|
||||
BIN
htdocs/install/doctemplates/boms/template_bom.odt
Normal file
BIN
htdocs/install/doctemplates/boms/template_bom.odt
Normal file
Binary file not shown.
@@ -382,6 +382,8 @@ class modMyModule extends DolibarrModules
|
||||
*/
|
||||
public function init($options = '')
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$result=$this->_load_tables('/mymodule/sql/');
|
||||
if ($result < 0) return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
|
||||
|
||||
@@ -394,7 +396,36 @@ class modMyModule extends DolibarrModules
|
||||
//$result4=$extrafields->addExtraField('myattr4', "New Attr 4 label", 'select', 1, 3, 'thirdparty', 0, 1, '', array('options'=>array('code1'=>'Val1','code2'=>'Val2','code3'=>'Val3')), 1,'', 0, 0, '', '', 'mymodule@mymodule', '$conf->mymodule->enabled');
|
||||
//$result5=$extrafields->addExtraField('myattr5', "New Attr 5 label", 'text', 1, 10, 'user', 0, 0, '', '', 1, '', 0, 0, '', '', 'mymodule@mymodule', '$conf->mymodule->enabled');
|
||||
|
||||
// Permissions
|
||||
$this->remove($options);
|
||||
|
||||
$sql = array();
|
||||
|
||||
// ODT template
|
||||
/*
|
||||
$src=DOL_DOCUMENT_ROOT.'/install/doctemplates/mymodule/template_myobjects.odt';
|
||||
$dirodt=DOL_DATA_ROOT.'/doctemplates/mymodule';
|
||||
$dest=$dirodt.'/template_myobjects.odt';
|
||||
|
||||
if (file_exists($src) && ! file_exists($dest))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
dol_mkdir($dirodt);
|
||||
$result=dol_copy($src, $dest, 0, 0);
|
||||
if ($result < 0)
|
||||
{
|
||||
$langs->load("errors");
|
||||
$this->error=$langs->trans('ErrorFailToCopyFile', $src, $dest);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
$sql = array(
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape($this->const[0][2])."' AND type = 'mymodule' AND entity = ".$conf->entity,
|
||||
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[0][2])."','mymodule',".$conf->entity.")"
|
||||
);
|
||||
*/
|
||||
|
||||
return $this->_init($sql, $options);
|
||||
}
|
||||
|
||||
|
||||
@@ -512,7 +512,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
// Documents
|
||||
/*$objref = dol_sanitizeFileName($object->ref);
|
||||
$relativepath = $comref . '/' . $comref . '.pdf';
|
||||
$relativepath = $objref . '/' . $objref . '.pdf';
|
||||
$filedir = $conf->mymodule->dir_output . '/' . $objref;
|
||||
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
|
||||
$genallowed = $user->rights->mymodule->read; // If you can read, you can build the PDF to read content
|
||||
@@ -536,7 +536,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, 'myobject', $socid, 1, '', $MAXEVENT, '', $morehtmlright);
|
||||
$somethingshown = $formactions->showactions($object, 'myobject', (is_object($object->thirdparty)?$object->thirdparty->id:0), 1, '', $MAXEVENT, '', $morehtmlright);
|
||||
|
||||
print '</div></div></div>';
|
||||
}
|
||||
@@ -546,10 +546,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
if (GETPOST('modelselected')) $action = 'presend';
|
||||
|
||||
// Presend form
|
||||
$modelmail='inventory';
|
||||
$modelmail='myobject';
|
||||
$defaulttopic='InformationMessage';
|
||||
$diroutput = $conf->product->dir_output.'/inventory';
|
||||
$trackid = 'stockinv'.$object->id;
|
||||
$diroutput = $conf->mymodule->dir_output;
|
||||
$trackid = 'myobject'.$object->id;
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user