Merge branch 'develop' into ticketsup_core

This commit is contained in:
Laurent Destailleur 2018-03-11 18:10:11 +01:00 committed by GitHub
commit 40cf236f92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 65 additions and 54 deletions

View File

@ -1049,7 +1049,7 @@ class DolibarrModules // Can not be abstract, because we need to insta
{ {
if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'llx_' && substr($file,0,4) != 'data') if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'llx_' && substr($file,0,4) != 'data')
{ {
$result=run_sql($dir.$file,1,'',1); $result=run_sql($dir.$file, empty($conf->global->MAIN_DISPLAY_SQL_INSTALL_LOG)?0:1, '', 1);
if ($result <= 0) $error++; if ($result <= 0) $error++;
} }
} }
@ -1067,7 +1067,7 @@ class DolibarrModules // Can not be abstract, because we need to insta
{ {
if (preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'llx_' && substr($file,0,4) != 'data') if (preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'llx_' && substr($file,0,4) != 'data')
{ {
$result=run_sql($dir.$file,1,'',1); $result=run_sql($dir.$file, empty($conf->global->MAIN_DISPLAY_SQL_INSTALL_LOG)?0:1, '', 1);
if ($result <= 0) $error++; if ($result <= 0) $error++;
} }
} }
@ -1085,7 +1085,7 @@ class DolibarrModules // Can not be abstract, because we need to insta
{ {
if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'data') if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'data')
{ {
$result=run_sql($dir.$file,1,'',1); $result=run_sql($dir.$file, empty($conf->global->MAIN_DISPLAY_SQL_INSTALL_LOG)?0:1, '', 1);
if ($result <= 0) $error++; if ($result <= 0) $error++;
} }
} }
@ -1103,7 +1103,7 @@ class DolibarrModules // Can not be abstract, because we need to insta
{ {
if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,6) == 'update') if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,6) == 'update')
{ {
$result=run_sql($dir.$file,1,'',1); $result=run_sql($dir.$file, empty($conf->global->MAIN_DISPLAY_SQL_INSTALL_LOG)?0:1, '', 1);
if ($result <= 0) $error++; if ($result <= 0) $error++;
} }
} }

View File

