Merge remote-tracking branch 'upstream/develop' into new_branch_20_04_2018
This commit is contained in:
commit
53efccd98e
@ -384,7 +384,7 @@ print $form->textwithpicto('', $langs->trans("TicketsEmailMustExistHelp"), 1, 'h
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
/*if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||||
{
|
{
|
||||||
// Show logo for module
|
// Show logo for module
|
||||||
print '<tr class="pair"><td width="70%">' . $langs->trans("TicketsShowModuleLogo") . '</td>';
|
print '<tr class="pair"><td width="70%">' . $langs->trans("TicketsShowModuleLogo") . '</td>';
|
||||||
@ -400,7 +400,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
|||||||
print $form->textwithpicto('', $langs->trans("TicketsShowModuleLogoHelp"), 1, 'help');
|
print $form->textwithpicto('', $langs->trans("TicketsShowModuleLogoHelp"), 1, 'help');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}*/
|
||||||
|
|
||||||
// Show logo for company
|
// Show logo for company
|
||||||
print '<tr class="pair"><td width="70%">' . $langs->trans("TicketsShowCompanyLogo") . '</td>';
|
print '<tr class="pair"><td width="70%">' . $langs->trans("TicketsShowCompanyLogo") . '</td>';
|
||||||
|
|||||||
@ -126,7 +126,7 @@ $hookmanager->initHooks(array('agenda'));
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (GETPOST("viewlist") || $action == 'show_list')
|
if (GETPOST("viewlist",'alpha') || $action == 'show_list')
|
||||||
{
|
{
|
||||||
$param='';
|
$param='';
|
||||||
if (is_array($_POST))
|
if (is_array($_POST))
|
||||||
@ -142,7 +142,7 @@ if (GETPOST("viewlist") || $action == 'show_list')
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GETPOST("viewperuser") || $action == 'show_peruser')
|
if (GETPOST("viewperuser",'alpha') || $action == 'show_peruser')
|
||||||
{
|
{
|
||||||
$param='';
|
$param='';
|
||||||
if (is_array($_POST))
|
if (is_array($_POST))
|
||||||
|
|||||||
@ -599,7 +599,7 @@ abstract class CommonObject
|
|||||||
|
|
||||||
if (empty($this->last_main_doc))
|
if (empty($this->last_main_doc))
|
||||||
{
|
{
|
||||||
return ''; // No known last doc
|
return ''; // No way to known which document name to use
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
|
||||||
@ -4387,6 +4387,9 @@ abstract class CommonObject
|
|||||||
$ecmfile->gen_or_uploaded = 'generated';
|
$ecmfile->gen_or_uploaded = 'generated';
|
||||||
$ecmfile->description = ''; // indexed content
|
$ecmfile->description = ''; // indexed content
|
||||||
$ecmfile->keyword = ''; // keyword content
|
$ecmfile->keyword = ''; // keyword content
|
||||||
|
$ecmfile->src_object_type = $this->table_element;
|
||||||
|
$ecmfile->src_object_id = $this->id;
|
||||||
|
|
||||||
$result = $ecmfile->create($user);
|
$result = $ecmfile->create($user);
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -7219,10 +7219,10 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return string with full Url
|
* Return string with full Url. The file qualified is the one defined by relative path in $object->last_main_doc
|
||||||
*
|
*
|
||||||
* @param Object $object Object
|
* @param Object $object Object
|
||||||
* @return string Url string
|
* @return string Url string
|
||||||
*/
|
*/
|
||||||
function showDirectDownloadLink($object)
|
function showDirectDownloadLink($object)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -245,7 +245,7 @@ class modAgenda extends DolibarrModules
|
|||||||
'type'=>'left',
|
'type'=>'left',
|
||||||
'titre'=>'Agenda',
|
'titre'=>'Agenda',
|
||||||
'mainmenu'=>'agenda',
|
'mainmenu'=>'agenda',
|
||||||
'url'=>'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda',
|
'url'=>'/comm/action/index.php?action='.($conf->global->AGENDA_DEFAULT_VIEW!='show_list'?$conf->global->AGENDA_DEFAULT_VIEW:'show_month').'&mainmenu=agenda&leftmenu=agenda',
|
||||||
'langs'=>'agenda',
|
'langs'=>'agenda',
|
||||||
'position'=>140,
|
'position'=>140,
|
||||||
'perms'=>'$user->rights->agenda->myactions->read',
|
'perms'=>'$user->rights->agenda->myactions->read',
|
||||||
@ -257,7 +257,7 @@ class modAgenda extends DolibarrModules
|
|||||||
'type'=>'left',
|
'type'=>'left',
|
||||||
'titre'=>'MenuToDoMyActions',
|
'titre'=>'MenuToDoMyActions',
|
||||||
'mainmenu'=>'agenda',
|
'mainmenu'=>'agenda',
|
||||||
'url'=>'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine',
|
'url'=>'/comm/action/index.php?action='.($conf->global->AGENDA_DEFAULT_VIEW!='show_list'?$conf->global->AGENDA_DEFAULT_VIEW:'show_month').'&mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine',
|
||||||
'langs'=>'agenda',
|
'langs'=>'agenda',
|
||||||
'position'=>141,
|
'position'=>141,
|
||||||
'perms'=>'$user->rights->agenda->myactions->read',
|
'perms'=>'$user->rights->agenda->myactions->read',
|
||||||
@ -269,7 +269,7 @@ class modAgenda extends DolibarrModules
|
|||||||
'type'=>'left',
|
'type'=>'left',
|
||||||
'titre'=>'MenuDoneMyActions',
|
'titre'=>'MenuDoneMyActions',
|
||||||
'mainmenu'=>'agenda',
|
'mainmenu'=>'agenda',
|
||||||
'url'=>'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=done&filter=mine',
|
'url'=>'/comm/action/index.php?action='.($conf->global->AGENDA_DEFAULT_VIEW!='show_list'?$conf->global->AGENDA_DEFAULT_VIEW:'show_month').'&mainmenu=agenda&leftmenu=agenda&status=done&filter=mine',
|
||||||
'langs'=>'agenda',
|
'langs'=>'agenda',
|
||||||
'position'=>142,
|
'position'=>142,
|
||||||
'perms'=>'$user->rights->agenda->myactions->read',
|
'perms'=>'$user->rights->agenda->myactions->read',
|
||||||
@ -281,7 +281,7 @@ class modAgenda extends DolibarrModules
|
|||||||
'type'=>'left',
|
'type'=>'left',
|
||||||
'titre'=>'MenuToDoActions',
|
'titre'=>'MenuToDoActions',
|
||||||
'mainmenu'=>'agenda',
|
'mainmenu'=>'agenda',
|
||||||
'url'=>'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1',
|
'url'=>'/comm/action/index.php?action='.($conf->global->AGENDA_DEFAULT_VIEW!='show_list'?$conf->global->AGENDA_DEFAULT_VIEW:'show_month').'&mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1',
|
||||||
'langs'=>'agenda',
|
'langs'=>'agenda',
|
||||||
'position'=>143,
|
'position'=>143,
|
||||||
'perms'=>'$user->rights->agenda->allactions->read',
|
'perms'=>'$user->rights->agenda->allactions->read',
|
||||||
@ -293,15 +293,16 @@ class modAgenda extends DolibarrModules
|
|||||||
'type'=>'left',
|
'type'=>'left',
|
||||||
'titre'=>'MenuDoneActions',
|
'titre'=>'MenuDoneActions',
|
||||||
'mainmenu'=>'agenda',
|
'mainmenu'=>'agenda',
|
||||||
'url'=>'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1',
|
'url'=>'/comm/action/index.php?action='.($conf->global->AGENDA_DEFAULT_VIEW!='show_list'?$conf->global->AGENDA_DEFAULT_VIEW:'show_month').'&mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1',
|
||||||
'langs'=>'agenda',
|
'langs'=>'agenda',
|
||||||
'position'=>144,
|
'position'=>144,
|
||||||
'perms'=>'$user->rights->agenda->allactions->read',
|
'perms'=>'$user->rights->agenda->allactions->read',
|
||||||
'enabled'=>'$user->rights->agenda->allactions->read',
|
'enabled'=>'$user->rights->agenda->allactions->read',
|
||||||
'target'=>'',
|
'target'=>'',
|
||||||
'user'=>2);
|
'user'=>2);
|
||||||
$r++;
|
|
||||||
// List
|
// List
|
||||||
|
$r++;
|
||||||
$this->menu[$r]=array('fk_menu'=>'r=1',
|
$this->menu[$r]=array('fk_menu'=>'r=1',
|
||||||
'type'=>'left',
|
'type'=>'left',
|
||||||
'titre'=>'List',
|
'titre'=>'List',
|
||||||
|
|||||||
@ -167,13 +167,13 @@ class EcmFiles extends CommonObject
|
|||||||
$obj = $this->db->fetch_object($resql);
|
$obj = $this->db->fetch_object($resql);
|
||||||
$maxposition = (int) $obj->maxposition;
|
$maxposition = (int) $obj->maxposition;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->errors[] = 'Error ' . $this->db->lasterror();
|
$this->errors[] = 'Error ' . $this->db->lasterror();
|
||||||
return --$error;
|
return --$error;
|
||||||
}
|
}
|
||||||
$maxposition=$maxposition+1;
|
$maxposition=$maxposition+1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$maxposition=$this->position;
|
$maxposition=$this->position;
|
||||||
@ -274,14 +274,16 @@ class EcmFiles extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Load object in memory from the database
|
* Load object in memory from the database
|
||||||
*
|
*
|
||||||
* @param int $id Id object
|
* @param int $id Id object
|
||||||
* @param string $ref Hash of file name (filename+filepath). Not always defined on some version.
|
* @param string $ref Hash of file name (filename+filepath). Not always defined on some version.
|
||||||
* @param string $relativepath Relative path of file from document directory. Example: path/path2/file
|
* @param string $relativepath Relative path of file from document directory. Example: path/path2/file
|
||||||
* @param string $hashoffile Hash of file content. Take the first one found if same file is at different places. This hash will also change if file content is changed.
|
* @param string $hashoffile Hash of file content. Take the first one found if same file is at different places. This hash will also change if file content is changed.
|
||||||
* @param string $hashforshare Hash of file sharing.
|
* @param string $hashforshare Hash of file sharing.
|
||||||
* @return int <0 if KO, 0 if not found, >0 if OK
|
* @param string $src_object_type src_object_type to search
|
||||||
|
* @param string $src_object_id src_object_id to search
|
||||||
|
* @return int <0 if KO, 0 if not found, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function fetch($id, $ref = '', $relativepath = '', $hashoffile='', $hashforshare='')
|
public function fetch($id, $ref = '', $relativepath = '', $hashoffile='', $hashforshare='', $src_object_type='', $src_object_id=0)
|
||||||
{
|
{
|
||||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
|
|
||||||
@ -324,8 +326,13 @@ class EcmFiles extends CommonObject
|
|||||||
}
|
}
|
||||||
elseif (! empty($hashforshare)) {
|
elseif (! empty($hashforshare)) {
|
||||||
$sql .= " AND t.share = '".$this->db->escape($hashforshare)."'";
|
$sql .= " AND t.share = '".$this->db->escape($hashforshare)."'";
|
||||||
} else {
|
}
|
||||||
$sql .= ' AND t.rowid = ' . $id;
|
elseif ($src_object_type && $src_object_id)
|
||||||
|
{
|
||||||
|
$sql.= " AND t.src_object_type ='".$this->db->escape($src_object_type)."' AND t.src_object_id = ".$this->db->escape($src_object_id);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$sql .= ' AND t.rowid = '.$this->db->escape($id);
|
||||||
}
|
}
|
||||||
// When we search on hash of content, we take the first one. Solve also hash conflict.
|
// When we search on hash of content, we take the first one. Solve also hash conflict.
|
||||||
$this->db->plimit(1);
|
$this->db->plimit(1);
|
||||||
@ -363,7 +370,7 @@ class EcmFiles extends CommonObject
|
|||||||
// Retrieve all extrafields for invoice
|
// Retrieve all extrafields for invoice
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
// $this->fetch_optionals();
|
// $this->fetch_optionals();
|
||||||
|
|
||||||
// $this->fetch_lines();
|
// $this->fetch_lines();
|
||||||
|
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
|
|||||||
@ -578,7 +578,7 @@ Module2200Desc=Enable the usage of math expressions for prices
|
|||||||
Module2300Name=Scheduled jobs
|
Module2300Name=Scheduled jobs
|
||||||
Module2300Desc=Scheduled jobs management (alias cron or chrono table)
|
Module2300Desc=Scheduled jobs management (alias cron or chrono table)
|
||||||
Module2400Name=Events/Agenda
|
Module2400Name=Events/Agenda
|
||||||
Module2400Desc=Follow done and upcoming events. Let application logs automatic events for tracking purposes or record manual events or rendez-vous.
|
Module2400Desc=Follow done and upcoming events. Let application logs automatic events for tracking purposes or record manual events or rendez-vous. This is the main important module for a good Customer or Supplier Relationship Management.
|
||||||
Module2500Name=DMS / ECM
|
Module2500Name=DMS / ECM
|
||||||
Module2500Desc=Document Management System / Electronic Content Management. Automatic organization of your generated or stored documents. Share them when you need.
|
Module2500Desc=Document Management System / Electronic Content Management. Automatic organization of your generated or stored documents. Share them when you need.
|
||||||
Module2600Name=API/Web services (SOAP server)
|
Module2600Name=API/Web services (SOAP server)
|
||||||
|
|||||||
@ -103,7 +103,7 @@ TicketPublicInterfaceTopicHelp=This text will appear as the title of the public
|
|||||||
TicketPublicInterfaceTextHelpMessageLabelAdmin=Help text to the message entry
|
TicketPublicInterfaceTextHelpMessageLabelAdmin=Help text to the message entry
|
||||||
TicketPublicInterfaceTextHelpMessageHelpAdmin=This text will appear above the message input area of the user.
|
TicketPublicInterfaceTextHelpMessageHelpAdmin=This text will appear above the message input area of the user.
|
||||||
ExtraFieldsTicketSup=Extra attributes
|
ExtraFieldsTicketSup=Extra attributes
|
||||||
TicketSupCkEditorEmailNotActivated=HTML editor is not activated. Please put FCKEDITOR_ENABLE_MAIL contant equal to 1
|
TicketSupCkEditorEmailNotActivated=HTML editor is not activated. Please put FCKEDITOR_ENABLE_MAIL content to 1 to get it.
|
||||||
TicketsDisableEmail=Do not send ticket creation or message send emails
|
TicketsDisableEmail=Do not send ticket creation or message send emails
|
||||||
TicketsDisableEmailHelp=By default, emails are sent when new tickets or messages created. Enable this option to disable *all* email notifications
|
TicketsDisableEmailHelp=By default, emails are sent when new tickets or messages created. Enable this option to disable *all* email notifications
|
||||||
TicketsLogEnableEmail=Enable log by email
|
TicketsLogEnableEmail=Enable log by email
|
||||||
|
|||||||
@ -469,8 +469,8 @@ if (empty($reshook))
|
|||||||
'use_companybankid'=>GETPOST('companybankid'),
|
'use_companybankid'=>GETPOST('companybankid'),
|
||||||
'force_dir_output'=>$conf->societe->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->id)
|
'force_dir_output'=>$conf->societe->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->id)
|
||||||
);
|
);
|
||||||
$_POST['lang_id'] = GETPOST('lang_idrib'.GETPOST('companybankid'));
|
$_POST['lang_id'] = GETPOST('lang_idrib'.GETPOST('companybankid','int'), 'alpha');
|
||||||
$_POST['model'] = GETPOST('modelrib'.GETPOST('companybankid'));
|
$_POST['model'] = GETPOST('modelrib'.GETPOST('companybankid','int'), 'alpha');
|
||||||
}
|
}
|
||||||
|
|
||||||
$id = $socid;
|
$id = $socid;
|
||||||
@ -1255,6 +1255,24 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
|||||||
|
|
||||||
print $formfile->showdocuments('company', $object->id, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 0, 0, 0, 28, 0, 'entity='.$object->entity, 0, '', $object->default_lang);
|
print $formfile->showdocuments('company', $object->id, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 0, 0, 0, 28, 0, 'entity='.$object->entity, 0, '', $object->default_lang);
|
||||||
|
|
||||||
|
// Show direct download link
|
||||||
|
if (! empty($conf->global->BANK_ACCOUNT_ALLOW_EXTERNAL_DOWNLOAD))
|
||||||
|
{
|
||||||
|
$companybankaccounttemp = new CompanyBankAccount($db);
|
||||||
|
$companypaymentmodetemp = new CompanyPaymentMode($db);
|
||||||
|
$result = $companypaymentmodetemp->fetch(0, null, $object->id, 'ban');
|
||||||
|
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
|
||||||
|
$ecmfile = new EcmFiles($db);
|
||||||
|
$result = $ecmfile->fetch(0, '', '', '', '', $companybankaccounttemp->table_element, $companypaymentmodetemp->id);
|
||||||
|
if ($result > 0)
|
||||||
|
{
|
||||||
|
$companybankaccounttemp->last_main_doc = $ecmfile->filepath.'/'.$ecmfile->filename;
|
||||||
|
print '<br><!-- Link to download main doc -->'."\n";
|
||||||
|
print showDirectDownloadLink($companybankaccounttemp).'<br>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user