diff --git a/class/gmaps_activity.class.php b/class/gmapsactivity.class.php similarity index 92% rename from class/gmaps_activity.class.php rename to class/gmapsactivity.class.php index 0a6edec..a06447b 100755 --- a/class/gmaps_activity.class.php +++ b/class/gmapsactivity.class.php @@ -17,9 +17,9 @@ */ /** - * \file class/gmaps_activity.class.php + * \file class/gmapsactivity.class.php * \ingroup gmaps - * \brief This file is a CRUD class file for Gmaps_activity (Create/Read/Update/Delete) + * \brief This file is a CRUD class file for GmapsActivity (Create/Read/Update/Delete) */ // Put here all includes required by your class file @@ -28,9 +28,9 @@ //require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; /** - * Class for Gmaps_activity + * Class for GmapsActivity */ -class Gmaps_activity extends CommonObject +class GmapsActivity extends CommonObject { /** * @var string ID of module. @@ -40,12 +40,12 @@ class Gmaps_activity extends CommonObject /** * @var string ID to identify managed object. */ - public $element = 'gmaps_activity'; + public $element = 'gmapsActivity'; /** * @var string Name of table without prefix where object is stored. This is also the key used for extrafields management. */ - public $table_element = 'gmaps_gmaps_activity'; + public $table_element = 'gmaps_gmapsactivity'; /** * @var int Does this object support multicompany module ? @@ -59,7 +59,7 @@ class Gmaps_activity extends CommonObject public $isextrafieldmanaged = 1; /** - * @var string String with name of icon for gmaps_activity. Must be the part after the 'object_' into object_gmaps_activity.png + * @var string String with name of icon for gmapsActivity. Must be the part after the 'object_' into object_gmapsActivity.png */ public $picto = 'gmaps_activity@gmaps'; @@ -102,8 +102,8 @@ class Gmaps_activity extends CommonObject 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of object"), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'help'=>"Help text", 'showoncombobox'=>'1',), - 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:((status:=:1) AND (entity:IN:__SHARED_ENTITIES__))', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty",), - 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'1', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1,), + 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:((status:=:1) AND (entity:IN:__SHARED_ENTITIES__))', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty", 'enabled'=>'isModEnabled("societe")'), + 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'1', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'enabled'=>'isModEnabled("project")'), 'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>3,), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>0,), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>62, 'notnull'=>0, 'visible'=>0,), @@ -150,17 +150,17 @@ class Gmaps_activity extends CommonObject /** * @var int Name of subtable line */ - //public $table_element_line = 'gmaps_gmaps_activityline'; + //public $table_element_line = 'gmaps_gmapsActivityline'; /** * @var int Field with ID of parent key if this object has a parent */ - //public $fk_element = 'fk_gmaps_activity'; + //public $fk_element = 'fk_gmapsactivity'; /** * @var int Name of subtable class that manage subtable lines */ - //public $class_element_line = 'Gmaps_activityline'; + //public $class_element_line = 'GmapsActivityline'; /** * @var array List of child tables. To test if we can delete object. @@ -172,15 +172,15 @@ class Gmaps_activity extends CommonObject * If name matches '@ClassNAme:FilePathClass:ParentFkFieldName' it will * call method deleteByParentField(parentId, ParentFkFieldName) to fetch and delete child object */ - protected $childtablesoncascade = array('@Gmaps_place:/gmaps/class/gmaps_place.class.php:fk_gmaps_activity'); + protected $childtablesoncascade = array('@GmapsPlace:/gmaps/class/gmapsplace.class.php:fk_gmapsActivity'); /** - * @var Gmaps_activityLine[] Array of subtable lines + * @var GmapsActivityLine[] Array of subtable lines */ //public $lines = array(); /** - * @var Gmaps_activityPlaces[] Array of places linked + * @var GmapsActivityPlaces[] Array of places linked */ public $places = array(); @@ -201,7 +201,7 @@ public function __construct(DoliDB $db) if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0; // Example to show how to set values of fields definition dynamically - /*if ($user->rights->gmaps->gmaps_activity->read) { + /*if ($user->rights->gmaps->gmapsActivity->read) { $this->fields['myfield']['visible'] = 1; $this->fields['myfield']['noteditable'] = 0; }*/ @@ -370,10 +370,10 @@ public function fetchLines() public function fetchPlaces() { $this->places = array(); - dol_include_once('/gmaps/class/gmaps_place.class.php'); + dol_include_once('/gmaps/class/gmapsplace.class.php'); - $place = new Gmaps_place($this->db); - $result = $place->fetchAll('','', 0, 0, array('t.fk_gmaps_activity'=>$this->id)); + $place = new GmapsPlace($this->db); + $result = $place->fetchAll('','', 0, 0, array('t.fk_gmapsActivity'=>$this->id)); if (is_array($result) && count($result)>0) { $this->places=$result; } else { @@ -390,9 +390,9 @@ public function findThirdpartyLinked() { foreach($this->places as $place) { if (!key_exists($place->id,$cached_places)) { $sql = 'SELECT fk_object FROM ' . MAIN_DB_PREFIX . 'societe_extrafields WHERE '; - $sql .= ' ( fk_gmaps_gmaps_place=\'' . $place->id . '\' OR '; - $sql .= ' fk_gmaps_gmaps_place LIKE \'' . $place->id . ',%\' OR '; - $sql .= ' fk_gmaps_gmaps_place LIKE \'%,' . $place->id . ',%\''; + $sql .= ' ( fk_gmaps_gmapsPlace=\'' . $place->id . '\' OR '; + $sql .= ' fk_gmaps_gmapsPlace LIKE \'' . $place->id . ',%\' OR '; + $sql .= ' fk_gmaps_gmapsPlace LIKE \'%,' . $place->id . ',%\''; $sql .= ' )'; $resql = $this->db->query($sql); if ($resql) { @@ -564,8 +564,8 @@ public function validate($user, $notrigger = 0) return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->gmaps->gmaps_activity->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->gmaps->gmaps_activity->gmaps_activity_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->gmaps->gmapsActivity->write)) + || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->gmaps->gmapsActivity->gmapsActivity_advance->validate)))) { $this->error='NotEnoughPermissions'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); @@ -606,7 +606,7 @@ public function validate($user, $notrigger = 0) if (!$error && !$notrigger) { // Call trigger - $result = $this->call_trigger('GMAPS_ACTIVITY_VALIDATE', $user); + $result = $this->call_trigger('GMAPSACTIVITY_VALIDATE', $user); if ($result < 0) $error++; // End call triggers } @@ -620,16 +620,16 @@ public function validate($user, $notrigger = 0) if (preg_match('/^[\(]?PROV/i', $this->ref)) { // Now we rename also files into index - $sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'gmaps_activity/".$this->db->escape($this->newref)."'"; - $sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'gmaps_activity/".$this->db->escape($this->ref)."' and entity = ".$conf->entity; + $sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'gmapsActivity/".$this->db->escape($this->newref)."'"; + $sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'gmapsActivity/".$this->db->escape($this->ref)."' and entity = ".$conf->entity; $resql = $this->db->query($sql); if (!$resql) { $error++; $this->error = $this->db->lasterror(); } // We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments $oldref = dol_sanitizeFileName($this->ref); $newref = dol_sanitizeFileName($num); - $dirsource = $conf->gmaps->dir_output.'/gmaps_activity/'.$oldref; - $dirdest = $conf->gmaps->dir_output.'/gmaps_activity/'.$newref; + $dirsource = $conf->gmaps->dir_output.'/gmapsActivity/'.$oldref; + $dirdest = $conf->gmaps->dir_output.'/gmapsActivity/'.$newref; if (!$error && file_exists($dirsource)) { dol_syslog(get_class($this)."::validate() rename dir ".$dirsource." into ".$dirdest); @@ -638,7 +638,7 @@ public function validate($user, $notrigger = 0) { dol_syslog("Rename ok"); // Rename docs starting with $oldref with $newref - $listoffiles = dol_dir_list($conf->gmaps->dir_output.'/gmaps_activity/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/')); + $listoffiles = dol_dir_list($conf->gmaps->dir_output.'/gmapsActivity/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/')); foreach ($listoffiles as $fileentry) { $dirsource = $fileentry['name']; @@ -692,7 +692,7 @@ public function setDraft($user, $notrigger = 0) return -1; }*/ - return $this->setStatusCommon($user, self::STATUS_DRAFT, $notrigger, 'GMAPS_ACTIVITY_UNVALIDATE'); + return $this->setStatusCommon($user, self::STATUS_DRAFT, $notrigger, 'GMAPSACTIVITY_UNVALIDATE'); } /** @@ -717,7 +717,7 @@ public function cancel($user, $notrigger = 0) return -1; }*/ - return $this->setStatusCommon($user, self::STATUS_CANCELED, $notrigger, 'GMAPS_ACTIVITY_CLOSE'); + return $this->setStatusCommon($user, self::STATUS_CANCELED, $notrigger, 'GMAPSACTIVITY_CLOSE'); } /** @@ -742,7 +742,7 @@ public function reopen($user, $notrigger = 0) return -1; }*/ - return $this->setStatusCommon($user, self::STATUS_VALIDATED, $notrigger, 'GMAPS_ACTIVITY_REOPEN'); + return $this->setStatusCommon($user, self::STATUS_VALIDATED, $notrigger, 'GMAPSACTIVITY_REOPEN'); } /** @@ -763,7 +763,7 @@ public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss $result = ''; - $label = img_picto('', $this->picto).' '.$langs->trans("Gmaps_activity").''; + $label = img_picto('', $this->picto).' '.$langs->trans("GmapsActivity").''; $label .= '
'; $label .= ''.$langs->trans('Ref').': '.$this->ref; if (isset($this->status)) { @@ -785,7 +785,7 @@ public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss { if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { - $label = $langs->trans("ShowGmaps_activity"); + $label = $langs->trans("ShowGmapsActivity"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; @@ -831,7 +831,7 @@ public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : ''); global $action, $hookmanager; - $hookmanager->initHooks(array('gmaps_activitydao')); + $hookmanager->initHooks(array('gmapsActivitydao')); $parameters = array('id'=>$this->id, 'getnomurl'=>$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) $result = $hookmanager->resPrint; @@ -952,8 +952,8 @@ public function getLinesArray() { $this->lines = array(); - $objectline = new Gmaps_activityLine($this->db); - $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_gmaps_activity = '.$this->id)); + $objectline = new GmapsActivityLine($this->db); + $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_gmapsActivity = '.$this->id)); if (is_numeric($result)) { @@ -976,16 +976,16 @@ public function getNextNumRef() global $langs, $conf; $langs->load("gmaps@gmaps"); - if (empty($conf->global->GMAPS_GMAPS_ACTIVITY_ADDON)) { - $conf->global->GMAPS_GMAPS_ACTIVITY_ADDON = 'mod_gmaps_activity_standard'; + if (empty($conf->global->GMAPS_GMAPSACTIVITY_ADDON)) { + $conf->global->GMAPS_GMAPSACTIVITY_ADDON = 'mod_gmapsActivity_standard'; } - if (!empty($conf->global->GMAPS_GMAPS_ACTIVITY_ADDON)) + if (!empty($conf->global->GMAPS_GMAPSACTIVITY_ADDON)) { $mybool = false; - $file = $conf->global->GMAPS_GMAPS_ACTIVITY_ADDON.".php"; - $classname = $conf->global->GMAPS_GMAPS_ACTIVITY_ADDON; + $file = $conf->global->GMAPS_GMAPSACTIVITY_ADDON.".php"; + $classname = $conf->global->GMAPS_GMAPSACTIVITY_ADDON; // Include file with class $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); @@ -1046,12 +1046,12 @@ public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hided $langs->load("gmaps@gmaps"); if (!dol_strlen($modele)) { - $modele = 'standard_gmaps_activity'; + $modele = 'standard_gmapsActivity'; if ($this->model_pdf) { $modele = $this->model_pdf; - } elseif (!empty($conf->global->GMAPS_ACTIVITY_ADDON_PDF)) { - $modele = $conf->global->GMAPS_ACTIVITY_ADDON_PDF; + } elseif (!empty($conf->global->GMAPSACTIVITY_ADDON_PDF)) { + $modele = $conf->global->GMAPSACTIVITY_ADDON_PDF; } } @@ -1099,12 +1099,12 @@ public function doScheduledJob() require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php'; /** - * Class Gmaps_activityLine. You can also remove this and generate a CRUD class for lines objects. + * Class GmapsActivityLine. You can also remove this and generate a CRUD class for lines objects. */ -class Gmaps_activityLine extends CommonObjectLine +class GmapsActivityLine extends CommonObjectLine { - // To complete with content of an object Gmaps_activityLine - // We should have a field rowid, fk_gmaps_activity and position + // To complete with content of an object GmapsActivityLine + // We should have a field rowid, fk_gmapsActivity and position /** * @var int Does object support extrafields ? 0=No, 1=Yes diff --git a/class/gmaps_import.class.php b/class/gmapsimport.class.php similarity index 98% rename from class/gmaps_import.class.php rename to class/gmapsimport.class.php index 05ace50..e4ed19a 100755 --- a/class/gmaps_import.class.php +++ b/class/gmapsimport.class.php @@ -17,20 +17,20 @@ */ /** - * \file class/gmaps_import.class.php + * \file class/gmapsimport.class.php * \ingroup gmaps * \brief This file is a CRUD class file for Gmaps_import (Create/Read/Update/Delete) */ // Put here all includes required by your class file require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php'; -dol_include_once('/gmaps/class/gmaps_activity.class.php'); -dol_include_once('/gmaps/class/gmaps_place.class.php'); +dol_include_once('/gmaps/class/gmapsactivity.class.php'); +dol_include_once('/gmaps/class/gmapsplace.class.php'); /** * Class for Gmaps_import */ -class Gmaps_import extends CommonObject +class GmapsImport extends CommonObject { /** * @var string ID of module. @@ -40,12 +40,12 @@ class Gmaps_import extends CommonObject /** * @var string ID to identify managed object. */ - public $element = 'gmaps_import'; + public $element = 'gmapsImport'; /** * @var string Name of table without prefix where object is stored. This is also the key used for extrafields management. */ - public $table_element = 'gmaps_gmaps_import'; + public $table_element = 'gmaps_gmapsimport'; /** * @var int Does this object support multicompany module ? @@ -836,7 +836,7 @@ public function getLinesArray() { $this->lines = array(); - $objectline = new Gmaps_importLine($this->db); + $objectline = new gmapsImportLine($this->db); $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql' => 'fk_gmaps_import = ' . $this->id)); if (is_numeric($result)) { @@ -1005,7 +1005,7 @@ public function importFile($file, $user) && property_exists($activitySegment, 'endLocation') && property_exists($activitySegment, 'duration') && property_exists($activitySegment, 'distance')) { - $gmapsActivity = new Gmaps_activity($this->db); + $gmapsActivity = new GmapsActivity($this->db); $gmapsActivity->ref = $key; $gmapsActivity->location_start_long = $activitySegment->startLocation->longitudeE7; $gmapsActivity->location_start_lat = $activitySegment->startLocation->latitudeE7; @@ -1018,7 +1018,7 @@ public function importFile($file, $user) //$gmapsActivity->duration_end = round(((int) $activitySegment->duration->endTimestamp)*0.001); $gmapsActivity->duration_end = dol_stringtotime($activitySegment->duration->endTimestamp); $gmapsActivity->distance = $activitySegment->distance; - $gmapsActivity->status = Gmaps_activity::STATUS_VALIDATED; + $gmapsActivity->status = GmapsActivity::STATUS_VALIDATED; $result = $gmapsActivity->create($user); if ($result < 0) { @@ -1039,9 +1039,9 @@ public function importFile($file, $user) && property_exists($placeVisit->location, 'placeId') && property_exists($placeVisit->location, 'address') && property_exists($placeVisit, 'duration')) { - $gmapsPlaceVisit = new Gmaps_place($this->db); + $gmapsPlaceVisit = new GmapsPlace($this->db); $gmapsPlaceVisit->ref = $key; - $gmapsPlaceVisit->fk_gmaps_activity = $gmapsActivity->id; + $gmapsPlaceVisit->fk_gmapsactivity = $gmapsActivity->id; $gmapsPlaceVisit->location_placeid = $placeVisit->location->placeId; $gmapsPlaceVisit->location_address_raw = $placeVisit->location->address; $gmapsPlaceVisit->location_name = (property_exists($placeVisit->location, 'name')?$placeVisit->location->name:$placeVisit->location->address); @@ -1049,7 +1049,7 @@ public function importFile($file, $user) $gmapsPlaceVisit->duration_start = dol_stringtotime($placeVisit->duration->startTimestamp); //$gmapsPlaceVisit->duration_end = round ((int) $placeVisit->duration->endTimestampMs)*0.001; $gmapsPlaceVisit->duration_end = dol_stringtotime($placeVisit->duration->startTimestamp); - $gmapsPlaceVisit->status = Gmaps_place::STATUS_VALIDATED; + $gmapsPlaceVisit->status = GmapsPlace::STATUS_VALIDATED; $result = $gmapsPlaceVisit->create($user); if ($result < 0) { diff --git a/class/gmaps_place.class.php b/class/gmapsplace.class.php similarity index 92% rename from class/gmaps_place.class.php rename to class/gmapsplace.class.php index 4f91120..1fca745 100755 --- a/class/gmaps_place.class.php +++ b/class/gmapsplace.class.php @@ -17,9 +17,9 @@ */ /** - * \file class/gmaps_place.class.php + * \file class/gmapsplace.class.php * \ingroup gmaps - * \brief This file is a CRUD class file for Gmaps_place (Create/Read/Update/Delete) + * \brief This file is a CRUD class file for GmapsPlace (Create/Read/Update/Delete) */ // Put here all includes required by your class file @@ -28,9 +28,9 @@ //require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; /** - * Class for Gmaps_place + * Class for GmapsPlace */ -class Gmaps_place extends CommonObject +class GmapsPlace extends CommonObject { /** * @var string ID of module. @@ -40,12 +40,12 @@ class Gmaps_place extends CommonObject /** * @var string ID to identify managed object. */ - public $element = 'gmaps_place'; + public $element = 'gmapsplace'; /** * @var string Name of table without prefix where object is stored. This is also the key used for extrafields management. */ - public $table_element = 'gmaps_gmaps_place'; + public $table_element = 'gmaps_gmapsplace'; /** * @var int Does this object support multicompany module ? @@ -59,9 +59,9 @@ class Gmaps_place extends CommonObject public $isextrafieldmanaged = 1; /** - * @var string String with name of icon for gmaps_place. Must be the part after the 'object_' into object_gmaps_place.png + * @var string String with name of icon for gmapsPlace. Must be the part after the 'object_' into object_gmapsPlace.png */ - public $picto = 'gmaps_place@gmaps'; + public $picto = 'gmapsPlace@gmaps'; const STATUS_DRAFT = 0; @@ -112,7 +112,7 @@ class Gmaps_place extends CommonObject 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>'1', 'position'=>511, 'notnull'=>-1, 'visible'=>-2,), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,), 'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Brouillon', '1'=>'Validé', '9'=>'Annulé'),), - 'fk_gmaps_activity' => array('type'=>'integer:Gmaps_activity:gmaps/class/gmaps_activity.class.php:1', 'label'=>'Activity', 'enabled'=>'1', 'position'=>40, 'notnull'=>1, 'visible'=>-1, 'index'=>1,), + 'fk_gmapsactivity' => array('type'=>'integer:GmapsActivity:gmaps/class/gmapsactivity.class.php:1', 'label'=>'Activity', 'enabled'=>'1', 'position'=>40, 'notnull'=>1, 'visible'=>-1, 'index'=>1,), 'location_placeid' => array('type'=>'varchar(50)', 'label'=>'PlaceId', 'enabled'=>'1', 'position'=>40, 'notnull'=>-1, 'visible'=>1,), 'location_address_raw' => array('type'=>'varchar(200)', 'label'=>'PlaceAdress', 'enabled'=>'1', 'position'=>41, 'notnull'=>-1, 'visible'=>1,), 'location_name' => array('type'=>'varchar(200)', 'label'=>'PlaceName', 'enabled'=>'1', 'position'=>42, 'notnull'=>-1, 'visible'=>1,), @@ -132,7 +132,7 @@ class Gmaps_place extends CommonObject public $fk_user_modif; public $import_key; public $status; - public $fk_gmaps_activity; + public $fk_gmapsActivity; public $location_placeid; public $location_address_raw; public $location_name; @@ -146,17 +146,17 @@ class Gmaps_place extends CommonObject /** * @var int Name of subtable line */ - //public $table_element_line = 'gmaps_gmaps_placeline'; + //public $table_element_line = 'gmaps_gmapsPlaceline'; /** * @var int Field with ID of parent key if this object has a parent */ - //public $fk_element = 'fk_gmaps_place'; + //public $fk_element = 'fk_gmapsPlace'; /** * @var int Name of subtable class that manage subtable lines */ - //public $class_element_line = 'Gmaps_placeline'; + //public $class_element_line = 'GmapsPlaceline'; /** * @var array List of child tables. To test if we can delete object. @@ -168,10 +168,10 @@ class Gmaps_place extends CommonObject * If name matches '@ClassNAme:FilePathClass;ParentFkFieldName' it will * call method deleteByParentField(parentId, ParentFkFieldName) to fetch and delete child object */ - //protected $childtablesoncascade = array('gmaps_gmaps_placedet'); + //protected $childtablesoncascade = array('gmaps_gmapsPlacedet'); /** - * @var Gmaps_placeLine[] Array of subtable lines + * @var GmapsPlaceLine[] Array of subtable lines */ //public $lines = array(); @@ -192,7 +192,7 @@ public function __construct(DoliDB $db) if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0; // Example to show how to set values of fields definition dynamically - /*if ($user->rights->gmaps->gmaps_place->read) { + /*if ($user->rights->gmaps->gmapsPlace->read) { $this->fields['myfield']['visible'] = 1; $this->fields['myfield']['noteditable'] = 0; }*/ @@ -382,7 +382,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = $sqlwhere = array(); if (count($filter) > 0) { foreach ($filter as $key => $value) { - if ($key == 't.rowid' || $key == 't.fk_gmaps_activity') { + if ($key == 't.rowid' || $key == 't.fk_gmapsActivity') { $sqlwhere[] = $key.'='.$value; } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; @@ -499,8 +499,8 @@ public function validate($user, $notrigger = 0) return 0; } - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->gmaps->gmaps_place->write)) - || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->gmaps->gmaps_place->gmaps_place_advance->validate)))) + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->gmaps->gmapsPlace->write)) + || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->gmaps->gmapsPlace->gmapsPlace_advance->validate)))) { $this->error='NotEnoughPermissions'; dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); @@ -541,7 +541,7 @@ public function validate($user, $notrigger = 0) if (!$error && !$notrigger) { // Call trigger - $result = $this->call_trigger('GMAPS_PLACE_VALIDATE', $user); + $result = $this->call_trigger('GMAPSPLACE_VALIDATE', $user); if ($result < 0) $error++; // End call triggers } @@ -555,16 +555,16 @@ public function validate($user, $notrigger = 0) if (preg_match('/^[\(]?PROV/i', $this->ref)) { // Now we rename also files into index - $sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'gmaps_place/".$this->db->escape($this->newref)."'"; - $sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'gmaps_place/".$this->db->escape($this->ref)."' and entity = ".$conf->entity; + $sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'gmapsPlace/".$this->db->escape($this->newref)."'"; + $sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'gmapsPlace/".$this->db->escape($this->ref)."' and entity = ".$conf->entity; $resql = $this->db->query($sql); if (!$resql) { $error++; $this->error = $this->db->lasterror(); } // We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments $oldref = dol_sanitizeFileName($this->ref); $newref = dol_sanitizeFileName($num); - $dirsource = $conf->gmaps->dir_output.'/gmaps_place/'.$oldref; - $dirdest = $conf->gmaps->dir_output.'/gmaps_place/'.$newref; + $dirsource = $conf->gmaps->dir_output.'/gmapsPlace/'.$oldref; + $dirdest = $conf->gmaps->dir_output.'/gmapsPlace/'.$newref; if (!$error && file_exists($dirsource)) { dol_syslog(get_class($this)."::validate() rename dir ".$dirsource." into ".$dirdest); @@ -573,7 +573,7 @@ public function validate($user, $notrigger = 0) { dol_syslog("Rename ok"); // Rename docs starting with $oldref with $newref - $listoffiles = dol_dir_list($conf->gmaps->dir_output.'/gmaps_place/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/')); + $listoffiles = dol_dir_list($conf->gmaps->dir_output.'/gmapsPlace/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/')); foreach ($listoffiles as $fileentry) { $dirsource = $fileentry['name']; @@ -627,7 +627,7 @@ public function setDraft($user, $notrigger = 0) return -1; }*/ - return $this->setStatusCommon($user, self::STATUS_DRAFT, $notrigger, 'GMAPS_PLACE_UNVALIDATE'); + return $this->setStatusCommon($user, self::STATUS_DRAFT, $notrigger, 'GMAPSPLACE_UNVALIDATE'); } /** @@ -652,7 +652,7 @@ public function cancel($user, $notrigger = 0) return -1; }*/ - return $this->setStatusCommon($user, self::STATUS_CANCELED, $notrigger, 'GMAPS_PLACE_CLOSE'); + return $this->setStatusCommon($user, self::STATUS_CANCELED, $notrigger, 'GMAPSPLACE_CLOSE'); } /** @@ -677,7 +677,7 @@ public function reopen($user, $notrigger = 0) return -1; }*/ - return $this->setStatusCommon($user, self::STATUS_VALIDATED, $notrigger, 'GMAPS_PLACE_REOPEN'); + return $this->setStatusCommon($user, self::STATUS_VALIDATED, $notrigger, 'GMAPSPLACE_REOPEN'); } /** @@ -698,14 +698,14 @@ public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss $result = ''; - $label = img_picto('', $this->picto).' '.$langs->trans("Gmaps_place").''; + $label = img_picto('', $this->picto).' '.$langs->trans("GmapsPlace").''; $label .= '
'; $label .= ''.$langs->trans('Ref').': '.$this->ref; if (isset($this->status)) { $label .= '
'.$langs->trans("Status").": ".$this->getLibStatut(5); } - $url = dol_buildpath('/gmaps/gmaps_place_card.php', 1).'?id='.$this->id; + $url = dol_buildpath('/gmaps/gmapsPlace_card.php', 1).'?id='.$this->id; if ($option != 'nolink') { @@ -720,7 +720,7 @@ public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss { if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { - $label = $langs->trans("ShowGmaps_place"); + $label = $langs->trans("ShowGmapsPlace"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; @@ -766,7 +766,7 @@ public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : ''); global $action, $hookmanager; - $hookmanager->initHooks(array('gmaps_placedao')); + $hookmanager->initHooks(array('gmapsPlacedao')); $parameters = array('id'=>$this->id, 'getnomurl'=>$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) $result = $hookmanager->resPrint; @@ -887,8 +887,8 @@ public function getLinesArray() { $this->lines = array(); - $objectline = new Gmaps_placeLine($this->db); - $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_gmaps_place = '.$this->id)); + $objectline = new GmapsPlaceLine($this->db); + $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_gmapsPlace = '.$this->id)); if (is_numeric($result)) { @@ -911,16 +911,16 @@ public function getNextNumRef() global $langs, $conf; $langs->load("gmaps@gmaps"); - if (empty($conf->global->GMAPS_GMAPS_PLACE_ADDON)) { - $conf->global->GMAPS_GMAPS_PLACE_ADDON = 'mod_gmaps_place_standard'; + if (empty($conf->global->GMAPS_GMAPSPLACE_ADDON)) { + $conf->global->GMAPS_GMAPSPLACE_ADDON = 'mod_gmapsPlace_standard'; } - if (!empty($conf->global->GMAPS_GMAPS_PLACE_ADDON)) + if (!empty($conf->global->GMAPS_GMAPSPLACE_ADDON)) { $mybool = false; - $file = $conf->global->GMAPS_GMAPS_PLACE_ADDON.".php"; - $classname = $conf->global->GMAPS_GMAPS_PLACE_ADDON; + $file = $conf->global->GMAPS_GMAPSPLACE_ADDON.".php"; + $classname = $conf->global->GMAPS_GMAPSPLACE_ADDON; // Include file with class $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); @@ -981,12 +981,12 @@ public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hided $langs->load("gmaps@gmaps"); if (!dol_strlen($modele)) { - $modele = 'standard_gmaps_place'; + $modele = 'standard_gmapsPlace'; if ($this->model_pdf) { $modele = $this->model_pdf; - } elseif (!empty($conf->global->GMAPS_PLACE_ADDON_PDF)) { - $modele = $conf->global->GMAPS_PLACE_ADDON_PDF; + } elseif (!empty($conf->global->GMAPSPLACE_ADDON_PDF)) { + $modele = $conf->global->GMAPSPLACE_ADDON_PDF; } } @@ -1034,12 +1034,12 @@ public function doScheduledJob() require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php'; /** - * Class Gmaps_placeLine. You can also remove this and generate a CRUD class for lines objects. + * Class GmapsPlaceLine. You can also remove this and generate a CRUD class for lines objects. */ -class Gmaps_placeLine extends CommonObjectLine +class GmapsPlaceLine extends CommonObjectLine { - // To complete with content of an object Gmaps_placeLine - // We should have a field rowid, fk_gmaps_place and position + // To complete with content of an object GmapsPlaceLine + // We should have a field rowid, fk_gmapsPlace and position /** * @var int Does object support extrafields ? 0=No, 1=Yes diff --git a/core/modules/modGmaps.class.php b/core/modules/modGmaps.class.php index 6aa57ac..2c0c1ac 100755 --- a/core/modules/modGmaps.class.php +++ b/core/modules/modGmaps.class.php @@ -61,8 +61,8 @@ public function __construct($db) $this->description = "GmapsDescription"; // Used only if file README.md and README-LL.md not found. $this->descriptionlong = "Gmaps description (Long)"; - $this->editor_name = 'Editor name'; - $this->editor_url = 'https://www.example.com'; + $this->editor_name = 'JeffInfo'; + //$this->editor_url = 'https://www.example.com'; // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z' $this->version = '1.0'; // Url to the file with your last numberversion of this module @@ -226,8 +226,8 @@ public function __construct($db) // 0 => array( // 'label' => 'MyJob label', // 'jobtype' => 'method', - // 'class' => '/gmaps/class/gmaps_activity.class.php', - // 'objectname' => 'Gmaps_activity', + // 'class' => '/gmaps/class/gmapsactivity.class.php', + // 'objectname' => 'GmapsActivity', // 'method' => 'doScheduledJob', // 'parameters' => '', // 'comment' => 'Comment', @@ -250,17 +250,17 @@ public function __construct($db) /* BEGIN MODULEBUILDER PERMISSIONS */ $this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used) $this->rights[$r][1] = 'Read objects of Gmaps'; // Permission label - $this->rights[$r][4] = 'gmaps_activity'; // In php code, permission will be checked by test if ($user->rights->gmaps->level1->level2) + $this->rights[$r][4] = 'gmapsActivity'; // In php code, permission will be checked by test if ($user->rights->gmaps->level1->level2) $this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->gmaps->level1->level2) $r++; $this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used) $this->rights[$r][1] = 'Create/Update objects of Gmaps'; // Permission label - $this->rights[$r][4] = 'gmaps_activity'; // In php code, permission will be checked by test if ($user->rights->gmaps->level1->level2) + $this->rights[$r][4] = 'gmapsActivity'; // In php code, permission will be checked by test if ($user->rights->gmaps->level1->level2) $this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->gmaps->level1->level2) $r++; $this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used) $this->rights[$r][1] = 'Delete objects of Gmaps'; // Permission label - $this->rights[$r][4] = 'gmaps_activity'; // In php code, permission will be checked by test if ($user->rights->gmaps->level1->level2) + $this->rights[$r][4] = 'gmapsActivity'; // In php code, permission will be checked by test if ($user->rights->gmaps->level1->level2) $this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->gmaps->level1->level2) $r++; /* END MODULEBUILDER PERMISSIONS */ @@ -280,51 +280,51 @@ public function __construct($db) 'langs'=>'gmaps@gmaps', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'position'=>1000 + $r, 'enabled'=>'$conf->gmaps->enabled', // Define condition to show or hide menu entry. Use '$conf->gmaps->enabled' if entry must be visible if module is enabled. - 'perms'=>'1', // Use 'perms'=>'$user->rights->gmaps->gmaps_activity->read' if you want your menu with a permission rules + 'perms'=>'1', // Use 'perms'=>'$user->rights->gmaps->gmapsActivity->read' if you want your menu with a permission rules 'target'=>'', 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both ); /* END MODULEBUILDER TOPMENU */ - /* BEGIN MODULEBUILDER LEFTMENU GMAPS_ACTIVITY + /* BEGIN MODULEBUILDER LEFTMENU GMAPSACTIVITY $this->menu[$r++]=array( 'fk_menu'=>'fk_mainmenu=gmaps', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'type'=>'left', // This is a Top menu entry - 'titre'=>'Gmaps_activity', + 'titre'=>'GmapsActivity', 'mainmenu'=>'gmaps', - 'leftmenu'=>'gmaps_activity', + 'leftmenu'=>'gmapsActivity', 'url'=>'/gmaps/gmapsindex.php', 'langs'=>'gmaps@gmaps', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'position'=>1000+$r, 'enabled'=>'$conf->gmaps->enabled', // Define condition to show or hide menu entry. Use '$conf->gmaps->enabled' if entry must be visible if module is enabled. - 'perms'=>'$user->rights->gmaps->gmaps_activity->read', // Use 'perms'=>'$user->rights->gmaps->level1->level2' if you want your menu with a permission rules + 'perms'=>'$user->rights->gmaps->gmapsActivity->read', // Use 'perms'=>'$user->rights->gmaps->level1->level2' if you want your menu with a permission rules 'target'=>'', 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both ); $this->menu[$r++]=array( - 'fk_menu'=>'fk_mainmenu=gmaps,fk_leftmenu=gmaps_activity', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + 'fk_menu'=>'fk_mainmenu=gmaps,fk_leftmenu=gmapsActivity', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'type'=>'left', // This is a Left menu entry - 'titre'=>'List_Gmaps_activity', + 'titre'=>'List_GmapsActivity', 'mainmenu'=>'gmaps', - 'leftmenu'=>'gmaps_gmaps_activity_list', + 'leftmenu'=>'gmaps_gmapsActivity_list', 'url'=>'/gmaps/gmaps_activity_list.php', 'langs'=>'gmaps@gmaps', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'position'=>1000+$r, 'enabled'=>'$conf->gmaps->enabled', // Define condition to show or hide menu entry. Use '$conf->gmaps->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. - 'perms'=>'$user->rights->gmaps->gmaps_activity->read', // Use 'perms'=>'$user->rights->gmaps->level1->level2' if you want your menu with a permission rules + 'perms'=>'$user->rights->gmaps->gmapsActivity->read', // Use 'perms'=>'$user->rights->gmaps->level1->level2' if you want your menu with a permission rules 'target'=>'', 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both ); $this->menu[$r++]=array( - 'fk_menu'=>'fk_mainmenu=gmaps,fk_leftmenu=gmaps_activity', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + 'fk_menu'=>'fk_mainmenu=gmaps,fk_leftmenu=gmapsActivity', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'type'=>'left', // This is a Left menu entry - 'titre'=>'New_Gmaps_activity', + 'titre'=>'New_GmapsActivity', 'mainmenu'=>'gmaps', - 'leftmenu'=>'gmaps_gmaps_activity_new', + 'leftmenu'=>'gmaps_gmapsActivity_new', 'url'=>'/gmaps/gmaps_activity_card.php?action=create', 'langs'=>'gmaps@gmaps', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'position'=>1000+$r, 'enabled'=>'$conf->gmaps->enabled', // Define condition to show or hide menu entry. Use '$conf->gmaps->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. - 'perms'=>'$user->rights->gmaps->gmaps_activity->write', // Use 'perms'=>'$user->rights->gmaps->level1->level2' if you want your menu with a permission rules + 'perms'=>'$user->rights->gmaps->gmapsActivity->write', // Use 'perms'=>'$user->rights->gmaps->level1->level2' if you want your menu with a permission rules 'target'=>'', 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both ); @@ -355,9 +355,9 @@ public function __construct($db) 'fk_menu'=>'fk_mainmenu=gmaps', // This is a Left menu entry 'type'=>'left', - 'titre'=>'List_Gmaps_activity', + 'titre'=>'List_GmapsActivity', 'mainmenu'=>'gmaps', - 'leftmenu'=>'gmaps_gmaps_activity', + 'leftmenu'=>'gmaps_gmapsActivity', 'url'=>'/gmaps/gmaps_activity_list.php', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'langs'=>'gmaps@gmaps', @@ -372,12 +372,12 @@ public function __construct($db) ); $this->menu[$r++]=array( // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - 'fk_menu'=>'fk_mainmenu=gmaps,fk_leftmenu=gmaps_gmaps_activity', + 'fk_menu'=>'fk_mainmenu=gmaps,fk_leftmenu=gmaps_gmapsActivity', // This is a Left menu entry 'type'=>'left', - 'titre'=>'New_Gmaps_activity', + 'titre'=>'New_GmapsActivity', 'mainmenu'=>'gmaps', - 'leftmenu'=>'gmaps_gmaps_activity', + 'leftmenu'=>'gmaps_gmapsActivity', 'url'=>'/gmaps/gmaps_activity_card.php?action=create', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'langs'=>'gmaps@gmaps', @@ -397,7 +397,7 @@ public function __construct($db) 'type'=>'left', 'titre'=>'Alayse_KM', 'mainmenu'=>'gmaps', - 'leftmenu'=>'gmaps_gmaps_activity', + 'leftmenu'=>'gmaps_gmapsActivity', 'url'=>'/gmaps/gmaps_analyses_km.php', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'langs'=>'gmaps@gmaps', @@ -437,7 +437,7 @@ public function __construct($db) 'type'=>'left', 'titre'=>'GmapsPrepareNDF', 'mainmenu'=>'gmaps', - 'leftmenu'=>'gmaps_gmaps_activity', + 'leftmenu'=>'gmaps_gmapsActivity', 'url'=>'/gmaps/gmaps_prepare_ndf.php', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'langs'=>'gmaps@gmaps', @@ -451,57 +451,57 @@ public function __construct($db) 'user'=>0 ); - /* END MODULEBUILDER LEFTMENU GMAPS_ACTIVITY */ + /* END MODULEBUILDER LEFTMENU GMAPSACTIVITY */ // Exports profiles provided by this module $r = 1; - /* BEGIN MODULEBUILDER EXPORT GMAPS_ACTIVITY */ + /* BEGIN MODULEBUILDER EXPORT GMAPSACTIVITY */ /* $langs->load("gmaps@gmaps"); $this->export_code[$r]=$this->rights_class.'_'.$r; - $this->export_label[$r]='Gmaps_activityLines'; // Translation key (used only if key ExportDataset_xxx_z not found) - $this->export_icon[$r]='gmaps_activity@gmaps'; + $this->export_label[$r]='GmapsActivityLines'; // Translation key (used only if key ExportDataset_xxx_z not found) + $this->export_icon[$r]='gmapsActivity@gmaps'; // Define $this->export_fields_array, $this->export_TypeFields_array and $this->export_entities_array - $keyforclass = 'Gmaps_activity'; $keyforclassfile='/gmaps/class/gmaps_activity.class.php'; $keyforelement='gmaps_activity@gmaps'; + $keyforclass = 'GmapsActivity'; $keyforclassfile='/gmaps/class/gmapsactivity.class.php'; $keyforelement='gmapsActivity@gmaps'; include DOL_DOCUMENT_ROOT.'/core/commonfieldsinexport.inc.php'; //$this->export_fields_array[$r]['t.fieldtoadd']='FieldToAdd'; $this->export_TypeFields_array[$r]['t.fieldtoadd']='Text'; //unset($this->export_fields_array[$r]['t.fieldtoremove']); - //$keyforclass = 'Gmaps_activityLine'; $keyforclassfile='/gmaps/class/gmaps_activity.class.php'; $keyforelement='gmaps_activityline@gmaps'; $keyforalias='tl'; + //$keyforclass = 'GmapsActivityLine'; $keyforclassfile='/gmaps/class/gmapsactivity.class.php'; $keyforelement='gmapsActivityline@gmaps'; $keyforalias='tl'; //include DOL_DOCUMENT_ROOT.'/core/commonfieldsinexport.inc.php'; - $keyforselect='gmaps_activity'; $keyforaliasextra='extra'; $keyforelement='gmaps_activity@gmaps'; + $keyforselect='gmapsActivity'; $keyforaliasextra='extra'; $keyforelement='gmapsActivity@gmaps'; include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; - //$keyforselect='gmaps_activityline'; $keyforaliasextra='extraline'; $keyforelement='gmaps_activityline@gmaps'; + //$keyforselect='gmapsActivityline'; $keyforaliasextra='extraline'; $keyforelement='gmapsActivityline@gmaps'; //include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; - //$this->export_dependencies_array[$r] = array('gmaps_activityline'=>array('tl.rowid','tl.ref')); // To force to activate one or several fields if we select some fields that need same (like to select a unique key if we ask a field of a child to avoid the DISTINCT to discard them, or for computed field than need several other fields) + //$this->export_dependencies_array[$r] = array('gmapsActivityline'=>array('tl.rowid','tl.ref')); // To force to activate one or several fields if we select some fields that need same (like to select a unique key if we ask a field of a child to avoid the DISTINCT to discard them, or for computed field than need several other fields) //$this->export_special_array[$r] = array('t.field'=>'...'); //$this->export_examplevalues_array[$r] = array('t.field'=>'Example'); //$this->export_help_array[$r] = array('t.field'=>'FieldDescHelp'); $this->export_sql_start[$r]='SELECT DISTINCT '; - $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'gmaps_activity as t'; - //$this->export_sql_end[$r] =' LEFT JOIN '.MAIN_DB_PREFIX.'gmaps_activity_line as tl ON tl.fk_gmaps_activity = t.rowid'; + $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'gmapsActivity as t'; + //$this->export_sql_end[$r] =' LEFT JOIN '.MAIN_DB_PREFIX.'gmapsActivity_line as tl ON tl.fk_gmapsActivity = t.rowid'; $this->export_sql_end[$r] .=' WHERE 1 = 1'; - $this->export_sql_end[$r] .=' AND t.entity IN ('.getEntity('gmaps_activity').')'; + $this->export_sql_end[$r] .=' AND t.entity IN ('.getEntity('gmapsActivity').')'; $r++; */ - /* END MODULEBUILDER EXPORT GMAPS_ACTIVITY */ + /* END MODULEBUILDER EXPORT GMAPSACTIVITY */ // Imports profiles provided by this module $r = 1; - /* BEGIN MODULEBUILDER IMPORT GMAPS_ACTIVITY */ + /* BEGIN MODULEBUILDER IMPORT GMAPSACTIVITY */ /* $langs->load("gmaps@gmaps"); $this->export_code[$r]=$this->rights_class.'_'.$r; - $this->export_label[$r]='Gmaps_activityLines'; // Translation key (used only if key ExportDataset_xxx_z not found) - $this->export_icon[$r]='gmaps_activity@gmaps'; - $keyforclass = 'Gmaps_activity'; $keyforclassfile='/gmaps/class/gmaps_activity.class.php'; $keyforelement='gmaps_activity@gmaps'; + $this->export_label[$r]='GmapsActivityLines'; // Translation key (used only if key ExportDataset_xxx_z not found) + $this->export_icon[$r]='gmapsActivity@gmaps'; + $keyforclass = 'GmapsActivity'; $keyforclassfile='/gmaps/class/gmapsactivity.class.php'; $keyforelement='gmapsActivity@gmaps'; include DOL_DOCUMENT_ROOT.'/core/commonfieldsinexport.inc.php'; - $keyforselect='gmaps_activity'; $keyforaliasextra='extra'; $keyforelement='gmaps_activity@gmaps'; + $keyforselect='gmapsActivity'; $keyforaliasextra='extra'; $keyforelement='gmapsActivity@gmaps'; include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; //$this->export_dependencies_array[$r]=array('mysubobject'=>'ts.rowid', 't.myfield'=>array('t.myfield2','t.myfield3')); // To force to activate one or several fields if we select some fields that need same (like to select a unique key if we ask a field of a child to avoid the DISTINCT to discard them, or for computed field than need several other fields) $this->export_sql_start[$r]='SELECT DISTINCT '; - $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'gmaps_activity as t'; + $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'gmapsActivity as t'; $this->export_sql_end[$r] .=' WHERE 1 = 1'; - $this->export_sql_end[$r] .=' AND t.entity IN ('.getEntity('gmaps_activity').')'; + $this->export_sql_end[$r] .=' AND t.entity IN ('.getEntity('gmapsActivity').')'; $r++; */ - /* END MODULEBUILDER IMPORT GMAPS_ACTIVITY */ + /* END MODULEBUILDER IMPORT GMAPSACTIVITY */ } /** @@ -522,8 +522,8 @@ public function init($options = '') // Create extrafields during init include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $extrafields = new ExtraFields($this->db); - $param['options']['gmaps_gmaps_place:CONCAT(location_name,\' \',location_address_raw):rowid::']=null; - $result1=$extrafields->addExtraField('fk_gmaps_gmaps_place', "Lieu Gmaps", 'chkbxlst', 1, '', 'thirdparty', 0, 0, '', $param, 1, '', 1, 0, '', '', 'gmaps@gmaps', '$conf->gmaps->enabled'); + $param['options']['gmaps_gmapsplace:CONCAT(location_name,\' \',location_address_raw):rowid::']=null; + $result1=$extrafields->addExtraField('fk_gmaps_gmapsplace', "Lieu Gmaps", 'chkbxlst', 1, '', 'thirdparty', 0, 0, '', $param, 1, '', 1, 0, '', '', 'gmaps@gmaps', '$conf->gmaps->enabled'); //$result2=$extrafields->addExtraField('gmaps_myattr2', "New Attr 2 label", 'varchar', 1, 10, 'project', 0, 0, '', '', 1, '', 0, 0, '', '', 'gmaps@gmaps', '$conf->gmaps->enabled'); //$result3=$extrafields->addExtraField('gmaps_myattr3', "New Attr 3 label", 'varchar', 1, 10, 'bank_account', 0, 0, '', '', 1, '', 0, 0, '', '', 'gmaps@gmaps', '$conf->gmaps->enabled'); //$result4=$extrafields->addExtraField('gmaps_myattr4', "New Attr 4 label", 'select', 1, 3, 'thirdparty', 0, 1, '', array('options'=>array('code1'=>'Val1','code2'=>'Val2','code3'=>'Val3')), 1,'', 0, 0, '', '', 'gmaps@gmaps', '$conf->gmaps->enabled'); @@ -537,14 +537,14 @@ public function init($options = '') // Document templates $moduledir = 'gmaps'; $myTmpObjects = array(); - $myTmpObjects['Gmaps_activity']=array('includerefgeneration'=>0, 'includedocgeneration'=>0); + $myTmpObjects['GmapsActivity']=array('includerefgeneration'=>0, 'includedocgeneration'=>0); foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { - if ($myTmpObjectKey == 'Gmaps_activity') continue; + if ($myTmpObjectKey == 'GmapsActivity') continue; if ($myTmpObjectArray['includerefgeneration']) { - $src=DOL_DOCUMENT_ROOT.'/install/doctemplates/gmaps/template_gmaps_activitys.odt'; + $src=DOL_DOCUMENT_ROOT.'/install/doctemplates/gmaps/template_gmapsActivitys.odt'; $dirodt=DOL_DATA_ROOT.'/doctemplates/gmaps'; - $dest=$dirodt.'/template_gmaps_activitys.odt'; + $dest=$dirodt.'/template_gmapsActivitys.odt'; if (file_exists($src) && ! file_exists($dest)) { diff --git a/gmaps_activity_agenda.php b/gmaps_activity_agenda.php index f5b57e8..f28d75d 100755 --- a/gmaps_activity_agenda.php +++ b/gmaps_activity_agenda.php @@ -17,9 +17,9 @@ */ /** - * \file gmaps_activity_agenda.php + * \file gmapsActivity_agenda.php * \ingroup gmaps - * \brief Tab of events on Gmaps_activity + * \brief Tab of events on GmapsActivity */ //if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db @@ -61,8 +61,8 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -dol_include_once('/gmaps/class/gmaps_activity.class.php'); -dol_include_once('/gmaps/lib/gmaps_gmaps_activity.lib.php'); +dol_include_once('/gmaps/class/gmapsactivity.class.php'); +dol_include_once('/gmaps/lib/gmaps_gmapsactivity.lib.php'); // Load translation files required by the page @@ -95,10 +95,10 @@ if (!$sortorder) $sortorder = 'DESC,DESC'; // Initialize technical objects -$object = new Gmaps_activity($db); +$object = new GmapsActivity($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->gmaps->dir_output.'/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('gmaps_activityagenda', 'globalcard')); // Note that conf->hooks_modules contains array +$hookmanager->initHooks(array('gmapsActivityagenda', 'globalcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); @@ -111,7 +111,7 @@ //if ($user->socid > 0) $socid = $user->socid; //$result = restrictedArea($user, 'gmaps', $object->id); -$permissiontoadd = $user->rights->gmaps->gmaps_activity->write; // Used by the include of actions_addupdatedelete.inc.php +$permissiontoadd = $user->rights->gmaps->gmapsActivity->write; // Used by the include of actions_addupdatedelete.inc.php /* @@ -155,10 +155,10 @@ llxHeader('', $title, $help_url); if (!empty($conf->notification->enabled)) $langs->load("mails"); - $head = gmaps_activityPrepareHead($object); + $head = gmapsActivityPrepareHead($object); - print dol_get_fiche_head($head, 'agenda', $langs->trans("Gmaps_activity"), -1, 'object_'.$object->picto); + print dol_get_fiche_head($head, 'agenda', $langs->trans("GmapsActivity"), -1, 'object_'.$object->picto); // Object card // ------------------------------------------------------------ @@ -260,7 +260,7 @@ if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); - //print load_fiche_titre($langs->trans("ActionsOnGmaps_activity"), '', ''); + //print load_fiche_titre($langs->trans("ActionsOnGmapsActivity"), '', ''); // List of all actions $filters = array(); diff --git a/gmaps_activity_card.php b/gmaps_activity_card.php index bf48c51..dfe792d 100755 --- a/gmaps_activity_card.php +++ b/gmaps_activity_card.php @@ -19,7 +19,7 @@ /** * \file gmaps_activity_card.php * \ingroup gmaps - * \brief Page to create/edit/view gmaps_activity + * \brief Page to create/edit/view gmapsActivity */ //if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db @@ -61,9 +61,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; -dol_include_once('/gmaps/class/gmaps_activity.class.php'); -dol_include_once('/gmaps/lib/gmaps_gmaps_activity.lib.php'); -dol_include_once('/gmaps/class/gmaps_gmaps_place.class.php'); +dol_include_once('/gmaps/class/gmapsactivity.class.php'); +dol_include_once('/gmaps/lib/gmaps_gmapsactivity.lib.php'); +dol_include_once('/gmaps/class/gmaps_gmapsplace.class.php'); // Load translation files required by the page $langs->loadLangs(array("gmaps@gmaps", "other")); @@ -74,16 +74,16 @@ $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'aZ09'); -$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'gmaps_activitycard'; // To manage different context of search +$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'gmapsActivitycard'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); //$lineid = GETPOST('lineid', 'int'); // Initialize technical objects -$object = new Gmaps_activity($db); +$object = new GmapsActivity($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->gmaps->dir_output.'/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('gmaps_activitycard', 'globalcard')); // Note that conf->hooks_modules contains array +$hookmanager->initHooks(array('gmapsActivitycard', 'globalcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); @@ -107,11 +107,11 @@ $object->fetchPlaces(); } -$permissiontoread = $user->rights->gmaps->gmaps_activity->read; -$permissiontoadd = $user->rights->gmaps->gmaps_activity->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php -$permissiontodelete = $user->rights->gmaps->gmaps_activity->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); -$permissionnote = $user->rights->gmaps->gmaps_activity->write; // Used by the include of actions_setnotes.inc.php -$permissiondellink = $user->rights->gmaps->gmaps_activity->write; // Used by the include of actions_dellink.inc.php +$permissiontoread = $user->rights->gmaps->gmapsActivity->read; +$permissiontoadd = $user->rights->gmaps->gmapsActivity->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php +$permissiontodelete = $user->rights->gmaps->gmapsActivity->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); +$permissionnote = $user->rights->gmaps->gmapsActivity->write; // Used by the include of actions_setnotes.inc.php +$permissiondellink = $user->rights->gmaps->gmapsActivity->write; // Used by the include of actions_dellink.inc.php $upload_dir = $conf->gmaps->multidir_output[isset($object->entity) ? $object->entity : 1]; // Security check - Protection if external user @@ -143,7 +143,7 @@ else $backtopage = dol_buildpath('/gmaps/gmaps_activity_card.php', 1).'?id='.($id > 0 ? $id : '__ID__'); } } - $triggermodname = 'GMAPS_GMAPS_ACTIVITY_MODIFY'; // Name of trigger action code to execute when we modify record + $triggermodname = 'GMAPS_GMAPSACTIVITY_MODIFY'; // Name of trigger action code to execute when we modify record // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; @@ -170,9 +170,9 @@ } // Actions to send emails - $triggersendname = 'GMAPS_GMAPS_ACTIVITY_SENTBYMAIL'; - $autocopy = 'MAIN_MAIL_AUTOCOPY_GMAPS_ACTIVITY_TO'; - $trackid = 'gmaps_activity'.$object->id; + $triggersendname = 'GMAPS_GMAPSACTIVITY_SENTBYMAIL'; + $autocopy = 'MAIN_MAIL_AUTOCOPY_GMAPSACTIVITY_TO'; + $trackid = 'gmapsActivity'.$object->id; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; } @@ -189,7 +189,7 @@ $formfile = new FormFile($db); $formproject = new FormProjets($db); -$title = $langs->trans("Gmaps_activity"); +$title = $langs->trans("GmapsActivity"); $help_url = ''; llxHeader('', $title, $help_url); @@ -212,7 +212,7 @@ function init_myfunc() // Part to create if ($action == 'create') { - print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Gmaps_activity")), '', 'object_'.$object->picto); + print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("GmapsActivity")), '', 'object_'.$object->picto); print '
'; print ''; @@ -251,7 +251,7 @@ function init_myfunc() // Part to edit record if (($id || $ref) && $action == 'edit') { - print load_fiche_titre($langs->trans("Gmaps_activity"), '', 'object_'.$object->picto); + print load_fiche_titre($langs->trans("GmapsActivity"), '', 'object_'.$object->picto); print ''; print ''; @@ -286,14 +286,14 @@ function init_myfunc() { $res = $object->fetch_optionals(); - $head = gmaps_activityPrepareHead($object); - print dol_get_fiche_head($head, 'card', $langs->trans("Gmaps_activity"), -1, $object->picto); + $head = gmapsActivityPrepareHead($object); + print dol_get_fiche_head($head, 'card', $langs->trans("GmapsActivity"), -1, $object->picto); $formconfirm = ''; // Confirmation to delete if ($action == 'delete') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteGmaps_activity'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteGmapsActivity'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); } // Confirmation to delete line if ($action == 'deleteline') { @@ -491,7 +491,7 @@ function init_myfunc() // Clone if ($permissiontoadd) { - print ''.$langs->trans("ToClone").''."\n"; + print ''.$langs->trans("ToClone").''."\n"; } /* @@ -543,13 +543,13 @@ function init_myfunc() $relativepath = $objref . '/' . $objref . '.pdf'; $filedir = $conf->gmaps->dir_output.'/'.$object->element.'/'.$objref; $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; - $genallowed = $user->rights->gmaps->gmaps_activity->read; // If you can read, you can build the PDF to read content - $delallowed = $user->rights->gmaps->gmaps_activity->write; // If you can create/edit, you can remove a file on card - print $formfile->showdocuments('gmaps:Gmaps_activity', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang); + $genallowed = $user->rights->gmaps->gmapsActivity->read; // If you can read, you can build the PDF to read content + $delallowed = $user->rights->gmaps->gmapsActivity->write; // If you can create/edit, you can remove a file on card + print $formfile->showdocuments('gmaps:GmapsActivity', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang); } // Show links to link elements - $linktoelem = $form->showLinkToObjectBlock($object, null, array('gmaps_activity')); + $linktoelem = $form->showLinkToObjectBlock($object, null, array('gmapsActivity')); $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); @@ -557,7 +557,7 @@ function init_myfunc() $MAXEVENT = 10; - $morehtmlright = ''; + $morehtmlright = ''; $morehtmlright .= $langs->trans("SeeAll"); $morehtmlright .= ''; @@ -573,10 +573,10 @@ function init_myfunc() if (GETPOST('modelselected')) $action = 'presend'; // Presend form - $modelmail = 'gmaps_activity'; + $modelmail = 'gmapsActivity'; $defaulttopic = 'InformationMessage'; $diroutput = $conf->gmaps->dir_output; - $trackid = 'gmaps_activity'.$object->id; + $trackid = 'gmapsActivity'.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; } diff --git a/gmaps_activity_document.php b/gmaps_activity_document.php index 4f9c5f4..1b0b13d 100755 --- a/gmaps_activity_document.php +++ b/gmaps_activity_document.php @@ -17,9 +17,9 @@ */ /** - * \file gmaps_activity_document.php + * \file gmapsActivity_document.php * \ingroup gmaps - * \brief Tab for documents linked to Gmaps_activity + * \brief Tab for documents linked to GmapsActivity */ //if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db @@ -62,8 +62,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -dol_include_once('/gmaps/class/gmaps_activity.class.php'); -dol_include_once('/gmaps/lib/gmaps_gmaps_activity.lib.php'); +dol_include_once('/gmaps/class/gmapsactivity.class.php'); +dol_include_once('/gmaps/lib/gmaps_gmapsactivity.lib.php'); // Load translation files required by the page $langs->loadLangs(array("gmaps@gmaps", "companies", "other", "mails")); @@ -88,25 +88,25 @@ //if (! $sortfield) $sortfield="position_name"; // Initialize technical objects -$object = new Gmaps_activity($db); +$object = new GmapsActivity($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->gmaps->dir_output.'/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('gmaps_activitydocument', 'globalcard')); // Note that conf->hooks_modules contains array +$hookmanager->initHooks(array('gmapsActivitydocument', 'globalcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals -//if ($id > 0 || ! empty($ref)) $upload_dir = $conf->gmaps->multidir_output[$object->entity?$object->entity:$conf->entity] . "/gmaps_activity/" . dol_sanitizeFileName($object->id); -if ($id > 0 || !empty($ref)) $upload_dir = $conf->gmaps->multidir_output[$object->entity ? $object->entity : $conf->entity]."/gmaps_activity/".dol_sanitizeFileName($object->ref); +//if ($id > 0 || ! empty($ref)) $upload_dir = $conf->gmaps->multidir_output[$object->entity?$object->entity:$conf->entity] . "/gmapsActivity/" . dol_sanitizeFileName($object->id); +if ($id > 0 || !empty($ref)) $upload_dir = $conf->gmaps->multidir_output[$object->entity ? $object->entity : $conf->entity]."/gmapsActivity/".dol_sanitizeFileName($object->ref); // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) $socid = $user->socid; //$result = restrictedArea($user, 'gmaps', $object->id); -$permissiontoadd = $user->rights->gmaps->gmaps_activity->write; // Used by the include of actions_addupdatedelete.inc.php +$permissiontoadd = $user->rights->gmaps->gmapsActivity->write; // Used by the include of actions_addupdatedelete.inc.php @@ -123,7 +123,7 @@ $form = new Form($db); -$title = $langs->trans("Gmaps_activity").' - '.$langs->trans("Files"); +$title = $langs->trans("GmapsActivity").' - '.$langs->trans("Files"); $help_url = ''; //$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; llxHeader('', $title, $help_url); @@ -133,9 +133,9 @@ /* * Show tabs */ - $head = gmaps_activityPrepareHead($object); + $head = gmapsActivityPrepareHead($object); - print dol_get_fiche_head($head, 'document', $langs->trans("Gmaps_activity"), -1, $object->picto); + print dol_get_fiche_head($head, 'document', $langs->trans("GmapsActivity"), -1, $object->picto); // Build file list @@ -210,14 +210,14 @@ print dol_get_fiche_end(); $modulepart = 'gmaps'; - //$permission = $user->rights->gmaps->gmaps_activity->write; + //$permission = $user->rights->gmaps->gmapsActivity->write; $permission = 1; - //$permtoedit = $user->rights->gmaps->gmaps_activity->write; + //$permtoedit = $user->rights->gmaps->gmapsActivity->write; $permtoedit = 1; $param = '&id='.$object->id; - //$relativepathwithnofile='gmaps_activity/' . dol_sanitizeFileName($object->id).'/'; - $relativepathwithnofile = 'gmaps_activity/'.dol_sanitizeFileName($object->ref).'/'; + //$relativepathwithnofile='gmapsActivity/' . dol_sanitizeFileName($object->id).'/'; + $relativepathwithnofile = 'gmapsActivity/'.dol_sanitizeFileName($object->ref).'/'; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { diff --git a/gmaps_activity_list.php b/gmaps_activity_list.php index 0c27fd5..b8030c0 100755 --- a/gmaps_activity_list.php +++ b/gmaps_activity_list.php @@ -19,7 +19,7 @@ /** * \file gmaps_activity_list.php * \ingroup gmaps - * \brief List page for gmaps_activity + * \brief List page for gmapsActivity */ //if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db @@ -82,7 +82,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; // load gmaps libraries -require_once __DIR__ . '/class/gmaps_activity.class.php'; +require_once __DIR__ . '/class/gmapsactivity.class.php'; // for other modules //dol_include_once('/othermodule/class/otherobject.class.php'); @@ -96,7 +96,7 @@ $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list -$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'gmaps_activitylist'; // To manage different context of search +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'gmapsActivitylist'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...) @@ -117,10 +117,10 @@ $pagenext = $page + 1; // Initialize technical objects -$object = new Gmaps_activity($db); +$object = new GmapsActivity($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->gmaps->dir_output . '/temp/massgeneration/' . $user->id; -$hookmanager->initHooks(array('gmaps_activitylist')); // Note that conf->hooks_modules contains array +$hookmanager->initHooks(array('gmapsActivitylist')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); @@ -183,9 +183,9 @@ $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); -$permissiontoread = $user->rights->gmaps->gmaps_activity->read; -$permissiontoadd = $user->rights->gmaps->gmaps_activity->write; -$permissiontodelete = $user->rights->gmaps->gmaps_activity->delete; +$permissiontoread = $user->rights->gmaps->gmapsActivity->read; +$permissiontoadd = $user->rights->gmaps->gmapsActivity->write; +$permissiontodelete = $user->rights->gmaps->gmapsActivity->delete; // Security check if (empty($conf->gmaps->enabled)) accessforbidden('Module not enabled'); @@ -239,15 +239,15 @@ } // Mass actions - $objectclass = 'Gmaps_activity'; - $objectlabel = 'Gmaps_activity'; + $objectclass = 'GmapsActivity'; + $objectlabel = 'GmapsActivity'; $uploaddir = $conf->gmaps->dir_output; include DOL_DOCUMENT_ROOT . '/core/actions_massactions.inc.php'; if ($massaction == 'affect_fk_soc' && $permissiontoadd) { if (!empty($toselect)) { foreach ($toselect as $kay => $val) { - $act = new Gmaps_activity($db); + $act = new GmapsActivity($db); $result = $act->fetch($val); if ($result < 0) { setEventMessages($act->error, $act->errors, 'errors'); @@ -271,12 +271,12 @@ if ($massaction == 'set_status_canceled' && $permissiontoadd) { if (!empty($toselect)) { foreach ($toselect as $kay => $val) { - $act = new Gmaps_activity($db); + $act = new GmapsActivity($db); $result = $act->fetch($val); if ($result < 0) { setEventMessages($act->error, $act->errors, 'errors'); } elseif ($result > 0) { - $$result_Upd = $act->setStatut(Gmaps_activity::STATUS_CANCELED, $val); + $$result_Upd = $act->setStatut(GmapsActivity::STATUS_CANCELED, $val); if ($result_Upd < 0) { setEventMessages($act->error, $act->errors, 'errors'); } @@ -299,9 +299,9 @@ $now = dol_now(); -//$help_url="EN:Module_Gmaps_activity|FR:Module_Gmaps_activity_FR|ES:Módulo_Gmaps_activity"; +//$help_url="EN:Module_GmapsActivity|FR:Module_GmapsActivity_FR|ES:Módulo_GmapsActivity"; $help_url = ''; -$title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("Gmaps_activitys")); +$title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("GmapsActivitys")); $morejs = array(); $morecss = array(); @@ -540,9 +540,9 @@ print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_' . $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); // Add code for pre mass action (confirmation or email presend form) -$topicmail = "SendGmaps_activityRef"; -$modelmail = "gmaps_activity"; -$objecttmp = new Gmaps_activity($db); +$topicmail = "SendGmapsActivityRef"; +$modelmail = "gmapsActivity"; +$objecttmp = new GmapsActivity($db); $trackid = 'xxxx' . $object->id; include DOL_DOCUMENT_ROOT . '/core/tpl/massactions_pre.tpl.php'; diff --git a/gmaps_activity_note.php b/gmaps_activity_note.php index a3955f2..add7190 100755 --- a/gmaps_activity_note.php +++ b/gmaps_activity_note.php @@ -17,9 +17,9 @@ */ /** - * \file gmaps_activity_note.php + * \file gmapsActivity_note.php * \ingroup gmaps - * \brief Tab for notes on Gmaps_activity + * \brief Tab for notes on GmapsActivity */ //if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db @@ -58,8 +58,8 @@ if (!$res && file_exists("../../../main.inc.php")) $res = @include "../../../main.inc.php"; if (!$res) die("Include of main fails"); -dol_include_once('/gmaps/class/gmaps_activity.class.php'); -dol_include_once('/gmaps/lib/gmaps_gmaps_activity.lib.php'); +dol_include_once('/gmaps/class/gmapsactivity.class.php'); +dol_include_once('/gmaps/lib/gmaps_gmapsactivity.lib.php'); // Load translation files required by the page $langs->loadLangs(array("gmaps@gmaps", "companies")); @@ -72,10 +72,10 @@ $backtopage = GETPOST('backtopage', 'alpha'); // Initialize technical objects -$object = new Gmaps_activity($db); +$object = new GmapsActivity($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->gmaps->dir_output.'/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('gmaps_activitynote', 'globalcard')); // Note that conf->hooks_modules contains array +$hookmanager->initHooks(array('gmapsActivitynote', 'globalcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); @@ -88,8 +88,8 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) $upload_dir = $conf->gmaps->multidir_output[$object->entity]."/".$object->id; -$permissionnote = $user->rights->gmaps->gmaps_activity->write; // Used by the include of actions_setnotes.inc.php -$permissiontoadd = $user->rights->gmaps->gmaps_activity->write; // Used by the include of actions_addupdatedelete.inc.php +$permissionnote = $user->rights->gmaps->gmapsActivity->write; // Used by the include of actions_setnotes.inc.php +$permissiontoadd = $user->rights->gmaps->gmapsActivity->write; // Used by the include of actions_addupdatedelete.inc.php @@ -108,15 +108,15 @@ //$help_url='EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes'; $help_url = ''; -llxHeader('', $langs->trans('Gmaps_activity'), $help_url); +llxHeader('', $langs->trans('GmapsActivity'), $help_url); if ($id > 0 || !empty($ref)) { $object->fetch_thirdparty(); - $head = gmaps_activityPrepareHead($object); + $head = gmapsActivityPrepareHead($object); - print dol_get_fiche_head($head, 'note', $langs->trans("Gmaps_activity"), -1, $object->picto); + print dol_get_fiche_head($head, 'note', $langs->trans("GmapsActivity"), -1, $object->picto); // Object card // ------------------------------------------------------------ diff --git a/gmaps_analyses_km.php b/gmaps_analyses_km.php index 216477e..b26a636 100755 --- a/gmaps_analyses_km.php +++ b/gmaps_analyses_km.php @@ -46,8 +46,8 @@ if (!$res) die("Include of main fails"); require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -require_once __DIR__.'/class/gmaps_activity.class.php'; -$object = new Gmaps_activity($db); +require_once __DIR__.'/class/gmapsactivity.class.php'; +$object = new GmapsActivity($db); // Load translation files required by the page $langs->loadLangs(array('companies',"gmaps@gmaps")); @@ -137,8 +137,8 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = ga.fk_soc"; $sql .= " WHERE ga.duration_start >= '".$db->idate($search_date_start)."'"; $sql .= " AND ga.duration_start <= '".$db->idate($search_date_end)."'"; -//$sql .= " AND ga.entity IN (".getEntity('gmaps_activity', 0).")"; // We don't share object for accountancy -$sql .= " AND ga.status =".Gmaps_activity::STATUS_VALIDATED; +//$sql .= " AND ga.entity IN (".getEntity('gmapsActivity', 0).")"; // We don't share object for accountancy +$sql .= " AND ga.status =".GmapsActivity::STATUS_VALIDATED; $sql .= " GROUP BY ga.fk_soc"; diff --git a/gmaps_analyses_time.php b/gmaps_analyses_time.php index 24ebacf..4959f8c 100755 --- a/gmaps_analyses_time.php +++ b/gmaps_analyses_time.php @@ -46,8 +46,8 @@ if (!$res) die("Include of main fails"); require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -require_once __DIR__.'/class/gmaps_activity.class.php'; -$object = new Gmaps_activity($db); +require_once __DIR__.'/class/gmapsactivity.class.php'; +$object = new GmapsActivity($db); // Load translation files required by the page $langs->loadLangs(array("companies","gmaps@gmaps")); @@ -137,8 +137,8 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = ga.fk_soc"; $sql .= " WHERE ga.duration_start >= '".$db->idate($search_date_start)."'"; $sql .= " AND ga.duration_start <= '".$db->idate($search_date_end)."'"; -//$sql .= " AND ga.entity IN (".getEntity('gmaps_activity', 0).")"; // We don't share object for accountancy -$sql .= " AND ga.status =".Gmaps_activity::STATUS_VALIDATED; +//$sql .= " AND ga.entity IN (".getEntity('gmapsActivity', 0).")"; // We don't share object for accountancy +$sql .= " AND ga.status =".GmapsActivity::STATUS_VALIDATED; $sql .= " GROUP BY ga.fk_soc"; $resql = $db->query($sql); diff --git a/gmaps_import_agenda.php b/gmaps_import_agenda.php index b38bd2b..841e74e 100755 --- a/gmaps_import_agenda.php +++ b/gmaps_import_agenda.php @@ -61,7 +61,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -dol_include_once('/gmaps/class/gmaps_import.class.php'); +dol_include_once('/gmaps/class/gmapsimport.class.php'); dol_include_once('/gmaps/lib/gmaps_gmaps_import.lib.php'); @@ -95,7 +95,7 @@ if (!$sortorder) $sortorder = 'DESC,DESC'; // Initialize technical objects -$object = new Gmaps_import($db); +$object = new gmapsImport($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->gmaps->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('gmaps_importagenda', 'globalcard')); // Note that conf->hooks_modules contains array diff --git a/gmaps_import_card.php b/gmaps_import_card.php index 29268c9..d22045f 100755 --- a/gmaps_import_card.php +++ b/gmaps_import_card.php @@ -61,7 +61,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; -dol_include_once('/gmaps/class/gmaps_import.class.php'); +dol_include_once('/gmaps/class/gmapsimport.class.php'); dol_include_once('/gmaps/lib/gmaps_gmaps_import.lib.php'); // Load translation files required by the page @@ -79,7 +79,7 @@ //$lineid = GETPOST('lineid', 'int'); // Initialize technical objects -$object = new Gmaps_import($db); +$object = new gmapsImport($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->gmaps->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('gmaps_importcard', 'globalcard')); // Note that conf->hooks_modules contains array diff --git a/gmaps_import_document.php b/gmaps_import_document.php index 581f985..173402b 100755 --- a/gmaps_import_document.php +++ b/gmaps_import_document.php @@ -62,7 +62,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -dol_include_once('/gmaps/class/gmaps_import.class.php'); +dol_include_once('/gmaps/class/gmapsimport.class.php'); dol_include_once('/gmaps/lib/gmaps_gmaps_import.lib.php'); // Load translation files required by the page @@ -88,7 +88,7 @@ //if (! $sortfield) $sortfield="position_name"; // Initialize technical objects -$object = new Gmaps_import($db); +$object = new gmapsImport($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->gmaps->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('gmaps_importdocument', 'globalcard')); // Note that conf->hooks_modules contains array diff --git a/gmaps_import_list.php b/gmaps_import_list.php index 3a68053..b489052 100755 --- a/gmaps_import_list.php +++ b/gmaps_import_list.php @@ -63,7 +63,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; // load gmaps libraries -require_once __DIR__.'/class/gmaps_import.class.php'; +require_once __DIR__.'/class/gmapsimport.class.php'; // for other modules //dol_include_once('/othermodule/class/otherobject.class.php'); @@ -94,7 +94,7 @@ $pagenext = $page + 1; // Initialize technical objects -$object = new Gmaps_import($db); +$object = new gmapsImport($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->gmaps->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('gmaps_importlist')); // Note that conf->hooks_modules contains array @@ -397,7 +397,7 @@ function init_myfunc() // Add code for pre mass action (confirmation or email presend form) $topicmail = "SendGmaps_importRef"; $modelmail = "gmaps_import"; -$objecttmp = new Gmaps_import($db); +$objecttmp = new gmapsImport($db); $trackid = 'xxxx'.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; diff --git a/gmaps_import_note.php b/gmaps_import_note.php index bf066a2..75830b1 100755 --- a/gmaps_import_note.php +++ b/gmaps_import_note.php @@ -58,7 +58,7 @@ if (!$res && file_exists("../../../main.inc.php")) $res = @include "../../../main.inc.php"; if (!$res) die("Include of main fails"); -dol_include_once('/gmaps/class/gmaps_import.class.php'); +dol_include_once('/gmaps/class/gmapsimport.class.php'); dol_include_once('/gmaps/lib/gmaps_gmaps_import.lib.php'); // Load translation files required by the page @@ -72,7 +72,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); // Initialize technical objects -$object = new Gmaps_import($db); +$object = gmapsImport($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->gmaps->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('gmaps_importnote', 'globalcard')); // Note that conf->hooks_modules contains array diff --git a/gmaps_place_agenda.php b/gmaps_place_agenda.php index b70e26c..1720ba5 100755 --- a/gmaps_place_agenda.php +++ b/gmaps_place_agenda.php @@ -17,9 +17,9 @@ */ /** - * \file gmaps_place_agenda.php + * \file gmapsPlace_agenda.php * \ingroup gmaps - * \brief Tab of events on Gmaps_place + * \brief Tab of events on GmapsPlace */ //if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db @@ -61,8 +61,8 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -dol_include_once('/gmaps/class/gmaps_place.class.php'); -dol_include_once('/gmaps/lib/gmaps_gmaps_place.lib.php'); +dol_include_once('/gmaps/class/gmapsplace.class.php'); +dol_include_once('/gmaps/lib/gmaps_gmapsPlace.lib.php'); // Load translation files required by the page @@ -95,10 +95,10 @@ if (!$sortorder) $sortorder = 'DESC,DESC'; // Initialize technical objects -$object = new Gmaps_place($db); +$object = new GmapsPlace($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->gmaps->dir_output.'/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('gmaps_placeagenda', 'globalcard')); // Note that conf->hooks_modules contains array +$hookmanager->initHooks(array('gmapsPlaceagenda', 'globalcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); @@ -111,7 +111,7 @@ //if ($user->socid > 0) $socid = $user->socid; //$result = restrictedArea($user, 'gmaps', $object->id); -$permissiontoadd = $user->rights->gmaps->gmaps_place->write; // Used by the include of actions_addupdatedelete.inc.php +$permissiontoadd = $user->rights->gmaps->gmapsPlace->write; // Used by the include of actions_addupdatedelete.inc.php /* @@ -155,14 +155,14 @@ llxHeader('', $title, $help_url); if (!empty($conf->notification->enabled)) $langs->load("mails"); - $head = gmaps_placePrepareHead($object); + $head = gmapsPlacePrepareHead($object); - print dol_get_fiche_head($head, 'agenda', $langs->trans("Gmaps_place"), -1, 'object_'.$object->picto); + print dol_get_fiche_head($head, 'agenda', $langs->trans("GmapsPlace"), -1, 'object_'.$object->picto); // Object card // ------------------------------------------------------------ - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; /* @@ -260,7 +260,7 @@ if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); - //print load_fiche_titre($langs->trans("ActionsOnGmaps_place"), '', ''); + //print load_fiche_titre($langs->trans("ActionsOnGmapsPlace"), '', ''); // List of all actions $filters = array(); diff --git a/gmaps_place_card.php b/gmaps_place_card.php index 9f2bdb0..daedd20 100755 --- a/gmaps_place_card.php +++ b/gmaps_place_card.php @@ -17,9 +17,9 @@ */ /** - * \file gmaps_place_card.php + * \file gmapsPlace_card.php * \ingroup gmaps - * \brief Page to create/edit/view gmaps_place + * \brief Page to create/edit/view gmapsPlace */ //if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db @@ -61,8 +61,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; -dol_include_once('/gmaps/class/gmaps_place.class.php'); -dol_include_once('/gmaps/lib/gmaps_gmaps_place.lib.php'); +dol_include_once('/gmaps/class/gmapsplace.class.php'); +dol_include_once('/gmaps/lib/gmaps_gmapsPlace.lib.php'); // Load translation files required by the page $langs->loadLangs(array("gmaps@gmaps", "other")); @@ -73,16 +73,16 @@ $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'aZ09'); -$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'gmaps_placecard'; // To manage different context of search +$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'gmapsPlacecard'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); //$lineid = GETPOST('lineid', 'int'); // Initialize technical objects -$object = new Gmaps_place($db); +$object = new GmapsPlace($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->gmaps->dir_output.'/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('gmaps_placecard', 'globalcard')); // Note that conf->hooks_modules contains array +$hookmanager->initHooks(array('gmapsPlacecard', 'globalcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); @@ -103,11 +103,11 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. -$permissiontoread = $user->rights->gmaps->gmaps_place->read; -$permissiontoadd = $user->rights->gmaps->gmaps_place->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php -$permissiontodelete = $user->rights->gmaps->gmaps_place->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); -$permissionnote = $user->rights->gmaps->gmaps_place->write; // Used by the include of actions_setnotes.inc.php -$permissiondellink = $user->rights->gmaps->gmaps_place->write; // Used by the include of actions_dellink.inc.php +$permissiontoread = $user->rights->gmaps->gmapsPlace->read; +$permissiontoadd = $user->rights->gmaps->gmapsPlace->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php +$permissiontodelete = $user->rights->gmaps->gmapsPlace->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); +$permissionnote = $user->rights->gmaps->gmapsPlace->write; // Used by the include of actions_setnotes.inc.php +$permissiondellink = $user->rights->gmaps->gmapsPlace->write; // Used by the include of actions_dellink.inc.php $upload_dir = $conf->gmaps->multidir_output[isset($object->entity) ? $object->entity : 1]; // Security check - Protection if external user @@ -131,15 +131,15 @@ { $error = 0; - $backurlforlist = dol_buildpath('/gmaps/gmaps_place_list.php', 1); + $backurlforlist = dol_buildpath('/gmaps/gmapsPlace_list.php', 1); if (empty($backtopage) || ($cancel && empty($id))) { if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) $backtopage = $backurlforlist; - else $backtopage = dol_buildpath('/gmaps/gmaps_place_card.php', 1).'?id='.($id > 0 ? $id : '__ID__'); + else $backtopage = dol_buildpath('/gmaps/gmapsPlace_card.php', 1).'?id='.($id > 0 ? $id : '__ID__'); } } - $triggermodname = 'GMAPS_GMAPS_PLACE_MODIFY'; // Name of trigger action code to execute when we modify record + $triggermodname = 'GMAPS_GMAPSPLACE_MODIFY'; // Name of trigger action code to execute when we modify record // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; @@ -166,9 +166,9 @@ } // Actions to send emails - $triggersendname = 'GMAPS_GMAPS_PLACE_SENTBYMAIL'; - $autocopy = 'MAIN_MAIL_AUTOCOPY_GMAPS_PLACE_TO'; - $trackid = 'gmaps_place'.$object->id; + $triggersendname = 'GMAPS_GMAPSPLACE_SENTBYMAIL'; + $autocopy = 'MAIN_MAIL_AUTOCOPY_GMAPSPLACE_TO'; + $trackid = 'gmapsPlace'.$object->id; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; } @@ -185,7 +185,7 @@ $formfile = new FormFile($db); $formproject = new FormProjets($db); -$title = $langs->trans("Gmaps_place"); +$title = $langs->trans("GmapsPlace"); $help_url = ''; llxHeader('', $title, $help_url); @@ -208,7 +208,7 @@ function init_myfunc() // Part to create if ($action == 'create') { - print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Gmaps_place")), '', 'object_'.$object->picto); + print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("GmapsPlace")), '', 'object_'.$object->picto); print ''; print ''; @@ -247,7 +247,7 @@ function init_myfunc() // Part to edit record if (($id || $ref) && $action == 'edit') { - print load_fiche_titre($langs->trans("Gmaps_place"), '', 'object_'.$object->picto); + print load_fiche_titre($langs->trans("GmapsPlace"), '', 'object_'.$object->picto); print ''; print ''; @@ -282,14 +282,14 @@ function init_myfunc() { $res = $object->fetch_optionals(); - $head = gmaps_placePrepareHead($object); - print dol_get_fiche_head($head, 'card', $langs->trans("Gmaps_place"), -1, $object->picto); + $head = gmapsPlacePrepareHead($object); + print dol_get_fiche_head($head, 'card', $langs->trans("GmapsPlace"), -1, $object->picto); $formconfirm = ''; // Confirmation to delete if ($action == 'delete') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteGmaps_place'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteGmapsPlace'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); } // Confirmation to delete line if ($action == 'deleteline') { @@ -331,7 +331,7 @@ function init_myfunc() // Object card // ------------------------------------------------------------ - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; /* @@ -497,7 +497,7 @@ function init_myfunc() // Clone if ($permissiontoadd) { - print ''.$langs->trans("ToClone").''."\n"; + print ''.$langs->trans("ToClone").''."\n"; } /* @@ -549,13 +549,13 @@ function init_myfunc() $relativepath = $objref . '/' . $objref . '.pdf'; $filedir = $conf->gmaps->dir_output.'/'.$object->element.'/'.$objref; $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; - $genallowed = $user->rights->gmaps->gmaps_place->read; // If you can read, you can build the PDF to read content - $delallowed = $user->rights->gmaps->gmaps_place->write; // If you can create/edit, you can remove a file on card - print $formfile->showdocuments('gmaps:Gmaps_place', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang); + $genallowed = $user->rights->gmaps->gmapsPlace->read; // If you can read, you can build the PDF to read content + $delallowed = $user->rights->gmaps->gmapsPlace->write; // If you can create/edit, you can remove a file on card + print $formfile->showdocuments('gmaps:GmapsPlace', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang); } // Show links to link elements - $linktoelem = $form->showLinkToObjectBlock($object, null, array('gmaps_place')); + $linktoelem = $form->showLinkToObjectBlock($object, null, array('gmapsPlace')); $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); @@ -563,7 +563,7 @@ function init_myfunc() $MAXEVENT = 10; - $morehtmlright = ''; + $morehtmlright = ''; $morehtmlright .= $langs->trans("SeeAll"); $morehtmlright .= ''; @@ -579,10 +579,10 @@ function init_myfunc() if (GETPOST('modelselected')) $action = 'presend'; // Presend form - $modelmail = 'gmaps_place'; + $modelmail = 'gmapsPlace'; $defaulttopic = 'InformationMessage'; $diroutput = $conf->gmaps->dir_output; - $trackid = 'gmaps_place'.$object->id; + $trackid = 'gmapsPlace'.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; } diff --git a/gmaps_place_document.php b/gmaps_place_document.php index 7cbd99e..105adbb 100755 --- a/gmaps_place_document.php +++ b/gmaps_place_document.php @@ -17,9 +17,9 @@ */ /** - * \file gmaps_place_document.php + * \file gmapsPlace_document.php * \ingroup gmaps - * \brief Tab for documents linked to Gmaps_place + * \brief Tab for documents linked to GmapsPlace */ //if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db @@ -62,8 +62,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -dol_include_once('/gmaps/class/gmaps_place.class.php'); -dol_include_once('/gmaps/lib/gmaps_gmaps_place.lib.php'); +dol_include_once('/gmaps/class/gmapsplace.class.php'); +dol_include_once('/gmaps/lib/gmaps_gmapsPlace.lib.php'); // Load translation files required by the page $langs->loadLangs(array("gmaps@gmaps", "companies", "other", "mails")); @@ -88,25 +88,25 @@ //if (! $sortfield) $sortfield="position_name"; // Initialize technical objects -$object = new Gmaps_place($db); +$object = new GmapsPlace($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->gmaps->dir_output.'/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('gmaps_placedocument', 'globalcard')); // Note that conf->hooks_modules contains array +$hookmanager->initHooks(array('gmapsPlacedocument', 'globalcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals -//if ($id > 0 || ! empty($ref)) $upload_dir = $conf->gmaps->multidir_output[$object->entity?$object->entity:$conf->entity] . "/gmaps_place/" . dol_sanitizeFileName($object->id); -if ($id > 0 || !empty($ref)) $upload_dir = $conf->gmaps->multidir_output[$object->entity ? $object->entity : $conf->entity]."/gmaps_place/".dol_sanitizeFileName($object->ref); +//if ($id > 0 || ! empty($ref)) $upload_dir = $conf->gmaps->multidir_output[$object->entity?$object->entity:$conf->entity] . "/gmapsPlace/" . dol_sanitizeFileName($object->id); +if ($id > 0 || !empty($ref)) $upload_dir = $conf->gmaps->multidir_output[$object->entity ? $object->entity : $conf->entity]."/gmapsPlace/".dol_sanitizeFileName($object->ref); // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) $socid = $user->socid; //$result = restrictedArea($user, 'gmaps', $object->id); -$permissiontoadd = $user->rights->gmaps->gmaps_place->write; // Used by the include of actions_addupdatedelete.inc.php +$permissiontoadd = $user->rights->gmaps->gmapsPlace->write; // Used by the include of actions_addupdatedelete.inc.php @@ -123,7 +123,7 @@ $form = new Form($db); -$title = $langs->trans("Gmaps_place").' - '.$langs->trans("Files"); +$title = $langs->trans("GmapsPlace").' - '.$langs->trans("Files"); $help_url = ''; //$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; llxHeader('', $title, $help_url); @@ -133,9 +133,9 @@ /* * Show tabs */ - $head = gmaps_placePrepareHead($object); + $head = gmapsPlacePrepareHead($object); - print dol_get_fiche_head($head, 'document', $langs->trans("Gmaps_place"), -1, $object->picto); + print dol_get_fiche_head($head, 'document', $langs->trans("GmapsPlace"), -1, $object->picto); // Build file list @@ -148,7 +148,7 @@ // Object card // ------------------------------------------------------------ - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; /* @@ -210,14 +210,14 @@ print dol_get_fiche_end(); $modulepart = 'gmaps'; - //$permission = $user->rights->gmaps->gmaps_place->write; + //$permission = $user->rights->gmaps->gmapsPlace->write; $permission = 1; - //$permtoedit = $user->rights->gmaps->gmaps_place->write; + //$permtoedit = $user->rights->gmaps->gmapsPlace->write; $permtoedit = 1; $param = '&id='.$object->id; - //$relativepathwithnofile='gmaps_place/' . dol_sanitizeFileName($object->id).'/'; - $relativepathwithnofile = 'gmaps_place/'.dol_sanitizeFileName($object->ref).'/'; + //$relativepathwithnofile='gmapsPlace/' . dol_sanitizeFileName($object->id).'/'; + $relativepathwithnofile = 'gmapsPlace/'.dol_sanitizeFileName($object->ref).'/'; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { diff --git a/gmaps_place_list.php b/gmaps_place_list.php index 7a7c897..401f955 100755 --- a/gmaps_place_list.php +++ b/gmaps_place_list.php @@ -17,9 +17,9 @@ */ /** - * \file gmaps_place_list.php + * \file gmapsPlace_list.php * \ingroup gmaps - * \brief List page for gmaps_place + * \brief List page for gmapsPlace */ //if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db @@ -63,7 +63,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; // load gmaps libraries -require_once __DIR__.'/class/gmaps_place.class.php'; +require_once __DIR__.'/class/gmapsplace.class.php'; // for other modules //dol_include_once('/othermodule/class/otherobject.class.php'); @@ -77,7 +77,7 @@ $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list -$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'gmaps_placelist'; // To manage different context of search +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'gmapsPlacelist'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') @@ -94,10 +94,10 @@ $pagenext = $page + 1; // Initialize technical objects -$object = new Gmaps_place($db); +$object = new GmapsPlace($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->gmaps->dir_output.'/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('gmaps_placelist')); // Note that conf->hooks_modules contains array +$hookmanager->initHooks(array('gmapsPlacelist')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); @@ -160,9 +160,9 @@ $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); -$permissiontoread = $user->rights->gmaps->gmaps_place->read; -$permissiontoadd = $user->rights->gmaps->gmaps_place->write; -$permissiontodelete = $user->rights->gmaps->gmaps_place->delete; +$permissiontoread = $user->rights->gmaps->gmapsPlace->read; +$permissiontoadd = $user->rights->gmaps->gmapsPlace->write; +$permissiontodelete = $user->rights->gmaps->gmapsPlace->delete; // Security check if (empty($conf->gmaps->enabled)) accessforbidden('Module not enabled'); @@ -210,8 +210,8 @@ } // Mass actions - $objectclass = 'Gmaps_place'; - $objectlabel = 'Gmaps_place'; + $objectclass = 'GmapsPlace'; + $objectlabel = 'GmapsPlace'; $uploaddir = $conf->gmaps->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -226,9 +226,9 @@ $now = dol_now(); -//$help_url="EN:Module_Gmaps_place|FR:Module_Gmaps_place_FR|ES:Módulo_Gmaps_place"; +//$help_url="EN:Module_GmapsPlace|FR:Module_GmapsPlace_FR|ES:Módulo_GmapsPlace"; $help_url = ''; -$title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("Gmaps_places")); +$title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("GmapsPlaces")); // Build and execute select @@ -327,7 +327,7 @@ { $obj = $db->fetch_object($resql); $id = $obj->rowid; - header("Location: ".dol_buildpath('/gmaps/gmaps_place_card.php', 1).'?id='.$id); + header("Location: ".dol_buildpath('/gmaps/gmapsPlace_card.php', 1).'?id='.$id); exit; } @@ -390,14 +390,14 @@ function init_myfunc() print ''; print ''; -$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/gmaps/gmaps_place_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); +$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/gmaps/gmapsPlace_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); // Add code for pre mass action (confirmation or email presend form) -$topicmail = "SendGmaps_placeRef"; -$modelmail = "gmaps_place"; -$objecttmp = new Gmaps_place($db); +$topicmail = "SendGmapsPlaceRef"; +$modelmail = "gmapsPlace"; +$objecttmp = new GmapsPlace($db); $trackid = 'xxxx'.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; diff --git a/gmaps_place_note.php b/gmaps_place_note.php index 0f88753..1fd5cdf 100755 --- a/gmaps_place_note.php +++ b/gmaps_place_note.php @@ -17,9 +17,9 @@ */ /** - * \file gmaps_place_note.php + * \file gmapsPlace_note.php * \ingroup gmaps - * \brief Tab for notes on Gmaps_place + * \brief Tab for notes on GmapsPlace */ //if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db @@ -58,8 +58,8 @@ if (!$res && file_exists("../../../main.inc.php")) $res = @include "../../../main.inc.php"; if (!$res) die("Include of main fails"); -dol_include_once('/gmaps/class/gmaps_place.class.php'); -dol_include_once('/gmaps/lib/gmaps_gmaps_place.lib.php'); +dol_include_once('/gmaps/class/gmapsplace.class.php'); +dol_include_once('/gmaps/lib/gmaps_gmapsPlace.lib.php'); // Load translation files required by the page $langs->loadLangs(array("gmaps@gmaps", "companies")); @@ -72,10 +72,10 @@ $backtopage = GETPOST('backtopage', 'alpha'); // Initialize technical objects -$object = new Gmaps_place($db); +$object = new GmapsPlace($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->gmaps->dir_output.'/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('gmaps_placenote', 'globalcard')); // Note that conf->hooks_modules contains array +$hookmanager->initHooks(array('gmapsPlacenote', 'globalcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); @@ -88,8 +88,8 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) $upload_dir = $conf->gmaps->multidir_output[$object->entity]."/".$object->id; -$permissionnote = $user->rights->gmaps->gmaps_place->write; // Used by the include of actions_setnotes.inc.php -$permissiontoadd = $user->rights->gmaps->gmaps_place->write; // Used by the include of actions_addupdatedelete.inc.php +$permissionnote = $user->rights->gmaps->gmapsPlace->write; // Used by the include of actions_setnotes.inc.php +$permissiontoadd = $user->rights->gmaps->gmapsPlace->write; // Used by the include of actions_addupdatedelete.inc.php @@ -108,19 +108,19 @@ //$help_url='EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes'; $help_url = ''; -llxHeader('', $langs->trans('Gmaps_place'), $help_url); +llxHeader('', $langs->trans('GmapsPlace'), $help_url); if ($id > 0 || !empty($ref)) { $object->fetch_thirdparty(); - $head = gmaps_placePrepareHead($object); + $head = gmapsPlacePrepareHead($object); - print dol_get_fiche_head($head, 'note', $langs->trans("Gmaps_place"), -1, $object->picto); + print dol_get_fiche_head($head, 'note', $langs->trans("GmapsPlace"), -1, $object->picto); // Object card // ------------------------------------------------------------ - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; /* diff --git a/gmaps_prepare_ndf.php b/gmaps_prepare_ndf.php index d6a6740..c21f429 100755 --- a/gmaps_prepare_ndf.php +++ b/gmaps_prepare_ndf.php @@ -46,8 +46,8 @@ if (!$res) die("Include of main fails"); require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; -require_once __DIR__ . '/class/gmaps_activity.class.php'; -$object = new Gmaps_activity($db); +require_once __DIR__ . '/class/gmapsactivity.class.php'; +$object = new GmapsActivity($db); $form = new Form($db); // Load translation files required by the page @@ -166,8 +166,8 @@ $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = ga.fk_soc"; $sql .= " WHERE ga.duration_start >= '" . $db->idate($date_start) . "'"; $sql .= " AND ga.duration_start <= '" . $db->idate($date_end) . "'"; -//$sql .= " AND ga.entity IN (".getEntity('gmaps_activity', 0).")"; // We don't share object for accountancy -$sql .= " AND ga.status =" . Gmaps_activity::STATUS_VALIDATED; +//$sql .= " AND ga.entity IN (".getEntity('gmapsActivity', 0).")"; // We don't share object for accountancy +$sql .= " AND ga.status =" . GmapsActivity::STATUS_VALIDATED; $sql .= " GROUP BY s.nom, DATE(ga.duration_start)"; $sql .= " ORDER BY s.nom, DATE(ga.duration_start)"; diff --git a/gmapsindex.php b/gmapsindex.php index 52cac93..e3d52b0 100755 --- a/gmapsindex.php +++ b/gmapsindex.php @@ -47,7 +47,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; -dol_include_once('/gmaps/class/gmaps_import.class.php'); +dol_include_once('/gmaps/class/gmapsimport.class.php'); // Load translation files required by the page $langs->loadLangs(array("gmaps@gmaps")); @@ -85,7 +85,7 @@ if ($action=='editfile') { $action=''; - $import = new Gmaps_import($db); + $import = new gmapsImport($db); $result = $import->importFile($upload_dir.'/'.GETPOST("urlfile"), $user); if ($result < 0) { setEventMessages($import->error,$import->errors,'errors'); diff --git a/langs/fr_FR/gmaps.lang b/langs/fr_FR/gmaps.lang index dd0f5bd..791b43f 100755 --- a/langs/fr_FR/gmaps.lang +++ b/langs/fr_FR/gmaps.lang @@ -55,12 +55,13 @@ List_Gmaps_activity = Liste des déplacement Alayse_KM=Analyse KM GmapsPrepareNDF= Générer les note de frais List_Gmaps_import=Import fichier Gmaps +GmapsActivity=Activité Gmaps # # Page # -Gmaps_activitys = Liste des déplacement +GmapsActivitys = Liste des déplacement GmapsAreaKM = Analyse KM GmapsAreaTemps = Analyse Temps (min.) GmapsArea = Traitement fichier GMaps @@ -73,5 +74,3 @@ LatitudeEnd = Latitude arrivé LongitudeStart = Longitude départ DurationStart = Heure de début DurationEnd = Heure de fin - - diff --git a/lib/gmaps_gmaps_activity.lib.php b/lib/gmaps_gmapsactivity.lib.php similarity index 87% rename from lib/gmaps_gmaps_activity.lib.php rename to lib/gmaps_gmapsactivity.lib.php index 61ba58c..441b34d 100755 --- a/lib/gmaps_gmaps_activity.lib.php +++ b/lib/gmaps_gmapsactivity.lib.php @@ -16,18 +16,18 @@ */ /** - * \file lib/gmaps_gmaps_activity.lib.php + * \file lib/gmaps_gmapsactivity.lib.php * \ingroup gmaps - * \brief Library files with common functions for Gmaps_activity + * \brief Library files with common functions for GmapsActivity */ /** - * Prepare array of tabs for Gmaps_activity + * Prepare array of tabs for GmapsActivity * - * @param Gmaps_activity $object Gmaps_activity + * @param GmapsActivity $object GmapsActivity * @return array Array of tabs */ -function gmaps_activityPrepareHead($object) +function gmapsActivityPrepareHead($object) { global $db, $langs, $conf; @@ -55,7 +55,7 @@ function gmaps_activityPrepareHead($object) require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; - $upload_dir = $conf->gmaps->dir_output."/gmaps_activity/".dol_sanitizeFileName($object->ref); + $upload_dir = $conf->gmaps->dir_output."/gmapsactivity/".dol_sanitizeFileName($object->ref); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks = Link::count($db, $object->element, $object->id); $head[$h][0] = dol_buildpath("/gmaps/gmaps_activity_document.php", 1).'?id='.$object->id; @@ -77,9 +77,9 @@ function gmaps_activityPrepareHead($object) //$this->tabs = array( // 'entity:-tabname:Title:@gmaps:/gmaps/mypage.php?id=__ID__' //); // to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'gmaps_activity@gmaps'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'gmapsactivity@gmaps'); - complete_head_from_modules($conf, $langs, $object, $head, $h, 'gmaps_activity@gmaps', 'remove'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'gmapsactivity@gmaps', 'remove'); return $head; } diff --git a/lib/gmaps_gmaps_import.lib.php b/lib/gmaps_gmapsimport.lib.php similarity index 100% rename from lib/gmaps_gmaps_import.lib.php rename to lib/gmaps_gmapsimport.lib.php diff --git a/lib/gmaps_gmaps_place.lib.php b/lib/gmaps_gmapsplace.lib.php similarity index 78% rename from lib/gmaps_gmaps_place.lib.php rename to lib/gmaps_gmapsplace.lib.php index e7539c8..91a3a9e 100755 --- a/lib/gmaps_gmaps_place.lib.php +++ b/lib/gmaps_gmapsplace.lib.php @@ -16,18 +16,18 @@ */ /** - * \file lib/gmaps_gmaps_place.lib.php + * \file lib/gmaps_gmapsPlace.lib.php * \ingroup gmaps - * \brief Library files with common functions for Gmaps_place + * \brief Library files with common functions for GmapsPlace */ /** - * Prepare array of tabs for Gmaps_place + * Prepare array of tabs for GmapsPlace * - * @param Gmaps_place $object Gmaps_place + * @param GmapsPlace $object GmapsPlace * @return array Array of tabs */ -function gmaps_placePrepareHead($object) +function gmapsPlacePrepareHead($object) { global $db, $langs, $conf; @@ -36,7 +36,7 @@ function gmaps_placePrepareHead($object) $h = 0; $head = array(); - $head[$h][0] = dol_buildpath("/gmaps/gmaps_place_card.php", 1).'?id='.$object->id; + $head[$h][0] = dol_buildpath("/gmaps/gmapsPlace_card.php", 1).'?id='.$object->id; $head[$h][1] = $langs->trans("Card"); $head[$h][2] = 'card'; $h++; @@ -46,7 +46,7 @@ function gmaps_placePrepareHead($object) $nbNote = 0; if (!empty($object->note_private)) $nbNote++; if (!empty($object->note_public)) $nbNote++; - $head[$h][0] = dol_buildpath('/gmaps/gmaps_place_note.php', 1).'?id='.$object->id; + $head[$h][0] = dol_buildpath('/gmaps/gmapsPlace_note.php', 1).'?id='.$object->id; $head[$h][1] = $langs->trans('Notes'); if ($nbNote > 0) $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ''.$nbNote.'' : ''); $head[$h][2] = 'note'; @@ -55,16 +55,16 @@ function gmaps_placePrepareHead($object) require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; - $upload_dir = $conf->gmaps->dir_output."/gmaps_place/".dol_sanitizeFileName($object->ref); + $upload_dir = $conf->gmaps->dir_output."/gmapsPlace/".dol_sanitizeFileName($object->ref); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks = Link::count($db, $object->element, $object->id); - $head[$h][0] = dol_buildpath("/gmaps/gmaps_place_document.php", 1).'?id='.$object->id; + $head[$h][0] = dol_buildpath("/gmaps/gmapsPlace_document.php", 1).'?id='.$object->id; $head[$h][1] = $langs->trans('Documents'); if (($nbFiles + $nbLinks) > 0) $head[$h][1] .= ''.($nbFiles + $nbLinks).''; $head[$h][2] = 'document'; $h++; - $head[$h][0] = dol_buildpath("/gmaps/gmaps_place_agenda.php", 1).'?id='.$object->id; + $head[$h][0] = dol_buildpath("/gmaps/gmapsPlace_agenda.php", 1).'?id='.$object->id; $head[$h][1] = $langs->trans("Events"); $head[$h][2] = 'agenda'; $h++; @@ -77,9 +77,9 @@ function gmaps_placePrepareHead($object) //$this->tabs = array( // 'entity:-tabname:Title:@gmaps:/gmaps/mypage.php?id=__ID__' //); // to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'gmaps_place@gmaps'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'gmapsPlace@gmaps'); - complete_head_from_modules($conf, $langs, $object, $head, $h, 'gmaps_place@gmaps', 'remove'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'gmapsPlace@gmaps', 'remove'); return $head; } diff --git a/sql/llx_gmaps_gmaps_activity.key.sql b/sql/llx_gmaps_gmaps_activity.key.sql deleted file mode 100755 index b01fc63..0000000 --- a/sql/llx_gmaps_gmaps_activity.key.sql +++ /dev/null @@ -1,29 +0,0 @@ --- Copyright (C) ---Put here your own copyright and developer email--- --- --- This program is free software: you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation, either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program. If not, see https://www.gnu.org/licenses/. - - --- BEGIN MODULEBUILDER INDEXES -ALTER TABLE llx_gmaps_gmaps_activity ADD INDEX idx_gmaps_gmaps_activity_rowid (rowid); -ALTER TABLE llx_gmaps_gmaps_activity ADD INDEX idx_gmaps_gmaps_activity_ref (ref); -ALTER TABLE llx_gmaps_gmaps_activity ADD INDEX idx_gmaps_gmaps_activity_fk_soc (fk_soc); -ALTER TABLE llx_gmaps_gmaps_activity ADD INDEX idx_gmaps_gmaps_activity_fk_project (fk_project); -ALTER TABLE llx_gmaps_gmaps_activity ADD CONSTRAINT llx_gmaps_gmaps_activity_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid); -ALTER TABLE llx_gmaps_gmaps_activity ADD INDEX idx_gmaps_gmaps_activity_status (status); --- END MODULEBUILDER INDEXES - ---ALTER TABLE llx_gmaps_gmaps_activity ADD UNIQUE INDEX uk_gmaps_gmaps_activity_fieldxy(fieldx, fieldy); - ---ALTER TABLE llx_gmaps_gmaps_activity ADD CONSTRAINT llx_gmaps_gmaps_activity_fk_field FOREIGN KEY (fk_field) REFERENCES llx_gmaps_myotherobject(rowid); - diff --git a/sql/llx_gmaps_gmaps_place.key.sql b/sql/llx_gmaps_gmaps_place.key.sql deleted file mode 100755 index 3723927..0000000 --- a/sql/llx_gmaps_gmaps_place.key.sql +++ /dev/null @@ -1,30 +0,0 @@ --- Copyright (C) ---Put here your own copyright and developer email--- --- --- This program is free software: you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation, either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program. If not, see https://www.gnu.org/licenses/. - - --- BEGIN MODULEBUILDER INDEXES -ALTER TABLE llx_gmaps_gmaps_place ADD INDEX idx_gmaps_gmaps_place_rowid (rowid); -ALTER TABLE llx_gmaps_gmaps_place ADD INDEX idx_gmaps_gmaps_place_ref (ref); -ALTER TABLE llx_gmaps_gmaps_place ADD INDEX idx_gmaps_gmaps_place_fk_soc (fk_soc); -ALTER TABLE llx_gmaps_gmaps_place ADD INDEX idx_gmaps_gmaps_place_fk_project (fk_project); -ALTER TABLE llx_gmaps_gmaps_place ADD CONSTRAINT llx_gmaps_gmaps_place_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid); -ALTER TABLE llx_gmaps_gmaps_place ADD INDEX idx_gmaps_gmaps_place_status (status); -ALTER TABLE llx_gmaps_gmaps_place ADD INDEX idx_gmaps_gmaps_place_fk_gmaps_activity (fk_gmaps_activity); --- END MODULEBUILDER INDEXES - ---ALTER TABLE llx_gmaps_gmaps_place ADD UNIQUE INDEX uk_gmaps_gmaps_place_fieldxy(fieldx, fieldy); - ---ALTER TABLE llx_gmaps_gmaps_place ADD CONSTRAINT llx_gmaps_gmaps_place_fk_field FOREIGN KEY (fk_field) REFERENCES llx_gmaps_myotherobject(rowid); - diff --git a/sql/llx_gmaps_gmaps_import.key.sql b/sql/llx_gmaps_gmapsactivity.key.sql similarity index 54% rename from sql/llx_gmaps_gmaps_import.key.sql rename to sql/llx_gmaps_gmapsactivity.key.sql index 0267d3f..9cb16d2 100755 --- a/sql/llx_gmaps_gmaps_import.key.sql +++ b/sql/llx_gmaps_gmapsactivity.key.sql @@ -15,13 +15,10 @@ -- BEGIN MODULEBUILDER INDEXES -ALTER TABLE llx_gmaps_gmaps_import ADD INDEX idx_gmaps_gmaps_import_rowid (rowid); -ALTER TABLE llx_gmaps_gmaps_import ADD INDEX idx_gmaps_gmaps_import_ref (ref); -ALTER TABLE llx_gmaps_gmaps_import ADD CONSTRAINT llx_gmaps_gmaps_import_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid); -ALTER TABLE llx_gmaps_gmaps_import ADD INDEX idx_gmaps_gmaps_import_status (status); +ALTER TABLE llx_gmaps_gmapsactivity ADD INDEX idx_gmaps_gmapsactivity_rowid (rowid); +ALTER TABLE llx_gmaps_gmapsactivity ADD INDEX idx_gmaps_gmapsactivity_ref (ref); +ALTER TABLE llx_gmaps_gmapsactivity ADD INDEX idx_gmaps_gmapsactivity_fk_soc (fk_soc); +ALTER TABLE llx_gmaps_gmapsactivity ADD INDEX idx_gmaps_gmapsactivity_fk_project (fk_project); +ALTER TABLE llx_gmaps_gmapsactivity ADD CONSTRAINT llx_gmaps_gmapsactivity_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid); +ALTER TABLE llx_gmaps_gmapsactivity ADD INDEX idx_gmaps_gmapsactivity_status (status); -- END MODULEBUILDER INDEXES - ---ALTER TABLE llx_gmaps_gmaps_import ADD UNIQUE INDEX uk_gmaps_gmaps_import_fieldxy(fieldx, fieldy); - ---ALTER TABLE llx_gmaps_gmaps_import ADD CONSTRAINT llx_gmaps_gmaps_import_fk_field FOREIGN KEY (fk_field) REFERENCES llx_gmaps_myotherobject(rowid); - diff --git a/sql/llx_gmaps_gmaps_activity.sql b/sql/llx_gmaps_gmapsactivity.sql similarity index 97% rename from sql/llx_gmaps_gmaps_activity.sql rename to sql/llx_gmaps_gmapsactivity.sql index f82d035..3059390 100755 --- a/sql/llx_gmaps_gmaps_activity.sql +++ b/sql/llx_gmaps_gmapsactivity.sql @@ -14,7 +14,7 @@ -- along with this program. If not, see https://www.gnu.org/licenses/. -CREATE TABLE llx_gmaps_gmaps_activity( +CREATE TABLE llx_gmaps_gmapsactivity( -- BEGIN MODULEBUILDER FIELDS rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, ref varchar(128) NOT NULL, diff --git a/sql/llx_gmaps_gmaps_activity_extrafields.key.sql b/sql/llx_gmaps_gmapsactivity_extrafields.key.sql similarity index 88% rename from sql/llx_gmaps_gmaps_activity_extrafields.key.sql rename to sql/llx_gmaps_gmapsactivity_extrafields.key.sql index 45f727c..a9e1361 100755 --- a/sql/llx_gmaps_gmaps_activity_extrafields.key.sql +++ b/sql/llx_gmaps_gmapsactivity_extrafields.key.sql @@ -15,5 +15,5 @@ -- BEGIN MODULEBUILDER INDEXES -ALTER TABLE llx_gmaps_gmaps_activity_extrafields ADD INDEX idx_gmaps_activity_fk_object(fk_object); +ALTER TABLE llx_gmaps_gmapsactivity_extrafields ADD INDEX idx_gmapsactivity_fk_object(fk_object); -- END MODULEBUILDER INDEXES diff --git a/sql/llx_gmaps_gmaps_import_extrafields.sql b/sql/llx_gmaps_gmapsactivity_extrafields.sql similarity index 95% rename from sql/llx_gmaps_gmaps_import_extrafields.sql rename to sql/llx_gmaps_gmapsactivity_extrafields.sql index 3cfe7db..78abd75 100755 --- a/sql/llx_gmaps_gmaps_import_extrafields.sql +++ b/sql/llx_gmaps_gmapsactivity_extrafields.sql @@ -13,11 +13,10 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see https://www.gnu.org/licenses/. -create table llx_gmaps_gmaps_import_extrafields +create table llx_gmaps_gmapsactivity_extrafields ( rowid integer AUTO_INCREMENT PRIMARY KEY, tms timestamp, fk_object integer NOT NULL, import_key varchar(14) -- import key ) ENGINE=innodb; - diff --git a/sql/llx_gmaps_gmapsimport.key.sql b/sql/llx_gmaps_gmapsimport.key.sql new file mode 100755 index 0000000..8079ff7 --- /dev/null +++ b/sql/llx_gmaps_gmapsimport.key.sql @@ -0,0 +1,22 @@ +-- Copyright (C) ---Put here your own copyright and developer email--- +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see https://www.gnu.org/licenses/. + + +-- BEGIN MODULEBUILDER INDEXES +ALTER TABLE llx_gmaps_gmapsimport ADD INDEX idx_gmaps_gmapsimport_rowid (rowid); +ALTER TABLE llx_gmaps_gmapsimport ADD INDEX idx_gmaps_gmapsimport_ref (ref); +ALTER TABLE llx_gmaps_gmapsimport ADD CONSTRAINT llx_gmaps_gmapsimport_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid); +ALTER TABLE llx_gmaps_gmapsimport ADD INDEX idx_gmaps_gmapsimport_status (status); +-- END MODULEBUILDER INDEXES diff --git a/sql/llx_gmaps_gmaps_import.sql b/sql/llx_gmaps_gmapsimport.sql similarity index 96% rename from sql/llx_gmaps_gmaps_import.sql rename to sql/llx_gmaps_gmapsimport.sql index 486829c..5e4c7ad 100755 --- a/sql/llx_gmaps_gmaps_import.sql +++ b/sql/llx_gmaps_gmapsimport.sql @@ -14,7 +14,7 @@ -- along with this program. If not, see https://www.gnu.org/licenses/. -CREATE TABLE llx_gmaps_gmaps_import( +CREATE TABLE llx_gmaps_gmapsimport( -- BEGIN MODULEBUILDER FIELDS rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, ref varchar(128) NOT NULL, diff --git a/sql/llx_gmaps_gmaps_place_extrafields.key.sql b/sql/llx_gmaps_gmapsimport_extrafields.key.sql similarity index 89% rename from sql/llx_gmaps_gmaps_place_extrafields.key.sql rename to sql/llx_gmaps_gmapsimport_extrafields.key.sql index e6b9a52..51a9903 100755 --- a/sql/llx_gmaps_gmaps_place_extrafields.key.sql +++ b/sql/llx_gmaps_gmapsimport_extrafields.key.sql @@ -15,5 +15,5 @@ -- BEGIN MODULEBUILDER INDEXES -ALTER TABLE llx_gmaps_gmaps_place_extrafields ADD INDEX idx_gmaps_place_fk_object(fk_object); +ALTER TABLE llx_gmaps_gmapsimport_extrafields ADD INDEX idx_gmapsimport_fk_object(fk_object); -- END MODULEBUILDER INDEXES diff --git a/sql/llx_gmaps_gmaps_place_extrafields.sql b/sql/llx_gmaps_gmapsimport_extrafields.sql similarity index 95% rename from sql/llx_gmaps_gmaps_place_extrafields.sql rename to sql/llx_gmaps_gmapsimport_extrafields.sql index ca500f6..6315412 100755 --- a/sql/llx_gmaps_gmaps_place_extrafields.sql +++ b/sql/llx_gmaps_gmapsimport_extrafields.sql @@ -13,11 +13,10 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see https://www.gnu.org/licenses/. -create table llx_gmaps_gmaps_place_extrafields +create table llx_gmaps_gmapsimport_extrafields ( rowid integer AUTO_INCREMENT PRIMARY KEY, tms timestamp, fk_object integer NOT NULL, import_key varchar(14) -- import key ) ENGINE=innodb; - diff --git a/sql/llx_gmaps_gmapsplace.key.sql b/sql/llx_gmaps_gmapsplace.key.sql new file mode 100755 index 0000000..7c02ed1 --- /dev/null +++ b/sql/llx_gmaps_gmapsplace.key.sql @@ -0,0 +1,25 @@ +-- Copyright (C) ---Put here your own copyright and developer email--- +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see https://www.gnu.org/licenses/. + + +-- BEGIN MODULEBUILDER INDEXES +ALTER TABLE llx_gmaps_gmapsplace ADD INDEX idx_gmaps_gmapsplace_rowid (rowid); +ALTER TABLE llx_gmaps_gmapsplace ADD INDEX idx_gmaps_gmapsplace_ref (ref); +ALTER TABLE llx_gmaps_gmapsplace ADD INDEX idx_gmaps_gmapsplace_fk_soc (fk_soc); +ALTER TABLE llx_gmaps_gmapsplace ADD INDEX idx_gmaps_gmapsplace_fk_project (fk_project); +ALTER TABLE llx_gmaps_gmapsplace ADD CONSTRAINT llx_gmaps_gmapsplace_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid); +ALTER TABLE llx_gmaps_gmapsplace ADD INDEX idx_gmaps_gmapsplace_status (status); +ALTER TABLE llx_gmaps_gmapsplace ADD INDEX idx_gmaps_gmapsplace_fk_gmapsActivity (fk_gmapsactivity); +-- END MODULEBUILDER INDEXES diff --git a/sql/llx_gmaps_gmaps_place.sql b/sql/llx_gmaps_gmapsplace.sql similarity index 94% rename from sql/llx_gmaps_gmaps_place.sql rename to sql/llx_gmaps_gmapsplace.sql index cd052e7..d9463a9 100755 --- a/sql/llx_gmaps_gmaps_place.sql +++ b/sql/llx_gmaps_gmapsplace.sql @@ -14,7 +14,7 @@ -- along with this program. If not, see https://www.gnu.org/licenses/. -CREATE TABLE llx_gmaps_gmaps_place( +CREATE TABLE llx_gmaps_gmapsplace( -- BEGIN MODULEBUILDER FIELDS rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, ref varchar(128), @@ -29,7 +29,7 @@ CREATE TABLE llx_gmaps_gmaps_place( fk_user_modif integer, import_key varchar(14), status smallint NOT NULL, - fk_gmaps_activity integer NOT NULL, + fk_gmapsactivity integer NOT NULL, location_placeid varchar(50), location_address_raw varchar(200), location_name varchar(200), diff --git a/sql/llx_gmaps_gmaps_import_extrafields.key.sql b/sql/llx_gmaps_gmapsplace_extrafields.key.sql similarity index 89% rename from sql/llx_gmaps_gmaps_import_extrafields.key.sql rename to sql/llx_gmaps_gmapsplace_extrafields.key.sql index 6f452f2..6021f49 100755 --- a/sql/llx_gmaps_gmaps_import_extrafields.key.sql +++ b/sql/llx_gmaps_gmapsplace_extrafields.key.sql @@ -15,5 +15,5 @@ -- BEGIN MODULEBUILDER INDEXES -ALTER TABLE llx_gmaps_gmaps_import_extrafields ADD INDEX idx_gmaps_import_fk_object(fk_object); +ALTER TABLE llx_gmaps_gmapsplace_extrafields ADD INDEX idx_gmapsplace_fk_object(fk_object); -- END MODULEBUILDER INDEXES diff --git a/sql/llx_gmaps_gmaps_activity_extrafields.sql b/sql/llx_gmaps_gmapsplace_extrafields.sql similarity index 94% rename from sql/llx_gmaps_gmaps_activity_extrafields.sql rename to sql/llx_gmaps_gmapsplace_extrafields.sql index 4ac291f..a26f254 100755 --- a/sql/llx_gmaps_gmaps_activity_extrafields.sql +++ b/sql/llx_gmaps_gmapsplace_extrafields.sql @@ -13,11 +13,10 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see https://www.gnu.org/licenses/. -create table llx_gmaps_gmaps_activity_extrafields +create table llx_gmaps_gmapsplace_extrafields ( rowid integer AUTO_INCREMENT PRIMARY KEY, tms timestamp, fk_object integer NOT NULL, import_key varchar(14) -- import key ) ENGINE=innodb; -