@ -1106,7 +1106,7 @@ class Ticketsup extends CommonObject
$sql .= " FROM " . MAIN_DB_PREFIX . "c_ticketsup_severity"; $sql .= " FROM " . MAIN_DB_PREFIX . "c_ticketsup_severity";
$sql .= " WHERE active > 0"; $sql .= " WHERE active > 0";
$sql .= " ORDER BY pos"; $sql .= " ORDER BY pos";
dol_syslog(get_class($this) . "::load_cache_severities_tickets sql=" . $sql, LOG_DEBUG); dol_syslog(get_class($this) . "::loadCacheSeveritiesTickets sql=" . $sql, LOG_DEBUG);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) { if ($resql) {
$num = $this->db->num_rows($resql); $num = $this->db->num_rows($resql);
@ -1133,8 +1133,8 @@ class Ticketsup extends CommonObject
/** /**
* Return status label of object * Return status label of object
* *
* @param number $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @return string * @return string Label
*/ */
public function getLibStatut($mode = 0) public function getLibStatut($mode = 0)
{ {
@ -1143,13 +1143,13 @@ class Ticketsup extends CommonObject
/** /**
* Return status label of object * Return status label of object
* *
* @param int $statut id statut * @param string $statut id statut
* @param number $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @return string * @return string Label
*/ */
public function libStatut($statut, $mode = 0) function LibStatut($statut, $mode = 0)
{ {
global $langs; global $langs;
@ -1294,10 +1294,11 @@ class Ticketsup extends CommonObject
} }
/** /**
* Return clckable link to object * Return clickable link to object
* @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul *
* @param string $option Where to point the link * @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @return string * @param string $option Sur quoi pointe le lien
* @return string Chaine avec URL
*/ */
public function getNomUrl($withpicto = 0, $option = '') public function getNomUrl($withpicto = 0, $option = '')
{ {
@ -1330,11 +1331,11 @@ class Ticketsup extends CommonObject
} }
/** /**
* Mark a message as read * Mark a message as read
* *
* @param User $user User for action * @param User $user Object user
* @param int $notrigger Lauch trigger or not * @param int $notrigger No trigger
* @return int 1 if ok, -1 otherwise * @return int <0 if KO, >0 if OK
*/ */
public function markAsRead($user, $notrigger = 0) public function markAsRead($user, $notrigger = 0)
{ {
@ -1379,12 +1380,12 @@ class Ticketsup extends CommonObject
} }
/** /**
* Assign ticket to an user * Mark a message as read
* *
* @param User $user User for action * @param User $user Object user
* @param int $id_assign_user IP user assigned * @param int $id_assign_user ID of user assigned
* @param int $notrigger Disable trigger if 1 * @param int $notrigger Disable trigger
* @return number * @return int <0 if KO, >0 if OK
*/ */
public function assignUser($user, $id_assign_user, $notrigger = 0) public function assignUser($user, $id_assign_user, $notrigger = 0)
{ {
@ -1488,11 +1489,11 @@ class Ticketsup extends CommonObject
} }
/** /**
* Send notification of changes by email * Send notification of changes by email
* *
* @param User $user User that create * @param User $user User that create
* @param string $message Log message * @param string $log_message Log message
* @return int <0 if KO, >0 if OK (number of emails sent) * @return int <0 if KO, >0 if OK (number of emails sent)
*/ */
private function sendLogByEmail($user, $message) private function sendLogByEmail($user, $message)
{ {
@ -2101,6 +2102,7 @@ class Ticketsup extends CommonObject
/** /**
* Return id of all contacts for ticket * Return id of all contacts for ticket
* *
* @return array Array of contacts
*/ */
public function getTicketAllCustomerContacts() public function getTicketAllCustomerContacts()
{ {
@ -2114,9 +2116,10 @@ class Ticketsup extends CommonObject
/** /**
* Send message * Send message
* @param string $subject Subject for message *
* @param string $texte Text for message * @param string $subject Subject
* @return int 1 if ok, -1 otherwise * @param string $texte Message to send
* @return int <0 if KO, or number of changes if OK
*/ */
public function messageSend($subject, $texte) public function messageSend($subject, $texte)
{ {
@ -2138,7 +2141,8 @@ class Ticketsup extends CommonObject
$sendto = $obj->firstname . " " . $obj->lastname . " <" . $obj->email . ">"; $sendto = $obj->firstname . " " . $obj->lastname . " <" . $obj->email . ">";
$actiondefid = $obj->adid; $actiondefid = $obj->adid;
if (dol_strlen($sendto)) { if (dol_strlen($sendto))
{
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$application = ($conf->global->MAIN_APPLICATION_TITLE ? $conf->global->MAIN_APPLICATION_TITLE : 'Dolibarr ERP/CRM'); $application = ($conf->global->MAIN_APPLICATION_TITLE ? $conf->global->MAIN_APPLICATION_TITLE : 'Dolibarr ERP/CRM');
@ -2239,12 +2243,12 @@ class Ticketsup extends CommonObject
* Get array of all contacts for a ticket * Get array of all contacts for a ticket
* Override method of file commonobject.class.php to add phone number * Override method of file commonobject.class.php to add phone number
* *
* @param int $statut Status of lines to get (-1=all) * @param int $statut Status of lines to get (-1=all)
* @param string $source Source of contact: external or thirdparty (llx_socpeople) or internal (llx_user) * @param string $source Source of contact: external or thirdparty (llx_socpeople) or internal (llx_user)
* @param int $list 0:Return array contains all properties, 1:Return array contains just id * @param int $list 0:Return array contains all properties, 1:Return array contains just id
* @return array Array of contacts * @return array Array of contacts
*/ */
public function listeContact($statut = -1, $source = 'external', $list = 0) function liste_contact($statut = -1, $source = 'external', $list = 0)
{ {
global $langs; global $langs;
@ -2453,10 +2457,10 @@ class Ticketsup extends CommonObject
} }
/** /**
* Affiche la premiere photo du ticket * Return if at least one photo is available
* *
* @param string $sdir Repertoire a scanner * @param string $sdir Directory to scan
* @return boolean true si photo dispo, false sinon * @return boolean True if at least one photo is available, False if not
*/ */
function is_photo_available($sdir) function is_photo_available($sdir)
{ {

View File

@ -0,0 +1 @@

View File

@ -16,6 +16,12 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
// Protection to avoid direct call of template
if (empty($conf) || ! is_object($conf))
{
print "Error, template page can't be called as URL";
exit;
}
?> ?>
<!-- BEGIN PHP TEMPLATE --> <!-- BEGIN PHP TEMPLATE -->