New: Send by mail permissions are not really protected permission because user can still view file and send it manually by email or from pdf reader menu. So i moved it as an ADVANCE permission.
This commit is contained in:
parent
a694166fc2
commit
04babd9297
@ -1559,13 +1559,17 @@ if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Send
|
// Send
|
||||||
if ($object->statut == 1 && $user->rights->propale->envoyer)
|
if ($object->statut == 1)
|
||||||
{
|
{
|
||||||
$propref = dol_sanitizeFileName($object->ref);
|
$propref = dol_sanitizeFileName($object->ref);
|
||||||
$file = $conf->propale->dir_output . '/'.$propref.'/'.$propref.'.pdf';
|
$file = $conf->propale->dir_output . '/'.$propref.'/'.$propref.'.pdf';
|
||||||
if (file_exists($file))
|
if (file_exists($file))
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init">'.$langs->trans('SendByMail').'</a>';
|
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->propale->propal_advance->send)
|
||||||
|
{
|
||||||
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init">'.$langs->trans('SendByMail').'</a>';
|
||||||
|
}
|
||||||
|
else print '<a class="butActionRefused" href="#">'.$langs->trans('SendByMail').'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1173,7 +1173,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||||||
$remise_percent = (!empty($objectsrc->remise_percent)?$objectsrc->remise_percent:(!empty($soc->remise_percent)?$soc->remise_percent:0));
|
$remise_percent = (!empty($objectsrc->remise_percent)?$objectsrc->remise_percent:(!empty($soc->remise_percent)?$soc->remise_percent:0));
|
||||||
$remise_absolue = (!empty($objectsrc->remise_absolue)?$objectsrc->remise_absolue:(!empty($soc->remise_absolue)?$soc->remise_absolue:0));
|
$remise_absolue = (!empty($objectsrc->remise_absolue)?$objectsrc->remise_absolue:(!empty($soc->remise_absolue)?$soc->remise_absolue:0));
|
||||||
$dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0;
|
$dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0;
|
||||||
|
|
||||||
// Object source contacts list
|
// Object source contacts list
|
||||||
$srccontactslist = $objectsrc->liste_contact(-1,'external',1);
|
$srccontactslist = $objectsrc->liste_contact(-1,'external',1);
|
||||||
}
|
}
|
||||||
@ -1447,7 +1447,7 @@ else
|
|||||||
|
|
||||||
$head = commande_prepare_head($object);
|
$head = commande_prepare_head($object);
|
||||||
dol_fiche_head($head, 'order', $langs->trans("CustomerOrder"), 0, 'order');
|
dol_fiche_head($head, 'order', $langs->trans("CustomerOrder"), 0, 'order');
|
||||||
|
|
||||||
$formconfirm='';
|
$formconfirm='';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1522,7 +1522,7 @@ else
|
|||||||
// Paiement incomplet. On demande si motif = escompte ou autre
|
// Paiement incomplet. On demande si motif = escompte ou autre
|
||||||
$formconfirm=$html->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneOrder'),$langs->trans('ConfirmCloneOrder',$object->ref),'confirm_clone',$formquestion,'yes',1);
|
$formconfirm=$html->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneOrder'),$langs->trans('ConfirmCloneOrder',$object->ref),'confirm_clone',$formquestion,'yes',1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hook of thirdparty module
|
// Hook of thirdparty module
|
||||||
if (empty($formconfirm) && ! empty($object->hooks))
|
if (empty($formconfirm) && ! empty($object->hooks))
|
||||||
{
|
{
|
||||||
@ -1531,7 +1531,7 @@ else
|
|||||||
if (empty($formconfirm)) $formconfirm = $module->formconfirm($action,$object,$lineid);
|
if (empty($formconfirm)) $formconfirm = $module->formconfirm($action,$object,$lineid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Print form confirm
|
// Print form confirm
|
||||||
print $formconfirm;
|
print $formconfirm;
|
||||||
|
|
||||||
@ -1741,7 +1741,7 @@ else
|
|||||||
$html->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->mode_reglement_id,'none');
|
$html->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->mode_reglement_id,'none');
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Availability
|
// Availability
|
||||||
print '<tr><td height="10">';
|
print '<tr><td height="10">';
|
||||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||||
@ -1845,7 +1845,7 @@ else
|
|||||||
* Lines
|
* Lines
|
||||||
*/
|
*/
|
||||||
$result = $object->getLinesArray();
|
$result = $object->getLinesArray();
|
||||||
|
|
||||||
$numlines = count($object->lines);
|
$numlines = count($object->lines);
|
||||||
|
|
||||||
if ($conf->use_javascript_ajax && $object->statut == 0)
|
if ($conf->use_javascript_ajax && $object->statut == 0)
|
||||||
@ -1915,14 +1915,15 @@ else
|
|||||||
// Send
|
// Send
|
||||||
if ($object->statut > 0)
|
if ($object->statut > 0)
|
||||||
{
|
{
|
||||||
if ($user->rights->commande->envoyer)
|
$comref = dol_sanitizeFileName($object->ref);
|
||||||
|
$file = $conf->commande->dir_output . '/'.$comref.'/'.$comref.'.pdf';
|
||||||
|
if (file_exists($file))
|
||||||
{
|
{
|
||||||
$comref = dol_sanitizeFileName($object->ref);
|
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->commande->order_advance->send))
|
||||||
$file = $conf->commande->dir_output . '/'.$comref.'/'.$comref.'.pdf';
|
|
||||||
if (file_exists($file))
|
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init">'.$langs->trans('SendByMail').'</a>';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init">'.$langs->trans('SendByMail').'</a>';
|
||||||
}
|
}
|
||||||
|
else print '<a class="butActionRefused" href="#">'.$langs->trans('SendByMail').'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1931,7 +1932,7 @@ else
|
|||||||
if ($conf->expedition->enabled)
|
if ($conf->expedition->enabled)
|
||||||
{
|
{
|
||||||
$numshipping = $object->nb_expedition();
|
$numshipping = $object->nb_expedition();
|
||||||
|
|
||||||
if ($object->statut > 0 && $object->statut < 3 && $object->getNbOfProductsLines() > 0)
|
if ($object->statut > 0 && $object->statut < 3 && $object->getNbOfProductsLines() > 0)
|
||||||
{
|
{
|
||||||
if ($user->rights->expedition->creer)
|
if ($user->rights->expedition->creer)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1767,9 +1767,13 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Send by mail
|
// Send by mail
|
||||||
if (($fac->statut == 1 || $fac->statut == 2) && $user->rights->facture->envoyer)
|
if (($fac->statut == 1 || $fac->statut == 2))
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?facid='.$fac->id.'&action=presend&mode=init">'.$langs->trans('SendByMail').'</a>';
|
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->fournisseur->supplier_invoice_advance->send)
|
||||||
|
{
|
||||||
|
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?facid='.$fac->id.'&action=presend&mode=init">'.$langs->trans('SendByMail').'</a>';
|
||||||
|
}
|
||||||
|
else print '<a class="butActionRefused" href="#">'.$langs->trans('SendByMail').'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -130,7 +130,8 @@ class modCommande extends DolibarrModules
|
|||||||
$this->rights[$r][1] = 'Envoyer les commandes clients';
|
$this->rights[$r][1] = 'Envoyer les commandes clients';
|
||||||
$this->rights[$r][2] = 'd';
|
$this->rights[$r][2] = 'd';
|
||||||
$this->rights[$r][3] = 0;
|
$this->rights[$r][3] = 0;
|
||||||
$this->rights[$r][4] = 'envoyer';
|
$this->rights[$r][4] = 'order_advance';
|
||||||
|
$this->rights[$r][5] = 'send';
|
||||||
|
|
||||||
$r++;
|
$r++;
|
||||||
$this->rights[$r][0] = 87;
|
$this->rights[$r][0] = 87;
|
||||||
|
|||||||
@ -145,7 +145,8 @@ class modFacture extends DolibarrModules
|
|||||||
$this->rights[$r][1] = 'Envoyer les factures par mail';
|
$this->rights[$r][1] = 'Envoyer les factures par mail';
|
||||||
$this->rights[$r][2] = 'a';
|
$this->rights[$r][2] = 'a';
|
||||||
$this->rights[$r][3] = 0;
|
$this->rights[$r][3] = 0;
|
||||||
$this->rights[$r][4] = 'envoyer';
|
$this->rights[$r][4] = 'invoice_advance';
|
||||||
|
$this->rights[$r][5] = 'send';
|
||||||
|
|
||||||
$r++;
|
$r++;
|
||||||
$this->rights[$r][0] = 16;
|
$this->rights[$r][0] = 16;
|
||||||
|
|||||||
@ -129,7 +129,7 @@ class modFicheinter extends DolibarrModules
|
|||||||
|
|
||||||
$r++;
|
$r++;
|
||||||
$this->rights[$r][0] = 68;
|
$this->rights[$r][0] = 68;
|
||||||
$this->rights[$r][1] = 'Envoyer les fiches d\'intervention';
|
$this->rights[$r][1] = 'Envoyer les fiches d\'intervention par courriel';
|
||||||
$this->rights[$r][2] = 'r';
|
$this->rights[$r][2] = 'r';
|
||||||
$this->rights[$r][3] = 0;
|
$this->rights[$r][3] = 0;
|
||||||
$this->rights[$r][4] = 'ficheinter_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on
|
$this->rights[$r][4] = 'ficheinter_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on
|
||||||
|
|||||||
@ -215,8 +215,8 @@ class modFournisseur extends DolibarrModules
|
|||||||
$this->rights[$r][1] = 'Envoyer les factures par mail';
|
$this->rights[$r][1] = 'Envoyer les factures par mail';
|
||||||
$this->rights[$r][2] = 'a';
|
$this->rights[$r][2] = 'a';
|
||||||
$this->rights[$r][3] = 0;
|
$this->rights[$r][3] = 0;
|
||||||
$this->rights[$r][4] = 'facture';
|
$this->rights[$r][4] = 'supplier_invoice_advance';
|
||||||
$this->rights[$r][5] = 'envoyer';
|
$this->rights[$r][5] = 'send';
|
||||||
|
|
||||||
$r++;
|
$r++;
|
||||||
$this->rights[$r][0] = 1236;
|
$this->rights[$r][0] = 1236;
|
||||||
|
|||||||
@ -134,7 +134,8 @@ class modPropale extends DolibarrModules
|
|||||||
$this->rights[$r][1] = 'Envoyer les propositions commerciales aux clients'; // libelle de la permission
|
$this->rights[$r][1] = 'Envoyer les propositions commerciales aux clients'; // libelle de la permission
|
||||||
$this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour)
|
$this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour)
|
||||||
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
|
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
|
||||||
$this->rights[$r][4] = 'envoyer';
|
$this->rights[$r][4] = 'propal_advance';
|
||||||
|
$this->rights[$r][5] = 'send';
|
||||||
|
|
||||||
$r++;
|
$r++;
|
||||||
$this->rights[$r][0] = 26; // id de la permission
|
$this->rights[$r][0] = 26; // id de la permission
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user